File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed
Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -212,6 +212,39 @@ describe('loadLocalAgents', () => {
212212 expect ( result [ 'nested-agent' ] ) . toBeDefined ( )
213213 } )
214214
215+ test ( 'skips files inside the skills directory' , async ( ) => {
216+ mkdirSync ( agentsDir , { recursive : true } )
217+ const skillsDir : string = path . join ( agentsDir , 'skills' )
218+ mkdirSync ( skillsDir , { recursive : true } )
219+ writeAgentFile (
220+ skillsDir ,
221+ 'some-skill.ts' ,
222+ `
223+ export default {
224+ id: 'skill-agent',
225+ displayName: 'Skill Agent',
226+ model: '${ MODEL_NAME } '
227+ }
228+ ` ,
229+ )
230+ writeAgentFile (
231+ agentsDir ,
232+ 'real-agent.ts' ,
233+ `
234+ export default {
235+ id: 'real-agent',
236+ displayName: 'Real Agent',
237+ model: '${ MODEL_NAME } '
238+ }
239+ ` ,
240+ )
241+
242+ const result : LoadedAgents = await loadLocalAgents ( { agentsPath : agentsDir } )
243+
244+ expect ( result [ 'skill-agent' ] ) . toBeUndefined ( )
245+ expect ( result [ 'real-agent' ] ) . toBeDefined ( )
246+ } )
247+
215248 test ( 'converts handleSteps function to string' , async ( ) => {
216249 mkdirSync ( agentsDir , { recursive : true } )
217250 writeAgentFile (
Original file line number Diff line number Diff line change @@ -112,6 +112,7 @@ const getAllAgentFiles = (dir: string): string[] => {
112112 for ( const entry of entries ) {
113113 const fullPath = path . join ( dir , entry . name )
114114 if ( entry . isDirectory ( ) ) {
115+ if ( entry . name === 'skills' ) continue
115116 files . push ( ...getAllAgentFiles ( fullPath ) )
116117 continue
117118 }
You can’t perform that action at this time.
0 commit comments