merge: integrate dhk-dev into dhk-1

This commit is contained in:
董宏凯 committed 2026-07-23 10:38:48 +08:00
commit 08ce3dda73
106 files changed
+11921 -910

No files matched your search

@@ -79,6 +79,8 @@ from app.gateway.routers import (
system_settings,
tags,
task_buttons,
taskcop_tasks,
task_reports,
thread_runs,
tool_metrics,
thread_shares,
@@ -86,6 +88,7 @@ from app.gateway.routers import (
uploads,
user_preferences,
user_prompts,
weknora_sources,
writing,
)
from deerflow.config import app_config as deerflow_app_config
@@ -1352,6 +1355,18 @@ This gateway provides custom endpoints for models, MCP configuration, skills, an
"X-Thread-Id",
]
# Public pages (e.g. http://47.x.x.x:7010) calling this Gateway on localhost
# trigger Chrome/Edge Private Network Access preflights. Without
# allow_private_network=True the browser reports a generic CORS failure even
# when Access-Control-Allow-Origin is correct.
cors_kwargs = {
"allow_credentials": True,
"allow_methods": ["*"],
"allow_headers": ["*"],
"expose_headers": cors_expose_headers,
"allow_private_network": True,
}
if _cors_allow_any_origin():
logger.warning(
"Permissive CORS enabled ? any Origin is echoed back (GATEWAY_CORS_ALLOW_ALL or "
@@ -1362,10 +1377,7 @@ This gateway provides custom endpoints for models, MCP configuration, skills, an
allow_origins=[],
# fullmatch() on the Origin header; browsers send scheme://host[:port]
allow_origin_regex=r".+",
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
expose_headers=cors_expose_headers,
**cors_kwargs,
)
elif cors_origins:
if "*" in cors_origins:
@@ -1378,10 +1390,7 @@ This gateway provides custom endpoints for models, MCP configuration, skills, an
app.add_middleware(
CORSMiddleware,
allow_origins=cors_origins,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
expose_headers=cors_expose_headers,
**cors_kwargs,
)
else:
# Safe-by-default fallback for local frontend development. Without any CORS
@@ -1404,10 +1413,7 @@ This gateway provides custom endpoints for models, MCP configuration, skills, an
app.add_middleware(
CORSMiddleware,
allow_origins=dev_origins,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
expose_headers=cors_expose_headers,
**cors_kwargs,
)
# Include routers
@@ -1417,6 +1423,9 @@ This gateway provides custom endpoints for models, MCP configuration, skills, an
# MCP API is mounted at /api/mcp
app.include_router(mcp.router)
# Authenticated source-context proxy for the WeKnora retrieval skill.
app.include_router(weknora_sources.router)
# Memory API is mounted at /api/memory
app.include_router(memory.router)
@@ -1482,6 +1491,12 @@ This gateway provides custom endpoints for models, MCP configuration, skills, an
# Task-workspace configurable jump buttons (按钮管理) at /api/task-buttons
app.include_router(task_buttons.router)
# Temporary compatibility bridge for the TaskCOP situation-overview frontend.
app.include_router(taskcop_tasks.router)
# Task-scoped situation-report details used by dashboard drawing / task gates.
app.include_router(task_reports.router)
# Standalone parallel multi-agent panel: fan-out streaming + saved tasks
app.include_router(parallel_agents.router)
app.include_router(parallel_agent_tasks.router)