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
@@ -9,6 +9,10 @@ and renders known components, charts, and map actions.
## SSE Event
生成接口为 `POST /api/v1/responses`。下方示例是会话状态订阅中的 UIEnvelope;Responses 生成流将同一业务数据放入 `tjwater.ui_envelope` 事件的 `data` 中,并携带 `response_id` 和 `sequence_number`。
运行中追加文本使用同一生成地址,`stream=false`,携带 `conversation`、`tjwater.delivery="steer" | "queue"` 和稳定的 `tjwater.input_id`。HTTP 202 的 `tjwater.response_input` 收件回执不是新的 Response 或处理成功证明。当前 Responses SSE 保持连接,用 `tjwater.user_input` 的 `pending` / `delivered` 状态同步输入,`delivered` 表示原生收件箱已取走而非任务完成。`GET /api/v1/session/:session_id/inputs` 返回待处理消息;PATCH 其 `/:input_id` 的 `delivery` 可在处理前切换模式,处理后返回409。恢复会话流使用同样的 `user_input` 业务事件和原生待处理列表。
```text
event: ui_envelope
data: {
@@ -66,7 +70,7 @@ type UIEnvelope =
## Registry
```text
GET /api/v1/agent/chat/ui-registry
GET /api/v1/ui-registry
```
The registry returns the allowed chart grammar, registered components, and map