/* eslint-disable */ // @generated by packages/widget/scripts/generate-runtype-openapi-types.mjs // Source: openapi/runtype-public-openapi.local.json // // Refresh the source snapshot from the public Runtype OpenAPI endpoint with: // pnpm --filter @runtypelabs/persona fetch:runtype-openapi // Then regenerate this file with: // pnpm --filter @runtypelabs/persona generate:runtype-types export type RuntypeExecutionStreamEvent = ({ agentId?: string; agentName?: string; config?: Record; executionId: string; flowId?: string; flowName?: string; kind: "agent" | "flow"; maxTurns?: number; seq: number; source?: string; startedAt: string; totalSteps?: number; type: "execution_start"; }) | ({ completedAt?: string; durationMs?: number; executionId: string; failedSteps?: number; finalOutput?: string; iterations?: number; kind: "agent" | "flow"; seq: number; stopReason?: string; success: boolean; successfulSteps?: number; totalCost?: number; totalSteps?: number; totalTokens?: { input: number; output: number; }; type: "execution_complete"; }) | ({ code?: string; completedAt?: string; error: string | { code: string; details?: Record; message: string; }; executionId: string; kind: "agent" | "flow"; seq: number; type: "execution_error"; upgradeUrl?: string; }) | ({ executionId: string; id: string; iteration?: number; role: "user" | "assistant" | "system"; seq: number; turnIndex?: number; type: "turn_start"; }) | ({ completedAt?: string; content?: string; cost?: number; executionId: string; fallback?: { attempts: Array<{ attempt: number; error?: string; model?: string; success: boolean; type: "retry" | "model" | "message" | "flow"; }>; exhausted: boolean; model?: string; reason?: string | null; used: boolean; }; id: string; iteration?: number; role: "user" | "assistant" | "system"; seq: number; stopReason?: "end_turn" | "max_tool_calls" | "length" | "content_filter" | "error" | "unknown"; tokens?: { input: number; output: number; }; type: "turn_complete"; }) | { executionId: string; id: string; index?: number; name?: string; outputVariable?: string; seq: number; startedAt?: string; stepType?: string; totalSteps?: number; type: "step_start"; } | ({ completedAt?: string; durationMs?: number; error?: string; executionId: string; fallback?: { attempts: Array<{ attempt: number; error?: string; model?: string; success: boolean; type: "retry" | "model" | "message" | "flow"; }>; exhausted: boolean; model?: string; reason?: string | null; used: boolean; }; id: string; name?: string; result?: unknown; seq: number; stepType?: string; stopReason?: "end_turn" | "max_tool_calls" | "length" | "content_filter" | "error" | "unknown"; success?: boolean; tokensUsed?: number; type: "step_complete"; unresolvedVariables?: Array; }) | { executionId: string; id: string; index?: number; name?: string; seq: number; skippedAt?: string; stepType?: string; totalSteps?: number; type: "step_skip"; when?: string; } | ({ executionId: string; id: string; parentToolCallId?: string; role?: "user" | "assistant" | "system"; seq: number; stepId?: string; turnId?: string; type: "text_start"; }) | { delta: string; executionId: string; id: string; seq: number; type: "text_delta"; } | { executionId: string; id: string; seq: number; text?: string; type: "text_complete"; } | ({ executionId: string; id: string; parentToolCallId?: string; scope?: "turn" | "loop"; seq: number; type: "reasoning_start"; }) | { delta: string; executionId: string; id: string; seq: number; type: "reasoning_delta"; } | ({ executionId: string; id: string; scope?: "turn" | "loop"; seq: number; text?: string; type: "reasoning_complete"; }) | ({ executionId: string; id: string; mediaType: string; role?: "user" | "assistant" | "system"; seq: number; toolCallId?: string; type: "media_start"; }) | { delta: string; executionId: string; id: string; seq: number; type: "media_delta"; } | { data?: string; executionId: string; id: string; mediaType?: string; seq: number; toolCallId?: string; type: "media_complete"; url?: string; } | ({ artifactType: "markdown" | "component"; component?: string; executionId?: string; id: string; seq?: number; title?: string; type: "artifact_start"; }) | { delta: string; executionId?: string; id: string; seq?: number; type: "artifact_delta"; } | { component: string; executionId?: string; id: string; props: Record; seq?: number; type: "artifact_update"; } | { executionId?: string; id: string; seq?: number; type: "artifact_complete"; } | { executionId: string; id?: string; seq: number; sourceType?: string; title?: string; type: "source"; url?: string; [key: string]: unknown; } | ({ executionId: string; hiddenParameterNames?: Array; iteration?: number; origin?: "webmcp" | "sdk"; pageOrigin?: string; parameters?: Record; seq: number; startedAt?: string; stepId?: string; toolCallId: string; toolName: string; toolType: string; type: "tool_start"; }) | { delta: string; executionId: string; seq: number; toolCallId: string; type: "tool_input_delta"; } | { executionId: string; hiddenParameterNames?: Array; parameters: Record; seq: number; toolCallId: string; toolName?: string; type: "tool_input_complete"; } | { delta: string; executionId: string; seq: number; toolCallId: string; type: "tool_output_delta"; } | { error?: string; executionId: string; executionTime?: number; iteration?: number; result?: unknown; seq: number; stepId?: string; success: boolean; toolCallId: string; toolName?: string; type: "tool_complete"; } | { approvalId: string; description?: string; executionId: string; iteration?: number; parameters?: Record; reason?: string; seq: number; startedAt?: string; subagent?: { agentName?: string; toolName: string; }; timeout?: number; toolCallId?: string; toolName: string; toolType?: string; type: "approval_start"; } | ({ approvalId: string; completedAt?: string; decision: "approved" | "denied" | "timeout"; executionId: string; resolvedBy?: "user" | "system"; seq: number; type: "approval_complete"; }) | ({ awaitedAt?: string; executionId: string; origin?: "webmcp" | "sdk"; pageOrigin?: string; parameters?: Record; seq: number; toolCallId?: string; toolId?: string; toolName?: string; type: "await"; }) | ({ error: string | { code: string; details?: Record; message: string; }; executionId: string; recoverable?: boolean; seq: number; type: "error"; }) | { executionId: string; seq: number; timestamp: string; type: "ping"; } | { executionId?: string; name: string; seq?: number; type: "custom"; value?: unknown; }; export type RuntypeFlowSSEEvent = { executionContext?: Record; executionId?: string; flowId: string; flowName?: string; input?: unknown; seq?: number; source?: string; startedAt: string; toolContext?: { executionId: string; stepId: string; toolId: string; }; totalSteps?: number; type: "flow_start"; } | { claudeManagedAgentId?: string; completedAt?: string; completedSteps?: number; duration?: number; executionContext?: Record; executionId?: string; executionTime?: number; failedSteps?: number; finalOutput?: string; flowId?: string; flowName?: string; output?: unknown; seq?: number; source?: string; success?: boolean; successfulSteps?: number; toolContext?: { executionId: string; stepId: string; toolId: string; }; totalSteps?: number; totalTokensUsed?: number; type: "flow_complete"; } | ({ code?: string; error: string | { code: string; message: string; stepId?: string; stepType?: string; }; executionId?: string; executionTime?: number; flowId?: string; seq?: number; timestamp?: string; toolContext?: { executionId: string; stepId: string; toolId: string; }; type: "flow_error"; upgradeUrl?: string; }) | ({ awaitedAt: string; executionId?: string; flowId: string; origin?: "webmcp" | "sdk"; pageOrigin?: string; parameters?: Record; seq?: number; toolCallId?: string; toolId?: string; toolName?: string; type: "flow_await"; }) | { estimatedTokens?: number; executionId?: string; id?: string; index?: number; name?: string; outputVariable?: string; seq?: number; startedAt: string; stepId?: string; stepName?: string; stepType?: string; toolContext?: { executionId: string; stepId: string; toolId: string; }; totalSteps?: number; type: "step_start"; } | { delta?: string; executionId?: string; id?: string; messageId?: string; partId?: string; seq?: number; text?: string; toolContext?: { executionId: string; stepId: string; toolId: string; }; toolId?: string; type: "step_delta"; } | ({ completedAt?: string; duration?: number; durationMs?: number; error?: string; executionId?: string; executionTime?: number; id?: string; index?: number; name?: string; output?: unknown; result?: unknown; seq?: number; stepId?: string; stepName?: string; stepType?: string; stopReason?: "end_turn" | "max_tool_calls" | "length" | "content_filter" | "error" | "unknown"; success?: boolean; tokensUsed?: number; toolContext?: { executionId: string; stepId: string; toolId: string; }; type: "step_complete"; unresolvedVariables?: Array; }) | { error: string; executionId?: string; executionTime?: number; id?: string; index?: number; name?: string; seq?: number; stepType?: string; type: "step_error"; } | { error?: string; executionId?: string; id: string; index?: number; name?: string; seq?: number; skippedAt: string; stepType: string; totalSteps: number; type: "step_skip"; when: string; } | { executionId?: string; reason?: string; seq?: number; type: "step_await"; [key: string]: unknown; } | ({ agentContext?: { executionId: string; iteration: number; seq: number; }; executionId?: string; hiddenParameterNames?: Array; name?: string; parameters?: Record; providerOptions?: Record; seq?: number; startedAt?: string; stepId?: string; toolCallId?: string; toolId?: string; toolName?: string; toolType: "flow" | "mcp" | "builtin" | "custom" | "external" | "advisor" | "subagent" | "local"; type: "tool_start"; [key: string]: unknown; }) | { delta?: string; executionId?: string; seq?: number; toolId?: string; type: "tool_delta"; [key: string]: unknown; } | { delta: string; executionId?: string; seq?: number; stepId?: string; toolCallId?: string; toolId?: string; type: "tool_input_delta"; } | { executionId?: string; hiddenParameterNames?: Array; parameters: Record; providerOptions?: Record; seq?: number; stepId?: string; toolCallId?: string; toolId?: string; toolName?: string; type: "tool_input_complete"; } | { agentContext?: { executionId: string; iteration: number; seq: number; }; completedAt?: string; error?: string; executionId?: string; executionTime?: number; name?: string; result?: unknown; seq?: number; stepId?: string; success: boolean; toolCallId?: string; toolCost?: number; toolId?: string; toolName?: string; type: "tool_complete"; } | { agentContext?: { executionId: string; iteration: number; seq: number; }; error: string; executionId?: string; executionTime?: number; failedAt?: string; name: string; seq?: number; toolId: string; type: "tool_error"; } | { executionId?: string; id: string; seq?: number; text: string; type: "chunk"; } | { executionId?: string; seq?: number; type: "text_start"; [key: string]: unknown; } | { executionId?: string; seq?: number; type: "text_end"; [key: string]: unknown; } | { executionId?: string; seq?: number; type: "reason_start"; [key: string]: unknown; } | { executionId?: string; seq?: number; type: "reason_delta"; [key: string]: unknown; } | { executionId?: string; seq?: number; type: "reason_complete"; [key: string]: unknown; } | { executionId?: string; seq?: number; type: "source"; [key: string]: unknown; } | { executionId?: string; seq?: number; type: "fallback_start"; [key: string]: unknown; } | { executionId?: string; seq?: number; type: "fallback_complete"; [key: string]: unknown; } | { executionId?: string; seq?: number; type: "fallback_exhausted"; [key: string]: unknown; }; export type RuntypeStreamEventOf = Extract; export type RuntypeTurnCompleteEvent = RuntypeStreamEventOf< RuntypeExecutionStreamEvent, "turn_complete" >; export type RuntypeStepCompleteEvent = RuntypeStreamEventOf< RuntypeFlowSSEEvent, "step_complete" >; export type RuntypeStopReasonKind = NonNullable< RuntypeTurnCompleteEvent["stopReason"] | RuntypeStepCompleteEvent["stopReason"] >; export type RuntypeClientInitRequest = { flowId?: string; sessionId?: string; token: string; }; export type RuntypeClientInitResponse = { config: { placeholder?: string; theme?: unknown; welcomeMessage?: string | null; }; expiresAt: string; flow: { description?: string | null; id: string; name?: string | null; }; sessionId: string; }; export type RuntypeClientChatRequest = { assistantMessageId?: string; clientTools?: Array<{ description: string; name: string; origin?: "webmcp" | "sdk"; pageOrigin?: string; parametersSchema: { type: "object"; [key: string]: unknown; }; untrustedContentHint?: boolean; }>; clientToolsFingerprint?: string; inputs?: Record; messages: Array<{ content: string | (Array<{ text: string; type: "text"; } | { image: string; mimeType?: string; type: "image"; } | { data: string; filename: string; mimeType: string; type: "file"; } | { providerOptions?: Record; text: string; type: "reasoning"; }>); id?: string; role: "user" | "assistant" | "system"; }>; metadata?: Record; sessionId: string; submitMode?: "normal" | "interrupt"; turnId?: string; }; export type RuntypeClientChatStreamEvent = RuntypeExecutionStreamEvent; export type RuntypeClientResumeRequest = { executionId: string; messages?: Array<{ content: string | (Array<{ text: string; type: "text"; } | { image: string; mimeType?: string; type: "image"; } | { data: string; filename: string; mimeType: string; type: "file"; } | { providerOptions?: Record; text: string; type: "reasoning"; }>); role: "system" | "user" | "assistant"; }>; sessionId: string; streamResponse?: boolean; toolOutputs?: Record; }; export type RuntypeClientResumeStreamEvent = RuntypeExecutionStreamEvent; export type RuntypeClientFeedbackRequest = { comment?: string; messageId?: string; metadata?: Record; rating?: number; sessionId: string; token: string; type: "upvote" | "downvote" | "copy" | "csat" | "nps"; }; export type RuntypeClientFeedbackResponse = { feedbackId: string; message?: string; success: true; }; export type RuntypeClientFeedbackType = RuntypeClientFeedbackRequest["type"];