@@ -92,8 +92,6 @@ export namespace Config {
9292
9393 const promises : Promise < void > [ ] = [ ]
9494 for ( const dir of unique ( directories ) ) {
95- await assertValid ( dir )
96-
9795 if ( dir . endsWith ( ".opencode" ) || dir === Flag . OPENCODE_CONFIG_DIR ) {
9896 for ( const file of [ "opencode.jsonc" , "opencode.json" ] ) {
9997 log . debug ( `loading config from ${ path . join ( dir , file ) } ` )
@@ -155,23 +153,6 @@ export namespace Config {
155153 }
156154 } )
157155
158- const INVALID_DIRS = new Bun . Glob ( `{${ [ "agents" , "commands" , "plugins" , "tools" , "skills" ] . join ( "," ) } }/` )
159- async function assertValid ( dir : string ) {
160- const invalid = await Array . fromAsync (
161- INVALID_DIRS . scan ( {
162- onlyFiles : false ,
163- cwd : dir ,
164- } ) ,
165- )
166- for ( const item of invalid ) {
167- throw new ConfigDirectoryTypoError ( {
168- path : dir ,
169- dir : item ,
170- suggestion : item . substring ( 0 , item . length - 1 ) ,
171- } )
172- }
173- }
174-
175156 async function installDependencies ( dir : string ) {
176157 if ( Installation . isLocal ( ) ) return
177158
@@ -197,7 +178,7 @@ export namespace Config {
197178 await BunProc . run ( [ "install" ] , { cwd : dir } ) . catch ( ( ) => { } )
198179 }
199180
200- const COMMAND_GLOB = new Bun . Glob ( "command/**/*.md" )
181+ const COMMAND_GLOB = new Bun . Glob ( "{ command,commands} /**/*.md" )
201182 async function loadCommand ( dir : string ) {
202183 const result : Record < string , Command > = { }
203184 for await ( const item of COMMAND_GLOB . scan ( {
@@ -235,7 +216,7 @@ export namespace Config {
235216 return result
236217 }
237218
238- const AGENT_GLOB = new Bun . Glob ( "agent/**/*.md" )
219+ const AGENT_GLOB = new Bun . Glob ( "{ agent,agents} /**/*.md" )
239220 async function loadAgent ( dir : string ) {
240221 const result : Record < string , Agent > = { }
241222
@@ -278,7 +259,7 @@ export namespace Config {
278259 return result
279260 }
280261
281- const MODE_GLOB = new Bun . Glob ( "mode/*.md" )
262+ const MODE_GLOB = new Bun . Glob ( "{ mode,modes}/** /*.md" )
282263 async function loadMode ( dir : string ) {
283264 const result : Record < string , Agent > = { }
284265 for await ( const item of MODE_GLOB . scan ( {
@@ -307,7 +288,7 @@ export namespace Config {
307288 return result
308289 }
309290
310- const PLUGIN_GLOB = new Bun . Glob ( "plugin/*.{ts,js}" )
291+ const PLUGIN_GLOB = new Bun . Glob ( "{ plugin,plugins}/** /*.{ts,js}" )
311292 async function loadPlugin ( dir : string ) {
312293 const plugins : string [ ] = [ ]
313294
0 commit comments