feat: release v0.5.1 with multi-file skill system and IDE plugin manifest
🚀 Release / 🚀 Build & Publish Multi-Platform Binaries (push) Has been cancelled

This commit is contained in:
gitea committed 2026-09-03 15:32:01 +08:00
1 parent c1dc9f1616
commit 188a0fb5dc
22 files changed
+3912 -187

No files matched your search

+45
View File
@@ -0,0 +1,45 @@
import { describe, expect, test } from "bun:test";
import { mkdtempSync, rmSync, existsSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { EMBEDDED_SKILL_FILES, getSkillContent, installSkillFiles } from "./embedded-skill.js";
describe("embedded-skill - 多文件内嵌 Skill 体系", () => {
test("正确内嵌 SKILL.md、agents/openai.yaml 及各领域参考专卷", () => {
expect(EMBEDDED_SKILL_FILES["SKILL.md"]).toBeDefined();
expect(EMBEDDED_SKILL_FILES["SKILL.md"]).toContain("name: hose-use");
expect(getSkillContent()).toContain("name: hose-use");
expect(EMBEDDED_SKILL_FILES["agents/openai.yaml"]).toBeDefined();
expect(EMBEDDED_SKILL_FILES["agents/openai.yaml"]).toContain("hose_cli");
expect(EMBEDDED_SKILL_FILES["references/auth.md"]).toBeDefined();
expect(EMBEDDED_SKILL_FILES["references/auth.md"]).toContain("RSA");
expect(EMBEDDED_SKILL_FILES["references/bill.md"]).toBeDefined();
expect(EMBEDDED_SKILL_FILES["references/bill.md"]).toContain("bill get");
expect(EMBEDDED_SKILL_FILES["references/workflow.md"]).toBeDefined();
expect(EMBEDDED_SKILL_FILES["references/workflow.md"]).toContain("workflow find");
expect(EMBEDDED_SKILL_FILES["references/service.md"]).toBeDefined();
expect(EMBEDDED_SKILL_FILES["references/service.md"]).toContain("POST /api/cli");
});
test("installSkillFiles 递归保留层级结构并落盘到目标目录", () => {
const tmp = mkdtempSync(join(tmpdir(), "hose-skill-test-"));
try {
const res = installSkillFiles(tmp);
expect(res.targetDir).toBe(tmp);
expect(res.files.length).toBe(6);
expect(existsSync(join(tmp, "SKILL.md"))).toBe(true);
expect(existsSync(join(tmp, "agents", "openai.yaml"))).toBe(true);
expect(existsSync(join(tmp, "references", "auth.md"))).toBe(true);
expect(existsSync(join(tmp, "references", "bill.md"))).toBe(true);
expect(existsSync(join(tmp, "references", "workflow.md"))).toBe(true);
expect(existsSync(join(tmp, "references", "service.md"))).toBe(true);
} finally {
rmSync(tmp, { recursive: true, force: true });
}
});
});
+12 -1
View File
@@ -1,10 +1,21 @@
import { existsSync, mkdirSync, writeFileSync, readFileSync } from "node:fs";
import { mkdirSync, writeFileSync } from "node:fs";
import { homedir } from "node:os";
import { dirname, join } from "node:path";
import skillMain from "../../skills/hose-use/SKILL.md" with { type: "text" };
import agentOpenAi from "../../skills/hose-use/agents/openai.yaml" with { type: "text" };
import refAuth from "../../skills/hose-use/references/auth.md" with { type: "text" };
import refBill from "../../skills/hose-use/references/bill.md" with { type: "text" };
import refWorkflow from "../../skills/hose-use/references/workflow.md" with { type: "text" };
import refService from "../../skills/hose-use/references/service.md" with { type: "text" };
export const EMBEDDED_SKILL_FILES: Record<string, string> = {
"SKILL.md": skillMain,
"agents/openai.yaml": agentOpenAi,
"references/auth.md": refAuth,
"references/bill.md": refBill,
"references/workflow.md": refWorkflow,
"references/service.md": refService,
};
export function getSkillContent(): string {