feat(canvas): AI 拆图 - 完善规划、图层编辑与素材复用

This commit is contained in:
Codex
2026-10-09 16:42:56 +08:00
parent 09f9b8e902
commit 5707102fbc
56 changed files with 3541 additions and 162 deletions

View File

@@ -0,0 +1,15 @@
import { expect, test } from "bun:test";
import { readFileSync } from "node:fs";
import { unzipSync, strFromU8 } from "fflate";
test("发布的拆层协议包与源码一致且请求 PNG,不丢失多图输出列表", () => {
const source = JSON.parse(readFileSync(new URL("../../plugin-packages/image-tools/manifest.json", import.meta.url), "utf8"));
const archive = unzipSync(readFileSync(new URL("../../plugin-packages/image-tools.yingce-plugin", import.meta.url)));
const packaged = JSON.parse(strFromU8(archive["manifest.json"]));
expect(packaged).toEqual(source);
const provider = packaged.contributes.providers.find((item: { id: string }) => item.id === "image-tools-layer-decomposition");
expect(provider.create.body.output_format).toBe("png");
expect(provider.create.path).toBe("/bytedance/seedream-v5.0-pro/layer-decomposition");
expect(provider.response.images).toEqual({ $ref: "response.data.outputs" });
expect(packaged.version).toBe("1.0.1");
});