summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAiden Cline <[email protected]>2025-12-30 18:58:31 -0600
committerAiden Cline <[email protected]>2025-12-30 18:58:31 -0600
commitb9ef09a0f4e8c96b4549352b53a64cee4be32aa7 (patch)
tree97192bb4c3049a297acae87b5c621eca86f11916
parenteb81994a18096f1a5573ed9420b38af955c332a2 (diff)
downloadopencode-b9ef09a0f4e8c96b4549352b53a64cee4be32aa7.tar.gz
opencode-b9ef09a0f4e8c96b4549352b53a64cee4be32aa7.zip
tweak: read plurals too and stop erroring on them
-rw-r--r--packages/opencode/src/config/config.ts27
-rw-r--r--packages/opencode/src/skill/skill.ts2
2 files changed, 5 insertions, 24 deletions
diff --git a/packages/opencode/src/config/config.ts b/packages/opencode/src/config/config.ts
index 9d34c6e47..f7c55d6f0 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.ts
index fa6fd7e43..bf90dd587 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 () => {