Skip to content

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

feat(learning): persist cross-surface Focus-Check in Question Bank

Gao-Chenkai3eb831d10888
diff --git a/deeptutor/api/routers/book.py b/deeptutor/api/routers/book.py
index 09ac94264..d2d1a79a0 100644
--- a/deeptutor/api/routers/book.py
+++ b/deeptutor/api/routers/book.py
@@ -1119,29 +1119,33 @@ async def quiz_attempt(req: QuizAttemptRequest) -> dict[str, Any]:
# has no conversation yet, progress still persists and the optional
# review sync waits for a later attempt after chat exists.
if session_id and await store.get_session(session_id) is not None:
- await store.upsert_notebook_entries(
- session_id,
- [
- {
- "turn_id": req.block_id,
- "question_id": question_id,
- "question": str(
- question.get("question") or block.title or "Focus check"
- ),
- "question_type": str(question.get("question_type") or ""),
- "options": question.get("options") or {},
- "correct_answer": str(question.get("correct_answer") or ""),
- "explanation": str(question.get("explanation") or ""),
- "difficulty": str(question.get("difficulty") or ""),
- "user_answer": req.user_answer,
- "is_correct": bool(req.is_correct),
- "source": "book",
- "material_id": req.book_id,
- "material_title": book.title,
- "section_id": req.page_id,
- "section_title": page.title if page is not None else "",
- }
- ],
+ from deeptutor.learning.assessment import (
+ AssessmentRecord,
+ is_correct_to_result,
+ record_assessment,
+ )
+
+ await record_assessment(
+ AssessmentRecord(
+ session_id=session_id,
+ turn_id=req.block_id,
+ question_id=question_id,
+ question=str(question.get("question") or block.title or "Focus check"),
+ question_type=str(question.get("question_type") or ""),
+ options=question.get("options") or {},
+ correct_answer=str(question.get("correct_answer") or ""),
+ explanation=str(question.get("explanation") or ""),
+ difficulty=str(question.get("difficulty") or ""),
+ user_answer=req.user_answer,
+ is_correct=bool(req.is_correct),
+ result=is_correct_to_result(bool(req.is_correct)),
+ source="book",
+ assessment_type="focus_check",
+ material_id=req.book_id,
+ material_title=book.title,
+ section_id=req.page_id,
+ section_title=page.title if page is not None else "",
+ )
)
except Exception:
logger.warning(
diff --git a/deeptutor/api/routers/question_notebook.py b/deeptutor/api/routers/question_notebook.py
index 7751ba324..db03675e3 100644
--- a/deeptutor/api/routers/question_notebook.py
+++ b/deeptutor/api/routers/question_notebook.py
@@ -20,6 +20,8 @@ logger = logging.getLogger(__name__)
router = APIRouter()
AssessmentSource = Literal["deep_question", "mastery_path", "immersive_reading", "book"]
ScoreTrend = Literal["new", "improved", "declined", "unchanged"]
+AssessmentType = Literal["quiz", "focus_check", "qualitative", "review"]
+AssessmentResult = Literal["correct", "incorrect", "partial", "ungraded"]
# ── Models ────────────────────────────────────────────────────────
@@ -65,6 +67,15 @@ class NotebookEntryItem(BaseModel):
section_id: str = ""
section_title: str = ""
score_trend: ScoreTrend = "new"
+ assessment_type: str = ""
+ result: AssessmentResult | str = ""
+ mastery_path_id: str = ""
+ knowledge_point_id: str = ""
+ attempt_count: int = 1
+ hints_used: int = 0
+ confidence: float | None = None
+ response_time: float | None = None
+ quality: float | None = None
is_correct: bool = False
resolved: bool = False
bookmarked: bool = False
@@ -164,6 +175,15 @@ class UpsertEntryRequest(BaseModel):
section_id: str = ""
section_title: str = ""
is_correct: bool = False
+ assessment_type: str = ""
+ result: str = ""
+ mastery_path_id: str = ""
+ knowledge_point_id: str = ""
+ attempt_count: int = 1
+ hints_used: int = 0
+ confidence: float | None = None
+ response_time: float | None = None
+ quality: float | None = None
# ── Entry endpoints ──────────────────────────────────────────────
@@ -288,6 +308,10 @@ async def list_entries(
),
material_id: str = Query(default="", max_length=500),
section_id: str = Query(default="", max_length=500),
+ assessment_type: str = Query(default="", pattern="^(quiz|focus_check|qualitative|review)?$"),
+ result: str = Query(default="", pattern="^(correct|incorrect|partial|ungraded)?$"),
+ mastery_path_id: str = Query(default="", max_length=500),
+ knowledge_point_id: str = Query(default="", max_length=500),
resolved: bool | None = Query(default=None),
score_trend: str = Query(default="", pattern="^(new|improved|declined|unchanged)?$"),
search: str = Query(default="", max_length=200),
@@ -297,7 +321,7 @@ async def list_entries(
) -> NotebookEntryListResponse:
store = get_sqlite_session_store()
session_ids = await _course_session_ids(store, course_id)
- result = await store.list_notebook_entries(
+ listing = await store.list_notebook_entries(
category_id=category_id,
uncategorized=uncategorized,
bookmarked=bookmarked,
@@ -306,6 +330,10 @@ async def list_entries(
source=source,
material_id=material_id,
section_id=section_id,
+ assessment_type=assessment_type,
+ result=result,
+ mastery_path_id=mastery_path_id,
+ knowledge_point_id=knowledge_point_id,
resolved=resolved,
score_trend=score_trend,
search=search,
@@ -314,8 +342,8 @@ async def list_entries(
offset=offset,
)
return NotebookEntryListResponse(
- items=[NotebookEntryItem(**item) for item in result["items"]],
- total=result["total"],
+ items=[NotebookEntryItem(**item) for item in listing["items"]],
+ total=listing["total"],
)
diff --git a/deeptutor/api/routers/reading_extensions.py b/deeptutor/api/routers/reading_extensions.py
index e4559f975..51785bbb9 100644
--- a/deeptutor/api/routers/reading_extensions.py
+++ b/deeptutor/api/routers/reading_extensions.py
@@ -4,11 +4,12 @@ from __future__ import annotations
import asyncio
import inspect
+import logging
import re
from typing import Any
from fastapi import APIRouter, HTTPException
-from pydantic import BaseModel, Field, ValidationError
+from pydantic import BaseModel, ConfigDict, Field, ValidationError
from deeptutor.multi_user.learning_access import (
allowed_reading_extensions,
@@ -20,9 +21,29 @@ from deeptutor.reading.extensions import (
ReadingExtensionResult,
get_reading_extension_registry,
)
+from deeptutor.services.llm.exceptions import LLMError
+logger = logging.getLogger(__name__)
router = APIRouter()
-ACTION_TIMEOUT_S = 30
+# Quiz / translation / vocabulary all call an LLM. Thirty seconds is enough to
+# trip a hanging *sync* plugin, but too short for a grounded three-question
+# quiz on a reasoning model — and a timeout used to circuit-break the extension
+# for the rest of the process.
+ACTION_TIMEOUT_S = 120
+
+
+def _unavailable_detail(
+ *,
+ reason: str = "",
+ message: str = "This reading action is temporarily unavailable.",
+) -> dict[str, Any]:
+ detail: dict[str, Any] = {
+ "message": message,
+ "recoverable": True,
+ }
+ if reason:
+ detail["reason"] = reason[:500]
+ return detail
class ActionPayload(BaseModel):
@@ -31,6 +52,24 @@ class ActionPayload(BaseModel):
locale: str = Field(default="en", max_length=32)
+class QuizAnswerItem(BaseModel):
+ model_config = ConfigDict(extra="ignore")
+
+ question_id: str = Field(min_length=1)
+ selected_index: int
+
+
+class QuizAnswersPayload(BaseModel):
+ model_config = ConfigDict(extra="ignore")
+
+ locator: int = Field(ge=1)
+ source_anchor: str = Field(default="", max_length=2_000)
+ section_title: str = Field(default="", max_length=500)
+ session_id: str = ""
+ turn_id: str = ""
+ answers: list[QuizAnswerItem] = Field(min_length=1)
+
+
def _normal(value: str) -> str:
return re.sub(r"\s+", " ", value).strip()
@@ -96,25 +135,31 @@ async def run_extension_action(
status_code=422,
detail="This reading unit is too large for the extension protocol.",
) from exc
- if not registry.begin_action(extension_id):
+ # Sync plugins run on a private worker we cannot kill; a timeout must
+ # open the circuit so later clicks do not queue behind the stuck call.
+ # Async plugins (quiz, translation, …) are cancelled with the request,
+ # so a slow LLM must not disable the button for the rest of the process.
+ run = extension.run_action
+ sync_plugin = not inspect.iscoroutinefunction(run)
+ if not registry.begin_action(extension_id, circuit_break=sync_plugin):
raise HTTPException(
status_code=503,
- detail={
- "message": "This reading action is temporarily unavailable.",
- "recoverable": True,
- },
+ detail=_unavailable_detail(reason="busy_or_circuit_open"),
)
try:
async with asyncio.timeout(ACTION_TIMEOUT_S):
- loop = asyncio.get_running_loop()
- value = await loop.run_in_executor(
- registry.executor_for(extension_id),
- extension.run_action,
- action,
- context,
- )
- if inspect.isawaitable(value):
- value = await value
+ if sync_plugin:
+ loop = asyncio.get_running_loop()
+ value = await loop.run_in_executor(
+ registry.executor_for(extension_id),
+ run,
+ action,
+ context,
+ )
+ if inspect.isawaitable(value):
+ value = await value
+ else:
+ value = await run(action, context)
result = (
value
if isinstance(value, ReadingExtensionResult)
@@ -122,26 +167,162 @@ async def run_extension_action(
)
if result.type not in extension.manifest.result_types:
raise ValueError(f"Extension returned undeclared result type {result.type!r}.")
- return result.model_dump()
+ dumped = result.model_dump()
+ quiz_payload = dumped.get("payload")
+ if dumped.get("type") == "quiz" and isinstance(quiz_payload, dict):
+ await _persist_reading_quiz_pending(material_id, payload.locator, quiz_payload)
+ return dumped
except TimeoutError as exc:
- registry.mark_timed_out(extension_id)
+ if sync_plugin:
+ registry.mark_timed_out(extension_id)
+ logger.warning(
+ "Reading extension %s action %s timed out after %ss (sync=%s)",
+ extension_id,
+ action,
+ ACTION_TIMEOUT_S,
+ sync_plugin,
+ )
+ raise HTTPException(
+ status_code=503,
+ detail=_unavailable_detail(reason="timed_out"),
+ ) from exc
+ except LLMError as exc:
+ logger.warning(
+ "Reading extension %s action %s failed via language model: %s",
+ extension_id,
+ action,
+ exc,
+ )
raise HTTPException(
status_code=503,
- detail={
- "message": "This reading action is temporarily unavailable.",
- "recoverable": True,
- },
+ detail=_unavailable_detail(
+ reason=str(exc),
+ message="This reading action needs a working language model.",
+ ),
) from exc
except Exception as exc:
+ logger.exception(
+ "Reading extension %s action %s failed",
+ extension_id,
+ action,
+ )
raise HTTPException(
status_code=503,
- detail={
- "message": "This reading action is temporarily unavailable.",
- "recoverable": True,
- },
+ detail=_unavailable_detail(reason=str(exc)),
) from exc
finally:
registry.finish_action(extension_id)
+def _choice_map(choices: list[Any]) -> dict[str, str]:
+ return {
+ chr(65 + index): str(choice)
+ for index, choice in enumerate(choices)
+ if isinstance(choice, str) or choice is not None
+ }
+
+
+def _material_title(material_id: str) -> str:
+ try:
+ manifest = ReadingStore().manifest(material_id)
+ except Exception:
+ return ""
+ return str(getattr(manifest, "title", "") or getattr(manifest, "filename", "") or "")
+
+
+async def _persist_reading_quiz_pending(
+ material_id: str, locator: int, payload: dict[str, Any]
+) -> None:
+ questions = payload.get("questions")
+ if not isinstance(questions, list) or not questions:
+ return
+ try:
+ from deeptutor.services.session import get_sqlite_session_store
+
+ await get_sqlite_session_store().put_reading_quiz_pending(material_id, locator, questions)
+ except Exception:
+ logger.warning(
+ "Failed to persist reading quiz keys for material %s locator %s",
+ material_id,
+ locator,
+ exc_info=True,
+ )
+
+
[email protected]("/materials/{material_id}/extensions/quiz/answers")
+async def submit_quiz_answers(material_id: str, payload: QuizAnswersPayload) -> dict[str, Any]:
+ try:
+ assert_learning_material(material_id)
+ except PermissionError as exc:
+ raise HTTPException(status_code=403, detail=str(exc)) from exc
+
+ from deeptutor.learning.assessment import (
+ AssessmentRecord,
+ RecordAssessmentError,
+ is_correct_to_result,
+ record_assessment,
+ )
+ from deeptutor.services.session import get_sqlite_session_store
+
+ store = get_sqlite_session_store()
+ question_ids = [item.question_id.strip() for item in payload.answers]
+ pending = await store.get_reading_quiz_pending(material_id, payload.locator, question_ids)
+ missing = [qid for qid in question_ids if qid not in pending]
+ if missing:
+ raise HTTPException(status_code=409, detail="This reading quiz has expired.")
+
+ session_id = payload.session_id.strip()
+ persist = bool(session_id) and await store.get_session(session_id) is not None
+ turn_id = payload.turn_id.strip() or f"loc:{payload.locator}"
+ section_title = payload.section_title.strip() or payload.source_anchor.strip()
+ material_title = _material_title(material_id)
+ graded: list[dict[str, Any]] = []
+ for item in payload.answers:
+ question = pending[item.question_id.strip()]
+ choices = question.get("choices") if isinstance(question.get("choices"), list) else []
+ try:
+ correct_index = int(question.get("correct_choice_index"))
+ except (TypeError, ValueError):
+ correct_index = -1
+ is_correct = item.selected_index == correct_index
+ result = is_correct_to_result(is_correct)
+ options = _choice_map(choices)
+ selected_text = (
+ str(choices[item.selected_index]) if 0 <= item.selected_index < len(choices) else ""
+ )
+ correct_text = str(choices[correct_index]) if 0 <= correct_index < len(choices) else ""
+ if persist:
+ try:
+ await record_assessment(
+ AssessmentRecord(
+ session_id=session_id,
+ turn_id=turn_id,
+ question_id=item.question_id.strip(),
+ question=str(question.get("prompt") or "Reading quiz"),
+ question_type="choice",
+ options=options,
+ user_answer=selected_text,
+ correct_answer=correct_text,
+ is_correct=is_correct,
+ result=result,
+ source="immersive_reading",
+ assessment_type="focus_check",
+ material_id=material_id,
+ material_title=material_title,
+ section_id=str(payload.locator),
+ section_title=section_title,
+ )
+ )
+ except RecordAssessmentError as exc:
+ raise HTTPException(status_code=500, detail=str(exc)) from exc
+ graded.append(
+ {
+ "question_id": item.question_id.strip(),
+ "is_correct": is_correct,
+ "result": result,
+ }
+ )
+ return {"answers": graded}
+
+
__all__ = ["router"]
diff --git a/deeptutor/capabilities/mastery/tools.py b/deeptutor/capabilities/mastery/tools.py
index b910af014..7c1004fcd 100644
--- a/deeptutor/capabilities/mastery/tools.py
+++ b/deeptutor/capabilities/mastery/tools.py
@@ -314,36 +314,51 @@ async def _sync_mastery_attempt_to_question_bank(
correct_answer: str | None = None,
material_title: str = "",
section_title: str = "",
+ attempt_count: int = 1,
+ hints_used: int = 0,
+ confidence: float | None = None,
+ response_time: float | None = None,
+ quality: float | None = None,
) -> None:
if not session_id:
return
- item = {
- "turn_id": turn_id,
- "question_id": pending.question_id,
- "question": pending.prompt,
- "question_type": _question_bank_type(pending.question_type),
- "options": choice_options or pending.choice_map,
- "correct_answer": correct_answer or pending.expected_answer,
- # Carried from mastery_quiz. Without these the bank held a bare
- # right/wrong for every mastery attempt — reviewable only as a score.
- "explanation": pending.explanation,
- "difficulty": pending.difficulty,
- "user_answer": user_answer,
- "is_correct": is_correct,
- "source": "mastery_path",
- "material_id": path_id,
- "material_title": material_title,
- "section_id": pending.knowledge_point_id,
- "section_title": section_title,
- }
- try:
- from deeptutor.services.session import get_sqlite_session_store
+ from deeptutor.learning.assessment import (
+ AssessmentRecord,
+ RecordAssessmentError,
+ is_correct_to_result,
+ record_assessment,
+ )
- await asyncio.wait_for(
- get_sqlite_session_store().upsert_notebook_entries(session_id, [item]),
- timeout=5.0,
- )
- except Exception:
+ record = AssessmentRecord(
+ session_id=session_id,
+ turn_id=turn_id,
+ question_id=pending.question_id,
+ question=pending.prompt,
+ question_type=_question_bank_type(pending.question_type),
+ options=choice_options or pending.choice_map,
+ correct_answer=correct_answer or pending.expected_answer,
+ explanation=pending.explanation,
+ difficulty=pending.difficulty,
+ user_answer=user_answer,
+ is_correct=is_correct,
+ result=is_correct_to_result(is_correct),
+ source="mastery_path",
+ assessment_type="quiz",
+ material_id=path_id,
+ material_title=material_title,
+ section_id=pending.knowledge_point_id,
+ section_title=section_title,
+ mastery_path_id=path_id,
+ knowledge_point_id=pending.knowledge_point_id,
+ attempt_count=attempt_count,
+ hints_used=hints_used,
+ confidence=confidence,
+ response_time=response_time,
+ quality=quality,
+ )
+ try:
+ await asyncio.wait_for(record_assessment(record), timeout=5.0)
+ except (RecordAssessmentError, Exception):
logger.warning(
"Failed to sync mastery question %s to question bank for session %s",
pending.question_id,
@@ -352,6 +367,56 @@ async def _sync_mastery_attempt_to_question_bank(
)
+async def _sync_qualitative_to_question_bank(
+ *,
+ path_id: str,
+ session_id: str,
+ turn_id: str,
+ knowledge_point_id: str,
+ knowledge_point_name: str,
+ passed: bool,
+ evidence: str,
+ material_title: str = "",
+ quality: float | None = None,
+) -> None:
+ if not session_id:
+ return
+ from deeptutor.learning.assessment import (
+ AssessmentRecord,
+ RecordAssessmentError,
+ record_assessment,
+ )
+
+ record = AssessmentRecord(
+ session_id=session_id,
+ turn_id=turn_id,
+ question_id=f"qual:{knowledge_point_id}",
+ question=knowledge_point_name,
+ question_type="written",
+ user_answer=evidence,
+ is_correct=passed,
+ result="correct" if passed else "partial",
+ source="mastery_path",
+ assessment_type="qualitative",
+ material_id=path_id,
+ material_title=material_title,
+ section_id=knowledge_point_id,
+ section_title=knowledge_point_name,
+ mastery_path_id=path_id,
+ knowledge_point_id=knowledge_point_id,
+ quality=1.0 if passed else 0.2 if quality is None else quality,
+ )
+ try:
+ await asyncio.wait_for(record_assessment(record), timeout=5.0)
+ except (RecordAssessmentError, Exception):
+ logger.warning(
+ "Failed to sync qualitative assessment %s to question bank for session %s",
+ knowledge_point_id,
+ session_id,
+ exc_info=True,
+ )
+
+
def _unreadable_choice_result(answer: str, options: dict[str, str]) -> ToolResult:
"""Ask for a definite choice rather than recording a guess as wrong."""
shown = "; ".join(f"{label} = {body}" for label, body in options.items())
@@ -1069,6 +1134,14 @@ class MasteryGradeTool(BaseTool):
# best-effort sync timed out, a safe retry repairs the auxiliary
# question bank without duplicating the mastery attempt.
kp, _, _ = find_knowledge_point(progress, pending.knowledge_point_id)
+ evidence = next(
+ (
+ item
+ for item in reversed(progress.learning_evidence)
+ if item.knowledge_point_id == pending.knowledge_point_id
+ ),
+ None,
+ )
await _sync_mastery_attempt_to_question_bank(
path_id=path_id,
session_id=interaction.session_id or _resolve_session_id(kwargs),
@@ -1082,6 +1155,11 @@ class MasteryGradeTool(BaseTool):
correct_answer=expected_answer,
material_title=progress.name,
section_title=kp.name if kp else "",
+ attempt_count=evidence.attempt_count if evidence is not None else 1,
+ hints_used=evidence.hints_used if evidence is not None else 0,
+ confidence=evidence.confidence if evidence is not None else None,
+ response_time=evidence.response_time if evidence is not None else None,
+ quality=evidence.quality if evidence is not None else None,
)
mastered = bool(kp and is_mastered(progress, kp))
gate = gate_kind(kp) if kp else ""
@@ -1235,6 +1313,16 @@ class MasteryAssessTool(BaseTool):
return ToolResult(content=str(exc), success=False)
kp, _, _ = find_knowledge_point(progress, kp_id)
assert kp is not None
+ await _sync_qualitative_to_question_bank(
+ path_id=path_id,
+ session_id=_resolve_session_id(kwargs),
+ turn_id=_resolve_turn_id(kwargs),
+ knowledge_point_id=kp_id,
+ knowledge_point_name=kp.name,
+ passed=passed,
+ evidence=feedback,
+ material_title=progress.name,
+ )
payload = {
"knowledge_point_id": kp_id,
"path_revision": progress.version,
diff --git a/deeptutor/learning/assessment.py b/deeptutor/learning/assessment.py
new file mode 100644
index 000000000..155012521
--- /dev/null
+++ b/deeptutor/learning/assessment.py
@@ -0,0 +1,297 @@
+"""Unified assessment adapter for the Question Notebook review layer.
+
+Mastery Path, Book Focus-Check, and Immersive Reading persist graded attempts
+through :func:`record_assessment`. Identity is the existing
+``(session_id, turn_id, question_id)`` notebook unique key — there is no
+second question bank. Objective linkage is written only for
+``source="mastery_path"``.
+"""
+
+from __future__ import annotations
+
+from hashlib import sha1
+import logging
+import time
+from typing import Any, Literal
+
+from pydantic import BaseModel, ConfigDict, Field, field_validator, model_validator
+
+logger = logging.getLogger(__name__)
+
+AssessmentSource = Literal["deep_question", "mastery_path", "immersive_reading", "book"]
+AssessmentType = Literal["quiz", "focus_check", "qualitative", "review"]
+AssessmentResult = Literal["correct", "incorrect", "partial", "ungraded"]
+
+ASSESSMENT_SOURCES: frozenset[str] = frozenset(
+ {"deep_question", "mastery_path", "immersive_reading", "book"}
+)
+ASSESSMENT_TYPES: frozenset[str] = frozenset({"quiz", "focus_check", "qualitative", "review"})
+ASSESSMENT_RESULTS: frozenset[str] = frozenset({"correct", "incorrect", "partial", "ungraded"})
+
+
+class RecordAssessmentError(RuntimeError):
+ """Raised when a review record cannot be persisted consistently."""
+
+
+class AssessmentOutcome(BaseModel):
+ model_config = ConfigDict(extra="ignore")
+
+ entry_id: int | None = None
+ upserted: bool = False
+ diagnostics: list[str] = Field(default_factory=list)
+
+
+def result_to_is_correct(result: str) -> bool:
+ """Bool compatibility: only a fully correct result is true."""
+ return str(result or "").strip() == "correct"
+
+
+def is_correct_to_result(is_correct: bool | None) -> AssessmentResult:
+ """Map the legacy bool onto a graded result; unknown stays ungraded."""
+ if is_correct is True:
+ return "correct"
+ if is_correct is False:
+ return "incorrect"
+ return "ungraded"
+
+
+def build_grade_result(
+ *,
+ result: str = "",
+ is_correct: bool | None = None,
+) -> AssessmentResult:
+ """Canonical result string; an explicit result wins over the bool."""
+ value = str(result or "").strip()
+ if value in ASSESSMENT_RESULTS:
+ return value # type: ignore[return-value]
+ return is_correct_to_result(is_correct)
+
+
+class AssessmentRecord(BaseModel):
+ """Normalized payload for one review upsert."""
+
+ model_config = ConfigDict(extra="ignore")
+
+ session_id: str
+ turn_id: str = ""
+ question_id: str
+ source: AssessmentSource = "deep_question"
+ assessment_type: AssessmentType = "quiz"
+ result: str = ""
+ is_correct: bool | None = None
+ question: str = ""
+ question_type: str = ""
+ options: dict[str, str] = Field(default_factory=dict)
+ user_answer: str = ""
+ correct_answer: str = ""
+ explanation: str = ""
+ difficulty: str = ""
+ material_id: str = ""
+ material_title: str = ""
+ section_id: str = ""
+ section_title: str = ""
+ mastery_path_id: str = ""
+ knowledge_point_id: str = ""
+ attempt_count: int = 1
+ hints_used: int = 0
+ confidence: float | None = None
+ response_time: float | None = None
+ quality: float | None = None
+ created_at: float = Field(default_factory=time.time)
+ updated_at: float = Field(default_factory=time.time)
+ bookmarked: bool = False
+ resolved: bool | None = None
+
+ @field_validator("source", mode="before")
+ @classmethod
+ def _normalize_source(cls, value: object) -> str:
+ raw = str(value or "").strip()
+ return raw if raw in ASSESSMENT_SOURCES else "deep_question"
+
+ @field_validator("assessment_type", mode="before")
+ @classmethod
+ def _normalize_type(cls, value: object) -> str:
+ raw = str(value or "").strip()
+ return raw if raw in ASSESSMENT_TYPES else "quiz"
+
+ @field_validator("result", mode="before")
+ @classmethod
+ def _normalize_result_field(cls, value: object) -> str:
+ raw = str(value or "").strip()
+ return raw if raw in ASSESSMENT_RESULTS else ""
+
+ @field_validator(
+ "session_id",
+ "turn_id",
+ "question_id",
+ "question",
+ "question_type",
+ "user_answer",
+ "correct_answer",
+ "explanation",
+ "difficulty",
+ "material_id",
+ "material_title",
+ "section_id",
+ "section_title",
+ "mastery_path_id",
+ "knowledge_point_id",
+ mode="before",
+ )
+ @classmethod
+ def _strip_text(cls, value: object) -> str:
+ return str(value or "").strip()
+
+ @field_validator("options", mode="before")
+ @classmethod
+ def _options(cls, value: object) -> dict[str, str]:
+ if not isinstance(value, dict):
+ return {}
+ return {str(key): str(body) for key, body in value.items()}
+
+ @field_validator("attempt_count", mode="before")
+ @classmethod
+ def _attempt_count(cls, value: object) -> int:
+ try:
+ return max(1, int(value)) # type: ignore[arg-type]
+ except (TypeError, ValueError):
+ return 1
+
+ @field_validator("hints_used", mode="before")
+ @classmethod
+ def _hints_used(cls, value: object) -> int:
+ try:
+ return max(0, int(value)) # type: ignore[arg-type]
+ except (TypeError, ValueError):
+ return 0
+
+ @model_validator(mode="after")
+ def _require_identity(self) -> "AssessmentRecord":
+ if not self.session_id or not self.question_id:
+ raise ValueError("session_id and question_id are required")
+ if not self.question:
+ raise ValueError("question is required")
+ return self
+
+ @property
+ def assessment_id(self) -> str:
+ """Audit id derived from the notebook unique key — not a second identity."""
+ raw = f"{self.session_id}|{self.turn_id}|{self.question_id}"
+ return sha1(raw.encode("utf-8")).hexdigest()
+
+
+def _resolve_result(record: AssessmentRecord, diagnostics: list[str]) -> AssessmentResult:
+ result = build_grade_result(result=record.result, is_correct=record.is_correct)
+ if record.result and record.is_correct is not None:
+ if record.result in {"partial", "ungraded"}:
+ if record.is_correct:
+ logger.warning(
+ "is_correct=%s conflicts with result=%s; using result",
+ record.is_correct,
+ record.result,
+ )
+ diagnostics.append("is_correct_result_conflict")
+ elif result_to_is_correct(record.result) != record.is_correct:
+ logger.warning(
+ "is_correct=%s conflicts with result=%s; using result",
+ record.is_correct,
+ record.result,
+ )
+ diagnostics.append("is_correct_result_conflict")
+ return result
+
+
+def _apply_linkage(record: AssessmentRecord, diagnostics: list[str]) -> tuple[str, str]:
+ if record.source == "mastery_path":
+ return record.mastery_path_id, record.knowledge_point_id
+ if record.mastery_path_id or record.knowledge_point_id:
+ logger.warning(
+ "Dropping mastery linkage on non-mastery assessment source=%s "
+ "mastery_path_id=%s knowledge_point_id=%s",
+ record.source,
+ record.mastery_path_id,
+ record.knowledge_point_id,
+ )
+ diagnostics.append("dropped_non_mastery_linkage")
+ return "", ""
+
+
+def to_notebook_item(record: AssessmentRecord, diagnostics: list[str]) -> dict[str, Any]:
+ """Build the dict ``upsert_notebook_entries`` expects."""
+ result = _resolve_result(record, diagnostics)
+ mastery_path_id, knowledge_point_id = _apply_linkage(record, diagnostics)
+ is_correct = result_to_is_correct(result)
+ item: dict[str, Any] = {
+ "turn_id": record.turn_id,
+ "question_id": record.question_id,
+ "question": record.question,
+ "question_type": record.question_type,
+ "options": record.options,
+ "correct_answer": record.correct_answer,
+ "explanation": record.explanation,
+ "difficulty": record.difficulty,
+ "user_answer": record.user_answer,
+ "is_correct": is_correct,
+ "source": record.source,
+ "material_id": record.material_id,
+ "material_title": record.material_title,
+ "section_id": record.section_id,
+ "section_title": record.section_title,
+ "assessment_type": record.assessment_type,
+ "result": result,
+ "mastery_path_id": mastery_path_id,
+ "knowledge_point_id": knowledge_point_id,
+ "attempt_count": record.attempt_count,
+ "hints_used": record.hints_used,
+ "confidence": record.confidence,
+ "response_time": record.response_time,
+ "quality": record.quality,
+ }
+ return item
+
+
+async def record_assessment(record: AssessmentRecord) -> AssessmentOutcome:
+ """Persist one assessment into the unified Question Notebook."""
+ diagnostics: list[str] = []
+ item = to_notebook_item(record, diagnostics)
+ try:
+ from deeptutor.services.session import get_sqlite_session_store
+
+ store = get_sqlite_session_store()
+ upserted = await store.upsert_notebook_entries(record.session_id, [item])
+ entry = await store.find_notebook_entry(
+ record.session_id, record.question_id, turn_id=record.turn_id
+ )
+ except Exception as exc:
+ logger.exception(
+ "Failed to record assessment %s for session %s",
+ record.question_id,
+ record.session_id,
+ )
+ raise RecordAssessmentError(
+ f"Failed to record assessment {record.question_id!r} for session {record.session_id!r}"
+ ) from exc
+ entry_id = int(entry["id"]) if isinstance(entry, dict) and entry.get("id") is not None else None
+ return AssessmentOutcome(
+ entry_id=entry_id,
+ upserted=bool(upserted),
+ diagnostics=diagnostics,
+ )
+
+
+__all__ = [
+ "ASSESSMENT_RESULTS",
+ "ASSESSMENT_SOURCES",
+ "ASSESSMENT_TYPES",
+ "AssessmentOutcome",
+ "AssessmentRecord",
+ "AssessmentResult",
+ "AssessmentSource",
+ "AssessmentType",
+ "RecordAssessmentError",
+ "build_grade_result",
+ "is_correct_to_result",
+ "record_assessment",
+ "result_to_is_correct",
+ "to_notebook_item",
+]
diff --git a/deeptutor/learning/tests/test_assessment.py b/deeptutor/learning/tests/test_assessment.py
new file mode 100644
index 000000000..a131cbc9e
--- /dev/null
+++ b/deeptutor/learning/tests/test_assessment.py
@@ -0,0 +1,162 @@
+"""Tests for the unified assessment adapter used to persist review records.
+
+These cover the normalization, identity, linkage and failure semantics that
+every surface (Mastery Path, Book, Immersive Reading) relies on when it
+records a graded attempt into the Question Notebook.
+"""
+
+from __future__ import annotations
+
+import asyncio
+from pathlib import Path
+
+import pytest
+
+from deeptutor.learning.assessment import (
+ AssessmentOutcome,
+ AssessmentRecord,
+ RecordAssessmentError,
+ is_correct_to_result,
+ record_assessment,
+ result_to_is_correct,
+ to_notebook_item,
+)
+from deeptutor.services.session.sqlite_store import SQLiteSessionStore
+
+
+def store(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> SQLiteSessionStore:
+ instance = SQLiteSessionStore(db_path=tmp_path / "assessment.db")
+ monkeypatch.setattr(
+ "deeptutor.services.session.get_sqlite_session_store",
+ lambda: instance,
+ )
+ return instance
+
+
+def _mastery_record(**overrides) -> AssessmentRecord:
+ values: dict = {
+ "session_id": "session-1",
+ "turn_id": "turn-1",
+ "question_id": "q-1",
+ "question": "What is 2+2?",
+ "result": "incorrect",
+ "is_correct": False,
+ "source": "mastery_path",
+ "assessment_type": "quiz",
+ "mastery_path_id": "path-1",
+ "knowledge_point_id": "kp-1",
+ "quality": 0.0,
+ }
+ values.update(overrides)
+ return AssessmentRecord(**values)
+
+
+def test_assessment_id_is_derived_identity() -> None:
+ record = _mastery_record()
+ same = _mastery_record()
+ assert record.assessment_id == same.assessment_id
+ assert len(record.assessment_id) == 40 # sha1 hex
+
+
+def test_record_round_trip_persists_all_phase2_fields(store: SQLiteSessionStore) -> None:
+ session = asyncio.run(store.create_session(title="S", session_id="session-1"))
+ assert "id" in session
+ record = _mastery_record()
+ outcome = asyncio.run(record_assessment(record))
+ assert isinstance(outcome, AssessmentOutcome)
+ assert outcome.upserted is True
+ assert outcome.entry_id is not None
+ assert outcome.diagnostics == []
+
+ entry = asyncio.run(store.find_notebook_entry("session-1", "q-1", turn_id="turn-1"))
+ assert entry is not None
+ assert entry["source"] == "mastery_path"
+ assert entry["assessment_type"] == "quiz"
+ assert entry["result"] == "incorrect"
+ assert entry["mastery_path_id"] == "path-1"
+ assert entry["knowledge_point_id"] == "kp-1"
+ assert entry["is_correct"] is False
+ assert entry["quality"] == 0.0
+
+
+def test_unknown_source_falls_back_to_deep_question() -> None:
+ record = AssessmentRecord(
+ session_id="s",
+ question_id="q",
+ question="...",
+ source="made_up_surface",
+ )
+ assert record.source == "deep_question"
+
+
+def test_result_wins_over_conflicting_bool() -> None:
+ record = _mastery_record(result="partial", is_correct=True)
+ diagnostics: list[str] = []
+ item = to_notebook_item(record, diagnostics)
+ assert item["result"] == "partial"
+ assert item["is_correct"] is False # partial is never a boolean "correct"
+ assert "is_correct_result_conflict" in diagnostics
+
+
+def test_ungraded_is_not_treated_as_wrong() -> None:
+ record = _mastery_record(result="ungraded", is_correct=False)
+ assert result_to_is_correct("ungraded") is False
+ assert is_correct_to_result(False) == "incorrect"
+ item = to_notebook_item(record, [])
+ assert item["result"] == "ungraded"
+ assert item["is_correct"] is False
+
+
+def test_non_mastery_linkage_is_dropped() -> None:
+ record = AssessmentRecord(
+ session_id="s",
+ turn_id="t",
+ question_id="q",
+ question="...",
+ source="book",
+ mastery_path_id="path-1",
+ knowledge_point_id="kp-1",
+ )
+ diagnostics: list[str] = []
+ item = to_notebook_item(record, diagnostics)
+ assert item["mastery_path_id"] == ""
+ assert item["knowledge_point_id"] == ""
+ assert "dropped_non_mastery_linkage" in diagnostics
+
+
+def test_mastery_defaults_attempt_and_hints() -> None:
+ record = _mastery_record(attempt_count=0, hints_used=-3)
+ item = to_notebook_item(record, [])
+ assert item["attempt_count"] == 1
+ assert item["hints_used"] == 0
+
+
+def test_repeated_record_is_idempotent(store: SQLiteSessionStore) -> None:
+ asyncio.run(store.create_session(title="S", session_id="session-1"))
+ record = _mastery_record()
+ asyncio.run(record_assessment(record))
+ second = asyncio.run(record_assessment(record))
+ assert second.entry_id == asyncio.run(record_assessment(record)).entry_id
+ listing = asyncio.run(
+ store.list_notebook_entries(source="mastery_path", session_id="session-1")
+ )
+ assert listing["total"] == 1
+
+
+def test_missing_session_raises_record_error() -> None:
+ record = _mastery_record(session_id="no-such-session")
+ with pytest.raises(RecordAssessmentError):
+ asyncio.run(record_assessment(record))
+
+
+def test_missing_identity_is_rejected() -> None:
+ with pytest.raises(ValueError):
+ AssessmentRecord(session_id="", question_id="q", question="...")
+ with pytest.raises(ValueError):
+ AssessmentRecord(session_id="s", question_id="", question="...")
+
+
+def test_missing_question_is_rejected() -> None:
+ with pytest.raises(ValueError):
+ AssessmentRecord(session_id="s", question_id="q", question=" ")
diff --git a/deeptutor/learning/tests/test_mastery_tools.py b/deeptutor/learning/tests/test_mastery_tools.py
index d7c671b09..82f0c4166 100644
--- a/deeptutor/learning/tests/test_mastery_tools.py
+++ b/deeptutor/learning/tests/test_mastery_tools.py
@@ -487,6 +487,10 @@ async def test_grade_syncs_mastery_attempt_to_question_bank(path_id, session_sto
assert entry["material_id"] == path_id
assert entry["section_id"] == kp_id
assert entry["section_title"] == "Truth tables"
+ assert entry["assessment_type"] == "quiz"
+ assert entry["result"] == "incorrect"
+ assert entry["mastery_path_id"] == path_id
+ assert entry["knowledge_point_id"] == kp_id
# An idempotent retry with a changed model argument must not overwrite the
# committed learner answer in the auxiliary question bank.
@@ -1279,6 +1283,57 @@ async def test_assess_rejects_quantitative_type(path_id):
assert result.success is False
+async def test_assess_syncs_qualitative_record_to_question_bank(path_id, session_store):
+ session = await session_store.create_session(title="Qualitative Session")
+ await _build_basic(path_id)
+ status = json.loads((await MasteryStatusTool().execute(_mastery_path_id=path_id)).content)
+ mem_kp = status["next"]["knowledge_point_id"]
+ for _ in range(3):
+ await MasteryQuizTool().execute(
+ _mastery_path_id=path_id, knowledge_point_id=mem_kp, question="q", expected_answer="a"
+ )
+ await MasteryGradeTool().execute(
+ _mastery_path_id=path_id,
+ _session_id=session["id"],
+ _turn_id="turn_mem",
+ answer="a",
+ )
+
+ status2 = json.loads((await MasteryStatusTool().execute(_mastery_path_id=path_id)).content)
+ concept_kp = status2["next"]["knowledge_point_id"]
+ await MasteryAssessTool().execute(
+ _mastery_path_id=path_id,
+ _session_id=session["id"],
+ _turn_id="turn_qual",
+ knowledge_point_id=concept_kp,
+ passed=True,
+ feedback="XOR is exclusive or.",
+ )
+ await MasteryAssessTool().execute(
+ _mastery_path_id=path_id,
+ _session_id=session["id"],
+ _turn_id="turn_qual",
+ knowledge_point_id=concept_kp,
+ passed=True,
+ feedback="XOR is exclusive or.",
+ )
+
+ qualitative = await session_store.list_notebook_entries(assessment_type="qualitative")
+ assert qualitative["total"] == 1
+ entry = qualitative["items"][0]
+ assert entry["source"] == "mastery_path"
+ assert entry["result"] == "correct"
+ assert entry["mastery_path_id"] == path_id
+ assert entry["knowledge_point_id"] == concept_kp
+ assert entry["question_id"] == f"qual:{concept_kp}"
+ assert entry["user_answer"] == "XOR is exclusive or."
+ assert entry["quality"] == 1.0
+ progress = LearningStore().load(path_id)
+ assert progress is not None
+ assert progress.repetition_states[concept_kp].interval_index == 0
+
+
# ── path switching: a conversation is not bound to one path ───────────────
diff --git a/deeptutor/reading/extensions.py b/deeptutor/reading/extensions.py
index 1e93eebc5..dfe16087b 100644
--- a/deeptutor/reading/extensions.py
+++ b/deeptutor/reading/extensions.py
@@ -127,10 +127,17 @@ class ReadingExtensionRegistry:
def get(self, extension_id: str) -> ReadingExtension | None:
return self._extensions.get(extension_id)
- def begin_action(self, extension_id: str) -> bool:
- """Reserve one extension worker unless it is busy or circuit-broken."""
+ def begin_action(self, extension_id: str, *, circuit_break: bool = True) -> bool:
+ """Reserve one extension worker unless it is busy or circuit-broken.
+
+ ``circuit_break`` is for sync handlers whose worker may still be stuck
+ after a timeout. Async LLM actions are cancelled with the request, so
+ a stale circuit must not block Quiz me until process restart.
+ """
with self._execution_lock:
- if extension_id in self._active or extension_id in self._timed_out:
+ if extension_id in self._active:
+ return False
+ if circuit_break and extension_id in self._timed_out:
return False
self._active.add(extension_id)
return True
diff --git a/deeptutor/services/session/sqlite_store.py b/deeptutor/services/session/sqlite_store.py
index 5cbdb76cd..a22e82b34 100644
--- a/deeptutor/services/session/sqlite_store.py
+++ b/deeptutor/services/session/sqlite_store.py
@@ -99,7 +99,14 @@ def _json_loads(value: str | None, default: Any) -> Any:
_IMPORTED_ID_PREFIX = "imported_"
_ID_SAFE = re.compile(r"[^A-Za-z0-9_-]")
ASSESSMENT_SOURCES = frozenset({"deep_question", "mastery_path", "immersive_reading", "book"})
+ASSESSMENT_TYPES = frozenset({"quiz", "focus_check", "qualitative", "review"})
+ASSESSMENT_RESULTS = frozenset({"correct", "incorrect", "partial", "ungraded"})
SCORE_TRENDS = frozenset({"new", "improved", "declined", "unchanged"})
+# Stored ``result=''`` is a pre-v2 row: treat it as already graded so wrong
+# lists do not swallow ungraded spectacle rows, and old incorrect rows stay
+# in the wrong filter.
+_GRADED_RESULT_SQL = "COALESCE(NULLIF(n.result,''),'graded') NOT IN ('ungraded','')"
+_GRADED_RESULT_SQL_UNALIASED = "COALESCE(NULLIF(result,''),'graded') NOT IN ('ungraded','')"
ACTIVE_TURN_STATUSES = frozenset({"queued", "running", "waiting_input"})
TERMINAL_TURN_STATUSES = frozenset({"completed", "failed", "cancelled"})
ALL_TURN_STATUSES = ACTIVE_TURN_STATUSES | TERMINAL_TURN_STATUSES
@@ -177,6 +184,10 @@ class QuestionBankQuery:
source: str = ""
material_id: str = ""
section_id: str = ""
+ assessment_type: str = ""
+ result: str = ""
+ mastery_path_id: str = ""
+ knowledge_point_id: str = ""
resolved: bool | None = None
score_trend: str = ""
search: str = ""
@@ -198,6 +209,14 @@ class QuestionBankQuery:
else "",
material_id=(self.material_id or "").strip(),
section_id=(self.section_id or "").strip(),
+ assessment_type=(self.assessment_type or "").strip()
+ if (self.assessment_type or "").strip() in ASSESSMENT_TYPES
+ else "",
+ result=(self.result or "").strip()
+ if (self.result or "").strip() in ASSESSMENT_RESULTS
+ else "",
+ mastery_path_id=(self.mastery_path_id or "").strip(),
+ knowledge_point_id=(self.knowledge_point_id or "").strip(),
resolved=self.resolved,
score_trend=(self.score_trend or "").strip()
if (self.score_trend or "").strip() in SCORE_TRENDS
@@ -339,6 +358,15 @@ class SQLiteSessionStore:
section_id TEXT NOT NULL DEFAULT '',
section_title TEXT NOT NULL DEFAULT '',
score_trend TEXT NOT NULL DEFAULT 'new',
+ assessment_type TEXT NOT NULL DEFAULT '',
+ result TEXT NOT NULL DEFAULT '',
+ mastery_path_id TEXT NOT NULL DEFAULT '',
+ knowledge_point_id TEXT NOT NULL DEFAULT '',
+ attempt_count INTEGER NOT NULL DEFAULT 1,
+ hints_used INTEGER NOT NULL DEFAULT 0,
+ confidence REAL,
+ response_time REAL,
+ quality REAL,
is_correct INTEGER DEFAULT 0,
resolved INTEGER DEFAULT 0,
bookmarked INTEGER DEFAULT 0,
@@ -355,6 +383,15 @@ class SQLiteSessionStore:
CREATE INDEX IF NOT EXISTS idx_notebook_entries_bookmarked
ON notebook_entries(bookmarked, created_at DESC);
+ CREATE TABLE IF NOT EXISTS reading_quiz_pending (
+ material_id TEXT NOT NULL,
+ locator INTEGER NOT NULL,
+ question_id TEXT NOT NULL,
+ question_json TEXT NOT NULL,
+ created_at REAL NOT NULL,
+ PRIMARY KEY (material_id, locator, question_id)
+ );
+
CREATE TABLE IF NOT EXISTS notebook_categories (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL UNIQUE,
@@ -418,6 +455,7 @@ class SQLiteSessionStore:
self._migrate_notebook_entries_add_user_answer_images(conn)
self._migrate_notebook_entries_add_ai_judgment(conn)
self._migrate_notebook_entries_add_assessment_review(conn)
+ self._migrate_notebook_entries_add_assessment_v2(conn)
self._migrate_turn_runtime_columns(conn)
conn.commit()
@@ -682,6 +720,47 @@ class SQLiteSessionStore:
"""
)
+ @staticmethod
+ def _migrate_notebook_entries_add_assessment_v2(
+ conn: sqlite3.Connection,
+ ) -> None:
+ """Add the cross-surface review columns without rewriting history."""
+ cols = {row[1] for row in conn.execute("PRAGMA table_info(notebook_entries)").fetchall()}
+ if not cols:
+ return
+ additions = {
+ "assessment_type": "TEXT NOT NULL DEFAULT ''",
+ "result": "TEXT NOT NULL DEFAULT ''",
+ "mastery_path_id": "TEXT NOT NULL DEFAULT ''",
+ "knowledge_point_id": "TEXT NOT NULL DEFAULT ''",
+ "attempt_count": "INTEGER NOT NULL DEFAULT 1",
+ "hints_used": "INTEGER NOT NULL DEFAULT 0",
+ "confidence": "REAL",
+ "response_time": "REAL",
+ "quality": "REAL",
+ }
+ for name, definition in additions.items():
+ if name not in cols:
+ conn.execute(f"ALTER TABLE notebook_entries ADD COLUMN {name} {definition}")
+ conn.execute(
+ """
+ CREATE INDEX IF NOT EXISTS idx_notebook_entries_linkage
+ ON notebook_entries(mastery_path_id, knowledge_point_id)
+ """
+ )
+ conn.execute(
+ """
+ CREATE TABLE IF NOT EXISTS reading_quiz_pending (
+ material_id TEXT NOT NULL,
+ locator INTEGER NOT NULL,
+ question_id TEXT NOT NULL,
+ question_json TEXT NOT NULL,
+ created_at REAL NOT NULL,
+ PRIMARY KEY (material_id, locator, question_id)
+ )
+ """
+ )
+
async def _run(self, fn, *args):
async with self._lock:
return await asyncio.to_thread(fn, *args)
@@ -2439,6 +2518,45 @@ class SQLiteSessionStore:
# ── Notebook entries ──────────────────────────────────────────────
+ @staticmethod
+ def _optional_float(value: Any) -> float | None:
+ if value is None or value == "":
+ return None
+ try:
+ return float(value)
+ except (TypeError, ValueError):
+ return None
+
+ @classmethod
+ def _notebook_assessment_values(cls, item: dict[str, Any], is_correct: int) -> tuple[Any, ...]:
+ assessment_type = str(item.get("assessment_type") or "").strip()
+ if assessment_type not in ASSESSMENT_TYPES:
+ assessment_type = ""
+ result = str(item.get("result") or "").strip()
+ if result not in ASSESSMENT_RESULTS:
+ result = "correct" if is_correct else "incorrect"
+ try:
+ raw_attempts = item.get("attempt_count")
+ attempt_count = max(1, int(raw_attempts if raw_attempts is not None else 1))
+ except (TypeError, ValueError):
+ attempt_count = 1
+ try:
+ raw_hints = item.get("hints_used")
+ hints_used = max(0, int(raw_hints if raw_hints is not None else 0))
+ except (TypeError, ValueError):
+ hints_used = 0
+ return (
+ assessment_type,
+ result,
+ str(item.get("mastery_path_id") or ""),
+ str(item.get("knowledge_point_id") or ""),
+ attempt_count,
+ hints_used,
+ cls._optional_float(item.get("confidence")),
+ cls._optional_float(item.get("response_time")),
+ cls._optional_float(item.get("quality")),
+ )
+
def _upsert_notebook_entries_sync(self, session_id: str, items: list[dict[str, Any]]) -> int:
if not items:
return 0
@@ -2488,6 +2606,8 @@ class SQLiteSessionStore:
str(item.get("section_title") or ""),
score_trend,
)
+ assessment = self._notebook_assessment_values(item, is_correct)
+ resolved_on_insert = 0 if assessment[1] == "ungraded" else (1 if is_correct else 0)
if images_json is None:
conn.execute(
"""
@@ -2496,9 +2616,11 @@ class SQLiteSessionStore:
options_json, correct_answer, explanation, difficulty,
user_answer, user_answer_images_json, source, material_id,
material_title, section_id, section_title, score_trend,
+ assessment_type, result, mastery_path_id, knowledge_point_id,
+ attempt_count, hints_used, confidence, response_time, quality,
is_correct, resolved, bookmarked, followup_session_id,
created_at, updated_at
- ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, '[]', ?, ?, ?, ?, ?, ?, ?, ?, 0, '', ?, ?)
+ ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, '[]', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 0, '', ?, ?)
ON CONFLICT(session_id, turn_id, question_id) DO UPDATE SET
question = excluded.question,
question_type = excluded.question_type,
@@ -2513,8 +2635,18 @@ class SQLiteSessionStore:
section_id = excluded.section_id,
section_title = excluded.section_title,
score_trend = excluded.score_trend,
+ assessment_type = excluded.assessment_type,
+ result = excluded.result,
+ mastery_path_id = excluded.mastery_path_id,
+ knowledge_point_id = excluded.knowledge_point_id,
+ attempt_count = excluded.attempt_count,
+ hints_used = excluded.hints_used,
+ confidence = excluded.confidence,
+ response_time = excluded.response_time,
+ quality = excluded.quality,
is_correct = excluded.is_correct,
resolved = CASE
+ WHEN excluded.result = 'ungraded' THEN notebook_entries.resolved
WHEN excluded.is_correct = 1 THEN 1
WHEN excluded.is_correct = 0 AND notebook_entries.is_correct = 1 THEN 0
ELSE notebook_entries.resolved
@@ -2533,8 +2665,9 @@ class SQLiteSessionStore:
item.get("difficulty") or "",
item.get("user_answer") or "",
*provenance,
+ *assessment,
is_correct,
- 1 if is_correct else 0,
+ resolved_on_insert,
now,
now,
),
@@ -2547,9 +2680,11 @@ class SQLiteSessionStore:
options_json, correct_answer, explanation, difficulty,
user_answer, user_answer_images_json, source, material_id,
material_title, section_id, section_title, score_trend,
+ assessment_type, result, mastery_path_id, knowledge_point_id,
+ attempt_count, hints_used, confidence, response_time, quality,
is_correct, resolved, bookmarked, followup_session_id,
created_at, updated_at
- ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 0, '', ?, ?)
+ ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 0, '', ?, ?)
ON CONFLICT(session_id, turn_id, question_id) DO UPDATE SET
question = excluded.question,
question_type = excluded.question_type,
@@ -2564,9 +2699,19 @@ class SQLiteSessionStore:
section_id = excluded.section_id,
section_title = excluded.section_title,
score_trend = excluded.score_trend,
+ assessment_type = excluded.assessment_type,
+ result = excluded.result,
+ mastery_path_id = excluded.mastery_path_id,
+ knowledge_point_id = excluded.knowledge_point_id,
+ attempt_count = excluded.attempt_count,
+ hints_used = excluded.hints_used,
+ confidence = excluded.confidence,
+ response_time = excluded.response_time,
+ quality = excluded.quality,
user_answer_images_json = excluded.user_answer_images_json,
is_correct = excluded.is_correct,
resolved = CASE
+ WHEN excluded.result = 'ungraded' THEN notebook_entries.resolved
WHEN excluded.is_correct = 1 THEN 1
WHEN excluded.is_correct = 0 AND notebook_entries.is_correct = 1 THEN 0
ELSE notebook_entries.resolved
@@ -2586,8 +2731,9 @@ class SQLiteSessionStore:
item.get("user_answer") or "",
images_json,
*provenance,
+ *assessment,
is_correct,
- 1 if is_correct else 0,
+ resolved_on_insert,
now,
now,
),
@@ -2599,6 +2745,87 @@ class SQLiteSessionStore:
async def upsert_notebook_entries(self, session_id: str, items: list[dict[str, Any]]) -> int:
return await self._run(self._upsert_notebook_entries_sync, session_id, items)
+ def _put_reading_quiz_pending_sync(
+ self, material_id: str, locator: int, questions: list[Any]
+ ) -> int:
+ material = str(material_id or "").strip()
+ if not material:
+ return 0
+ now = time.time()
+ with self._connect() as conn:
+ conn.execute(
+ "DELETE FROM reading_quiz_pending WHERE material_id = ? AND locator = ?",
+ (material, int(locator)),
+ )
+ stored = 0
+ for index, question in enumerate(questions or [], start=1):
+ if not isinstance(question, dict):
+ continue
+ question_id = str(question.get("id") or f"q_{index}").strip()
+ if not question_id:
+ continue
+ conn.execute(
+ """
+ INSERT INTO reading_quiz_pending (
+ material_id, locator, question_id, question_json, created_at
+ ) VALUES (?, ?, ?, ?, ?)
+ """,
+ (material, int(locator), question_id, _json_dumps(question), now),
+ )
+ stored += 1
+ conn.commit()
+ return stored
+
+ async def put_reading_quiz_pending(
+ self, material_id: str, locator: int, questions: list[Any]
+ ) -> int:
+ """Replace the server-side answer keys for one reading quiz."""
+ return await self._run(
+ self._put_reading_quiz_pending_sync, material_id, locator, list(questions or [])
+ )
+
+ def _get_reading_quiz_pending_sync(
+ self,
+ material_id: str,
+ locator: int,
+ question_ids: Sequence[str] | None = None,
+ ) -> dict[str, dict[str, Any]]:
+ material = str(material_id or "").strip()
+ sql = """
+ SELECT question_id, question_json FROM reading_quiz_pending
+ WHERE material_id = ? AND locator = ?
+ """
+ params: list[Any] = [material, int(locator)]
+ if question_ids is not None:
+ wanted = [str(qid).strip() for qid in question_ids if str(qid).strip()]
+ if not wanted:
+ return {}
+ placeholders = ",".join("?" for _ in wanted)
+ sql += f" AND question_id IN ({placeholders})" # nosec B608
+ params.extend(wanted)
+ with self._connect() as conn:
+ rows = conn.execute(sql, tuple(params)).fetchall()
+ pending: dict[str, dict[str, Any]] = {}
+ for row in rows:
+ parsed = _json_loads(row["question_json"], {})
+ if isinstance(parsed, dict):
+ pending[str(row["question_id"])] = parsed
+ return pending
+
+ async def get_reading_quiz_pending(
+ self,
+ material_id: str,
+ locator: int,
+ question_ids: Sequence[str] | None = None,
+ ) -> dict[str, dict[str, Any]]:
+ """Return stored reading-quiz items keyed by question id (includes answer keys)."""
+ return await self._run(
+ self._get_reading_quiz_pending_sync,
+ material_id,
+ locator,
+ None if question_ids is None else tuple(question_ids),
+ )
+
@staticmethod
def _serialize_notebook_entry(row: sqlite3.Row) -> dict[str, Any]:
keys = set(row.keys())
@@ -2607,6 +2834,13 @@ class SQLiteSessionStore:
raw_images = _json_loads(row["user_answer_images_json"], [])
if isinstance(raw_images, list):
images = [r for r in raw_images if isinstance(r, dict)]
+ is_correct = bool(row["is_correct"])
+ stored_result = (row["result"] or "") if "result" in keys else ""
+ if stored_result in ASSESSMENT_RESULTS:
+ result = stored_result
+ else:
+ result = "correct" if is_correct else "incorrect"
+ assessment_type = (row["assessment_type"] or "") if "assessment_type" in keys else ""
return {
"id": int(row["id"]),
"session_id": row["session_id"],
@@ -2621,14 +2855,31 @@ class SQLiteSessionStore:
"difficulty": row["difficulty"] or "",
"user_answer": row["user_answer"] or "",
"user_answer_images": images,
- "is_correct": bool(row["is_correct"]),
+ "is_correct": is_correct,
"source": (row["source"] or "deep_question") if "source" in keys else "deep_question",
"material_id": (row["material_id"] or "") if "material_id" in keys else "",
"material_title": (row["material_title"] or "") if "material_title" in keys else "",
"section_id": (row["section_id"] or "") if "section_id" in keys else "",
"section_title": (row["section_title"] or "") if "section_title" in keys else "",
"score_trend": (row["score_trend"] or "new") if "score_trend" in keys else "new",
- "resolved": bool(row["resolved"]) if "resolved" in keys else bool(row["is_correct"]),
+ "assessment_type": assessment_type,
+ "result": result,
+ "mastery_path_id": (row["mastery_path_id"] or "") if "mastery_path_id" in keys else "",
+ "knowledge_point_id": (row["knowledge_point_id"] or "")
+ if "knowledge_point_id" in keys
+ else "",
+ "attempt_count": int(row["attempt_count"]) if "attempt_count" in keys else 1,
+ "hints_used": int(row["hints_used"]) if "hints_used" in keys else 0,
+ "confidence": SQLiteSessionStore._optional_float(
+ row["confidence"] if "confidence" in keys else None
+ ),
+ "response_time": SQLiteSessionStore._optional_float(
+ row["response_time"] if "response_time" in keys else None
+ ),
+ "quality": SQLiteSessionStore._optional_float(
+ row["quality"] if "quality" in keys else None
+ ),
+ "resolved": bool(row["resolved"]) if "resolved" in keys else is_correct,
"bookmarked": bool(row["bookmarked"]),
"followup_session_id": row["followup_session_id"] or "",
"ai_judgment": (row["ai_judgment"] or "") if "ai_judgment" in keys else "",
@@ -2672,6 +2923,26 @@ class SQLiteSessionStore:
if query.is_correct is not None:
conditions.append("n.is_correct = ?")
params.append(1 if query.is_correct else 0)
+ if not query.is_correct:
+ conditions.append(_GRADED_RESULT_SQL)
+ if query.assessment_type:
+ conditions.append("n.assessment_type = ?")
+ params.append(query.assessment_type)
+ if query.result:
+ if query.result in {"correct", "incorrect"}:
+ conditions.append(
+ "(n.result = ? OR (COALESCE(n.result, '') = '' AND n.is_correct = ?))"
+ )
+ params.extend([query.result, 1 if query.result == "correct" else 0])
+ else:
+ conditions.append("n.result = ?")
+ params.append(query.result)
+ if query.mastery_path_id:
+ conditions.append("n.mastery_path_id = ?")
+ params.append(query.mastery_path_id)
+ if query.knowledge_point_id:
+ conditions.append("n.knowledge_point_id = ?")
+ params.append(query.knowledge_point_id)
if query.source:
conditions.append("n.source = ?")
params.append(query.source)
@@ -2746,6 +3017,8 @@ class SQLiteSessionStore:
n.correct_answer, n.explanation, n.difficulty,
n.user_answer, n.user_answer_images_json, n.source, n.material_id,
n.material_title, n.section_id, n.section_title, n.score_trend,
+ n.assessment_type, n.result, n.mastery_path_id, n.knowledge_point_id,
+ n.attempt_count, n.hints_used, n.confidence, n.response_time, n.quality,
n.is_correct, n.resolved, n.bookmarked,
n.followup_session_id, n.ai_judgment, n.created_at, n.updated_at
FROM notebook_entries n
@@ -2785,6 +3058,10 @@ class SQLiteSessionStore:
source: str = "",
material_id: str = "",
section_id: str = "",
+ assessment_type: str = "",
+ result: str = "",
+ mastery_path_id: str = "",
+ knowledge_point_id: str = "",
resolved: bool | None = None,
score_trend: str = "",
search: str = "",
@@ -2802,6 +3079,10 @@ class SQLiteSessionStore:
source=source,
material_id=material_id,
section_id=section_id,
+ assessment_type=assessment_type,
+ result=result,
+ mastery_path_id=mastery_path_id,
+ knowledge_point_id=knowledge_point_id,
resolved=resolved,
score_trend=score_trend,
search=search,
@@ -2829,8 +3110,8 @@ class SQLiteSessionStore:
f"""
SELECT
COUNT(*) AS total,
- COALESCE(SUM(CASE WHEN is_correct = 0 THEN 1 ELSE 0 END), 0) AS wrong,
- COALESCE(SUM(CASE WHEN is_correct = 0 AND resolved = 0 THEN 1 ELSE 0 END), 0) AS unresolved,
+ COALESCE(SUM(CASE WHEN is_correct = 0 AND {_GRADED_RESULT_SQL_UNALIASED} THEN 1 ELSE 0 END), 0) AS wrong,
+ COALESCE(SUM(CASE WHEN is_correct = 0 AND resolved = 0 AND {_GRADED_RESULT_SQL_UNALIASED} THEN 1 ELSE 0 END), 0) AS unresolved,
COALESCE(SUM(CASE WHEN bookmarked = 1 THEN 1 ELSE 0 END), 0) AS bookmarked,
COALESCE(SUM(
CASE WHEN NOT EXISTS (
@@ -2901,7 +3182,7 @@ class SQLiteSessionStore:
material_id,
COALESCE(NULLIF(MAX(material_title), ''), material_id, 'Unnamed material') AS material_title,
COUNT(*) AS entry_count,
- COALESCE(SUM(CASE WHEN is_correct = 0 AND resolved = 0 THEN 1 ELSE 0 END), 0) AS unresolved_count
+ COALESCE(SUM(CASE WHEN is_correct = 0 AND resolved = 0 AND {_GRADED_RESULT_SQL_UNALIASED} THEN 1 ELSE 0 END), 0) AS unresolved_count
FROM notebook_entries
WHERE {where}
GROUP BY source, material_id
diff --git a/tests/api/test_book_quiz_attempt_notebook.py b/tests/api/test_book_quiz_attempt_notebook.py
index 35aa20bd4..c22569fa8 100644
--- a/tests/api/test_book_quiz_attempt_notebook.py
+++ b/tests/api/test_book_quiz_attempt_notebook.py
@@ -89,6 +89,8 @@ def test_quiz_attempt_syncs_focus_check_to_question_bank(tmp_path, monkeypatch)
assert entry["session_title"] == "Page 1 chat"
assert entry["question"] == "Which chapter?"
assert entry["source"] == "book"
+ assert entry["assessment_type"] == "focus_check"
+ assert entry["result"] == "incorrect"
assert entry["material_id"] == "book-1"
assert entry["material_title"] == "Compiled Book"
assert entry["section_id"] == "page-1"
diff --git a/tests/api/test_notebook_router.py b/tests/api/test_notebook_router.py
index b8a29ee25..f51d74a6d 100644
--- a/tests/api/test_notebook_router.py
+++ b/tests/api/test_notebook_router.py
@@ -542,3 +542,95 @@ def test_lookup_missing_entry_returns_204_when_missing_ok(store: SQLiteSessionSt
)
assert resp.status_code == 204
assert resp.content == b""
+
+
+def test_assessment_v2_fields_round_trip_and_filters(store: SQLiteSessionStore) -> None:
+ session = asyncio.run(store.create_session(title="Review"))
+ asyncio.run(
+ store.upsert_notebook_entries(
+ session["id"],
+ [
+ {
+ "question_id": "graded-wrong",
+ "question": "Wrong?",
+ "is_correct": False,
+ "result": "incorrect",
+ "assessment_type": "quiz",
+ "source": "mastery_path",
+ "mastery_path_id": "path-1",
+ "knowledge_point_id": "kp-1",
+ },
+ {
+ "question_id": "ungraded",
+ "question": "Pending?",
+ "is_correct": False,
+ "result": "ungraded",
+ "assessment_type": "review",
+ },
+ {
+ "question_id": "book-old",
+ "question": "Chapter?",
+ "is_correct": False,
+ "source": "book",
+ "material_id": "book-1",
+ },
+ ],
+ )
+ )
+
+ with TestClient(_build_app(store)) as client:
+ all_rows = client.get("/api/question-notebook/entries").json()
+ assert all_rows["total"] == 3
+ ungraded = next(item for item in all_rows["items"] if item["question_id"] == "ungraded")
+ assert ungraded["result"] == "ungraded"
+ old_book = next(item for item in all_rows["items"] if item["question_id"] == "book-old")
+ assert old_book["source"] == "book"
+ assert old_book["result"] == "incorrect"
+
+ wrong = client.get("/api/question-notebook/entries", params={"is_correct": "false"}).json()
+ assert {item["question_id"] for item in wrong["items"]} == {"graded-wrong", "book-old"}
+
+ by_type = client.get(
+ "/api/question-notebook/entries", params={"assessment_type": "quiz"}
+ ).json()
+ assert {item["question_id"] for item in by_type["items"]} == {"graded-wrong"}
+
+ by_result = client.get(
+ "/api/question-notebook/entries", params={"result": "ungraded"}
+ ).json()
+ assert {item["question_id"] for item in by_result["items"]} == {"ungraded"}
+
+ by_link = client.get(
+ "/api/question-notebook/entries",
+ params={"mastery_path_id": "path-1", "knowledge_point_id": "kp-1"},
+ ).json()
+ assert {item["question_id"] for item in by_link["items"]} == {"graded-wrong"}
+
+ eid = next(
+ item["id"] for item in all_rows["items"] if item["question_id"] == "graded-wrong"
+ )
+ client.patch(f"/api/question-notebook/entries/{eid}", json={"resolved": True})
+ resolved = client.get("/api/question-notebook/entries", params={"resolved": "true"}).json()
+ assert eid in {item["id"] for item in resolved["items"]}
+ client.patch(f"/api/question-notebook/entries/{eid}", json={"resolved": False})
+ unresolved = client.get(
+ "/api/question-notebook/entries", params={"resolved": "false", "is_correct": "false"}
+ ).json()
+ assert eid in {item["id"] for item in unresolved["items"]}
+
+ client.post(
+ "/api/question-notebook/entries/upsert",
+ json={
+ "session_id": session["id"],
+ "question_id": "graded-wrong",
+ "question": "Wrong?",
+ "is_correct": False,
+ "result": "incorrect",
+ "assessment_type": "quiz",
+ "source": "mastery_path",
+ "mastery_path_id": "path-1",
+ "knowledge_point_id": "kp-1",
+ },
+ )
+ after = client.get("/api/question-notebook/entries").json()
+ assert after["total"] == 3
diff --git a/tests/api/test_reading_quiz_answers.py b/tests/api/test_reading_quiz_answers.py
new file mode 100644
index 000000000..1bdc8cff8
--- /dev/null
+++ b/tests/api/test_reading_quiz_answers.py
@@ -0,0 +1,192 @@
+"""Tests for the Immersive Reading Focus-Check answer endpoint.
+
+The endpoint is where browser-graded reading quizzes become durable review
+records: the server grades each submission against its own stored answer key
+(the browser sends only the chosen index), records ``immersive_reading``
+entries into the unified Question Notebook, and never fabricates data when no
+real conversation exists.
+"""
+
+from __future__ import annotations
+
+import asyncio
+import importlib
+from pathlib import Path
+from typing import Any
+
+import pytest
+
+pytest.importorskip("fastapi")
+
+FastAPI = pytest.importorskip("fastapi").FastAPI
+TestClient = pytest.importorskip("fastapi.testclient").TestClient
+reading_router = importlib.import_module("deeptutor.api.routers.reading_extensions").router
+
+from deeptutor.services.session.sqlite_store import SQLiteSessionStore
+
+MATERIAL_ID = "m-atlas"
+LOCATOR = 4
+
+
+class _StubManifest:
+ title = "Test Material"
+
+
+class _StubReadingStore:
+ def __init__(self) -> None:
+ pass
+
+ def manifest(self, material_id: str) -> Any:
+ return _StubManifest()
+
+
+def _build_app(store: SQLiteSessionStore) -> FastAPI:
+ app = FastAPI()
+ app.include_router(reading_router, prefix="/api/reading")
+ return app
+
+
+def store(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> SQLiteSessionStore:
+ instance = SQLiteSessionStore(db_path=tmp_path / "reading-quiz.db")
+ monkeypatch.setattr(
+ "deeptutor.api.routers.reading_extensions.assert_learning_material",
+ lambda material_id: None,
+ )
+ monkeypatch.setattr(
+ "deeptutor.services.session.get_sqlite_session_store",
+ lambda: instance,
+ )
+ monkeypatch.setattr(
+ "deeptutor.api.routers.reading_extensions.ReadingStore",
+ _StubReadingStore,
+ )
+ return instance
+
+
+def _quiz_questions() -> list[dict]:
+ return [
+ {
+ "id": "q_1",
+ "prompt": "Which ocean?",
+ "choices": ["Pacific", "Atlantic"],
+ "correct_choice_index": 1,
+ },
+ {
+ "id": "q_2",
+ "prompt": "2+2?",
+ "choices": ["3", "4", "5"],
+ "correct_choice_index": 1,
+ },
+ ]
+
+
+def _answers(*pairs: tuple[str, int]) -> list[dict]:
+ return [{"question_id": qid, "selected_index": index} for qid, index in pairs]
+
+
+def _payload(**overrides) -> dict:
+ values: dict = {
+ "locator": LOCATOR,
+ "section_title": "Atlas preface",
+ "session_id": "reading-session",
+ "turn_id": "",
+ "answers": _answers(("q_1", 1), ("q_2", 0)),
+ }
+ values.update(overrides)
+ return values
+
+
+def test_focus_check_entries_land_in_unified_list(
+ store: SQLiteSessionStore,
+) -> None:
+ asyncio.run(store.create_session(title="Reading", session_id="reading-session"))
+ asyncio.run(store.put_reading_quiz_pending(MATERIAL_ID, LOCATOR, _quiz_questions()))
+
+ with TestClient(_build_app(store)) as client:
+ resp = client.post(
+ f"/api/reading/materials/{MATERIAL_ID}/extensions/quiz/answers",
+ json=_payload(),
+ )
+ assert resp.status_code == 200
+ verdicts = {(item["question_id"]): item for item in resp.json()["answers"]}
+ assert verdicts["q_1"]["is_correct"] is True
+ assert verdicts["q_1"]["result"] == "correct"
+ assert verdicts["q_2"]["is_correct"] is False
+ assert verdicts["q_2"]["result"] == "incorrect"
+
+ listing = asyncio.run(
+ store.list_notebook_entries(session_id="reading-session", source="immersive_reading")
+ )
+ assert listing["total"] == 2
+ by_id = {item["question_id"]: item for item in listing["items"]}
+ assert by_id["q_1"]["result"] == "correct"
+ assert by_id["q_1"]["is_correct"] is True
+ assert by_id["q_2"]["result"] == "incorrect"
+ for item in listing["items"]:
+ assert item["source"] == "immersive_reading"
+ assert item["assessment_type"] == "focus_check"
+ assert item["material_id"] == MATERIAL_ID
+ assert item["material_title"] == "Test Material"
+ assert item["section_id"] == str(LOCATOR)
+ assert item["section_title"] == "Atlas preface"
+ assert item["question_type"] == "choice"
+ # The stored reference answer is the server's own text, never a client value.
+ assert by_id["q_1"]["correct_answer"] == "Atlantic"
+ assert by_id["q_1"]["user_answer"] == "Atlantic"
+ assert by_id["q_2"]["user_answer"] == "3"
+
+
+def test_no_session_degrades_without_fabricating_data(store: SQLiteSessionStore) -> None:
+ asyncio.run(store.put_reading_quiz_pending(MATERIAL_ID, LOCATOR, _quiz_questions()))
+ with TestClient(_build_app(store)) as client:
+ resp = client.post(
+ f"/api/reading/materials/{MATERIAL_ID}/extensions/quiz/answers",
+ json=_payload(session_id="", turn_id=""),
+ )
+ assert resp.status_code == 200
+ assert resp.json()["answers"][0]["is_correct"] is True
+ listing = asyncio.run(store.list_notebook_entries())
+ assert listing["total"] == 0
+
+
+def test_missing_answer_key_is_409(store: SQLiteSessionStore) -> None:
+ # Nothing was persisted when the quiz was generated.
+ with TestClient(_build_app(store)) as client:
+ resp = client.post(
+ f"/api/reading/materials/{MATERIAL_ID}/extensions/quiz/answers",
+ json=_payload(),
+ )
+ assert resp.status_code == 409
+
+
+def test_grading_uses_server_key_not_client_submission(store: SQLiteSessionStore) -> None:
+ asyncio.run(store.create_session(title="Reading", session_id="reading-session"))
+ asyncio.run(store.put_reading_quiz_pending(MATERIAL_ID, LOCATOR, _quiz_questions()))
+ payload = _payload(answers=_answers(("q_1", 1)))
+ with TestClient(_build_app(store)) as client:
+ resp = client.post(
+ f"/api/reading/materials/{MATERIAL_ID}/extensions/quiz/answers",
+ json=payload,
+ )
+ assert resp.status_code == 200
+ assert resp.json()["answers"] == [
+ {"question_id": "q_1", "is_correct": True, "result": "correct"}
+ ]
+
+
+def test_repeat_submission_is_idempotent(store: SQLiteSessionStore) -> None:
+ asyncio.run(store.create_session(title="Reading", session_id="reading-session"))
+ asyncio.run(store.put_reading_quiz_pending(MATERIAL_ID, LOCATOR, _quiz_questions()))
+ with TestClient(_build_app(store)) as client:
+ first = client.post(
+ f"/api/reading/materials/{MATERIAL_ID}/extensions/quiz/answers",
+ json=_payload(),
+ )
+ second = client.post(
+ f"/api/reading/materials/{MATERIAL_ID}/extensions/quiz/answers",
+ json=_payload(),
+ )
+ assert first.status_code == second.status_code == 200
+ listing = asyncio.run(store.list_notebook_entries(session_id="reading-session"))
+ assert listing["total"] == 2
diff --git a/tests/reading/test_extension_router.py b/tests/reading/test_extension_router.py
index c650f4c15..73fbd459e 100644
--- a/tests/reading/test_extension_router.py
+++ b/tests/reading/test_extension_router.py
@@ -163,6 +163,24 @@ def test_hanging_extension_action_times_out(material, monkeypatch):
assert response.json()["detail"]["recoverable"] is True
+def test_language_model_errors_are_reported_distinctly(material, monkeypatch):
+ from deeptutor.services.llm.exceptions import LLMAuthenticationError
+
+ def run(*_args):
+ raise LLMAuthenticationError("Invalid API key")
+
+ client = _client(monkeypatch, _extension(run))
+ response = client.post(
+ f"/api/reading/materials/{material.material_id}/extensions/sample/actions/open",
+ json={"locator": 1},
+ )
+
+ assert response.status_code == 503
+ detail = response.json()["detail"]
+ assert detail["recoverable"] is True
+ assert "language model" in detail["message"].lower()
+
+
def test_timed_out_sync_extension_opens_circuit_without_queueing(material, monkeypatch):
release = threading.Event()
calls = 0
@@ -188,6 +206,73 @@ def test_timed_out_sync_extension_opens_circuit_without_queueing(material, monke
assert first.status_code == 503
assert second.status_code == 503
+ assert first.json()["detail"]["reason"] == "timed_out"
assert calls == 1
finally:
release.set()
+
+
+def test_timed_out_async_extension_can_retry(material, monkeypatch):
+ calls = 0
+
+ async def run(*_args):
+ nonlocal calls
+ calls += 1
+ if calls == 1:
+ await asyncio.sleep(1)
+ return ReadingExtensionResult(type="card")
+
+ monkeypatch.setattr(reading_extensions, "ACTION_TIMEOUT_S", 0.01)
+ client = _client(monkeypatch, _extension(run))
+
+ first = client.post(
+ f"/api/reading/materials/{material.material_id}/extensions/sample/actions/open",
+ json={"locator": 1},
+ )
+ second = client.post(
+ f"/api/reading/materials/{material.material_id}/extensions/sample/actions/open",
+ json={"locator": 1},
+ )
+
+ assert first.status_code == 503
+ assert first.json()["detail"]["reason"] == "timed_out"
+ assert second.status_code == 200
+ assert calls == 2
+
+
+def test_async_extension_ignores_stale_circuit(material, monkeypatch):
+ async def run(*_args):
+ return ReadingExtensionResult(type="card", payload={"body": "ok"})
+
+ extension = _extension(run)
+ registry = ReadingExtensionRegistry([extension])
+ registry.mark_timed_out("sample")
+ monkeypatch.setattr(
+ reading_extensions,
+ "get_reading_extension_registry",
+ lambda: registry,
+ )
+ app = FastAPI()
+ app.include_router(reading_extensions.router, prefix="/api/reading")
+ client = TestClient(app)
+
+ response = client.post(
+ f"/api/reading/materials/{material.material_id}/extensions/sample/actions/open",
+ json={"locator": 1},
+ )
+
+ assert response.status_code == 200, response.text
+ assert response.json()["type"] == "card"
+
+
+def test_plugin_exception_reason_is_returned(material, monkeypatch):
+ client = _client(
+ monkeypatch,
+ _extension(lambda *_: (_ for _ in ()).throw(RuntimeError("broken plugin"))),
+ )
+ response = client.post(
+ f"/api/reading/materials/{material.material_id}/extensions/sample/actions/open",
+ json={"locator": 1},
+ )
+ assert response.status_code == 503
+ assert response.json()["detail"]["reason"] == "broken plugin"
diff --git a/tests/services/session/test_sqlite_store.py b/tests/services/session/test_sqlite_store.py
index d7b78a3d3..4de350336 100644
--- a/tests/services/session/test_sqlite_store.py
+++ b/tests/services/session/test_sqlite_store.py
@@ -491,6 +491,34 @@ def test_list_entries_filters_is_correct(store: SQLiteSessionStore) -> None:
assert wrong["items"][0]["question_id"] == "q1"
+def test_ungraded_rows_are_not_listed_as_wrong(store: SQLiteSessionStore) -> None:
+ session = asyncio.run(store.create_session())
+ asyncio.run(
+ store.upsert_notebook_entries(
+ session["id"],
+ [
+ {
+ "question_id": "wrong",
+ "question": "Wrong?",
+ "is_correct": False,
+ "result": "incorrect",
+ },
+ {
+ "question_id": "pending",
+ "question": "Pending?",
+ "is_correct": False,
+ "result": "ungraded",
+ },
+ ],
+ )
+ )
+ wrong = asyncio.run(store.list_notebook_entries(is_correct=False))
+ assert [item["question_id"] for item in wrong["items"]] == ["wrong"]
+ stats = asyncio.run(store.question_bank_stats())
+ assert stats["wrong"] == 1
+ assert stats["unresolved"] == 1
+
+
def test_notebook_review_metadata_filters_and_transitions(
store: SQLiteSessionStore,
) -> None:
diff --git a/web/components/reading/ReaderPane.tsx b/web/components/reading/ReaderPane.tsx
index 30d4db694..238a59049 100644
--- a/web/components/reading/ReaderPane.tsx
+++ b/web/components/reading/ReaderPane.tsx
@@ -905,6 +905,7 @@ export function ReaderPane({
locator={currentLocator}
selectionLocator={selection?.locator}
selection={selection?.quote}
+ sessionId={sessionId}
onError={setError}
/>
)}
diff --git a/web/components/reading/ReadingExtensionBar.tsx b/web/components/reading/ReadingExtensionBar.tsx
index 4fff4fea9..a10cc3f3d 100644
--- a/web/components/reading/ReadingExtensionBar.tsx
+++ b/web/components/reading/ReadingExtensionBar.tsx
@@ -6,6 +6,7 @@ import { useTranslation } from "react-i18next";
import {
listReadingExtensions,
runReadingExtension,
+ submitReadingQuizAnswers,
type ReadingExtensionManifest,
type ReadingExtensionResult,
} from "@/lib/reading-api";
@@ -34,6 +35,7 @@ export function ReadingExtensionBar({
locator,
selectionLocator,
selection,
+ sessionId,
onError,
}: {
materialId: string;
@@ -47,6 +49,7 @@ export function ReadingExtensionBar({
*/
selectionLocator?: number;
selection?: string;
+ sessionId?: string | null;
onError: (message: string) => void;
}) {
const { i18n, t } = useTranslation();
@@ -148,7 +151,7 @@ export function ReadingExtensionBar({
const needsSelection =
action.requires.includes("selection") && !selection?.trim();
// `busy === key`, not `Boolean(busy)`: an action can take the full
- // 30s server timeout, and disabling all six meanwhile is
+ // server timeout, and disabling all six meanwhile is
// indistinguishable from the toolbar being broken.
const disabled = busy === key || needsSelection;
const builtInLabel = builtInActionLabel(extension.id, action.id);
@@ -198,8 +201,12 @@ export function ReadingExtensionBar({
{result && result.type !== "browser_speech" ? (
<ExtensionResult
result={result}
+ materialId={materialId}
+ locator={selection?.trim() ? (selectionLocator ?? locator) : locator}
+ sessionId={sessionId}
closeLabel={t("Close")}
onClose={() => setResult(null)}
+ onError={onError}
/>
) : null}
</>
@@ -230,12 +237,20 @@ function builtInActionLabel(extensionId: string, actionId: string) {
function ExtensionResult({
result,
+ materialId,
+ locator,
+ sessionId,
closeLabel,
onClose,
+ onError,
}: {
result: ReadingExtensionResult;
+ materialId: string;
+ locator: number;
+ sessionId?: string | null;
closeLabel: string;
onClose: () => void;
+ onError: (message: string) => void;
}) {
const questions = Array.isArray(result.payload.questions)
? (result.payload.questions as QuizQuestion[])
@@ -331,15 +346,46 @@ function ExtensionResult({
))}
</dl>
) : null}
- {questions.length ? <QuizQuestions questions={questions} /> : null}
+ {questions.length ? (
+ <QuizQuestions
+ questions={questions}
+ materialId={materialId}
+ locator={locator}
+ sessionId={sessionId}
+ onError={onError}
+ />
+ ) : null}
</section>
);
}
-function QuizQuestions({ questions }: { questions: QuizQuestion[] }) {
+function QuizQuestions({
+ questions,
+ materialId,
+ locator,
+ sessionId,
+ onError,
+}: {
+ questions: QuizQuestion[];
+ materialId: string;
+ locator: number;
+ sessionId?: string | null;
+ onError: (message: string) => void;
+}) {
const { t } = useTranslation();
const [answers, setAnswers] = useState<Record<string, number>>({});
+ function persistAnswer(question: QuizQuestion, index: number, choiceIndex: number) {
+ const questionId = question.id || `q_${index + 1}`;
+ void submitReadingQuizAnswers(materialId, {
+ locator,
+ session_id: sessionId || "",
+ answers: [{ question_id: questionId, selected_index: choiceIndex }],
+ }).catch((error) => {
+ onError(error instanceof Error ? error.message : String(error));
+ });
+ }
+
return questions.map((question, index) => {
const key = question.id || String(index);
const selected = answers[key];
@@ -369,9 +415,10 @@ function QuizQuestions({ questions }: { questions: QuizQuestion[] }) {
key={choice}
type="button"
aria-pressed={selected === choiceIndex}
- onClick={() =>
- setAnswers((current) => ({ ...current, [key]: choiceIndex }))
- }
+ onClick={() => {
+ setAnswers((current) => ({ ...current, [key]: choiceIndex }));
+ persistAnswer(question, index, choiceIndex);
+ }}
className="rounded-md border border-[var(--border)] px-2 py-1.5 text-left text-[var(--muted-foreground)] transition hover:bg-[var(--muted)] aria-pressed:bg-[var(--muted)] aria-pressed:text-[var(--foreground)]"
>
{String.fromCharCode(65 + choiceIndex)}. {choice}
diff --git a/web/components/space/question-bank/QuestionCard.tsx b/web/components/space/question-bank/QuestionCard.tsx
index 2435e8298..263d62870 100644
--- a/web/components/space/question-bank/QuestionCard.tsx
+++ b/web/components/space/question-bank/QuestionCard.tsx
@@ -13,6 +13,7 @@ import {
X,
} from "lucide-react";
import type { NotebookCategory, NotebookEntry } from "@/lib/notebook-api";
+import { optionIsAnswer } from "@/lib/question-bank-answers";
import { bookRoute } from "@/lib/resource-routes";
import CategoryMenu from "./CategoryMenu";
@@ -28,6 +29,13 @@ const SOURCE_LABELS: Record<NotebookEntry["source"], string> = {
book: "Book",
};
+const ASSESSMENT_TYPE_LABELS: Record<string, string> = {
+ quiz: "Quiz",
+ focus_check: "Focus Check",
+ qualitative: "Qualitative",
+ review: "Review",
+};
+
const TREND_LABELS: Record<NotebookEntry["score_trend"], string> = {
new: "First Attempt",
improved: "Improved",
@@ -35,6 +43,43 @@ const TREND_LABELS: Record<NotebookEntry["score_trend"], string> = {
unchanged: "Unchanged",
};
+function entryResult(entry: NotebookEntry): string {
+ if (entry.result) return entry.result;
+ return entry.is_correct ? "correct" : "incorrect";
+}
+
+function resultBadge(entry: NotebookEntry): {
+ label: string;
+ className: string;
+} {
+ const result = entryResult(entry);
+ if (result === "partial") {
+ return {
+ label: "Partially Correct",
+ className:
+ "bg-amber-100 text-amber-700 dark:bg-amber-950/30 dark:text-amber-400",
+ };
+ }
+ if (result === "ungraded") {
+ return {
+ label: "Not Graded",
+ className:
+ "bg-[var(--muted)] text-[var(--muted-foreground)]",
+ };
+ }
+ if (result === "correct" || entry.is_correct) {
+ return {
+ label: "Correct",
+ className:
+ "bg-green-100 text-green-700 dark:bg-green-950/30 dark:text-green-400",
+ };
+ }
+ return {
+ label: "Incorrect",
+ className: "bg-red-100 text-red-700 dark:bg-red-950/30 dark:text-red-400",
+ };
+}
+
interface QuestionCardProps {
entry: NotebookEntry;
categories: NotebookCategory[];
@@ -125,6 +170,9 @@ export default function QuestionCard({
const hasOptions = Object.keys(options).length > 0;
const isCode = entry.question_type === "coding";
const filed = entry.categories || [];
+ const result = entryResult(entry);
+ const badge = resultBadge(entry);
+ const showReviewState = result === "incorrect" || result === "partial";
return (
<li
@@ -148,13 +196,9 @@ export default function QuestionCard({
<div className="min-w-0 flex-1">
<div className="mb-1.5 flex flex-wrap items-center gap-1.5">
<span
- className={`rounded-md px-1.5 py-0.5 text-[10px] font-semibold ${
- entry.is_correct
- ? "bg-green-100 text-green-700 dark:bg-green-950/30 dark:text-green-400"
- : "bg-red-100 text-red-700 dark:bg-red-950/30 dark:text-red-400"
- }`}
+ className={`rounded-md px-1.5 py-0.5 text-[10px] font-semibold ${badge.className}`}
>
- {entry.is_correct ? t("Correct") : t("Incorrect")}
+ {t(badge.label)}
</span>
{entry.difficulty && (
<span
@@ -175,14 +219,19 @@ export default function QuestionCard({
</span>
)}
<span className="rounded-md bg-[var(--muted)] px-1.5 py-0.5 text-[10px] font-medium text-[var(--muted-foreground)]">
- {t(SOURCE_LABELS[entry.source] || "Deep Question")}
+ {t(SOURCE_LABELS[entry.source] || "Unknown Source")}
</span>
+ {entry.assessment_type && ASSESSMENT_TYPE_LABELS[entry.assessment_type] ? (
+ <span className="rounded-md bg-[var(--muted)] px-1.5 py-0.5 text-[10px] font-medium text-[var(--muted-foreground)]">
+ {t(ASSESSMENT_TYPE_LABELS[entry.assessment_type])}
+ </span>
+ ) : null}
{entry.score_trend && (
<span className="rounded-md bg-[var(--muted)] px-1.5 py-0.5 text-[10px] font-medium text-[var(--muted-foreground)]">
{t(TREND_LABELS[entry.score_trend] || "First Attempt")}
</span>
)}
- {!entry.is_correct && (
+ {showReviewState && (
<span
className={`rounded-md px-1.5 py-0.5 text-[10px] font-semibold ${
entry.resolved
@@ -230,7 +279,7 @@ export default function QuestionCard({
fill={entry.bookmarked ? "currentColor" : "none"}
/>
</button>
- {!entry.is_correct && (
+ {showReviewState && (
<button
type="button"
onClick={onToggleResolved}
@@ -266,11 +315,15 @@ export default function QuestionCard({
{hasOptions && (
<div className="space-y-1">
{Object.entries(options).map(([key, text]) => {
- const isUserAnswer =
- entry.user_answer?.toUpperCase() === key.toUpperCase();
+ const isUserAnswer = optionIsAnswer(
+ key,
+ text,
+ entry.user_answer || "",
+ );
const isCorrectAnswer =
- entry.correct_answer?.toUpperCase() === key.toUpperCase();
- const isWrongPick = isUserAnswer && !entry.is_correct;
+ result !== "ungraded" &&
+ optionIsAnswer(key, text, entry.correct_answer || "");
+ const isWrongPick = isUserAnswer && result === "incorrect";
return (
<div
key={key}
@@ -326,9 +379,17 @@ export default function QuestionCard({
{!hasOptions && (
<div className="grid gap-2 sm:grid-cols-2">
<AnswerBlock
- label={`${t("Your Answer")} ${entry.is_correct ? "✓" : "✗"}`}
+ label={`${t("Your Answer")}${
+ result === "correct" ? " ✓" : result === "incorrect" ? " ✗" : ""
+ }`}
body={entry.user_answer}
- tone={entry.is_correct ? "correct" : "wrong"}
+ tone={
+ result === "correct"
+ ? "correct"
+ : result === "incorrect"
+ ? "wrong"
+ : "neutral"
+ }
isCode={isCode}
/>
<AnswerBlock
@@ -397,6 +458,12 @@ export default function QuestionCard({
{entry.section_title ? ` · ${entry.section_title}` : ""}
</span>
)}
+ {entry.source === "immersive_reading" &&
+ (entry.material_title || entry.section_title || entry.material_id) && (
+ <span className="inline-flex items-center rounded-md border border-[var(--border)] bg-[var(--muted)]/40 px-2 py-0.5 text-[var(--muted-foreground)]">
+ {entry.section_title || entry.material_title || entry.material_id}
+ </span>
+ )}
{entry.followup_session_id && (
<Link
href={`/chat/${encodeURIComponent(entry.followup_session_id)}`}
diff --git a/web/contracts/generated/api.ts b/web/contracts/generated/api.ts
index 4e0342db5..38d17b7f2 100644
--- a/web/contracts/generated/api.ts
+++ b/web/contracts/generated/api.ts
@@ -5831,6 +5831,23 @@ export interface paths {
readonly patch?: never;
readonly trace?: never;
};
+ readonly "/api/reading/materials/{material_id}/extensions/quiz/answers": {
+ readonly parameters: {
+ readonly query?: never;
+ readonly header?: never;
+ readonly path?: never;
+ readonly cookie?: never;
+ };
+ readonly get?: never;
+ readonly put?: never;
+ /** Submit Quiz Answers */
+ readonly post: operations["submit_quiz_answers_api_reading_materials__material_id__extensions_quiz_answers_post"];
+ readonly delete?: never;
+ readonly options?: never;
+ readonly head?: never;
+ readonly patch?: never;
+ readonly trace?: never;
+ };
readonly "/api/reading/materials/{material_id}/position": {
readonly parameters: {
readonly query?: never;
@@ -6397,6 +6414,23 @@ export interface paths {
readonly patch: operations["update_session_organization_api_sessions__session_id__organization_patch"];
readonly trace?: never;
};
+ readonly "/api/sessions/{session_id}/purge": {
+ readonly parameters: {
+ readonly query?: never;
+ readonly header?: never;
+ readonly path?: never;
+ readonly cookie?: never;
+ };
+ readonly get?: never;
+ readonly put?: never;
+ readonly post?: never;
+ /** Purge Session */
+ readonly delete: operations["purge_session_api_sessions__session_id__purge_delete"];
+ readonly options?: never;
+ readonly head?: never;
+ readonly patch?: never;
+ readonly trace?: never;
+ };
readonly "/api/sessions/{session_id}/quiz-results": {
readonly parameters: {
readonly query?: never;
@@ -6414,6 +6448,40 @@ export interface paths {
readonly patch?: never;
readonly trace?: never;
};
+ readonly "/api/sessions/{session_id}/restore": {
+ readonly parameters: {
+ readonly query?: never;
+ readonly header?: never;
+ readonly path?: never;
+ readonly cookie?: never;
+ };
+ readonly get?: never;
+ readonly put?: never;
+ /** Restore Session */
+ readonly post: operations["restore_session_api_sessions__session_id__restore_post"];
+ readonly delete?: never;
+ readonly options?: never;
+ readonly head?: never;
+ readonly patch?: never;
+ readonly trace?: never;
+ };
+ readonly "/api/sessions/recycle-bin": {
+ readonly parameters: {
+ readonly query?: never;
+ readonly header?: never;
+ readonly path?: never;
+ readonly cookie?: never;
+ };
+ /** List Recycle Bin */
+ readonly get: operations["list_recycle_bin_api_sessions_recycle_bin_get"];
+ readonly put?: never;
+ readonly post?: never;
+ readonly delete?: never;
+ readonly options?: never;
+ readonly head?: never;
+ readonly patch?: never;
+ readonly trace?: never;
+ };
readonly "/api/sessions/search": {
readonly parameters: {
readonly query?: never;
@@ -8893,6 +8961,122 @@ export interface paths {
readonly patch?: never;
readonly trace?: never;
};
+ readonly "/files/library/": {
+ readonly parameters: {
+ readonly query?: never;
+ readonly header?: never;
+ readonly path?: never;
+ readonly cookie?: never;
+ };
+ /**
+ * List Library Files
+ * @description List active library entries, newest first.
+ */
+ readonly get: operations["library_list"];
+ readonly put?: never;
+ /**
+ * Add Library File
+ * @description Add a file to the library.
+ *
+ * The request must be ``multipart/form-data`` with a ``file`` field containing
+ * the raw bytes. If a file with the same SHA-256 content hash already exists
+ * in the library, returns the existing entry (deduplication).
+ */
+ readonly post: operations["library_add"];
+ readonly delete?: never;
+ readonly options?: never;
+ readonly head?: never;
+ readonly patch?: never;
+ readonly trace?: never;
+ };
+ readonly "/files/library/{file_id}": {
+ readonly parameters: {
+ readonly query?: never;
+ readonly header?: never;
+ readonly path?: never;
+ readonly cookie?: never;
+ };
+ /**
+ * Get Library File
+ * @description Get a single library entry by id (includes soft-deleted).
+ */
+ readonly get: operations["library_get"];
+ readonly put?: never;
+ readonly post?: never;
+ /**
+ * Delete Library File
+ * @description Soft-delete a library file (sets is_deleted=1).
+ */
+ readonly delete: operations["library_delete"];
+ readonly options?: never;
+ readonly head?: never;
+ readonly patch?: never;
+ readonly trace?: never;
+ };
+ readonly "/files/library/{file_id}/download": {
+ readonly parameters: {
+ readonly query?: never;
+ readonly header?: never;
+ readonly path?: never;
+ readonly cookie?: never;
+ };
+ /**
+ * Download Library File
+ * @description Download a library file by id.
+ */
+ readonly get: operations["library_download"];
+ readonly put?: never;
+ readonly post?: never;
+ readonly delete?: never;
+ readonly options?: never;
+ /**
+ * Download Library File Head
+ * @description Check whether a library file exists (HEAD only).
+ */
+ readonly head: operations["library_download_head"];
+ readonly patch?: never;
+ readonly trace?: never;
+ };
+ readonly "/files/library/{file_id}/restore": {
+ readonly parameters: {
+ readonly query?: never;
+ readonly header?: never;
+ readonly path?: never;
+ readonly cookie?: never;
+ };
+ readonly get?: never;
+ readonly put?: never;
+ /**
+ * Restore Library File
+ * @description Restore a soft-deleted library file.
+ */
+ readonly post: operations["library_restore"];
+ readonly delete?: never;
+ readonly options?: never;
+ readonly head?: never;
+ readonly patch?: never;
+ readonly trace?: never;
+ };
+ readonly "/files/library/search": {
+ readonly parameters: {
+ readonly query?: never;
+ readonly header?: never;
+ readonly path?: never;
+ readonly cookie?: never;
+ };
+ /**
+ * Search Library Files
+ * @description Search library entries by filename (case-insensitive substring).
+ */
+ readonly get: operations["library_search"];
+ readonly put?: never;
+ readonly post?: never;
+ readonly delete?: never;
+ readonly options?: never;
+ readonly head?: never;
+ readonly patch?: never;
+ readonly trace?: never;
+ };
readonly "/files/outputs/{output_path}": {
readonly parameters: {
readonly query?: never;
@@ -9382,6 +9566,24 @@ export interface components {
/** File */
readonly file: string;
};
+ /** Body_library_add */
+ readonly Body_library_add: {
+ /**
+ * File
+ * @description Raw file bytes
+ */
+ readonly file: string;
+ /**
+ * Filename
+ * @description Original filename
+ */
+ readonly filename: string;
+ /**
+ * Mime Type
+ * @default
+ */
+ readonly mime_type: string;
+ };
/** Body_reindex_knowledge_base_api_knowledge_bases__kb_name__reindex_post */
readonly Body_reindex_knowledge_base_api_knowledge_bases__kb_name__reindex_post: {
/**
@@ -11550,6 +11752,16 @@ export interface components {
* @default
*/
readonly ai_judgment: string;
+ /**
+ * Assessment Type
+ * @default
+ */
+ readonly assessment_type: string;
+ /**
+ * Attempt Count
+ * @default 1
+ */
+ readonly attempt_count: number;
/**
* Bookmarked
* @default false
@@ -11558,6 +11770,8 @@ export interface components {
/** Categories */
readonly categories?:
readonly components["schemas"]["CategoryItem"][] | null;
+ /** Confidence */
+ readonly confidence?: number | null;
/**
* Correct Answer
* @default
@@ -11580,6 +11794,11 @@ export interface components {
* @default
*/
readonly followup_session_id: string;
+ /**
+ * Hints Used
+ * @default 0
+ */
+ readonly hints_used: number;
/** Id */
readonly id: number;
/**
@@ -11587,6 +11806,16 @@ export interface components {
* @default false
*/
readonly is_correct: boolean;
+ /**
+ * Knowledge Point Id
+ * @default
+ */
+ readonly knowledge_point_id: string;
+ /**
+ * Mastery Path Id
+ * @default
+ */
+ readonly mastery_path_id: string;
/**
* Material Id
* @default
@@ -11604,6 +11833,8 @@ export interface components {
readonly options: {
readonly [key: string]: string;
};
+ /** Quality */
+ readonly quality?: number | null;
/** Question */
readonly question: string;
/**
@@ -11621,6 +11852,14 @@ export interface components {
* @default false
*/
readonly resolved: boolean;
+ /** Response Time */
+ readonly response_time?: number | null;
+ /**
+ * Result
+ * @default
+ */
+ readonly result:
+ ("correct" | "incorrect" | "partial" | "ungraded") | string;
/**
* Score Trend
* @default new
@@ -11936,6 +12175,40 @@ export interface components {
*/
readonly wrong: number;
};
+ /** QuizAnswerItem */
+ readonly QuizAnswerItem: {
+ /** Question Id */
+ readonly question_id: string;
+ /** Selected Index */
+ readonly selected_index: number;
+ };
+ /** QuizAnswersPayload */
+ readonly QuizAnswersPayload: {
+ /** Answers */
+ readonly answers: readonly components["schemas"]["QuizAnswerItem"][];
+ /** Locator */
+ readonly locator: number;
+ /**
+ * Section Title
+ * @default
+ */
+ readonly section_title: string;
+ /**
+ * Session Id
+ * @default
+ */
+ readonly session_id: string;
+ /**
+ * Source Anchor
+ * @default
+ */
+ readonly source_anchor: string;
+ /**
+ * Turn Id
+ * @default
+ */
+ readonly turn_id: string;
+ };
/** QuizAttemptRequest */
readonly QuizAttemptRequest: {
/** Block Id */
@@ -13294,6 +13567,18 @@ export interface components {
};
/** UpsertEntryRequest */
readonly UpsertEntryRequest: {
+ /**
+ * Assessment Type
+ * @default
+ */
+ readonly assessment_type: string;
+ /**
+ * Attempt Count
+ * @default 1
+ */
+ readonly attempt_count: number;
+ /** Confidence */
+ readonly confidence?: number | null;
/**
* Correct Answer
* @default
@@ -13309,11 +13594,26 @@ export interface components {
* @default
*/
readonly explanation: string;
+ /**
+ * Hints Used
+ * @default 0
+ */
+ readonly hints_used: number;
/**
* Is Correct
* @default false
*/
readonly is_correct: boolean;
+ /**
+ * Knowledge Point Id
+ * @default
+ */
+ readonly knowledge_point_id: string;
+ /**
+ * Mastery Path Id
+ * @default
+ */
+ readonly mastery_path_id: string;
/**
* Material Id
* @default
@@ -13328,6 +13628,8 @@ export interface components {
readonly options?: {
readonly [key: string]: string;
} | null;
+ /** Quality */
+ readonly quality?: number | null;
/** Question */
readonly question: string;
/** Question Id */
@@ -13337,6 +13639,13 @@ export interface components {
* @default
*/
readonly question_type: string;
+ /** Response Time */
+ readonly response_time?: number | null;
+ /**
+ * Result
+ * @default
+ */
+ readonly result: string;
/**
* Section Id
* @default
@@ -13593,6 +13902,7 @@ export type SchemaBodyImportDocxApiDocumentsImportDocxPost =
components["schemas"]["Body_import_docx_api_documents_import_docx_post"];
export type SchemaBodyImportVisualizerApiVisualizersImportPost =
components["schemas"]["Body_import_visualizer_api_visualizers_import_post"];
+export type SchemaBodyLibraryAdd = components["schemas"]["Body_library_add"];
export type SchemaBodyReindexKnowledgeBaseApiKnowledgeBasesKbNameReindexPost =
components["schemas"]["Body_reindex_knowledge_base_api_knowledge_bases__kb_name__reindex_post"];
export type SchemaBodySpeechToTextApiVoiceSttPost =
@@ -13870,6 +14180,9 @@ export type SchemaQuestionBankMaterial =
components["schemas"]["QuestionBankMaterial"];
export type SchemaQuestionBankStats =
components["schemas"]["QuestionBankStats"];
+export type SchemaQuizAnswerItem = components["schemas"]["QuizAnswerItem"];
+export type SchemaQuizAnswersPayload =
+ components["schemas"]["QuizAnswersPayload"];
export type SchemaQuizAttemptRequest =
components["schemas"]["QuizAttemptRequest"];
export type SchemaQuizResultItem = components["schemas"]["QuizResultItem"];
@@ -25881,14 +26194,18 @@ export interface operations {
readonly list_entries_api_question_notebook_entries_get: {
readonly parameters: {
readonly query?: {
+ readonly assessment_type?: string;
readonly bookmarked?: boolean | null;
readonly category_id?: number | null;
readonly course_id?: string;
readonly is_correct?: boolean | null;
+ readonly knowledge_point_id?: string;
readonly limit?: number;
+ readonly mastery_path_id?: string;
readonly material_id?: string;
readonly offset?: number;
readonly resolved?: boolean | null;
+ readonly result?: string;
readonly score_trend?: string;
readonly search?: string;
readonly section_id?: string;
@@ -27078,7 +27395,7 @@ export interface operations {
};
};
};
- readonly get_position_api_reading_materials__material_id__position_get: {
+ readonly submit_quiz_answers_api_reading_materials__material_id__extensions_quiz_answers_post: {
readonly parameters: {
readonly query?: never;
readonly header?: {
@@ -27091,7 +27408,11 @@ export interface operations {
readonly dt_token?: string | null;
};
};
- readonly requestBody?: never;
+ readonly requestBody: {
+ readonly content: {
+ readonly "application/json": components["schemas"]["QuizAnswersPayload"];
+ };
+ };
readonly responses: {
/** @description Successful Response */
readonly 200: {
@@ -27099,7 +27420,9 @@ export interface operations {
readonly [name: string]: unknown;
};
content: {
- readonly "application/json": components["schemas"]["PositionInfo"];
+ readonly "application/json": {
+ readonly [key: string]: unknown;
+ };
};
};
/** @description Validation Error */
@@ -27113,7 +27436,7 @@ export interface operations {
};
};
};
- readonly save_position_api_reading_materials__material_id__position_put: {
+ readonly get_position_api_reading_materials__material_id__position_get: {
readonly parameters: {
readonly query?: never;
readonly header?: {
@@ -27126,11 +27449,7 @@ export interface operations {
readonly dt_token?: string | null;
};
};
- readonly requestBody: {
- readonly content: {
- readonly "application/json": components["schemas"]["PositionPayload"];
- };
- };
+ readonly requestBody?: never;
readonly responses: {
/** @description Successful Response */
readonly 200: {
@@ -27152,7 +27471,7 @@ export interface operations {
};
};
};
- readonly get_raw_api_reading_materials__material_id__raw_get: {
+ readonly save_position_api_reading_materials__material_id__position_put: {
readonly parameters: {
readonly query?: never;
readonly header?: {
@@ -27165,7 +27484,11 @@ export interface operations {
readonly dt_token?: string | null;
};
};
- readonly requestBody?: never;
+ readonly requestBody: {
+ readonly content: {
+ readonly "application/json": components["schemas"]["PositionPayload"];
+ };
+ };
readonly responses: {
/** @description Successful Response */
readonly 200: {
@@ -27173,7 +27496,7 @@ export interface operations {
readonly [name: string]: unknown;
};
content: {
- readonly "application/json": unknown;
+ readonly "application/json": components["schemas"]["PositionInfo"];
};
};
/** @description Validation Error */
@@ -27187,7 +27510,7 @@ export interface operations {
};
};
};
- readonly retry_import_api_reading_materials__material_id__retry_post: {
+ readonly get_raw_api_reading_materials__material_id__raw_get: {
readonly parameters: {
readonly query?: never;
readonly header?: {
@@ -27203,14 +27526,12 @@ export interface operations {
readonly requestBody?: never;
readonly responses: {
/** @description Successful Response */
- readonly 202: {
+ readonly 200: {
headers: {
readonly [name: string]: unknown;
};
content: {
- readonly "application/json": {
- readonly [key: string]: unknown;
- };
+ readonly "application/json": unknown;
};
};
/** @description Validation Error */
@@ -27224,7 +27545,44 @@ export interface operations {
};
};
};
- readonly list_material_revisions_api_reading_materials__material_id__revisions_get: {
+ readonly retry_import_api_reading_materials__material_id__retry_post: {
+ readonly parameters: {
+ readonly query?: never;
+ readonly header?: {
+ readonly Authorization?: string | null;
+ };
+ readonly path: {
+ readonly material_id: string;
+ };
+ readonly cookie?: {
+ readonly dt_token?: string | null;
+ };
+ };
+ readonly requestBody?: never;
+ readonly responses: {
+ /** @description Successful Response */
+ readonly 202: {
+ headers: {
+ readonly [name: string]: unknown;
+ };
+ content: {
+ readonly "application/json": {
+ readonly [key: string]: unknown;
+ };
+ };
+ };
+ /** @description Validation Error */
+ readonly 422: {
+ headers: {
+ readonly [name: string]: unknown;
+ };
+ content: {
+ readonly "application/json": components["schemas"]["HTTPValidationError"];
+ };
+ };
+ };
+ };
+ readonly list_material_revisions_api_reading_materials__material_id__revisions_get: {
readonly parameters: {
readonly query?: never;
readonly header?: {
@@ -28524,6 +28882,41 @@ export interface operations {
};
};
};
+ readonly purge_session_api_sessions__session_id__purge_delete: {
+ readonly parameters: {
+ readonly query?: never;
+ readonly header?: {
+ readonly Authorization?: string | null;
+ };
+ readonly path: {
+ readonly session_id: string;
+ };
+ readonly cookie?: {
+ readonly dt_token?: string | null;
+ };
+ };
+ readonly requestBody?: never;
+ readonly responses: {
+ /** @description Successful Response */
+ readonly 200: {
+ headers: {
+ readonly [name: string]: unknown;
+ };
+ content: {
+ readonly "application/json": unknown;
+ };
+ };
+ /** @description Validation Error */
+ readonly 422: {
+ headers: {
+ readonly [name: string]: unknown;
+ };
+ content: {
+ readonly "application/json": components["schemas"]["HTTPValidationError"];
+ };
+ };
+ };
+ };
readonly record_quiz_results_api_sessions__session_id__quiz_results_post: {
readonly parameters: {
readonly query?: never;
@@ -28563,6 +28956,77 @@ export interface operations {
};
};
};
+ readonly restore_session_api_sessions__session_id__restore_post: {
+ readonly parameters: {
+ readonly query?: never;
+ readonly header?: {
+ readonly Authorization?: string | null;
+ };
+ readonly path: {
+ readonly session_id: string;
+ };
+ readonly cookie?: {
+ readonly dt_token?: string | null;
+ };
+ };
+ readonly requestBody?: never;
+ readonly responses: {
+ /** @description Successful Response */
+ readonly 200: {
+ headers: {
+ readonly [name: string]: unknown;
+ };
+ content: {
+ readonly "application/json": unknown;
+ };
+ };
+ /** @description Validation Error */
+ readonly 422: {
+ headers: {
+ readonly [name: string]: unknown;
+ };
+ content: {
+ readonly "application/json": components["schemas"]["HTTPValidationError"];
+ };
+ };
+ };
+ };
+ readonly list_recycle_bin_api_sessions_recycle_bin_get: {
+ readonly parameters: {
+ readonly query?: {
+ readonly limit?: number;
+ readonly offset?: number;
+ };
+ readonly header?: {
+ readonly Authorization?: string | null;
+ };
+ readonly path?: never;
+ readonly cookie?: {
+ readonly dt_token?: string | null;
+ };
+ };
+ readonly requestBody?: never;
+ readonly responses: {
+ /** @description Successful Response */
+ readonly 200: {
+ headers: {
+ readonly [name: string]: unknown;
+ };
+ content: {
+ readonly "application/json": unknown;
+ };
+ };
+ /** @description Validation Error */
+ readonly 422: {
+ headers: {
+ readonly [name: string]: unknown;
+ };
+ content: {
+ readonly "application/json": components["schemas"]["HTTPValidationError"];
+ };
+ };
+ };
+ };
readonly search_sessions_api_sessions_search_get: {
readonly parameters: {
readonly query: {
@@ -33935,6 +34399,301 @@ export interface operations {
};
};
};
+ readonly library_list: {
+ readonly parameters: {
+ readonly query?: {
+ readonly limit?: number;
+ readonly offset?: number;
+ };
+ readonly header?: {
+ readonly Authorization?: string | null;
+ };
+ readonly path?: never;
+ readonly cookie?: {
+ readonly dt_token?: string | null;
+ };
+ };
+ readonly requestBody?: never;
+ readonly responses: {
+ /** @description Successful Response */
+ readonly 200: {
+ headers: {
+ readonly [name: string]: unknown;
+ };
+ content: {
+ readonly "application/json": readonly {
+ readonly [key: string]: unknown;
+ }[];
+ };
+ };
+ /** @description Validation Error */
+ readonly 422: {
+ headers: {
+ readonly [name: string]: unknown;
+ };
+ content: {
+ readonly "application/json": components["schemas"]["HTTPValidationError"];
+ };
+ };
+ };
+ };
+ readonly library_add: {
+ readonly parameters: {
+ readonly query?: never;
+ readonly header?: {
+ readonly Authorization?: string | null;
+ };
+ readonly path?: never;
+ readonly cookie?: {
+ readonly dt_token?: string | null;
+ };
+ };
+ readonly requestBody: {
+ readonly content: {
+ readonly "multipart/form-data": components["schemas"]["Body_library_add"];
+ };
+ };
+ readonly responses: {
+ /** @description Successful Response */
+ readonly 200: {
+ headers: {
+ readonly [name: string]: unknown;
+ };
+ content: {
+ readonly "application/json": {
+ readonly [key: string]: unknown;
+ };
+ };
+ };
+ /** @description Validation Error */
+ readonly 422: {
+ headers: {
+ readonly [name: string]: unknown;
+ };
+ content: {
+ readonly "application/json": components["schemas"]["HTTPValidationError"];
+ };
+ };
+ };
+ };
+ readonly library_get: {
+ readonly parameters: {
+ readonly query?: never;
+ readonly header?: {
+ readonly Authorization?: string | null;
+ };
+ readonly path: {
+ readonly file_id: string;
+ };
+ readonly cookie?: {
+ readonly dt_token?: string | null;
+ };
+ };
+ readonly requestBody?: never;
+ readonly responses: {
+ /** @description Successful Response */
+ readonly 200: {
+ headers: {
+ readonly [name: string]: unknown;
+ };
+ content: {
+ readonly "application/json": {
+ readonly [key: string]: unknown;
+ };
+ };
+ };
+ /** @description Validation Error */
+ readonly 422: {
+ headers: {
+ readonly [name: string]: unknown;
+ };
+ content: {
+ readonly "application/json": components["schemas"]["HTTPValidationError"];
+ };
+ };
+ };
+ };
+ readonly library_delete: {
+ readonly parameters: {
+ readonly query?: never;
+ readonly header?: {
+ readonly Authorization?: string | null;
+ };
+ readonly path: {
+ readonly file_id: string;
+ };
+ readonly cookie?: {
+ readonly dt_token?: string | null;
+ };
+ };
+ readonly requestBody?: never;
+ readonly responses: {
+ /** @description Successful Response */
+ readonly 200: {
+ headers: {
+ readonly [name: string]: unknown;
+ };
+ content: {
+ readonly "application/json": {
+ readonly [key: string]: unknown;
+ };
+ };
+ };
+ /** @description Validation Error */
+ readonly 422: {
+ headers: {
+ readonly [name: string]: unknown;
+ };
+ content: {
+ readonly "application/json": components["schemas"]["HTTPValidationError"];
+ };
+ };
+ };
+ };
+ readonly library_download: {
+ readonly parameters: {
+ readonly query?: never;
+ readonly header?: {
+ readonly Authorization?: string | null;
+ };
+ readonly path: {
+ readonly file_id: string;
+ };
+ readonly cookie?: {
+ readonly dt_token?: string | null;
+ };
+ };
+ readonly requestBody?: never;
+ readonly responses: {
+ /** @description Successful Response */
+ readonly 200: {
+ headers: {
+ readonly [name: string]: unknown;
+ };
+ content: {
+ readonly "application/json": unknown;
+ };
+ };
+ /** @description Validation Error */
+ readonly 422: {
+ headers: {
+ readonly [name: string]: unknown;
+ };
+ content: {
+ readonly "application/json": components["schemas"]["HTTPValidationError"];
+ };
+ };
+ };
+ };
+ readonly library_download_head: {
+ readonly parameters: {
+ readonly query?: never;
+ readonly header?: {
+ readonly Authorization?: string | null;
+ };
+ readonly path: {
+ readonly file_id: string;
+ };
+ readonly cookie?: {
+ readonly dt_token?: string | null;
+ };
+ };
+ readonly requestBody?: never;
+ readonly responses: {
+ /** @description Successful Response */
+ readonly 200: {
+ headers: {
+ readonly [name: string]: unknown;
+ };
+ content: {
+ readonly "application/json": unknown;
+ };
+ };
+ /** @description Validation Error */
+ readonly 422: {
+ headers: {
+ readonly [name: string]: unknown;
+ };
+ content: {
+ readonly "application/json": components["schemas"]["HTTPValidationError"];
+ };
+ };
+ };
+ };
+ readonly library_restore: {
+ readonly parameters: {
+ readonly query?: never;
+ readonly header?: {
+ readonly Authorization?: string | null;
+ };
+ readonly path: {
+ readonly file_id: string;
+ };
+ readonly cookie?: {
+ readonly dt_token?: string | null;
+ };
+ };
+ readonly requestBody?: never;
+ readonly responses: {
+ /** @description Successful Response */
+ readonly 200: {
+ headers: {
+ readonly [name: string]: unknown;
+ };
+ content: {
+ readonly "application/json": {
+ readonly [key: string]: unknown;
+ };
+ };
+ };
+ /** @description Validation Error */
+ readonly 422: {
+ headers: {
+ readonly [name: string]: unknown;
+ };
+ content: {
+ readonly "application/json": components["schemas"]["HTTPValidationError"];
+ };
+ };
+ };
+ };
+ readonly library_search: {
+ readonly parameters: {
+ readonly query: {
+ readonly q: string;
+ };
+ readonly header?: {
+ readonly Authorization?: string | null;
+ };
+ readonly path?: never;
+ readonly cookie?: {
+ readonly dt_token?: string | null;
+ };
+ };
+ readonly requestBody?: never;
+ readonly responses: {
+ /** @description Successful Response */
+ readonly 200: {
+ headers: {
+ readonly [name: string]: unknown;
+ };
+ content: {
+ readonly "application/json": readonly {
+ readonly [key: string]: unknown;
+ }[];
+ };
+ };
+ /** @description Validation Error */
+ readonly 422: {
+ headers: {
+ readonly [name: string]: unknown;
+ };
+ content: {
+ readonly "application/json": components["schemas"]["HTTPValidationError"];
+ };
+ };
+ };
+ };
readonly read_output_get: {
readonly parameters: {
readonly query?: never;
diff --git a/web/contracts/schema/openapi.json b/web/contracts/schema/openapi.json
index 9c2862f3e..a4edb8a24 100644
--- a/web/contracts/schema/openapi.json
+++ b/web/contracts/schema/openapi.json
@@ -750,6 +750,32 @@
"title": "Body_import_visualizer_api_visualizers_import_post",
"type": "object"
},
+ "Body_library_add": {
+ "properties": {
+ "file": {
+ "contentMediaType": "application/octet-stream",
+ "description": "Raw file bytes",
+ "title": "File",
+ "type": "string"
+ },
+ "filename": {
+ "description": "Original filename",
+ "title": "Filename",
+ "type": "string"
+ },
+ "mime_type": {
+ "default": "",
+ "title": "Mime Type",
+ "type": "string"
+ }
+ },
+ "required": [
+ "filename",
+ "file"
+ ],
+ "title": "Body_library_add",
+ "type": "object"
+ },
"Body_reindex_knowledge_base_api_knowledge_bases__kb_name__reindex_post": {
"properties": {
"indexing_llm": {
@@ -5417,6 +5443,16 @@
"title": "Ai Judgment",
"type": "string"
},
+ "assessment_type": {
+ "default": "",
+ "title": "Assessment Type",
+ "type": "string"
+ },
+ "attempt_count": {
+ "default": 1,
+ "title": "Attempt Count",
+ "type": "integer"
+ },
"bookmarked": {
"default": false,
"title": "Bookmarked",
@@ -5436,6 +5472,17 @@
],
"title": "Categories"
},
+ "confidence": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Confidence"
+ },
"correct_answer": {
"default": "",
"title": "Correct Answer",
@@ -5460,6 +5507,11 @@
"title": "Followup Session Id",
"type": "string"
},
+ "hints_used": {
+ "default": 0,
+ "title": "Hints Used",
+ "type": "integer"
+ },
"id": {
"title": "Id",
"type": "integer"
@@ -5469,6 +5521,16 @@
"title": "Is Correct",
"type": "boolean"
},
+ "knowledge_point_id": {
+ "default": "",
+ "title": "Knowledge Point Id",
+ "type": "string"
+ },
+ "mastery_path_id": {
+ "default": "",
+ "title": "Mastery Path Id",
+ "type": "string"
+ },
"material_id": {
"default": "",
"title": "Material Id",
@@ -5487,6 +5549,17 @@
"title": "Options",
"type": "object"
},
+ "quality": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Quality"
+ },
"question": {
"title": "Question",
"type": "string"
@@ -5506,6 +5579,35 @@
"title": "Resolved",
"type": "boolean"
},
+ "response_time": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Response Time"
+ },
+ "result": {
+ "anyOf": [
+ {
+ "enum": [
+ "correct",
+ "incorrect",
+ "partial",
+ "ungraded"
+ ],
+ "type": "string"
+ },
+ {
+ "type": "string"
+ }
+ ],
+ "default": "",
+ "title": "Result"
+ },
"score_trend": {
"default": "new",
"enum": [
@@ -6124,6 +6226,70 @@
"title": "QuestionBankStats",
"type": "object"
},
+ "QuizAnswerItem": {
+ "properties": {
+ "question_id": {
+ "minLength": 1,
+ "title": "Question Id",
+ "type": "string"
+ },
+ "selected_index": {
+ "title": "Selected Index",
+ "type": "integer"
+ }
+ },
+ "required": [
+ "question_id",
+ "selected_index"
+ ],
+ "title": "QuizAnswerItem",
+ "type": "object"
+ },
+ "QuizAnswersPayload": {
+ "properties": {
+ "answers": {
+ "items": {
+ "$ref": "#/components/schemas/QuizAnswerItem"
+ },
+ "minItems": 1,
+ "title": "Answers",
+ "type": "array"
+ },
+ "locator": {
+ "minimum": 1.0,
+ "title": "Locator",
+ "type": "integer"
+ },
+ "section_title": {
+ "default": "",
+ "maxLength": 500,
+ "title": "Section Title",
+ "type": "string"
+ },
+ "session_id": {
+ "default": "",
+ "title": "Session Id",
+ "type": "string"
+ },
+ "source_anchor": {
+ "default": "",
+ "maxLength": 2000,
+ "title": "Source Anchor",
+ "type": "string"
+ },
+ "turn_id": {
+ "default": "",
+ "title": "Turn Id",
+ "type": "string"
+ }
+ },
+ "required": [
+ "locator",
+ "answers"
+ ],
+ "title": "QuizAnswersPayload",
+ "type": "object"
+ },
"QuizAttemptRequest": {
"properties": {
"block_id": {
@@ -9535,6 +9701,27 @@
},
"UpsertEntryRequest": {
"properties": {
+ "assessment_type": {
+ "default": "",
+ "title": "Assessment Type",
+ "type": "string"
+ },
+ "attempt_count": {
+ "default": 1,
+ "title": "Attempt Count",
+ "type": "integer"
+ },
+ "confidence": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Confidence"
+ },
"correct_answer": {
"default": "",
"title": "Correct Answer",
@@ -9550,11 +9737,26 @@
"title": "Explanation",
"type": "string"
},
+ "hints_used": {
+ "default": 0,
+ "title": "Hints Used",
+ "type": "integer"
+ },
"is_correct": {
"default": false,
"title": "Is Correct",
"type": "boolean"
},
+ "knowledge_point_id": {
+ "default": "",
+ "title": "Knowledge Point Id",
+ "type": "string"
+ },
+ "mastery_path_id": {
+ "default": "",
+ "title": "Mastery Path Id",
+ "type": "string"
+ },
"material_id": {
"default": "",
"title": "Material Id",
@@ -9579,6 +9781,17 @@
],
"title": "Options"
},
+ "quality": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Quality"
+ },
"question": {
"title": "Question",
"type": "string"
@@ -9592,6 +9805,22 @@
"title": "Question Type",
"type": "string"
},
+ "response_time": {
+ "anyOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Response Time"
+ },
+ "result": {
+ "default": "",
+ "title": "Result",
+ "type": "string"
+ },
"section_id": {
"default": "",
"title": "Section Id",
@@ -34676,6 +34905,50 @@
"type": "string"
}
},
+ {
+ "in": "query",
+ "name": "assessment_type",
+ "required": false,
+ "schema": {
+ "default": "",
+ "pattern": "^(quiz|focus_check|qualitative|review)?$",
+ "title": "Assessment Type",
+ "type": "string"
+ }
+ },
+ {
+ "in": "query",
+ "name": "result",
+ "required": false,
+ "schema": {
+ "default": "",
+ "pattern": "^(correct|incorrect|partial|ungraded)?$",
+ "title": "Result",
+ "type": "string"
+ }
+ },
+ {
+ "in": "query",
+ "name": "mastery_path_id",
+ "required": false,
+ "schema": {
+ "default": "",
+ "maxLength": 500,
+ "title": "Mastery Path Id",
+ "type": "string"
+ }
+ },
+ {
+ "in": "query",
+ "name": "knowledge_point_id",
+ "required": false,
+ "schema": {
+ "default": "",
+ "maxLength": 500,
+ "title": "Knowledge Point Id",
+ "type": "string"
+ }
+ },
{
"in": "query",
"name": "resolved",
@@ -37212,9 +37485,9 @@
]
}
},
- "/api/reading/materials/{material_id}/extensions/{extension_id}/actions/{action}": {
+ "/api/reading/materials/{material_id}/extensions/quiz/answers": {
"post": {
- "operationId": "run_extension_action_api_reading_materials__material_id__extensions__extension_id__actions__action__post",
+ "operationId": "submit_quiz_answers_api_reading_materials__material_id__extensions_quiz_answers_post",
"parameters": [
{
"in": "path",
@@ -37225,24 +37498,6 @@
"type": "string"
}
},
- {
- "in": "path",
- "name": "extension_id",
- "required": true,
- "schema": {
- "title": "Extension Id",
- "type": "string"
- }
- },
- {
- "in": "path",
- "name": "action",
- "required": true,
- "schema": {
- "title": "Action",
- "type": "string"
- }
- },
{
"in": "header",
"name": "Authorization",
@@ -37280,7 +37535,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/ActionPayload"
+ "$ref": "#/components/schemas/QuizAnswersPayload"
}
}
},
@@ -37292,7 +37547,7 @@
"application/json": {
"schema": {
"additionalProperties": true,
- "title": "Response Run Extension Action Api Reading Materials Material Id Extensions Extension Id Actions Action Post",
+ "title": "Response Submit Quiz Answers Api Reading Materials Material Id Extensions Quiz Answers Post",
"type": "object"
}
}
@@ -37310,16 +37565,120 @@
"description": "Validation Error"
}
},
- "summary": "Run Extension Action",
+ "summary": "Submit Quiz Answers",
"tags": [
"reading-extensions"
]
}
},
- "/api/reading/materials/{material_id}/position": {
- "get": {
- "description": "Return the user's last durable viewport for this material.",
- "operationId": "get_position_api_reading_materials__material_id__position_get",
+ "/api/reading/materials/{material_id}/extensions/{extension_id}/actions/{action}": {
+ "post": {
+ "operationId": "run_extension_action_api_reading_materials__material_id__extensions__extension_id__actions__action__post",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "material_id",
+ "required": true,
+ "schema": {
+ "title": "Material Id",
+ "type": "string"
+ }
+ },
+ {
+ "in": "path",
+ "name": "extension_id",
+ "required": true,
+ "schema": {
+ "title": "Extension Id",
+ "type": "string"
+ }
+ },
+ {
+ "in": "path",
+ "name": "action",
+ "required": true,
+ "schema": {
+ "title": "Action",
+ "type": "string"
+ }
+ },
+ {
+ "in": "header",
+ "name": "Authorization",
+ "required": false,
+ "schema": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Authorization"
+ }
+ },
+ {
+ "in": "cookie",
+ "name": "dt_token",
+ "required": false,
+ "schema": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Dt Token"
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ActionPayload"
+ }
+ }
+ },
+ "required": true
+ },
+ "responses": {
+ "200": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "additionalProperties": true,
+ "title": "Response Run Extension Action Api Reading Materials Material Id Extensions Extension Id Actions Action Post",
+ "type": "object"
+ }
+ }
+ },
+ "description": "Successful Response"
+ },
+ "422": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
+ }
+ },
+ "description": "Validation Error"
+ }
+ },
+ "summary": "Run Extension Action",
+ "tags": [
+ "reading-extensions"
+ ]
+ }
+ },
+ "/api/reading/materials/{material_id}/position": {
+ "get": {
+ "description": "Return the user's last durable viewport for this material.",
+ "operationId": "get_position_api_reading_materials__material_id__position_get",
"parameters": [
{
"in": "path",
@@ -39810,29 +40169,17 @@
]
}
},
- "/api/sessions/search": {
+ "/api/sessions/recycle-bin": {
"get": {
- "description": "Search titles and persisted user/assistant messages for a literal term.",
- "operationId": "search_sessions_api_sessions_search_get",
+ "operationId": "list_recycle_bin_api_sessions_recycle_bin_get",
"parameters": [
- {
- "in": "query",
- "name": "q",
- "required": true,
- "schema": {
- "maxLength": 200,
- "minLength": 1,
- "title": "Q",
- "type": "string"
- }
- },
{
"in": "query",
"name": "limit",
"required": false,
"schema": {
"default": 50,
- "maximum": 100,
+ "maximum": 200,
"minimum": 1,
"title": "Limit",
"type": "integer"
@@ -39902,93 +40249,49 @@
"description": "Validation Error"
}
},
- "summary": "Search Sessions",
+ "summary": "List Recycle Bin",
"tags": [
"sessions"
]
}
},
- "/api/sessions/{session_id}": {
- "delete": {
- "operationId": "delete_session_api_sessions__session_id__delete",
+ "/api/sessions/search": {
+ "get": {
+ "description": "Search titles and persisted user/assistant messages for a literal term.",
+ "operationId": "search_sessions_api_sessions_search_get",
"parameters": [
{
- "in": "path",
- "name": "session_id",
+ "in": "query",
+ "name": "q",
"required": true,
"schema": {
- "title": "Session Id",
+ "maxLength": 200,
+ "minLength": 1,
+ "title": "Q",
"type": "string"
}
},
{
- "in": "header",
- "name": "Authorization",
+ "in": "query",
+ "name": "limit",
"required": false,
"schema": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Authorization"
+ "default": 50,
+ "maximum": 100,
+ "minimum": 1,
+ "title": "Limit",
+ "type": "integer"
}
},
{
- "in": "cookie",
- "name": "dt_token",
+ "in": "query",
+ "name": "offset",
"required": false,
"schema": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "title": "Dt Token"
- }
- }
- ],
- "responses": {
- "200": {
- "content": {
- "application/json": {
- "schema": {}
- }
- },
- "description": "Successful Response"
- },
- "422": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/HTTPValidationError"
- }
- }
- },
- "description": "Validation Error"
- }
- },
- "summary": "Delete Session",
- "tags": [
- "sessions"
- ]
- },
- "get": {
- "operationId": "get_session_api_sessions__session_id__get",
- "parameters": [
- {
- "in": "path",
- "name": "session_id",
- "required": true,
- "schema": {
- "title": "Session Id",
- "type": "string"
+ "default": 0,
+ "minimum": 0,
+ "title": "Offset",
+ "type": "integer"
}
},
{
@@ -40044,13 +40347,15 @@
"description": "Validation Error"
}
},
- "summary": "Get Session",
+ "summary": "Search Sessions",
"tags": [
"sessions"
]
- },
- "patch": {
- "operationId": "rename_session_api_sessions__session_id__patch",
+ }
+ },
+ "/api/sessions/{session_id}": {
+ "delete": {
+ "operationId": "delete_session_api_sessions__session_id__delete",
"parameters": [
{
"in": "path",
@@ -40094,16 +40399,6 @@
}
}
],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/SessionRenameRequest"
- }
- }
- },
- "required": true
- },
"responses": {
"200": {
"content": {
@@ -40124,16 +40419,13 @@
"description": "Validation Error"
}
},
- "summary": "Rename Session",
+ "summary": "Delete Session",
"tags": [
"sessions"
]
- }
- },
- "/api/sessions/{session_id}/ask-hint": {
+ },
"get": {
- "description": "One line the user is likely to type next, for the home composer placeholder.",
- "operationId": "get_session_ask_hint_api_sessions__session_id__ask_hint_get",
+ "operationId": "get_session_api_sessions__session_id__get",
"parameters": [
{
"in": "path",
@@ -40181,11 +40473,7 @@
"200": {
"content": {
"application/json": {
- "schema": {
- "additionalProperties": true,
- "title": "Response Get Session Ask Hint Api Sessions Session Id Ask Hint Get",
- "type": "object"
- }
+ "schema": {}
}
},
"description": "Successful Response"
@@ -40201,15 +40489,13 @@
"description": "Validation Error"
}
},
- "summary": "Get Session Ask Hint",
+ "summary": "Get Session",
"tags": [
"sessions"
]
- }
- },
- "/api/sessions/{session_id}/branch-selection": {
- "put": {
- "operationId": "update_branch_selection_api_sessions__session_id__branch_selection_put",
+ },
+ "patch": {
+ "operationId": "rename_session_api_sessions__session_id__patch",
"parameters": [
{
"in": "path",
@@ -40257,7 +40543,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/BranchSelectionRequest"
+ "$ref": "#/components/schemas/SessionRenameRequest"
}
}
},
@@ -40283,15 +40569,16 @@
"description": "Validation Error"
}
},
- "summary": "Update Branch Selection",
+ "summary": "Rename Session",
"tags": [
"sessions"
]
}
},
- "/api/sessions/{session_id}/messages/{message_id}": {
- "delete": {
- "operationId": "delete_turn_by_message_api_sessions__session_id__messages__message_id__delete",
+ "/api/sessions/{session_id}/ask-hint": {
+ "get": {
+ "description": "One line the user is likely to type next, for the home composer placeholder.",
+ "operationId": "get_session_ask_hint_api_sessions__session_id__ask_hint_get",
"parameters": [
{
"in": "path",
@@ -40302,15 +40589,6 @@
"type": "string"
}
},
- {
- "in": "path",
- "name": "message_id",
- "required": true,
- "schema": {
- "title": "Message Id",
- "type": "integer"
- }
- },
{
"in": "header",
"name": "Authorization",
@@ -40348,7 +40626,11 @@
"200": {
"content": {
"application/json": {
- "schema": {}
+ "schema": {
+ "additionalProperties": true,
+ "title": "Response Get Session Ask Hint Api Sessions Session Id Ask Hint Get",
+ "type": "object"
+ }
}
},
"description": "Successful Response"
@@ -40364,15 +40646,15 @@
"description": "Validation Error"
}
},
- "summary": "Delete Turn By Message",
+ "summary": "Get Session Ask Hint",
"tags": [
"sessions"
]
}
},
- "/api/sessions/{session_id}/messages/{message_id}/events": {
- "get": {
- "operationId": "get_message_events_api_sessions__session_id__messages__message_id__events_get",
+ "/api/sessions/{session_id}/branch-selection": {
+ "put": {
+ "operationId": "update_branch_selection_api_sessions__session_id__branch_selection_put",
"parameters": [
{
"in": "path",
@@ -40384,34 +40666,93 @@
}
},
{
- "in": "path",
- "name": "message_id",
- "required": true,
+ "in": "header",
+ "name": "Authorization",
+ "required": false,
"schema": {
- "title": "Message Id",
- "type": "string"
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Authorization"
}
},
{
- "in": "query",
- "name": "after_seq",
+ "in": "cookie",
+ "name": "dt_token",
"required": false,
"schema": {
- "default": 0,
- "minimum": 0,
- "title": "After Seq",
- "type": "integer"
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Dt Token"
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/BranchSelectionRequest"
+ }
}
},
+ "required": true
+ },
+ "responses": {
+ "200": {
+ "content": {
+ "application/json": {
+ "schema": {}
+ }
+ },
+ "description": "Successful Response"
+ },
+ "422": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
+ }
+ },
+ "description": "Validation Error"
+ }
+ },
+ "summary": "Update Branch Selection",
+ "tags": [
+ "sessions"
+ ]
+ }
+ },
+ "/api/sessions/{session_id}/messages/{message_id}": {
+ "delete": {
+ "operationId": "delete_turn_by_message_api_sessions__session_id__messages__message_id__delete",
+ "parameters": [
{
- "in": "query",
- "name": "limit",
- "required": false,
+ "in": "path",
+ "name": "session_id",
+ "required": true,
"schema": {
- "default": 500,
- "maximum": 1000,
- "minimum": 1,
- "title": "Limit",
+ "title": "Session Id",
+ "type": "string"
+ }
+ },
+ {
+ "in": "path",
+ "name": "message_id",
+ "required": true,
+ "schema": {
+ "title": "Message Id",
"type": "integer"
}
},
@@ -40468,15 +40809,15 @@
"description": "Validation Error"
}
},
- "summary": "Get Message Events",
+ "summary": "Delete Turn By Message",
"tags": [
"sessions"
]
}
},
- "/api/sessions/{session_id}/organization": {
- "patch": {
- "operationId": "update_session_organization_api_sessions__session_id__organization_patch",
+ "/api/sessions/{session_id}/messages/{message_id}/events": {
+ "get": {
+ "operationId": "get_message_events_api_sessions__session_id__messages__message_id__events_get",
"parameters": [
{
"in": "path",
@@ -40487,6 +40828,38 @@
"type": "string"
}
},
+ {
+ "in": "path",
+ "name": "message_id",
+ "required": true,
+ "schema": {
+ "title": "Message Id",
+ "type": "string"
+ }
+ },
+ {
+ "in": "query",
+ "name": "after_seq",
+ "required": false,
+ "schema": {
+ "default": 0,
+ "minimum": 0,
+ "title": "After Seq",
+ "type": "integer"
+ }
+ },
+ {
+ "in": "query",
+ "name": "limit",
+ "required": false,
+ "schema": {
+ "default": 500,
+ "maximum": 1000,
+ "minimum": 1,
+ "title": "Limit",
+ "type": "integer"
+ }
+ },
{
"in": "header",
"name": "Authorization",
@@ -40520,16 +40893,6 @@
}
}
],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/SessionOrganizationRequest"
- }
- }
- },
- "required": true
- },
"responses": {
"200": {
"content": {
@@ -40550,15 +40913,15 @@
"description": "Validation Error"
}
},
- "summary": "Update Session Organization",
+ "summary": "Get Message Events",
"tags": [
"sessions"
]
}
},
- "/api/sessions/{session_id}/quiz-results": {
- "post": {
- "operationId": "record_quiz_results_api_sessions__session_id__quiz_results_post",
+ "/api/sessions/{session_id}/organization": {
+ "patch": {
+ "operationId": "update_session_organization_api_sessions__session_id__organization_patch",
"parameters": [
{
"in": "path",
@@ -40606,7 +40969,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/QuizResultsRequest"
+ "$ref": "#/components/schemas/SessionOrganizationRequest"
}
}
},
@@ -40632,16 +40995,25 @@
"description": "Validation Error"
}
},
- "summary": "Record Quiz Results",
+ "summary": "Update Session Organization",
"tags": [
"sessions"
]
}
},
- "/api/settings": {
- "get": {
- "operationId": "get_settings_api_settings_get",
+ "/api/sessions/{session_id}/purge": {
+ "delete": {
+ "operationId": "purge_session_api_sessions__session_id__purge_delete",
"parameters": [
+ {
+ "in": "path",
+ "name": "session_id",
+ "required": true,
+ "schema": {
+ "title": "Session Id",
+ "type": "string"
+ }
+ },
{
"in": "header",
"name": "Authorization",
@@ -40695,17 +41067,25 @@
"description": "Validation Error"
}
},
- "summary": "Get Settings",
+ "summary": "Purge Session",
"tags": [
- "settings"
+ "sessions"
]
}
},
- "/api/settings/apply": {
+ "/api/sessions/{session_id}/quiz-results": {
"post": {
- "description": "Move settings into the files the runtime reads, and clear the draft.\n\nWith no body this promotes the stored draft's catalog, which is how the\nsettings UI applies: credentials that only ever existed in a draft would\notherwise have to round-trip through the browser as placeholders and come\nback resolving to the previous key.",
- "operationId": "apply_catalog_api_settings_apply_post",
+ "operationId": "record_quiz_results_api_sessions__session_id__quiz_results_post",
"parameters": [
+ {
+ "in": "path",
+ "name": "session_id",
+ "required": true,
+ "schema": {
+ "title": "Session Id",
+ "type": "string"
+ }
+ },
{
"in": "header",
"name": "Authorization",
@@ -40743,18 +41123,11 @@
"content": {
"application/json": {
"schema": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/CatalogPayload"
- },
- {
- "type": "null"
- }
- ],
- "title": "Payload"
+ "$ref": "#/components/schemas/QuizResultsRequest"
}
}
- }
+ },
+ "required": true
},
"responses": {
"200": {
@@ -40776,17 +41149,25 @@
"description": "Validation Error"
}
},
- "summary": "Apply Catalog",
+ "summary": "Record Quiz Results",
"tags": [
- "settings"
+ "sessions"
]
}
},
- "/api/settings/apply/service": {
+ "/api/sessions/{session_id}/restore": {
"post": {
- "description": "Apply one model service while leaving every other draft untouched.\n\nProvider dialogs use this narrower commit path for their Done action. A\nuser may still have unrelated edits elsewhere in Settings, and closing an\nSTT dialog must not silently promote those edits too.",
- "operationId": "apply_catalog_service_api_settings_apply_service_post",
+ "operationId": "restore_session_api_sessions__session_id__restore_post",
"parameters": [
+ {
+ "in": "path",
+ "name": "session_id",
+ "required": true,
+ "schema": {
+ "title": "Session Id",
+ "type": "string"
+ }
+ },
{
"in": "header",
"name": "Authorization",
@@ -40820,16 +41201,6 @@
}
}
],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/CatalogServicePayload"
- }
- }
- },
- "required": true
- },
"responses": {
"200": {
"content": {
@@ -40850,15 +41221,15 @@
"description": "Validation Error"
}
},
- "summary": "Apply Catalog Service",
+ "summary": "Restore Session",
"tags": [
- "settings"
+ "sessions"
]
}
},
- "/api/settings/catalog": {
+ "/api/settings": {
"get": {
- "operationId": "get_catalog_api_settings_catalog_get",
+ "operationId": "get_settings_api_settings_get",
"parameters": [
{
"in": "header",
@@ -40913,13 +41284,16 @@
"description": "Validation Error"
}
},
- "summary": "Get Catalog",
+ "summary": "Get Settings",
"tags": [
"settings"
]
- },
- "put": {
- "operationId": "update_catalog_api_settings_catalog_put",
+ }
+ },
+ "/api/settings/apply": {
+ "post": {
+ "description": "Move settings into the files the runtime reads, and clear the draft.\n\nWith no body this promotes the stored draft's catalog, which is how the\nsettings UI applies: credentials that only ever existed in a draft would\notherwise have to round-trip through the browser as placeholders and come\nback resolving to the previous key.",
+ "operationId": "apply_catalog_api_settings_apply_post",
"parameters": [
{
"in": "header",
@@ -40958,11 +41332,18 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/CatalogPayload"
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/CatalogPayload"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Payload"
}
}
- },
- "required": true
+ }
},
"responses": {
"200": {
@@ -40984,16 +41365,16 @@
"description": "Validation Error"
}
},
- "summary": "Update Catalog",
+ "summary": "Apply Catalog",
"tags": [
"settings"
]
}
},
- "/api/settings/chat-attachments": {
- "get": {
- "description": "Chat attachment policy. Readable by any user — the composer needs the\ncaps to gate file picks client-side; only the PUT is admin-gated.",
- "operationId": "get_chat_attachment_settings_api_settings_chat_attachments_get",
+ "/api/settings/apply/service": {
+ "post": {
+ "description": "Apply one model service while leaving every other draft untouched.\n\nProvider dialogs use this narrower commit path for their Done action. A\nuser may still have unrelated edits elsewhere in Settings, and closing an\nSTT dialog must not silently promote those edits too.",
+ "operationId": "apply_catalog_service_api_settings_apply_service_post",
"parameters": [
{
"in": "header",
@@ -41028,6 +41409,16 @@
}
}
],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/CatalogServicePayload"
+ }
+ }
+ },
+ "required": true
+ },
"responses": {
"200": {
"content": {
@@ -41048,13 +41439,15 @@
"description": "Validation Error"
}
},
- "summary": "Get Chat Attachment Settings",
+ "summary": "Apply Catalog Service",
"tags": [
"settings"
]
- },
- "put": {
- "operationId": "update_chat_attachment_settings_api_settings_chat_attachments_put",
+ }
+ },
+ "/api/settings/catalog": {
+ "get": {
+ "operationId": "get_catalog_api_settings_catalog_get",
"parameters": [
{
"in": "header",
@@ -41089,16 +41482,6 @@
}
}
],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ChatAttachmentSettingsUpdate"
- }
- }
- },
- "required": true
- },
"responses": {
"200": {
"content": {
@@ -41119,16 +41502,13 @@
"description": "Validation Error"
}
},
- "summary": "Update Chat Attachment Settings",
+ "summary": "Get Catalog",
"tags": [
"settings"
]
- }
- },
- "/api/settings/chat-response-timeout": {
+ },
"put": {
- "description": "Persist how long the chat UI waits for a turn event before timing out.\n\nA personal UI preference (any authenticated user). Slow tools like image /\nvideo generation can take longer than the old 60s default, so this is\nuser-adjustable; the chat surface reads it client-side.",
- "operationId": "update_chat_response_timeout_api_settings_chat_response_timeout_put",
+ "operationId": "update_catalog_api_settings_catalog_put",
"parameters": [
{
"in": "header",
@@ -41167,7 +41547,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/ChatResponseTimeoutUpdate"
+ "$ref": "#/components/schemas/CatalogPayload"
}
}
},
@@ -41193,16 +41573,16 @@
"description": "Validation Error"
}
},
- "summary": "Update Chat Response Timeout",
+ "summary": "Update Catalog",
"tags": [
"settings"
]
}
},
- "/api/settings/chat-starters": {
+ "/api/settings/chat-attachments": {
"get": {
- "description": "How many recent activities shape the home screen's starting points.\n\nPer user and not admin-gated, unlike the attachment caps next door: this\nchanges the size of one prompt built from the caller's own memory, not any\nresource other people share.",
- "operationId": "get_chat_starter_settings_api_settings_chat_starters_get",
+ "description": "Chat attachment policy. Readable by any user — the composer needs the\ncaps to gate file picks client-side; only the PUT is admin-gated.",
+ "operationId": "get_chat_attachment_settings_api_settings_chat_attachments_get",
"parameters": [
{
"in": "header",
@@ -41257,13 +41637,13 @@
"description": "Validation Error"
}
},
- "summary": "Get Chat Starter Settings",
+ "summary": "Get Chat Attachment Settings",
"tags": [
"settings"
]
},
"put": {
- "operationId": "update_chat_starter_settings_api_settings_chat_starters_put",
+ "operationId": "update_chat_attachment_settings_api_settings_chat_attachments_put",
"parameters": [
{
"in": "header",
@@ -41302,7 +41682,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/ChatStarterSettingsUpdate"
+ "$ref": "#/components/schemas/ChatAttachmentSettingsUpdate"
}
}
},
@@ -41328,15 +41708,16 @@
"description": "Validation Error"
}
},
- "summary": "Update Chat Starter Settings",
+ "summary": "Update Chat Attachment Settings",
"tags": [
"settings"
]
}
},
- "/api/settings/document-parsing": {
- "get": {
- "operationId": "get_document_parsing_settings_api_settings_document_parsing_get",
+ "/api/settings/chat-response-timeout": {
+ "put": {
+ "description": "Persist how long the chat UI waits for a turn event before timing out.\n\nA personal UI preference (any authenticated user). Slow tools like image /\nvideo generation can take longer than the old 60s default, so this is\nuser-adjustable; the chat surface reads it client-side.",
+ "operationId": "update_chat_response_timeout_api_settings_chat_response_timeout_put",
"parameters": [
{
"in": "header",
@@ -41371,6 +41752,16 @@
}
}
],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ChatResponseTimeoutUpdate"
+ }
+ }
+ },
+ "required": true
+ },
"responses": {
"200": {
"content": {
@@ -41391,13 +41782,16 @@
"description": "Validation Error"
}
},
- "summary": "Get Document Parsing Settings",
+ "summary": "Update Chat Response Timeout",
"tags": [
"settings"
]
- },
- "put": {
- "operationId": "update_document_parsing_settings_api_settings_document_parsing_put",
+ }
+ },
+ "/api/settings/chat-starters": {
+ "get": {
+ "description": "How many recent activities shape the home screen's starting points.\n\nPer user and not admin-gated, unlike the attachment caps next door: this\nchanges the size of one prompt built from the caller's own memory, not any\nresource other people share.",
+ "operationId": "get_chat_starter_settings_api_settings_chat_starters_get",
"parameters": [
{
"in": "header",
@@ -41432,16 +41826,6 @@
}
}
],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/DocumentParsingUpdate"
- }
- }
- },
- "required": true
- },
"responses": {
"200": {
"content": {
@@ -41462,16 +41846,13 @@
"description": "Validation Error"
}
},
- "summary": "Update Document Parsing Settings",
+ "summary": "Get Chat Starter Settings",
"tags": [
"settings"
]
- }
- },
- "/api/settings/document-parsing/docling/test": {
- "post": {
- "description": "Live connectivity check for the Docling remote-server draft values.\nPings the server health + version endpoints and returns ``ok`` + a\nhuman-readable detail. Tests draft form values so the user can verify the\nURL/key before saving; falls back to the stored key when the secret field\nis untouched.",
- "operationId": "test_docling_remote_connection_api_settings_document_parsing_docling_test_post",
+ },
+ "put": {
+ "operationId": "update_chat_starter_settings_api_settings_chat_starters_put",
"parameters": [
{
"in": "header",
@@ -41510,7 +41891,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/DoclingRemoteTest"
+ "$ref": "#/components/schemas/ChatStarterSettingsUpdate"
}
}
},
@@ -41536,16 +41917,15 @@
"description": "Validation Error"
}
},
- "summary": "Test Docling Remote Connection",
+ "summary": "Update Chat Starter Settings",
"tags": [
"settings"
]
}
},
- "/api/settings/document-parsing/install": {
- "post": {
- "description": "Kick off a one-click ``pip install`` of an optional engine's package(s).\n\nReturns ``{ok, message}`` immediately; progress is polled via the shared job\nstatus endpoint. Only one job runs at a time (process-wide singleton). The\nengine must be in the install allow-list (``ENGINE_PIP_SPECS``).",
- "operationId": "start_document_parsing_install_api_settings_document_parsing_install_post",
+ "/api/settings/document-parsing": {
+ "get": {
+ "operationId": "get_document_parsing_settings_api_settings_document_parsing_get",
"parameters": [
{
"in": "header",
@@ -41580,16 +41960,6 @@
}
}
],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/DocumentParsingInstall"
- }
- }
- },
- "required": true
- },
"responses": {
"200": {
"content": {
@@ -41610,15 +41980,13 @@
"description": "Validation Error"
}
},
- "summary": "Start Document Parsing Install",
+ "summary": "Get Document Parsing Settings",
"tags": [
"settings"
]
- }
- },
- "/api/settings/document-parsing/job/cancel": {
- "post": {
- "operationId": "cancel_document_parsing_job_api_settings_document_parsing_job_cancel_post",
+ },
+ "put": {
+ "operationId": "update_document_parsing_settings_api_settings_document_parsing_put",
"parameters": [
{
"in": "header",
@@ -41653,6 +42021,16 @@
}
}
],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/DocumentParsingUpdate"
+ }
+ }
+ },
+ "required": true
+ },
"responses": {
"200": {
"content": {
@@ -41673,26 +42051,17 @@
"description": "Validation Error"
}
},
- "summary": "Cancel Document Parsing Job",
+ "summary": "Update Document Parsing Settings",
"tags": [
"settings"
]
}
},
- "/api/settings/document-parsing/job/status": {
- "get": {
- "operationId": "document_parsing_job_status_api_settings_document_parsing_job_status_get",
+ "/api/settings/document-parsing/docling/test": {
+ "post": {
+ "description": "Live connectivity check for the Docling remote-server draft values.\nPings the server health + version endpoints and returns ``ok`` + a\nhuman-readable detail. Tests draft form values so the user can verify the\nURL/key before saving; falls back to the stored key when the secret field\nis untouched.",
+ "operationId": "test_docling_remote_connection_api_settings_document_parsing_docling_test_post",
"parameters": [
- {
- "in": "query",
- "name": "cursor",
- "required": false,
- "schema": {
- "default": 0,
- "title": "Cursor",
- "type": "integer"
- }
- },
{
"in": "header",
"name": "Authorization",
@@ -41726,6 +42095,16 @@
}
}
],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/DoclingRemoteTest"
+ }
+ }
+ },
+ "required": true
+ },
"responses": {
"200": {
"content": {
@@ -41746,16 +42125,16 @@
"description": "Validation Error"
}
},
- "summary": "Document Parsing Job Status",
+ "summary": "Test Docling Remote Connection",
"tags": [
"settings"
]
}
},
- "/api/settings/document-parsing/models/download": {
+ "/api/settings/document-parsing/install": {
"post": {
- "description": "Kick off a one-click model-weight download for an engine (e.g. Docling).\n\nRuns the engine's downloader console script (``docling-tools models\ndownload``) as a background subprocess; progress is polled via the shared job\nstatus endpoint. The engine must be in ``ENGINE_MODEL_DOWNLOADERS`` and its\nscript reachable next to the server's python or on PATH.",
- "operationId": "start_document_parsing_model_download_api_settings_document_parsing_models_download_post",
+ "description": "Kick off a one-click ``pip install`` of an optional engine's package(s).\n\nReturns ``{ok, message}`` immediately; progress is polled via the shared job\nstatus endpoint. Only one job runs at a time (process-wide singleton). The\nengine must be in the install allow-list (``ENGINE_PIP_SPECS``).",
+ "operationId": "start_document_parsing_install_api_settings_document_parsing_install_post",
"parameters": [
{
"in": "header",
@@ -41820,16 +42199,15 @@
"description": "Validation Error"
}
},
- "summary": "Start Document Parsing Model Download",
+ "summary": "Start Document Parsing Install",
"tags": [
"settings"
]
}
},
- "/api/settings/document-parsing/test": {
+ "/api/settings/document-parsing/job/cancel": {
"post": {
- "description": "Readiness test for an engine. For MinerU's deeper checks (live cloud\ntoken / CLI ``--version``) the UI uses ``/mineru/test``; this generic test\ncovers engine availability + model readiness for all engines.",
- "operationId": "test_document_parsing_api_settings_document_parsing_test_post",
+ "operationId": "cancel_document_parsing_job_api_settings_document_parsing_job_cancel_post",
"parameters": [
{
"in": "header",
@@ -41864,16 +42242,6 @@
}
}
],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/DocumentParsingTest"
- }
- }
- },
- "required": true
- },
"responses": {
"200": {
"content": {
@@ -41894,17 +42262,26 @@
"description": "Validation Error"
}
},
- "summary": "Test Document Parsing",
+ "summary": "Cancel Document Parsing Job",
"tags": [
"settings"
]
}
},
- "/api/settings/document-parsing/tika/test": {
- "post": {
- "description": "Live connectivity check for the Tika server draft URL. Pings ``/version``\nso the user can verify the URL before saving.",
- "operationId": "test_tika_remote_connection_api_settings_document_parsing_tika_test_post",
+ "/api/settings/document-parsing/job/status": {
+ "get": {
+ "operationId": "document_parsing_job_status_api_settings_document_parsing_job_status_get",
"parameters": [
+ {
+ "in": "query",
+ "name": "cursor",
+ "required": false,
+ "schema": {
+ "default": 0,
+ "title": "Cursor",
+ "type": "integer"
+ }
+ },
{
"in": "header",
"name": "Authorization",
@@ -41938,16 +42315,6 @@
}
}
],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/TikaRemoteTest"
- }
- }
- },
- "required": true
- },
"responses": {
"200": {
"content": {
@@ -41968,15 +42335,16 @@
"description": "Validation Error"
}
},
- "summary": "Test Tika Remote Connection",
+ "summary": "Document Parsing Job Status",
"tags": [
"settings"
]
}
},
- "/api/settings/draft": {
- "delete": {
- "operationId": "discard_settings_draft_api_settings_draft_delete",
+ "/api/settings/document-parsing/models/download": {
+ "post": {
+ "description": "Kick off a one-click model-weight download for an engine (e.g. Docling).\n\nRuns the engine's downloader console script (``docling-tools models\ndownload``) as a background subprocess; progress is polled via the shared job\nstatus endpoint. The engine must be in ``ENGINE_MODEL_DOWNLOADERS`` and its\nscript reachable next to the server's python or on PATH.",
+ "operationId": "start_document_parsing_model_download_api_settings_document_parsing_models_download_post",
"parameters": [
{
"in": "header",
@@ -42011,6 +42379,16 @@
}
}
],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/DocumentParsingInstall"
+ }
+ }
+ },
+ "required": true
+ },
"responses": {
"200": {
"content": {
@@ -42031,14 +42409,16 @@
"description": "Validation Error"
}
},
- "summary": "Discard Settings Draft",
+ "summary": "Start Document Parsing Model Download",
"tags": [
"settings"
]
- },
- "get": {
- "description": "Return the unapplied draft, or nothing when there is none.\n\nThe draft is deliberately invisible to every other read path: nothing that\nresolves runtime configuration looks here, which is the whole difference\nbetween saving a draft and applying it.",
- "operationId": "get_settings_draft_api_settings_draft_get",
+ }
+ },
+ "/api/settings/document-parsing/test": {
+ "post": {
+ "description": "Readiness test for an engine. For MinerU's deeper checks (live cloud\ntoken / CLI ``--version``) the UI uses ``/mineru/test``; this generic test\ncovers engine availability + model readiness for all engines.",
+ "operationId": "test_document_parsing_api_settings_document_parsing_test_post",
"parameters": [
{
"in": "header",
@@ -42073,6 +42453,16 @@
}
}
],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/DocumentParsingTest"
+ }
+ }
+ },
+ "required": true
+ },
"responses": {
"200": {
"content": {
@@ -42093,13 +42483,16 @@
"description": "Validation Error"
}
},
- "summary": "Get Settings Draft",
+ "summary": "Test Document Parsing",
"tags": [
"settings"
]
- },
- "put": {
- "operationId": "update_settings_draft_api_settings_draft_put",
+ }
+ },
+ "/api/settings/document-parsing/tika/test": {
+ "post": {
+ "description": "Live connectivity check for the Tika server draft URL. Pings ``/version``\nso the user can verify the URL before saving.",
+ "operationId": "test_tika_remote_connection_api_settings_document_parsing_tika_test_post",
"parameters": [
{
"in": "header",
@@ -42138,7 +42531,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/SettingsDraftPayload"
+ "$ref": "#/components/schemas/TikaRemoteTest"
}
}
},
@@ -42164,15 +42557,15 @@
"description": "Validation Error"
}
},
- "summary": "Update Settings Draft",
+ "summary": "Test Tika Remote Connection",
"tags": [
"settings"
]
}
},
- "/api/settings/enabled-tools": {
- "put": {
- "operationId": "update_enabled_tools_api_settings_enabled_tools_put",
+ "/api/settings/draft": {
+ "delete": {
+ "operationId": "discard_settings_draft_api_settings_draft_delete",
"parameters": [
{
"in": "header",
@@ -42207,16 +42600,6 @@
}
}
],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/EnabledToolsUpdate"
- }
- }
- },
- "required": true
- },
"responses": {
"200": {
"content": {
@@ -42237,16 +42620,14 @@
"description": "Validation Error"
}
},
- "summary": "Update Enabled Tools",
+ "summary": "Discard Settings Draft",
"tags": [
"settings"
]
- }
- },
- "/api/settings/fetch-models": {
- "post": {
- "description": "List the model IDs an OpenAI-compatible provider exposes.\n\nThin HTTP surface over ``factory.fetch_models`` so the settings UI can\npopulate a model picker from ``base_url`` + ``api_key`` instead of making\nthe user type model IDs by hand.",
- "operationId": "fetch_models_from_provider_api_settings_fetch_models_post",
+ },
+ "get": {
+ "description": "Return the unapplied draft, or nothing when there is none.\n\nThe draft is deliberately invisible to every other read path: nothing that\nresolves runtime configuration looks here, which is the whole difference\nbetween saving a draft and applying it.",
+ "operationId": "get_settings_draft_api_settings_draft_get",
"parameters": [
{
"in": "header",
@@ -42281,16 +42662,6 @@
}
}
],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/FetchModelsPayload"
- }
- }
- },
- "required": true
- },
"responses": {
"200": {
"content": {
@@ -42311,15 +42682,13 @@
"description": "Validation Error"
}
},
- "summary": "Fetch Models From Provider",
+ "summary": "Get Settings Draft",
"tags": [
"settings"
]
- }
- },
- "/api/settings/language": {
+ },
"put": {
- "operationId": "update_language_api_settings_language_put",
+ "operationId": "update_settings_draft_api_settings_draft_put",
"parameters": [
{
"in": "header",
@@ -42358,7 +42727,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/LanguageUpdate"
+ "$ref": "#/components/schemas/SettingsDraftPayload"
}
}
},
@@ -42384,15 +42753,15 @@
"description": "Validation Error"
}
},
- "summary": "Update Language",
+ "summary": "Update Settings Draft",
"tags": [
"settings"
]
}
},
- "/api/settings/llm-options": {
- "get": {
- "operationId": "get_llm_options_api_settings_llm_options_get",
+ "/api/settings/enabled-tools": {
+ "put": {
+ "operationId": "update_enabled_tools_api_settings_enabled_tools_put",
"parameters": [
{
"in": "header",
@@ -42427,6 +42796,16 @@
}
}
],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/EnabledToolsUpdate"
+ }
+ }
+ },
+ "required": true
+ },
"responses": {
"200": {
"content": {
@@ -42447,15 +42826,16 @@
"description": "Validation Error"
}
},
- "summary": "Get Llm Options",
+ "summary": "Update Enabled Tools",
"tags": [
"settings"
]
}
},
- "/api/settings/mcp": {
- "get": {
- "operationId": "get_mcp_settings_api_settings_mcp_get",
+ "/api/settings/fetch-models": {
+ "post": {
+ "description": "List the model IDs an OpenAI-compatible provider exposes.\n\nThin HTTP surface over ``factory.fetch_models`` so the settings UI can\npopulate a model picker from ``base_url`` + ``api_key`` instead of making\nthe user type model IDs by hand.",
+ "operationId": "fetch_models_from_provider_api_settings_fetch_models_post",
"parameters": [
{
"in": "header",
@@ -42490,15 +42870,21 @@
}
}
],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/FetchModelsPayload"
+ }
+ }
+ },
+ "required": true
+ },
"responses": {
"200": {
"content": {
"application/json": {
- "schema": {
- "additionalProperties": true,
- "title": "Response Get Mcp Settings Api Settings Mcp Get",
- "type": "object"
- }
+ "schema": {}
}
},
"description": "Successful Response"
@@ -42514,13 +42900,15 @@
"description": "Validation Error"
}
},
- "summary": "Get Mcp Settings",
+ "summary": "Fetch Models From Provider",
"tags": [
- "mcp-settings"
+ "settings"
]
- },
+ }
+ },
+ "/api/settings/language": {
"put": {
- "operationId": "update_mcp_settings_api_settings_mcp_put",
+ "operationId": "update_language_api_settings_language_put",
"parameters": [
{
"in": "header",
@@ -42559,7 +42947,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/MCPSettingsPayload"
+ "$ref": "#/components/schemas/LanguageUpdate"
}
}
},
@@ -42569,11 +42957,7 @@
"200": {
"content": {
"application/json": {
- "schema": {
- "additionalProperties": true,
- "title": "Response Update Mcp Settings Api Settings Mcp Put",
- "type": "object"
- }
+ "schema": {}
}
},
"description": "Successful Response"
@@ -42589,25 +42973,79 @@
"description": "Validation Error"
}
},
- "summary": "Update Mcp Settings",
+ "summary": "Update Language",
"tags": [
- "mcp-settings"
+ "settings"
]
}
},
- "/api/settings/mcp/servers/{name}": {
- "delete": {
- "operationId": "delete_mcp_server_api_settings_mcp_servers__name__delete",
+ "/api/settings/llm-options": {
+ "get": {
+ "operationId": "get_llm_options_api_settings_llm_options_get",
"parameters": [
{
- "in": "path",
- "name": "name",
- "required": true,
+ "in": "header",
+ "name": "Authorization",
+ "required": false,
"schema": {
- "title": "Name",
- "type": "string"
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Authorization"
}
},
+ {
+ "in": "cookie",
+ "name": "dt_token",
+ "required": false,
+ "schema": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Dt Token"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "content": {
+ "application/json": {
+ "schema": {}
+ }
+ },
+ "description": "Successful Response"
+ },
+ "422": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
+ }
+ },
+ "description": "Validation Error"
+ }
+ },
+ "summary": "Get Llm Options",
+ "tags": [
+ "settings"
+ ]
+ }
+ },
+ "/api/settings/mcp": {
+ "get": {
+ "operationId": "get_mcp_settings_api_settings_mcp_get",
+ "parameters": [
{
"in": "header",
"name": "Authorization",
@@ -42647,7 +43085,7 @@
"application/json": {
"schema": {
"additionalProperties": true,
- "title": "Response Delete Mcp Server Api Settings Mcp Servers Name Delete",
+ "title": "Response Get Mcp Settings Api Settings Mcp Get",
"type": "object"
}
}
@@ -42665,24 +43103,14 @@
"description": "Validation Error"
}
},
- "summary": "Delete Mcp Server",
+ "summary": "Get Mcp Settings",
"tags": [
"mcp-settings"
]
},
"put": {
- "description": "Upsert one server, leaving every other entry byte-identical.\n\nThe whole-map ``PUT`` above cannot express \"change this one\": a client has to\nsend back everything it read, so it silently drops any field it does not\nmodel (a hand-written ``disabled_tools`` blocklist) and overwrites whatever\na second administrator saved in between.",
- "operationId": "upsert_mcp_server_api_settings_mcp_servers__name__put",
+ "operationId": "update_mcp_settings_api_settings_mcp_put",
"parameters": [
- {
- "in": "path",
- "name": "name",
- "required": true,
- "schema": {
- "title": "Name",
- "type": "string"
- }
- },
{
"in": "header",
"name": "Authorization",
@@ -42720,7 +43148,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/MCPServerConfig"
+ "$ref": "#/components/schemas/MCPSettingsPayload"
}
}
},
@@ -42732,7 +43160,7 @@
"application/json": {
"schema": {
"additionalProperties": true,
- "title": "Response Upsert Mcp Server Api Settings Mcp Servers Name Put",
+ "title": "Response Update Mcp Settings Api Settings Mcp Put",
"type": "object"
}
}
@@ -42750,16 +43178,25 @@
"description": "Validation Error"
}
},
- "summary": "Upsert Mcp Server",
+ "summary": "Update Mcp Settings",
"tags": [
"mcp-settings"
]
}
},
- "/api/settings/mcp/test": {
- "post": {
- "operationId": "test_mcp_server_api_settings_mcp_test_post",
+ "/api/settings/mcp/servers/{name}": {
+ "delete": {
+ "operationId": "delete_mcp_server_api_settings_mcp_servers__name__delete",
"parameters": [
+ {
+ "in": "path",
+ "name": "name",
+ "required": true,
+ "schema": {
+ "title": "Name",
+ "type": "string"
+ }
+ },
{
"in": "header",
"name": "Authorization",
@@ -42793,23 +43230,13 @@
}
}
],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/MCPServerConfig"
- }
- }
- },
- "required": true
- },
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"additionalProperties": true,
- "title": "Response Test Mcp Server Api Settings Mcp Test Post",
+ "title": "Response Delete Mcp Server Api Settings Mcp Servers Name Delete",
"type": "object"
}
}
@@ -42827,16 +43254,24 @@
"description": "Validation Error"
}
},
- "summary": "Test Mcp Server",
+ "summary": "Delete Mcp Server",
"tags": [
"mcp-settings"
]
- }
- },
- "/api/settings/mineru": {
- "get": {
- "operationId": "get_mineru_settings_api_settings_mineru_get",
+ },
+ "put": {
+ "description": "Upsert one server, leaving every other entry byte-identical.\n\nThe whole-map ``PUT`` above cannot express \"change this one\": a client has to\nsend back everything it read, so it silently drops any field it does not\nmodel (a hand-written ``disabled_tools`` blocklist) and overwrites whatever\na second administrator saved in between.",
+ "operationId": "upsert_mcp_server_api_settings_mcp_servers__name__put",
"parameters": [
+ {
+ "in": "path",
+ "name": "name",
+ "required": true,
+ "schema": {
+ "title": "Name",
+ "type": "string"
+ }
+ },
{
"in": "header",
"name": "Authorization",
@@ -42870,11 +43305,25 @@
}
}
],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/MCPServerConfig"
+ }
+ }
+ },
+ "required": true
+ },
"responses": {
"200": {
"content": {
"application/json": {
- "schema": {}
+ "schema": {
+ "additionalProperties": true,
+ "title": "Response Upsert Mcp Server Api Settings Mcp Servers Name Put",
+ "type": "object"
+ }
}
},
"description": "Successful Response"
@@ -42890,13 +43339,15 @@
"description": "Validation Error"
}
},
- "summary": "Get Mineru Settings",
+ "summary": "Upsert Mcp Server",
"tags": [
- "settings"
+ "mcp-settings"
]
- },
- "put": {
- "operationId": "update_mineru_settings_api_settings_mineru_put",
+ }
+ },
+ "/api/settings/mcp/test": {
+ "post": {
+ "operationId": "test_mcp_server_api_settings_mcp_test_post",
"parameters": [
{
"in": "header",
@@ -42935,7 +43386,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/MinerUSettingsUpdate"
+ "$ref": "#/components/schemas/MCPServerConfig"
}
}
},
@@ -42945,7 +43396,11 @@
"200": {
"content": {
"application/json": {
- "schema": {}
+ "schema": {
+ "additionalProperties": true,
+ "title": "Response Test Mcp Server Api Settings Mcp Test Post",
+ "type": "object"
+ }
}
},
"description": "Successful Response"
@@ -42961,16 +43416,15 @@
"description": "Validation Error"
}
},
- "summary": "Update Mineru Settings",
+ "summary": "Test Mcp Server",
"tags": [
- "settings"
+ "mcp-settings"
]
}
},
- "/api/settings/mineru/models/download": {
- "post": {
- "description": "Kick off a one-click model download via ``mineru-models-download``.\n\nReturns ``{ok, message}`` immediately; progress is polled via the status\nendpoint. Only one download runs at a time (process-wide singleton).",
- "operationId": "start_mineru_models_download_api_settings_mineru_models_download_post",
+ "/api/settings/mineru": {
+ "get": {
+ "operationId": "get_mineru_settings_api_settings_mineru_get",
"parameters": [
{
"in": "header",
@@ -43005,16 +43459,6 @@
}
}
],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/MinerUModelDownloadPayload"
- }
- }
- },
- "required": true
- },
"responses": {
"200": {
"content": {
@@ -43035,15 +43479,13 @@
"description": "Validation Error"
}
},
- "summary": "Start Mineru Models Download",
+ "summary": "Get Mineru Settings",
"tags": [
"settings"
]
- }
- },
- "/api/settings/mineru/models/download/cancel": {
- "post": {
- "operationId": "cancel_mineru_models_download_api_settings_mineru_models_download_cancel_post",
+ },
+ "put": {
+ "operationId": "update_mineru_settings_api_settings_mineru_put",
"parameters": [
{
"in": "header",
@@ -43078,6 +43520,16 @@
}
}
],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/MinerUSettingsUpdate"
+ }
+ }
+ },
+ "required": true
+ },
"responses": {
"200": {
"content": {
@@ -43098,26 +43550,17 @@
"description": "Validation Error"
}
},
- "summary": "Cancel Mineru Models Download",
+ "summary": "Update Mineru Settings",
"tags": [
"settings"
]
}
},
- "/api/settings/mineru/models/download/status": {
- "get": {
- "operationId": "mineru_models_download_status_api_settings_mineru_models_download_status_get",
+ "/api/settings/mineru/models/download": {
+ "post": {
+ "description": "Kick off a one-click model download via ``mineru-models-download``.\n\nReturns ``{ok, message}`` immediately; progress is polled via the status\nendpoint. Only one download runs at a time (process-wide singleton).",
+ "operationId": "start_mineru_models_download_api_settings_mineru_models_download_post",
"parameters": [
- {
- "in": "query",
- "name": "cursor",
- "required": false,
- "schema": {
- "default": 0,
- "title": "Cursor",
- "type": "integer"
- }
- },
{
"in": "header",
"name": "Authorization",
@@ -43151,6 +43594,16 @@
}
}
],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/MinerUModelDownloadPayload"
+ }
+ }
+ },
+ "required": true
+ },
"responses": {
"200": {
"content": {
@@ -43171,16 +43624,15 @@
"description": "Validation Error"
}
},
- "summary": "Mineru Models Download Status",
+ "summary": "Start Mineru Models Download",
"tags": [
"settings"
]
}
},
- "/api/settings/mineru/test": {
+ "/api/settings/mineru/models/download/cancel": {
"post": {
- "description": "Validate the active backend. ``mode == \"local\"`` checks the CLI install\n(PATH probe + ``--version``); cloud mode validates the token against the\nlive MinerU API (no parse quota consumed). Tests the draft form values so\nthe user can verify before saving; falls back to the stored token when the\nsecret field is untouched.",
- "operationId": "test_mineru_connection_api_settings_mineru_test_post",
+ "operationId": "cancel_mineru_models_download_api_settings_mineru_models_download_cancel_post",
"parameters": [
{
"in": "header",
@@ -43215,16 +43667,6 @@
}
}
],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/MinerUSettingsUpdate"
- }
- }
- },
- "required": true
- },
"responses": {
"200": {
"content": {
@@ -43245,17 +43687,26 @@
"description": "Validation Error"
}
},
- "summary": "Test Mineru Connection",
+ "summary": "Cancel Mineru Models Download",
"tags": [
"settings"
]
}
},
- "/api/settings/model-capabilities": {
- "post": {
- "description": "What the built-in capability tables assume for one provider/model pair.\n\nThe settings UI shows these as the value \"Auto\" resolves to next to each\nper-model override, so a user can see what they are overriding.",
- "operationId": "resolve_model_capabilities_api_settings_model_capabilities_post",
+ "/api/settings/mineru/models/download/status": {
+ "get": {
+ "operationId": "mineru_models_download_status_api_settings_mineru_models_download_status_get",
"parameters": [
+ {
+ "in": "query",
+ "name": "cursor",
+ "required": false,
+ "schema": {
+ "default": 0,
+ "title": "Cursor",
+ "type": "integer"
+ }
+ },
{
"in": "header",
"name": "Authorization",
@@ -43289,16 +43740,6 @@
}
}
],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ModelCapabilitiesQuery"
- }
- }
- },
- "required": true
- },
"responses": {
"200": {
"content": {
@@ -43319,15 +43760,16 @@
"description": "Validation Error"
}
},
- "summary": "Resolve Model Capabilities",
+ "summary": "Mineru Models Download Status",
"tags": [
"settings"
]
}
},
- "/api/settings/network": {
- "get": {
- "operationId": "get_network_settings_api_settings_network_get",
+ "/api/settings/mineru/test": {
+ "post": {
+ "description": "Validate the active backend. ``mode == \"local\"`` checks the CLI install\n(PATH probe + ``--version``); cloud mode validates the token against the\nlive MinerU API (no parse quota consumed). Tests the draft form values so\nthe user can verify before saving; falls back to the stored token when the\nsecret field is untouched.",
+ "operationId": "test_mineru_connection_api_settings_mineru_test_post",
"parameters": [
{
"in": "header",
@@ -43362,6 +43804,16 @@
}
}
],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/MinerUSettingsUpdate"
+ }
+ }
+ },
+ "required": true
+ },
"responses": {
"200": {
"content": {
@@ -43382,13 +43834,16 @@
"description": "Validation Error"
}
},
- "summary": "Get Network Settings",
+ "summary": "Test Mineru Connection",
"tags": [
"settings"
]
- },
- "put": {
- "operationId": "update_network_settings_api_settings_network_put",
+ }
+ },
+ "/api/settings/model-capabilities": {
+ "post": {
+ "description": "What the built-in capability tables assume for one provider/model pair.\n\nThe settings UI shows these as the value \"Auto\" resolves to next to each\nper-model override, so a user can see what they are overriding.",
+ "operationId": "resolve_model_capabilities_api_settings_model_capabilities_post",
"parameters": [
{
"in": "header",
@@ -43427,7 +43882,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/NetworkSettingsUpdate"
+ "$ref": "#/components/schemas/ModelCapabilitiesQuery"
}
}
},
@@ -43453,15 +43908,15 @@
"description": "Validation Error"
}
},
- "summary": "Update Network Settings",
+ "summary": "Resolve Model Capabilities",
"tags": [
"settings"
]
}
},
- "/api/settings/providers/codebuddy/auth/cancel": {
- "post": {
- "operationId": "cancel_codebuddy_auth_api_settings_providers_codebuddy_auth_cancel_post",
+ "/api/settings/network": {
+ "get": {
+ "operationId": "get_network_settings_api_settings_network_get",
"parameters": [
{
"in": "header",
@@ -43500,11 +43955,7 @@
"200": {
"content": {
"application/json": {
- "schema": {
- "additionalProperties": true,
- "title": "Response Cancel Codebuddy Auth Api Settings Providers Codebuddy Auth Cancel Post",
- "type": "object"
- }
+ "schema": {}
}
},
"description": "Successful Response"
@@ -43520,15 +43971,13 @@
"description": "Validation Error"
}
},
- "summary": "Cancel Codebuddy Auth",
+ "summary": "Get Network Settings",
"tags": [
"settings"
]
- }
- },
- "/api/settings/providers/codebuddy/auth/logout": {
- "post": {
- "operationId": "logout_codebuddy_auth_api_settings_providers_codebuddy_auth_logout_post",
+ },
+ "put": {
+ "operationId": "update_network_settings_api_settings_network_put",
"parameters": [
{
"in": "header",
@@ -43563,15 +44012,21 @@
}
}
],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/NetworkSettingsUpdate"
+ }
+ }
+ },
+ "required": true
+ },
"responses": {
"200": {
"content": {
"application/json": {
- "schema": {
- "additionalProperties": true,
- "title": "Response Logout Codebuddy Auth Api Settings Providers Codebuddy Auth Logout Post",
- "type": "object"
- }
+ "schema": {}
}
},
"description": "Successful Response"
@@ -43587,15 +44042,15 @@
"description": "Validation Error"
}
},
- "summary": "Logout Codebuddy Auth",
+ "summary": "Update Network Settings",
"tags": [
"settings"
]
}
},
- "/api/settings/providers/codebuddy/auth/start": {
+ "/api/settings/providers/codebuddy/auth/cancel": {
"post": {
- "operationId": "start_codebuddy_auth_api_settings_providers_codebuddy_auth_start_post",
+ "operationId": "cancel_codebuddy_auth_api_settings_providers_codebuddy_auth_cancel_post",
"parameters": [
{
"in": "header",
@@ -43636,7 +44091,7 @@
"application/json": {
"schema": {
"additionalProperties": true,
- "title": "Response Start Codebuddy Auth Api Settings Providers Codebuddy Auth Start Post",
+ "title": "Response Cancel Codebuddy Auth Api Settings Providers Codebuddy Auth Cancel Post",
"type": "object"
}
}
@@ -43654,15 +44109,15 @@
"description": "Validation Error"
}
},
- "summary": "Start Codebuddy Auth",
+ "summary": "Cancel Codebuddy Auth",
"tags": [
"settings"
]
}
},
- "/api/settings/providers/codebuddy/auth/status": {
- "get": {
- "operationId": "get_codebuddy_auth_status_api_settings_providers_codebuddy_auth_status_get",
+ "/api/settings/providers/codebuddy/auth/logout": {
+ "post": {
+ "operationId": "logout_codebuddy_auth_api_settings_providers_codebuddy_auth_logout_post",
"parameters": [
{
"in": "header",
@@ -43703,7 +44158,7 @@
"application/json": {
"schema": {
"additionalProperties": true,
- "title": "Response Get Codebuddy Auth Status Api Settings Providers Codebuddy Auth Status Get",
+ "title": "Response Logout Codebuddy Auth Api Settings Providers Codebuddy Auth Logout Post",
"type": "object"
}
}
@@ -43721,15 +44176,15 @@
"description": "Validation Error"
}
},
- "summary": "Get Codebuddy Auth Status",
+ "summary": "Logout Codebuddy Auth",
"tags": [
"settings"
]
}
},
- "/api/settings/providers/openai-codex/models/reasoning-effort": {
+ "/api/settings/providers/codebuddy/auth/start": {
"post": {
- "operationId": "update_openai_codex_reasoning_effort_api_settings_providers_openai_codex_models_reasoning_effort_post",
+ "operationId": "start_codebuddy_auth_api_settings_providers_codebuddy_auth_start_post",
"parameters": [
{
"in": "header",
@@ -43764,23 +44219,13 @@
}
}
],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/CodexReasoningEffortUpdate"
- }
- }
- },
- "required": true
- },
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"additionalProperties": true,
- "title": "Response Update Openai Codex Reasoning Effort Api Settings Providers Openai Codex Models Reasoning Effort Post",
+ "title": "Response Start Codebuddy Auth Api Settings Providers Codebuddy Auth Start Post",
"type": "object"
}
}
@@ -43798,15 +44243,15 @@
"description": "Validation Error"
}
},
- "summary": "Update Openai Codex Reasoning Effort",
+ "summary": "Start Codebuddy Auth",
"tags": [
"settings"
]
}
},
- "/api/settings/providers/openai-codex/models/refresh": {
- "post": {
- "operationId": "refresh_openai_codex_models_api_settings_providers_openai_codex_models_refresh_post",
+ "/api/settings/providers/codebuddy/auth/status": {
+ "get": {
+ "operationId": "get_codebuddy_auth_status_api_settings_providers_codebuddy_auth_status_get",
"parameters": [
{
"in": "header",
@@ -43847,7 +44292,7 @@
"application/json": {
"schema": {
"additionalProperties": true,
- "title": "Response Refresh Openai Codex Models Api Settings Providers Openai Codex Models Refresh Post",
+ "title": "Response Get Codebuddy Auth Status Api Settings Providers Codebuddy Auth Status Get",
"type": "object"
}
}
@@ -43865,15 +44310,15 @@
"description": "Validation Error"
}
},
- "summary": "Refresh Openai Codex Models",
+ "summary": "Get Codebuddy Auth Status",
"tags": [
"settings"
]
}
},
- "/api/settings/providers/openai-codex/oauth/cancel": {
+ "/api/settings/providers/openai-codex/models/reasoning-effort": {
"post": {
- "operationId": "cancel_openai_codex_oauth_api_settings_providers_openai_codex_oauth_cancel_post",
+ "operationId": "update_openai_codex_reasoning_effort_api_settings_providers_openai_codex_models_reasoning_effort_post",
"parameters": [
{
"in": "header",
@@ -43908,13 +44353,23 @@
}
}
],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/CodexReasoningEffortUpdate"
+ }
+ }
+ },
+ "required": true
+ },
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"additionalProperties": true,
- "title": "Response Cancel Openai Codex Oauth Api Settings Providers Openai Codex Oauth Cancel Post",
+ "title": "Response Update Openai Codex Reasoning Effort Api Settings Providers Openai Codex Models Reasoning Effort Post",
"type": "object"
}
}
@@ -43932,16 +44387,15 @@
"description": "Validation Error"
}
},
- "summary": "Cancel Openai Codex Oauth",
+ "summary": "Update Openai Codex Reasoning Effort",
"tags": [
"settings"
]
}
},
- "/api/settings/providers/openai-codex/oauth/complete": {
+ "/api/settings/providers/openai-codex/models/refresh": {
"post": {
- "description": "Finish a waiting Codex login from a callback address the user pasted.\n\nThe provider redirects the browser to a loopback listener. In Docker that\nlistener lives in the container and the published ports do not include it,\nso the browser shows a failed page while the sign-in waits forever\n(#1252). This is the way back in without a tunnel: the address is parsed\nfor its OAuth result and discarded, and the exchange is the same one the\nlistener would have driven.",
- "operationId": "complete_openai_codex_oauth_api_settings_providers_openai_codex_oauth_complete_post",
+ "operationId": "refresh_openai_codex_models_api_settings_providers_openai_codex_models_refresh_post",
"parameters": [
{
"in": "header",
@@ -43976,23 +44430,13 @@
}
}
],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/CodexOAuthCallbackPayload"
- }
- }
- },
- "required": true
- },
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"additionalProperties": true,
- "title": "Response Complete Openai Codex Oauth Api Settings Providers Openai Codex Oauth Complete Post",
+ "title": "Response Refresh Openai Codex Models Api Settings Providers Openai Codex Models Refresh Post",
"type": "object"
}
}
@@ -44010,15 +44454,15 @@
"description": "Validation Error"
}
},
- "summary": "Complete Openai Codex Oauth",
+ "summary": "Refresh Openai Codex Models",
"tags": [
"settings"
]
}
},
- "/api/settings/providers/openai-codex/oauth/logout": {
+ "/api/settings/providers/openai-codex/oauth/cancel": {
"post": {
- "operationId": "logout_openai_codex_oauth_api_settings_providers_openai_codex_oauth_logout_post",
+ "operationId": "cancel_openai_codex_oauth_api_settings_providers_openai_codex_oauth_cancel_post",
"parameters": [
{
"in": "header",
@@ -44059,7 +44503,7 @@
"application/json": {
"schema": {
"additionalProperties": true,
- "title": "Response Logout Openai Codex Oauth Api Settings Providers Openai Codex Oauth Logout Post",
+ "title": "Response Cancel Openai Codex Oauth Api Settings Providers Openai Codex Oauth Cancel Post",
"type": "object"
}
}
@@ -44077,15 +44521,16 @@
"description": "Validation Error"
}
},
- "summary": "Logout Openai Codex Oauth",
+ "summary": "Cancel Openai Codex Oauth",
"tags": [
"settings"
]
}
},
- "/api/settings/providers/openai-codex/oauth/start": {
+ "/api/settings/providers/openai-codex/oauth/complete": {
"post": {
- "operationId": "start_openai_codex_oauth_api_settings_providers_openai_codex_oauth_start_post",
+ "description": "Finish a waiting Codex login from a callback address the user pasted.\n\nThe provider redirects the browser to a loopback listener. In Docker that\nlistener lives in the container and the published ports do not include it,\nso the browser shows a failed page while the sign-in waits forever\n(#1252). This is the way back in without a tunnel: the address is parsed\nfor its OAuth result and discarded, and the exchange is the same one the\nlistener would have driven.",
+ "operationId": "complete_openai_codex_oauth_api_settings_providers_openai_codex_oauth_complete_post",
"parameters": [
{
"in": "header",
@@ -44120,13 +44565,23 @@
}
}
],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/CodexOAuthCallbackPayload"
+ }
+ }
+ },
+ "required": true
+ },
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"additionalProperties": true,
- "title": "Response Start Openai Codex Oauth Api Settings Providers Openai Codex Oauth Start Post",
+ "title": "Response Complete Openai Codex Oauth Api Settings Providers Openai Codex Oauth Complete Post",
"type": "object"
}
}
@@ -44144,15 +44599,15 @@
"description": "Validation Error"
}
},
- "summary": "Start Openai Codex Oauth",
+ "summary": "Complete Openai Codex Oauth",
"tags": [
"settings"
]
}
},
- "/api/settings/providers/openai-codex/oauth/status": {
- "get": {
- "operationId": "get_openai_codex_oauth_status_api_settings_providers_openai_codex_oauth_status_get",
+ "/api/settings/providers/openai-codex/oauth/logout": {
+ "post": {
+ "operationId": "logout_openai_codex_oauth_api_settings_providers_openai_codex_oauth_logout_post",
"parameters": [
{
"in": "header",
@@ -44193,7 +44648,7 @@
"application/json": {
"schema": {
"additionalProperties": true,
- "title": "Response Get Openai Codex Oauth Status Api Settings Providers Openai Codex Oauth Status Get",
+ "title": "Response Logout Openai Codex Oauth Api Settings Providers Openai Codex Oauth Logout Post",
"type": "object"
}
}
@@ -44211,16 +44666,15 @@
"description": "Validation Error"
}
},
- "summary": "Get Openai Codex Oauth Status",
+ "summary": "Logout Openai Codex Oauth",
"tags": [
"settings"
]
}
},
- "/api/settings/readiness": {
- "get": {
- "description": "Return the value-free cross-setting capability readiness matrix.",
- "operationId": "get_settings_readiness_api_settings_readiness_get",
+ "/api/settings/providers/openai-codex/oauth/start": {
+ "post": {
+ "operationId": "start_openai_codex_oauth_api_settings_providers_openai_codex_oauth_start_post",
"parameters": [
{
"in": "header",
@@ -44259,7 +44713,11 @@
"200": {
"content": {
"application/json": {
- "schema": {}
+ "schema": {
+ "additionalProperties": true,
+ "title": "Response Start Openai Codex Oauth Api Settings Providers Openai Codex Oauth Start Post",
+ "type": "object"
+ }
}
},
"description": "Successful Response"
@@ -44275,15 +44733,15 @@
"description": "Validation Error"
}
},
- "summary": "Get Settings Readiness",
+ "summary": "Start Openai Codex Oauth",
"tags": [
"settings"
]
}
},
- "/api/settings/reset": {
- "post": {
- "operationId": "reset_settings_api_settings_reset_post",
+ "/api/settings/providers/openai-codex/oauth/status": {
+ "get": {
+ "operationId": "get_openai_codex_oauth_status_api_settings_providers_openai_codex_oauth_status_get",
"parameters": [
{
"in": "header",
@@ -44322,7 +44780,11 @@
"200": {
"content": {
"application/json": {
- "schema": {}
+ "schema": {
+ "additionalProperties": true,
+ "title": "Response Get Openai Codex Oauth Status Api Settings Providers Openai Codex Oauth Status Get",
+ "type": "object"
+ }
}
},
"description": "Successful Response"
@@ -44338,15 +44800,16 @@
"description": "Validation Error"
}
},
- "summary": "Reset Settings",
+ "summary": "Get Openai Codex Oauth Status",
"tags": [
"settings"
]
}
},
- "/api/settings/sidebar": {
+ "/api/settings/readiness": {
"get": {
- "operationId": "get_sidebar_settings_api_settings_sidebar_get",
+ "description": "Return the value-free cross-setting capability readiness matrix.",
+ "operationId": "get_settings_readiness_api_settings_readiness_get",
"parameters": [
{
"in": "header",
@@ -44401,15 +44864,15 @@
"description": "Validation Error"
}
},
- "summary": "Get Sidebar Settings",
+ "summary": "Get Settings Readiness",
"tags": [
"settings"
]
}
},
- "/api/settings/sidebar/description": {
- "put": {
- "operationId": "update_sidebar_description_api_settings_sidebar_description_put",
+ "/api/settings/reset": {
+ "post": {
+ "operationId": "reset_settings_api_settings_reset_post",
"parameters": [
{
"in": "header",
@@ -44444,16 +44907,6 @@
}
}
],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/SidebarDescriptionUpdate"
- }
- }
- },
- "required": true
- },
"responses": {
"200": {
"content": {
@@ -44474,15 +44927,15 @@
"description": "Validation Error"
}
},
- "summary": "Update Sidebar Description",
+ "summary": "Reset Settings",
"tags": [
"settings"
]
}
},
- "/api/settings/sidebar/nav-order": {
- "put": {
- "operationId": "update_sidebar_nav_order_api_settings_sidebar_nav_order_put",
+ "/api/settings/sidebar": {
+ "get": {
+ "operationId": "get_sidebar_settings_api_settings_sidebar_get",
"parameters": [
{
"in": "header",
@@ -44517,16 +44970,6 @@
}
}
],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/SidebarNavOrderUpdate"
- }
- }
- },
- "required": true
- },
"responses": {
"200": {
"content": {
@@ -44547,25 +44990,16 @@
"description": "Validation Error"
}
},
- "summary": "Update Sidebar Nav Order",
+ "summary": "Get Sidebar Settings",
"tags": [
"settings"
]
}
},
- "/api/settings/tests/{service}/start": {
- "post": {
- "operationId": "start_service_test_api_settings_tests__service__start_post",
+ "/api/settings/sidebar/description": {
+ "put": {
+ "operationId": "update_sidebar_description_api_settings_sidebar_description_put",
"parameters": [
- {
- "in": "path",
- "name": "service",
- "required": true,
- "schema": {
- "title": "Service",
- "type": "string"
- }
- },
{
"in": "header",
"name": "Authorization",
@@ -44603,18 +45037,11 @@
"content": {
"application/json": {
"schema": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/CatalogPayload"
- },
- {
- "type": "null"
- }
- ],
- "title": "Payload"
+ "$ref": "#/components/schemas/SidebarDescriptionUpdate"
}
}
- }
+ },
+ "required": true
},
"responses": {
"200": {
@@ -44636,34 +45063,16 @@
"description": "Validation Error"
}
},
- "summary": "Start Service Test",
+ "summary": "Update Sidebar Description",
"tags": [
"settings"
]
}
},
- "/api/settings/tests/{service}/{run_id}/cancel": {
- "post": {
- "operationId": "cancel_service_test_api_settings_tests__service___run_id__cancel_post",
+ "/api/settings/sidebar/nav-order": {
+ "put": {
+ "operationId": "update_sidebar_nav_order_api_settings_sidebar_nav_order_put",
"parameters": [
- {
- "in": "path",
- "name": "service",
- "required": true,
- "schema": {
- "title": "Service",
- "type": "string"
- }
- },
- {
- "in": "path",
- "name": "run_id",
- "required": true,
- "schema": {
- "title": "Run Id",
- "type": "string"
- }
- },
{
"in": "header",
"name": "Authorization",
@@ -44697,6 +45106,16 @@
}
}
],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/SidebarNavOrderUpdate"
+ }
+ }
+ },
+ "required": true
+ },
"responses": {
"200": {
"content": {
@@ -44717,15 +45136,15 @@
"description": "Validation Error"
}
},
- "summary": "Cancel Service Test",
+ "summary": "Update Sidebar Nav Order",
"tags": [
"settings"
]
}
},
- "/api/settings/tests/{service}/{run_id}/events": {
- "get": {
- "operationId": "stream_service_test_events_api_settings_tests__service___run_id__events_get",
+ "/api/settings/tests/{service}/start": {
+ "post": {
+ "operationId": "start_service_test_api_settings_tests__service__start_post",
"parameters": [
{
"in": "path",
@@ -44736,15 +45155,6 @@
"type": "string"
}
},
- {
- "in": "path",
- "name": "run_id",
- "required": true,
- "schema": {
- "title": "Run Id",
- "type": "string"
- }
- },
{
"in": "header",
"name": "Authorization",
@@ -44778,6 +45188,23 @@
}
}
],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/CatalogPayload"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Payload"
+ }
+ }
+ }
+ },
"responses": {
"200": {
"content": {
@@ -44798,16 +45225,34 @@
"description": "Validation Error"
}
},
- "summary": "Stream Service Test Events",
+ "summary": "Start Service Test",
"tags": [
"settings"
]
}
},
- "/api/settings/theme": {
- "put": {
- "operationId": "update_theme_api_settings_theme_put",
+ "/api/settings/tests/{service}/{run_id}/cancel": {
+ "post": {
+ "operationId": "cancel_service_test_api_settings_tests__service___run_id__cancel_post",
"parameters": [
+ {
+ "in": "path",
+ "name": "service",
+ "required": true,
+ "schema": {
+ "title": "Service",
+ "type": "string"
+ }
+ },
+ {
+ "in": "path",
+ "name": "run_id",
+ "required": true,
+ "schema": {
+ "title": "Run Id",
+ "type": "string"
+ }
+ },
{
"in": "header",
"name": "Authorization",
@@ -44841,16 +45286,6 @@
}
}
],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ThemeUpdate"
- }
- }
- },
- "required": true
- },
"responses": {
"200": {
"content": {
@@ -44871,16 +45306,34 @@
"description": "Validation Error"
}
},
- "summary": "Update Theme",
+ "summary": "Cancel Service Test",
"tags": [
"settings"
]
}
},
- "/api/settings/themes": {
+ "/api/settings/tests/{service}/{run_id}/events": {
"get": {
- "operationId": "get_themes_api_settings_themes_get",
+ "operationId": "stream_service_test_events_api_settings_tests__service___run_id__events_get",
"parameters": [
+ {
+ "in": "path",
+ "name": "service",
+ "required": true,
+ "schema": {
+ "title": "Service",
+ "type": "string"
+ }
+ },
+ {
+ "in": "path",
+ "name": "run_id",
+ "required": true,
+ "schema": {
+ "title": "Run Id",
+ "type": "string"
+ }
+ },
{
"in": "header",
"name": "Authorization",
@@ -44934,15 +45387,15 @@
"description": "Validation Error"
}
},
- "summary": "Get Themes",
+ "summary": "Stream Service Test Events",
"tags": [
"settings"
]
}
},
- "/api/settings/tour/complete": {
- "post": {
- "operationId": "complete_tour_api_settings_tour_complete_post",
+ "/api/settings/theme": {
+ "put": {
+ "operationId": "update_theme_api_settings_theme_put",
"parameters": [
{
"in": "header",
@@ -44981,18 +45434,11 @@
"content": {
"application/json": {
"schema": {
- "anyOf": [
- {
- "$ref": "#/components/schemas/TourCompletePayload"
- },
- {
- "type": "null"
- }
- ],
- "title": "Payload"
+ "$ref": "#/components/schemas/ThemeUpdate"
}
}
- }
+ },
+ "required": true
},
"responses": {
"200": {
@@ -45014,15 +45460,15 @@
"description": "Validation Error"
}
},
- "summary": "Complete Tour",
+ "summary": "Update Theme",
"tags": [
"settings"
]
}
},
- "/api/settings/tour/reopen": {
- "post": {
- "operationId": "reopen_tour_api_settings_tour_reopen_post",
+ "/api/settings/themes": {
+ "get": {
+ "operationId": "get_themes_api_settings_themes_get",
"parameters": [
{
"in": "header",
@@ -45077,15 +45523,15 @@
"description": "Validation Error"
}
},
- "summary": "Reopen Tour",
+ "summary": "Get Themes",
"tags": [
"settings"
]
}
},
- "/api/settings/tour/status": {
- "get": {
- "operationId": "tour_status_api_settings_tour_status_get",
+ "/api/settings/tour/complete": {
+ "post": {
+ "operationId": "complete_tour_api_settings_tour_complete_post",
"parameters": [
{
"in": "header",
@@ -45120,6 +45566,23 @@
}
}
],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "anyOf": [
+ {
+ "$ref": "#/components/schemas/TourCompletePayload"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Payload"
+ }
+ }
+ }
+ },
"responses": {
"200": {
"content": {
@@ -45140,34 +45603,15 @@
"description": "Validation Error"
}
},
- "summary": "Tour Status",
+ "summary": "Complete Tour",
"tags": [
"settings"
]
}
},
- "/api/settings/ui": {
- "get": {
- "description": "Return the pre-session UI preferences: theme and the two languages.\n\nPublic by design, which is why it is a narrow projection rather than the\nsaved ``ui`` blob. The app shell — and the statically prerendered auth\npages, which have no session at all — adopt the persisted languages here\nduring bootstrap. Theme rides along so those pages can paint in the right\none instead of flashing.\n\nEverything else under ``ui`` (sidebar_nav_order, enabled_optional_tools,\nchat_response_timeout, …) describes what the deployment has turned on, so\nit stays behind auth: read it from the ``ui`` key of GET /settings.",
- "operationId": "get_ui_settings_api_settings_ui_get",
- "responses": {
- "200": {
- "content": {
- "application/json": {
- "schema": {}
- }
- },
- "description": "Successful Response"
- }
- },
- "summary": "Get Ui Settings",
- "tags": [
- "settings"
- ]
- },
- "put": {
- "description": "Merge frontend partial update into current UI settings.\n\nUses exclude_unset=True semantics so that only fields explicitly provided\nby the frontend override saved values. Fields not in the frontend payload\n(even if they equal the model defaults) are omitted from the merge.",
- "operationId": "update_ui_settings_api_settings_ui_put",
+ "/api/settings/tour/reopen": {
+ "post": {
+ "operationId": "reopen_tour_api_settings_tour_reopen_post",
"parameters": [
{
"in": "header",
@@ -45202,16 +45646,6 @@
}
}
],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/UISettingsUpdate"
- }
- }
- },
- "required": true
- },
"responses": {
"200": {
"content": {
@@ -45232,15 +45666,15 @@
"description": "Validation Error"
}
},
- "summary": "Update Ui Settings",
+ "summary": "Reopen Tour",
"tags": [
"settings"
]
}
},
- "/api/settings/video-learning": {
+ "/api/settings/tour/status": {
"get": {
- "operationId": "get_video_learning_settings_api_settings_video_learning_get",
+ "operationId": "tour_status_api_settings_tour_status_get",
"parameters": [
{
"in": "header",
@@ -45279,11 +45713,7 @@
"200": {
"content": {
"application/json": {
- "schema": {
- "additionalProperties": true,
- "title": "Response Get Video Learning Settings Api Settings Video Learning Get",
- "type": "object"
- }
+ "schema": {}
}
},
"description": "Successful Response"
@@ -45299,13 +45729,34 @@
"description": "Validation Error"
}
},
- "summary": "Get Video Learning Settings",
+ "summary": "Tour Status",
"tags": [
- "video-learning-settings"
+ "settings"
+ ]
+ }
+ },
+ "/api/settings/ui": {
+ "get": {
+ "description": "Return the pre-session UI preferences: theme and the two languages.\n\nPublic by design, which is why it is a narrow projection rather than the\nsaved ``ui`` blob. The app shell — and the statically prerendered auth\npages, which have no session at all — adopt the persisted languages here\nduring bootstrap. Theme rides along so those pages can paint in the right\none instead of flashing.\n\nEverything else under ``ui`` (sidebar_nav_order, enabled_optional_tools,\nchat_response_timeout, …) describes what the deployment has turned on, so\nit stays behind auth: read it from the ``ui`` key of GET /settings.",
+ "operationId": "get_ui_settings_api_settings_ui_get",
+ "responses": {
+ "200": {
+ "content": {
+ "application/json": {
+ "schema": {}
+ }
+ },
+ "description": "Successful Response"
+ }
+ },
+ "summary": "Get Ui Settings",
+ "tags": [
+ "settings"
]
},
"put": {
- "operationId": "update_video_learning_settings_api_settings_video_learning_put",
+ "description": "Merge frontend partial update into current UI settings.\n\nUses exclude_unset=True semantics so that only fields explicitly provided\nby the frontend override saved values. Fields not in the frontend payload\n(even if they equal the model defaults) are omitted from the merge.",
+ "operationId": "update_ui_settings_api_settings_ui_put",
"parameters": [
{
"in": "header",
@@ -45344,7 +45795,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/VideoLearningSettingsRequest"
+ "$ref": "#/components/schemas/UISettingsUpdate"
}
}
},
@@ -45354,11 +45805,7 @@
"200": {
"content": {
"application/json": {
- "schema": {
- "additionalProperties": true,
- "title": "Response Update Video Learning Settings Api Settings Video Learning Put",
- "type": "object"
- }
+ "schema": {}
}
},
"description": "Successful Response"
@@ -45374,15 +45821,15 @@
"description": "Validation Error"
}
},
- "summary": "Update Video Learning Settings",
+ "summary": "Update Ui Settings",
"tags": [
- "video-learning-settings"
+ "settings"
]
}
},
- "/api/settings/video-learning/test-invidious": {
- "post": {
- "operationId": "test_invidious_api_settings_video_learning_test_invidious_post",
+ "/api/settings/video-learning": {
+ "get": {
+ "operationId": "get_video_learning_settings_api_settings_video_learning_get",
"parameters": [
{
"in": "header",
@@ -45417,23 +45864,13 @@
}
}
],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/VideoLearningSettingsRequest"
- }
- }
- },
- "required": true
- },
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"additionalProperties": true,
- "title": "Response Test Invidious Api Settings Video Learning Test Invidious Post",
+ "title": "Response Get Video Learning Settings Api Settings Video Learning Get",
"type": "object"
}
}
@@ -45451,16 +45888,13 @@
"description": "Validation Error"
}
},
- "summary": "Test Invidious",
+ "summary": "Get Video Learning Settings",
"tags": [
"video-learning-settings"
]
- }
- },
- "/api/settings/voice-autoplay": {
+ },
"put": {
- "description": "Persist the global default for auto-playing chat replies via TTS.\n\nA personal UI preference (any authenticated user); the chat surface layers\na per-session override on top of this value.",
- "operationId": "update_voice_autoplay_api_settings_voice_autoplay_put",
+ "operationId": "update_video_learning_settings_api_settings_video_learning_put",
"parameters": [
{
"in": "header",
@@ -45499,7 +45933,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/VoiceAutoplayUpdate"
+ "$ref": "#/components/schemas/VideoLearningSettingsRequest"
}
}
},
@@ -45509,7 +45943,11 @@
"200": {
"content": {
"application/json": {
- "schema": {}
+ "schema": {
+ "additionalProperties": true,
+ "title": "Response Update Video Learning Settings Api Settings Video Learning Put",
+ "type": "object"
+ }
}
},
"description": "Successful Response"
@@ -45525,15 +45963,15 @@
"description": "Validation Error"
}
},
- "summary": "Update Voice Autoplay",
+ "summary": "Update Video Learning Settings",
"tags": [
- "settings"
+ "video-learning-settings"
]
}
},
- "/api/settings/workspace": {
- "get": {
- "operationId": "get_workspace_settings_api_settings_workspace_get",
+ "/api/settings/video-learning/test-invidious": {
+ "post": {
+ "operationId": "test_invidious_api_settings_video_learning_test_invidious_post",
"parameters": [
{
"in": "header",
@@ -45568,13 +46006,23 @@
}
}
],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/VideoLearningSettingsRequest"
+ }
+ }
+ },
+ "required": true
+ },
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"additionalProperties": true,
- "title": "Response Get Workspace Settings Api Settings Workspace Get",
+ "title": "Response Test Invidious Api Settings Video Learning Test Invidious Post",
"type": "object"
}
}
@@ -45592,13 +46040,16 @@
"description": "Validation Error"
}
},
- "summary": "Get Workspace Settings",
+ "summary": "Test Invidious",
"tags": [
- "workspace-settings"
+ "video-learning-settings"
]
- },
+ }
+ },
+ "/api/settings/voice-autoplay": {
"put": {
- "operationId": "update_workspace_api_settings_workspace_put",
+ "description": "Persist the global default for auto-playing chat replies via TTS.\n\nA personal UI preference (any authenticated user); the chat surface layers\na per-session override on top of this value.",
+ "operationId": "update_voice_autoplay_api_settings_voice_autoplay_put",
"parameters": [
{
"in": "header",
@@ -45637,7 +46088,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/WorkspacePathPayload"
+ "$ref": "#/components/schemas/VoiceAutoplayUpdate"
}
}
},
@@ -45647,11 +46098,7 @@
"200": {
"content": {
"application/json": {
- "schema": {
- "additionalProperties": true,
- "title": "Response Update Workspace Api Settings Workspace Put",
- "type": "object"
- }
+ "schema": {}
}
},
"description": "Successful Response"
@@ -45667,15 +46114,15 @@
"description": "Validation Error"
}
},
- "summary": "Update Workspace",
+ "summary": "Update Voice Autoplay",
"tags": [
- "workspace-settings"
+ "settings"
]
}
},
- "/api/settings/workspace/validate": {
- "post": {
- "operationId": "validate_workspace_api_settings_workspace_validate_post",
+ "/api/settings/workspace": {
+ "get": {
+ "operationId": "get_workspace_settings_api_settings_workspace_get",
"parameters": [
{
"in": "header",
@@ -45710,23 +46157,13 @@
}
}
],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/WorkspacePathPayload"
- }
- }
- },
- "required": true
- },
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"additionalProperties": true,
- "title": "Response Validate Workspace Api Settings Workspace Validate Post",
+ "title": "Response Get Workspace Settings Api Settings Workspace Get",
"type": "object"
}
}
@@ -45744,15 +46181,13 @@
"description": "Validation Error"
}
},
- "summary": "Validate Workspace",
+ "summary": "Get Workspace Settings",
"tags": [
"workspace-settings"
]
- }
- },
- "/api/skills/create": {
- "post": {
- "operationId": "create_skill_api_skills_create_post",
+ },
+ "put": {
+ "operationId": "update_workspace_api_settings_workspace_put",
"parameters": [
{
"in": "header",
@@ -45791,7 +46226,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/CreateSkillRequest"
+ "$ref": "#/components/schemas/WorkspacePathPayload"
}
}
},
@@ -45803,7 +46238,7 @@
"application/json": {
"schema": {
"additionalProperties": true,
- "title": "Response Create Skill Api Skills Create Post",
+ "title": "Response Update Workspace Api Settings Workspace Put",
"type": "object"
}
}
@@ -45821,47 +46256,16 @@
"description": "Validation Error"
}
},
- "summary": "Create Skill",
+ "summary": "Update Workspace",
"tags": [
- "skills"
+ "workspace-settings"
]
}
},
- "/api/skills/hub/catalog": {
- "get": {
- "description": "Proxy a skill hub's public catalog for the in-app browser.\n\nThe web \"Import from EduHub\" panel renders these rows in DeepTutor's own\nUI — no embedded iframe, no login — so users can browse, search, and\none-click download skills. Returns ``web_url`` (the hub's site origin) so\nthe panel can offer a \"view on EduHub\" link out.",
- "operationId": "hub_catalog_api_skills_hub_catalog_get",
+ "/api/settings/workspace/validate": {
+ "post": {
+ "operationId": "validate_workspace_api_settings_workspace_validate_post",
"parameters": [
- {
- "in": "query",
- "name": "hub",
- "required": false,
- "schema": {
- "default": "eduhub",
- "title": "Hub",
- "type": "string"
- }
- },
- {
- "in": "query",
- "name": "q",
- "required": false,
- "schema": {
- "default": "",
- "title": "Q",
- "type": "string"
- }
- },
- {
- "in": "query",
- "name": "limit",
- "required": false,
- "schema": {
- "default": 50,
- "title": "Limit",
- "type": "integer"
- }
- },
{
"in": "header",
"name": "Authorization",
@@ -45895,13 +46299,23 @@
}
}
],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/WorkspacePathPayload"
+ }
+ }
+ },
+ "required": true
+ },
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"additionalProperties": true,
- "title": "Response Hub Catalog Api Skills Hub Catalog Get",
+ "title": "Response Validate Workspace Api Settings Workspace Validate Post",
"type": "object"
}
}
@@ -45919,36 +46333,16 @@
"description": "Validation Error"
}
},
- "summary": "Hub Catalog",
+ "summary": "Validate Workspace",
"tags": [
- "skills"
+ "workspace-settings"
]
}
},
- "/api/skills/hub/detail": {
- "get": {
- "description": "Full metadata + SKILL.md body for one hub skill (browser detail view).",
- "operationId": "hub_detail_api_skills_hub_detail_get",
+ "/api/skills/create": {
+ "post": {
+ "operationId": "create_skill_api_skills_create_post",
"parameters": [
- {
- "in": "query",
- "name": "slug",
- "required": true,
- "schema": {
- "title": "Slug",
- "type": "string"
- }
- },
- {
- "in": "query",
- "name": "hub",
- "required": false,
- "schema": {
- "default": "eduhub",
- "title": "Hub",
- "type": "string"
- }
- },
{
"in": "header",
"name": "Authorization",
@@ -45982,13 +46376,23 @@
}
}
],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/CreateSkillRequest"
+ }
+ }
+ },
+ "required": true
+ },
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"additionalProperties": true,
- "title": "Response Hub Detail Api Skills Hub Detail Get",
+ "title": "Response Create Skill Api Skills Create Post",
"type": "object"
}
}
@@ -46006,17 +46410,47 @@
"description": "Validation Error"
}
},
- "summary": "Hub Detail",
+ "summary": "Create Skill",
"tags": [
"skills"
]
}
},
- "/api/skills/install": {
- "post": {
- "description": "Import a hub skill (e.g. from EduHub) into the caller's own skill layer.\n\nLands the package in the same per-user dir that ``/create`` writes to, so\nthe imported skill shows up in this user's Skills list. The install gate\n(``suspicious`` verdict abort, safe extraction, ``always`` stripping)\nlives in :func:`deeptutor.services.skill.hub.install_from_hub`.",
- "operationId": "install_skill_api_skills_install_post",
+ "/api/skills/hub/catalog": {
+ "get": {
+ "description": "Proxy a skill hub's public catalog for the in-app browser.\n\nThe web \"Import from EduHub\" panel renders these rows in DeepTutor's own\nUI — no embedded iframe, no login — so users can browse, search, and\none-click download skills. Returns ``web_url`` (the hub's site origin) so\nthe panel can offer a \"view on EduHub\" link out.",
+ "operationId": "hub_catalog_api_skills_hub_catalog_get",
"parameters": [
+ {
+ "in": "query",
+ "name": "hub",
+ "required": false,
+ "schema": {
+ "default": "eduhub",
+ "title": "Hub",
+ "type": "string"
+ }
+ },
+ {
+ "in": "query",
+ "name": "q",
+ "required": false,
+ "schema": {
+ "default": "",
+ "title": "Q",
+ "type": "string"
+ }
+ },
+ {
+ "in": "query",
+ "name": "limit",
+ "required": false,
+ "schema": {
+ "default": 50,
+ "title": "Limit",
+ "type": "integer"
+ }
+ },
{
"in": "header",
"name": "Authorization",
@@ -46050,23 +46484,13 @@
}
}
],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/InstallSkillRequest"
- }
- }
- },
- "required": true
- },
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"additionalProperties": true,
- "title": "Response Install Skill Api Skills Install Post",
+ "title": "Response Hub Catalog Api Skills Hub Catalog Get",
"type": "object"
}
}
@@ -46084,16 +46508,36 @@
"description": "Validation Error"
}
},
- "summary": "Install Skill",
+ "summary": "Hub Catalog",
"tags": [
"skills"
]
}
},
- "/api/skills/list": {
+ "/api/skills/hub/detail": {
"get": {
- "operationId": "list_skills_api_skills_list_get",
+ "description": "Full metadata + SKILL.md body for one hub skill (browser detail view).",
+ "operationId": "hub_detail_api_skills_hub_detail_get",
"parameters": [
+ {
+ "in": "query",
+ "name": "slug",
+ "required": true,
+ "schema": {
+ "title": "Slug",
+ "type": "string"
+ }
+ },
+ {
+ "in": "query",
+ "name": "hub",
+ "required": false,
+ "schema": {
+ "default": "eduhub",
+ "title": "Hub",
+ "type": "string"
+ }
+ },
{
"in": "header",
"name": "Authorization",
@@ -46132,14 +46576,8 @@
"content": {
"application/json": {
"schema": {
- "additionalProperties": {
- "items": {
- "additionalProperties": true,
- "type": "object"
- },
- "type": "array"
- },
- "title": "Response List Skills Api Skills List Get",
+ "additionalProperties": true,
+ "title": "Response Hub Detail Api Skills Hub Detail Get",
"type": "object"
}
}
@@ -46157,15 +46595,166 @@
"description": "Validation Error"
}
},
- "summary": "List Skills",
+ "summary": "Hub Detail",
"tags": [
"skills"
]
}
},
- "/api/skills/tags/create": {
+ "/api/skills/install": {
"post": {
- "operationId": "create_tag_api_skills_tags_create_post",
+ "description": "Import a hub skill (e.g. from EduHub) into the caller's own skill layer.\n\nLands the package in the same per-user dir that ``/create`` writes to, so\nthe imported skill shows up in this user's Skills list. The install gate\n(``suspicious`` verdict abort, safe extraction, ``always`` stripping)\nlives in :func:`deeptutor.services.skill.hub.install_from_hub`.",
+ "operationId": "install_skill_api_skills_install_post",
+ "parameters": [
+ {
+ "in": "header",
+ "name": "Authorization",
+ "required": false,
+ "schema": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Authorization"
+ }
+ },
+ {
+ "in": "cookie",
+ "name": "dt_token",
+ "required": false,
+ "schema": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Dt Token"
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/InstallSkillRequest"
+ }
+ }
+ },
+ "required": true
+ },
+ "responses": {
+ "200": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "additionalProperties": true,
+ "title": "Response Install Skill Api Skills Install Post",
+ "type": "object"
+ }
+ }
+ },
+ "description": "Successful Response"
+ },
+ "422": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
+ }
+ },
+ "description": "Validation Error"
+ }
+ },
+ "summary": "Install Skill",
+ "tags": [
+ "skills"
+ ]
+ }
+ },
+ "/api/skills/list": {
+ "get": {
+ "operationId": "list_skills_api_skills_list_get",
+ "parameters": [
+ {
+ "in": "header",
+ "name": "Authorization",
+ "required": false,
+ "schema": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Authorization"
+ }
+ },
+ {
+ "in": "cookie",
+ "name": "dt_token",
+ "required": false,
+ "schema": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Dt Token"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "additionalProperties": {
+ "items": {
+ "additionalProperties": true,
+ "type": "object"
+ },
+ "type": "array"
+ },
+ "title": "Response List Skills Api Skills List Get",
+ "type": "object"
+ }
+ }
+ },
+ "description": "Successful Response"
+ },
+ "422": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
+ }
+ },
+ "description": "Validation Error"
+ }
+ },
+ "summary": "List Skills",
+ "tags": [
+ "skills"
+ ]
+ }
+ },
+ "/api/skills/tags/create": {
+ "post": {
+ "operationId": "create_tag_api_skills_tags_create_post",
"parameters": [
{
"in": "header",
@@ -47492,7 +48081,331 @@
"application/json": {
"schema": {
"additionalProperties": true,
- "title": "Response List Servers Api Space Mcp Servers Get",
+ "title": "Response List Servers Api Space Mcp Servers Get",
+ "type": "object"
+ }
+ }
+ },
+ "description": "Successful Response"
+ },
+ "422": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
+ }
+ },
+ "description": "Validation Error"
+ }
+ },
+ "summary": "List Servers",
+ "tags": [
+ "space-mcp"
+ ]
+ }
+ },
+ "/api/space/mcp/servers/{name}": {
+ "delete": {
+ "operationId": "remove_server_api_space_mcp_servers__name__delete",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "name",
+ "required": true,
+ "schema": {
+ "title": "Name",
+ "type": "string"
+ }
+ },
+ {
+ "in": "header",
+ "name": "Authorization",
+ "required": false,
+ "schema": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Authorization"
+ }
+ },
+ {
+ "in": "cookie",
+ "name": "dt_token",
+ "required": false,
+ "schema": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Dt Token"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "additionalProperties": true,
+ "title": "Response Remove Server Api Space Mcp Servers Name Delete",
+ "type": "object"
+ }
+ }
+ },
+ "description": "Successful Response"
+ },
+ "422": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
+ }
+ },
+ "description": "Validation Error"
+ }
+ },
+ "summary": "Remove Server",
+ "tags": [
+ "space-mcp"
+ ]
+ },
+ "put": {
+ "operationId": "upsert_server_api_space_mcp_servers__name__put",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "name",
+ "required": true,
+ "schema": {
+ "title": "Name",
+ "type": "string"
+ }
+ },
+ {
+ "in": "header",
+ "name": "Authorization",
+ "required": false,
+ "schema": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Authorization"
+ }
+ },
+ {
+ "in": "cookie",
+ "name": "dt_token",
+ "required": false,
+ "schema": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Dt Token"
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ServerPayload"
+ }
+ }
+ },
+ "required": true
+ },
+ "responses": {
+ "200": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "additionalProperties": true,
+ "title": "Response Upsert Server Api Space Mcp Servers Name Put",
+ "type": "object"
+ }
+ }
+ },
+ "description": "Successful Response"
+ },
+ "422": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
+ }
+ },
+ "description": "Validation Error"
+ }
+ },
+ "summary": "Upsert Server",
+ "tags": [
+ "space-mcp"
+ ]
+ }
+ },
+ "/api/space/mcp/servers/{name}/authorize": {
+ "post": {
+ "description": "Begin an OAuth consent for one of the caller's servers.\n\nReturns the URL to send the person to. This is the **only** place a flow may\nstart: a background reconnect has nobody in front of it, so it reports\n``needs_auth`` and waits for someone to click.",
+ "operationId": "authorize_server_api_space_mcp_servers__name__authorize_post",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "name",
+ "required": true,
+ "schema": {
+ "title": "Name",
+ "type": "string"
+ }
+ },
+ {
+ "in": "header",
+ "name": "Authorization",
+ "required": false,
+ "schema": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Authorization"
+ }
+ },
+ {
+ "in": "cookie",
+ "name": "dt_token",
+ "required": false,
+ "schema": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Dt Token"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "additionalProperties": true,
+ "title": "Response Authorize Server Api Space Mcp Servers Name Authorize Post",
+ "type": "object"
+ }
+ }
+ },
+ "description": "Successful Response"
+ },
+ "422": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
+ }
+ },
+ "description": "Validation Error"
+ }
+ },
+ "summary": "Authorize Server",
+ "tags": [
+ "space-mcp"
+ ]
+ }
+ },
+ "/api/space/mcp/servers/{name}/test": {
+ "post": {
+ "description": "Probe a definition before saving it.\n\nRuns under the caller's own owner id so the probe obeys the same address\npolicy and redirect rule the real connection will — a Test more permissive\nthan the connection it previews is worse than no Test at all.\n\nDeliberately side-effect free: nothing is written, so the incoming config is\nprobed as given (any literal credential in it is used in memory only). That\nalso means a caller may probe under a scratch name the store would refuse,\nwhich is how the UI tests a draft before it has one.",
+ "operationId": "test_server_api_space_mcp_servers__name__test_post",
+ "parameters": [
+ {
+ "in": "path",
+ "name": "name",
+ "required": true,
+ "schema": {
+ "title": "Name",
+ "type": "string"
+ }
+ },
+ {
+ "in": "header",
+ "name": "Authorization",
+ "required": false,
+ "schema": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Authorization"
+ }
+ },
+ {
+ "in": "cookie",
+ "name": "dt_token",
+ "required": false,
+ "schema": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Dt Token"
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ServerPayload"
+ }
+ }
+ },
+ "required": true
+ },
+ "responses": {
+ "200": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "additionalProperties": true,
+ "title": "Response Test Server Api Space Mcp Servers Name Test Post",
"type": "object"
}
}
@@ -47510,22 +48423,87 @@
"description": "Validation Error"
}
},
- "summary": "List Servers",
+ "summary": "Test Server",
"tags": [
"space-mcp"
]
}
},
- "/api/space/mcp/servers/{name}": {
- "delete": {
- "operationId": "remove_server_api_space_mcp_servers__name__delete",
+ "/api/subagents/backends/options": {
+ "get": {
+ "description": "Synced model + reasoning-effort options per backend (settings page sync).",
+ "operationId": "backend_options_api_subagents_backends_options_get",
+ "parameters": [
+ {
+ "in": "header",
+ "name": "Authorization",
+ "required": false,
+ "schema": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Authorization"
+ }
+ },
+ {
+ "in": "cookie",
+ "name": "dt_token",
+ "required": false,
+ "schema": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Dt Token"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "content": {
+ "application/json": {
+ "schema": {}
+ }
+ },
+ "description": "Successful Response"
+ },
+ "422": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
+ }
+ },
+ "description": "Validation Error"
+ }
+ },
+ "summary": "Backend Options",
+ "tags": [
+ "subagents"
+ ]
+ }
+ },
+ "/api/subagents/backends/{kind}/sync": {
+ "post": {
+ "description": "Re-pull one backend's model catalog (the settings \"sync\" button).\n\nFor Claude Code this scrapes its ``/model`` TUI live and caches the result;\nfor Codex it re-reads the CLI-maintained cache.",
+ "operationId": "sync_backend_api_subagents_backends__kind__sync_post",
"parameters": [
{
"in": "path",
- "name": "name",
+ "name": "kind",
"required": true,
"schema": {
- "title": "Name",
+ "title": "Kind",
"type": "string"
}
},
@@ -47566,11 +48544,7 @@
"200": {
"content": {
"application/json": {
- "schema": {
- "additionalProperties": true,
- "title": "Response Remove Server Api Space Mcp Servers Name Delete",
- "type": "object"
- }
+ "schema": {}
}
},
"description": "Successful Response"
@@ -47586,23 +48560,79 @@
"description": "Validation Error"
}
},
- "summary": "Remove Server",
+ "summary": "Sync Backend",
"tags": [
- "space-mcp"
+ "subagents"
]
- },
- "put": {
- "operationId": "upsert_server_api_space_mcp_servers__name__put",
+ }
+ },
+ "/api/subagents/connections": {
+ "get": {
+ "description": "List the current user's connected subagents.",
+ "operationId": "list_connections_api_subagents_connections_get",
"parameters": [
{
- "in": "path",
- "name": "name",
- "required": true,
+ "in": "header",
+ "name": "Authorization",
+ "required": false,
"schema": {
- "title": "Name",
- "type": "string"
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Authorization"
+ }
+ },
+ {
+ "in": "cookie",
+ "name": "dt_token",
+ "required": false,
+ "schema": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Dt Token"
}
+ }
+ ],
+ "responses": {
+ "200": {
+ "content": {
+ "application/json": {
+ "schema": {}
+ }
+ },
+ "description": "Successful Response"
},
+ "422": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
+ }
+ },
+ "description": "Validation Error"
+ }
+ },
+ "summary": "List Connections",
+ "tags": [
+ "subagents"
+ ]
+ },
+ "post": {
+ "description": "Connect a local, remote, or Partner subagent as a selectable KB.\n\nA partner connection (``agent_kind == \"partner\"``) binds a ``partner_id``\ninstead of a working directory: consulting it opens a fresh session on that\npartner, exactly as if the user started one from the partner page. Every\nconsult within one DeepTutor chat lands in that one partner session.",
+ "operationId": "create_connection_api_subagents_connections_post",
+ "parameters": [
{
"in": "header",
"name": "Authorization",
@@ -47640,7 +48670,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/ServerPayload"
+ "$ref": "#/components/schemas/ConnectSubagentRequest"
}
}
},
@@ -47650,11 +48680,7 @@
"200": {
"content": {
"application/json": {
- "schema": {
- "additionalProperties": true,
- "title": "Response Upsert Server Api Space Mcp Servers Name Put",
- "type": "object"
- }
+ "schema": {}
}
},
"description": "Successful Response"
@@ -47670,16 +48696,16 @@
"description": "Validation Error"
}
},
- "summary": "Upsert Server",
+ "summary": "Create Connection",
"tags": [
- "space-mcp"
+ "subagents"
]
}
},
- "/api/space/mcp/servers/{name}/authorize": {
- "post": {
- "description": "Begin an OAuth consent for one of the caller's servers.\n\nReturns the URL to send the person to. This is the **only** place a flow may\nstart: a background reconnect has nobody in front of it, so it reports\n``needs_auth`` and waits for someone to click.",
- "operationId": "authorize_server_api_space_mcp_servers__name__authorize_post",
+ "/api/subagents/connections/{name}": {
+ "delete": {
+ "description": "Disconnect a subagent (removes the pointer KB; touches no files).",
+ "operationId": "delete_connection_api_subagents_connections__name__delete",
"parameters": [
{
"in": "path",
@@ -47727,11 +48753,7 @@
"200": {
"content": {
"application/json": {
- "schema": {
- "additionalProperties": true,
- "title": "Response Authorize Server Api Space Mcp Servers Name Authorize Post",
- "type": "object"
- }
+ "schema": {}
}
},
"description": "Successful Response"
@@ -47747,16 +48769,16 @@
"description": "Validation Error"
}
},
- "summary": "Authorize Server",
+ "summary": "Delete Connection",
"tags": [
- "space-mcp"
+ "subagents"
]
}
},
- "/api/space/mcp/servers/{name}/test": {
+ "/api/subagents/connections/{name}/message": {
"post": {
- "description": "Probe a definition before saving it.\n\nRuns under the caller's own owner id so the probe obeys the same address\npolicy and redirect rule the real connection will — a Test more permissive\nthan the connection it previews is worse than no Test at all.\n\nDeliberately side-effect free: nothing is written, so the incoming config is\nprobed as given (any literal credential in it is used in memory only). That\nalso means a caller may probe under a scratch name the store would refuse,\nwhich is how the UI tests a draft before it has one.",
- "operationId": "test_server_api_space_mcp_servers__name__test_post",
+ "description": "Send a message straight to a connected subagent and stream its run.\n\nThis is the sidebar's \"talk to the agent directly\" path: it resumes the same\nlive session DeepTutor consults (shared via the cross-turn registry, keyed by\nchat session + connection), so the agent keeps full context. Streams the\nnative run as newline-delimited JSON, in the same channel shape the chat WS\nuses, so the sidebar transcript renders it identically.",
+ "operationId": "message_connection_api_subagents_connections__name__message_post",
"parameters": [
{
"in": "path",
@@ -47804,7 +48826,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/ServerPayload"
+ "$ref": "#/components/schemas/SubagentMessageRequest"
}
}
},
@@ -47814,11 +48836,7 @@
"200": {
"content": {
"application/json": {
- "schema": {
- "additionalProperties": true,
- "title": "Response Test Server Api Space Mcp Servers Name Test Post",
- "type": "object"
- }
+ "schema": {}
}
},
"description": "Successful Response"
@@ -47834,16 +48852,16 @@
"description": "Validation Error"
}
},
- "summary": "Test Server",
+ "summary": "Message Connection",
"tags": [
- "space-mcp"
+ "subagents"
]
}
},
- "/api/subagents/backends/options": {
+ "/api/subagents/detect": {
"get": {
- "description": "Synced model + reasoning-effort options per backend (settings page sync).",
- "operationId": "backend_options_api_subagents_backends_options_get",
+ "description": "Report which local and remote agent backends are usable.",
+ "operationId": "detect_subagents_api_subagents_detect_get",
"parameters": [
{
"in": "header",
@@ -47898,26 +48916,17 @@
"description": "Validation Error"
}
},
- "summary": "Backend Options",
+ "summary": "Detect Subagents",
"tags": [
"subagents"
]
}
},
- "/api/subagents/backends/{kind}/sync": {
- "post": {
- "description": "Re-pull one backend's model catalog (the settings \"sync\" button).\n\nFor Claude Code this scrapes its ``/model`` TUI live and caches the result;\nfor Codex it re-reads the CLI-maintained cache.",
- "operationId": "sync_backend_api_subagents_backends__kind__sync_post",
+ "/api/subagents/partners": {
+ "get": {
+ "description": "Partners the current user can connect & consult.\n\nReturns every partner for an admin, or just the ones an admin has assigned\nfor a non-admin. The partner CRUD API (``/api/partners``) stays fully\nadmin-gated; this is the read surface the connect flow and the partner list\npage use, so a non-admin sees their assigned partners without a 403.",
+ "operationId": "list_visible_partners_api_subagents_partners_get",
"parameters": [
- {
- "in": "path",
- "name": "kind",
- "required": true,
- "schema": {
- "title": "Kind",
- "type": "string"
- }
- },
{
"in": "header",
"name": "Authorization",
@@ -47971,16 +48980,16 @@
"description": "Validation Error"
}
},
- "summary": "Sync Backend",
+ "summary": "List Visible Partners",
"tags": [
"subagents"
]
}
},
- "/api/subagents/connections": {
+ "/api/subagents/settings": {
"get": {
- "description": "List the current user's connected subagents.",
- "operationId": "list_connections_api_subagents_connections_get",
+ "description": "Read the consult budget and per-backend run config.",
+ "operationId": "get_settings_api_subagents_settings_get",
"parameters": [
{
"in": "header",
@@ -48035,14 +49044,14 @@
"description": "Validation Error"
}
},
- "summary": "List Connections",
+ "summary": "Get Settings",
"tags": [
"subagents"
]
},
- "post": {
- "description": "Connect a local, remote, or Partner subagent as a selectable KB.\n\nA partner connection (``agent_kind == \"partner\"``) binds a ``partner_id``\ninstead of a working directory: consulting it opens a fresh session on that\npartner, exactly as if the user started one from the partner page. Every\nconsult within one DeepTutor chat lands in that one partner session.",
- "operationId": "create_connection_api_subagents_connections_post",
+ "put": {
+ "description": "Update the subagent settings (admin-gated; deployment-wide).",
+ "operationId": "update_settings_api_subagents_settings_put",
"parameters": [
{
"in": "header",
@@ -48081,7 +49090,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/ConnectSubagentRequest"
+ "$ref": "#/components/schemas/SubagentSettingsPayload"
}
}
},
@@ -48107,26 +49116,17 @@
"description": "Validation Error"
}
},
- "summary": "Create Connection",
+ "summary": "Update Settings",
"tags": [
"subagents"
]
}
},
- "/api/subagents/connections/{name}": {
- "delete": {
- "description": "Disconnect a subagent (removes the pointer KB; touches no files).",
- "operationId": "delete_connection_api_subagents_connections__name__delete",
+ "/api/system/memory": {
+ "get": {
+ "description": "Resident memory of the running DeepTutor process tree.\n\nDeliberately separate from ``/status``: that snapshot resolves the LLM,\nembedding and search configs and is fetched once per settings mount, while\nthis one is cheap enough for the status strip to poll.\n\nAdmin-only, for the same reason ``/status`` strips model names from\nnon-admins — process composition and host memory are operational detail a\ntenant has no need for.",
+ "operationId": "get_memory_usage_api_system_memory_get",
"parameters": [
- {
- "in": "path",
- "name": "name",
- "required": true,
- "schema": {
- "title": "Name",
- "type": "string"
- }
- },
{
"in": "header",
"name": "Authorization",
@@ -48180,26 +49180,17 @@
"description": "Validation Error"
}
},
- "summary": "Delete Connection",
+ "summary": "Get Memory Usage",
"tags": [
- "subagents"
+ "system"
]
}
},
- "/api/subagents/connections/{name}/message": {
- "post": {
- "description": "Send a message straight to a connected subagent and stream its run.\n\nThis is the sidebar's \"talk to the agent directly\" path: it resumes the same\nlive session DeepTutor consults (shared via the cross-turn registry, keyed by\nchat session + connection), so the agent keeps full context. Streams the\nnative run as newline-delimited JSON, in the same channel shape the chat WS\nuses, so the sidebar transcript renders it identically.",
- "operationId": "message_connection_api_subagents_connections__name__message_post",
+ "/api/system/runtime": {
+ "get": {
+ "description": "Return credential-free coordination and worker diagnostics.",
+ "operationId": "get_runtime_status_api_system_runtime_get",
"parameters": [
- {
- "in": "path",
- "name": "name",
- "required": true,
- "schema": {
- "title": "Name",
- "type": "string"
- }
- },
{
"in": "header",
"name": "Authorization",
@@ -48233,21 +49224,13 @@
}
}
],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/SubagentMessageRequest"
- }
- }
- },
- "required": true
- },
"responses": {
"200": {
"content": {
"application/json": {
- "schema": {}
+ "schema": {
+ "$ref": "#/components/schemas/RuntimeStatus"
+ }
}
},
"description": "Successful Response"
@@ -48263,16 +49246,16 @@
"description": "Validation Error"
}
},
- "summary": "Message Connection",
+ "summary": "Get Runtime Status",
"tags": [
- "subagents"
+ "system"
]
}
},
- "/api/subagents/detect": {
+ "/api/system/status": {
"get": {
- "description": "Report which local and remote agent backends are usable.",
- "operationId": "detect_subagents_api_subagents_detect_get",
+ "description": "Get overall system status including backend and model configurations\n\nReturns:\n Dictionary containing status of backend, LLM, embeddings, and search",
+ "operationId": "get_system_status_api_system_status_get",
"parameters": [
{
"in": "header",
@@ -48327,16 +49310,16 @@
"description": "Validation Error"
}
},
- "summary": "Detect Subagents",
+ "summary": "Get System Status",
"tags": [
- "subagents"
+ "system"
]
}
},
- "/api/subagents/partners": {
- "get": {
- "description": "Partners the current user can connect & consult.\n\nReturns every partner for an admin, or just the ones an admin has assigned\nfor a non-admin. The partner CRUD API (``/api/partners``) stays fully\nadmin-gated; this is the read surface the connect flow and the partner list\npage use, so a non-admin sees their assigned partners without a 403.",
- "operationId": "list_visible_partners_api_subagents_partners_get",
+ "/api/system/test/embeddings": {
+ "post": {
+ "description": "Test Embeddings model connection by sending a simple embedding request\n\nReturns:\n Test result with success status and response time",
+ "operationId": "test_embeddings_connection_api_system_test_embeddings_post",
"parameters": [
{
"in": "header",
@@ -48375,7 +49358,9 @@
"200": {
"content": {
"application/json": {
- "schema": {}
+ "schema": {
+ "$ref": "#/components/schemas/TestResponse"
+ }
}
},
"description": "Successful Response"
@@ -48391,16 +49376,16 @@
"description": "Validation Error"
}
},
- "summary": "List Visible Partners",
+ "summary": "Test Embeddings Connection",
"tags": [
- "subagents"
+ "system"
]
}
},
- "/api/subagents/settings": {
- "get": {
- "description": "Read the consult budget and per-backend run config.",
- "operationId": "get_settings_api_subagents_settings_get",
+ "/api/system/test/llm": {
+ "post": {
+ "description": "Test LLM model connection by sending a simple completion request\n\nReturns:\n Test result with success status and response time",
+ "operationId": "test_llm_connection_api_system_test_llm_post",
"parameters": [
{
"in": "header",
@@ -48439,7 +49424,9 @@
"200": {
"content": {
"application/json": {
- "schema": {}
+ "schema": {
+ "$ref": "#/components/schemas/TestResponse"
+ }
}
},
"description": "Successful Response"
@@ -48455,14 +49442,15 @@
"description": "Validation Error"
}
},
- "summary": "Get Settings",
+ "summary": "Test Llm Connection",
"tags": [
- "subagents"
+ "system"
]
- },
- "put": {
- "description": "Update the subagent settings (admin-gated; deployment-wide).",
- "operationId": "update_settings_api_subagents_settings_put",
+ }
+ },
+ "/api/system/test/search": {
+ "post": {
+ "operationId": "test_search_connection_api_system_test_search_post",
"parameters": [
{
"in": "header",
@@ -48497,21 +49485,13 @@
}
}
],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/SubagentSettingsPayload"
- }
- }
- },
- "required": true
- },
"responses": {
"200": {
"content": {
"application/json": {
- "schema": {}
+ "schema": {
+ "$ref": "#/components/schemas/TestResponse"
+ }
}
},
"description": "Successful Response"
@@ -48527,16 +49507,16 @@
"description": "Validation Error"
}
},
- "summary": "Update Settings",
+ "summary": "Test Search Connection",
"tags": [
- "subagents"
+ "system"
]
}
},
- "/api/system/memory": {
+ "/api/system/update": {
"get": {
- "description": "Resident memory of the running DeepTutor process tree.\n\nDeliberately separate from ``/status``: that snapshot resolves the LLM,\nembedding and search configs and is fetched once per settings mount, while\nthis one is cheap enough for the status strip to poll.\n\nAdmin-only, for the same reason ``/status`` strips model names from\nnon-admins — process composition and host memory are operational detail a\ntenant has no need for.",
- "operationId": "get_memory_usage_api_system_memory_get",
+ "description": "Return About-page version state, checking at most once per 24 hours.",
+ "operationId": "get_update_status_api_system_update_get",
"parameters": [
{
"in": "header",
@@ -48575,7 +49555,11 @@
"200": {
"content": {
"application/json": {
- "schema": {}
+ "schema": {
+ "additionalProperties": true,
+ "title": "Response Get Update Status Api System Update Get",
+ "type": "object"
+ }
}
},
"description": "Successful Response"
@@ -48591,16 +49575,92 @@
"description": "Validation Error"
}
},
- "summary": "Get Memory Usage",
+ "summary": "Get Update Status",
+ "tags": [
+ "system"
+ ]
+ },
+ "post": {
+ "description": "Reserve one safe update for the supervising launcher to apply.",
+ "operationId": "request_managed_update_api_system_update_post",
+ "parameters": [
+ {
+ "in": "header",
+ "name": "Authorization",
+ "required": false,
+ "schema": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Authorization"
+ }
+ },
+ {
+ "in": "cookie",
+ "name": "dt_token",
+ "required": false,
+ "schema": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Dt Token"
+ }
+ }
+ ],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/ManagedUpdateRequest"
+ }
+ }
+ },
+ "required": true
+ },
+ "responses": {
+ "202": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "additionalProperties": true,
+ "title": "Response Request Managed Update Api System Update Post",
+ "type": "object"
+ }
+ }
+ },
+ "description": "Successful Response"
+ },
+ "422": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
+ }
+ },
+ "description": "Validation Error"
+ }
+ },
+ "summary": "Request Managed Update",
"tags": [
"system"
]
}
},
- "/api/system/runtime": {
- "get": {
- "description": "Return credential-free coordination and worker diagnostics.",
- "operationId": "get_runtime_status_api_system_runtime_get",
+ "/api/system/update/check": {
+ "post": {
+ "description": "Perform an explicit administrator-requested release check.",
+ "operationId": "check_for_update_api_system_update_check_post",
"parameters": [
{
"in": "header",
@@ -48640,7 +49700,9 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/RuntimeStatus"
+ "additionalProperties": true,
+ "title": "Response Check For Update Api System Update Check Post",
+ "type": "object"
}
}
},
@@ -48657,16 +49719,15 @@
"description": "Validation Error"
}
},
- "summary": "Get Runtime Status",
+ "summary": "Check For Update",
"tags": [
"system"
]
}
},
- "/api/system/status": {
+ "/api/system/update/job": {
"get": {
- "description": "Get overall system status including backend and model configurations\n\nReturns:\n Dictionary containing status of backend, LLM, embeddings, and search",
- "operationId": "get_system_status_api_system_status_get",
+ "operationId": "get_update_job_api_system_update_job_get",
"parameters": [
{
"in": "header",
@@ -48705,7 +49766,18 @@
"200": {
"content": {
"application/json": {
- "schema": {}
+ "schema": {
+ "anyOf": [
+ {
+ "additionalProperties": true,
+ "type": "object"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Response Get Update Job Api System Update Job Get"
+ }
}
},
"description": "Successful Response"
@@ -48721,16 +49793,15 @@
"description": "Validation Error"
}
},
- "summary": "Get System Status",
+ "summary": "Get Update Job",
"tags": [
"system"
]
}
},
- "/api/system/test/embeddings": {
- "post": {
- "description": "Test Embeddings model connection by sending a simple embedding request\n\nReturns:\n Test result with success status and response time",
- "operationId": "test_embeddings_connection_api_system_test_embeddings_post",
+ "/api/system/update/settings": {
+ "put": {
+ "operationId": "update_check_settings_api_system_update_settings_put",
"parameters": [
{
"in": "header",
@@ -48765,12 +49836,24 @@
}
}
],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/UpdateSettingsRequest"
+ }
+ }
+ },
+ "required": true
+ },
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/TestResponse"
+ "additionalProperties": true,
+ "title": "Response Update Check Settings Api System Update Settings Put",
+ "type": "object"
}
}
},
@@ -48787,16 +49870,16 @@
"description": "Validation Error"
}
},
- "summary": "Test Embeddings Connection",
+ "summary": "Update Check Settings",
"tags": [
"system"
]
}
},
- "/api/system/test/llm": {
- "post": {
- "description": "Test LLM model connection by sending a simple completion request\n\nReturns:\n Test result with success status and response time",
- "operationId": "test_llm_connection_api_system_test_llm_post",
+ "/api/tools": {
+ "get": {
+ "description": "Return all built-in tools the chat agent can invoke, plus any\ncoming-soon placeholders for the settings page.",
+ "operationId": "list_builtin_tools_api_tools_get",
"parameters": [
{
"in": "header",
@@ -48836,7 +49919,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/TestResponse"
+ "$ref": "#/components/schemas/ToolsListResponse"
}
}
},
@@ -48853,15 +49936,15 @@
"description": "Validation Error"
}
},
- "summary": "Test Llm Connection",
+ "summary": "List Builtin Tools",
"tags": [
- "system"
+ "tools"
]
}
},
- "/api/system/test/search": {
+ "/api/video-learning/invidious/account/authorize": {
"post": {
- "operationId": "test_search_connection_api_system_test_search_post",
+ "operationId": "authorize_invidious_account_api_video_learning_invidious_account_authorize_post",
"parameters": [
{
"in": "header",
@@ -48901,7 +49984,11 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/TestResponse"
+ "additionalProperties": {
+ "type": "string"
+ },
+ "title": "Response Authorize Invidious Account Api Video Learning Invidious Account Authorize Post",
+ "type": "object"
}
}
},
@@ -48918,17 +50005,36 @@
"description": "Validation Error"
}
},
- "summary": "Test Search Connection",
+ "summary": "Authorize Invidious Account",
"tags": [
- "system"
+ "video-learning"
]
}
},
- "/api/system/update": {
+ "/api/video-learning/invidious/account/callback": {
"get": {
- "description": "Return About-page version state, checking at most once per 24 hours.",
- "operationId": "get_update_status_api_system_update_get",
+ "operationId": "invidious_account_callback_api_video_learning_invidious_account_callback_get",
"parameters": [
+ {
+ "in": "query",
+ "name": "token",
+ "required": false,
+ "schema": {
+ "default": "",
+ "title": "Token",
+ "type": "string"
+ }
+ },
+ {
+ "in": "query",
+ "name": "state",
+ "required": false,
+ "schema": {
+ "default": "",
+ "title": "State",
+ "type": "string"
+ }
+ },
{
"in": "header",
"name": "Authorization",
@@ -48966,11 +50072,7 @@
"200": {
"content": {
"application/json": {
- "schema": {
- "additionalProperties": true,
- "title": "Response Get Update Status Api System Update Get",
- "type": "object"
- }
+ "schema": {}
}
},
"description": "Successful Response"
@@ -48986,14 +50088,15 @@
"description": "Validation Error"
}
},
- "summary": "Get Update Status",
+ "summary": "Invidious Account Callback",
"tags": [
- "system"
+ "video-learning"
]
- },
+ }
+ },
+ "/api/video-learning/invidious/account/disconnect": {
"post": {
- "description": "Reserve one safe update for the supervising launcher to apply.",
- "operationId": "request_managed_update_api_system_update_post",
+ "operationId": "disconnect_invidious_account_api_video_learning_invidious_account_disconnect_post",
"parameters": [
{
"in": "header",
@@ -49028,23 +50131,13 @@
}
}
],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ManagedUpdateRequest"
- }
- }
- },
- "required": true
- },
"responses": {
- "202": {
+ "200": {
"content": {
"application/json": {
"schema": {
"additionalProperties": true,
- "title": "Response Request Managed Update Api System Update Post",
+ "title": "Response Disconnect Invidious Account Api Video Learning Invidious Account Disconnect Post",
"type": "object"
}
}
@@ -49062,16 +50155,15 @@
"description": "Validation Error"
}
},
- "summary": "Request Managed Update",
+ "summary": "Disconnect Invidious Account",
"tags": [
- "system"
+ "video-learning"
]
}
},
- "/api/system/update/check": {
- "post": {
- "description": "Perform an explicit administrator-requested release check.",
- "operationId": "check_for_update_api_system_update_check_post",
+ "/api/video-learning/invidious/account/status": {
+ "get": {
+ "operationId": "get_invidious_account_status_api_video_learning_invidious_account_status_get",
"parameters": [
{
"in": "header",
@@ -49112,7 +50204,7 @@
"application/json": {
"schema": {
"additionalProperties": true,
- "title": "Response Check For Update Api System Update Check Post",
+ "title": "Response Get Invidious Account Status Api Video Learning Invidious Account Status Get",
"type": "object"
}
}
@@ -49130,16 +50222,59 @@
"description": "Validation Error"
}
},
- "summary": "Check For Update",
+ "summary": "Get Invidious Account Status",
"tags": [
- "system"
+ "video-learning"
]
}
},
- "/api/system/update/job": {
+ "/api/video-learning/invidious/browse/{kind}": {
"get": {
- "operationId": "get_update_job_api_system_update_job_get",
+ "operationId": "browse_invidious_api_video_learning_invidious_browse__kind__get",
"parameters": [
+ {
+ "in": "path",
+ "name": "kind",
+ "required": true,
+ "schema": {
+ "title": "Kind",
+ "type": "string"
+ }
+ },
+ {
+ "in": "query",
+ "name": "q",
+ "required": false,
+ "schema": {
+ "default": "",
+ "maxLength": 500,
+ "title": "Q",
+ "type": "string"
+ }
+ },
+ {
+ "in": "query",
+ "name": "page",
+ "required": false,
+ "schema": {
+ "default": 1,
+ "maximum": 1000,
+ "minimum": 1,
+ "title": "Page",
+ "type": "integer"
+ }
+ },
+ {
+ "in": "query",
+ "name": "playlist_id",
+ "required": false,
+ "schema": {
+ "default": "",
+ "maxLength": 100,
+ "title": "Playlist Id",
+ "type": "string"
+ }
+ },
{
"in": "header",
"name": "Authorization",
@@ -49177,18 +50312,7 @@
"200": {
"content": {
"application/json": {
- "schema": {
- "anyOf": [
- {
- "additionalProperties": true,
- "type": "object"
- },
- {
- "type": "null"
- }
- ],
- "title": "Response Get Update Job Api System Update Job Get"
- }
+ "schema": {}
}
},
"description": "Successful Response"
@@ -49204,15 +50328,15 @@
"description": "Validation Error"
}
},
- "summary": "Get Update Job",
+ "summary": "Browse Invidious",
"tags": [
- "system"
+ "video-learning"
]
}
},
- "/api/system/update/settings": {
- "put": {
- "operationId": "update_check_settings_api_system_update_settings_put",
+ "/api/video-learning/materials/resolve": {
+ "post": {
+ "operationId": "resolve_video_api_video_learning_materials_resolve_post",
"parameters": [
{
"in": "header",
@@ -49251,7 +50375,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/UpdateSettingsRequest"
+ "$ref": "#/components/schemas/ResolveRequest"
}
}
},
@@ -49263,7 +50387,7 @@
"application/json": {
"schema": {
"additionalProperties": true,
- "title": "Response Update Check Settings Api System Update Settings Put",
+ "title": "Response Resolve Video Api Video Learning Materials Resolve Post",
"type": "object"
}
}
@@ -49281,17 +50405,25 @@
"description": "Validation Error"
}
},
- "summary": "Update Check Settings",
+ "summary": "Resolve Video",
"tags": [
- "system"
+ "video-learning"
]
}
},
- "/api/tools": {
+ "/api/video-learning/materials/{material_id}": {
"get": {
- "description": "Return all built-in tools the chat agent can invoke, plus any\ncoming-soon placeholders for the settings page.",
- "operationId": "list_builtin_tools_api_tools_get",
+ "operationId": "get_video_material_api_video_learning_materials__material_id__get",
"parameters": [
+ {
+ "in": "path",
+ "name": "material_id",
+ "required": true,
+ "schema": {
+ "title": "Material Id",
+ "type": "string"
+ }
+ },
{
"in": "header",
"name": "Authorization",
@@ -49330,7 +50462,9 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/ToolsListResponse"
+ "additionalProperties": true,
+ "title": "Response Get Video Material Api Video Learning Materials Material Id Get",
+ "type": "object"
}
}
},
@@ -49347,16 +50481,25 @@
"description": "Validation Error"
}
},
- "summary": "List Builtin Tools",
+ "summary": "Get Video Material",
"tags": [
- "tools"
+ "video-learning"
]
}
},
- "/api/video-learning/invidious/account/authorize": {
- "post": {
- "operationId": "authorize_invidious_account_api_video_learning_invidious_account_authorize_post",
+ "/api/video-learning/materials/{material_id}/notes": {
+ "get": {
+ "operationId": "list_video_notes_api_video_learning_materials__material_id__notes_get",
"parameters": [
+ {
+ "in": "path",
+ "name": "material_id",
+ "required": true,
+ "schema": {
+ "title": "Material Id",
+ "type": "string"
+ }
+ },
{
"in": "header",
"name": "Authorization",
@@ -49395,11 +50538,12 @@
"content": {
"application/json": {
"schema": {
- "additionalProperties": {
- "type": "string"
+ "items": {
+ "additionalProperties": true,
+ "type": "object"
},
- "title": "Response Authorize Invidious Account Api Video Learning Invidious Account Authorize Post",
- "type": "object"
+ "title": "Response List Video Notes Api Video Learning Materials Material Id Notes Get",
+ "type": "array"
}
}
},
@@ -49416,33 +50560,20 @@
"description": "Validation Error"
}
},
- "summary": "Authorize Invidious Account",
+ "summary": "List Video Notes",
"tags": [
"video-learning"
]
- }
- },
- "/api/video-learning/invidious/account/callback": {
- "get": {
- "operationId": "invidious_account_callback_api_video_learning_invidious_account_callback_get",
+ },
+ "post": {
+ "operationId": "create_video_note_api_video_learning_materials__material_id__notes_post",
"parameters": [
{
- "in": "query",
- "name": "token",
- "required": false,
- "schema": {
- "default": "",
- "title": "Token",
- "type": "string"
- }
- },
- {
- "in": "query",
- "name": "state",
- "required": false,
+ "in": "path",
+ "name": "material_id",
+ "required": true,
"schema": {
- "default": "",
- "title": "State",
+ "title": "Material Id",
"type": "string"
}
},
@@ -49479,11 +50610,25 @@
}
}
],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/CreateVideoNoteRequest"
+ }
+ }
+ },
+ "required": true
+ },
"responses": {
"200": {
"content": {
"application/json": {
- "schema": {}
+ "schema": {
+ "additionalProperties": true,
+ "title": "Response Create Video Note Api Video Learning Materials Material Id Notes Post",
+ "type": "object"
+ }
}
},
"description": "Successful Response"
@@ -49499,16 +50644,25 @@
"description": "Validation Error"
}
},
- "summary": "Invidious Account Callback",
+ "summary": "Create Video Note",
"tags": [
"video-learning"
]
}
},
- "/api/video-learning/invidious/account/disconnect": {
- "post": {
- "operationId": "disconnect_invidious_account_api_video_learning_invidious_account_disconnect_post",
+ "/api/video-learning/materials/{material_id}/notes.md": {
+ "get": {
+ "operationId": "export_video_notes_api_video_learning_materials__material_id__notes_md_get",
"parameters": [
+ {
+ "in": "path",
+ "name": "material_id",
+ "required": true,
+ "schema": {
+ "title": "Material Id",
+ "type": "string"
+ }
+ },
{
"in": "header",
"name": "Authorization",
@@ -49546,11 +50700,7 @@
"200": {
"content": {
"application/json": {
- "schema": {
- "additionalProperties": true,
- "title": "Response Disconnect Invidious Account Api Video Learning Invidious Account Disconnect Post",
- "type": "object"
- }
+ "schema": {}
}
},
"description": "Successful Response"
@@ -49566,16 +50716,34 @@
"description": "Validation Error"
}
},
- "summary": "Disconnect Invidious Account",
+ "summary": "Export Video Notes",
"tags": [
"video-learning"
]
}
},
- "/api/video-learning/invidious/account/status": {
- "get": {
- "operationId": "get_invidious_account_status_api_video_learning_invidious_account_status_get",
+ "/api/video-learning/materials/{material_id}/notes/{note_id}": {
+ "delete": {
+ "operationId": "delete_video_note_api_video_learning_materials__material_id__notes__note_id__delete",
"parameters": [
+ {
+ "in": "path",
+ "name": "material_id",
+ "required": true,
+ "schema": {
+ "title": "Material Id",
+ "type": "string"
+ }
+ },
+ {
+ "in": "path",
+ "name": "note_id",
+ "required": true,
+ "schema": {
+ "title": "Note Id",
+ "type": "string"
+ }
+ },
{
"in": "header",
"name": "Authorization",
@@ -49614,8 +50782,10 @@
"content": {
"application/json": {
"schema": {
- "additionalProperties": true,
- "title": "Response Get Invidious Account Status Api Video Learning Invidious Account Status Get",
+ "additionalProperties": {
+ "type": "string"
+ },
+ "title": "Response Delete Video Note Api Video Learning Materials Material Id Notes Note Id Delete",
"type": "object"
}
}
@@ -49633,56 +50803,29 @@
"description": "Validation Error"
}
},
- "summary": "Get Invidious Account Status",
+ "summary": "Delete Video Note",
"tags": [
"video-learning"
]
- }
- },
- "/api/video-learning/invidious/browse/{kind}": {
- "get": {
- "operationId": "browse_invidious_api_video_learning_invidious_browse__kind__get",
+ },
+ "put": {
+ "operationId": "update_video_note_api_video_learning_materials__material_id__notes__note_id__put",
"parameters": [
{
"in": "path",
- "name": "kind",
+ "name": "material_id",
"required": true,
"schema": {
- "title": "Kind",
- "type": "string"
- }
- },
- {
- "in": "query",
- "name": "q",
- "required": false,
- "schema": {
- "default": "",
- "maxLength": 500,
- "title": "Q",
+ "title": "Material Id",
"type": "string"
}
},
{
- "in": "query",
- "name": "page",
- "required": false,
- "schema": {
- "default": 1,
- "maximum": 1000,
- "minimum": 1,
- "title": "Page",
- "type": "integer"
- }
- },
- {
- "in": "query",
- "name": "playlist_id",
- "required": false,
+ "in": "path",
+ "name": "note_id",
+ "required": true,
"schema": {
- "default": "",
- "maxLength": 100,
- "title": "Playlist Id",
+ "title": "Note Id",
"type": "string"
}
},
@@ -49719,11 +50862,25 @@
}
}
],
+ "requestBody": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/UpdateVideoNoteRequest"
+ }
+ }
+ },
+ "required": true
+ },
"responses": {
"200": {
"content": {
"application/json": {
- "schema": {}
+ "schema": {
+ "additionalProperties": true,
+ "title": "Response Update Video Note Api Video Learning Materials Material Id Notes Note Id Put",
+ "type": "object"
+ }
}
},
"description": "Successful Response"
@@ -49739,16 +50896,25 @@
"description": "Validation Error"
}
},
- "summary": "Browse Invidious",
+ "summary": "Update Video Note",
"tags": [
"video-learning"
]
}
},
- "/api/video-learning/materials/resolve": {
- "post": {
- "operationId": "resolve_video_api_video_learning_materials_resolve_post",
+ "/api/video-learning/materials/{material_id}/progress": {
+ "put": {
+ "operationId": "save_video_progress_api_video_learning_materials__material_id__progress_put",
"parameters": [
+ {
+ "in": "path",
+ "name": "material_id",
+ "required": true,
+ "schema": {
+ "title": "Material Id",
+ "type": "string"
+ }
+ },
{
"in": "header",
"name": "Authorization",
@@ -49786,7 +50952,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/ResolveRequest"
+ "$ref": "#/components/schemas/deeptutor__api__routers__video_learning__ProgressRequest"
}
}
},
@@ -49797,8 +50963,10 @@
"content": {
"application/json": {
"schema": {
- "additionalProperties": true,
- "title": "Response Resolve Video Api Video Learning Materials Resolve Post",
+ "additionalProperties": {
+ "type": "number"
+ },
+ "title": "Response Save Video Progress Api Video Learning Materials Material Id Progress Put",
"type": "object"
}
}
@@ -49816,15 +50984,15 @@
"description": "Validation Error"
}
},
- "summary": "Resolve Video",
+ "summary": "Save Video Progress",
"tags": [
"video-learning"
]
}
},
- "/api/video-learning/materials/{material_id}": {
+ "/api/video-learning/materials/{material_id}/stream/{format_id}": {
"get": {
- "operationId": "get_video_material_api_video_learning_materials__material_id__get",
+ "operationId": "stream_video_get",
"parameters": [
{
"in": "path",
@@ -49835,6 +51003,15 @@
"type": "string"
}
},
+ {
+ "in": "path",
+ "name": "format_id",
+ "required": true,
+ "schema": {
+ "title": "Format Id",
+ "type": "string"
+ }
+ },
{
"in": "header",
"name": "Authorization",
@@ -49872,11 +51049,7 @@
"200": {
"content": {
"application/json": {
- "schema": {
- "additionalProperties": true,
- "title": "Response Get Video Material Api Video Learning Materials Material Id Get",
- "type": "object"
- }
+ "schema": {}
}
},
"description": "Successful Response"
@@ -49892,15 +51065,13 @@
"description": "Validation Error"
}
},
- "summary": "Get Video Material",
+ "summary": "Stream Video",
"tags": [
"video-learning"
]
- }
- },
- "/api/video-learning/materials/{material_id}/notes": {
- "get": {
- "operationId": "list_video_notes_api_video_learning_materials__material_id__notes_get",
+ },
+ "head": {
+ "operationId": "stream_video_head",
"parameters": [
{
"in": "path",
@@ -49911,6 +51082,15 @@
"type": "string"
}
},
+ {
+ "in": "path",
+ "name": "format_id",
+ "required": true,
+ "schema": {
+ "title": "Format Id",
+ "type": "string"
+ }
+ },
{
"in": "header",
"name": "Authorization",
@@ -49948,14 +51128,7 @@
"200": {
"content": {
"application/json": {
- "schema": {
- "items": {
- "additionalProperties": true,
- "type": "object"
- },
- "title": "Response List Video Notes Api Video Learning Materials Material Id Notes Get",
- "type": "array"
- }
+ "schema": {}
}
},
"description": "Successful Response"
@@ -49971,13 +51144,15 @@
"description": "Validation Error"
}
},
- "summary": "List Video Notes",
+ "summary": "Stream Video",
"tags": [
"video-learning"
]
- },
- "post": {
- "operationId": "create_video_note_api_video_learning_materials__material_id__notes_post",
+ }
+ },
+ "/api/video-learning/materials/{material_id}/subtitles.vtt": {
+ "get": {
+ "operationId": "get_video_subtitles_api_video_learning_materials__material_id__subtitles_vtt_get",
"parameters": [
{
"in": "path",
@@ -50021,25 +51196,11 @@
}
}
],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/CreateVideoNoteRequest"
- }
- }
- },
- "required": true
- },
"responses": {
"200": {
"content": {
"application/json": {
- "schema": {
- "additionalProperties": true,
- "title": "Response Create Video Note Api Video Learning Materials Material Id Notes Post",
- "type": "object"
- }
+ "schema": {}
}
},
"description": "Successful Response"
@@ -50055,15 +51216,15 @@
"description": "Validation Error"
}
},
- "summary": "Create Video Note",
+ "summary": "Get Video Subtitles",
"tags": [
"video-learning"
]
}
},
- "/api/video-learning/materials/{material_id}/notes.md": {
- "get": {
- "operationId": "export_video_notes_api_video_learning_materials__material_id__notes_md_get",
+ "/api/video-learning/materials/{material_id}/transcript/refresh": {
+ "post": {
+ "operationId": "refresh_video_transcript_api_video_learning_materials__material_id__transcript_refresh_post",
"parameters": [
{
"in": "path",
@@ -50111,7 +51272,11 @@
"200": {
"content": {
"application/json": {
- "schema": {}
+ "schema": {
+ "additionalProperties": true,
+ "title": "Response Refresh Video Transcript Api Video Learning Materials Material Id Transcript Refresh Post",
+ "type": "object"
+ }
}
},
"description": "Successful Response"
@@ -50127,31 +51292,22 @@
"description": "Validation Error"
}
},
- "summary": "Export Video Notes",
+ "summary": "Refresh Video Transcript",
"tags": [
"video-learning"
]
}
},
- "/api/video-learning/materials/{material_id}/notes/{note_id}": {
- "delete": {
- "operationId": "delete_video_note_api_video_learning_materials__material_id__notes__note_id__delete",
+ "/api/visualizers/bundled/{visualizer_id}/install": {
+ "post": {
+ "operationId": "install_bundled_api_visualizers_bundled__visualizer_id__install_post",
"parameters": [
{
"in": "path",
- "name": "material_id",
- "required": true,
- "schema": {
- "title": "Material Id",
- "type": "string"
- }
- },
- {
- "in": "path",
- "name": "note_id",
+ "name": "visualizer_id",
"required": true,
"schema": {
- "title": "Note Id",
+ "title": "Visualizer Id",
"type": "string"
}
},
@@ -50193,10 +51349,8 @@
"content": {
"application/json": {
"schema": {
- "additionalProperties": {
- "type": "string"
- },
- "title": "Response Delete Video Note Api Video Learning Materials Material Id Notes Note Id Delete",
+ "additionalProperties": true,
+ "title": "Response Install Bundled Api Visualizers Bundled Visualizer Id Install Post",
"type": "object"
}
}
@@ -50214,32 +51368,17 @@
"description": "Validation Error"
}
},
- "summary": "Delete Video Note",
+ "summary": "Install Bundled",
"tags": [
- "video-learning"
+ "visualizers"
]
- },
- "put": {
- "operationId": "update_video_note_api_video_learning_materials__material_id__notes__note_id__put",
+ }
+ },
+ "/api/visualizers/import": {
+ "post": {
+ "description": "Install one declarative ``visualizer.json`` + iframe bundle zip.",
+ "operationId": "import_visualizer_api_visualizers_import_post",
"parameters": [
- {
- "in": "path",
- "name": "material_id",
- "required": true,
- "schema": {
- "title": "Material Id",
- "type": "string"
- }
- },
- {
- "in": "path",
- "name": "note_id",
- "required": true,
- "schema": {
- "title": "Note Id",
- "type": "string"
- }
- },
{
"in": "header",
"name": "Authorization",
@@ -50275,9 +51414,9 @@
],
"requestBody": {
"content": {
- "application/json": {
+ "multipart/form-data": {
"schema": {
- "$ref": "#/components/schemas/UpdateVideoNoteRequest"
+ "$ref": "#/components/schemas/Body_import_visualizer_api_visualizers_import_post"
}
}
},
@@ -50289,7 +51428,7 @@
"application/json": {
"schema": {
"additionalProperties": true,
- "title": "Response Update Video Note Api Video Learning Materials Material Id Notes Note Id Put",
+ "title": "Response Import Visualizer Api Visualizers Import Post",
"type": "object"
}
}
@@ -50307,25 +51446,16 @@
"description": "Validation Error"
}
},
- "summary": "Update Video Note",
+ "summary": "Import Visualizer",
"tags": [
- "video-learning"
+ "visualizers"
]
}
},
- "/api/video-learning/materials/{material_id}/progress": {
- "put": {
- "operationId": "save_video_progress_api_video_learning_materials__material_id__progress_put",
+ "/api/visualizers/list": {
+ "get": {
+ "operationId": "list_visualizers_api_visualizers_list_get",
"parameters": [
- {
- "in": "path",
- "name": "material_id",
- "required": true,
- "schema": {
- "title": "Material Id",
- "type": "string"
- }
- },
{
"in": "header",
"name": "Authorization",
@@ -50359,25 +51489,13 @@
}
}
],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/deeptutor__api__routers__video_learning__ProgressRequest"
- }
- }
- },
- "required": true
- },
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
- "additionalProperties": {
- "type": "number"
- },
- "title": "Response Save Video Progress Api Video Learning Materials Material Id Progress Put",
+ "additionalProperties": true,
+ "title": "Response List Visualizers Api Visualizers List Get",
"type": "object"
}
}
@@ -50395,31 +51513,22 @@
"description": "Validation Error"
}
},
- "summary": "Save Video Progress",
+ "summary": "List Visualizers",
"tags": [
- "video-learning"
+ "visualizers"
]
}
},
- "/api/video-learning/materials/{material_id}/stream/{format_id}": {
- "get": {
- "operationId": "stream_video_get",
+ "/api/visualizers/{visualizer_id}": {
+ "delete": {
+ "operationId": "uninstall_visualizer_api_visualizers__visualizer_id__delete",
"parameters": [
{
"in": "path",
- "name": "material_id",
- "required": true,
- "schema": {
- "title": "Material Id",
- "type": "string"
- }
- },
- {
- "in": "path",
- "name": "format_id",
+ "name": "visualizer_id",
"required": true,
"schema": {
- "title": "Format Id",
+ "title": "Visualizer Id",
"type": "string"
}
},
@@ -50460,7 +51569,13 @@
"200": {
"content": {
"application/json": {
- "schema": {}
+ "schema": {
+ "additionalProperties": {
+ "type": "string"
+ },
+ "title": "Response Uninstall Visualizer Api Visualizers Visualizer Id Delete",
+ "type": "object"
+ }
}
},
"description": "Successful Response"
@@ -50476,29 +51591,31 @@
"description": "Validation Error"
}
},
- "summary": "Stream Video",
+ "summary": "Uninstall Visualizer",
"tags": [
- "video-learning"
+ "visualizers"
]
- },
- "head": {
- "operationId": "stream_video_head",
+ }
+ },
+ "/api/visualizers/{visualizer_id}/assets/{asset_path}": {
+ "get": {
+ "operationId": "get_visualizer_asset_api_visualizers__visualizer_id__assets__asset_path__get",
"parameters": [
{
"in": "path",
- "name": "material_id",
+ "name": "visualizer_id",
"required": true,
"schema": {
- "title": "Material Id",
+ "title": "Visualizer Id",
"type": "string"
}
},
{
"in": "path",
- "name": "format_id",
+ "name": "asset_path",
"required": true,
"schema": {
- "title": "Format Id",
+ "title": "Asset Path",
"type": "string"
}
},
@@ -50555,22 +51672,22 @@
"description": "Validation Error"
}
},
- "summary": "Stream Video",
+ "summary": "Get Visualizer Asset",
"tags": [
- "video-learning"
+ "visualizers"
]
}
},
- "/api/video-learning/materials/{material_id}/subtitles.vtt": {
- "get": {
- "operationId": "get_video_subtitles_api_video_learning_materials__material_id__subtitles_vtt_get",
+ "/api/visualizers/{visualizer_id}/disable": {
+ "post": {
+ "operationId": "disable_visualizer_api_visualizers__visualizer_id__disable_post",
"parameters": [
{
"in": "path",
- "name": "material_id",
+ "name": "visualizer_id",
"required": true,
"schema": {
- "title": "Material Id",
+ "title": "Visualizer Id",
"type": "string"
}
},
@@ -50611,7 +51728,13 @@
"200": {
"content": {
"application/json": {
- "schema": {}
+ "schema": {
+ "additionalProperties": {
+ "type": "string"
+ },
+ "title": "Response Disable Visualizer Api Visualizers Visualizer Id Disable Post",
+ "type": "object"
+ }
}
},
"description": "Successful Response"
@@ -50627,22 +51750,22 @@
"description": "Validation Error"
}
},
- "summary": "Get Video Subtitles",
+ "summary": "Disable Visualizer",
"tags": [
- "video-learning"
+ "visualizers"
]
}
},
- "/api/video-learning/materials/{material_id}/transcript/refresh": {
+ "/api/visualizers/{visualizer_id}/enable": {
"post": {
- "operationId": "refresh_video_transcript_api_video_learning_materials__material_id__transcript_refresh_post",
+ "operationId": "enable_visualizer_api_visualizers__visualizer_id__enable_post",
"parameters": [
{
"in": "path",
- "name": "material_id",
+ "name": "visualizer_id",
"required": true,
"schema": {
- "title": "Material Id",
+ "title": "Visualizer Id",
"type": "string"
}
},
@@ -50684,8 +51807,10 @@
"content": {
"application/json": {
"schema": {
- "additionalProperties": true,
- "title": "Response Refresh Video Transcript Api Video Learning Materials Material Id Transcript Refresh Post",
+ "additionalProperties": {
+ "type": "string"
+ },
+ "title": "Response Enable Visualizer Api Visualizers Visualizer Id Enable Post",
"type": "object"
}
}
@@ -50703,25 +51828,17 @@
"description": "Validation Error"
}
},
- "summary": "Refresh Video Transcript",
+ "summary": "Enable Visualizer",
"tags": [
- "video-learning"
+ "visualizers"
]
}
},
- "/api/visualizers/bundled/{visualizer_id}/install": {
+ "/api/voice/stt": {
"post": {
- "operationId": "install_bundled_api_visualizers_bundled__visualizer_id__install_post",
+ "description": "Transcribe an uploaded audio clip using the active STT provider.",
+ "operationId": "speech_to_text_api_voice_stt_post",
"parameters": [
- {
- "in": "path",
- "name": "visualizer_id",
- "required": true,
- "schema": {
- "title": "Visualizer Id",
- "type": "string"
- }
- },
{
"in": "header",
"name": "Authorization",
@@ -50755,13 +51872,25 @@
}
}
],
+ "requestBody": {
+ "content": {
+ "multipart/form-data": {
+ "schema": {
+ "$ref": "#/components/schemas/Body_speech_to_text_api_voice_stt_post"
+ }
+ }
+ },
+ "required": true
+ },
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
- "additionalProperties": true,
- "title": "Response Install Bundled Api Visualizers Bundled Visualizer Id Install Post",
+ "additionalProperties": {
+ "type": "string"
+ },
+ "title": "Response Speech To Text Api Voice Stt Post",
"type": "object"
}
}
@@ -50779,16 +51908,16 @@
"description": "Validation Error"
}
},
- "summary": "Install Bundled",
+ "summary": "Speech To Text",
"tags": [
- "visualizers"
+ "voice"
]
}
},
- "/api/visualizers/import": {
+ "/api/voice/tts": {
"post": {
- "description": "Install one declarative ``visualizer.json`` + iframe bundle zip.",
- "operationId": "import_visualizer_api_visualizers_import_post",
+ "description": "Synthesize ``text`` to audio using the active TTS provider.",
+ "operationId": "text_to_speech_api_voice_tts_post",
"parameters": [
{
"in": "header",
@@ -50825,9 +51954,9 @@
],
"requestBody": {
"content": {
- "multipart/form-data": {
+ "application/json": {
"schema": {
- "$ref": "#/components/schemas/Body_import_visualizer_api_visualizers_import_post"
+ "$ref": "#/components/schemas/TTSRequest"
}
}
},
@@ -50837,11 +51966,7 @@
"200": {
"content": {
"application/json": {
- "schema": {
- "additionalProperties": true,
- "title": "Response Import Visualizer Api Visualizers Import Post",
- "type": "object"
- }
+ "schema": {}
}
},
"description": "Successful Response"
@@ -50857,16 +51982,44 @@
"description": "Validation Error"
}
},
- "summary": "Import Visualizer",
+ "summary": "Text To Speech",
"tags": [
- "visualizers"
+ "voice"
]
}
},
- "/api/visualizers/list": {
+ "/files/attachments/{session_id}/{attachment_id}/{filename}": {
"get": {
- "operationId": "list_visualizers_api_visualizers_list_get",
+ "description": "Serve a previously uploaded chat attachment.\n\nResponds with ``Content-Disposition: inline`` so browsers preview PDFs\nand images directly in an ``<iframe>`` / ``<img>``. For unknown types\nthe browser still falls back to download, which is fine for the\ndrawer's \"Download\" button path.",
+ "operationId": "get_attachment_files_attachments__session_id___attachment_id___filename__get",
"parameters": [
+ {
+ "in": "path",
+ "name": "session_id",
+ "required": true,
+ "schema": {
+ "title": "Session Id",
+ "type": "string"
+ }
+ },
+ {
+ "in": "path",
+ "name": "attachment_id",
+ "required": true,
+ "schema": {
+ "title": "Attachment Id",
+ "type": "string"
+ }
+ },
+ {
+ "in": "path",
+ "name": "filename",
+ "required": true,
+ "schema": {
+ "title": "Filename",
+ "type": "string"
+ }
+ },
{
"in": "header",
"name": "Authorization",
@@ -50904,11 +52057,7 @@
"200": {
"content": {
"application/json": {
- "schema": {
- "additionalProperties": true,
- "title": "Response List Visualizers Api Visualizers List Get",
- "type": "object"
- }
+ "schema": {}
}
},
"description": "Successful Response"
@@ -50924,23 +52073,38 @@
"description": "Validation Error"
}
},
- "summary": "List Visualizers",
+ "summary": "Get Attachment",
"tags": [
- "visualizers"
+ "attachments"
]
}
},
- "/api/visualizers/{visualizer_id}": {
- "delete": {
- "operationId": "uninstall_visualizer_api_visualizers__visualizer_id__delete",
+ "/files/library/": {
+ "get": {
+ "description": "List active library entries, newest first.",
+ "operationId": "library_list",
"parameters": [
{
- "in": "path",
- "name": "visualizer_id",
- "required": true,
+ "in": "query",
+ "name": "limit",
+ "required": false,
"schema": {
- "title": "Visualizer Id",
- "type": "string"
+ "default": 50,
+ "maximum": 200,
+ "minimum": 1,
+ "title": "Limit",
+ "type": "integer"
+ }
+ },
+ {
+ "in": "query",
+ "name": "offset",
+ "required": false,
+ "schema": {
+ "default": 0,
+ "minimum": 0,
+ "title": "Offset",
+ "type": "integer"
}
},
{
@@ -50981,11 +52145,12 @@
"content": {
"application/json": {
"schema": {
- "additionalProperties": {
- "type": "string"
+ "items": {
+ "additionalProperties": true,
+ "type": "object"
},
- "title": "Response Uninstall Visualizer Api Visualizers Visualizer Id Delete",
- "type": "object"
+ "title": "Response Library List",
+ "type": "array"
}
}
},
@@ -51002,34 +52167,15 @@
"description": "Validation Error"
}
},
- "summary": "Uninstall Visualizer",
+ "summary": "List Library Files",
"tags": [
- "visualizers"
+ "library"
]
- }
- },
- "/api/visualizers/{visualizer_id}/assets/{asset_path}": {
- "get": {
- "operationId": "get_visualizer_asset_api_visualizers__visualizer_id__assets__asset_path__get",
+ },
+ "post": {
+ "description": "Add a file to the library.\n\nThe request must be ``multipart/form-data`` with a ``file`` field containing\nthe raw bytes. If a file with the same SHA-256 content hash already exists\nin the library, returns the existing entry (deduplication).",
+ "operationId": "library_add",
"parameters": [
- {
- "in": "path",
- "name": "visualizer_id",
- "required": true,
- "schema": {
- "title": "Visualizer Id",
- "type": "string"
- }
- },
- {
- "in": "path",
- "name": "asset_path",
- "required": true,
- "schema": {
- "title": "Asset Path",
- "type": "string"
- }
- },
{
"in": "header",
"name": "Authorization",
@@ -51063,11 +52209,25 @@
}
}
],
+ "requestBody": {
+ "content": {
+ "multipart/form-data": {
+ "schema": {
+ "$ref": "#/components/schemas/Body_library_add"
+ }
+ }
+ },
+ "required": true
+ },
"responses": {
"200": {
"content": {
"application/json": {
- "schema": {}
+ "schema": {
+ "additionalProperties": true,
+ "title": "Response Library Add",
+ "type": "object"
+ }
}
},
"description": "Successful Response"
@@ -51083,22 +52243,25 @@
"description": "Validation Error"
}
},
- "summary": "Get Visualizer Asset",
+ "summary": "Add Library File",
"tags": [
- "visualizers"
+ "library"
]
}
},
- "/api/visualizers/{visualizer_id}/disable": {
- "post": {
- "operationId": "disable_visualizer_api_visualizers__visualizer_id__disable_post",
+ "/files/library/search": {
+ "get": {
+ "description": "Search library entries by filename (case-insensitive substring).",
+ "operationId": "library_search",
"parameters": [
{
- "in": "path",
- "name": "visualizer_id",
+ "in": "query",
+ "name": "q",
"required": true,
"schema": {
- "title": "Visualizer Id",
+ "maxLength": 200,
+ "minLength": 1,
+ "title": "Q",
"type": "string"
}
},
@@ -51140,11 +52303,12 @@
"content": {
"application/json": {
"schema": {
- "additionalProperties": {
- "type": "string"
+ "items": {
+ "additionalProperties": true,
+ "type": "object"
},
- "title": "Response Disable Visualizer Api Visualizers Visualizer Id Disable Post",
- "type": "object"
+ "title": "Response Library Search",
+ "type": "array"
}
}
},
@@ -51161,22 +52325,23 @@
"description": "Validation Error"
}
},
- "summary": "Disable Visualizer",
+ "summary": "Search Library Files",
"tags": [
- "visualizers"
+ "library"
]
}
},
- "/api/visualizers/{visualizer_id}/enable": {
- "post": {
- "operationId": "enable_visualizer_api_visualizers__visualizer_id__enable_post",
+ "/files/library/{file_id}": {
+ "delete": {
+ "description": "Soft-delete a library file (sets is_deleted=1).",
+ "operationId": "library_delete",
"parameters": [
{
"in": "path",
- "name": "visualizer_id",
+ "name": "file_id",
"required": true,
"schema": {
- "title": "Visualizer Id",
+ "title": "File Id",
"type": "string"
}
},
@@ -51218,10 +52383,8 @@
"content": {
"application/json": {
"schema": {
- "additionalProperties": {
- "type": "string"
- },
- "title": "Response Enable Visualizer Api Visualizers Visualizer Id Enable Post",
+ "additionalProperties": true,
+ "title": "Response Library Delete",
"type": "object"
}
}
@@ -51239,17 +52402,24 @@
"description": "Validation Error"
}
},
- "summary": "Enable Visualizer",
+ "summary": "Delete Library File",
"tags": [
- "visualizers"
+ "library"
]
- }
- },
- "/api/voice/stt": {
- "post": {
- "description": "Transcribe an uploaded audio clip using the active STT provider.",
- "operationId": "speech_to_text_api_voice_stt_post",
+ },
+ "get": {
+ "description": "Get a single library entry by id (includes soft-deleted).",
+ "operationId": "library_get",
"parameters": [
+ {
+ "in": "path",
+ "name": "file_id",
+ "required": true,
+ "schema": {
+ "title": "File Id",
+ "type": "string"
+ }
+ },
{
"in": "header",
"name": "Authorization",
@@ -51283,25 +52453,13 @@
}
}
],
- "requestBody": {
- "content": {
- "multipart/form-data": {
- "schema": {
- "$ref": "#/components/schemas/Body_speech_to_text_api_voice_stt_post"
- }
- }
- },
- "required": true
- },
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
- "additionalProperties": {
- "type": "string"
- },
- "title": "Response Speech To Text Api Voice Stt Post",
+ "additionalProperties": true,
+ "title": "Response Library Get",
"type": "object"
}
}
@@ -51319,17 +52477,26 @@
"description": "Validation Error"
}
},
- "summary": "Speech To Text",
+ "summary": "Get Library File",
"tags": [
- "voice"
+ "library"
]
}
},
- "/api/voice/tts": {
- "post": {
- "description": "Synthesize ``text`` to audio using the active TTS provider.",
- "operationId": "text_to_speech_api_voice_tts_post",
+ "/files/library/{file_id}/download": {
+ "get": {
+ "description": "Download a library file by id.",
+ "operationId": "library_download",
"parameters": [
+ {
+ "in": "path",
+ "name": "file_id",
+ "required": true,
+ "schema": {
+ "title": "File Id",
+ "type": "string"
+ }
+ },
{
"in": "header",
"name": "Authorization",
@@ -51363,16 +52530,6 @@
}
}
],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/TTSRequest"
- }
- }
- },
- "required": true
- },
"responses": {
"200": {
"content": {
@@ -51393,41 +52550,94 @@
"description": "Validation Error"
}
},
- "summary": "Text To Speech",
+ "summary": "Download Library File",
"tags": [
- "voice"
+ "library"
]
- }
- },
- "/files/attachments/{session_id}/{attachment_id}/{filename}": {
- "get": {
- "description": "Serve a previously uploaded chat attachment.\n\nResponds with ``Content-Disposition: inline`` so browsers preview PDFs\nand images directly in an ``<iframe>`` / ``<img>``. For unknown types\nthe browser still falls back to download, which is fine for the\ndrawer's \"Download\" button path.",
- "operationId": "get_attachment_files_attachments__session_id___attachment_id___filename__get",
+ },
+ "head": {
+ "description": "Check whether a library file exists (HEAD only).",
+ "operationId": "library_download_head",
"parameters": [
{
"in": "path",
- "name": "session_id",
+ "name": "file_id",
"required": true,
"schema": {
- "title": "Session Id",
+ "title": "File Id",
"type": "string"
}
},
{
- "in": "path",
- "name": "attachment_id",
- "required": true,
+ "in": "header",
+ "name": "Authorization",
+ "required": false,
"schema": {
- "title": "Attachment Id",
- "type": "string"
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Authorization"
+ }
+ },
+ {
+ "in": "cookie",
+ "name": "dt_token",
+ "required": false,
+ "schema": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "title": "Dt Token"
}
+ }
+ ],
+ "responses": {
+ "200": {
+ "content": {
+ "application/json": {
+ "schema": {}
+ }
+ },
+ "description": "Successful Response"
},
+ "422": {
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
+ }
+ },
+ "description": "Validation Error"
+ }
+ },
+ "summary": "Download Library File Head",
+ "tags": [
+ "library"
+ ]
+ }
+ },
+ "/files/library/{file_id}/restore": {
+ "post": {
+ "description": "Restore a soft-deleted library file.",
+ "operationId": "library_restore",
+ "parameters": [
{
"in": "path",
- "name": "filename",
+ "name": "file_id",
"required": true,
"schema": {
- "title": "Filename",
+ "title": "File Id",
"type": "string"
}
},
@@ -51468,7 +52678,11 @@
"200": {
"content": {
"application/json": {
- "schema": {}
+ "schema": {
+ "additionalProperties": true,
+ "title": "Response Library Restore",
+ "type": "object"
+ }
}
},
"description": "Successful Response"
@@ -51484,9 +52698,9 @@
"description": "Validation Error"
}
},
- "summary": "Get Attachment",
+ "summary": "Restore Library File",
"tags": [
- "attachments"
+ "library"
]
}
},
diff --git a/web/lib/notebook-api.ts b/web/lib/notebook-api.ts
index a4d976883..f57eb2f6a 100644
--- a/web/lib/notebook-api.ts
+++ b/web/lib/notebook-api.ts
@@ -217,6 +217,15 @@ export interface NotebookEntry {
section_id: string;
section_title: string;
score_trend: ScoreTrend;
+ assessment_type?: AssessmentType | "";
+ result?: AssessmentResult;
+ mastery_path_id?: string;
+ knowledge_point_id?: string;
+ attempt_count?: number;
+ hints_used?: number;
+ confidence?: number | null;
+ response_time?: number | null;
+ quality?: number | null;
is_correct: boolean;
resolved: boolean;
bookmarked: boolean;
@@ -241,6 +250,14 @@ export type AssessmentSource =
| "immersive_reading"
| "book";
+export type AssessmentType = "quiz" | "focus_check" | "qualitative" | "review";
+
+export type AssessmentResult =
+ | "correct"
+ | "incorrect"
+ | "partial"
+ | "ungraded";
+
export type ScoreTrend = "new" | "improved" | "declined" | "unchanged";
export interface QuestionBankMaterial {
@@ -283,6 +300,10 @@ export interface NotebookEntryFilter {
source?: AssessmentSource;
material_id?: string;
section_id?: string;
+ assessment_type?: AssessmentType;
+ result?: AssessmentResult;
+ mastery_path_id?: string;
+ knowledge_point_id?: string;
resolved?: boolean;
score_trend?: ScoreTrend;
search?: string;
@@ -313,6 +334,12 @@ export async function listNotebookEntries(
if (filter.source) params.set("source", filter.source);
if (filter.material_id) params.set("material_id", filter.material_id);
if (filter.section_id) params.set("section_id", filter.section_id);
+ if (filter.assessment_type) params.set("assessment_type", filter.assessment_type);
+ if (filter.result) params.set("result", filter.result);
+ if (filter.mastery_path_id)
+ params.set("mastery_path_id", filter.mastery_path_id);
+ if (filter.knowledge_point_id)
+ params.set("knowledge_point_id", filter.knowledge_point_id);
if (filter.resolved !== undefined)
params.set("resolved", String(filter.resolved));
if (filter.score_trend) params.set("score_trend", filter.score_trend);
@@ -414,6 +441,15 @@ export async function upsertNotebookEntry(data: {
material_title?: string;
section_id?: string;
section_title?: string;
+ assessment_type?: AssessmentType | "";
+ result?: AssessmentResult;
+ mastery_path_id?: string;
+ knowledge_point_id?: string;
+ attempt_count?: number;
+ hints_used?: number;
+ confidence?: number | null;
+ response_time?: number | null;
+ quality?: number | null;
}): Promise<NotebookEntry> {
const response = await apiFetch(
apiUrl("/api/question-notebook/entries/upsert"),
diff --git a/web/lib/question-bank-answers.ts b/web/lib/question-bank-answers.ts
new file mode 100644
index 000000000..dc76288ea
--- /dev/null
+++ b/web/lib/question-bank-answers.ts
@@ -0,0 +1,25 @@
+/** Fold letters and option text so choice matching is not whitespace-sensitive. */
+export function foldedAnswer(value: string): string {
+ return value.trim().replace(/\s+/g, " ").toUpperCase();
+}
+
+/**
+ * Choice records store either the option letter (Book / Deep Question) or
+ * the option text (Immersive Reading). Match both so a review card can mark
+ * the learner's pick and the reference answer.
+ */
+export function optionIsAnswer(
+ key: string,
+ text: string,
+ answer: string,
+): boolean {
+ const needle = foldedAnswer(answer);
+ if (!needle) return false;
+ const label = foldedAnswer(key);
+ const body = foldedAnswer(text);
+ if (needle === label || needle === body) return true;
+ return Boolean(
+ body &&
+ (needle === `${label}. ${body}` || needle === `${label}) ${body}`),
+ );
+}
diff --git a/web/lib/reading-api.ts b/web/lib/reading-api.ts
index 84b0d8a4f..d867284c9 100644
--- a/web/lib/reading-api.ts
+++ b/web/lib/reading-api.ts
@@ -346,6 +346,57 @@ export async function runReadingExtension(
);
}
+export interface ReadingQuizAnswer {
+ question_id: string;
+ selected_index: number;
+}
+
+export interface ReadingQuizAnswerVerdict {
+ question_id: string;
+ is_correct: boolean;
+ result: "correct" | "incorrect" | "partial" | "ungraded";
+}
+
+/**
+ * Persist a reading Focus-Check on the server.
+ *
+ * The browser never sends the answer key — only the chosen index. Instant
+ * local feedback stays on the existing quiz card.
+ */
+export async function submitReadingQuizAnswers(
+ materialId: string,
+ payload: {
+ locator: number;
+ source_anchor?: string;
+ section_title?: string;
+ session_id?: string;
+ turn_id?: string;
+ answers: ReadingQuizAnswer[];
+ },
+): Promise<ReadingQuizAnswerVerdict[]> {
+ const data = await unwrap<{ answers?: ReadingQuizAnswerVerdict[] }>(
+ await apiFetch(
+ apiUrl(`${BASE}/materials/${materialId}/extensions/quiz/answers`),
+ {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({
+ locator: payload.locator,
+ source_anchor: payload.source_anchor || "",
+ section_title: payload.section_title || "",
+ session_id: payload.session_id || "",
+ turn_id: payload.turn_id || "",
+ answers: payload.answers.map((row) => ({
+ question_id: row.question_id,
+ selected_index: row.selected_index,
+ })),
+ }),
+ },
+ ),
+ );
+ return data.answers ?? [];
+}
+
/** URL of the original bytes. Served with Range support so pdf.js can stream. */
export function rawMaterialUrl(materialId: string): string {
return apiUrl(`${BASE}/materials/${materialId}/raw`);
diff --git a/web/locales/en/app.json b/web/locales/en/app.json
index 99a278f2f..2b01220dd 100644
--- a/web/locales/en/app.json
+++ b/web/locales/en/app.json
@@ -3654,7 +3654,13 @@
"Needs Review": "Needs Review",
"All Sources": "All Sources",
"Deep Question": "Deep Question",
+ "Unknown Source": "Unknown Source",
"Book": "Book",
+ "Assessment Type": "Assessment Type",
+ "Focus Check": "Focus Check",
+ "Qualitative": "Qualitative",
+ "Partially Correct": "Partially Correct",
+ "Not Graded": "Not Graded",
"All Materials": "All Materials",
"Score Trend": "Score Trend",
"All Trends": "All Trends",
diff --git a/web/locales/zh/app.json b/web/locales/zh/app.json
index e0c6bccbc..5de813d03 100644
--- a/web/locales/zh/app.json
+++ b/web/locales/zh/app.json
@@ -3654,7 +3654,13 @@
"Needs Review": "待复习",
"All Sources": "全部来源",
"Deep Question": "深度提问",
+ "Unknown Source": "未知来源",
"Book": "书籍",
+ "Assessment Type": "评估类型",
+ "Focus Check": "专注检测",
+ "Qualitative": "定性评估",
+ "Partially Correct": "部分正确",
+ "Not Graded": "未评分",
"All Materials": "全部材料",
"Score Trend": "得分趋势",
"All Trends": "全部趋势",
diff --git a/web/tests/question-bank-answers.test.ts b/web/tests/question-bank-answers.test.ts
new file mode 100644
index 000000000..2ab2900ee
--- /dev/null
+++ b/web/tests/question-bank-answers.test.ts
@@ -0,0 +1,54 @@
+import assert from "node:assert/strict";
+import test from "node:test";
+import { optionIsAnswer } from "../lib/question-bank-answers";
+
+test("option matching accepts a letter key", () => {
+ assert.equal(
+ optionIsAnswer("B", "To remove all trees from wide streets.", "B"),
+ true,
+ );
+ assert.equal(
+ optionIsAnswer("A", "To find places with little existing shade.", "B"),
+ false,
+ );
+});
+
+test("option matching accepts stored choice text from reading quizzes", () => {
+ assert.equal(
+ optionIsAnswer(
+ "B",
+ "To remove all trees from wide streets.",
+ "To remove all trees from wide streets.",
+ ),
+ true,
+ );
+ assert.equal(
+ optionIsAnswer(
+ "A",
+ "To find places with little existing shade.",
+ "To find places with little existing shade.",
+ ),
+ true,
+ );
+ assert.equal(
+ optionIsAnswer(
+ "A",
+ "To find places with little existing shade.",
+ "To remove all trees from wide streets.",
+ ),
+ false,
+ );
+});
+
+test("option matching ignores extra whitespace and letter prefixes", () => {
+ assert.equal(
+ optionIsAnswer("A", "Atlantic ocean", " atlantic ocean "),
+ true,
+ );
+ assert.equal(optionIsAnswer("B", "Shade pavement", "B. Shade pavement"), true);
+ assert.equal(
+ optionIsAnswer("B", "Shade pavement", "B) Shade pavement"),
+ true,
+ );
+ assert.equal(optionIsAnswer("A", "Shade pavement", ""), false);
+});
diff --git a/web/tests/question-card-assessment.test.ts b/web/tests/question-card-assessment.test.ts
new file mode 100644
index 000000000..f11357302
--- /dev/null
+++ b/web/tests/question-card-assessment.test.ts
@@ -0,0 +1,47 @@
+import assert from "node:assert/strict";
+import { readFileSync } from "node:fs";
+import path from "node:path";
+import test from "node:test";
+
+const card = readFileSync(
+ path.resolve(process.cwd(), "components/space/question-bank/QuestionCard.tsx"),
+ "utf8",
+);
+const english = readFileSync(
+ path.resolve(process.cwd(), "locales/en/app.json"),
+ "utf8",
+);
+const chinese = readFileSync(
+ path.resolve(process.cwd(), "locales/zh/app.json"),
+ "utf8",
+);
+
+test("question cards distinguish partial and ungraded results", () => {
+ assert.match(card, /Partially Correct/);
+ assert.match(card, /Not Graded/);
+ assert.match(card, /result === "partial"/);
+ assert.match(card, /result === "ungraded"/);
+ assert.match(card, /isUserAnswer && result === "incorrect"/);
+ assert.match(card, /result === "incorrect"\s*\? "wrong"/);
+ assert.match(card, /ASSESSMENT_TYPE_LABELS/);
+ assert.match(card, /Focus Check/);
+ assert.match(card, /source === "immersive_reading"/);
+ assert.match(english, /"Partially Correct": "Partially Correct"/);
+ assert.match(chinese, /"Partially Correct": "部分正确"/);
+ assert.match(english, /"Not Graded": "Not Graded"/);
+ assert.match(chinese, /"Not Graded": "未评分"/);
+ assert.match(english, /"Focus Check": "Focus Check"/);
+ assert.match(chinese, /"Focus Check": "专注检测"/);
+});
+
+test("choice cards mark the pick and reference from letter or option text", () => {
+ assert.match(card, /optionIsAnswer/);
+ assert.match(card, /from "@\/lib\/question-bank-answers"/);
+ assert.match(card, /t\("Your pick"\)/);
+ assert.doesNotMatch(
+ card,
+ /entry\.user_answer\?\.toUpperCase\(\) === key\.toUpperCase\(\)/,
+ );
+ assert.match(english, /"Your pick": "Your pick"/);
+ assert.match(chinese, /"Your pick": "你的选择"/);
+});
diff --git a/web/tests/reading-extensions.test.ts b/web/tests/reading-extensions.test.ts
index 20a429c0e..56882bd8b 100644
--- a/web/tests/reading-extensions.test.ts
+++ b/web/tests/reading-extensions.test.ts
@@ -39,6 +39,27 @@ test("the browser sends a locator and selection, not trusted visible text", () =
assert.doesNotMatch(api, /visible_text\?: string/);
});
+test("reading quiz answers send only the selected index", () => {
+ assert.match(api, /export async function submitReadingQuizAnswers/);
+ assert.match(
+ api,
+ /answers: payload\.answers\.map\(\(row\) => \(\{[\s\S]*question_id: row\.question_id,[\s\S]*selected_index: row\.selected_index,[\s\S]*\}\)\)/,
+ );
+ const submitFn = api.slice(api.indexOf("submitReadingQuizAnswers"));
+ assert.doesNotMatch(submitFn, /correct_choice_index/);
+ assert.match(component, /submitReadingQuizAnswers\(materialId,/);
+ assert.match(component, /selected_index: choiceIndex/);
+ const persistStart = component.indexOf("function persistAnswer");
+ const persistEnd = component.indexOf("return questions.map", persistStart);
+ assert.notEqual(persistStart, -1);
+ assert.notEqual(persistEnd, -1);
+ assert.doesNotMatch(
+ component.slice(persistStart, persistEnd),
+ /correct_choice_index/,
+ );
+ assert.match(pane, /sessionId=\{sessionId\}/);
+});
+
test("a malformed extension catalog cannot crash the whole reader", () => {
assert.match(api, /if \(!Array\.isArray\(payload\)\) return \[\]/);
assert.match(