refactor(agent): 将 Summary Model 改造为内置 Sub Agent

- 扩展 AgentMode 类型添加 'internal' 模式
- 新增 summary agent preset (claude-3-5-haiku)
- AgentRegistry 添加 getInternal/listInternalAgents 方法
- CompressionManager 添加 setSummaryModelFromAgentConfig
- Agent 构造函数改用 Registry 配置初始化 Summary 模型
- 清理旧的 SummaryConfig 配置系统
- UI AgentsPanel 分离显示 System/Preset/Custom agents
- UI AgentEditor 为 internal agent 显示简化编辑界面
This commit is contained in:
2025-12-14 22:12:36 +08:00
parent e97daaa0eb
commit c307cd3a7c
20 changed files with 339 additions and 594 deletions
+22 -2
View File
@@ -61,16 +61,36 @@ export class AgentRegistry {
/**
* 列出可作为子 Agent 的 Agent(供 Task 工具使用)
* 排除 primary 和 internal 模式
*/
listSubagents(): AgentInfo[] {
return this.list().filter((a) => a.mode !== 'primary');
return this.list().filter((a) => a.mode !== 'primary' && a.mode !== 'internal');
}
/**
* 列出可作为主交互 Agent 的 Agent(供 /agent 命令使用)
* 排除 internal 模式
*/
listPrimaryAgents(): AgentInfo[] {
return this.list().filter((a) => a.mode !== 'subagent');
return this.list().filter((a) => a.mode !== 'subagent' && a.mode !== 'internal');
}
/**
* 获取内部 Agentinternal 模式)
*/
getInternal(name: string): AgentInfo | undefined {
const agent = this.get(name);
if (agent?.mode === 'internal') {
return agent;
}
return undefined;
}
/**
* 列出所有内部 Agent
*/
listInternalAgents(): AgentInfo[] {
return this.list().filter((a) => a.mode === 'internal');
}
/**