export const CH = { start: "stream:start", stop: "stream:stop", stats: "stream:stats", export: "stream:export", batch: "stream:batch", }; const SOURCES = ["build", "network", "tools"]; const LEVELS = ["info", "warn", "error"]; function isEvent(value) { if (typeof value !== "object" || value === null) return false; const event = value; return (typeof event.id === "number" && Number.isFinite(event.id) && typeof event.ts === "number" && SOURCES.includes(event.source) && LEVELS.includes(event.level) && typeof event.text === "string" && event.text.length > 0 && event.text.length <= 500); } export function assertExportReq(value) { if (typeof value !== "object" || value === null) { throw new Error("BAD_EXPORT_REQ"); } const events = value.events; if (!Array.isArray(events) || events.length > 10_000) { throw new Error("BAD_EXPORT_SIZE"); } if (!events.every(isEvent)) throw new Error("BAD_EXPORT_EVENT"); } //# sourceMappingURL=ipc.js.map