Skip to content

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

release: v1.4.6

Bingxi Zhao (Frank)7ac3a3ba795a
diff --git a/README.md b/README.md
index c6aa42d3a..da14ae9a2 100644
--- a/README.md
+++ b/README.md
@@ -44,6 +44,8 @@
### ๐Ÿ“ฆ Releases
+> **[2026.6.17]** [v1.4.6](https://github.com/HKUDS/DeepTutor/releases/tag/v1.4.6) โ€” Consolidation across four surfaces: Space becomes a learning dashboard with importable **My Agents** and a top-level Memory, the **Knowledge Center** adds GraphRAG / PageIndex / LightRAG engines plus linked-KB and Obsidian mounts, Settings opens up document parsing / voice / image+video, and LLM capabilities are gated per assigned model.
+
> **[2026.6.14]** [v1.4.5](https://github.com/HKUDS/DeepTutor/releases/tag/v1.4.5) โ€” Guided Learning rebuilt on the chat agent loop with a hard per-type mastery gate and a `/learning` dashboard, a new extensible loop-plugin framework, plus Markdown export / save-to-notebook for Partner conversations.
> **[2026.6.13]** [v1.4.4](https://github.com/HKUDS/DeepTutor/releases/tag/v1.4.4) โ€” Install community skills from [ClawHub](https://clawhub.ai/) with `deeptutor skill install` behind a security gate, plus real in-browser DOCX/XLSX previews for knowledge-base files.
diff --git a/assets/releases/ver1-4-6.md b/assets/releases/ver1-4-6.md
new file mode 100644
index 000000000..2d41f8769
--- /dev/null
+++ b/assets/releases/ver1-4-6.md
@@ -0,0 +1,94 @@
+# DeepTutor v1.4.6 Release Notes
+
+**Release Date:** 2026.06.17
+
+_Heads up: the documentation is still catching up to this release, so some
+pages may not yet reflect everything below._
+
+A broad consolidation release on top of [v1.4.5](ver1-4-5.md), organized
+around the four surfaces it touches: the **Learning Space** becomes a real
+dashboard, the **Knowledge Center** gains new retrieval engines and external
+mounts, **Settings** opens up document parsing, voice, and media generation,
+and the platform tightens per-user access. Drop-in upgrade โ€” no data migration.
+
+> **One behavior change; everything else is opt-in.** Users without an
+> assigned model now see LLM-backed capabilities locked in both the UI and the
+> server-side gate โ€” admins are never gated, so just make sure each user has a
+> model assigned. The new Knowledge Center engines (GraphRAG, PageIndex) and
+> the document-parsing / voice / image-video services are all off until
+> configured; nothing new runs or downloads by default. No data migration:
+> existing spaces, memory, and knowledge bases load as-is.
+
+## What's New
+
+### Learning Space
+
+The **Space** is now a learning dashboard that pulls your work together, and
+the surfaces around it grew up:
+
+- **My Agents** โ€” import your local Claude Code / Codex chat history into a
+ resumable agent you can keep talking to (`/space/agents`). A referenced
+ transcript gets an objective briefing and third-party framing, so the tutor
+ narrates it instead of role-playing as you.
+- **Memory** is promoted to its own top-level destination (`/memory`) instead
+ of being buried in the workspace, with the L1/L2/L3 views intact.
+- **Partner** conversations now flow into Memory on the same pipeline as chat.
+- Install community skills from **EduHub** inline at `/space/skills`.
+
+### Knowledge Center
+
+`/knowledge` is rebuilt as a **Knowledge Center** console โ€” engine cards are
+pure entry points and configuration moves into a per-engine detail page:
+
+- New retrieval engines join LlamaIndex: **GraphRAG** (microsoft/graphrag),
+ **PageIndex** (cloud reasoning-retrieval), and a built-out **LightRAG**
+ backend โ€” picked per knowledge base.
+- **Linked KB** โ€” point a knowledge base at an already-built index folder as a
+ read-only mount, skipping ingestion entirely.
+- **Obsidian** โ€” connect a live vault as an agentic knowledge capability that
+ reads and writes notes directly.
+
+### Settings
+
+New configurable services, each with its own settings page and all off until
+you set them up:
+
+- **Document parsing** โ€” a pluggable parse layer (MinerU, Docling, MarkItDown)
+ with a content-addressed cache (`/settings/document-parsing`). MinerU adds a
+ cloud/local dual backend (`/settings/mineru`) and now extracts question type,
+ difficulty, and answer.
+- **Voice** โ€” a speaker button with three-state autoplay for replies (TTS) and
+ a composer mic for dictation (STT), at `/settings/tts` and `/settings/stt`.
+- **Image & video generation** โ€” configurable model catalogs wired into chat
+ tools (`/settings/image`, `/settings/video`).
+- Settings navigation rebuilt around the expanded surface.
+
+### Other
+
+- **Per-user access gating** โ€” LLM capabilities are locked for users without an
+ assigned model, with the sidebar lock and the server-side gate always in
+ agreement.
+- **Solve** is rebuilt as a capability on the chat loop, with a per-step gate
+ and a mid-run failure fallback that forces a graceful finish instead of
+ failing the whole turn.
+- **Login** accepts a username (not just an email), surfaces bad-login errors
+ inline instead of silently reloading, and fixes the `NEXT_PUBLIC_AUTH_ENABLED`
+ flag.
+- **CLI** gains `deeptutor skill` commands โ€” browser login plus publish/update
+ for your own skills.
+- Context pickers are polished onto a shared shell with live preview, and a
+ math-before-citation rendering fix keeps `$โ€ฆ$` from being mangled by citation
+ linkification.
+
+## Upgrade Notes
+
+- Drop-in from v1.4.5: `pip install -U deeptutor`; Docker users pull
+ `ghcr.io/hkuds/deeptutor:latest`. No migrations โ€” existing data loads as-is.
+- Assign each user a model so their capabilities unlock; admins manage this
+ from the model catalog.
+- New engines and services are opt-in: GraphRAG needs the extra
+ (`pip install 'deeptutor[graphrag]'`), document parsing needs
+ `deeptutor[parse]`, and voice / image / video need their model catalogs
+ configured.
+
+**Full Changelog**: https://github.com/HKUDS/DeepTutor/compare/v1.4.5...v1.4.6
diff --git a/deeptutor/__version__.py b/deeptutor/__version__.py
index 820d35d66..841ab1ab7 100644
--- a/deeptutor/__version__.py
+++ b/deeptutor/__version__.py
@@ -6,6 +6,6 @@ before publishing to PyPI; the web sidebar badge and CLI banner read from this
file directly.
"""
-__version__ = "1.4.5"
+__version__ = "1.4.6"
__all__ = ("__version__",)
diff --git a/deeptutor/agents/chat/agentic_pipeline.py b/deeptutor/agents/chat/agentic_pipeline.py
index 7eeb97119..2038957e5 100644
--- a/deeptutor/agents/chat/agentic_pipeline.py
+++ b/deeptutor/agents/chat/agentic_pipeline.py
@@ -77,13 +77,16 @@ def _drop_unconfigured_generation_tools(tools: list[str]) -> list[str]:
configured = {
name
for name in present
- if (service.get_active_model(catalog, _GENERATION_TOOL_SERVICES[name]) or {}).get("model")
+ if (service.get_active_model(catalog, _GENERATION_TOOL_SERVICES[name]) or {}).get(
+ "model"
+ )
}
except Exception:
logger.debug("generation-tool config probe failed; dropping them", exc_info=True)
configured = set()
return [name for name in tools if name not in _GENERATION_TOOL_SERVICES or name in configured]
+
KB_SEED_MAX_KBS = 3
KB_SEED_CHARS_PER_KB = 4000
# Exploring-loop budget: max LLM rounds in one turn's loop. A round without
diff --git a/deeptutor/agents/chat/capability.py b/deeptutor/agents/chat/capability.py
index c3b4513c3..3412ecd63 100644
--- a/deeptutor/agents/chat/capability.py
+++ b/deeptutor/agents/chat/capability.py
@@ -3,10 +3,10 @@
from __future__ import annotations
from deeptutor.agents.chat.agentic_pipeline import CHAT_OPTIONAL_TOOLS, AgenticChatPipeline
-from deeptutor.runtime.request_contracts import get_capability_request_schema
from deeptutor.core.capability_protocol import BaseCapability, CapabilityManifest
from deeptutor.core.context import UnifiedContext
from deeptutor.core.stream_bus import StreamBus
+from deeptutor.runtime.request_contracts import get_capability_request_schema
class ChatCapability(BaseCapability):
diff --git a/deeptutor/agents/chat/prompt_blocks.py b/deeptutor/agents/chat/prompt_blocks.py
index a5bac0639..f25f9f9e7 100644
--- a/deeptutor/agents/chat/prompt_blocks.py
+++ b/deeptutor/agents/chat/prompt_blocks.py
@@ -4,8 +4,8 @@ from __future__ import annotations
from typing import Any
-from deeptutor.core.context import UnifiedContext
from deeptutor.capabilities.protocol import PromptBlock
+from deeptutor.core.context import UnifiedContext
from deeptutor.services.prompt.language import append_language_directive
diff --git a/deeptutor/agents/math_animator/capability.py b/deeptutor/agents/math_animator/capability.py
index 1f4b08684..bca47459c 100644
--- a/deeptutor/agents/math_animator/capability.py
+++ b/deeptutor/agents/math_animator/capability.py
@@ -6,14 +6,14 @@ import importlib.util
import time
from typing import Any
-from deeptutor.i18n import StatusI18n
from deeptutor.agents._shared.capability_result import emit_capability_result
-from deeptutor.runtime.request_contracts import get_capability_request_schema
from deeptutor.core.agentic.usage import UsageTracker
from deeptutor.core.capability_protocol import BaseCapability, CapabilityManifest
from deeptutor.core.context import UnifiedContext
from deeptutor.core.stream_bus import StreamBus
from deeptutor.core.trace import build_trace_metadata, merge_trace_metadata, new_call_id
+from deeptutor.i18n import StatusI18n
+from deeptutor.runtime.request_contracts import get_capability_request_schema
class MathAnimatorCapability(BaseCapability):
diff --git a/deeptutor/agents/question/capability.py b/deeptutor/agents/question/capability.py
index 01840eac6..7c353a64d 100644
--- a/deeptutor/agents/question/capability.py
+++ b/deeptutor/agents/question/capability.py
@@ -15,14 +15,14 @@ import base64
import tempfile
from typing import Any
-from deeptutor.i18n import StatusI18n
from deeptutor.agents._shared.capability_result import emit_capability_result
-from deeptutor.runtime.request_contracts import get_capability_request_schema
from deeptutor.core.agentic.usage import UsageTracker
from deeptutor.core.capability_protocol import BaseCapability, CapabilityManifest
from deeptutor.core.context import UnifiedContext
from deeptutor.core.stream_bus import StreamBus
from deeptutor.core.trace import merge_trace_metadata
+from deeptutor.i18n import StatusI18n
+from deeptutor.runtime.request_contracts import get_capability_request_schema
class DeepQuestionCapability(BaseCapability):
diff --git a/deeptutor/agents/question/pipeline.py b/deeptutor/agents/question/pipeline.py
index 29d133873..f799239bc 100644
--- a/deeptutor/agents/question/pipeline.py
+++ b/deeptutor/agents/question/pipeline.py
@@ -33,6 +33,7 @@ import logging
import re
from typing import Any
+from deeptutor.agents._shared.capability_result import emit_capability_result
from deeptutor.agents._shared.tool_composition import (
ToolMountFlags,
compose_enabled_tools,
@@ -40,7 +41,6 @@ from deeptutor.agents._shared.tool_composition import (
user_has_memory,
user_has_notebooks,
)
-from deeptutor.agents._shared.capability_result import emit_capability_result
from deeptutor.core.agentic import (
DispatchOutcome,
LabeledStepResult,
diff --git a/deeptutor/agents/research/capability.py b/deeptutor/agents/research/capability.py
index aebabda14..0ad98f342 100644
--- a/deeptutor/agents/research/capability.py
+++ b/deeptutor/agents/research/capability.py
@@ -27,10 +27,10 @@ from deeptutor.agents.research.request_config import (
build_research_runtime_config,
validate_research_request_config,
)
-from deeptutor.runtime.request_contracts import get_capability_request_schema
from deeptutor.core.capability_protocol import BaseCapability, CapabilityManifest
from deeptutor.core.context import UnifiedContext
from deeptutor.core.stream_bus import StreamBus
+from deeptutor.runtime.request_contracts import get_capability_request_schema
from deeptutor.services.config import load_config_with_main
diff --git a/deeptutor/agents/research/pipeline.py b/deeptutor/agents/research/pipeline.py
index 50cac474d..619245ca9 100644
--- a/deeptutor/agents/research/pipeline.py
+++ b/deeptutor/agents/research/pipeline.py
@@ -39,6 +39,7 @@ import logging
import re
from typing import Any
+from deeptutor.agents._shared.capability_result import emit_capability_result
from deeptutor.agents._shared.tool_composition import (
ToolMountFlags,
compose_enabled_tools,
@@ -53,7 +54,6 @@ from deeptutor.agents.research.data_structures import (
TopicStatus,
)
from deeptutor.agents.research.utils.citation_manager import CitationManager
-from deeptutor.agents._shared.capability_result import emit_capability_result
from deeptutor.core.agentic import (
DispatchOutcome,
LabeledStepResult,
diff --git a/deeptutor/agents/vision_solver/vision_solver_agent.py b/deeptutor/agents/vision_solver/vision_solver_agent.py
index b5202cee0..c34e39c51 100644
--- a/deeptutor/agents/vision_solver/vision_solver_agent.py
+++ b/deeptutor/agents/vision_solver/vision_solver_agent.py
@@ -178,7 +178,12 @@ def _coerce_commands(raw: Any) -> list[dict[str, Any]]:
out: list[dict[str, Any]] = []
for item in raw:
if isinstance(item, dict) and str(item.get("command") or "").strip():
- out.append({"command": str(item["command"]).strip(), "description": str(item.get("description") or "")})
+ out.append(
+ {
+ "command": str(item["command"]).strip(),
+ "description": str(item.get("description") or ""),
+ }
+ )
elif isinstance(item, str) and item.strip():
out.append({"command": item.strip(), "description": ""})
return out
diff --git a/deeptutor/agents/visualize/capability.py b/deeptutor/agents/visualize/capability.py
index b508f71e0..2cb4286b0 100644
--- a/deeptutor/agents/visualize/capability.py
+++ b/deeptutor/agents/visualize/capability.py
@@ -14,18 +14,18 @@ from __future__ import annotations
import logging
from typing import Any
-from deeptutor.i18n import StatusI18n
from deeptutor.agents._shared.capability_result import emit_capability_result
-from deeptutor.runtime.request_contracts import (
- VisualizeRequestConfig,
- get_capability_request_schema,
- validate_visualize_request_config,
-)
from deeptutor.core.agentic.usage import UsageTracker
from deeptutor.core.capability_protocol import BaseCapability, CapabilityManifest
from deeptutor.core.context import UnifiedContext
from deeptutor.core.stream_bus import StreamBus
from deeptutor.core.trace import merge_trace_metadata
+from deeptutor.i18n import StatusI18n
+from deeptutor.runtime.request_contracts import (
+ VisualizeRequestConfig,
+ get_capability_request_schema,
+ validate_visualize_request_config,
+)
logger = logging.getLogger(__name__)
diff --git a/deeptutor/api/main.py b/deeptutor/api/main.py
index 8433c56cd..80000b352 100644
--- a/deeptutor/api/main.py
+++ b/deeptutor/api/main.py
@@ -344,9 +344,7 @@ app.include_router(
app.include_router(
knowledge.router, prefix="/api/v1/knowledge", tags=["knowledge"], dependencies=_auth
)
-app.include_router(
- imports.router, prefix="/api/v1/imports", tags=["imports"], dependencies=_auth
-)
+app.include_router(imports.router, prefix="/api/v1/imports", tags=["imports"], dependencies=_auth)
app.include_router(
dashboard.router, prefix="/api/v1/dashboard", tags=["dashboard"], dependencies=_auth
)
diff --git a/deeptutor/api/routers/knowledge.py b/deeptutor/api/routers/knowledge.py
index 13e0a9298..04144380b 100644
--- a/deeptutor/api/routers/knowledge.py
+++ b/deeptutor/api/routers/knowledge.py
@@ -871,8 +871,7 @@ async def run_upload_processing_task(
task_id,
error_msg,
details="\n".join(
- f"{failure.file_path}: {failure.error}"
- for failure in index_result.failures
+ f"{failure.file_path}: {failure.error}" for failure in index_result.failures
),
)
return
@@ -1961,9 +1960,7 @@ async def upload_files(
# validated against ``allowed_extensions`` during extraction and the
# archive itself is never indexed (``safe_extract_zip`` skips ``.zip``).
upload_extensions = allowed_extensions | {".zip"}
- _validate_upload_batch(
- files, allowed_extensions=upload_extensions, rel_paths=rel_paths
- )
+ _validate_upload_batch(files, allowed_extensions=upload_extensions, rel_paths=rel_paths)
uploaded_files, uploaded_file_paths = _save_uploaded_files(
files, raw_dir, allowed_extensions=upload_extensions, rel_paths=rel_paths
)
@@ -2020,9 +2017,7 @@ async def create_knowledge_base(
_assert_provider_ready(rag_provider)
_enforce_provider_formats(rag_provider, files)
allowed_extensions = FileTypeRouter.get_supported_extensions()
- _validate_upload_batch(
- files, allowed_extensions=allowed_extensions, rel_paths=rel_paths
- )
+ _validate_upload_batch(files, allowed_extensions=allowed_extensions, rel_paths=rel_paths)
logger.info(f"Creating KB: {name} (provider={rag_provider})")
task_id = _build_unique_task_id("kb_init", name)
diff --git a/deeptutor/api/routers/settings.py b/deeptutor/api/routers/settings.py
index c4ef40e8e..779a58a2b 100644
--- a/deeptutor/api/routers/settings.py
+++ b/deeptutor/api/routers/settings.py
@@ -98,9 +98,7 @@ class VoiceAutoplayUpdate(BaseModel):
class ChatResponseTimeoutUpdate(BaseModel):
- chat_response_timeout: int = Field(
- ge=CHAT_RESPONSE_TIMEOUT_MIN, le=CHAT_RESPONSE_TIMEOUT_MAX
- )
+ chat_response_timeout: int = Field(ge=CHAT_RESPONSE_TIMEOUT_MIN, le=CHAT_RESPONSE_TIMEOUT_MAX)
class ThemeUpdate(BaseModel):
diff --git a/deeptutor/api/routers/tools.py b/deeptutor/api/routers/tools.py
index cd0037573..87041bd46 100644
--- a/deeptutor/api/routers/tools.py
+++ b/deeptutor/api/routers/tools.py
@@ -17,8 +17,8 @@ from fastapi import APIRouter
from pydantic import BaseModel
from deeptutor.api.routers.settings import get_enabled_optional_tools
-from deeptutor.i18n.metadata_i18n import tool_description_i18n
from deeptutor.core.tool_protocol import BaseTool, ToolDefinition, ToolPromptHints
+from deeptutor.i18n.metadata_i18n import tool_description_i18n
from deeptutor.tools.builtin import (
BUILTIN_TOOL_TYPES,
COMING_SOON_TOOL_TYPES,
diff --git a/deeptutor/capabilities/explore_context/explorer.py b/deeptutor/capabilities/explore_context/explorer.py
index d669639d4..db89c9574 100644
--- a/deeptutor/capabilities/explore_context/explorer.py
+++ b/deeptutor/capabilities/explore_context/explorer.py
@@ -486,7 +486,7 @@ class ContextExplorer:
return {str(k): str(v) for k, v in idx.items()}
return {}
- def _token_kwargs(self, max_tokens: int) -> dict[str, int]:
+ def _token_kwargs(self, max_tokens: int) -> dict[str, Any]:
if not self.model:
return {}
return get_token_limit_kwargs(self.model, max_tokens)
@@ -527,9 +527,7 @@ def _content_chars(message: dict[str, Any]) -> int:
return 0
-def _assistant_with_tool_calls(
- content: str, tool_calls: list[dict[str, Any]]
-) -> dict[str, Any]:
+def _assistant_with_tool_calls(content: str, tool_calls: list[dict[str, Any]]) -> dict[str, Any]:
return {
"role": "assistant",
"content": content or None,
diff --git a/deeptutor/capabilities/solve/capability.py b/deeptutor/capabilities/solve/capability.py
index 5be0f688d..ddb869c6c 100644
--- a/deeptutor/capabilities/solve/capability.py
+++ b/deeptutor/capabilities/solve/capability.py
@@ -78,9 +78,7 @@ class DeepSolveCapability(BaseCapability):
except Exception as exc: # pragma: no cover - defensive config read
logger.warning("Failed to load solve params, using defaults: %s", exc)
params = {}
- context.metadata["solve_max_replans"] = int(
- params.get("max_replans", DEFAULT_MAX_REPLANS)
- )
+ context.metadata["solve_max_replans"] = int(params.get("max_replans", DEFAULT_MAX_REPLANS))
pipeline = AgenticChatPipeline(
language=context.language,
max_rounds=params.get("max_rounds"),
diff --git a/deeptutor/capabilities/solve/loop.py b/deeptutor/capabilities/solve/loop.py
index 62b7850d2..84c03ee3b 100644
--- a/deeptutor/capabilities/solve/loop.py
+++ b/deeptutor/capabilities/solve/loop.py
@@ -58,7 +58,9 @@ class SolveLoopCapability:
# capability forwards ``max_replans`` into metadata); never the model.
session = get_session(session_id)
try:
- session.max_replans = int(context.metadata.get("solve_max_replans", DEFAULT_MAX_REPLANS))
+ session.max_replans = int(
+ context.metadata.get("solve_max_replans", DEFAULT_MAX_REPLANS)
+ )
except (TypeError, ValueError):
session.max_replans = DEFAULT_MAX_REPLANS
updated = dict(kwargs)
diff --git a/deeptutor/capabilities/solve/tools.py b/deeptutor/capabilities/solve/tools.py
index d4d15c67e..c12065d9e 100644
--- a/deeptutor/capabilities/solve/tools.py
+++ b/deeptutor/capabilities/solve/tools.py
@@ -18,8 +18,8 @@ from __future__ import annotations
import json
from typing import Any
-from deeptutor.core.tool_protocol import BaseTool, ToolDefinition, ToolParameter, ToolResult
from deeptutor.capabilities.solve.session import get_session
+from deeptutor.core.tool_protocol import BaseTool, ToolDefinition, ToolParameter, ToolResult
# Tool names the pipeline mounts together when a solve turn is active. Kept
# here so the mount policy and the registration list can't disagree.
@@ -34,7 +34,9 @@ def _resolve_session_id(kwargs: dict[str, Any]) -> str:
return str(kwargs.get("_solve_session_id") or "").strip()
-def _json_result(payload: dict[str, Any], *, meta_key: str, extra_meta: dict[str, Any] | None = None) -> ToolResult:
+def _json_result(
+ payload: dict[str, Any], *, meta_key: str, extra_meta: dict[str, Any] | None = None
+) -> ToolResult:
metadata: dict[str, Any] = {meta_key: payload}
if extra_meta:
metadata.update(extra_meta)
diff --git a/deeptutor/knowledge/add_documents.py b/deeptutor/knowledge/add_documents.py
index 762079551..8e4c9c8d3 100644
--- a/deeptutor/knowledge/add_documents.py
+++ b/deeptutor/knowledge/add_documents.py
@@ -63,9 +63,7 @@ class DocumentIndexResult:
def failure_summary(self, *, limit: int = 3) -> str:
if not self.failures:
return ""
- shown = [
- f"{failure.file_path.name}: {failure.error}" for failure in self.failures[:limit]
- ]
+ shown = [f"{failure.file_path.name}: {failure.error}" for failure in self.failures[:limit]]
remaining = len(self.failures) - len(shown)
if remaining > 0:
shown.append(f"... and {remaining} more file(s)")
@@ -116,9 +114,7 @@ class DocumentAdder:
)
if not has_provider_index:
- raise ValueError(
- f"Knowledge base not initialized ({self.rag_provider}): {kb_name}"
- )
+ raise ValueError(f"Knowledge base not initialized ({self.rag_provider}): {kb_name}")
self.api_key = api_key
self.base_url = base_url
diff --git a/deeptutor/knowledge/manager.py b/deeptutor/knowledge/manager.py
index 5f1b17c51..67401fb4c 100644
--- a/deeptutor/knowledge/manager.py
+++ b/deeptutor/knowledge/manager.py
@@ -222,7 +222,7 @@ def _reconcile_embedding_flags(knowledge_bases: dict, base_dir: Path | None = No
stored_model = kb_entry.get("embedding_model")
# Empty/in-progress version dirs are created before indexing finishes.
# They should not mark a brand-new KB as needing re-index.
- versions: list[dict] = []
+ versions = []
has_ready_version = False
if kb_dir is not None:
versions = inspect_kb_versions(kb_dir, provider)
@@ -588,9 +588,9 @@ class KnowledgeBaseManager:
rag_storage = item / "rag_storage"
versions = list_kb_versions(item)
detected_provider = _detect_provider_from_versions(versions)
- is_valid_kb = has_ready_provider_index(
- item, detected_provider
- ) or (rag_storage.exists() and rag_storage.is_dir())
+ is_valid_kb = has_ready_provider_index(item, detected_provider) or (
+ rag_storage.exists() and rag_storage.is_dir()
+ )
if is_valid_kb:
# Auto-register this KB to kb_config.json
diff --git a/deeptutor/services/config/runtime_settings.py b/deeptutor/services/config/runtime_settings.py
index a8f040bd5..32e7cbecf 100644
--- a/deeptutor/services/config/runtime_settings.py
+++ b/deeptutor/services/config/runtime_settings.py
@@ -390,7 +390,9 @@ class RuntimeSettingsService:
def save_document_parsing(self, settings: dict[str, Any]) -> dict[str, Any]:
self._migrate_legacy_document_parsing_file()
- payload = self._normalize_document_parsing({**DEFAULT_DOCUMENT_PARSING_SETTINGS, **settings})
+ payload = self._normalize_document_parsing(
+ {**DEFAULT_DOCUMENT_PARSING_SETTINGS, **settings}
+ )
_atomic_write_json(self.path_for(DOCUMENT_PARSING_SETTINGS_NAME), payload)
return payload
@@ -450,9 +452,7 @@ class RuntimeSettingsService:
return payload
def load_graphrag(self) -> dict[str, Any]:
- return self._load_or_create(
- "graphrag", DEFAULT_GRAPHRAG_SETTINGS, self._normalize_graphrag
- )
+ return self._load_or_create("graphrag", DEFAULT_GRAPHRAG_SETTINGS, self._normalize_graphrag)
def save_graphrag(self, settings: dict[str, Any]) -> dict[str, Any]:
payload = self._normalize_graphrag({**DEFAULT_GRAPHRAG_SETTINGS, **settings})
@@ -460,9 +460,7 @@ class RuntimeSettingsService:
return payload
def load_lightrag(self) -> dict[str, Any]:
- return self._load_or_create(
- "lightrag", DEFAULT_LIGHTRAG_SETTINGS, self._normalize_lightrag
- )
+ return self._load_or_create("lightrag", DEFAULT_LIGHTRAG_SETTINGS, self._normalize_lightrag)
def save_lightrag(self, settings: dict[str, Any]) -> dict[str, Any]:
payload = self._normalize_lightrag({**DEFAULT_LIGHTRAG_SETTINGS, **settings})
diff --git a/deeptutor/services/parsing/engines/docling/config.py b/deeptutor/services/parsing/engines/docling/config.py
index be9b92871..7e9a18eee 100644
--- a/deeptutor/services/parsing/engines/docling/config.py
+++ b/deeptutor/services/parsing/engines/docling/config.py
@@ -21,9 +21,7 @@ class DoclingConfig:
def resolve_docling_config() -> DoclingConfig:
slice_ = (
- load_document_parsing_settings()
- .get("engines", {})
- .get(DOCUMENT_PARSING_ENGINE_DOCLING, {})
+ load_document_parsing_settings().get("engines", {}).get(DOCUMENT_PARSING_ENGINE_DOCLING, {})
)
return DoclingConfig(
do_ocr=bool(slice_.get("do_ocr", False)),
diff --git a/deeptutor/services/parsing/engines/docling/engine.py b/deeptutor/services/parsing/engines/docling/engine.py
index 904d745e5..4ba8f5b0d 100644
--- a/deeptutor/services/parsing/engines/docling/engine.py
+++ b/deeptutor/services/parsing/engines/docling/engine.py
@@ -30,18 +30,24 @@ _MODEL_DIR_HINTS = ("docling", "ds4sd")
def _docling_models_ready() -> bool:
"""Best-effort, fail-closed check for downloaded Docling models."""
artifacts = os.environ.get("DOCLING_ARTIFACTS_PATH")
- if artifacts and Path(artifacts).expanduser().is_dir() and any(
- Path(artifacts).expanduser().iterdir()
+ if (
+ artifacts
+ and Path(artifacts).expanduser().is_dir()
+ and any(Path(artifacts).expanduser().iterdir())
):
return True
hf_home = os.environ.get("HF_HOME")
- hub = (Path(hf_home).expanduser() if hf_home else Path.home() / ".cache" / "huggingface") / "hub"
+ hub = (
+ Path(hf_home).expanduser() if hf_home else Path.home() / ".cache" / "huggingface"
+ ) / "hub"
try:
if hub.is_dir():
for child in hub.iterdir():
name = child.name.lower()
- if child.is_dir() and any(h in name for h in _MODEL_DIR_HINTS) and any(
- child.iterdir()
+ if (
+ child.is_dir()
+ and any(h in name for h in _MODEL_DIR_HINTS)
+ and any(child.iterdir())
):
return True
except Exception:
@@ -127,9 +133,7 @@ class DoclingParser:
pipeline_options.do_ocr = config.do_ocr
pipeline_options.do_table_structure = config.do_table_structure
return DocumentConverter(
- format_options={
- InputFormat.PDF: PdfFormatOption(pipeline_options=pipeline_options)
- }
+ format_options={InputFormat.PDF: PdfFormatOption(pipeline_options=pipeline_options)}
)
except Exception:
return DocumentConverter()
diff --git a/deeptutor/services/parsing/engines/markitdown/engine.py b/deeptutor/services/parsing/engines/markitdown/engine.py
index ce4e16906..f400a2ddb 100644
--- a/deeptutor/services/parsing/engines/markitdown/engine.py
+++ b/deeptutor/services/parsing/engines/markitdown/engine.py
@@ -16,9 +16,24 @@ from .config import MarkItDownConfig, resolve_markitdown_config
# what it can't read and we surface an empty result rather than crash.
_SUPPORTED = frozenset(
{
- ".pdf", ".docx", ".pptx", ".xlsx", ".xls", ".html", ".htm",
- ".csv", ".json", ".xml", ".txt", ".md", ".epub",
- ".png", ".jpg", ".jpeg", ".gif", ".webp",
+ ".pdf",
+ ".docx",
+ ".pptx",
+ ".xlsx",
+ ".xls",
+ ".html",
+ ".htm",
+ ".csv",
+ ".json",
+ ".xml",
+ ".txt",
+ ".md",
+ ".epub",
+ ".png",
+ ".jpg",
+ ".jpeg",
+ ".gif",
+ ".webp",
}
)
@@ -73,11 +88,7 @@ class MarkItDownParser:
except Exception as exc: # noqa: BLE001 - surface as a parser error
raise ParserError(f"markitdown failed to convert {Path(source_path).name}: {exc}")
- text = (
- getattr(result, "text_content", None)
- or getattr(result, "markdown", None)
- or ""
- )
+ text = getattr(result, "text_content", None) or getattr(result, "markdown", None) or ""
stem = Path(source_path).stem
(workdir / f"{stem}.md").write_text(str(text), encoding="utf-8")
diff --git a/deeptutor/services/parsing/engines/mineru/engine.py b/deeptutor/services/parsing/engines/mineru/engine.py
index 9014779a9..53df39250 100644
--- a/deeptutor/services/parsing/engines/mineru/engine.py
+++ b/deeptutor/services/parsing/engines/mineru/engine.py
@@ -37,9 +37,7 @@ class MinerUParser:
return frozenset({".pdf"})
def signature(self, config: MinerUConfig) -> ParserSignature:
- version = (
- f"cloud:{config.api_base_url}" if config.is_cloud else package_version("mineru")
- )
+ version = f"cloud:{config.api_base_url}" if config.is_cloud else package_version("mineru")
return ParserSignature.build(
"mineru",
version,
diff --git a/deeptutor/services/parsing/engines/mineru/local.py b/deeptutor/services/parsing/engines/mineru/local.py
index 67c2500e3..08b580234 100644
--- a/deeptutor/services/parsing/engines/mineru/local.py
+++ b/deeptutor/services/parsing/engines/mineru/local.py
@@ -55,7 +55,7 @@ def check_mineru_installed():
def parse_pdf_with_mineru(
pdf_path: str,
- output_base_dir: str = None,
+ output_base_dir: str | None = None,
on_output: Callable[[str], None] | None = None,
cli_command: str | None = None,
extra_env: dict[str, str] | None = None,
@@ -94,40 +94,40 @@ def parse_pdf_with_mineru(
return False
print(f"โœ“ Detected MinerU command: {mineru_cmd}")
- pdf_path = Path(pdf_path).resolve()
- if not pdf_path.exists():
- print(f"โœ— Error: PDF file does not exist: {pdf_path}")
+ pdf_file = Path(pdf_path).resolve()
+ if not pdf_file.exists():
+ print(f"โœ— Error: PDF file does not exist: {pdf_file}")
return False
- if not pdf_path.suffix.lower() == ".pdf":
- print(f"โœ— Error: File is not PDF format: {pdf_path}")
+ if not pdf_file.suffix.lower() == ".pdf":
+ print(f"โœ— Error: File is not PDF format: {pdf_file}")
return False
# Project root is 3 levels up from deeptutor/tools/question/
project_root = Path(__file__).parent.parent.parent.parent
if output_base_dir is None:
- output_base_dir = project_root / "reference_papers"
+ base_dir = project_root / "reference_papers"
else:
- output_base_dir = Path(output_base_dir)
+ base_dir = Path(output_base_dir)
- output_base_dir.mkdir(parents=True, exist_ok=True)
+ base_dir.mkdir(parents=True, exist_ok=True)
- pdf_name = pdf_path.stem
- output_dir = output_base_dir / pdf_name
+ pdf_name = pdf_file.stem
+ output_dir = base_dir / pdf_name
if output_dir.exists():
print(f"โš ๏ธ Directory already exists, replacing: {output_dir.name}")
shutil.rmtree(output_dir)
- print(f"๐Ÿ“„ PDF file: {pdf_path}")
+ print(f"๐Ÿ“„ PDF file: {pdf_file}")
print(f"๐Ÿ“ Output directory: {output_dir}")
print("โ†’ Starting parsing...")
try:
- temp_output = output_base_dir / "temp_mineru_output"
+ temp_output = base_dir / "temp_mineru_output"
temp_output.mkdir(parents=True, exist_ok=True)
- cmd = [mineru_cmd, "-p", str(pdf_path), "-o", str(temp_output)]
+ cmd = [mineru_cmd, "-p", str(pdf_file), "-o", str(temp_output)]
print(f"๐Ÿ”ง Executing command: {' '.join(cmd)}")
diff --git a/deeptutor/services/rag/index_probe.py b/deeptutor/services/rag/index_probe.py
index e8a9c5eaf..d449f0208 100644
--- a/deeptutor/services/rag/index_probe.py
+++ b/deeptutor/services/rag/index_probe.py
@@ -11,7 +11,7 @@ from __future__ import annotations
from dataclasses import dataclass, field
import json
from pathlib import Path
-from typing import Any, Optional
+from typing import Any
from deeptutor.services.rag.factory import (
DEFAULT_PROVIDER,
@@ -35,7 +35,9 @@ class ProviderIndexProbe:
diagnostics: dict[str, Any] = field(default_factory=dict)
-def inspect_provider_index(provider: str | None, storage_dir: str | Path | None) -> ProviderIndexProbe:
+def inspect_provider_index(
+ provider: str | None, storage_dir: str | Path | None
+) -> ProviderIndexProbe:
"""Inspect one provider storage directory using real provider artifacts."""
resolved = normalize_provider_name(provider)
path = Path(storage_dir) if storage_dir is not None else None
@@ -189,11 +191,7 @@ def _inspect_graphrag(storage_dir: Path) -> ProviderIndexProbe:
from deeptutor.services.rag.pipelines.graphrag import storage
out = storage.output_dir(storage_dir)
- tables = [
- name
- for name in storage.OUTPUT_TABLES
- if (out / f"{name}.parquet").exists()
- ]
+ tables = [name for name in storage.OUTPUT_TABLES if (out / f"{name}.parquet").exists()]
if not storage.has_output(storage_dir):
return ProviderIndexProbe(
GRAPHRAG_PROVIDER,
diff --git a/deeptutor/services/rag/pipelines/graphrag/config.py b/deeptutor/services/rag/pipelines/graphrag/config.py
index 589e85f0c..0b2bc76b2 100644
--- a/deeptutor/services/rag/pipelines/graphrag/config.py
+++ b/deeptutor/services/rag/pipelines/graphrag/config.py
@@ -93,9 +93,7 @@ def query_config_from_settings() -> GraphRagQueryConfig:
return GraphRagQueryConfig(
response_type=str(settings.get("response_type") or "Multiple Paragraphs"),
community_level=int(settings.get("community_level", 2)),
- dynamic_community_selection=bool(
- settings.get("dynamic_community_selection", False)
- ),
+ dynamic_community_selection=bool(settings.get("dynamic_community_selection", False)),
)
except Exception:
return GraphRagQueryConfig()
diff --git a/deeptutor/services/rag/pipelines/lightrag/pipeline.py b/deeptutor/services/rag/pipelines/lightrag/pipeline.py
index 697af8b86..1851bef04 100644
--- a/deeptutor/services/rag/pipelines/lightrag/pipeline.py
+++ b/deeptutor/services/rag/pipelines/lightrag/pipeline.py
@@ -103,9 +103,7 @@ class LightRagPipeline:
file_name=path.name,
doc_id=doc.source_hash or path.stem,
)
- doc_error = storage.document_error(
- Path(rag.working_dir), doc.source_hash or path.stem
- )
+ doc_error = storage.document_error(Path(rag.working_dir), doc.source_hash or path.stem)
if doc_error:
raise RuntimeError(f"{path.name}: {doc_error}")
inserted += 1
@@ -150,9 +148,7 @@ class LightRagPipeline:
kb_dir = resolve_kb_dir(self.kb_base_dir, kb_name)
existing = resolve_storage_dir_for_read(kb_dir, None)
is_update = existing is not None and storage.has_output(existing)
- root_dir = (
- existing if is_update else resolve_storage_dir_for_rebuild(kb_dir, None)
- )
+ root_dir = existing if is_update else resolve_storage_dir_for_rebuild(kb_dir, None)
self.logger.info(
"Adding %d document(s) to LightRAG KB '%s' (update=%s)",
@@ -195,8 +191,7 @@ class LightRagPipeline:
return {
"query": query,
"answer": (
- "This LightRAG knowledge base has no index yet. "
- "Add documents before querying."
+ "This LightRAG knowledge base has no index yet. Add documents before querying."
),
"content": "",
"sources": [],
diff --git a/deeptutor/services/rag/pipelines/pageindex/client.py b/deeptutor/services/rag/pipelines/pageindex/client.py
index 6aac1d34e..7d59a7985 100644
--- a/deeptutor/services/rag/pipelines/pageindex/client.py
+++ b/deeptutor/services/rag/pipelines/pageindex/client.py
@@ -66,9 +66,7 @@ class PageIndexClient:
@staticmethod
def _json(resp: httpx.Response) -> dict[str, Any]:
if resp.status_code >= 400:
- raise PageIndexAPIError(
- f"PageIndex API {resp.status_code}: {resp.text[:300]}"
- )
+ raise PageIndexAPIError(f"PageIndex API {resp.status_code}: {resp.text[:300]}")
try:
data = resp.json()
except Exception as exc: # pragma: no cover - defensive
@@ -114,9 +112,7 @@ class PageIndexClient:
if on_poll is not None:
on_poll(attempt, status or ("ready" if ready else "processing"))
if status in _TERMINAL_FAIL:
- raise PageIndexAPIError(
- f"PageIndex processing failed for {doc_id}: {data!r}"
- )
+ raise PageIndexAPIError(f"PageIndex processing failed for {doc_id}: {data!r}")
if ready or status in _TERMINAL_OK:
return data
await asyncio.sleep(poll_interval)
@@ -179,9 +175,7 @@ class PageIndexClient:
status = str(data.get("status") or "").strip().lower()
nodes = data.get("retrieved_nodes")
if status in _TERMINAL_FAIL:
- raise PageIndexAPIError(
- f"PageIndex retrieval failed for {doc_id}: {data!r}"
- )
+ raise PageIndexAPIError(f"PageIndex retrieval failed for {doc_id}: {data!r}")
if status in _TERMINAL_OK or (isinstance(nodes, list) and nodes):
return nodes if isinstance(nodes, list) else []
await asyncio.sleep(poll_interval)
diff --git a/deeptutor/services/rag/pipelines/pageindex/pipeline.py b/deeptutor/services/rag/pipelines/pageindex/pipeline.py
index 2cceb2819..c358b37d0 100644
--- a/deeptutor/services/rag/pipelines/pageindex/pipeline.py
+++ b/deeptutor/services/rag/pipelines/pageindex/pipeline.py
@@ -96,9 +96,7 @@ class PageIndexPipeline:
storage_dir = resolve_storage_dir_for_rebuild(kb_dir, None)
manifest = storage._empty_manifest()
- self.logger.info(
- "Adding %d document(s) to PageIndex KB '%s'", len(file_paths), kb_name
- )
+ self.logger.info("Adding %d document(s) to PageIndex KB '%s'", len(file_paths), kb_name)
try:
count = await self._ingest(file_paths, manifest, progress_callback)
if count == 0:
diff --git a/deeptutor/services/rag/service.py b/deeptutor/services/rag/service.py
index 55647f1ec..2f5602089 100644
--- a/deeptutor/services/rag/service.py
+++ b/deeptutor/services/rag/service.py
@@ -62,9 +62,7 @@ class RAGService:
def _get_pipeline(self, provider: str):
if provider not in self._pipelines:
- self._pipelines[provider] = get_pipeline(
- name=provider, kb_base_dir=self.kb_base_dir
- )
+ self._pipelines[provider] = get_pipeline(name=provider, kb_base_dir=self.kb_base_dir)
return self._pipelines[provider]
async def initialize(self, kb_name: str, file_paths: List[str], **kwargs) -> bool:
@@ -202,10 +200,14 @@ class RAGService:
message.startswith("Load ") or message.startswith("Init ")
):
return True
- if logger_name.startswith("deeptutor.services.embedding.") and (
- message.startswith("Successfully generated ")
- or message.startswith("Generated ")
- ) and "embedding" in message.lower():
+ if (
+ logger_name.startswith("deeptutor.services.embedding.")
+ and (
+ message.startswith("Successfully generated ")
+ or message.startswith("Generated ")
+ )
+ and "embedding" in message.lower()
+ ):
return True
return False
diff --git a/deeptutor/services/skill/hub.py b/deeptutor/services/skill/hub.py
index 9a13170fc..ff6f583d0 100644
--- a/deeptutor/services/skill/hub.py
+++ b/deeptutor/services/skill/hub.py
@@ -388,9 +388,7 @@ class ClawHubProvider:
detail = str(response.json().get("error") or "")
except ValueError:
detail = response.text[:200]
- raise HubError(
- f"{self.name}: publish failed (HTTP {response.status_code}): {detail}"
- )
+ raise HubError(f"{self.name}: publish failed (HTTP {response.status_code}): {detail}")
try:
return response.json()
except ValueError:
@@ -411,7 +409,9 @@ class ClawHubProvider:
except httpx.HTTPError as exc:
raise HubError(f"{self.name}: request failed: {exc}") from exc
if response.status_code in (401, 403):
- raise HubError(f"{self.name}: not authenticated โ€” run `skill login` or pass a valid token.")
+ raise HubError(
+ f"{self.name}: not authenticated โ€” run `skill login` or pass a valid token."
+ )
if response.status_code >= 400:
raise HubError(f"{self.name}: HTTP {response.status_code}: {response.text[:200]}")
try:
@@ -574,9 +574,7 @@ def get_hub_provider(name: str) -> SkillHubProvider:
raise HubError(f"Hub `{hub}` is missing fetch_cmd in skill_hubs settings.")
return CommandProvider(hub, fetch_cmd=fetch_cmd)
raise HubError(f"Hub `{hub}` has unknown type `{kind}` in skill_hubs settings.")
- raise HubError(
- f"Unknown hub `{hub}`. Configure it in settings/skill_hubs.json."
- )
+ raise HubError(f"Unknown hub `{hub}`. Configure it in settings/skill_hubs.json.")
# โ”€โ”€ orchestration โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
@@ -663,8 +661,21 @@ class SkillPreflight:
# before upload rather than after a server-side ``review`` verdict.
_DANGEROUS_BINARY_EXT = frozenset(
{
- ".exe", ".dll", ".so", ".dylib", ".bin", ".msi", ".dmg", ".pkg",
- ".app", ".bat", ".cmd", ".scr", ".com", ".jar", ".apk",
+ ".exe",
+ ".dll",
+ ".so",
+ ".dylib",
+ ".bin",
+ ".msi",
+ ".dmg",
+ ".pkg",
+ ".app",
+ ".bat",
+ ".cmd",
+ ".scr",
+ ".com",
+ ".jar",
+ ".apk",
}
)
@@ -692,7 +703,9 @@ def preflight_skill_dir(directory: str | Path) -> SkillPreflight:
else:
fm = _read_frontmatter(skill_md)
if not str(fm.get("name") or "").strip():
- warnings.append("SKILL.md frontmatter has no `name:` (display name falls back to slug).")
+ warnings.append(
+ "SKILL.md frontmatter has no `name:` (display name falls back to slug)."
+ )
if not str(fm.get("description") or "").strip():
warnings.append(
"SKILL.md frontmatter has no `description:` โ€” agents rely on it to decide when to use the skill."
diff --git a/deeptutor/tools/media_gen_tool.py b/deeptutor/tools/media_gen_tool.py
index 7ca9be75b..b3272a3c6 100644
--- a/deeptutor/tools/media_gen_tool.py
+++ b/deeptutor/tools/media_gen_tool.py
@@ -170,9 +170,7 @@ class ImagegenTool(BaseTool):
return ToolResult(content=f"Image generation failed: {exc}", success=False)
run_dir = _run_dir(kwargs.get("_workspace_dir"), "imagegen")
- artifacts = _write_media(
- run_dir, images, stem=_slug(prompt, "image"), default_ext="png"
- )
+ artifacts = _write_media(run_dir, images, stem=_slug(prompt, "image"), default_ext="png")
return _artifact_result(
artifacts,
empty_message="Image generation produced no saved files.",
diff --git a/deeptutor_cli/skill.py b/deeptutor_cli/skill.py
index 7d8623a0a..894ad5293 100644
--- a/deeptutor_cli/skill.py
+++ b/deeptutor_cli/skill.py
@@ -173,9 +173,7 @@ def register(app: typer.Typer) -> None:
provider: str | None = typer.Argument(
None, help="็™ปๅฝ•ๆ–นๅผ๏ผšgithub | google๏ผˆไธๅกซๅˆ™ๅœจ็ปˆ็ซฏ่ฏข้—ฎ๏ผ‰ใ€‚"
),
- hub: str | None = typer.Option(
- None, "--hub", help="Target hub (default from settings)."
- ),
+ hub: str | None = typer.Option(None, "--hub", help="Target hub (default from settings)."),
no_browser: bool = typer.Option(
False, "--no-browser", help="ไธ่‡ชๅŠจๆ‰“ๅผ€ๆต่งˆๅ™จ๏ผŒๅชๆ‰“ๅฐๆŽˆๆƒ้“พๆŽฅใ€‚"
),
@@ -196,9 +194,7 @@ def register(app: typer.Typer) -> None:
raise typer.Exit(code=1)
base_url = getattr(provider_obj, "base_url", None)
if not base_url:
- console.print(
- f"[bold red]Hub `{target_hub}` ไธๆ”ฏๆŒ็ฝ‘้กต็™ปๅฝ•๏ผˆ้ž clawhub ๅž‹๏ผ‰ใ€‚[/]"
- )
+ console.print(f"[bold red]Hub `{target_hub}` ไธๆ”ฏๆŒ็ฝ‘้กต็™ปๅฝ•๏ผˆ้ž clawhub ๅž‹๏ผ‰ใ€‚[/]")
raise typer.Exit(code=1)
origin = hub_origin_from_base(str(base_url))
@@ -231,9 +227,7 @@ def register(app: typer.Typer) -> None:
@app.command("logout")
def skill_logout(
- hub: str | None = typer.Option(
- None, "--hub", help="Target hub (default from settings)."
- ),
+ hub: str | None = typer.Option(None, "--hub", help="Target hub (default from settings)."),
) -> None:
"""ๆธ…้™คๆœฌๅœฐไฟๅญ˜็š„ๆŸไธช hub ็™ปๅฝ•ไปค็‰Œใ€‚"""
from deeptutor.services.skill import credentials
@@ -257,9 +251,7 @@ def register(app: typer.Typer) -> None:
track: str | None = typer.Option(
None, "--track", help="Track (skips the track prompt when set)."
),
- hub: str | None = typer.Option(
- None, "--hub", help="Target hub (default from settings)."
- ),
+ hub: str | None = typer.Option(None, "--hub", help="Target hub (default from settings)."),
token: str | None = typer.Option(
None, "--token", help="Publish token; else env / `deeptutor skills login`."
),
@@ -364,8 +356,7 @@ def register(app: typer.Typer) -> None:
raise typer.Exit(code=1)
console.print(
- f"[bold green]Published[/] [bold]{outcome.slug}@{outcome.version}[/] "
- f"โ†’ {outcome.hub}"
+ f"[bold green]Published[/] [bold]{outcome.slug}@{outcome.version}[/] โ†’ {outcome.hub}"
)
console.print(
f" [dim]install with:[/] deeptutor skill install {outcome.hub}:{outcome.slug}"
@@ -376,9 +367,7 @@ def register(app: typer.Typer) -> None:
directory: str | None = typer.Argument(
None, help="ๆ–ฐ็‰ˆๆœฌ็š„ skill ็›ฎๅฝ•๏ผˆๅ‡็บงๆ–ฐ็‰ˆๆœฌๆ—ถ็”จ๏ผ›ๅ›ž้€€ไธ้œ€่ฆ๏ผ‰ใ€‚"
),
- hub: str | None = typer.Option(
- None, "--hub", help="Target hub (default from settings)."
- ),
+ hub: str | None = typer.Option(None, "--hub", help="Target hub (default from settings)."),
token: str | None = typer.Option(
None, "--token", help="Publish token; else env / `deeptutor skills login`."
),
@@ -456,9 +445,7 @@ def register(app: typer.Typer) -> None:
if len([v for v in versions if v != current]) == 0:
console.print(f"[dim]{chosen_slug} ๅชๆœ‰ไธ€ไธช็‰ˆๆœฌ๏ผˆ{current}๏ผ‰๏ผŒๆ— ๆณ•ๅ›ž้€€ใ€‚[/]")
raise typer.Exit(code=0)
- version_opts = [
- Option(v, "โ† ๅฝ“ๅ‰ latest" if v == current else "", v) for v in versions
- ]
+ version_opts = [Option(v, "โ† ๅฝ“ๅ‰ latest" if v == current else "", v) for v in versions]
target_version = select_one(version_opts, "ๅ›ž้€€ latest ๅˆฐๅ“ชไธช็‰ˆๆœฌ๏ผŸ")
if target_version == current:
console.print("[dim]ๅทฒๆ˜ฏๅฝ“ๅ‰ latest๏ผŒๆ— ้œ€ๅ›ž้€€ใ€‚[/]")
@@ -469,8 +456,12 @@ def register(app: typer.Typer) -> None:
):
console.print("[dim]ๅทฒๅ–ๆถˆใ€‚[/]")
raise typer.Exit(code=0)
+ tag_setter = getattr(provider, "set_dist_tag", None)
+ if not callable(tag_setter):
+ console.print(f"[bold red]Hub `{target_hub}` ไธๆ”ฏๆŒๅ›ž้€€ latestใ€‚[/]")
+ raise typer.Exit(code=1)
try:
- provider.set_dist_tag(chosen_slug, version=target_version, token=tok)
+ tag_setter(chosen_slug, version=target_version, token=tok)
except HubError as exc:
console.print(f"[bold red]ๅ›ž้€€ๅคฑ่ดฅ๏ผš[/] {exc}")
raise typer.Exit(code=1)
diff --git a/deeptutor_cli/skill_prompts.py b/deeptutor_cli/skill_prompts.py
index 262d30272..0c8dd7607 100644
--- a/deeptutor_cli/skill_prompts.py
+++ b/deeptutor_cli/skill_prompts.py
@@ -170,16 +170,22 @@ def collect_classification(defaults: dict[str, Any], *, locale: str = "zh") -> d
)
domains = select_domains(preselected=_as_list(defaults, "domains"), locale=locale)
stages = select_many(
- STAGE_OPTIONS, "ๅญฆๆฎต stages โ€” ๅฏ้€‰๏ผ›็ฉบ=ๅ…จๅญฆๆฎต้€š็”จ",
- preselected=_as_list(defaults, "stages"), locale=locale,
+ STAGE_OPTIONS,
+ "ๅญฆๆฎต stages โ€” ๅฏ้€‰๏ผ›็ฉบ=ๅ…จๅญฆๆฎต้€š็”จ",
+ preselected=_as_list(defaults, "stages"),
+ locale=locale,
)
forms = select_many(
- FORM_OPTIONS, "ๅฝขๅผ forms โ€” ๅฏ้€‰๏ผ›ๆŠ€่ƒฝๅฆ‚ไฝ•ไธŽ็”จๆˆทไบคไบ’",
- preselected=_as_list(defaults, "forms"), locale=locale,
+ FORM_OPTIONS,
+ "ๅฝขๅผ forms โ€” ๅฏ้€‰๏ผ›ๆŠ€่ƒฝๅฆ‚ไฝ•ไธŽ็”จๆˆทไบคไบ’",
+ preselected=_as_list(defaults, "forms"),
+ locale=locale,
)
audiences = select_many(
- AUDIENCE_OPTIONS, "ๅ—ไผ— audiences โ€” ๅฏ้€‰๏ผ›็ฉบ=้ขๅ‘ๅญฆไน ่€…",
- preselected=_as_list(defaults, "audiences"), locale=locale,
+ AUDIENCE_OPTIONS,
+ "ๅ—ไผ— audiences โ€” ๅฏ้€‰๏ผ›็ฉบ=้ขๅ‘ๅญฆไน ่€…",
+ preselected=_as_list(defaults, "audiences"),
+ locale=locale,
)
tags_default = ",".join(_as_list(defaults, "tags"))
tags = typer.prompt(
diff --git a/tests/agents/chat/test_agent_loop.py b/tests/agents/chat/test_agent_loop.py
index 49d8e1b17..59278a6a3 100644
--- a/tests/agents/chat/test_agent_loop.py
+++ b/tests/agents/chat/test_agent_loop.py
@@ -450,9 +450,7 @@ async def test_midloop_llm_failure_salvages_turn_with_forced_finish(
class _Completions:
async def create(self, **kwargs):
parent.call_count += 1
- parent.calls.append(
- {**kwargs, "messages": list(kwargs.get("messages") or [])}
- )
+ parent.calls.append({**kwargs, "messages": list(kwargs.get("messages") or [])})
if parent.call_count == 1:
return _async_llm_stream(
[
diff --git a/tests/api/test_imports.py b/tests/api/test_imports.py
index 999b36ff9..177a8f949 100644
--- a/tests/api/test_imports.py
+++ b/tests/api/test_imports.py
@@ -68,9 +68,7 @@ def test_source_validation_rejects_unknown() -> None:
def test_source_is_normalized_lowercase() -> None:
- assert ChatHistoryImportRequest(source="Claude_Code", sessions=[]).source == (
- "claude_code"
- )
+ assert ChatHistoryImportRequest(source="Claude_Code", sessions=[]).source == ("claude_code")
def test_import_endpoint_persists_and_dedups(store: SQLiteSessionStore) -> None:
@@ -109,9 +107,7 @@ def test_empty_content_messages_are_dropped(store: SQLiteSessionStore) -> None:
def test_session_with_only_empty_messages_is_skipped(
store: SQLiteSessionStore,
) -> None:
- res = asyncio.run(
- import_chat_history(_payload(messages=[{"role": "user", "content": " "}]))
- )
+ res = asyncio.run(import_chat_history(_payload(messages=[{"role": "user", "content": " "}])))
assert res["imported"] == 0
assert res["skipped"] == 1
@@ -137,9 +133,7 @@ def test_reimport_backfills_agent_attribution(store: SQLiteSessionStore) -> None
# Re-syncing under an agent backfills attribution without duplicating the
# session or re-adding messages.
- again = asyncio.run(
- import_chat_history(_payload(agent_id="codex-a1", agent_name="Research"))
- )
+ again = asyncio.run(import_chat_history(_payload(agent_id="codex-a1", agent_name="Research")))
assert again["imported"] == 0
assert again["skipped"] == 1
listed = asyncio.run(list_imported_chat_history(limit=50, offset=0))
diff --git a/tests/api/test_knowledge_router.py b/tests/api/test_knowledge_router.py
index f7bdac025..b815f0fc5 100644
--- a/tests/api/test_knowledge_router.py
+++ b/tests/api/test_knowledge_router.py
@@ -226,9 +226,7 @@ def test_create_preserves_known_nondefault_provider(monkeypatch, tmp_path: Path)
monkeypatch.setattr(knowledge_router_module, "KnowledgeBaseInitializer", _FakeInitializer)
monkeypatch.setattr(knowledge_router_module, "_kb_base_dir", tmp_path / "knowledge_bases")
- pageindex_config = importlib.import_module(
- "deeptutor.services.rag.pipelines.pageindex.config"
- )
+ pageindex_config = importlib.import_module("deeptutor.services.rag.pipelines.pageindex.config")
monkeypatch.setattr(pageindex_config, "is_pageindex_configured", lambda: True)
async def _noop_init_task(*_args, **_kwargs):
@@ -874,9 +872,7 @@ def test_update_config_preserves_known_provider() -> None:
assert fake_service.config.get("rag_provider") == "pageindex"
-def test_update_config_rejects_provider_change_for_ready_index(
- monkeypatch, tmp_path: Path
-) -> None:
+def test_update_config_rejects_provider_change_for_ready_index(monkeypatch, tmp_path: Path) -> None:
kb_dir = tmp_path / "demo"
kb_dir.mkdir(parents=True)
_write_ready_llamaindex_version(kb_dir)
diff --git a/tests/api/test_partners_router.py b/tests/api/test_partners_router.py
index b96da8ed9..671bac928 100644
--- a/tests/api/test_partners_router.py
+++ b/tests/api/test_partners_router.py
@@ -236,9 +236,7 @@ class TestChatAttachments:
assert _create(client, start=False).status_code == 200
data = yaml.safe_load(
- (isolated_root / "partners" / "ada" / "config.yaml").read_text(
- encoding="utf-8"
- )
+ (isolated_root / "partners" / "ada" / "config.yaml").read_text(encoding="utf-8")
)
assert data["auto_start"] is False
diff --git a/tests/capabilities/test_explore_context_capability.py b/tests/capabilities/test_explore_context_capability.py
index ca9289ae0..67d74f80f 100644
--- a/tests/capabilities/test_explore_context_capability.py
+++ b/tests/capabilities/test_explore_context_capability.py
@@ -76,9 +76,7 @@ def _fake_stream(briefing_chunks: list[str]):
@pytest.fixture
def _force_single_pass(monkeypatch: pytest.MonkeyPatch) -> None:
"""Pin the explorer onto its single-pass (llm_stream) fallback path."""
- monkeypatch.setattr(
- explorer_mod, "can_use_native_tool_calling", lambda **_kwargs: False
- )
+ monkeypatch.setattr(explorer_mod, "can_use_native_tool_calling", lambda **_kwargs: False)
@pytest.mark.asyncio
@@ -238,9 +236,13 @@ async def test_loop_reads_source_then_writes_investigation(
investigation grounded in the loaded full text."""
rounds = [
# Round 0: ask to read the attached transcript.
- [_FakeChunk(_FakeDelta(tool_calls=[
- _FakeToolCall(0, "call_1", "read_source", '{"source_id": "hs-x"}')
- ]))],
+ [
+ _FakeChunk(
+ _FakeDelta(
+ tool_calls=[_FakeToolCall(0, "call_1", "read_source", '{"source_id": "hs-x"}')]
+ )
+ )
+ ],
# Round 1: no tool calls โ†’ this text is the investigation.
[_FakeChunk(_FakeDelta(content="The other agent rewrote the nav and shipped it."))],
]
diff --git a/tests/capabilities/test_solve_capability.py b/tests/capabilities/test_solve_capability.py
index 8cb97f294..10e19ce77 100644
--- a/tests/capabilities/test_solve_capability.py
+++ b/tests/capabilities/test_solve_capability.py
@@ -6,7 +6,6 @@ import json
import pytest
-from deeptutor.core.context import UnifiedContext
from deeptutor.capabilities.solve import SOLVE_TOOL_NAMES, SolveLoopCapability
from deeptutor.capabilities.solve.session import SolveSession, get_session
from deeptutor.capabilities.solve.tools import (
@@ -14,6 +13,7 @@ from deeptutor.capabilities.solve.tools import (
SolvePlanTool,
SolveReplanTool,
)
+from deeptutor.core.context import UnifiedContext
def _solve_context(session_id: str = "t1") -> UnifiedContext:
@@ -99,7 +99,9 @@ async def test_replan_is_budget_limited() -> None:
await SolvePlanTool().execute(_solve_session_id=sid, analysis="a", steps=[{"goal": "g1"}])
get_session(sid).max_replans = 1
- ok = await SolveReplanTool().execute(_solve_session_id=sid, reason="wrong", steps=[{"goal": "g2"}])
+ ok = await SolveReplanTool().execute(
+ _solve_session_id=sid, reason="wrong", steps=[{"goal": "g2"}]
+ )
assert ok.success is True
refused = await SolveReplanTool().execute(
_solve_session_id=sid, reason="again", steps=[{"goal": "g3"}]
diff --git a/tests/core/test_capabilities_runtime.py b/tests/core/test_capabilities_runtime.py
index 4da92593b..5a876eb03 100644
--- a/tests/core/test_capabilities_runtime.py
+++ b/tests/core/test_capabilities_runtime.py
@@ -10,12 +10,12 @@ from typing import Any
import pytest
-import deeptutor.agents.visualize.pipeline as visualize_pipeline
from deeptutor.agents.chat.capability import ChatCapability
from deeptutor.agents.question.capability import DeepQuestionCapability
from deeptutor.agents.research.capability import DeepResearchCapability
-from deeptutor.capabilities.solve.capability import DeepSolveCapability
from deeptutor.agents.visualize.capability import VisualizeCapability
+import deeptutor.agents.visualize.pipeline as visualize_pipeline
+from deeptutor.capabilities.solve.capability import DeepSolveCapability
from deeptutor.core.context import Attachment, UnifiedContext
from deeptutor.core.stream import StreamEvent, StreamEventType
from deeptutor.core.stream_bus import StreamBus
@@ -130,6 +130,7 @@ async def test_chat_capability_streams_content_and_geogebra_context(
)
assert "GGB commands" in captured["process"]["message"]
+
@pytest.mark.asyncio
async def test_deep_solve_capability_runs_chat_loop_in_solve_mode(
monkeypatch: pytest.MonkeyPatch,
@@ -149,9 +150,7 @@ async def test_deep_solve_capability_runs_chat_loop_in_solve_mode(
captured["attachments"] = list(context.attachments or [])
await stream.content("final solution", source="chat", stage="responding")
- monkeypatch.setattr(
- "deeptutor.capabilities.solve.capability.AgenticChatPipeline", FakePipeline
- )
+ monkeypatch.setattr("deeptutor.capabilities.solve.capability.AgenticChatPipeline", FakePipeline)
context = UnifiedContext(
user_message="solve x^2=4",
@@ -281,8 +280,8 @@ async def test_deep_research_capability_delegates_to_pipeline(
in the capability module so we can assert what it was called with
without spinning up real LLM I/O.
"""
- import deeptutor.agents.research.request_config # noqa: F401
import deeptutor.agents.research.capability as deep_research_mod
+ import deeptutor.agents.research.request_config # noqa: F401
captured: dict[str, Any] = {}
diff --git a/tests/knowledge/test_document_adder_provider.py b/tests/knowledge/test_document_adder_provider.py
index 663077e39..737f571fe 100644
--- a/tests/knowledge/test_document_adder_provider.py
+++ b/tests/knowledge/test_document_adder_provider.py
@@ -12,9 +12,7 @@ def _write_provider_version(kb_dir: Path, provider: str) -> None:
version_dir.mkdir(parents=True)
if provider == "pageindex":
(version_dir / "pageindex_docs.json").write_text(
- json.dumps(
- {"provider": "pageindex", "docs": {"doc.pdf": {"doc_id": "doc-1"}}}
- ),
+ json.dumps({"provider": "pageindex", "docs": {"doc.pdf": {"doc_id": "doc-1"}}}),
encoding="utf-8",
)
elif provider == "graphrag":
@@ -44,11 +42,7 @@ def test_document_adder_reads_provider_from_kb_config_when_metadata_missing(
_write_provider_version(kb_dir, "pageindex")
(tmp_path / "kb_config.json").write_text(
json.dumps(
- {
- "knowledge_bases": {
- "page-kb": {"path": "page-kb", "rag_provider": "pageindex"}
- }
- }
+ {"knowledge_bases": {"page-kb": {"path": "page-kb", "rag_provider": "pageindex"}}}
),
encoding="utf-8",
)
diff --git a/tests/services/config/test_graphrag_lightrag_settings.py b/tests/services/config/test_graphrag_lightrag_settings.py
index 72656f16e..b6725cf1a 100644
--- a/tests/services/config/test_graphrag_lightrag_settings.py
+++ b/tests/services/config/test_graphrag_lightrag_settings.py
@@ -15,7 +15,11 @@ def test_graphrag_defaults_and_clamp(tmp_path: Path) -> None:
assert defaults["dynamic_community_selection"] is False
saved = svc.save_graphrag(
- {"community_level": 99, "dynamic_community_selection": "yes", "response_type": " Single Paragraph "}
+ {
+ "community_level": 99,
+ "dynamic_community_selection": "yes",
+ "response_type": " Single Paragraph ",
+ }
)
assert saved["community_level"] == 5 # clamped to max
assert saved["dynamic_community_selection"] is True
diff --git a/tests/services/config/test_llamaindex_settings.py b/tests/services/config/test_llamaindex_settings.py
index b2a988b6e..86cd1133e 100644
--- a/tests/services/config/test_llamaindex_settings.py
+++ b/tests/services/config/test_llamaindex_settings.py
@@ -55,8 +55,6 @@ def test_llamaindex_profile_env_override(tmp_path: Path) -> None:
svc = RuntimeSettingsService(tmp_path, process_env={})
svc.save_llamaindex({"retrieval_profile": "vector"})
- overridden = RuntimeSettingsService(
- tmp_path, process_env={"RAG_RETRIEVAL_PROFILE": "hybrid"}
- )
+ overridden = RuntimeSettingsService(tmp_path, process_env={"RAG_RETRIEVAL_PROFILE": "hybrid"})
loaded = overridden.load_llamaindex(include_process_overrides=True)
assert loaded["retrieval_profile"] == "hybrid"
diff --git a/tests/services/config/test_runtime_settings.py b/tests/services/config/test_runtime_settings.py
index 51d637b7d..d0dcc8879 100644
--- a/tests/services/config/test_runtime_settings.py
+++ b/tests/services/config/test_runtime_settings.py
@@ -343,9 +343,10 @@ def test_document_parsing_fresh_default_engine_is_text_only(tmp_path: Path) -> N
def test_mineru_allow_local_model_download_default_off_and_env(tmp_path: Path) -> None:
service = RuntimeSettingsService(tmp_path / "settings", process_env={})
assert service.load_mineru()["allow_local_model_download"] is False
- assert service.save_mineru({"allow_local_model_download": True})[
- "allow_local_model_download"
- ] is True
+ assert (
+ service.save_mineru({"allow_local_model_download": True})["allow_local_model_download"]
+ is True
+ )
env_service = RuntimeSettingsService(
tmp_path / "settings2",
diff --git a/tests/services/memory/test_snapshot_adapters.py b/tests/services/memory/test_snapshot_adapters.py
index 2fb9d0d1f..f8c94e553 100644
--- a/tests/services/memory/test_snapshot_adapters.py
+++ b/tests/services/memory/test_snapshot_adapters.py
@@ -109,9 +109,7 @@ def test_missing_config_uses_dir_id_as_name(partner_tree: Path) -> None:
assert entities[0].metadata["partner_name"] == "bot3"
-def test_non_admin_scope_sees_no_partners(
- tmp_path: Path, monkeypatch: pytest.MonkeyPatch
-) -> None:
+def test_non_admin_scope_sees_no_partners(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
"""A regular user's memory view must not surface admin partner chats."""
admin_root = tmp_path / "admin"
user_root = tmp_path / "users" / "u1" / "workspace"
diff --git a/tests/services/rag/test_lightrag_pipeline.py b/tests/services/rag/test_lightrag_pipeline.py
index eb48c600c..bbfd2463f 100644
--- a/tests/services/rag/test_lightrag_pipeline.py
+++ b/tests/services/rag/test_lightrag_pipeline.py
@@ -230,9 +230,7 @@ def test_lightrag_vision_adapter_preserves_messages(monkeypatch) -> None:
assert result == "ok"
assert captured["prompt"] == ""
assert captured["image_data"] == "abc123"
- assert captured["messages"] == [
- {"role": "user", "content": [{"type": "text", "text": "hi"}]}
- ]
+ assert captured["messages"] == [{"role": "user", "content": [{"type": "text", "text": "hi"}]}]
def test_lightrag_query_initializes_raganything_before_aquery(monkeypatch) -> None:
diff --git a/tests/services/rag/test_pageindex_pipeline.py b/tests/services/rag/test_pageindex_pipeline.py
index 86667061f..9d3bf066d 100644
--- a/tests/services/rag/test_pageindex_pipeline.py
+++ b/tests/services/rag/test_pageindex_pipeline.py
@@ -148,8 +148,12 @@ def test_delete_drops_cloud_docs_and_local_dir(tmp_path) -> None:
def test_factory_dispatches_by_provider(tmp_path) -> None:
- assert type(get_pipeline("pageindex", kb_base_dir=str(tmp_path))).__name__ == "PageIndexPipeline"
- assert type(get_pipeline("llamaindex", kb_base_dir=str(tmp_path))).__name__ == "LlamaIndexPipeline"
+ assert (
+ type(get_pipeline("pageindex", kb_base_dir=str(tmp_path))).__name__ == "PageIndexPipeline"
+ )
+ assert (
+ type(get_pipeline("llamaindex", kb_base_dir=str(tmp_path))).__name__ == "LlamaIndexPipeline"
+ )
# Legacy / unknown providers fall back to the default engine.
assert (
type(get_pipeline("raganything", kb_base_dir=str(tmp_path))).__name__
diff --git a/tests/services/rag/test_rag_pipelines.py b/tests/services/rag/test_rag_pipelines.py
index 7f8618482..9c4ed2455 100644
--- a/tests/services/rag/test_rag_pipelines.py
+++ b/tests/services/rag/test_rag_pipelines.py
@@ -9,8 +9,8 @@ from typing import Any, Dict
import pytest
-from deeptutor.services.rag.service import RAGService
import deeptutor.services.rag.service as rag_service_module
+from deeptutor.services.rag.service import RAGService
from deeptutor.services.rag.smart_retriever import SmartRetriever
@@ -168,9 +168,7 @@ async def test_search_forwards_lightrag_native_logs_to_event_sink(
lightrag_logger.setLevel(original_level)
raw_logs = [
- (message, metadata)
- for event_type, message, metadata in events
- if event_type == "raw_log"
+ (message, metadata) for event_type, message, metadata in events if event_type == "raw_log"
]
assert any(
message == "Final context: 14 entities, 13 relations, 1 chunks"
@@ -266,11 +264,7 @@ async def test_search_filters_noisy_vector_and_embedding_logs(
lightrag_logger.setLevel(original_lightrag_level)
lightrag_logger.propagate = original_lightrag_propagate
- raw_messages = [
- message
- for event_type, message, _metadata in events
- if event_type == "raw_log"
- ]
+ raw_messages = [message for event_type, message, _metadata in events if event_type == "raw_log"]
assert "Raw search results: 14 entities, 13 relations, 0 vector chunks" in raw_messages
assert not any(message.startswith("Load ") for message in raw_messages)
assert not any(message.startswith("Init ") for message in raw_messages)
diff --git a/tests/services/session/test_import_session.py b/tests/services/session/test_import_session.py
index 119cad1d6..9aa65cd26 100644
--- a/tests/services/session/test_import_session.py
+++ b/tests/services/session/test_import_session.py
@@ -40,9 +40,7 @@ def _import(store: SQLiteSessionStore, ext: str = "abc", title: str = "Imported"
def test_make_imported_session_id_prefix_and_sanitize() -> None:
- assert make_imported_session_id("claude_code", "uuid-1").startswith(
- "imported_claude_code_"
- )
+ assert make_imported_session_id("claude_code", "uuid-1").startswith("imported_claude_code_")
unsafe = make_imported_session_id("x/y", "a/b.c")
assert unsafe.startswith("imported_")
assert "/" not in unsafe and "." not in unsafe
diff --git a/tests/services/skill/test_skill_login.py b/tests/services/skill/test_skill_login.py
index ebd4a3efb..865805220 100644
--- a/tests/services/skill/test_skill_login.py
+++ b/tests/services/skill/test_skill_login.py
@@ -72,8 +72,10 @@ def test_run_login_captures_token_and_rejects_bad_state() -> None:
assert thread.is_alive() # still waiting for a valid callback
# Correct state โ†’ token captured.
- good = base + "?" + urllib.parse.urlencode(
- {"state": state, "token": "eduhub_abc", "login": "alice"}
+ good = (
+ base
+ + "?"
+ + urllib.parse.urlencode({"state": state, "token": "eduhub_abc", "login": "alice"})
)
with urllib.request.urlopen(good, timeout=5) as resp:
assert resp.status == 200
diff --git a/tests/services/test_media_gen.py b/tests/services/test_media_gen.py
index 2c1fcc3c4..39d611c66 100644
--- a/tests/services/test_media_gen.py
+++ b/tests/services/test_media_gen.py
@@ -42,7 +42,9 @@ def _patch_http(
captured: dict[str, Any] = {"posts": [], "gets": []}
async def fake_post(self: httpx.AsyncClient, url: str, **kwargs: Any) -> httpx.Response:
- captured["posts"].append({"url": url, "json": kwargs.get("json"), "headers": kwargs.get("headers")})
+ captured["posts"].append(
+ {"url": url, "json": kwargs.get("json"), "headers": kwargs.get("headers")}
+ )
resp = post(url, kwargs) if callable(post) else post
resp.request = httpx.Request("POST", url)
return resp
@@ -212,9 +214,7 @@ def _media_catalog() -> dict[str, Any]:
"binding": "volcengine",
"base_url": "",
"api_key": "ark-key",
- "models": [
- {"id": "m1", "model": "doubao-seedream-3", "size": "1024x1024"}
- ],
+ "models": [{"id": "m1", "model": "doubao-seedream-3", "size": "1024x1024"}],
}
],
},
@@ -227,7 +227,9 @@ def _media_catalog() -> dict[str, Any]:
"binding": "volcengine",
"base_url": "",
"api_key": "ark-key",
- "models": [{"id": "m2", "model": "doubao-seedance-1", "aspect_ratio": "9:16"}],
+ "models": [
+ {"id": "m2", "model": "doubao-seedance-1", "aspect_ratio": "9:16"}
+ ],
}
],
},
@@ -288,7 +290,9 @@ def test_resolve_imagegen_config_raises_without_model() -> None:
@pytest.mark.asyncio
async def test_generate_image_facade(monkeypatch: pytest.MonkeyPatch) -> None:
payload = base64.b64encode(b"IMG").decode("ascii")
- captured = _patch_http(monkeypatch, post=httpx.Response(200, json={"data": [{"b64_json": payload}]}))
+ captured = _patch_http(
+ monkeypatch, post=httpx.Response(200, json={"data": [{"b64_json": payload}]})
+ )
images = await generate_image("a tree", catalog=_media_catalog(), size="512x512")
assert images == [(b"IMG", "image/png")]
assert captured["posts"][0]["json"]["size"] == "512x512"
diff --git a/web/app/(utility)/settings/capabilities/page.tsx b/web/app/(utility)/settings/capabilities/page.tsx
index a03b3cdbe..eaf51f00f 100644
--- a/web/app/(utility)/settings/capabilities/page.tsx
+++ b/web/app/(utility)/settings/capabilities/page.tsx
@@ -284,9 +284,7 @@ export default function CapabilitiesSettingsPage() {
<div data-tour="tour-capabilities">
<SettingsPageHeader
title={t("Capabilities")}
- description={t(
- "Per-capability LLM parameters and runtime knobs.",
- )}
+ description={t("Per-capability LLM parameters and runtime knobs.")}
/>
<SettingSection
diff --git a/web/app/(utility)/settings/document-parsing/page.tsx b/web/app/(utility)/settings/document-parsing/page.tsx
index 14bed7bb4..61c8a6d4b 100644
--- a/web/app/(utility)/settings/document-parsing/page.tsx
+++ b/web/app/(utility)/settings/document-parsing/page.tsx
@@ -236,7 +236,11 @@ function TextOnlyPanel() {
>
<SettingRow
title={t("Model status")}
- control={<ReadinessBadge readiness={{ ready: true, reason: "ready", message: "" }} />}
+ control={
+ <ReadinessBadge
+ readiness={{ ready: true, reason: "ready", message: "" }}
+ />
+ }
/>
</SettingSection>
);
@@ -300,7 +304,10 @@ function DoclingPanel({
"Structured conversion of PDF/Office/HTML/images. Downloads layout/table models on first run.",
)}
>
- <SettingRow title={t("Model status")} control={<ReadinessBadge readiness={readiness} />} />
+ <SettingRow
+ title={t("Model status")}
+ control={<ReadinessBadge readiness={readiness} />}
+ />
<SettingRow
title={t("Allow automatic model download")}
description={t(
diff --git a/web/components/chat/HistorySessionPicker.tsx b/web/components/chat/HistorySessionPicker.tsx
index 6e715a58a..595ae95a7 100644
--- a/web/components/chat/HistorySessionPicker.tsx
+++ b/web/components/chat/HistorySessionPicker.tsx
@@ -156,7 +156,8 @@ export default function HistorySessionPicker({
? sessions.find((s) => sessionKey(s) === activeId)
: undefined;
const activeDetail = activeId ? details[activeId] : undefined;
- const activeLoading = previewLoadingId !== null && previewLoadingId === activeId;
+ const activeLoading =
+ previewLoadingId !== null && previewLoadingId === activeId;
return (
<PickerShell
diff --git a/web/components/chat/MyAgentsPicker.tsx b/web/components/chat/MyAgentsPicker.tsx
index a222b29b6..32f5edf59 100644
--- a/web/components/chat/MyAgentsPicker.tsx
+++ b/web/components/chat/MyAgentsPicker.tsx
@@ -192,7 +192,9 @@ export default function MyAgentsPicker({
if (activeAgent !== ALL && ownerKey !== activeAgent) continue;
if (keyword) {
const title = String(session.title || "").toLowerCase();
- const last = normalizeMessageContent(session.last_message).toLowerCase();
+ const last = normalizeMessageContent(
+ session.last_message,
+ ).toLowerCase();
if (!title.includes(keyword) && !last.includes(keyword)) continue;
}
const meta = readImportMeta(session);
@@ -357,7 +359,10 @@ export default function MyAgentsPicker({
<Loader2 className="h-5 w-5 animate-spin text-[var(--muted-foreground)]" />
</div>
) : groups.length ? (
- <div key={activeAgent} className="animate-fade-in divide-y divide-[var(--border)]">
+ <div
+ key={activeAgent}
+ className="animate-fade-in divide-y divide-[var(--border)]"
+ >
{groups.map((group) => {
const ids = group.sessions.map((s) => s.session_id || s.id);
const selectedInGroup = ids.filter((id) =>
@@ -543,7 +548,11 @@ function PreviewPane({
onBack,
onToggleSelect,
}: {
- preview: { session: SessionSummary; detail: SessionDetail | null; loading: boolean };
+ preview: {
+ session: SessionSummary;
+ detail: SessionDetail | null;
+ loading: boolean;
+ };
selected: boolean;
onBack: () => void;
onToggleSelect: () => void;
diff --git a/web/components/chat/home/ChatComposer.tsx b/web/components/chat/home/ChatComposer.tsx
index d15a83d6c..6e85550fe 100644
--- a/web/components/chat/home/ChatComposer.tsx
+++ b/web/components/chat/home/ChatComposer.tsx
@@ -125,7 +125,11 @@ function CapMenuItem({
</div>
</div>
{selected && (
- <Check size={14} strokeWidth={2} className="shrink-0 text-[var(--primary)]" />
+ <Check
+ size={14}
+ strokeWidth={2}
+ className="shrink-0 text-[var(--primary)]"
+ />
)}
</button>
);
@@ -771,7 +775,9 @@ export default memo(function ChatComposer({
/>
))}
{(() => {
- const loopCaps = capabilities.filter((cap) => cap.loopEngine);
+ const loopCaps = capabilities.filter(
+ (cap) => cap.loopEngine,
+ );
if (loopCaps.length === 0) return null;
const loopSelected = loopCaps.some(
(cap) => cap.value === activeCap.value,
@@ -784,7 +790,10 @@ export default memo(function ChatComposer({
onFocus={() => setMoreCapsOpen(true)}
onBlur={(event) => {
const next = event.relatedTarget;
- if (!next || !event.currentTarget.contains(next as Node)) {
+ if (
+ !next ||
+ !event.currentTarget.contains(next as Node)
+ ) {
setMoreCapsOpen(false);
}
}}
@@ -828,7 +837,9 @@ export default memo(function ChatComposer({
click/focus also open it for touch and keyboard. */}
<div
className={`absolute bottom-0 left-full z-50 pl-1.5 transition-opacity duration-150 ${
- moreCapsOpen ? "visible opacity-100" : "invisible opacity-0"
+ moreCapsOpen
+ ? "visible opacity-100"
+ : "invisible opacity-0"
}`}
>
<div className="w-[240px] overflow-hidden rounded-xl border border-[var(--border)] bg-[var(--popover)] py-1 shadow-lg backdrop-blur-md">
@@ -893,7 +904,8 @@ export default memo(function ChatComposer({
onSelectHistoryPicker();
else if (key === "my_agents") onSelectAgentsPicker();
else if (key === "books") onSelectBookPicker();
- else if (key === "notebooks") onSelectNotebookPicker();
+ else if (key === "notebooks")
+ onSelectNotebookPicker();
else if (key === "question_bank")
onSelectQuestionBankPicker();
else if (key === "persona") onSelectPersonaPicker();
diff --git a/web/components/chat/home/TracePanels.tsx b/web/components/chat/home/TracePanels.tsx
index 25edbb232..d9b2da8a3 100644
--- a/web/components/chat/home/TracePanels.tsx
+++ b/web/components/chat/home/TracePanels.tsx
@@ -1325,7 +1325,9 @@ function TraceRowItem({
// "่”็ฝ‘ๆœ็ดข โ€ฆ" at a glance โ€” the colour drop is the only cue
// separating the two, no pill chrome.
<div className="flex items-baseline gap-1.5">
- <span className={`shrink-0 ${active ? "dt-breathing-text" : ""}`}>
+ <span
+ className={`shrink-0 ${active ? "dt-breathing-text" : ""}`}
+ >
{headline}
</span>
<span
diff --git a/web/components/common/InlineFileCard.tsx b/web/components/common/InlineFileCard.tsx
index c99e185eb..eab70dc9c 100644
Binary files a/web/components/common/InlineFileCard.tsx and b/web/components/common/InlineFileCard.tsx differ
diff --git a/web/components/common/PickerShell.tsx b/web/components/common/PickerShell.tsx
index 0a02518fe..148e7f00b 100644
--- a/web/components/common/PickerShell.tsx
+++ b/web/components/common/PickerShell.tsx
@@ -287,7 +287,10 @@ export default function PickerShell({
onMouseDown={(e) => e.stopPropagation()}
// Own GPU layer keeps the expand transform crisp (no sub-pixel
// shimmer) and isolates it from the blurred backdrop's compositing.
- style={{ willChange: "transform, opacity", backfaceVisibility: "hidden" }}
+ style={{
+ willChange: "transform, opacity",
+ backfaceVisibility: "hidden",
+ }}
initial={cardInitial}
animate={cardAnimate}
exit={cardExit}
diff --git a/web/components/knowledge/CreateKbModal.tsx b/web/components/knowledge/CreateKbModal.tsx
index 404201e11..594467d4d 100644
--- a/web/components/knowledge/CreateKbModal.tsx
+++ b/web/components/knowledge/CreateKbModal.tsx
@@ -181,11 +181,8 @@ export default function CreateKbModal({
}
};
- const submitLabel = mode === "new"
- ? t("Create")
- : linkIsObsidian
- ? t("Connect")
- : t("Link");
+ const submitLabel =
+ mode === "new" ? t("Create") : linkIsObsidian ? t("Connect") : t("Link");
return (
<Modal
@@ -226,7 +223,12 @@ export default function CreateKbModal({
>
<div className="space-y-4 px-5 py-4">
{/* New vs. link existing */}
- <ModeToggle mode={mode} onChange={setMode} disabled={submitting} t={t} />
+ <ModeToggle
+ mode={mode}
+ onChange={setMode}
+ disabled={submitting}
+ t={t}
+ />
<div>
<label className="mb-1 block text-[11px] font-medium uppercase tracking-wide text-[var(--muted-foreground)]">
@@ -298,23 +300,27 @@ function ModeToggle({
disabled: boolean;
t: TFn;
}) {
- const options: { id: Mode; label: string; hint: string; icon: typeof Plus }[] =
- [
- {
- id: "new",
- label: t("Create new"),
- hint: t("Upload documents and build a fresh index."),
- icon: Plus,
- },
- {
- id: "link",
- label: t("Link existing"),
- hint: t(
- "Reuse an index you already built โ€” read in place, no upload or re-index.",
- ),
- icon: Link2,
- },
- ];
+ const options: {
+ id: Mode;
+ label: string;
+ hint: string;
+ icon: typeof Plus;
+ }[] = [
+ {
+ id: "new",
+ label: t("Create new"),
+ hint: t("Upload documents and build a fresh index."),
+ icon: Plus,
+ },
+ {
+ id: "link",
+ label: t("Link existing"),
+ hint: t(
+ "Reuse an index you already built โ€” read in place, no upload or re-index.",
+ ),
+ icon: Link2,
+ },
+ ];
return (
<div className="grid grid-cols-2 gap-2">
{options.map((opt) => {
@@ -424,7 +430,9 @@ function NewModeFields({
<span className="flex items-center gap-1.5">
<AlertTriangle className="h-3.5 w-3.5 shrink-0" />
{providerNeedsKey
- ? t("This engine needs an API key. Configure it before creating.")
+ ? t(
+ "This engine needs an API key. Configure it before creating.",
+ )
: t(
"This engine isn't installed on the server. Install it before creating.",
)}
@@ -505,7 +513,9 @@ function LinkModeFields({
onClick={() => setLinkSource(p.id)}
title={
!p.linkable
- ? t("This engine's index lives in the cloud and can't be linked.")
+ ? t(
+ "This engine's index lives in the cloud and can't be linked.",
+ )
: undefined
}
className={`group flex flex-col gap-1 rounded-2xl border p-3 text-left transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${
@@ -554,7 +564,9 @@ function LinkModeFields({
)}
</div>
<span className="text-[11.5px] leading-snug text-[var(--muted-foreground)]">
- {t("A live Obsidian vault โ€” browsed and edited in place, no index.")}
+ {t(
+ "A live Obsidian vault โ€” browsed and edited in place, no index.",
+ )}
</span>
</button>
</div>
@@ -569,7 +581,9 @@ function LinkModeFields({
value={folderPath}
onChange={(event) => setFolderPath(event.target.value)}
disabled={submitting}
- placeholder={linkIsObsidian ? EXAMPLE_VAULT_PATH : EXAMPLE_INDEX_PATH}
+ placeholder={
+ linkIsObsidian ? EXAMPLE_VAULT_PATH : EXAMPLE_INDEX_PATH
+ }
className="w-full rounded-lg border border-[var(--border)] bg-[var(--background)] px-3 py-2 font-mono text-[12.5px] text-[var(--foreground)] outline-none transition-colors focus:border-[var(--foreground)]/25 disabled:opacity-50"
/>
{!linkIsObsidian && (
@@ -610,9 +624,7 @@ function ProbeVerdict({ probe, t }: { probe: LinkedFolderProbe; t: TFn }) {
<AlertTriangle className="h-3.5 w-3.5 shrink-0" />
{t("This folder can't be linked")}
</span>
- {probe.error && (
- <p className="mt-1 leading-relaxed">{probe.error}</p>
- )}
+ {probe.error && <p className="mt-1 leading-relaxed">{probe.error}</p>}
</div>
);
}
@@ -625,9 +637,7 @@ function ProbeVerdict({ probe, t }: { probe: LinkedFolderProbe; t: TFn }) {
{t("Ready index found")}
</div>
<div className="flex flex-wrap items-center gap-x-3 gap-y-1 text-[11.5px] text-[var(--muted-foreground)]">
- {probe.version && (
- <span className="font-mono">{probe.version}</span>
- )}
+ {probe.version && <span className="font-mono">{probe.version}</span>}
{probe.doc_count != null && (
<span>{t("{{count}} documents", { count: probe.doc_count })}</span>
)}
diff --git a/web/components/knowledge/EngineDetail.tsx b/web/components/knowledge/EngineDetail.tsx
index bb4d7383b..4b59bc232 100644
--- a/web/components/knowledge/EngineDetail.tsx
+++ b/web/components/knowledge/EngineDetail.tsx
@@ -87,7 +87,8 @@ const MODE_DESCRIPTIONS: Record<string, string> = {
"lightrag:naive": "Plain vector retrieval, without the knowledge graph.",
"lightrag:local": "Local context focused on the most relevant entities.",
"lightrag:global": "Theme-level retrieval over global relationships.",
- "lightrag:hybrid": "Combines local and global retrieval โ€” a solid general default.",
+ "lightrag:hybrid":
+ "Combines local and global retrieval โ€” a solid general default.",
"lightrag:mix": "Fuses knowledge-graph and vector retrieval.",
};
@@ -239,7 +240,9 @@ function NumberField({
className="w-full rounded-lg border border-[var(--border)] bg-[var(--background)] px-3 py-1.5 text-[13px] text-[var(--foreground)] outline-none transition-colors focus:border-[var(--foreground)]/25 disabled:opacity-50"
/>
{hint && (
- <span className="text-[11px] text-[var(--muted-foreground)]">{hint}</span>
+ <span className="text-[11px] text-[var(--muted-foreground)]">
+ {hint}
+ </span>
)}
</label>
);
@@ -385,17 +388,19 @@ function LlamaIndexForm({
};
const isHybrid = form.retrieval_profile === "hybrid";
- const profiles: { id: LlamaIndexConfig["retrieval_profile"]; desc: string }[] =
- [
- {
- id: "hybrid",
- desc: "BM25 keyword + vector semantic retrieval, fused and re-ranked. More robust recall.",
- },
- {
- id: "vector",
- desc: "Vector semantic retrieval only. Faster, but leans entirely on embedding quality.",
- },
- ];
+ const profiles: {
+ id: LlamaIndexConfig["retrieval_profile"];
+ desc: string;
+ }[] = [
+ {
+ id: "hybrid",
+ desc: "BM25 keyword + vector semantic retrieval, fused and re-ranked. More robust recall.",
+ },
+ {
+ id: "vector",
+ desc: "Vector semantic retrieval only. Faster, but leans entirely on embedding quality.",
+ },
+ ];
return (
<div className="space-y-6 rounded-2xl border border-[var(--border)] p-4">
@@ -422,7 +427,9 @@ function LlamaIndexForm({
<span className="font-mono text-[12.5px] font-medium text-[var(--foreground)]">
{p.id}
</span>
- {active && <Check className="h-3.5 w-3.5 text-[var(--primary)]" />}
+ {active && (
+ <Check className="h-3.5 w-3.5 text-[var(--primary)]" />
+ )}
</div>
<span className="text-[11.5px] leading-snug text-[var(--muted-foreground)]">
{t(p.desc)}
@@ -539,7 +546,10 @@ function PageIndexForm({
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
- const persist = async (payload: { api_key?: string; api_base_url?: string }) => {
+ const persist = async (payload: {
+ api_key?: string;
+ api_base_url?: string;
+ }) => {
setSaving(true);
try {
const next = await updatePageIndexConfig(payload);
@@ -679,9 +689,13 @@ function ToggleField({
return (
<div className="flex items-center justify-between gap-3">
<div className="flex flex-col">
- <span className="text-[12px] font-medium text-[var(--foreground)]">{label}</span>
+ <span className="text-[12px] font-medium text-[var(--foreground)]">
+ {label}
+ </span>
{hint && (
- <span className="text-[11px] text-[var(--muted-foreground)]">{hint}</span>
+ <span className="text-[11px] text-[var(--muted-foreground)]">
+ {hint}
+ </span>
)}
</div>
<button
@@ -729,7 +743,10 @@ function SaveButton({
}
/** Shared loader + dirty-tracking scaffold for the small engine config forms. */
-function useEngineForm<T>(load: () => Promise<T>, onError: (m: string) => void) {
+function useEngineForm<T>(
+ load: () => Promise<T>,
+ onError: (m: string) => void,
+) {
const [loaded, setLoaded] = useState<T | null>(null);
const [form, setForm] = useState<T | null>(null);
const [saving, setSaving] = useState(false);
@@ -742,7 +759,9 @@ function useEngineForm<T>(load: () => Promise<T>, onError: (m: string) => void)
setLoaded(cfg);
setForm(cfg);
})
- .catch((err) => onError(err instanceof Error ? err.message : String(err)));
+ .catch((err) =>
+ onError(err instanceof Error ? err.message : String(err)),
+ );
return () => {
cancelled = true;
};
@@ -769,7 +788,10 @@ function GraphRagForm({
}) {
const { t } = useTranslation();
const { form, setLoaded, setForm, saving, setSaving, dirty, patch } =
- useEngineForm<GraphRagConfig>(() => getGraphRagConfig({ force: true }), onError);
+ useEngineForm<GraphRagConfig>(
+ () => getGraphRagConfig({ force: true }),
+ onError,
+ );
if (!form) return <FormSkeleton />;
@@ -829,7 +851,10 @@ function LightRagForm({
}) {
const { t } = useTranslation();
const { form, setLoaded, setForm, saving, setSaving, dirty, patch } =
- useEngineForm<LightRagConfig>(() => getLightRagConfig({ force: true }), onError);
+ useEngineForm<LightRagConfig>(
+ () => getLightRagConfig({ force: true }),
+ onError,
+ );
if (!form) return <FormSkeleton />;
@@ -888,7 +913,10 @@ function ModelsSection({
onError: (message: string) => void;
}) {
const { t } = useTranslation();
- const kinds = useMemo(() => ENGINE_MODEL_KINDS[providerId] ?? [], [providerId]);
+ const kinds = useMemo(
+ () => ENGINE_MODEL_KINDS[providerId] ?? [],
+ [providerId],
+ );
const [data, setData] = useState<ModelOptionsByKind | null>(null);
const [failed, setFailed] = useState(false);
const [busyKind, setBusyKind] = useState<string | null>(null);
@@ -987,7 +1015,9 @@ function ModelsSection({
)}
{kind === "llm" && providerId === "lightrag" && (
<span className="text-[11px] text-[var(--muted-foreground)]">
- {t("Multimodal documents need a vision-capable chat model.")}
+ {t(
+ "Multimodal documents need a vision-capable chat model.",
+ )}
</span>
)}
</div>
@@ -1268,7 +1298,9 @@ export default function EngineDetail({
<div className="flex min-w-0 items-center gap-2">
<span
className={`inline-block h-1.5 w-1.5 shrink-0 rounded-full ${
- ready ? "bg-emerald-500" : "bg-[var(--muted-foreground)]"
+ ready
+ ? "bg-emerald-500"
+ : "bg-[var(--muted-foreground)]"
}`}
/>
<span className="truncate text-[13px] font-medium text-[var(--foreground)]">
diff --git a/web/components/knowledge/KbDocumentList.tsx b/web/components/knowledge/KbDocumentList.tsx
index 5d303a37b..84eaedb5a 100644
--- a/web/components/knowledge/KbDocumentList.tsx
+++ b/web/components/knowledge/KbDocumentList.tsx
@@ -189,7 +189,11 @@ export default function KbDocumentList({
// Keep the preview pointed at the moved file if it was selected.
if (selectedFile === source) {
const moved = files.find((f) => f.name === source);
- onSelect({ ...(moved ?? { name: newPath }), name: newPath, type: "file" });
+ onSelect({
+ ...(moved ?? { name: newPath }),
+ name: newPath,
+ type: "file",
+ });
}
} catch (err) {
setError(err instanceof Error ? err.message : String(err));
@@ -317,7 +321,11 @@ export default function KbDocumentList({
title={node.path}
className="flex min-w-0 flex-1 items-center gap-2 text-left"
>
- <Icon size={13} strokeWidth={1.6} className={`shrink-0 ${spec.tint}`} />
+ <Icon
+ size={13}
+ strokeWidth={1.6}
+ className={`shrink-0 ${spec.tint}`}
+ />
<div className="min-w-0 flex-1">
<div className="truncate text-[12px] font-medium text-[var(--foreground)]">
{node.name}
diff --git a/web/components/knowledge/KbDocumentsSection.tsx b/web/components/knowledge/KbDocumentsSection.tsx
index 02665abe0..ea1da8377 100644
--- a/web/components/knowledge/KbDocumentsSection.tsx
+++ b/web/components/knowledge/KbDocumentsSection.tsx
@@ -63,11 +63,11 @@ export default function KbDocumentsSection({
"This knowledge base is in Error state. Retry indexing from the existing documents before uploading new files.",
)
: status !== "ready"
- ? t(
- "This knowledge base is currently {{status}} and cannot accept uploads yet.",
- { status: status.replaceAll("_", " ") },
- )
- : null
+ ? t(
+ "This knowledge base is currently {{status}} and cannot accept uploads yet.",
+ { status: status.replaceAll("_", " ") },
+ )
+ : null
: null;
const selection = validateFiles(files, uploadPolicy, t);
diff --git a/web/components/knowledge/KnowledgeBaseDetail.tsx b/web/components/knowledge/KnowledgeBaseDetail.tsx
index c2ea4c99b..dbff8e69e 100644
--- a/web/components/knowledge/KnowledgeBaseDetail.tsx
+++ b/web/components/knowledge/KnowledgeBaseDetail.tsx
@@ -115,7 +115,8 @@ export default function KnowledgeBaseDetail({
const lastIndexedLabel = formatKnowledgeTimestamp(meta.last_indexed_at);
const isReindexingLocally =
- (task?.kind === "reindex" || task?.kind === "retry") && task.executing === true;
+ (task?.kind === "reindex" || task?.kind === "retry") &&
+ task.executing === true;
const status = resolveKbStatus(kb);
const canRetry = status === "error" && !kb.read_only;
diff --git a/web/components/knowledge/KnowledgeHome.tsx b/web/components/knowledge/KnowledgeHome.tsx
index c6beea59f..7b79386aa 100644
--- a/web/components/knowledge/KnowledgeHome.tsx
+++ b/web/components/knowledge/KnowledgeHome.tsx
@@ -112,7 +112,8 @@ export default function KnowledgeHome({
);
const kbCountByProvider = useMemo(() => {
const counts: Record<string, number> = {};
- for (const kb of kbs) counts[kbProvider(kb)] = (counts[kbProvider(kb)] ?? 0) + 1;
+ for (const kb of kbs)
+ counts[kbProvider(kb)] = (counts[kbProvider(kb)] ?? 0) + 1;
return counts;
}, [kbs]);
@@ -184,9 +185,7 @@ export default function KnowledgeHome({
{p.default_mode}
</span>
)}
- {count > 0 && (
- <span>{t("{{count}} KB", { count })}</span>
- )}
+ {count > 0 && <span>{t("{{count}} KB", { count })}</span>}
<ChevronRight className="ml-auto h-3.5 w-3.5 opacity-0 transition-opacity group-hover:opacity-60" />
</div>
</button>
diff --git a/web/components/knowledge/KnowledgePage.tsx b/web/components/knowledge/KnowledgePage.tsx
index d86f8537f..9ab9eb7fd 100644
--- a/web/components/knowledge/KnowledgePage.tsx
+++ b/web/components/knowledge/KnowledgePage.tsx
@@ -103,8 +103,7 @@ export default function KnowledgePage() {
// Keep ?kb / ?engine in sync with the effective selection so deep links work.
// The Overview view carries neither, so reloading the console stays on it.
const urlKb = view === "kb" ? (selectedKbName ?? null) : null;
- const urlEngine =
- view === "engine" ? (selectedProvider?.id ?? null) : null;
+ const urlEngine = view === "engine" ? (selectedProvider?.id ?? null) : null;
useEffect(() => {
if (typeof window === "undefined") return;
if (
diff --git a/web/components/knowledge/PageIndexSettingsModal.tsx b/web/components/knowledge/PageIndexSettingsModal.tsx
index 89c626b0f..56ff31090 100644
--- a/web/components/knowledge/PageIndexSettingsModal.tsx
+++ b/web/components/knowledge/PageIndexSettingsModal.tsx
@@ -56,7 +56,10 @@ export default function PageIndexSettingsModal({
};
}, [isOpen]);
- const persist = async (payload: { api_key?: string; api_base_url?: string }) => {
+ const persist = async (payload: {
+ api_key?: string;
+ api_base_url?: string;
+ }) => {
setSaving(true);
setError(null);
try {
diff --git a/web/components/memory/MemoryGraph.tsx b/web/components/memory/MemoryGraph.tsx
index 61abd8ab1..d0be75610 100644
--- a/web/components/memory/MemoryGraph.tsx
+++ b/web/components/memory/MemoryGraph.tsx
@@ -281,9 +281,7 @@ export default function MemoryGraph() {
/>
)}
- {hover && (
- <HoverCard hover={hover} view={view} />
- )}
+ {hover && <HoverCard hover={hover} view={view} />}
</div>
{graph && !loading && <Legend graph={graph} />}
@@ -916,13 +914,7 @@ function Legend({ graph }: { graph: MemoryGraph }) {
// โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ HoverCard
-function HoverCard({
- hover,
- view,
-}: {
- hover: HoverState;
- view: ViewState;
-}) {
+function HoverCard({ hover, view }: { hover: HoverState; view: ViewState }) {
const { t } = useTranslation();
const { node } = hover;
// Anchor the tooltip to the *node's* screen position (not the
diff --git a/web/components/memory/MemorySection.tsx b/web/components/memory/MemorySection.tsx
index fdaeb27e6..d6288de2c 100644
--- a/web/components/memory/MemorySection.tsx
+++ b/web/components/memory/MemorySection.tsx
@@ -234,7 +234,9 @@ function entityDeepLinkUrl(surface: Surface, ent: Entity): string | null {
case "partner": {
// Partner entity.id is `partnerId:sessionKey`. Deep-link to the partner.
const partnerId = asString(m.partner_id) || ent.id.split(":")[0];
- return partnerId ? `/partners/${encodeURIComponent(partnerId)}` : "/partners";
+ return partnerId
+ ? `/partners/${encodeURIComponent(partnerId)}`
+ : "/partners";
}
case "quiz": {
// Quiz entity.id is `session:question`. Deep-link to the session.
diff --git a/web/components/research/ResearchOutlineEditor.tsx b/web/components/research/ResearchOutlineEditor.tsx
index fa22a810c..54fcfa518 100644
--- a/web/components/research/ResearchOutlineEditor.tsx
+++ b/web/components/research/ResearchOutlineEditor.tsx
@@ -42,8 +42,7 @@ export default function ResearchOutlineEditor({
externalStatus === "done" ||
localConfirmed;
- const displayCollapsed =
- locked && (userToggled ? collapsed : true);
+ const displayCollapsed = locked && (userToggled ? collapsed : true);
const toggleCollapsed = useCallback(() => {
const wasAutoCollapsed = locked && !userToggled;
diff --git a/web/components/settings/MinerUEngineSettings.tsx b/web/components/settings/MinerUEngineSettings.tsx
index 92ce3aa95..9eb72f089 100644
--- a/web/components/settings/MinerUEngineSettings.tsx
+++ b/web/components/settings/MinerUEngineSettings.tsx
@@ -655,7 +655,9 @@ export function MinerUEngineSettings() {
>
<SettingRow
title={t("Model version")}
- description={t("pipeline is faster; vlm is the vision-language model.")}
+ description={t(
+ "pipeline is faster; vlm is the vision-language model.",
+ )}
control={
<select
className={`${nativeSelectClass} w-40`}
@@ -721,7 +723,9 @@ export function MinerUEngineSettings() {
<div className="flex items-center justify-between gap-3">
<p className="text-[12px] text-[var(--muted-foreground)]">
{message ||
- t("MinerU settings are written to data/user/settings/document_parsing.json.")}
+ t(
+ "MinerU settings are written to data/user/settings/document_parsing.json.",
+ )}
</p>
<button
onClick={save}
diff --git a/web/components/settings/ServiceConfigEditor.tsx b/web/components/settings/ServiceConfigEditor.tsx
index 944db4436..ac03cac1b 100644
--- a/web/components/settings/ServiceConfigEditor.tsx
+++ b/web/components/settings/ServiceConfigEditor.tsx
@@ -616,7 +616,11 @@ export function ServiceConfigEditor({ service }: { service: ServiceName }) {
className={inputClass}
value={activeModel.style || ""}
onChange={(e) =>
- updateModelField(service, "style", e.target.value)
+ updateModelField(
+ service,
+ "style",
+ e.target.value,
+ )
}
placeholder={t("style (e.g. vivid)")}
/>
diff --git a/web/components/settings/SettingsContext.tsx b/web/components/settings/SettingsContext.tsx
index 8d7bed8cc..65bb8c81c 100644
--- a/web/components/settings/SettingsContext.tsx
+++ b/web/components/settings/SettingsContext.tsx
@@ -232,8 +232,16 @@ export function defaultCatalog(): Catalog {
search: { active_profile_id: null, profiles: [] },
tts: { active_profile_id: null, active_model_id: null, profiles: [] },
stt: { active_profile_id: null, active_model_id: null, profiles: [] },
- imagegen: { active_profile_id: null, active_model_id: null, profiles: [] },
- videogen: { active_profile_id: null, active_model_id: null, profiles: [] },
+ imagegen: {
+ active_profile_id: null,
+ active_model_id: null,
+ profiles: [],
+ },
+ videogen: {
+ active_profile_id: null,
+ active_model_id: null,
+ profiles: [],
+ },
},
};
}
diff --git a/web/components/settings/SettingsSectionGrid.tsx b/web/components/settings/SettingsSectionGrid.tsx
index a6367815f..b29c0f56a 100644
--- a/web/components/settings/SettingsSectionGrid.tsx
+++ b/web/components/settings/SettingsSectionGrid.tsx
@@ -129,7 +129,9 @@ function LeafCard({
>
<span
className={`h-1.5 w-1.5 rounded-full ${
- chip.ok ? "bg-emerald-500" : "bg-[var(--muted-foreground)]/50"
+ chip.ok
+ ? "bg-emerald-500"
+ : "bg-[var(--muted-foreground)]/50"
}`}
/>
{tr(chip.label)}
diff --git a/web/components/space/EduHubImportModal.tsx b/web/components/space/EduHubImportModal.tsx
index d99fa1dea..5f831a579 100644
--- a/web/components/space/EduHubImportModal.tsx
+++ b/web/components/space/EduHubImportModal.tsx
@@ -46,10 +46,7 @@ export default function EduHubImportModal({
}) {
const { i18n } = useTranslation();
const zh = i18n.language?.toLowerCase().startsWith("zh");
- const tr = useCallback(
- (cn: string, en: string) => (zh ? cn : en),
- [zh],
- );
+ const tr = useCallback((cn: string, en: string) => (zh ? cn : en), [zh]);
const [status, setStatus] = useState<Status>({ kind: "idle" });
@@ -155,7 +152,10 @@ function StatusBanner({
if (status.kind === "installing") {
return (
<div className="flex items-center gap-2 border-b border-[var(--border)] bg-[var(--muted)]/40 px-5 py-2.5 text-[12.5px] text-[var(--foreground)]">
- <Loader2 size={14} className="animate-spin text-[var(--muted-foreground)]" />
+ <Loader2
+ size={14}
+ className="animate-spin text-[var(--muted-foreground)]"
+ />
{tr(`ๆญฃๅœจๅฏผๅ…ฅ ${status.name}โ€ฆ`, `Importing ${status.name}โ€ฆ`)}
</div>
);
diff --git a/web/components/space/ImportWizard.tsx b/web/components/space/ImportWizard.tsx
index aefaca68f..ea8e5d919 100644
--- a/web/components/space/ImportWizard.tsx
+++ b/web/components/space/ImportWizard.tsx
@@ -72,7 +72,8 @@ export default function ImportWizard({
);
const unit = scan ? selectionUnit(scan.source) : "projects";
const selectedRefs = useMemo(
- () => groups.filter((g) => selectedKeys.has(g.key)).flatMap((g) => g.sessions),
+ () =>
+ groups.filter((g) => selectedKeys.has(g.key)).flatMap((g) => g.sessions),
[groups, selectedKeys],
);
diff --git a/web/components/space/MyAgentsSection.tsx b/web/components/space/MyAgentsSection.tsx
index bb08685d3..eb51abe93 100644
--- a/web/components/space/MyAgentsSection.tsx
+++ b/web/components/space/MyAgentsSection.tsx
@@ -1,12 +1,6 @@
"use client";
-import {
- useCallback,
- useEffect,
- useMemo,
- useRef,
- useState,
-} from "react";
+import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import { useRouter } from "next/navigation";
import {
Bot,
@@ -63,7 +57,13 @@ import {
const UNGROUPED_PREFIX = "ungrouped:";
type CardView =
- | { kind: "agent"; key: string; agent: ImportAgent; count: number; latest: number }
+ | {
+ kind: "agent";
+ key: string;
+ agent: ImportAgent;
+ count: number;
+ latest: number;
+ }
| {
kind: "ungrouped";
key: string;
@@ -118,8 +118,7 @@ export default function MyAgentsSection() {
const { cards, byCard } = useMemo(() => {
const ordered = [...registry].sort(
- (a, b) =>
- (b.lastSyncAt || b.createdAt) - (a.lastSyncAt || a.createdAt),
+ (a, b) => (b.lastSyncAt || b.createdAt) - (a.lastSyncAt || a.createdAt),
);
const owner = assignSessionsToAgents(sessions, ordered);
const byCard = new Map<string, SessionSummary[]>();
@@ -327,7 +326,9 @@ export default function MyAgentsSection() {
</div>
{note && (
- <p className="text-[11.5px] text-[var(--muted-foreground)]">{note}</p>
+ <p className="text-[11.5px] text-[var(--muted-foreground)]">
+ {note}
+ </p>
)}
<section className="rounded-2xl border border-[var(--border)] bg-[var(--card)] shadow-sm">
diff --git a/web/components/space/ScopeEditorModal.tsx b/web/components/space/ScopeEditorModal.tsx
index fce796860..dfb52f4f6 100644
--- a/web/components/space/ScopeEditorModal.tsx
+++ b/web/components/space/ScopeEditorModal.tsx
@@ -220,7 +220,9 @@ function CenteredStatus({
{icon}
</span>
<div className="space-y-1">
- <p className="text-[14px] font-medium text-[var(--foreground)]">{title}</p>
+ <p className="text-[14px] font-medium text-[var(--foreground)]">
+ {title}
+ </p>
{subtitle ? (
<p className="mx-auto max-w-sm text-[12px] leading-relaxed text-[var(--muted-foreground)]">
{subtitle}
diff --git a/web/components/space/ScopePicker.tsx b/web/components/space/ScopePicker.tsx
index f5644b9be..f0f92fdcc 100644
--- a/web/components/space/ScopePicker.tsx
+++ b/web/components/space/ScopePicker.tsx
@@ -149,7 +149,9 @@ export default function ScopePicker({
/>
<span className="min-w-0 flex-1">
<span className="block truncate text-[12.5px] font-medium text-[var(--foreground)]">
- {unit === "dates" ? formatDay(group.label, lang) : group.label}
+ {unit === "dates"
+ ? formatDay(group.label, lang)
+ : group.label}
</span>
{group.sublabel ? (
<span className="block truncate text-[10.5px] text-[var(--muted-foreground)]/80">
diff --git a/web/components/space/SpaceDashboard.tsx b/web/components/space/SpaceDashboard.tsx
index 13c01681d..24dbcff52 100644
--- a/web/components/space/SpaceDashboard.tsx
+++ b/web/components/space/SpaceDashboard.tsx
@@ -63,9 +63,8 @@ interface DashboardGroup {
function distinctAgentSources(sessions: SessionSummary[]): number {
const seen = new Set<string>();
for (const s of sessions) {
- const src = (
- s.preferences as { import?: { source?: string } } | undefined
- )?.import?.source;
+ const src = (s.preferences as { import?: { source?: string } } | undefined)
+ ?.import?.source;
if (src === "claude_code" || src === "codex") seen.add(src);
}
return seen.size;
@@ -197,8 +196,7 @@ export default function SpaceDashboard() {
item
.load()
.then((n) => {
- if (!cancelled)
- setCounts((prev) => ({ ...prev, [item.key]: n }));
+ if (!cancelled) setCounts((prev) => ({ ...prev, [item.key]: n }));
})
.catch(() => {
/* leave undefined โ†’ tile just omits the count */
diff --git a/web/context/app-shell-storage.ts b/web/context/app-shell-storage.ts
index f2c8dcbd4..44e14ce9e 100644
--- a/web/context/app-shell-storage.ts
+++ b/web/context/app-shell-storage.ts
@@ -5,7 +5,8 @@ export type AppLanguage = "en" | "zh";
export const ACTIVE_SESSION_STORAGE_KEY = "deeptutor.activeSessionId.tab";
export const LANGUAGE_STORAGE_KEY = "deeptutor-language";
export const SIDEBAR_COLLAPSED_STORAGE_KEY = "deeptutor.sidebarCollapsed";
-export const CHAT_RESPONSE_TIMEOUT_STORAGE_KEY = "deeptutor.chatResponseTimeout";
+export const CHAT_RESPONSE_TIMEOUT_STORAGE_KEY =
+ "deeptutor.chatResponseTimeout";
// Mirror of the per-user ``chat_response_timeout`` UI preference. Cached in
// localStorage so the chat watchdog (a separate provider from Settings) can
@@ -23,7 +24,8 @@ export function clampChatResponseTimeout(seconds: number): number {
}
export function readStoredChatResponseTimeout(): number {
- if (typeof window === "undefined") return DEFAULT_CHAT_RESPONSE_TIMEOUT_SECONDS;
+ if (typeof window === "undefined")
+ return DEFAULT_CHAT_RESPONSE_TIMEOUT_SECONDS;
try {
const raw = window.localStorage.getItem(CHAT_RESPONSE_TIMEOUT_STORAGE_KEY);
const parsed = raw ? Number.parseInt(raw, 10) : NaN;
diff --git a/web/hooks/useVoiceAutoplay.ts b/web/hooks/useVoiceAutoplay.ts
index fb634377c..977770ed5 100644
--- a/web/hooks/useVoiceAutoplay.ts
+++ b/web/hooks/useVoiceAutoplay.ts
@@ -44,7 +44,9 @@ function scopedKey(prefix: string, scopeKey?: string): string {
function readSession(scopeKey?: string): boolean | null {
if (typeof window === "undefined") return null;
try {
- const v = window.sessionStorage.getItem(scopedKey(SESSION_KEY_PREFIX, scopeKey));
+ const v = window.sessionStorage.getItem(
+ scopedKey(SESSION_KEY_PREFIX, scopeKey),
+ );
return v === "on" ? true : v === "off" ? false : null;
} catch {
return null;
@@ -116,8 +118,8 @@ export function useVoiceAutoplay(scopeKey?: string) {
const [stateScopeKey, setStateScopeKey] = useState<string | undefined>(
normalizedScopeKey,
);
- const [sessionOverride, setSessionOverride] = useState<boolean | null>(
- () => readSession(normalizedScopeKey),
+ const [sessionOverride, setSessionOverride] = useState<boolean | null>(() =>
+ readSession(normalizedScopeKey),
);
if (stateScopeKey !== normalizedScopeKey) {
setStateScopeKey(normalizedScopeKey);
@@ -160,7 +162,10 @@ export function useVoiceAutoplay(scopeKey?: string) {
const markPrompted = useCallback(() => {
if (typeof window === "undefined") return;
try {
- window.sessionStorage.setItem(scopedKey(PROMPTED_KEY_PREFIX, normalizedScopeKey), "1");
+ window.sessionStorage.setItem(
+ scopedKey(PROMPTED_KEY_PREFIX, normalizedScopeKey),
+ "1",
+ );
} catch {
// ignore
}
@@ -174,8 +179,9 @@ export function useVoiceAutoplay(scopeKey?: string) {
if (typeof window === "undefined") return false;
try {
return (
- window.sessionStorage.getItem(scopedKey(PROMPTED_KEY_PREFIX, normalizedScopeKey)) !==
- "1"
+ window.sessionStorage.getItem(
+ scopedKey(PROMPTED_KEY_PREFIX, normalizedScopeKey),
+ ) !== "1"
);
} catch {
return false;
diff --git a/web/lib/chat-import/agent-store.ts b/web/lib/chat-import/agent-store.ts
index ac386bff4..0aa97832d 100644
--- a/web/lib/chat-import/agent-store.ts
+++ b/web/lib/chat-import/agent-store.ts
@@ -131,7 +131,9 @@ export async function saveAgent(agent: ImportAgent): Promise<void> {
export async function getAgents(): Promise<ImportAgent[]> {
try {
- return (await tx<ImportAgent[]>("readonly", (store) => store.getAll())) ?? [];
+ return (
+ (await tx<ImportAgent[]>("readonly", (store) => store.getAll())) ?? []
+ );
} catch {
return [];
}
diff --git a/web/lib/chat-import/attribution.ts b/web/lib/chat-import/attribution.ts
index a5185d911..240c068a0 100644
--- a/web/lib/chat-import/attribution.ts
+++ b/web/lib/chat-import/attribution.ts
@@ -16,7 +16,9 @@ export interface SessionImportMeta {
agentId?: string;
}
-export function readImportMeta(session: SessionSummary): SessionImportMeta | null {
+export function readImportMeta(
+ session: SessionSummary,
+): SessionImportMeta | null {
const imp = (
session.preferences as
| { import?: { source?: string; source_cwd?: string; agent_id?: string } }
diff --git a/web/lib/chat-import/claude-code.ts b/web/lib/chat-import/claude-code.ts
index ba38aae8a..d573003b0 100644
--- a/web/lib/chat-import/claude-code.ts
+++ b/web/lib/chat-import/claude-code.ts
@@ -100,9 +100,7 @@ export async function scanClaude(
const aiTitle = head.find(
(r) => r.type === "ai-title" && r.aiTitle,
)?.aiTitle;
- const firstUser = head
- .map(toMessage)
- .find((m) => m?.role === "user");
+ const firstUser = head.map(toMessage).find((m) => m?.role === "user");
sessions.push({
externalId: handle.name.replace(/\.jsonl$/, ""),
provisionalTitle:
diff --git a/web/lib/chat-import/codex.ts b/web/lib/chat-import/codex.ts
index 263d88f0a..ddebc7e61 100644
--- a/web/lib/chat-import/codex.ts
+++ b/web/lib/chat-import/codex.ts
@@ -82,7 +82,10 @@ async function walkJsonl(
entry.name,
]);
} else if (entry.name.endsWith(".jsonl")) {
- out.push({ handle: entry as FileSystemFileHandle, date: dateFromTrail(trail) });
+ out.push({
+ handle: entry as FileSystemFileHandle,
+ date: dateFromTrail(trail),
+ });
}
}
}
diff --git a/web/lib/knowledge-api.ts b/web/lib/knowledge-api.ts
index 4abba6f32..716dca278 100644
--- a/web/lib/knowledge-api.ts
+++ b/web/lib/knowledge-api.ts
@@ -230,7 +230,8 @@ export function invalidateKnowledgeCaches() {
invalidateClientCache(KNOWLEDGE_CACHE_PREFIX);
}
-const PAGEINDEX_CONFIG_PATH = "/api/v1/knowledge/rag-pipelines/pageindex/config";
+const PAGEINDEX_CONFIG_PATH =
+ "/api/v1/knowledge/rag-pipelines/pageindex/config";
export async function getPageIndexConfig(options?: {
force?: boolean;
@@ -358,13 +359,15 @@ async function updateEngineConfig<T>(
export const getGraphRagConfig = (options?: { force?: boolean }) =>
getEngineConfig<GraphRagConfig>("graphrag", "graphrag-config", options);
-export const updateGraphRagConfig = (payload: Partial<Omit<GraphRagConfig, "version">>) =>
- updateEngineConfig<GraphRagConfig>("graphrag", payload);
+export const updateGraphRagConfig = (
+ payload: Partial<Omit<GraphRagConfig, "version">>,
+) => updateEngineConfig<GraphRagConfig>("graphrag", payload);
export const getLightRagConfig = (options?: { force?: boolean }) =>
getEngineConfig<LightRagConfig>("lightrag", "lightrag-config", options);
-export const updateLightRagConfig = (payload: Partial<Omit<LightRagConfig, "version">>) =>
- updateEngineConfig<LightRagConfig>("lightrag", payload);
+export const updateLightRagConfig = (
+ payload: Partial<Omit<LightRagConfig, "version">>,
+) => updateEngineConfig<LightRagConfig>("lightrag", payload);
export async function getEnginePreflight(
provider: string,
@@ -401,11 +404,14 @@ export async function setEngineActiveModel(
profileId: string,
modelId: string,
): Promise<ModelKindOptions> {
- const res = await apiFetch(apiUrl("/api/v1/knowledge/rag-pipelines/active-model"), {
- method: "PUT",
- headers: { "Content-Type": "application/json" },
- body: JSON.stringify({ kind, profile_id: profileId, model_id: modelId }),
- });
+ const res = await apiFetch(
+ apiUrl("/api/v1/knowledge/rag-pipelines/active-model"),
+ {
+ method: "PUT",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({ kind, profile_id: profileId, model_id: modelId }),
+ },
+ );
if (!res.ok) {
throw new Error(await readErrorDetail(res, "Failed to switch model"));
}
@@ -418,7 +424,9 @@ export async function updateRagProviderMode(
mode: string,
): Promise<{ provider: string; mode: string }> {
const res = await apiFetch(
- apiUrl(`/api/v1/knowledge/rag-providers/${encodeURIComponent(provider)}/mode`),
+ apiUrl(
+ `/api/v1/knowledge/rag-providers/${encodeURIComponent(provider)}/mode`,
+ ),
{
method: "PUT",
headers: { "Content-Type": "application/json" },
@@ -426,7 +434,9 @@ export async function updateRagProviderMode(
},
);
if (!res.ok) {
- throw new Error(await readErrorDetail(res, "Failed to update retrieval mode"));
+ throw new Error(
+ await readErrorDetail(res, "Failed to update retrieval mode"),
+ );
}
// The provider list's `default_mode` depends on this; refresh it.
invalidateKnowledgeCaches();
@@ -559,10 +569,16 @@ export async function connectObsidianVault(payload: {
body: JSON.stringify({ name: payload.name, vault_path: payload.vaultPath }),
});
if (!res.ok) {
- throw new Error(await readErrorDetail(res, "Failed to connect Obsidian vault"));
+ throw new Error(
+ await readErrorDetail(res, "Failed to connect Obsidian vault"),
+ );
}
invalidateKnowledgeCaches();
- return (await res.json()) as { status: string; name: string; vault_path: string };
+ return (await res.json()) as {
+ status: string;
+ name: string;
+ vault_path: string;
+ };
}
export interface LinkedFolderProbe {
@@ -730,10 +746,7 @@ export async function retryKnowledgeBase(
{ method: "POST" },
);
if (!res.ok) {
- const detail = await readErrorDetail(
- res,
- `Retry failed (${res.status})`,
- );
+ const detail = await readErrorDetail(res, `Retry failed (${res.status})`);
throw new Error(
withDockerUpgradeHint(detail, res.status, "Knowledge retry"),
);
diff --git a/web/lib/settings-nav.ts b/web/lib/settings-nav.ts
index 02d7120ce..c75968c05 100644
--- a/web/lib/settings-nav.ts
+++ b/web/lib/settings-nav.ts
@@ -225,7 +225,10 @@ export const SETTINGS_CATEGORIES: SettingsCategory[] = [
{
key: "chat",
label: { zh: "่Šๅคฉ", en: "Chat" },
- blurb: { zh: "ๅทฅๅ…ทใ€MCP ๆœๅŠกๅ™จไธŽ่ƒฝๅŠ›", en: "Tools, MCP servers, and capabilities" },
+ blurb: {
+ zh: "ๅทฅๅ…ทใ€MCP ๆœๅŠกๅ™จไธŽ่ƒฝๅŠ›",
+ en: "Tools, MCP servers, and capabilities",
+ },
icon: MessagesSquare,
href: "/settings/chat",
children: CHAT_CHILDREN,
@@ -233,7 +236,10 @@ export const SETTINGS_CATEGORIES: SettingsCategory[] = [
{
key: "memory",
label: { zh: "่ฎฐๅฟ†", en: "Memory" },
- blurb: { zh: "ๅˆ†ๅ—ใ€้ข„็ฎ—ใ€ๅŽป้‡ไธŽๅผ•็”จ็ญ–็•ฅ", en: "Chunking, budget, dedup, and reference policies" },
+ blurb: {
+ zh: "ๅˆ†ๅ—ใ€้ข„็ฎ—ใ€ๅŽป้‡ไธŽๅผ•็”จ็ญ–็•ฅ",
+ en: "Chunking, budget, dedup, and reference policies",
+ },
icon: BrainCircuit,
href: "/settings/memory",
},