fix(skills): adapt skill source metadata API

This commit is contained in:
Jacob Tomlinson
2026-03-27 18:28:25 +00:00
parent 694619caaf
commit 25210317b8
7 changed files with 43 additions and 7 deletions

View File

@@ -60,7 +60,13 @@ function buildEntry(name: string): SkillEntry {
description: `${name} test skill`,
filePath: path.join(skillDir, "SKILL.md"),
baseDir: skillDir,
source: "openclaw-workspace",
sourceInfo: {
path: skillDir,
source: "openclaw-workspace",
scope: "project",
origin: "package",
baseDir: skillDir,
},
disableModelInvocation: false,
},
frontmatter: {},

View File

@@ -17,7 +17,13 @@ describe("buildWorkspaceSkillStatus", () => {
description: "test",
filePath: "/tmp/os-scoped",
baseDir: "/tmp",
source: "test",
sourceInfo: {
path: "/tmp",
source: "test",
scope: "project",
origin: "package",
baseDir: "/tmp",
},
disableModelInvocation: false,
},
frontmatter: {},

View File

@@ -24,7 +24,13 @@ function makeEntry(params: {
description: `desc:${params.name}`,
filePath: `/tmp/${params.name}/SKILL.md`,
baseDir: `/tmp/${params.name}`,
source: params.source ?? "openclaw-workspace",
sourceInfo: {
path: `/tmp/${params.name}`,
source: params.source ?? "openclaw-workspace",
scope: "project",
origin: "package",
baseDir: `/tmp/${params.name}`,
},
disableModelInvocation: false,
},
frontmatter: {},

View File

@@ -17,7 +17,13 @@ describe("resolveSkillsPromptForRun", () => {
description: "Demo",
filePath: "/app/skills/demo-skill/SKILL.md",
baseDir: "/app/skills/demo-skill",
source: "openclaw-bundled",
sourceInfo: {
path: "/app/skills/demo-skill",
source: "openclaw-bundled",
scope: "project",
origin: "package",
baseDir: "/app/skills/demo-skill",
},
disableModelInvocation: false,
},
frontmatter: {},

View File

@@ -15,7 +15,13 @@ function makeSkill(name: string, desc = "A skill", filePath = `/skills/${name}/S
description: desc,
filePath,
baseDir: `/skills/${name}`,
source: "workspace",
sourceInfo: {
path: `/skills/${name}`,
source: "workspace",
scope: "project",
origin: "package",
baseDir: `/skills/${name}`,
},
disableModelInvocation: false,
};
}

View File

@@ -1,5 +1,5 @@
import type { Skill } from "@mariozechner/pi-coding-agent";
export function resolveSkillSource(skill: Skill): string {
return skill.source;
return skill.sourceInfo.source;
}

View File

@@ -38,7 +38,13 @@ describe("skills-cli (e2e)", () => {
description: "Capture UI screenshots",
filePath: path.join(baseDir, "SKILL.md"),
baseDir,
source: "openclaw-bundled",
sourceInfo: {
path: baseDir,
source: "openclaw-bundled",
scope: "project",
origin: "package",
baseDir,
},
disableModelInvocation: false,
},
frontmatter: {},