refactor(core): 重命名 build agent 为 general agent

- build.ts 重命名为 general.ts
- buildAgent 重命名为 generalAgent
- 更新相关导出和测试
This commit is contained in:
2025-12-17 14:50:40 +08:00
parent 5a6925aef3
commit 5d1db127b2
5 changed files with 295 additions and 370 deletions
@@ -6,7 +6,6 @@ import {
generalAgent,
exploreAgent,
codeReviewerAgent,
buildAgent,
planAgent,
visionAgent,
} from '../../../../src/agent/presets/index.js';
@@ -14,7 +13,7 @@ import {
describe('Agent Presets - 预设 Agent', () => {
describe('presetAgents 集合', () => {
it('包含所有预设 Agent', () => {
expect(Object.keys(presetAgents)).toHaveLength(8); // includes summary and guide agent
expect(Object.keys(presetAgents)).toHaveLength(7); // general, explore, code-reviewer, plan, vision, summary, guide
});
it('包含 general Agent', () => {
@@ -32,11 +31,6 @@ describe('Agent Presets - 预设 Agent', () => {
expect(presetAgents['code-reviewer']).toBe(codeReviewerAgent);
});
it('包含 build Agent', () => {
expect(presetAgents['build']).toBeDefined();
expect(presetAgents['build']).toBe(buildAgent);
});
it('包含 plan Agent', () => {
expect(presetAgents['plan']).toBeDefined();
expect(presetAgents['plan']).toBe(planAgent);
@@ -55,7 +49,6 @@ describe('Agent Presets - 预设 Agent', () => {
expect(names).toContain('general');
expect(names).toContain('explore');
expect(names).toContain('code-reviewer');
expect(names).toContain('build');
expect(names).toContain('plan');
expect(names).toContain('vision');
});
@@ -67,7 +60,7 @@ describe('Agent Presets - 预设 Agent', () => {
it('返回正确数量', () => {
const names = getPresetAgentNames();
expect(names).toHaveLength(8); // general, explore, code-reviewer, build, plan, vision, summary, guide
expect(names).toHaveLength(7); // general, explore, code-reviewer, plan, vision, summary, guide
});
});
@@ -84,10 +77,6 @@ describe('Agent Presets - 预设 Agent', () => {
expect(isPresetAgent('code-reviewer')).toBe(true);
});
it('识别 build', () => {
expect(isPresetAgent('build')).toBe(true);
});
it('识别 plan', () => {
expect(isPresetAgent('plan')).toBe(true);
});
@@ -115,12 +104,8 @@ describe('Agent Presets - 预设 Agent', () => {
expect(generalAgent.description).toContain('通用');
});
it('mode 为 subagent', () => {
expect(generalAgent.mode).toBe('subagent');
});
it('禁止嵌套 Task', () => {
expect(generalAgent.tools?.noTask).toBe(true);
it('mode 为 primary(主模式)', () => {
expect(generalAgent.mode).toBe('primary');
});
it('使用默认 maxSteps(未设置具体值)', () => {
@@ -149,16 +134,6 @@ describe('Agent Presets - 预设 Agent', () => {
});
});
describe('buildAgent - 构建 Agent', () => {
it('有描述', () => {
expect(buildAgent.description).toBeDefined();
});
it('mode 为 primary(主模式)', () => {
expect(buildAgent.mode).toBe('primary');
});
});
describe('planAgent - 计划 Agent', () => {
it('有描述', () => {
expect(planAgent.description).toBeDefined();