/** * AG-UI SSE Events Route * * GET /events/ag-ui - Server-Sent Events stream for AG-UI protocol clients. * * Provides AG-UI protocol compatibility while preserving Gizmo's observability. * Events are generated by the ag-ui-adapter-plugin and emitted via EventEmitter. */ import { Hono } from "hono"; import type { Runtime, Action } from "@gizmo-ai/runtime"; import type { EventEmitter } from "events"; export interface AGUIEventsRouteConfig, A extends Action> { /** * Runtime instance */ runtime: Runtime; /** * EventEmitter from ag-ui-adapter-plugin * Should be the same bus passed to agUIAdapterPlugin() */ bus: EventEmitter; /** * Which state slices to include in STATE_SNAPSHOT * Default: ['agent'] (only agent slice) */ slices?: string[]; /** * Heartbeat interval in milliseconds * Default: 30000 (30 seconds) */ heartbeatInterval?: number; /** * JSON serializer function */ serializer: (value: unknown) => string; } /** * Create the AG-UI SSE events route * * This route provides AG-UI protocol compatibility for frontend clients. * It streams AG-UI events (RunStarted, TextMessageContent, ToolCallStart, etc.) * and STATE_DELTA events with RFC 6902 JSON Patch operations. * * @example * ```typescript * import { createAGUIEventsRoute } from "@gizmo-ai/server"; * import { agUIAdapterPlugin } from "@gizmo-ai/ag-ui-adapter-plugin"; * * const adapter = agUIAdapterPlugin(); * const aguiRoute = createAGUIEventsRoute({ * runtime, * bus: adapter.bus, * serializer: JSON.stringify, * }); * * app.route("/events/ag-ui", aguiRoute); * ``` */ export declare function createAGUIEventsRoute, A extends Action>(config: AGUIEventsRouteConfig): Hono; /** * Helper to check if AG-UI adapter plugin is configured * * @param runtime - Runtime instance * @returns True if ag-ui-adapter-plugin is present */ export declare function hasAGUIAdapter>(runtime: Runtime): boolean; //# sourceMappingURL=ag-ui-events.d.ts.map