import { describe, expect, test } from "bun:test"; import { handleSkillCommand } from "./skill.js"; import { getAiProSkillContent, getSkillContent } from "../../packaging/embedded-skill.js"; const parsed = { area: "skill", action: "dump", args: [], options: {}, raw: ["skill", "dump"], }; const baseRuntime = { selectedCorp: null, corpContext: {}, jsonMode: false, }; describe("skill dump 的 multicall 入口识别", () => { test("hose-aipro 入口返回 AI PRO Skill(不依赖 argv0 猜测)", async () => { const result = await handleSkillCommand(parsed as never,{ ...baseRuntime, app: "hose-aipro" } as never); expect(result.stdout).toBe(`${getAiProSkillContent()}\n`); expect(result.stdout).toContain("hose-aipro (v"); }); test("hose-use 入口返回平台 Skill", async () => { const result = await handleSkillCommand(parsed as never,{ ...baseRuntime, app: "hose-use" } as never); expect(result.stdout).toBe(`${getSkillContent()}\n`); expect(result.stdout).toContain("hose-use (v"); }); test("兼容历史:未标注 app 时仍按 parsed.raw 里的 aipro 标记识别", async () => { const legacyParsed = { ...parsed, raw: ["skill", "dump", "aipro"] }; const result = await handleSkillCommand(legacyParsed as never, baseRuntime as never); expect(result.stdout).toBe(`${getAiProSkillContent()}\n`); }); });