feat(beaver): 完成Task Team功能v1实现,重构后端架构支持统一内核

新增内部Task系统,包括验证、反馈门控机制,实现自动质量验证
(通过率>=0.75)和用户反馈闭环(satisfied/revise/abandon)。

实现Agent Team v1协调器,支持sequence/parallel/dag执行策略,
sub-agent复用主AgentLoop,每个run使用独立memory snapshot。

建立Skill学习pipeline,包含draft/审核/发布/回滚完整生命周期,
通过Task验证通过且用户满意才生成学习候选。

重构目录结构,移除third_party依赖,建立统一engine内核,
所有agent共享运行时基础组件。

更新ContextBuilder清理provider消息字段,增强SkillContext版本管理,
集成TaskExecutionPlanner和TaskSkillResolver实现技能解析机制。
This commit is contained in:
2026-05-08 17:14:14 +08:00
parent 5ba5c7e4c1
commit 8a12c30141
93 changed files with 16724 additions and 1247 deletions

View File

@ -8,6 +8,7 @@ import type {
ProcessRun,
ProcessWsEvent,
Session,
SessionProcessProjection,
UiAgentDescriptor,
UiMcpServerDescriptor,
} from '@/types';
@ -55,6 +56,11 @@ interface ChatStore {
setSessionId: (id: string) => void;
setMessages: (msgs: ChatMessage[]) => void;
addMessage: (msg: ChatMessage) => void;
updateMessageFeedback: (
runId: string,
feedbackState: ChatMessage['feedback_state'],
error?: string
) => void;
setIsLoading: (loading: boolean) => void;
setStreamingContent: (content: string) => void;
appendStreamingContent: (chunk: string) => void;
@ -65,6 +71,7 @@ interface ChatStore {
setNanobotReady: (ready: boolean | null) => void;
resetProcessState: () => void;
ingestProcessEvent: (event: ProcessWsEvent) => void;
setSessionProcess: (sessionId: string, projection: SessionProcessProjection) => void;
setSelectedRunId: (runId: string | null) => void;
setSelectedArtifactId: (artifactId: string | null) => void;
setAgentRegistry: (agents: UiAgentDescriptor[]) => void;
@ -148,6 +155,18 @@ export const useChatStore = create<ChatStore>((set) => ({
},
setMessages: (msgs) => set({ messages: msgs }),
addMessage: (msg) => set((s) => ({ messages: [...s.messages, msg] })),
updateMessageFeedback: (runId, feedbackState, error) =>
set((s) => ({
messages: s.messages.map((message) =>
message.run_id === runId
? {
...message,
feedback_state: feedbackState,
feedback_error: error,
}
: message
),
})),
setIsLoading: (loading) => set({ isLoading: loading }),
setStreamingContent: (content) => set({ streamingContent: content }),
appendStreamingContent: (chunk) =>
@ -345,6 +364,37 @@ export const useChatStore = create<ChatStore>((set) => ({
selectedRunId: nextSelectedRunId,
};
}),
setSessionProcess: (sessionId, projection) =>
set((state) => {
const incomingRuns = projection.runs || [];
const incomingEvents = projection.events || [];
const incomingArtifacts = projection.artifacts || [];
const incomingRunIds = new Set(incomingRuns.map((run) => run.run_id));
const nextRuns = [
...state.processRuns.filter((run) => run.session_id !== sessionId && !incomingRunIds.has(run.run_id)),
...incomingRuns,
];
const liveRunIds = new Set(nextRuns.map((run) => run.run_id));
const incomingEventIds = new Set(incomingEvents.map((event) => event.event_id));
const nextEvents = [
...state.processEvents.filter(
(event) => liveRunIds.has(event.run_id) && !incomingEventIds.has(event.event_id)
),
...incomingEvents,
];
const incomingArtifactIds = new Set(incomingArtifacts.map((artifact) => artifact.artifact_id));
const nextArtifacts = [
...state.processArtifacts.filter(
(artifact) => liveRunIds.has(artifact.run_id) && !incomingArtifactIds.has(artifact.artifact_id)
),
...incomingArtifacts,
];
return {
processRuns: nextRuns,
processEvents: nextEvents,
processArtifacts: nextArtifacts,
};
}),
setSelectedRunId: (runId) => set({ selectedRunId: runId }),
setSelectedArtifactId: (artifactId) => set({ selectedArtifactId: artifactId }),
setAgentRegistry: (agents) => set({ agentRegistry: agents }),