File
Blob: src/contracts/log.ts
| 1 | import { eg, type TypeFromCodec } from "@cloudflare/util-en-garde"; |
| 2 | |
| 3 | import { IsoDateTime, OpaqueId, RunId } from "@/contracts/common"; |
| 4 | import { LogStream } from "@/contracts/execution"; |
| 5 | |
| 6 | export const LogEvent = eg.exactStrict( |
| 7 | eg.object({ |
| 8 | id: OpaqueId, |
| 9 | runId: RunId, |
| 10 | seq: eg.number, |
| 11 | stream: LogStream, |
| 12 | chunk: eg.string, |
| 13 | createdAt: IsoDateTime, |
| 14 | }), |
| 15 | ); |
| 16 | export type LogEvent = TypeFromCodec<typeof LogEvent>; |