remoteOfficialPluginAssets.test.ts 1.3 KB

123456789101112131415161718
  1. import { describe, expect, it } from "vitest";
  2. import { OFFICIAL_DESIGN_REQUIRED_SEED_PATHS } from "../../../apps/zcode-cli/packages/bootstrap/src/app/official-plugin-definitions.js";
  3. import { REMOTE_AGENT_OFFICIAL_PLUGIN_REQUIRED_RELATIVE_PATHS } from "../src/remote/zcodeAgentOfficialPluginAssets.js";
  4. // design 的规则文件与脚本是会话里按需读取/执行的,远端缺一份只会在用到时失败;远端部署前的必需路径
  5. // 因此要覆盖本地 seed 的全部必需路径。server 运行时不依赖 bootstrap,这里机械对照两份清单。
  6. describe("remote official plugin required paths", () => {
  7. it("design 覆盖本地 seed 的全部必需路径(7 份 references、4 个脚本、hook)", () => {
  8. const remote = new Set<string>(REMOTE_AGENT_OFFICIAL_PLUGIN_REQUIRED_RELATIVE_PATHS);
  9. const missing = OFFICIAL_DESIGN_REQUIRED_SEED_PATHS.map((path) => `design-plugin/${path}`).filter(
  10. (path) => !remote.has(path),
  11. );
  12. expect(missing).toEqual([]);
  13. const seeds: readonly string[] = OFFICIAL_DESIGN_REQUIRED_SEED_PATHS;
  14. expect(seeds.filter((path) => path.startsWith("skills/design/references/"))).toHaveLength(7);
  15. expect(seeds.filter((path) => path.startsWith("skills/design/scripts/"))).toHaveLength(4);
  16. });
  17. });