The open source coding agent.
TypeScript
tweak: read plurals too and stop erroring on them
Aiden Clineb9ef09a0f4e8
diff --git a/packages/opencode/src/config/config.ts b/packages/opencode/src/config/config.tsindex 9d34c6e4710..f7c55d6f0e2 100644--- a/packages/opencode/src/config/config.ts+++ b/packages/opencode/src/config/config.ts@@ -92,8 +92,6 @@ export namespace Config {const promises: Promise<void>[] = []for (const dir of unique(directories)) {- await assertValid(dir)-if (dir.endsWith(".opencode") || dir === Flag.OPENCODE_CONFIG_DIR) {for (const file of ["opencode.jsonc", "opencode.json"]) {log.debug(`loading config from ${path.join(dir, file)}`)@@ -155,23 +153,6 @@ export namespace Config {}})- const INVALID_DIRS = new Bun.Glob(`{${["agents", "commands", "plugins", "tools", "skills"].join(",")}}/`)- async function assertValid(dir: string) {- const invalid = await Array.fromAsync(- INVALID_DIRS.scan({- onlyFiles: false,- cwd: dir,- }),- )- for (const item of invalid) {- throw new ConfigDirectoryTypoError({- path: dir,- dir: item,- suggestion: item.substring(0, item.length - 1),- })- }- }-async function installDependencies(dir: string) {if (Installation.isLocal()) return@@ -197,7 +178,7 @@ export namespace Config {await BunProc.run(["install"], { cwd: dir }).catch(() => {})}- const COMMAND_GLOB = new Bun.Glob("command/**/*.md")+ const COMMAND_GLOB = new Bun.Glob("{command,commands}/**/*.md")async function loadCommand(dir: string) {const result: Record<string, Command> = {}for await (const item of COMMAND_GLOB.scan({@@ -235,7 +216,7 @@ export namespace Config {return result}- const AGENT_GLOB = new Bun.Glob("agent/**/*.md")+ const AGENT_GLOB = new Bun.Glob("{agent,agents}/**/*.md")async function loadAgent(dir: string) {const result: Record<string, Agent> = {}@@ -278,7 +259,7 @@ export namespace Config {return result}- const MODE_GLOB = new Bun.Glob("mode/*.md")+ const MODE_GLOB = new Bun.Glob("{mode,modes}/**/*.md")async function loadMode(dir: string) {const result: Record<string, Agent> = {}for await (const item of MODE_GLOB.scan({@@ -307,7 +288,7 @@ export namespace Config {return result}- const PLUGIN_GLOB = new Bun.Glob("plugin/*.{ts,js}")+ const PLUGIN_GLOB = new Bun.Glob("{plugin,plugins}/**/*.{ts,js}")async function loadPlugin(dir: string) {const plugins: string[] = []diff --git a/packages/opencode/src/skill/skill.ts b/packages/opencode/src/skill/skill.tsindex fa6fd7e43e7..bf90dd5870c 100644--- a/packages/opencode/src/skill/skill.ts+++ b/packages/opencode/src/skill/skill.ts@@ -35,7 +35,7 @@ export namespace Skill {}),)- const OPENCODE_SKILL_GLOB = new Bun.Glob("skill/**/SKILL.md")+ const OPENCODE_SKILL_GLOB = new Bun.Glob("{skill,skills}/**/SKILL.md")const CLAUDE_SKILL_GLOB = new Bun.Glob("skills/**/SKILL.md")export const state = Instance.state(async () => {