chore: adjust way skill dirs are whitelisted (#12026)

This commit is contained in:
Aiden Cline
2026-02-03 16:33:36 -06:00
committed by GitHub
parent 015cd404e4
commit a68fedd4a6
2 changed files with 64 additions and 3 deletions

View File

@@ -50,6 +50,7 @@ export namespace Skill {
export const state = Instance.state(async () => {
const skills: Record<string, Info> = {}
const dirs = new Set<string>()
const addSkill = async (match: string) => {
const md = await ConfigMarkdown.parse(match).catch((err) => {
@@ -75,6 +76,8 @@ export namespace Skill {
})
}
dirs.add(path.dirname(match))
skills[parsed.data.name] = {
name: parsed.data.name,
description: parsed.data.description,
@@ -148,11 +151,9 @@ export namespace Skill {
}
}
const dirs = Array.from(new Set(Object.values(skills).map((item) => path.dirname(item.location))))
return {
skills,
dirs,
dirs: Array.from(dirs),
}
})