feat: 添加swarms团队编排功能并优化agent委派系统

- 引入AgentTeamOrchestrator支持多agent协同任务执行
- 增加第三方swarms库依赖并配置git协议替换以改善包管理
- 扩展DelegationManager支持团队任务调度和进度跟踪
- 实现中文bigram分词算法提升中文任务检索准确性
- 调整A2AClient和DelegationManager超时时间从30秒增至600秒
- 优化AgentRunResult状态判断逻辑增加有意义摘要检测
- 修改Dockerfile配置npm仓库镜像地址和git协议映射
- 更新CLI命令行接口支持网关端口配置传递
- 调整提供者超时配置机制增强请求稳定性
- 移除过时的support_group字段简化agent描述符结构
- 增强错误处理和进度事件报告机制改进用户体验
This commit is contained in:
2026-04-14 14:34:23 +08:00
parent fee9007da6
commit cdfc222c9f
85 changed files with 5443 additions and 1392 deletions

View File

@ -231,18 +231,21 @@ export const useChatStore = create<ChatStore>((set) => ({
}
if (event.type === 'process_run_status') {
const current = nextRuns.find((item) => item.run_id === event.run_id);
nextRuns = upsertRun(nextRuns, {
run_id: event.run_id,
parent_run_id: current?.parent_run_id ?? event.parent_run_id ?? null,
session_id: current?.session_id ?? event.session_id ?? state.sessionId,
actor_type: event.actor_type,
actor_id: event.actor_id,
actor_name: event.actor_name,
title:
nextRuns.find((item) => item.run_id === event.run_id)?.title ||
event.actor_name,
current?.title || event.actor_name,
source: current?.source ?? null,
status: event.status,
started_at:
nextRuns.find((item) => item.run_id === event.run_id)?.started_at ||
event.created_at,
current?.started_at || event.created_at,
metadata: event.metadata,
});
}
@ -250,12 +253,16 @@ export const useChatStore = create<ChatStore>((set) => ({
const current = nextRuns.find((item) => item.run_id === event.run_id);
nextRuns = upsertRun(nextRuns, {
run_id: event.run_id,
parent_run_id: current?.parent_run_id ?? event.parent_run_id ?? null,
session_id: current?.session_id ?? event.session_id ?? state.sessionId,
actor_type: event.actor_type,
actor_id: event.actor_id,
actor_name: event.actor_name,
title: current?.title || event.actor_name,
source: current?.source ?? null,
status: current?.status || 'running',
started_at: current?.started_at || event.created_at,
metadata: event.metadata,
});
}
@ -264,12 +271,15 @@ export const useChatStore = create<ChatStore>((set) => ({
nextRuns = upsertRun(nextRuns, {
run_id: event.run_id,
parent_run_id: current?.parent_run_id ?? event.parent_run_id ?? null,
session_id: current?.session_id ?? event.session_id ?? state.sessionId,
actor_type: event.actor_type,
actor_id: event.actor_id,
actor_name: event.actor_name,
title: current?.title || event.actor_name,
source: current?.source ?? null,
status: current?.status || 'running',
started_at: current?.started_at || event.created_at,
metadata: event.metadata,
});
}
@ -295,10 +305,13 @@ export const useChatStore = create<ChatStore>((set) => ({
const current = nextRuns.find((item) => item.run_id === event.run_id);
nextRuns = upsertRun(nextRuns, {
run_id: event.run_id,
parent_run_id: current?.parent_run_id ?? null,
session_id: current?.session_id ?? event.session_id ?? state.sessionId,
actor_type: event.actor_type,
actor_id: event.actor_id,
actor_name: event.actor_name,
title: current?.title || event.actor_name,
source: current?.source ?? null,
status: event.status,
started_at: current?.started_at || event.created_at,
finished_at: event.created_at,
@ -311,14 +324,17 @@ export const useChatStore = create<ChatStore>((set) => ({
const current = nextRuns.find((item) => item.run_id === event.run_id);
nextRuns = upsertRun(nextRuns, {
run_id: event.run_id,
parent_run_id: current?.parent_run_id ?? null,
session_id: current?.session_id ?? event.session_id ?? state.sessionId,
actor_type: event.actor_type,
actor_id: event.actor_id,
actor_name: event.actor_name,
title: current?.title || event.actor_name,
source: current?.source ?? null,
status: 'cancelled',
started_at: current?.started_at || event.created_at,
finished_at: event.created_at,
summary: current?.summary ?? '已取消',
summary: current?.summary ?? null,
});
}