mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-07 16:35:48 +01:00
Exclude nested skill trees from parent inventories
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
5d01b75c60
commit
f74999d0cf
2 files changed
+41
-2
No files matched your search
@@ -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"
|
||||
|
||||
Reference in new issue
Block a user