(payload: T)
| 36 | export type CursorsBySession = z.infer<typeof cursorsBySessionSchema>; |
| 37 | |
| 38 | export const wsEventEnvelopeSchema = <T extends z.ZodTypeAny>(payload: T) => |
| 39 | z.object({ |
| 40 | type: z.string(), |
| 41 | seq: z.number().int().nonnegative(), |
| 42 | epoch: z.string().optional(), |
| 43 | volatile: z.boolean().optional(), |
| 44 | /** |
| 45 | * For volatile text-delta frames (`assistant.delta` / `thinking.delta`): |
| 46 | * the cumulative character offset of this delta within the in-flight |
| 47 | * turn's accumulated stream. Clients align against |
| 48 | * `snapshot.in_flight_turn.*_text.length` — `offset < local length` is a |
| 49 | * duplicate (skip), `offset > local length` means deltas were missed |
| 50 | * (re-snapshot). |
| 51 | */ |
| 52 | offset: z.number().int().nonnegative().optional(), |
| 53 | session_id: z.string().optional(), |
| 54 | timestamp: isoDateTimeSchema, |
| 55 | payload, |
| 56 | }); |
| 57 | |
| 58 | export const wsControlEnvelopeSchema = <T extends z.ZodTypeAny>(payload: T) => |
| 59 | z.object({ |
no outgoing calls
no test coverage detected