mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-03-31 22:32:28 +00:00
chore: adjust way skill dirs are whitelisted (#12026)
This commit is contained in:
@@ -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),
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user