Skip to content

Commit 227745c

Browse files
committed
[buffbench] Extend codelayer-base by inheriting from the base factory
and overriding key fields to tailor identity and capabilities; update SDK to integrate code_search and run_file_change_hooks for improved tooling orchestration. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
1 parent 7f7fbc2 commit 227745c

2 files changed

Lines changed: 21 additions & 17 deletions

File tree

.agents/codelayer/codelayer-base.ts

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,23 @@
1+
import { join } from 'path'
2+
13
import {
24
scanCommandsDirectory,
35
generateCommandsSection,
46
} from './utils/command-scanner'
5-
import { join } from 'path'
7+
import { base } from '../factory/base'
68

7-
import type { AgentDefinition } from '../types/agent-definition'
9+
import type { SecretAgentDefinition } from '../types/secret-agent-definition'
810

9-
const definition: AgentDefinition = {
11+
const definition: SecretAgentDefinition = {
1012
id: 'codelayer-base',
1113
publisher: 'codelayer',
14+
...base('anthropic/claude-4-sonnet-20250522'),
15+
16+
// Override specific fields from base factory
1217
displayName: 'Codelayer Base Agent',
13-
model: 'anthropic/claude-4-sonnet-20250522',
14-
15-
toolNames: [
16-
'read_files',
17-
'code_search',
18-
'run_terminal_command',
19-
'spawn_agents',
20-
'end_turn',
21-
],
2218

2319
spawnableAgents: [
24-
'codebuff/editor@0.0.1',
20+
'context-pruner',
2521
'codebase-analyzer',
2622
'codebase-locator',
2723
'codebase-pattern-finder',
@@ -82,10 +78,7 @@ Always read the command files to get the latest instructions rather than relying
8278
})(),
8379

8480
instructionsPrompt:
85-
'As Codelayer Base, focus on understanding the user request and coordinating with other agents as needed. Use your tools efficiently and provide clear, helpful responses.',
86-
87-
outputMode: 'last_message',
88-
includeMessageHistory: false,
81+
'As Codelayer Base, you are a foundational agent in the Codelayer collection that provides core functionality and coordination. You can detect trigger phrases in user input and execute corresponding commands by reading markdown files from the commands directory. When you detect triggers, read the appropriate .md file, extract the prompt section, and follow the instructions. Always coordinate with other Codelayer agents as needed and provide clear, helpful responses about command execution and results.',
8982
}
9083

9184
export default definition

sdk/src/client.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import {
44
type RunState,
55
} from './run-state'
66
import { changeFile } from './tools/change-file'
7+
import { codeSearch } from './tools/code-search'
78
import { getFiles } from './tools/read-files'
9+
import { runFileChangeHooks } from './tools/run-file-change-hooks'
810
import { runTerminalCommand } from './tools/run-terminal-command'
911
import { WebSocketHandler } from './websocket-client'
1012
import {
@@ -330,6 +332,15 @@ export class CodebuffClient {
330332
...input,
331333
cwd: input.cwd ?? this.cwd,
332334
} as Parameters<typeof runTerminalCommand>[0])
335+
} else if (toolName === 'code_search') {
336+
result = await codeSearch({
337+
...input,
338+
cwd: input.cwd ?? this.cwd,
339+
} as Parameters<typeof codeSearch>[0])
340+
} else if (toolName === 'run_file_change_hooks') {
341+
result = await runFileChangeHooks(
342+
input as Parameters<typeof runFileChangeHooks>[0],
343+
)
333344
} else {
334345
throw new Error(
335346
`Tool not implemented in SDK. Please provide an override or modify your agent to not use this tool: ${toolName}`,

0 commit comments

Comments
 (0)