2026-08-14 15:41:59 +08:00

26 lines
586 B
TypeScript

import { z } from "zod";
export const runEventSchema = z.object({
runId: z.string(),
sequence: z.number().int().positive(),
timestamp: z.string(),
type: z.enum([
"run.started",
"message.started",
"message.delta",
"message.completed",
"interaction.requested",
"interaction.resolved",
"interaction.cancelled",
"tool.started",
"tool.completed",
"tool.failed",
"run.completed",
"run.failed",
"run.cancelled",
]),
payload: z.record(z.string(), z.unknown()),
});
export type RunEventResponse = z.infer<typeof runEventSchema>;