feat(agent): unify MCP tools and adopt Responses delivery

Move project and host queries into native MCP with host-owned OAuth/context,
while retaining memory, skills, actions and publication plugins. Add nearby-model
queries and explicit chat/task/learning model defaults.

Adopt Responses HTTP/SSE and native steer/queue inbox delivery, preserving scoped
session ownership, pending input edits and investigation communication.

Disable local-provider discovery: Server /health allowed native vLLM to probe
/v1/models on port 8000. A native before/after regression prevents recurrence.

Validation: 170 focused Bun tests; service/plugin typechecks; native discovery,
provider-discovery and input-inbox smoke checks; no paid model inference.
This commit is contained in:
2026-10-19 18:46:58 +08:00
parent f5c3cde2c2
commit 6a49d2209e
164 changed files with 12286 additions and 2368 deletions
+5 -1
View File
@@ -23,8 +23,12 @@ Mermaid、todo 和可选的旧执行计划供人理解,不约束 Agent 调度
## 任务、协作与恢复
后台调查通过 `publish_task_progress` 在真实步骤开始及路线变化时发布完整 summary 与可空 diagram,复用 Server `agent-artifacts` 写入。节点可带显式 status 和供水图层要素 map_targets;只有 running 代表当前活动。进度图可以替换或重绘,不受旧计划保留节点规则约束,也不从 todo 推算。最终报告 diagram 使用相同节点引用字段;两者均不调度 Agent。
`publish_task_presentation` 仅允许 task_execution,通过 Server `presentation-events` 记录有限地图、图表及证据图层命令。run_id、任务和会话身份来自可信运行上下文;request_id 为模型提供的 UUID,相同操作重试复用。命令无需浏览器 capability 或实际显示回执,recorded 不代表已显示。图表引用真实证据,overlay 仅提供 evidence_id,由 Server 提取数据。前端 Dev 选择当前任务后实时跟随未来展示事件,关闭、切换或重连不回放旧展示,不启动新调查。
计划独立保存在现有 Session UI State 的 `executionPlans` 中,并随消息流发送。
`GET /api/v1/agent/chat/session/:session_id/stream` 的首个 `state` 事件返回运行中快照,
`GET /api/v1/session/:session_id/stream` 的首个 `state` 事件返回运行中快照,
或已保存的 `execution_plans`。主对话断线不影响计划快照保存。前端支持历史版本查看及断线重连。
会话元数据以 `purpose` 区分普通聊天、后台任务执行和任务协作。普通历史列表默认仅返回
`ordinary_chat`;任务执行和协作会话只能用显式 purpose/task 过滤或从对应工况任务进入。