sync update from LAN repo (source master @ c21a2a4a)

This commit is contained in:
gozeros committed 2026-11-10 14:03:50 +08:00
1 parent ea9dcff9c0
commit 66a443e915
140 files changed
+13777 -1040

No files matched your search

@@ -19,6 +19,7 @@ from fastapi.responses import FileResponse
from pydantic import BaseModel, Field
from app.gateway.deps import get_checkpointer, get_thread_share_store, get_thread_store
from app.gateway.routers.artifacts import build_html_offline_bundle_response
from app.gateway.thread_copy import copy_thread_state
from deerflow.config.paths import get_paths
from deerflow.persistence.thread_meta.base import ThreadMetaStore
@@ -316,6 +317,7 @@ def _public_share_disposition(mime_type: str) -> str:
async def get_public_share_file(
share_code: str,
path: str,
offline_bundle: bool = False,
share_store: ThreadShareStore = Depends(get_thread_share_store),
) -> FileResponse:
"""Serve a file referenced by a view-shared conversation.
@@ -342,6 +344,11 @@ async def get_public_share_file(
if not actual_path.exists() or not actual_path.is_file():
raise HTTPException(status_code=404, detail="File not found")
if offline_bundle:
if actual_path.suffix.lower() not in {".htm", ".html", ".xhtml"}:
raise HTTPException(status_code=400, detail="Offline bundles are available for HTML files only")
return await build_html_offline_bundle_response(actual_path)
mime_type = mimetypes.guess_type(actual_path.name)[0] or "application/octet-stream"
return FileResponse(
actual_path,