Skip to content

Commit 4bf42e4

Browse files
committed
Create types in .agents/types
1 parent 88ac53c commit 4bf42e4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

backend/src/templates/agents/agent-builder.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,10 @@ import(TEMPLATE_RELATIVE_PATH)
2222

2323
const TEMPLATE_PATH = path.join(__dirname, TEMPLATE_RELATIVE_PATH)
2424
const DEFAULT_MODEL = openrouterModels.openrouter_claude_sonnet_4
25-
const TEMPLATE_TYPES_PATH = path.join(AGENT_TEMPLATES_DIR, AGENT_CONFIG_FILE)
25+
const TYPES_DIR = path.join(AGENT_TEMPLATES_DIR, 'types')
26+
const TEMPLATE_TYPES_PATH = path.join(TYPES_DIR, AGENT_CONFIG_FILE)
2627
const TOOL_DEFINITIONS_FILE = 'tools.d.ts'
27-
const TOOL_DEFINITIONS_PATH = path.join(
28-
AGENT_TEMPLATES_DIR,
29-
TOOL_DEFINITIONS_FILE,
30-
)
28+
const TOOL_DEFINITIONS_PATH = path.join(TYPES_DIR, TOOL_DEFINITIONS_FILE)
3129

3230
export const agentBuilder = (model: Model): Omit<AgentTemplate, 'id'> => {
3331
// Read the AGENT_CONFIG_FILE content dynamically
@@ -137,6 +135,7 @@ export const agentBuilder = (model: Model): Omit<AgentTemplate, 'id'> => {
137135
`4. Create the complete agent template file in ${AGENT_TEMPLATES_DIR}`,
138136
'5. Ensure the template follows all conventions and best practices',
139137
'6. Use the AgentConfig interface for the configuration',
138+
'7. Start the file with: import type { AgentConfig } from "./types/agent-config"',
140139
'',
141140
'Create agent templates that are focused, efficient, and well-documented. Always import the AgentConfig type and export a default configuration object.',
142141
].join('\n'),
@@ -167,7 +166,7 @@ IMPORTANT: Always end your response with the end_turn tool when you have complet
167166
yield {
168167
toolName: 'run_terminal_command',
169168
args: {
170-
command: `mkdir -p ${AGENT_TEMPLATES_DIR}`,
169+
command: `mkdir -p ${TYPES_DIR}`,
171170
process_type: 'SYNC',
172171
timeout_seconds: 10,
173172
},
@@ -227,6 +226,7 @@ IMPORTANT: Always end your response with the end_turn tool when you have complet
227226
228227
**Requirements:**
229228
- Create the agent template file in ${AGENT_TEMPLATES_DIR}
229+
- Always start the file with: import type { AgentConfig } from './types/agent-config'
230230
- Use the AgentConfig interface
231231
- Include appropriate tools based on the specialty
232232
- Write a comprehensive system prompt

0 commit comments

Comments
 (0)