diff --git a/README.md b/README.md index 763ac2d..b1ca9d5 100644 --- a/README.md +++ b/README.md @@ -140,8 +140,9 @@ Export response payload: Files at or below `maxInlineBytes` also include `encoding: "base64"` and `content`. When `artifactScope` is omitted, export/list defaults to the current task scope derived from `sessionKey/runId`. If that scope has no files, export/list returns -an empty artifact list. The plugin does not scan the workspace root and does not -borrow artifacts from earlier task scopes. +an empty artifact list with the manifest text `No artifacts found for this task +run.` The plugin does not scan the workspace root and does not borrow artifacts +from earlier task scopes. Each exported artifact includes `artifactRef`, a plugin-signed reference over the issued session/run scope, artifact scope, path, size, and SHA-256 digest. `read` accepts diff --git a/dist/src/exportArtifacts.js b/dist/src/exportArtifacts.js index e1380df..a7c89bf 100644 --- a/dist/src/exportArtifacts.js +++ b/dist/src/exportArtifacts.js @@ -87,7 +87,7 @@ export async function exportXWorkmateArtifacts(input) { }) : []; if (!scopePrepared) { - warnings.push("artifact scope is not prepared"); + warnings.push("artifact scope is not prepared for this task run"); } candidates.sort((left, right) => { if (right.mtimeMs !== left.mtimeMs) { @@ -265,7 +265,7 @@ export function formatArtifactManifestMarkdown(input) { "", ]; if (input.artifacts.length === 0) { - lines.push("No artifacts found."); + lines.push("No artifacts found for this task run."); } else { lines.push("| File | Type | Size | SHA-256 | Inline |"); diff --git a/index.test.ts b/index.test.ts index 470cbc5..ac686dc 100644 --- a/index.test.ts +++ b/index.test.ts @@ -114,7 +114,8 @@ describe("plugin registration", () => { }); expect(unprepared.ok).toBe(true); expect(unprepared.payload?.artifacts).toEqual([]); - expect(unprepared.payload?.warnings).toEqual(["artifact scope is not prepared"]); + expect(unprepared.payload?.warnings).toEqual(["artifact scope is not prepared for this task run"]); + expect(unprepared.payload?.manifestMarkdown).toContain("No artifacts found for this task run."); }); it("does not invent default session or run ids for the optional agent tool", async () => { diff --git a/src/exportArtifacts.test.ts b/src/exportArtifacts.test.ts index 0ac22eb..607e243 100644 --- a/src/exportArtifacts.test.ts +++ b/src/exportArtifacts.test.ts @@ -194,6 +194,8 @@ describe("exportXWorkmateArtifacts", () => { expect(result.scopeKind).toBe("task"); expect(result.artifacts).toEqual([]); + expect(result.manifestMarkdown).toContain("No artifacts found for this task run."); + expect(result.manifestMarkdown).toContain("Artifact scope: `tasks/thread-main/turn-1`"); }); it("rejects scoped exports that do not match the requested session/run", async () => { diff --git a/src/exportArtifacts.ts b/src/exportArtifacts.ts index f454cef..2ab1901 100644 --- a/src/exportArtifacts.ts +++ b/src/exportArtifacts.ts @@ -168,7 +168,7 @@ export async function exportXWorkmateArtifacts(input: ExportInput): Promise { @@ -366,7 +366,7 @@ export function formatArtifactManifestMarkdown(input: { "", ]; if (input.artifacts.length === 0) { - lines.push("No artifacts found."); + lines.push("No artifacts found for this task run."); } else { lines.push("| File | Type | Size | SHA-256 | Inline |"); lines.push("| --- | --- | ---: | --- | --- |");