import { z } from "@hono/zod-openapi";

//#region src/validation/stream-event-schemas.d.ts

/**
 * Vercel AI SDK Data Stream Protocol Event Schemas
 *
 * These schemas define the structure of events sent by the Inkeep Agents Run API.
 * They are used by both the streaming backend and AI SDK providers to ensure type safety.
 */
/**
 * Marks the beginning of a text stream
 */
declare const TextStartEventSchema: z.ZodObject<{
  type: z.ZodLiteral<"text-start">;
  id: z.ZodString;
}, z.core.$strip>;
/**
 * Represents a chunk of streaming text
 */
declare const TextDeltaEventSchema: z.ZodObject<{
  type: z.ZodLiteral<"text-delta">;
  id: z.ZodString;
  delta: z.ZodString;
}, z.core.$strip>;
/**
 * Marks the end of a text stream
 */
declare const TextEndEventSchema: z.ZodObject<{
  type: z.ZodLiteral<"text-end">;
  id: z.ZodString;
}, z.core.$strip>;
/**
 * Data component event - structured data in the stream
 * Used for artifacts, visualizations, or other structured outputs
 */
declare const DataComponentStreamEventSchema: z.ZodObject<{
  type: z.ZodLiteral<"data-component">;
  id: z.ZodString;
  data: z.ZodAny;
}, z.core.$strip>;
/**
 * Data operation event - agent operations and state changes
 * Wraps operation events (agent_initializing, completion, etc.)
 */
declare const DataOperationStreamEventSchema: z.ZodObject<{
  type: z.ZodLiteral<"data-operation">;
  data: z.ZodAny;
}, z.core.$strip>;
/**
 * Data summary event - progress summaries and status updates
 */
declare const DataSummaryStreamEventSchema: z.ZodObject<{
  type: z.ZodLiteral<"data-summary">;
  data: z.ZodAny;
}, z.core.$strip>;
/**
 * Stream error event
 */
declare const StreamErrorEventSchema: z.ZodObject<{
  type: z.ZodLiteral<"error">;
  error: z.ZodString;
}, z.core.$strip>;
/**
 * Stream finish event with usage statistics
 */
declare const StreamFinishEventSchema: z.ZodObject<{
  type: z.ZodLiteral<"finish">;
  finishReason: z.ZodOptional<z.ZodString>;
  usage: z.ZodOptional<z.ZodObject<{
    promptTokens: z.ZodOptional<z.ZodNumber>;
    completionTokens: z.ZodOptional<z.ZodNumber>;
    totalTokens: z.ZodOptional<z.ZodNumber>;
  }, z.core.$strip>>;
}, z.core.$strip>;
/**
 * Tool input start event - marks beginning of tool input streaming
 */
declare const ToolInputStartEventSchema: z.ZodObject<{
  type: z.ZodLiteral<"tool-input-start">;
  toolCallId: z.ZodString;
  toolName: z.ZodString;
}, z.core.$strip>;
/**
 * Tool input delta event - streaming chunks of tool input
 */
declare const ToolInputDeltaEventSchema: z.ZodObject<{
  type: z.ZodLiteral<"tool-input-delta">;
  toolCallId: z.ZodString;
  inputTextDelta: z.ZodString;
}, z.core.$strip>;
/**
 * Tool input available event - complete tool input is available
 */
declare const ToolInputAvailableEventSchema: z.ZodObject<{
  type: z.ZodLiteral<"tool-input-available">;
  toolCallId: z.ZodString;
  toolName: z.ZodString;
  input: z.ZodAny;
  providerMetadata: z.ZodOptional<z.ZodAny>;
}, z.core.$strip>;
/**
 * Tool output available event - tool execution result
 */
declare const ToolOutputAvailableEventSchema: z.ZodObject<{
  type: z.ZodLiteral<"tool-output-available">;
  toolCallId: z.ZodString;
  output: z.ZodAny;
}, z.core.$strip>;
/**
 * Tool output error event - tool execution failed
 */
declare const ToolOutputErrorEventSchema: z.ZodObject<{
  type: z.ZodLiteral<"tool-output-error">;
  toolCallId: z.ZodString;
  errorText: z.ZodString;
}, z.core.$strip>;
/**
 * Tool approval request event - requesting user approval for tool execution
 */
declare const ToolApprovalRequestEventSchema: z.ZodObject<{
  type: z.ZodLiteral<"tool-approval-request">;
  approvalId: z.ZodString;
  toolCallId: z.ZodString;
  toolName: z.ZodOptional<z.ZodString>;
  input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
}, z.core.$strip>;
/**
 * Tool output denied event - tool execution was denied by user
 */
declare const ToolOutputDeniedEventSchema: z.ZodObject<{
  type: z.ZodLiteral<"tool-output-denied">;
  toolCallId: z.ZodString;
}, z.core.$strip>;
/**
 * Union of all stream event types
 * This is the main schema used for validating incoming stream events
 */
