mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-27 04:47:03 -06:00
fix: enforce canonical workshop skill names
This commit is contained in:
@@ -59,6 +59,7 @@ describe("skill workshop proposals", () => {
|
||||
|
||||
expect(proposal.record.status).toBe("pending");
|
||||
expect(proposal.record.scan.state).toBe("clean");
|
||||
expect(proposal.content).toContain('name: "weather-helper"');
|
||||
expect(proposal.record.supportFiles?.map((file) => file.path)).toEqual([
|
||||
"references/weather-api.md",
|
||||
"scripts/check-weather.js",
|
||||
@@ -85,7 +86,7 @@ describe("skill workshop proposals", () => {
|
||||
});
|
||||
expect(applied.targetSkillFile).toBe(proposal.record.target.skillFile);
|
||||
await expect(fs.readFile(applied.targetSkillFile, "utf8")).resolves.toBe(
|
||||
'---\nname: "Weather Helper"\ndescription: "Check weather before planning outdoor tasks"\n---\n\n# Weather Helper\n\nUse the weather provider before answering.\n',
|
||||
'---\nname: "weather-helper"\ndescription: "Check weather before planning outdoor tasks"\n---\n\n# Weather Helper\n\nUse the weather provider before answering.\n',
|
||||
);
|
||||
await expect(
|
||||
fs.readFile(
|
||||
@@ -101,8 +102,8 @@ describe("skill workshop proposals", () => {
|
||||
).resolves.toContain("parseWeather");
|
||||
|
||||
const status = buildWorkspaceSkillStatus(workspaceDir);
|
||||
expect(status.skills.find((skill) => skill.name === "Weather Helper")).toMatchObject({
|
||||
name: "Weather Helper",
|
||||
expect(status.skills.find((skill) => skill.name === "weather-helper")).toMatchObject({
|
||||
name: "weather-helper",
|
||||
source: "openclaw-workspace",
|
||||
filePath: applied.targetSkillFile,
|
||||
});
|
||||
|
||||
@@ -135,7 +135,7 @@ export async function proposeCreateSkill(
|
||||
|
||||
const supportFiles = prepareSkillProposalSupportFiles(input.supportFiles);
|
||||
const proposalContent = renderProposalMarkdown({
|
||||
name,
|
||||
name: target.skillKey,
|
||||
description,
|
||||
content: input.content,
|
||||
});
|
||||
@@ -192,7 +192,7 @@ export async function proposeUpdateSkill(
|
||||
|
||||
const supportFiles = prepareSkillProposalSupportFiles(input.supportFiles);
|
||||
const proposalContent = renderProposalMarkdown({
|
||||
name: targetSkill.name,
|
||||
name: targetSkill.skillKey,
|
||||
description: targetSkill.description,
|
||||
content: input.content,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user