refactor: unify skills+cli runtime and streamline ag-ui flow

This commit is contained in:
qzl
2026-04-22 17:09:37 +08:00
parent eeed737949
commit 4d55df45ab
111 changed files with 4858 additions and 3264 deletions
+10 -11
View File
@@ -93,12 +93,12 @@ data: <json>
### 5.2 UI 编译器一致
两条链路都使用后端 `ui_compiler.compile(...)`**worker**`ui_hints` 编译为可渲染结构:
两条链路都使用后端 `ui_compiler.compile(...)`**tool**`ui_hints` 编译为可渲染结构:
- events:在 runtime 发送事件前编译,字段名为 `ui_schema`
- history:在历史转换时编译,字段名为 `ui_schema`
tool 结果不再走 UI 编译链路:`TOOL_CALL_RESULT` 提供 `tool_call_args` + `result` 组合
tool 结果走 UI 编译链路:`TOOL_CALL_RESULT` 在保留 `tool_call_args` + `result` 的同时可携带 `ui_schema`
- `metadata.tool_agent_output` 是 tool 消息的完整信源(用于 runtime observation 与 history replay)。
- `message.content` 保持轻量摘要(当前等于 `result`)。
@@ -126,10 +126,9 @@ tool 结果不再走 UI 编译链路:`TOOL_CALL_RESULT` 提供 `tool_call_args
### 7.1 后端生成
- runtime 使用 `ui_hints.action.type = navigation` 产出导航动作。
- runtime 基于 tool 输出中的 `ui_hints.action.type = navigation` 产出导航动作。
- 编译后在 `ui_schema` 中保持 `action.type = navigation``action.path``action.params`
- 路由来源应受后端静态路由目录约束:
- `backend/src/core/config/static/route/frontend_routes.yaml`
- 路由由工具能力直接给出 concrete pathagent 本身不需要维护 route_id 概念。
### 7.2 前端消费(统一解析规则)
@@ -144,12 +143,12 @@ tool 结果不再走 UI 编译链路:`TOOL_CALL_RESULT` 提供 `tool_call_args
- 关键业务动作(创建、编辑、分享、处理邀请等)应优先设计为可深链页面路由,而不是仅存在于临时弹层。
- 若 UI 采用 sheet 风格展示,也应由页面路由承载状态,再以页面内 surface 呈现 sheet 视觉。
- `todo.edit` 必须落地为独立子页面(`/todo/{id}/edit`),不应通过详情页内弹窗承载编辑主流程。
- 推荐后端优先使用以下 route_id 生成导航(示例):
- `calendar.event_create` -> `/calendar/events/new`
- `calendar.event_edit` -> `/calendar/events/{id}/edit`
- `calendar.event_share` -> `/calendar/events/{id}/share`
- `todo.create` -> `/todo/new`
- `todo.edit` -> `/todo/{id}/edit`
- 推荐工具能力优先输出以下 concrete path(示例):
- `/calendar/events/new`
- `/calendar/events/{id}/edit`
- `/calendar/events/{id}/share`
- `/todo/new`
- `/todo/{id}/edit`
### 7.4 约束建议
+2 -2
View File
@@ -294,8 +294,8 @@ interface NavigateAction {
// 2) path MUST NOT include query string or fragment.
// 3) params, when provided, is treated as query params only.
// 4) params values MUST be scalar (string | number | boolean).
// 5) Backend MUST generate path from route catalog
// `backend/src/core/config/static/route/frontend_routes.yaml`.
// 5) Backend/tool layer MUST generate concrete internal path directly.
// Agent prompt does not carry route catalog contract.
// URL action
interface UrlAction {