/** * Framework-generic event schemas. * * These are emitted automatically by the Agent + built-in stores. Bots can * compose their own event schemas alongside (see README) — they all flow into * the same Analytics Engine dataset. * * Wall: keep these payloads *minimal* and *non-PII*. No message bodies, no * answer text. Just metadata, identifiers, latency, status. */ import { z } from 'zod'; export declare const MessageInboundEvent: z.ZodObject<{ type: z.ZodLiteral<"message_inbound">; whatsapp: z.ZodString; wamid: z.ZodString; messageType: z.ZodEnum<["text", "audio", "image", "button_reply", "list_reply", "template_button", "document", "interactive"]>; isFirstContact: z.ZodBoolean; fromAd: z.ZodBoolean; v: z.ZodLiteral<1>; ts: z.ZodString; traceId: z.ZodString; tenantId: z.ZodOptional; }, "strip", z.ZodTypeAny, { wamid: string; whatsapp: string; type: "message_inbound"; traceId: string; messageType: "text" | "audio" | "image" | "button_reply" | "list_reply" | "template_button" | "document" | "interactive"; isFirstContact: boolean; fromAd: boolean; v: 1; ts: string; tenantId?: string | undefined; }, { wamid: string; whatsapp: string; type: "message_inbound"; traceId: string; messageType: "text" | "audio" | "image" | "button_reply" | "list_reply" | "template_button" | "document" | "interactive"; isFirstContact: boolean; fromAd: boolean; v: 1; ts: string; tenantId?: string | undefined; }>; export declare const OptInEvent: z.ZodObject<{ type: z.ZodLiteral<"opt_in">; whatsapp: z.ZodString; v: z.ZodLiteral<1>; ts: z.ZodString; traceId: z.ZodString; tenantId: z.ZodOptional; }, "strip", z.ZodTypeAny, { whatsapp: string; type: "opt_in"; traceId: string; v: 1; ts: string; tenantId?: string | undefined; }, { whatsapp: string; type: "opt_in"; traceId: string; v: 1; ts: string; tenantId?: string | undefined; }>; export declare const OptOutEvent: z.ZodObject<{ type: z.ZodLiteral<"opt_out">; whatsapp: z.ZodString; v: z.ZodLiteral<1>; ts: z.ZodString; traceId: z.ZodString; tenantId: z.ZodOptional; }, "strip", z.ZodTypeAny, { whatsapp: string; type: "opt_out"; traceId: string; v: 1; ts: string; tenantId?: string | undefined; }, { whatsapp: string; type: "opt_out"; traceId: string; v: 1; ts: string; tenantId?: string | undefined; }>; export declare const GateBlockedEvent: z.ZodObject<{ type: z.ZodLiteral<"gate_blocked">; whatsapp: z.ZodString; tier: z.ZodString; reason: z.ZodEnum<["tier", "trial", "denied"]>; v: z.ZodLiteral<1>; ts: z.ZodString; traceId: z.ZodString; tenantId: z.ZodOptional; }, "strip", z.ZodTypeAny, { whatsapp: string; type: "gate_blocked"; reason: "tier" | "trial" | "denied"; traceId: string; v: 1; ts: string; tier: string; tenantId?: string | undefined; }, { whatsapp: string; type: "gate_blocked"; reason: "tier" | "trial" | "denied"; traceId: string; v: 1; ts: string; tier: string; tenantId?: string | undefined; }>; export declare const BroadcastSentEvent: z.ZodObject<{ type: z.ZodLiteral<"broadcast_sent">; whatsapp: z.ZodString; channel: z.ZodString; v: z.ZodLiteral<1>; ts: z.ZodString; traceId: z.ZodString; tenantId: z.ZodOptional; }, "strip", z.ZodTypeAny, { whatsapp: string; type: "broadcast_sent"; channel: string; traceId: string; v: 1; ts: string; tenantId?: string | undefined; }, { whatsapp: string; type: "broadcast_sent"; channel: string; traceId: string; v: 1; ts: string; tenantId?: string | undefined; }>; export declare const PlanDayDeliveredEvent: z.ZodObject<{ type: z.ZodLiteral<"plan_day_delivered">; whatsapp: z.ZodString; planId: z.ZodNumber; day: z.ZodNumber; v: z.ZodLiteral<1>; ts: z.ZodString; traceId: z.ZodString; tenantId: z.ZodOptional; }, "strip", z.ZodTypeAny, { whatsapp: string; type: "plan_day_delivered"; planId: number; day: number; traceId: string; v: 1; ts: string; tenantId?: string | undefined; }, { whatsapp: string; type: "plan_day_delivered"; planId: number; day: number; traceId: string; v: 1; ts: string; tenantId?: string | undefined; }>; export declare const AgentDecisionEvent: z.ZodObject<{ type: z.ZodLiteral<"agent_decision">; whatsapp: z.ZodString; intent: z.ZodString; action: z.ZodEnum<["reply", "escalate", "silent"]>; latencyMs: z.ZodNumber; model: z.ZodNullable; v: z.ZodLiteral<1>; ts: z.ZodString; traceId: z.ZodString; tenantId: z.ZodOptional; }, "strip", z.ZodTypeAny, { whatsapp: string; type: "agent_decision"; traceId: string; model: string | null; latencyMs: number; v: 1; ts: string; intent: string; action: "reply" | "escalate" | "silent"; tenantId?: string | undefined; }, { whatsapp: string; type: "agent_decision"; traceId: string; model: string | null; latencyMs: number; v: 1; ts: string; intent: string; action: "reply" | "escalate" | "silent"; tenantId?: string | undefined; }>; export declare const AgentOutcomeEvent: z.ZodObject<{ type: z.ZodLiteral<"agent_outcome">; parentTraceId: z.ZodString; outcome: z.ZodEnum<["ok", "error", "timeout", "no_response"]>; v: z.ZodLiteral<1>; ts: z.ZodString; traceId: z.ZodString; tenantId: z.ZodOptional; }, "strip", z.ZodTypeAny, { type: "agent_outcome"; traceId: string; v: 1; ts: string; parentTraceId: string; outcome: "ok" | "error" | "timeout" | "no_response"; tenantId?: string | undefined; }, { type: "agent_outcome"; traceId: string; v: 1; ts: string; parentTraceId: string; outcome: "ok" | "error" | "timeout" | "no_response"; tenantId?: string | undefined; }>; export declare const ErrorEvent: z.ZodObject<{ type: z.ZodLiteral<"error">; whatsapp: z.ZodOptional; source: z.ZodString; message: z.ZodString; v: z.ZodLiteral<1>; ts: z.ZodString; traceId: z.ZodString; tenantId: z.ZodOptional; }, "strip", z.ZodTypeAny, { type: "error"; message: string; traceId: string; v: 1; ts: string; source: string; whatsapp?: string | undefined; tenantId?: string | undefined; }, { type: "error"; message: string; traceId: string; v: 1; ts: string; source: string; whatsapp?: string | undefined; tenantId?: string | undefined; }>; export declare const FrameworkEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ type: z.ZodLiteral<"message_inbound">; whatsapp: z.ZodString; wamid: z.ZodString; messageType: z.ZodEnum<["text", "audio", "image", "button_reply", "list_reply", "template_button", "document", "interactive"]>; isFirstContact: z.ZodBoolean; fromAd: z.ZodBoolean; v: z.ZodLiteral<1>; ts: z.ZodString; traceId: z.ZodString; tenantId: z.ZodOptional; }, "strip", z.ZodTypeAny, { wamid: string; whatsapp: string; type: "message_inbound"; traceId: string; messageType: "text" | "audio" | "image" | "button_reply" | "list_reply" | "template_button" | "document" | "interactive"; isFirstContact: boolean; fromAd: boolean; v: 1; ts: string; tenantId?: string | undefined; }, { wamid: string; whatsapp: string; type: "message_inbound"; traceId: string; messageType: "text" | "audio" | "image" | "button_reply" | "list_reply" | "template_button" | "document" | "interactive"; isFirstContact: boolean; fromAd: boolean; v: 1; ts: string; tenantId?: string | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"opt_in">; whatsapp: z.ZodString; v: z.ZodLiteral<1>; ts: z.ZodString; traceId: z.ZodString; tenantId: z.ZodOptional; }, "strip", z.ZodTypeAny, { whatsapp: string; type: "opt_in"; traceId: string; v: 1; ts: string; tenantId?: string | undefined; }, { whatsapp: string; type: "opt_in"; traceId: string; v: 1; ts: string; tenantId?: string | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"opt_out">; whatsapp: z.ZodString; v: z.ZodLiteral<1>; ts: z.ZodString; traceId: z.ZodString; tenantId: z.ZodOptional; }, "strip", z.ZodTypeAny, { whatsapp: string; type: "opt_out"; traceId: string; v: 1; ts: string; tenantId?: string | undefined; }, { whatsapp: string; type: "opt_out"; traceId: string; v: 1; ts: string; tenantId?: string | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"gate_blocked">; whatsapp: z.ZodString; tier: z.ZodString; reason: z.ZodEnum<["tier", "trial", "denied"]>; v: z.ZodLiteral<1>; ts: z.ZodString; traceId: z.ZodString; tenantId: z.ZodOptional; }, "strip", z.ZodTypeAny, { whatsapp: string; type: "gate_blocked"; reason: "tier" | "trial" | "denied"; traceId: string; v: 1; ts: string; tier: string; tenantId?: string | undefined; }, { whatsapp: string; type: "gate_blocked"; reason: "tier" | "trial" | "denied"; traceId: string; v: 1; ts: string; tier: string; tenantId?: string | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"broadcast_sent">; whatsapp: z.ZodString; channel: z.ZodString; v: z.ZodLiteral<1>; ts: z.ZodString; traceId: z.ZodString; tenantId: z.ZodOptional; }, "strip", z.ZodTypeAny, { whatsapp: string; type: "broadcast_sent"; channel: string; traceId: string; v: 1; ts: string; tenantId?: string | undefined; }, { whatsapp: string; type: "broadcast_sent"; channel: string; traceId: string; v: 1; ts: string; tenantId?: string | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"plan_day_delivered">; whatsapp: z.ZodString; planId: z.ZodNumber; day: z.ZodNumber; v: z.ZodLiteral<1>; ts: z.ZodString; traceId: z.ZodString; tenantId: z.ZodOptional; }, "strip", z.ZodTypeAny, { whatsapp: string; type: "plan_day_delivered"; planId: number; day: number; traceId: string; v: 1; ts: string; tenantId?: string | undefined; }, { whatsapp: string; type: "plan_day_delivered"; planId: number; day: number; traceId: string; v: 1; ts: string; tenantId?: string | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"agent_decision">; whatsapp: z.ZodString; intent: z.ZodString; action: z.ZodEnum<["reply", "escalate", "silent"]>; latencyMs: z.ZodNumber; model: z.ZodNullable; v: z.ZodLiteral<1>; ts: z.ZodString; traceId: z.ZodString; tenantId: z.ZodOptional; }, "strip", z.ZodTypeAny, { whatsapp: string; type: "agent_decision"; traceId: string; model: string | null; latencyMs: number; v: 1; ts: string; intent: string; action: "reply" | "escalate" | "silent"; tenantId?: string | undefined; }, { whatsapp: string; type: "agent_decision"; traceId: string; model: string | null; latencyMs: number; v: 1; ts: string; intent: string; action: "reply" | "escalate" | "silent"; tenantId?: string | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"agent_outcome">; parentTraceId: z.ZodString; outcome: z.ZodEnum<["ok", "error", "timeout", "no_response"]>; v: z.ZodLiteral<1>; ts: z.ZodString; traceId: z.ZodString; tenantId: z.ZodOptional; }, "strip", z.ZodTypeAny, { type: "agent_outcome"; traceId: string; v: 1; ts: string; parentTraceId: string; outcome: "ok" | "error" | "timeout" | "no_response"; tenantId?: string | undefined; }, { type: "agent_outcome"; traceId: string; v: 1; ts: string; parentTraceId: string; outcome: "ok" | "error" | "timeout" | "no_response"; tenantId?: string | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"error">; whatsapp: z.ZodOptional; source: z.ZodString; message: z.ZodString; v: z.ZodLiteral<1>; ts: z.ZodString; traceId: z.ZodString; tenantId: z.ZodOptional; }, "strip", z.ZodTypeAny, { type: "error"; message: string; traceId: string; v: 1; ts: string; source: string; whatsapp?: string | undefined; tenantId?: string | undefined; }, { type: "error"; message: string; traceId: string; v: 1; ts: string; source: string; whatsapp?: string | undefined; tenantId?: string | undefined; }>]>; export type FrameworkEvent = z.infer; export type FrameworkEventType = FrameworkEvent['type']; /** Input shape — `v`, `ts`, `traceId` are stamped by `emit()`. */ export type FrameworkEventInput = { [T in FrameworkEventType]: Omit, 'v' | 'ts' | 'traceId'> & { traceId?: string; }; }[FrameworkEventType]; //# sourceMappingURL=schemas.d.ts.map