feat: 添加 Agent 步骤事件与图片附件功能

- 新增 stepStarted/stepFinished 事件类型支持
- 前端实现图片附件上传和预览功能
- 后端增强工具结果存储和事件处理
- 完善相关单元测试和集成测试
This commit is contained in:
zl-q
2026-03-12 09:29:57 +08:00
parent 87215f9d41
commit 7b8865e256
45 changed files with 3869 additions and 308 deletions
-1
View File
@@ -50,7 +50,6 @@ class ApiClient implements IApiClient {
};
}
@override
Future<Response<T>> get<T>(String path, {Options? options}) async {
try {
return await _dio.get<T>(path, options: options);
+8 -17
View File
@@ -40,7 +40,11 @@ class MockApiClient implements IApiClient {
_handlers[key] = handler;
}
void registerPatternHandler(RegExp pattern, String method, MockHandler handler) {
void registerPatternHandler(
RegExp pattern,
String method,
MockHandler handler,
) {
_patternHandlers.add(
_PatternRoute(
pattern: pattern,
@@ -96,11 +100,7 @@ class MockApiClient implements IApiClient {
final direct = _handlers[key];
if (direct != null) {
final response = direct(
MockRequest(
path: path,
method: 'SSE',
headers: headers,
),
MockRequest(path: path, method: 'SSE', headers: headers),
);
if (response is Stream<String>) {
return response;
@@ -118,11 +118,7 @@ class MockApiClient implements IApiClient {
continue;
}
final response = route.handler(
MockRequest(
path: path,
method: 'SSE',
headers: headers,
),
MockRequest(path: path, method: 'SSE', headers: headers),
);
if (response is Stream<String>) {
return response;
@@ -147,12 +143,7 @@ class MockApiClient implements IApiClient {
if (handler != null) {
final response = handler(
MockRequest(
path: path,
method: method,
data: data,
options: options,
),
MockRequest(path: path, method: method, data: data, options: options),
);
if (response is Response) {
return response as Response<T>;