diff --git a/dist/src/exportArtifacts.js b/dist/src/exportArtifacts.js index 2d1fbac..98f4301 100644 --- a/dist/src/exportArtifacts.js +++ b/dist/src/exportArtifacts.js @@ -26,6 +26,7 @@ const THREAD_DELIVERY_FILE_NAMES = new Set([ "index.html", ]); const THREAD_DELIVERY_DIRS = new Set([ + "assets", "renders", "render", "exports", @@ -43,6 +44,12 @@ const THREAD_DELIVERY_EXTENSIONS = new Set([ ".md", ".html", ".json", + ".png", + ".jpg", + ".jpeg", + ".webp", + ".gif", + ".svg", ]); export async function prepareXWorkmateArtifacts(input) { const params = input.params ?? {}; diff --git a/package.json b/package.json index 117e330..4bc6902 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openclaw-multi-session-plugins", - "version": "0.1.11", + "version": "0.1.12", "description": "OpenClaw multi-session plugin runtime support for scoped XWorkmate artifacts", "type": "module", "license": "MIT", diff --git a/src/exportArtifacts.test.ts b/src/exportArtifacts.test.ts index b0baa11..2ebf985 100644 --- a/src/exportArtifacts.test.ts +++ b/src/exportArtifacts.test.ts @@ -400,7 +400,13 @@ describe("exportXWorkmateArtifacts", () => { }); const threadRoot = path.join(root, "owners", "local", "user", "owner-hash", "threads", "draft:1779524982823421-3"); await fs.mkdir(path.join(threadRoot, "renders"), { recursive: true }); + await fs.mkdir(path.join(threadRoot, "assets", "images", "security-identity-evolution"), { recursive: true }); await fs.writeFile(path.join(threadRoot, "renders", "cloud-native-servicemesh-network.mp4"), "mp4"); + await fs.writeFile( + path.join(threadRoot, "assets", "images", "security-identity-evolution", "001-local-permission.png"), + "png", + ); + await fs.writeFile(path.join(threadRoot, "assets", "images", "manifest.md"), "manifest"); await fs.writeFile(path.join(threadRoot, "DELIVERY.md"), "delivered"); await fs.writeFile(path.join(threadRoot, "scratch.txt"), "scratch"); await fs.symlink(threadRoot, path.join(threadRoot, "venv")); @@ -424,9 +430,13 @@ describe("exportXWorkmateArtifacts", () => { expect(result.artifactScope).toBe("tasks/draft_1779524982823421-3/turn-1779685283403237342"); expect(result.artifacts.map((entry) => entry.relativePath).sort()).toEqual([ "DELIVERY.md", + "assets/images/manifest.md", + "assets/images/security-identity-evolution/001-local-permission.png", "renders/cloud-native-servicemesh-network.mp4", ]); expect(result.artifacts.map((entry) => entry.contentType).sort()).toEqual([ + "image/png", + "text/markdown", "text/markdown", "video/mp4", ]); @@ -443,6 +453,21 @@ describe("exportXWorkmateArtifacts", () => { "utf8", ), ).toBe("mp4"); + expect( + await fs.readFile( + path.join( + root, + "tasks", + "draft_1779524982823421-3", + "turn-1779685283403237342", + "assets", + "images", + "security-identity-evolution", + "001-local-permission.png", + ), + "utf8", + ), + ).toBe("png"); await expect( fs.stat(path.join(root, "tasks", "draft_1779524982823421-3", "turn-1779685283403237342", "scratch.txt")), ).rejects.toThrow(); diff --git a/src/exportArtifacts.ts b/src/exportArtifacts.ts index eefb229..ce68569 100644 --- a/src/exportArtifacts.ts +++ b/src/exportArtifacts.ts @@ -30,6 +30,7 @@ const THREAD_DELIVERY_FILE_NAMES = new Set([ ]); const THREAD_DELIVERY_DIRS = new Set([ + "assets", "renders", "render", "exports", @@ -48,6 +49,12 @@ const THREAD_DELIVERY_EXTENSIONS = new Set([ ".md", ".html", ".json", + ".png", + ".jpg", + ".jpeg", + ".webp", + ".gif", + ".svg", ]); export type XWorkmateArtifact = {