@@ -2,18 +2,12 @@ import {
22 DynamicAgentConfigParsed ,
33 DynamicAgentConfigSchema ,
44 DynamicAgentTemplate ,
5- PromptField ,
65} from '@codebuff/common/types/dynamic-agent-template'
7- import { filterCustomAgentFiles } from '@codebuff/common/util/agent-file-utils'
86import * as fs from 'fs'
97import * as path from 'path'
108import { cyan , green } from 'picocolors'
119import { CodebuffConfig } from '@codebuff/common/json-config/constants'
12- import {
13- getAllTsFiles ,
14- loadFileContents ,
15- getAgentsDirectory ,
16- } from './agent-utils'
10+ import { getAllTsFiles , getAgentsDirectory } from './agent-utils'
1711
1812export let loadedAgents : Record < string , DynamicAgentTemplate > = { }
1913
@@ -47,7 +41,7 @@ export async function loadLocalAgents({
4741 }
4842 continue
4943 }
50-
44+
5145 try {
5246 agentConfig = agentModule . default
5347 } catch ( error : any ) {
@@ -73,11 +67,9 @@ export async function loadLocalAgents({
7367
7468 loadedAgents [ fileName ] = {
7569 ...typedAgentConfig ,
76- systemPrompt : loadFileContents ( typedAgentConfig . systemPrompt ) ,
77- instructionsPrompt : loadFileContents (
78- typedAgentConfig . instructionsPrompt
79- ) ,
80- stepPrompt : loadFileContents ( typedAgentConfig . stepPrompt ) ,
70+ systemPrompt : typedAgentConfig . systemPrompt || '' ,
71+ instructionsPrompt : typedAgentConfig . instructionsPrompt || '' ,
72+ stepPrompt : typedAgentConfig . stepPrompt || '' ,
8173 handleSteps : handleStepsString ,
8274 }
8375 }
0 commit comments