feat: AG-UI 协议对齐与路由导航功能

- 前端: 添加 SSE 流式支持、stateSnapshot 事件、路由导航工具
- 前端: 实现工具调用审批流程,支持 pending 状态展示
- 后端: Agent 状态管理与会话持久化相关重构
- 文档: 新增 agent-agui-full-alignance 设计文档
- 测试: 补充相关单元测试和集成测试
This commit is contained in:
zl-q
2026-03-07 17:30:20 +08:00
parent ec33bb0cee
commit 120df903d2
52 changed files with 4305 additions and 1672 deletions
@@ -211,5 +211,35 @@ void main() {
),
],
);
blocTest<ChatBloc, ChatState>(
'toolCallResult without ui removes pending tool call and does not add empty card',
build: () => chatBloc,
seed: () => ChatState(
items: [
ToolCallItem(
id: 'tc_1',
callId: 'tc_1',
toolName: 'navigate_to_route',
args: {'target': '/calendar/dayweek', '__nonce': 'nonce_1'},
status: ToolCallStatus.executing,
timestamp: DateTime.now(),
sender: MessageSender.ai,
),
],
),
act: (bloc) {
service.onEvent(
ToolCallResultEvent(
messageId: 'msg_tool_1',
toolCallId: 'tc_1',
content: '{"result":{"ok":true}}',
),
);
},
expect: () => [
isA<ChatState>().having((s) => s.items.isEmpty, 'items empty', true),
],
);
});
}