diff --git a/sdks/typescript/packages/core/src/events.ts b/sdks/typescript/packages/core/src/events.ts index 2ef11be8cf..df2d0e74c2 100644 --- a/sdks/typescript/packages/core/src/events.ts +++ b/sdks/typescript/packages/core/src/events.ts @@ -361,6 +361,17 @@ export const EventSchemas = z.discriminatedUnion("type", [ export type BaseEvent = z.infer; export type AGUIEvent = z.infer; +/** + * Input-side counterpart to {@link AGUIEvent}. + * + * `AGUIEvent` is the parsed/output shape (`z.infer`), where every field with a + * schema default is required. `AGUIEventInput` is the pre-parse shape + * (`z.input`), where defaulted fields are optional. Emitters constructing + * events to hand to `EventSchemas.parse` should type against this union so the + * compiler checks the discriminated payload without forcing them to restate + * defaults. + */ +export type AGUIEventInput = z.input; export type BaseEventFields = z.infer; export type AGUIEventByType = { [EventType.TEXT_MESSAGE_START]: TextMessageStartEvent;