Exclude nested skill trees from parent inventories

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-06-06 17:36:03 +00:00
1 parent 5d01b75c60
commit f74999d0cf
2 files changed
+41 -2

No files matched your search

+11 -2
View File
@@ -1119,10 +1119,19 @@ async function readLocalSkillImports(companyId: string, sourcePath: string): Pro
for (const skillPath of skillPaths) {
const skillDir = path.posix.dirname(skillPath);
const skillInventoryRoot = skillDir === "." ? "" : skillDir;
const nestedSkillRoots = skillPaths
.map((entry) => {
const nestedDir = path.posix.dirname(entry);
return nestedDir === "." ? "" : nestedDir;
})
.filter((entry) =>
entry !== skillInventoryRoot
&& (skillInventoryRoot ? entry.startsWith(`${skillInventoryRoot}/`) : entry.length > 0));
const inventory = allFiles
.filter((entry) =>
entry === skillPath
|| (skillInventoryRoot ? entry.startsWith(`${skillInventoryRoot}/`) : true))
(entry === skillPath || (skillInventoryRoot ? entry.startsWith(`${skillInventoryRoot}/`) : true))
&& !nestedSkillRoots.some((nestedRoot) =>
entry === `${nestedRoot}/SKILL.md` || entry.startsWith(`${nestedRoot}/`)))
.map((entry) => {
const relative = entry === skillPath
? "SKILL.md"