fix: restore followSymlinks behavior in Glob utility

Add symlink: true to all locations that previously had followSymlinks: true:
- theme.tsx: custom themes
- config.ts: commands, agents, modes, plugins
- skill.ts: external, opencode, and custom skills
- registry.ts: custom tools

Also fix nodir to default to true (exclude directories) when include is not explicitly set to 'all'.
This commit is contained in:
Dax Raad
2026-02-19 13:11:38 -05:00
parent bbfb7e95e0
commit 9657d1bbfd
5 changed files with 13 additions and 2 deletions

View File

@@ -409,6 +409,7 @@ async function getCustomThemes() {
cwd: dir,
absolute: true,
dot: true,
symlink: true,
})) {
const name = path.basename(item, ".json")
result[name] = await Filesystem.readJson(item)

View File

@@ -358,6 +358,7 @@ export namespace Config {
cwd: dir,
absolute: true,
dot: true,
symlink: true,
})) {
const md = await ConfigMarkdown.parse(item).catch(async (err) => {
const message = ConfigMarkdown.FrontmatterError.isInstance(err)
@@ -396,6 +397,7 @@ export namespace Config {
cwd: dir,
absolute: true,
dot: true,
symlink: true,
})) {
const md = await ConfigMarkdown.parse(item).catch(async (err) => {
const message = ConfigMarkdown.FrontmatterError.isInstance(err)
@@ -433,6 +435,7 @@ export namespace Config {
cwd: dir,
absolute: true,
dot: true,
symlink: true,
})) {
const md = await ConfigMarkdown.parse(item).catch(async (err) => {
const message = ConfigMarkdown.FrontmatterError.isInstance(err)
@@ -469,6 +472,7 @@ export namespace Config {
cwd: dir,
absolute: true,
dot: true,
symlink: true,
})) {
plugins.push(pathToFileURL(item).href)
}

View File

@@ -93,6 +93,7 @@ export namespace Skill {
absolute: true,
include: "file",
dot: true,
symlink: true,
})
.then((matches) => Promise.all(matches.map(addSkill)))
.catch((error) => {
@@ -124,6 +125,7 @@ export namespace Skill {
cwd: dir,
absolute: true,
include: "file",
symlink: true,
})
for (const match of matches) {
await addSkill(match)
@@ -143,6 +145,7 @@ export namespace Skill {
cwd: resolved,
absolute: true,
include: "file",
symlink: true,
})
for (const match of matches) {
await addSkill(match)
@@ -158,6 +161,7 @@ export namespace Skill {
cwd: dir,
absolute: true,
include: "file",
symlink: true,
})
for (const match of matches) {
await addSkill(match)

View File

@@ -36,7 +36,9 @@ export namespace ToolRegistry {
const custom = [] as Tool.Info[]
const matches = await Config.directories().then((dirs) =>
dirs.flatMap((dir) => Glob.scanSync("{tool,tools}/*.{js,ts}", { cwd: dir, absolute: true, dot: true })),
dirs.flatMap((dir) =>
Glob.scanSync("{tool,tools}/*.{js,ts}", { cwd: dir, absolute: true, dot: true, symlink: true }),
),
)
if (matches.length) await Config.waitForDependencies()
for (const match of matches) {

View File

@@ -16,7 +16,7 @@ export namespace Glob {
absolute: options.absolute,
dot: options.dot,
follow: options.symlink ?? false,
nodir: options.include === "file",
nodir: options.include !== "all",
}
}