22 lines
579 B
JavaScript
22 lines
579 B
JavaScript
import assert from "node:assert/strict";
|
|
import test from "node:test";
|
|
|
|
import { unwrapSkillResponse } from "../src/a2a.js";
|
|
|
|
test("unwraps the production invoke response envelope", () => {
|
|
const result = {
|
|
status: "ok",
|
|
svg_assets: [{ name: "sprite.svg", svg: "<svg></svg>" }],
|
|
};
|
|
|
|
assert.deepEqual(
|
|
unwrapSkillResponse({ result, events: [], artifacts: [], grant_id: null }),
|
|
result,
|
|
);
|
|
});
|
|
|
|
test("keeps direct skill responses compatible", () => {
|
|
const result = { status: "ok", receipts: [] };
|
|
assert.equal(unwrapSkillResponse(result), result);
|
|
});
|