Make PayloadEvent typesafe w/ discriminated union

This commit is contained in:
Colin McDonnell
2025-11-20 15:57:20 -08:00
parent e5878de9e4
commit f8bb2e12f3
3 changed files with 90 additions and 4 deletions
+2 -1
View File
@@ -1,3 +1,4 @@
import { encode as toonEncode } from "@toon-format/toon";
import type { Payload } from "../external.ts";
import { ghPullfrogMcpName } from "../external.ts";
import { modes } from "../modes.ts";
@@ -62,4 +63,4 @@ ${[...modes, ...payload.modes].map((w) => ` - "${w.name}": ${w.description}`)
${payload.prompt}
${typeof payload.event === "string" ? payload.event : JSON.stringify(payload.event, null, 2)}`;
${toonEncode(payload.event)}`;