sync update from LAN repo (source dhk-1 @ fc974e93)

This commit is contained in:
gozeros committed 2026-11-17 11:28:44 +08:00
1 parent a1fa13a238
commit e2fea6a801
432 files changed
+68707 -2270

No files matched your search

@@ -8,6 +8,7 @@ deployment files. An effective non-empty API URL is the sole provider switch.
from __future__ import annotations
from dataclasses import dataclass
from typing import Literal
from urllib.parse import urlsplit, urlunsplit
from pydantic import BaseModel, ConfigDict, Field, field_validator, model_validator
@@ -145,6 +146,11 @@ class LocalWikiIndexConfig(BaseModel):
description="Allowed local dev frontend origins; wiki_url uses the request Origin when it matches.",
)
auto_sync: bool = False
# The administrator-facing schedule is persisted in system_settings.json.
# These fields live on the effective runtime config so the scheduler never
# needs to read the settings file separately from the runtime rebuild.
auto_sync_schedule: Literal["hourly", "daily"] = "hourly"
auto_sync_hour: int = Field(default=2, ge=0, le=23)
sync_interval_seconds: int = Field(default=30, ge=10, le=86400)
sync_page_size: int = Field(default=100, ge=1, le=500)
sync_concurrency: int = Field(default=3, ge=1, le=32)
@@ -193,6 +193,20 @@ class SkillKnowledgeAutoSyncSettings(BaseModel):
model_config = ConfigDict(extra="ignore")
class LocalWikiAutoSyncSettings(BaseModel):
"""Administrator-controlled schedule for the local Wiki mirror scan.
This is deliberately separate from the WeKnora connection override: it
controls background work only, while single-knowledge-base manual syncs
remain available regardless of this switch.
"""
enabled: bool = False
schedule: Literal["hourly", "daily"] = "hourly"
hour: int = Field(default=2, ge=0, le=23)
model_config = ConfigDict(extra="ignore")
class AppearanceRouteParam(BaseModel):
"""Runtime query-param descriptor for top-bar shortcut buttons.
@@ -268,6 +282,22 @@ class AppearanceSettings(BaseModel):
default="card",
description="Default agent list display mode for users who haven't picked their own (card / list)",
)
default_agent_grid_adaptive: bool = Field(
default=True,
description="Default agent-card grid column strategy for users without a personal choice: adaptive width-based columns (true) or fixed count (false)",
)
default_agent_grid_columns: int = Field(
default=4,
description="Default fixed column count for the agent-card grid when adaptive is off (1-8)",
)
@field_validator("default_agent_grid_columns", mode="before")
@classmethod
def _clamp_default_agent_grid_columns(cls, value: object) -> int:
try:
return min(8, max(1, int(value)))
except (TypeError, ValueError):
return 4
default_layout_mode: Literal["full", "compact"] = Field(
default="compact",
description="Default interface layout for users who haven't picked their own — compact (hidden) / full (sidebar + header)",
@@ -1135,6 +1165,9 @@ class SystemSettings(BaseModel):
html_runtime: HtmlRuntimeSettings = Field(default_factory=HtmlRuntimeSettings)
app_identity: AppIdentitySettings = Field(default_factory=AppIdentitySettings)
llmwiki: LlmWikiRuntimeOverride = Field(default_factory=LlmWikiRuntimeOverride)
local_wiki_auto_sync: LocalWikiAutoSyncSettings = Field(
default_factory=LocalWikiAutoSyncSettings
)
skill_knowledge_auto_sync: SkillKnowledgeAutoSyncSettings = Field(default_factory=SkillKnowledgeAutoSyncSettings)
knowledge_base_product_version: Literal["v1", "v2"] = Field(
default="v1",