Skip to content

Commit e1fc419

Browse files
committed
rename some agents
1 parent 5134b8a commit e1fc419

File tree

13 files changed

+37
-32
lines changed

13 files changed

+37
-32
lines changed

backend/src/__tests__/agent-id-resolution.test.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { AgentTemplateTypes } from '@codebuff/common/types/session-state'
12
import { resolveAgentId } from '@codebuff/common/util/agent-name-normalization'
23
import { describe, expect, it, beforeEach } from 'bun:test'
34

@@ -22,8 +23,8 @@ describe('Agent ID Resolution', () => {
2223
parentPrompt: 'Test',
2324
inputSchema: {},
2425
},
25-
file_picker: {
26-
id: 'file_picker',
26+
[AgentTemplateTypes.file_picker]: {
27+
id: AgentTemplateTypes.file_picker,
2728
displayName: 'Fletcher',
2829
systemPrompt: 'Test',
2930
instructionsPrompt: 'Test',
@@ -86,7 +87,7 @@ describe('Agent ID Resolution', () => {
8687
describe('Direct ID Resolution', () => {
8788
it('should resolve built-in agent IDs directly', () => {
8889
expect(resolveAgentId('base', mockRegistry)).toBe('base')
89-
expect(resolveAgentId('file_picker', mockRegistry)).toBe('file_picker')
90+
expect(resolveAgentId('file-picker', mockRegistry)).toBe('file-picker')
9091
})
9192

9293
it('should resolve custom agent IDs directly', () => {
@@ -115,7 +116,7 @@ describe('Agent ID Resolution', () => {
115116
it('should not add prefix to built-in agents', () => {
116117
// Built-in agents should be found directly, not with prefix
117118
expect(resolveAgentId('base', mockRegistry)).toBe('base')
118-
expect(resolveAgentId('file_picker', mockRegistry)).toBe('file_picker')
119+
expect(resolveAgentId('file-picker', mockRegistry)).toBe('file-picker')
119120
})
120121
})
121122

backend/src/templates/agents/archive/dry-run.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import type { Model } from '@codebuff/common/constants'
88

99
export const dryRun = (model: Model): Omit<AgentTemplate, 'id'> => ({
1010
model,
11-
displayName: AGENT_PERSONAS['dry_run'].displayName,
12-
parentPrompt: AGENT_PERSONAS['dry_run'].purpose,
11+
displayName: AGENT_PERSONAS.dry_run.displayName,
12+
parentPrompt: AGENT_PERSONAS.dry_run.purpose,
1313
inputSchema: {
1414
prompt: z.string().describe('A coding task to complete'),
1515
},

backend/src/templates/agents/ask.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import type { Model } from '@codebuff/common/constants'
1414

1515
export const ask = (model: Model): Omit<AgentTemplate, 'id'> => ({
1616
model,
17-
displayName: AGENT_PERSONAS['ask'].displayName,
17+
displayName: AGENT_PERSONAS.ask.displayName,
1818
parentPrompt: 'Base ask-mode agent that orchestrates the full response.',
1919
inputSchema: {
2020
prompt: z

backend/src/templates/agents/base.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ export const base = (
1616
allAvailableAgents?: string[],
1717
): Omit<AgentTemplate, 'id'> => ({
1818
model,
19-
displayName: AGENT_PERSONAS['base'].displayName,
20-
parentPrompt: AGENT_PERSONAS['base'].purpose,
19+
displayName: AGENT_PERSONAS.base.displayName,
20+
parentPrompt: AGENT_PERSONAS.base.purpose,
2121
inputSchema: {
2222
prompt: z.string().describe('A coding task to complete'),
2323
},

backend/src/templates/agents/file-picker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import type { Model } from '@codebuff/common/constants'
88

99
export const filePicker = (model: Model): Omit<AgentTemplate, 'id'> => ({
1010
model,
11-
displayName: AGENT_PERSONAS['file_picker'].displayName,
12-
parentPrompt: AGENT_PERSONAS['file_picker'].purpose,
11+
displayName: AGENT_PERSONAS.file_picker.displayName,
12+
parentPrompt: AGENT_PERSONAS.file_picker.purpose,
1313
inputSchema: {
1414
prompt: z.string().describe('A coding task to complete'),
1515
},

backend/src/templates/agents/planner.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import type { Model } from '@codebuff/common/constants'
99

1010
export const planner = (model: Model): Omit<AgentTemplate, 'id'> => ({
1111
model,
12-
displayName: AGENT_PERSONAS['planner'].displayName,
13-
parentPrompt: AGENT_PERSONAS['planner'].purpose,
12+
displayName: AGENT_PERSONAS.planner.displayName,
13+
parentPrompt: AGENT_PERSONAS.planner.purpose,
1414
inputSchema: {
1515
prompt: z
1616
.string()

backend/src/templates/agents/researcher.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import type { Model } from '@codebuff/common/constants'
99

1010
export const researcher = (model: Model): Omit<AgentTemplate, 'id'> => ({
1111
model,
12-
displayName: AGENT_PERSONAS['researcher'].displayName,
13-
parentPrompt: AGENT_PERSONAS['researcher'].purpose,
12+
displayName: AGENT_PERSONAS.researcher.displayName,
13+
parentPrompt: AGENT_PERSONAS.researcher.purpose,
1414
inputSchema: {
1515
prompt: z
1616
.string()

backend/src/templates/agents/reviewer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import type { Model } from '@codebuff/common/constants'
99

1010
export const reviewer = (model: Model): Omit<AgentTemplate, 'id'> => ({
1111
model,
12-
displayName: AGENT_PERSONAS['reviewer'].displayName,
13-
parentPrompt: AGENT_PERSONAS['reviewer'].purpose,
12+
displayName: AGENT_PERSONAS.reviewer.displayName,
13+
parentPrompt: AGENT_PERSONAS.reviewer.purpose,
1414
inputSchema: {
1515
prompt: z.string().describe('What should be reviewed. Be brief.'),
1616
},

backend/src/templates/agents/superagent.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ export const superagent = (
1212
allAvailableAgents?: string[],
1313
): Omit<AgentTemplate, 'id'> => ({
1414
model,
15-
displayName: AGENT_PERSONAS['superagent'].displayName,
16-
parentPrompt: AGENT_PERSONAS['superagent'].purpose,
15+
displayName: AGENT_PERSONAS.superagent.displayName,
16+
parentPrompt: AGENT_PERSONAS.superagent.purpose,
1717
inputSchema: {
1818
prompt: z.string().describe('A coding task to complete'),
1919
},

backend/src/templates/agents/thinker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import type { Model } from '@codebuff/common/constants'
99

1010
export const thinker = (model: Model): Omit<AgentTemplate, 'id'> => ({
1111
model,
12-
displayName: AGENT_PERSONAS['thinker'].displayName,
13-
parentPrompt: AGENT_PERSONAS['thinker'].purpose,
12+
displayName: AGENT_PERSONAS.thinker.displayName,
13+
parentPrompt: AGENT_PERSONAS.thinker.purpose,
1414
inputSchema: {
1515
prompt: z.string().describe('The problem you are trying to solve'),
1616
},

0 commit comments

Comments
 (0)