feat(canvas): finalize mixer reconnect swap and related updates

This commit is contained in:
2026-04-11 07:42:42 +02:00
parent f3dcaf89f2
commit 028fce35c2
52 changed files with 3859 additions and 272 deletions

View File

@@ -47,6 +47,10 @@ describe("normalizeAgentStructuredOutput", () => {
language: "en",
tags: ["launch", "saas"],
},
metadataLabels: {
language: "language",
tags: "tags",
},
qualityChecks: ["concise", "channel-fit"],
body: "Legacy flat content",
});
@@ -145,4 +149,38 @@ describe("normalizeAgentStructuredOutput", () => {
"Hook:\nLead with a bold claim.\n\nCTA:\nInvite replies with a concrete question.",
);
});
it("slugifies non-ascii metadata keys and preserves original labels", () => {
const normalized = normalizeAgentStructuredOutput(
{
sections: [
{
id: "caption",
label: "Caption",
content: "Publish-ready caption.",
},
],
metadataEntries: [
{ key: "tonalität", values: ["freundlich"] },
{ key: "hashtags", values: ["dogs", "berner-sennenhund"] },
{ key: "empty", values: [] },
{ key: " ", values: ["ignored"] },
],
},
{
title: "Fallback Title",
channel: "fallback-channel",
artifactType: "fallback-artifact",
},
);
expect(normalized.metadata).toEqual({
tonalitaet: "freundlich",
hashtags: ["dogs", "berner-sennenhund"],
});
expect(normalized.metadataLabels).toEqual({
tonalitaet: "tonalität",
hashtags: "hashtags",
});
});
});