mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-22 06:32:00 +00:00
fix(skills): adapt skill source metadata API
This commit is contained in:
@@ -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: {},
|
||||
|
||||
@@ -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: {},
|
||||
|
||||
@@ -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: {},
|
||||
|
||||
@@ -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: {},
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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: {},
|
||||
|
||||
Reference in New Issue
Block a user