declare const StreamEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
  type: z.ZodLiteral<"text-start">;
  id: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
  type: z.ZodLiteral<"text-delta">;
  id: z.ZodString;
  delta: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
  type: z.ZodLiteral<"text-end">;
  id: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
  type: z.ZodLiteral<"data-component">;
  id: z.ZodString;
  data: z.ZodAny;
}, z.core.$strip>, z.ZodObject<{
  type: z.ZodLiteral<"data-operation">;
  data: z.ZodAny;
}, z.core.$strip>, z.ZodObject<{
  type: z.ZodLiteral<"data-summary">;
  data: z.ZodAny;
}, z.core.$strip>, z.ZodObject<{
  type: z.ZodLiteral<"error">;
  error: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
  type: z.ZodLiteral<"finish">;
  finishReason: z.ZodOptional<z.ZodString>;
  usage: z.ZodOptional<z.ZodObject<{
    promptTokens: z.ZodOptional<z.ZodNumber>;
    completionTokens: z.ZodOptional<z.ZodNumber>;
    totalTokens: z.ZodOptional<z.ZodNumber>;
  }, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
  type: z.ZodLiteral<"tool-input-start">;
  toolCallId: z.ZodString;
  toolName: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
  type: z.ZodLiteral<"tool-input-delta">;
  toolCallId: z.ZodString;
  inputTextDelta: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
  type: z.ZodLiteral<"tool-input-available">;
  toolCallId: z.ZodString;
  toolName: z.ZodString;
  input: z.ZodAny;
  providerMetadata: z.ZodOptional<z.ZodAny>;
}, z.core.$strip>, z.ZodObject<{
  type: z.ZodLiteral<"tool-output-available">;
  toolCallId: z.ZodString;
  output: z.ZodAny;
}, z.core.$strip>, z.ZodObject<{
  type: z.ZodLiteral<"tool-output-error">;
  toolCallId: z.ZodString;
  errorText: z.ZodString;
}, z.core.$strip>, z.ZodObject<{
  type: z.ZodLiteral<"tool-approval-request">;
  approvalId: z.ZodString;
  toolCallId: z.ZodString;
  toolName: z.ZodOptional<z.ZodString>;
  input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
}, z.core.$strip>, z.ZodObject<{
  type: z.ZodLiteral<"tool-output-denied">;
  toolCallId: z.ZodString;
}, z.core.$strip>], "type">;
type TextStartEvent = z.infer<typeof TextStartEventSchema>;
type TextDeltaEvent = z.infer<typeof TextDeltaEventSchema>;
type TextEndEvent = z.infer<typeof TextEndEventSchema>;
type DataComponentStreamEvent = z.infer<typeof DataComponentStreamEventSchema>;
type DataOperationStreamEvent = z.infer<typeof DataOperationStreamEventSchema>;
type DataSummaryStreamEvent = z.infer<typeof DataSummaryStreamEventSchema>;
type StreamErrorEvent = z.infer<typeof StreamErrorEventSchema>;
type StreamFinishEvent = z.infer<typeof StreamFinishEventSchema>;
type ToolInputStartEvent = z.infer<typeof ToolInputStartEventSchema>;
type ToolInputDeltaEvent = z.infer<typeof ToolInputDeltaEventSchema>;
type ToolInputAvailableEvent = z.infer<typeof ToolInputAvailableEventSchema>;
type ToolOutputAvailableEvent = z.infer<typeof ToolOutputAvailableEventSchema>;
type ToolOutputErrorEvent = z.infer<typeof ToolOutputErrorEventSchema>;
type ToolApprovalRequestEvent = z.infer<typeof ToolApprovalRequestEventSchema>;
type ToolOutputDeniedEvent = z.infer<typeof ToolOutputDeniedEventSchema>;
/**
 * Union type of all possible stream events
 */
type StreamEvent = z.infer<typeof StreamEventSchema>;
//#endregion
export { DataComponentStreamEvent, DataComponentStreamEventSchema, DataOperationStreamEvent, DataOperationStreamEventSchema, DataSummaryStreamEvent, DataSummaryStreamEventSchema, StreamErrorEvent, StreamErrorEventSchema, StreamEvent, StreamEventSchema, StreamFinishEvent, StreamFinishEventSchema, TextDeltaEvent, TextDeltaEventSchema, TextEndEvent, TextEndEventSchema, TextStartEvent, TextStartEventSchema, ToolApprovalRequestEvent, ToolApprovalRequestEventSchema, ToolInputAvailableEvent, ToolInputAvailableEventSchema, ToolInputDeltaEvent, ToolInputDeltaEventSchema, ToolInputStartEvent, ToolInputStartEventSchema, ToolOutputAvailableEvent, ToolOutputAvailableEventSchema, ToolOutputDeniedEvent, ToolOutputDeniedEventSchema, ToolOutputErrorEvent, ToolOutputErrorEventSchema };