// This file is auto-generated by @hey-api/openapi-ts

export type ClientOptions = {
    baseUrl: `${string}://${string}` | (string & {});
};

export type ActionRequired = {
    data: ActionRequiredData;
};

export type ActionRequiredData = {
    actionType: 'toolConfirmation';
    arguments: JsonObject;
    id: string;
    prompt?: string | null;
    toolName: string;
} | {
    actionType: 'elicitation';
    id: string;
    message: string;
    requested_schema: unknown;
} | {
    actionType: 'elicitationResponse';
    id: string;
    user_data: unknown;
};

export type Annotations = {
    audience?: Array<Role>;
    lastModified?: string;
    priority?: number;
};

export type Author = {
    contact?: string | null;
    metadata?: string | null;
};

export type AuthorRequest = {
    contact?: string | null;
    metadata?: string | null;
};

export type CallToolRequest = {
    arguments: unknown;
    name: string;
    session_id: string;
};

export type CallToolResponse = {
    _meta?: unknown;
    content: Array<ContentBlock>;
    isError: boolean;
    structuredContent?: unknown;
};

export type CancelRequest = {
    request_id: string;
};

export type ChatRequest = {
    /**
     * Override the server's conversation history. Only use this when you need absolute control
     * over the conversation state (e.g., administrative tools). For normal operations, the server
     * is the source of truth - use truncate/fork endpoints to modify conversation history instead.
     */
    override_conversation?: Array<Message> | null;
    recipe_name?: string | null;
    recipe_version?: string | null;
    session_id: string;
    user_message: Message;
};

export type ChatTemplate = {
    type: 'embedded';
} | {
    name: string;
    type: 'builtin';
} | {
    template: string;
    type: 'custom_inline';
};

export type CheckProviderRequest = {
    provider: string;
};

export type CommandType = 'Builtin' | 'Recipe' | 'Skill' | 'Agent';

/**
 * Configuration key metadata for provider setup
 */
export type ConfigKey = {
    /**
     * Optional default value for the key
     */
    default?: string | null;
    /**
     * Whether this OAuth flow uses the device code grant (RFC 8628)
     * When true, the user must enter a verification code in the browser
     */
    device_code_flow?: boolean;
    /**
     * The name of the configuration key (e.g., "API_KEY")
     */
    name: string;
    /**
     * Whether this key should be configured using an OAuth flow
     * When true, the provider's configure_oauth() method will be called instead of prompting for manual input
     */
    oauth_flow: boolean;
    /**
     * Whether this key should be shown prominently during provider setup
     * (onboarding, settings modal, CLI configure)
     */
    primary?: boolean;
    /**
     * Whether this key is required for the provider to function
     */
    required: boolean;
    /**
     * Whether this key should be stored securely (e.g., in keychain)
     */
    secret: boolean;
};

export type ConfigKeyQuery = {
    is_secret: boolean;
    key: string;
};

export type ConfigResponse = {
    config: {
        [key: string]: unknown;
    };
};

export type ConfirmToolActionRequest = {
    action: Permission;
    id: string;
    principalType?: PrincipalType;
    sessionId: string;
};

export type Content = ({
    type: 'text';
} & RawTextContent) | ({
    type: 'image';
} & RawImageContent) | ({
    type: 'resource';
} & RawEmbeddedResource) | ({
    type: 'audio';
} & RawAudioContent) | ({
    type: 'resource_link';
} & RawResource);

export type ContentBlock = ({
    type: 'text';
} & RawTextContent) | ({
    type: 'image';
} & RawImageContent) | ({
    type: 'resource';
} & RawEmbeddedResource) | ({
    type: 'audio';
} & RawAudioContent) | ({
    type: 'resource_link';
} & RawResource);

export type Conversation = Array<Message>;

export type CreateCustomProviderResponse = {
    provider_name: string;
};

export type CreateRecipeRequest = {
    author?: AuthorRequest | null;
    session_id: string;
};

export type CreateRecipeResponse = {
    error?: string | null;
    recipe?: Recipe | null;
};

export type CreateScheduleRequest = {
    cron: string;
    id: string;
    recipe: Recipe;
};

/**
 * Content Security Policy metadata for MCP Apps
 * Specifies allowed domains for network connections and resource loading
 */
export type CspMetadata = {
    /**
     * Domains allowed for base-uri
     */
    baseUriDomains?: Array<string> | null;
    /**
     * Domains allowed for connect-src (fetch, XHR, WebSocket)
     */
    connectDomains?: Array<string> | null;
    /**
     * Domains allowed for frame-src (nested iframes)
     */
    frameDomains?: Array<string> | null;
    /**
     * Domains allowed for resource loading (scripts, styles, images, fonts, media)
     */
    resourceDomains?: Array<string> | null;
};

export type DeclarativeProviderConfig = {
    api_key_env?: string;
    base_path?: string | null;
    base_url: string;
    catalog_provider_id?: string | null;
    description?: string | null;
    display_name: string;
    /**
     * Controls whether `fetch_supported_models` calls the provider's `/v1/models`
     * endpoint or returns the static `models` list directly.
     *
     * - `Some(false)` + non-empty `models`: return the static list; no API call.
     * Construction fails if `models` is empty.
     * - `Some(true)` or `None`: try the API; fall back to `models` on 404.
     */
    dynamic_models?: boolean | null;
    engine: ProviderEngine;
    env_vars?: Array<EnvVarConfig> | null;
    fast_model?: string | null;
    headers?: {
        [key: string]: string;
    } | null;
    model_doc_link?: string | null;
    models: Array<ModelInfo>;
    name: string;
    preserves_thinking?: boolean;
    requires_auth?: boolean;
    setup_steps?: Array<string>;
    skip_canonical_filtering?: boolean;
    supports_streaming?: boolean | null;
    timeout_seconds?: number | null;
};

export type DecodeRecipeRequest = {
    deeplink: string;
};

export type DecodeRecipeResponse = {
    recipe: Recipe;
};

export type DeleteRecipeRequest = {
    id: string;
};

export type DictationProvider = 'openai' | 'elevenlabs' | 'groq' | 'local';

export type DictationProviderStatus = {
    /**
     * Config key name if uses_provider_config is false
     */
    config_key?: string | null;
    /**
     * Whether the provider is fully configured and ready to use
     */
    configured: boolean;
    /**
     * Description of what this provider does
     */
    description: string;
    /**
     * Custom host URL if configured (only for providers that support it)
     */
    host?: string | null;
    /**
     * Path to settings if uses_provider_config is true
     */
    settings_path?: string | null;
    /**
     * Whether this provider uses the main provider config (true) or has its own key (false)
     */
    uses_provider_config: boolean;
};

export type DownloadModelRequest = {
    /**
     * Model spec like "bartowski/Llama-3.2-3B-Instruct-GGUF:Q4_K_M"
     */
    spec: string;
};

export type DownloadProgress = {
    /**
     * Bytes downloaded so far
     */
    bytes_downloaded: number;
    /**
     * Error message if failed
     */
    error?: string | null;
    /**
     * Estimated time remaining in seconds
     */
    eta_seconds?: number | null;
    /**
     * Model ID being downloaded
     */
    model_id: string;
    /**
     * Download progress percentage (0-100)
     */
    progress_percent: number;
    /**
     * Download speed in bytes per second
     */
    speed_bps?: number | null;
    status: DownloadStatus;
    /**
     * Total bytes to download
     */
    total_bytes: number;
};

export type DownloadStatus = 'downloading' | 'completed' | 'failed' | 'cancelled';

export type EmbeddedResource = {
    _meta?: {
        [key: string]: unknown;
    };
    annotations?: Annotations | {
        [key: string]: unknown;
    };
    resource: ResourceContents;
};

export type EncodeRecipeRequest = {
    recipe: Recipe;
};

export type EncodeRecipeResponse = {
    deeplink: string;
};

export type EnvVarConfig = {
    default?: string | null;
    description?: string | null;
    name: string;
    /**
     * When true, the field is shown prominently in the UI (not collapsed).
     * Defaults to the value of `required` if not specified.
     */
    primary?: boolean | null;
    required?: boolean;
    secret?: boolean;
};

export type Envs = {
    [key: string]: string;
};

export type ErrorResponse = {
    message: string;
};

/**
 * Represents the different types of MCP extensions that can be added to the manager
 */
export type ExtensionConfig = {
    description: string;
    name: string;
    type: 'sse';
    uri?: string | null;
} | {
    args: Array<string>;
    available_tools?: Array<string>;
    bundled?: boolean | null;
    cmd: string;
    description: string;
    env_keys?: Array<string>;
    envs?: Envs;
    /**
     * The name used to identify this extension
     */
    name: string;
    timeout?: number | null;
    type: 'stdio';
} | {
    available_tools?: Array<string>;
    bundled?: boolean | null;
    description: string;
    display_name?: string | null;
    /**
     * The name used to identify this extension
     */
    name: string;
    timeout?: number | null;
    type: 'builtin';
} | {
    available_tools?: Array<string>;
    bundled?: boolean | null;
    description: string;
    display_name?: string | null;
    /**
     * The name used to identify this extension
     */
    name: string;
    type: 'platform';
} | {
    available_tools?: Array<string>;
    bundled?: boolean | null;
    description: string;
    env_keys?: Array<string>;
    envs?: Envs;
    headers?: {
        [key: string]: string;
    };
    /**
     * The name used to identify this extension
     */
    name: string;
    /**
     * Optional Unix domain socket path for HTTP-over-UDS transport.
     * When set, the HTTP connection is routed through this socket while
     * `uri` is used for the Host header and path.
     * Use `@name` for Linux abstract sockets.
     */
    socket?: string | null;
    timeout?: number | null;
    type: 'streamable_http';
    uri: string;
} | {
    available_tools?: Array<string>;
    bundled?: boolean | null;
    description: string;
    /**
     * Instructions for how to use these tools
     */
    instructions?: string | null;
    /**
     * The name used to identify this extension
     */
    name: string;
    /**
     * The tools provided by the frontend
     */
    tools: Array<Tool>;
    type: 'frontend';
} | {
    available_tools?: Array<string>;
    /**
     * The Python code to execute
     */
    code: string;
    /**
     * Python package dependencies required by this extension
     */
    dependencies?: Array<string> | null;
    description: string;
    /**
     * The name used to identify this extension
     */
    name: string;
    /**
     * Timeout in seconds
     */
    timeout?: number | null;
    type: 'inline_python';
};

/**
 * Extension data containing all extension states
 * Keys are in format "extension_name.version" (e.g., "todo.v0")
 */
export type ExtensionData = {
    [key: string]: unknown;
};

export type ExtensionEntry = ExtensionConfig & {
    enabled: boolean;
};

export type ExtensionLoadResult = {
    error?: string | null;
    name: string;
    success: boolean;
};

export type FeaturesResponse = {
    /**
     * Map of feature name to enabled status
     */
    features: {
        [key: string]: boolean;
    };
};

export type ForkRequest = {
    copy: boolean;
    timestamp?: number | null;
    truncate: boolean;
};

export type ForkResponse = {
    sessionId: string;
};

export type FrontendToolRequest = {
    id: string;
    toolCall: {
        [key: string]: unknown;
    };
};

export type GetToolsQuery = {
    extension_name?: string | null;
    session_id: string;
};

export type GooseApp = McpAppResource & (WindowProps | null) & {
    mcpServers?: Array<string>;
    prd?: string | null;
};

export type GooseMode = 'auto' | 'approve' | 'smart_approve' | 'chat';

/**
 * A single downloadable GGUF file (used internally and for downloads).
 */
export type HfGgufFile = {
    download_url: string;
    filename: string;
    quantization: string;
    size_bytes: number;
};

export type HfModelInfo = {
    author: string;
    downloads: number;
    gguf_files: Array<HfGgufFile>;
    model_name: string;
    repo_id: string;
};

/**
 * A quantization variant — groups sharded files into one logical entry.
 */
export type HfQuantVariant = {
    description: string;
    download_url: string;
    filename: string;
    quality_rank: number;
    quantization: string;
    sharded?: boolean;
    size_bytes: number;
};

export type Icon = {
    mimeType?: string;
    sizes?: Array<string>;
    src: string;
    theme?: IconTheme | {
        [key: string]: unknown;
    };
};

export type IconTheme = 'light' | 'dark';

export type ImageContent = {
    _meta?: {
        [key: string]: unknown;
    };
    annotations?: Annotations | {
        [key: string]: unknown;
    };
    data: string;
    mimeType: string;
};

export type ImportAppRequest = {
    html: string;
};

export type ImportAppResponse = {
    message: string;
    name: string;
};

export type ImportSessionNostrRequest = {
    deeplink: string;
};

export type ImportSessionRequest = {
    json: string;
};

export type InferenceMetadata = {
    provider: string;
    requestedModel: string;
    resolvedModel?: string | null;
};

export type InspectJobResponse = {
    processStartTime?: string | null;
    runningDurationSeconds?: number | null;
    sessionId?: string | null;
};

export type JsonObject = {
    [key: string]: unknown;
};

export type KillJobResponse = {
    message: string;
};

export type ListAppsRequest = {
    session_id?: string | null;
};

export type ListAppsResponse = {
    apps: Array<GooseApp>;
};

export type ListRecipeResponse = {
    manifests: Array<RecipeManifest>;
};

export type ListSchedulesResponse = {
    jobs: Array<ScheduledJob>;
};

export type LoadedProvider = {
    config: DeclarativeProviderConfig;
    is_editable: boolean;
};

export type LocalModelResponse = {
    filename: string;
    id: string;
    mmproj_status?: ModelDownloadStatus | null;
    quantization: string;
    recommended: boolean;
    repo_id: string;
    settings: ModelSettings;
    size_bytes: number;
    status: ModelDownloadStatus;
    vision_capable: boolean;
};

/**
 * MCP App Resource
 * Represents a UI resource that can be rendered in an MCP App
 */
export type McpAppResource = {
    _meta?: ResourceMetadata | null;
    /**
     * Base64-encoded binary content (alternative to text)
     */
    blob?: string | null;
    /**
     * Optional description of what this resource does
     */
    description?: string | null;
    /**
     * MIME type (should be "text/html;profile=mcp-app" for MCP Apps)
     */
    mimeType: string;
    /**
     * Human-readable name of the resource
     */
    name: string;
    /**
     * Text content of the resource (HTML for MCP Apps)
     */
    text?: string | null;
    /**
     * URI of the resource (must use ui:// scheme)
     */
    uri: string;
};

/**
 * A message to or from an LLM
 */
export type Message = {
    content: Array<MessageContent>;
    created: number;
    id?: string | null;
    metadata: MessageMetadata;
    role: Role;
};

/**
 * Content passed inside a message, which can be both simple content and tool content
 */
export type MessageContent = (TextContent & {
    type: 'text';
}) | (ImageContent & {
    type: 'image';
}) | (ToolRequest & {
    type: 'toolRequest';
}) | (ToolResponse & {
    type: 'toolResponse';
}) | (ToolConfirmationRequest & {
    type: 'toolConfirmationRequest';
}) | (ActionRequired & {
    type: 'actionRequired';
}) | (FrontendToolRequest & {
    type: 'frontendToolRequest';
}) | (ThinkingContent & {
    type: 'thinking';
}) | (RedactedThinkingContent & {
    type: 'redactedThinking';
}) | (SystemNotificationContent & {
    type: 'systemNotification';
});

export type MessageEvent = {
    message: Message;
    token_state: TokenState;
    type: 'Message';
} | {
    error: string;
    type: 'Error';
} | {
    reason: string;
    token_state: TokenState;
    type: 'Finish';
} | {
    message: {
        [key: string]: unknown;
    };
    request_id: string;
    type: 'Notification';
} | {
    conversation: Conversation;
    type: 'UpdateConversation';
} | {
    request_ids: Array<string>;
    type: 'ActiveRequests';
} | {
    type: 'Ping';
};

/**
 * Metadata for message visibility and model inference details
 */
export type MessageMetadata = {
    /**
     * Whether the message should be included in the agent's context window
     */
    agentVisible: boolean;
    inference?: InferenceMetadata | null;
    /**
     * Whether the message should be visible to the user in the UI
     */
    userVisible: boolean;
};

export type ModelCapabilities = {
    attachment: boolean;
    reasoning: boolean;
    temperature: boolean;
    tool_call: boolean;
};

export type ModelConfig = {
    context_limit?: number | null;
    max_tokens?: number | null;
    model_name: string;
    reasoning?: boolean | null;
    /**
     * Provider-specific request parameters (e.g., anthropic_beta headers)
     */
    request_params?: {
        [key: string]: unknown;
    } | null;
    temperature?: number | null;
    toolshim: boolean;
    toolshim_model?: string | null;
};

export type ModelDownloadStatus = {
    state: 'NotDownloaded';
} | {
    bytes_downloaded: number;
    progress_percent: number;
    speed_bps?: number | null;
    state: 'Downloading';
    total_bytes: number;
} | {
    state: 'Downloaded';
};

/**
 * Information about a model's capabilities
 */
export type ModelInfo = {
    /**
     * The maximum context length this model supports
     */
    context_limit: number;
    /**
     * Currency for the costs (default: "$")
     */
    currency?: string | null;
    /**
     * Cost per token for input in USD (optional)
     */
    input_token_cost?: number | null;
    /**
     * The name of the model
     */
    name: string;
    /**
     * Cost per token for output in USD (optional)
     */
    output_token_cost?: number | null;
    /**
     * Whether this model supports reasoning/thinking controls
     */
    reasoning?: boolean;
    /**
     * The underlying model resolved from provider metadata, when the configured model is an alias or endpoint.
     */
    resolved_model?: string | null;
    /**
     * Whether this model supports cache control
     */
    supports_cache_control?: boolean | null;
};

export type ModelInfoData = {
    cache_read_token_cost?: number | null;
    cache_write_token_cost?: number | null;
    context_limit: number;
    currency: string;
    input_token_cost?: number | null;
    max_output_tokens?: number | null;
    model: string;
    output_token_cost?: number | null;
    provider: string;
    reasoning: boolean;
};

export type ModelInfoQuery = {
    model: string;
    provider: string;
};

export type ModelInfoResponse = {
    model_info?: ModelInfoData | null;
    source: string;
};

export type ModelSettings = {
    chat_template?: ChatTemplate;
    context_size?: number | null;
    enable_thinking?: boolean;
    flash_attention?: boolean | null;
    frequency_penalty?: number;
    /**
     * Estimated tokens per image for budget planning before mtmd tokenization.
     * The actual count is determined after tokenization via `chunks.total_tokens()`.
     */
    image_token_estimate?: number;
    max_output_tokens?: number | null;
    /**
     * Size of the mmproj file in bytes, used for memory accounting.
     */
    mmproj_size_bytes?: number;
    n_batch?: number | null;
    n_gpu_layers?: number | null;
    n_threads?: number | null;
    presence_penalty?: number;
    repeat_last_n?: number;
    repeat_penalty?: number;
    sampling?: SamplingConfig;
    tool_calling?: ToolCallingMode;
    use_mlock?: boolean;
    /**
     * Whether this model architecture supports vision input.
     * Derived from associated mmproj metadata, not user-configurable.
     */
    vision_capable?: boolean;
};

export type ModelTemplate = {
    capabilities: ModelCapabilities;
    context_limit: number;
    deprecated: boolean;
    id: string;
    name: string;
};

export type ParseRecipeRequest = {
    content: string;
};

export type ParseRecipeResponse = {
    recipe: Recipe;
};

export type Permission = 'always_allow' | 'allow_once' | 'cancel' | 'deny_once' | 'always_deny';

/**
 * Enum representing the possible permission levels for a tool.
 */
export type PermissionLevel = 'always_allow' | 'ask_before' | 'never_allow';

/**
 * Sandbox permissions for MCP Apps
 * Specifies which browser capabilities the UI needs access to.
 * Maps to the iframe Permission Policy `allow` attribute.
 */
export type PermissionsMetadata = {
    /**
     * Request camera access (maps to Permission Policy `camera` feature)
     */
    camera?: boolean;
    /**
     * Request clipboard write access (maps to Permission Policy `clipboard-write` feature)
     */
    clipboardWrite?: boolean;
    /**
     * Request geolocation access (maps to Permission Policy `geolocation` feature)
     */
    geolocation?: boolean;
    /**
     * Request microphone access (maps to Permission Policy `microphone` feature)
     */
    microphone?: boolean;
};

export type PrincipalType = 'Extension' | 'Tool';

export type PromptContentResponse = {
    content: string;
    default_content: string;
    is_customized: boolean;
    name: string;
};

export type PromptsListResponse = {
    prompts: Array<Template>;
};

export type ProviderCatalogEntry = {
    api_url: string;
    doc_url: string;
    env_var: string;
    format: string;
    id: string;
    model_count: number;
    name: string;
};

export type ProviderDetails = {
    is_configured: boolean;
    metadata: ProviderMetadata;
    name: string;
    provider_type: ProviderType;
    saved_model?: string | null;
};

export type ProviderEngine = 'openai' | 'ollama' | 'anthropic';

/**
 * Metadata about a provider's configuration requirements and capabilities
 */
export type ProviderMetadata = {
    /**
     * Required configuration keys
     */
    config_keys: Array<ConfigKey>;
    /**
     * The default/recommended model for this provider
     */
    default_model: string;
    /**
     * Description of the provider's capabilities
     */
    description: string;
    /**
     * Display name for the provider in UIs
     */
    display_name: string;
    /**
     * A list of currently known models with their capabilities
     */
    known_models: Array<ModelInfo>;
    /**
     * Link to the docs where models can be found
     */
    model_doc_link: string;
    /**
     * Hint shown in the model picker when this provider manages its own model selection.
     */
    model_selection_hint?: string | null;
    /**
     * The unique identifier for this provider
     */
    name: string;
    /**
     * step-by-step instructions for set up providers eg: api key
     */
    setup_steps?: Array<string>;
};

export type ProviderModelInfoQuery = {
    model: string;
};

export type ProviderTemplate = {
    api_url: string;
    doc_url: string;
    env_var: string;
    format: string;
    id: string;
    models: Array<ModelTemplate>;
    name: string;
    supports_streaming: boolean;
};

export type ProviderType = 'Preferred' | 'Builtin' | 'Declarative' | 'Custom';

export type ProvidersResponse = {
    providers: Array<ProviderDetails>;
};

export type RawAudioContent = {
    data: string;
    mimeType: string;
};

export type RawEmbeddedResource = {
    _meta?: {
        [key: string]: unknown;
    };
    resource: ResourceContents;
};

export type RawImageContent = {
    _meta?: {
        [key: string]: unknown;
    };
    data: string;
    mimeType: string;
};

export type RawResource = {
    _meta?: {
        [key: string]: unknown;
    };
    description?: string;
    icons?: Array<Icon>;
    mimeType?: string;
    name: string;
    size?: number;
    title?: string;
    uri: string;
};

export type RawTextContent = {
    _meta?: {
        [key: string]: unknown;
    };
    text: string;
};

export type ReadResourceRequest = {
    extension_name: string;
    session_id: string;
    uri: string;
};

export type ReadResourceResponse = {
    _meta?: {
        [key: string]: unknown;
    } | null;
    mimeType?: string | null;
    text: string;
    uri: string;
};

export type Recipe = {
    activities?: Array<string> | null;
    author?: Author | null;
    description: string;
    extensions?: Array<ExtensionConfig> | null;
    instructions?: string | null;
    parameters?: Array<RecipeParameter> | null;
    prompt?: string | null;
    response?: Response | null;
    retry?: RetryConfig | null;
    settings?: Settings | null;
    sub_recipes?: Array<SubRecipe> | null;
    title: string;
    version?: string;
};

export type RecipeManifest = {
    file_path: string;
    id: string;
    last_modified: string;
    recipe: Recipe;
    schedule_cron?: string | null;
    slash_command?: string | null;
};

export type RecipeParameter = {
    default?: string | null;
    description: string;
    input_type: RecipeParameterInputType;
    key: string;
    options?: Array<string> | null;
    requirement: RecipeParameterRequirement;
};

export type RecipeParameterInputType = 'string' | 'number' | 'boolean' | 'date' | 'file' | 'select';

export type RecipeParameterRequirement = 'required' | 'optional' | 'user_prompt';

export type RecipeToYamlRequest = {
    recipe: Recipe;
};

export type RecipeToYamlResponse = {
    yaml: string;
};

export type RedactedThinkingContent = {
    data: string;
};

export type RepoVariantsResponse = {
    available_memory_bytes: number;
    downloaded_quants: Array<string>;
    recommended_index?: number | null;
    variants: Array<HfQuantVariant>;
};

export type ResourceContents = {
    _meta?: {
        [key: string]: unknown;
    };
    mimeType?: string;
    text: string;
    uri: string;
} | {
    _meta?: {
        [key: string]: unknown;
    };
    blob: string;
    mimeType?: string;
    uri: string;
};

/**
 * Resource metadata containing UI configuration
 */
export type ResourceMetadata = {
    ui?: UiMetadata | null;
};

export type Response = {
    json_schema?: unknown;
};

export type RestartAgentRequest = {
    session_id: string;
};

export type RestartAgentResponse = {
    extension_results: Array<ExtensionLoadResult>;
};

export type ResumeAgentRequest = {
    load_model_and_extensions: boolean;
    session_id: string;
};

export type ResumeAgentResponse = {
    extension_results?: Array<ExtensionLoadResult> | null;
    session: Session;
};

/**
 * Configuration for retry logic in recipe execution
 */
export type RetryConfig = {
    /**
     * List of success checks to validate recipe completion
     */
    checks: Array<SuccessCheck>;
    /**
     * Maximum number of retry attempts before giving up
     */
    max_retries: number;
    /**
     * Optional shell command to run on failure for cleanup
     */
    on_failure?: string | null;
    /**
     * Timeout in seconds for on_failure commands (default: 600 seconds)
     */
    on_failure_timeout_seconds?: number | null;
    /**
     * Timeout in seconds for individual shell commands (default: 300 seconds)
     */
    timeout_seconds?: number | null;
};

export type Role = 'user' | 'assistant';

export type RunNowResponse = {
    session_id: string;
};

export type SamplingConfig = {
    type: 'Greedy';
} | {
    min_p: number;
    seed?: number | null;
    temperature: number;
    top_k: number;
    top_p: number;
    type: 'Temperature';
} | {
    eta: number;
    seed?: number | null;
    tau: number;
    type: 'MirostatV2';
};

export type SavePromptRequest = {
    content: string;
};

export type SaveRecipeRequest = {
    id?: string | null;
    recipe: Recipe;
};

export type SaveRecipeResponse = {
    file_name: string;
    file_path: string;
    id: string;
};

export type ScanRecipeRequest = {
    recipe: Recipe;
};

export type ScanRecipeResponse = {
    has_security_warnings: boolean;
};

export type ScheduleRecipeRequest = {
    cron_schedule?: string | null;
    id: string;
};

export type ScheduledJob = {
    cron: string;
    current_session_id?: string | null;
    currently_running?: boolean;
    id: string;
    last_run?: string | null;
    parameters?: Array<Array<string>>;
    paused?: boolean;
    process_start_time?: string | null;
    /**
     * Original directory of the recipe file before it was copied to scheduled_recipes/.
     * Preserved so that relative paths (sub-recipes, template includes) resolve correctly
     * against the source tree rather than the scheduler's internal storage directory.
     */
    recipe_base_dir?: string | null;
    source: string;
};

export type Session = {
    accumulated_cost?: number | null;
    accumulated_input_tokens?: number | null;
    accumulated_output_tokens?: number | null;
    accumulated_total_tokens?: number | null;
    archived_at?: string | null;
    conversation?: Conversation | null;
    created_at: string;
    extension_data: ExtensionData;
    goose_mode?: GooseMode;
    id: string;
    input_tokens?: number | null;
    message_count: number;
    model_config?: ModelConfig | null;
    name: string;
    output_tokens?: number | null;
    project_id?: string | null;
    provider_name?: string | null;
    recipe?: Recipe | null;
    schedule_id?: string | null;
    session_type?: SessionType;
    total_tokens?: number | null;
    updated_at: string;
    user_recipe_values?: {
        [key: string]: string;
    } | null;
    user_set_name?: boolean;
    working_dir: string;
};

export type SessionDisplayInfo = {
    accumulatedInputTokens?: number | null;
    accumulatedOutputTokens?: number | null;
    accumulatedTotalTokens?: number | null;
    createdAt: string;
    id: string;
    inputTokens?: number | null;
    messageCount: number;
    name: string;
    outputTokens?: number | null;
    scheduleId?: string | null;
    totalTokens?: number | null;
    workingDir: string;
};

export type SessionInsights = {
    totalSessions: number;
    totalTokens: number;
};

export type SessionListResponse = {
    /**
     * List of available session information objects
     */
    sessions: Array<Session>;
};

export type SessionReplyRequest = {
    override_conversation?: Array<Message> | null;
    /**
     * Client-generated UUIDv7 identifying this request.
     */
    request_id: string;
    user_message: Message;
};

export type SessionReplyResponse = {
    request_id: string;
};

export type SessionType = 'user' | 'scheduled' | 'sub_agent' | 'hidden' | 'terminal' | 'gateway' | 'acp';

export type SessionsQuery = {
    limit: number;
};

export type SetProviderRequest = {
    model: string;
    provider: string;
};

export type SetSlashCommandRequest = {
    id: string;
    slash_command?: string | null;
};

export type Settings = {
    goose_model?: string | null;
    goose_provider?: string | null;
    max_turns?: number | null;
    temperature?: number | null;
};

export type SetupResponse = {
    message: string;
    success: boolean;
};

export type ShareSessionNostrRequest = {
    relays?: Array<string>;
};

export type ShareSessionNostrResponse = {
    deeplink: string;
    eventId: string;
    nevent: string;
    relays: Array<string>;
};

export type SlashCommand = {
    command: string;
    command_type: CommandType;
    help: string;
};

export type SlashCommandsResponse = {
    commands: Array<SlashCommand>;
};

export type StartAgentRequest = {
    extension_overrides?: Array<ExtensionConfig> | null;
    recipe?: Recipe | null;
    recipe_deeplink?: string | null;
    recipe_id?: string | null;
    working_dir: string;
};

export type StopAgentRequest = {
    session_id: string;
};

export type SubRecipe = {
    description?: string | null;
    name: string;
    path: string;
    sequential_when_repeated?: boolean;
    values?: {
        [key: string]: string;
    } | null;
};

/**
 * Execute a shell command and check its exit status
 */
export type SuccessCheck = {
    /**
     * The shell command to execute
     */
    command: string;
    type: 'Shell';
};

export type SystemInfo = {
    app_version: string;
    architecture: string;
    enabled_extensions: Array<string>;
    model?: string | null;
    os: string;
    os_version: string;
    provider?: string | null;
};

export type SystemNotificationContent = {
    data?: unknown;
    msg: string;
    notificationType: SystemNotificationType;
};

export type SystemNotificationType = 'thinkingMessage' | 'inlineMessage' | 'creditsExhausted';

export type TaskSupport = 'forbidden' | 'optional' | 'required';

export type TelemetryEventRequest = {
    event_name: string;
    properties?: {
        [key: string]: unknown;
    };
};

/**
 * Information about a template including its content and customization status
 */
export type Template = {
    default_content: string;
    description: string;
    is_customized: boolean;
    name: string;
    user_content?: string | null;
};

export type TextContent = {
    _meta?: {
        [key: string]: unknown;
    };
    annotations?: Annotations | {
        [key: string]: unknown;
    };
    text: string;
};

export type ThinkingContent = {
    signature: string;
    thinking: string;
};

export type ThinkingEffort = 'off' | 'low' | 'medium' | 'high' | 'max';

export type TokenState = {
    accumulatedCost?: number | null;
    accumulatedInputTokens: number;
    accumulatedOutputTokens: number;
    accumulatedTotalTokens: number;
    inputTokens: number;
    outputTokens: number;
    totalTokens: number;
};

export type Tool = {
    _meta?: {
        [key: string]: unknown;
    };
    annotations?: ToolAnnotations | {
        [key: string]: unknown;
    };
    description?: string;
    execution?: ToolExecution | {
        [key: string]: unknown;
    };
    icons?: Array<Icon>;
    inputSchema: {
        [key: string]: unknown;
    };
    name: string;
    outputSchema?: {
        [key: string]: unknown;
    };
    title?: string;
};

export type ToolAnnotations = {
    destructiveHint?: boolean;
    idempotentHint?: boolean;
    openWorldHint?: boolean;
    readOnlyHint?: boolean;
    title?: string;
};

export type ToolCallingMode = 'auto' | 'force_native' | 'force_emulated';

export type ToolConfirmationRequest = {
    arguments: JsonObject;
    id: string;
    prompt?: string | null;
    toolName: string;
};

export type ToolExecution = {
    taskSupport?: TaskSupport | {
        [key: string]: unknown;
    };
};

/**
 * Information about the tool used for building prompts
 */
export type ToolInfo = {
    description: string;
    input_schema?: {
        [key: string]: unknown;
    };
    name: string;
    parameters: Array<string>;
    permission?: PermissionLevel | null;
};

export type ToolPermission = {
    permission: PermissionLevel;
    tool_name: string;
};

export type ToolRequest = {
    _meta?: {
        [key: string]: unknown;
    };
    id: string;
    metadata?: {
        [key: string]: unknown;
    };
    toolCall: {
        [key: string]: unknown;
    };
};

export type ToolResponse = {
    id: string;
    metadata?: {
        [key: string]: unknown;
    };
    toolResult: {
        [key: string]: unknown;
    };
};

export type TranscribeRequest = {
    /**
     * Base64 encoded audio data
     */
    audio: string;
    /**
     * MIME type of the audio (e.g., "audio/webm", "audio/wav")
     */
    mime_type: string;
    provider: DictationProvider;
};

export type TranscribeResponse = {
    /**
     * Transcribed text from the audio
     */
    text: string;
};

export type TunnelInfo = {
    hostname: string;
    secret: string;
    state: TunnelState;
    url: string;
};

export type TunnelState = 'idle' | 'starting' | 'running' | 'error' | 'disabled';

/**
 * UI-specific metadata for MCP resources
 */
export type UiMetadata = {
    csp?: CspMetadata | null;
    /**
     * Preferred domain for the app (used for CORS)
     */
    domain?: string | null;
    permissions?: PermissionsMetadata;
    /**
     * Whether the app prefers to have a border around it
     */
    prefersBorder?: boolean | null;
};

export type UpdateCustomProviderRequest = {
    api_key: string;
    api_url: string;
    base_path?: string | null;
    catalog_provider_id?: string | null;
    display_name: string;
    engine: string;
    headers?: {
        [key: string]: string;
    } | null;
    models: Array<string>;
    preserves_thinking?: boolean | null;
    requires_auth?: boolean;
    supports_streaming?: boolean | null;
};

export type UpdateFromSessionRequest = {
    session_id: string;
};

export type UpdateProviderRequest = {
    context_limit?: number | null;
    model?: string | null;
    provider: string;
    request_params?: {
        [key: string]: unknown;
    } | null;
    session_id: string;
};

export type UpdateScheduleRequest = {
    cron: string;
};

export type UpdateSessionNameRequest = {
    /**
     * Updated name for the session (max 200 characters)
     */
    name: string;
};

export type UpdateSessionRequest = {
    goose_mode?: string | null;
    session_id: string;
};

export type UpdateSessionUserRecipeValuesRequest = {
    /**
     * Recipe parameter values entered by the user
     */
    userRecipeValues: {
        [key: string]: string;
    };
};

export type UpdateSessionUserRecipeValuesResponse = {
    recipe: Recipe;
};

export type UpdateWorkingDirRequest = {
    session_id: string;
    working_dir: string;
};

export type UpsertConfigQuery = {
    is_secret: boolean;
    key: string;
    value: unknown;
};

export type UpsertPermissionsQuery = {
    tool_permissions: Array<ToolPermission>;
};

export type WhisperModelResponse = {
    /**
     * Description
     */
    description: string;
    /**
     * Model identifier (e.g., "tiny", "base", "small")
     */
    id: string;
    /**
     * Model file size in MB
     */
    size_mb: number;
    /**
     * Download URL from HuggingFace
     */
    url: string;
} & {
    downloaded: boolean;
    recommended: boolean;
};

export type WindowProps = {
    height: number;
    resizable: boolean;
    width: number;
};

export type ConfirmToolActionData = {
    body: ConfirmToolActionRequest;
    path?: never;
    query?: never;
    url: '/action-required/tool-confirmation';
};

export type ConfirmToolActionErrors = {
    /**
     * Unauthorized - invalid secret key
     */
    401: unknown;
    /**
     * Internal server error
     */
    500: unknown;
};

export type ConfirmToolActionResponses = {
    /**
     * Tool confirmation action is confirmed
     */
    200: unknown;
};

export type CallToolData = {
    body: CallToolRequest;
    path?: never;
    query?: never;
    url: '/agent/call_tool';
};

export type CallToolErrors = {
    /**
     * Unauthorized - invalid secret key
     */
    401: unknown;
    /**
     * Forbidden - tool is not app-visible
     */
    403: ErrorResponse;
    /**
     * Resource not found
     */
    404: ErrorResponse;
    /**
     * Frontend tool execution requires the frontend host
     */
    424: ErrorResponse;
    /**
     * Internal server error
     */
    500: ErrorResponse;
};

export type CallToolError = CallToolErrors[keyof CallToolErrors];

export type CallToolResponses = {
    /**
     * Resource read successfully
     */
    200: CallToolResponse;
};

export type CallToolResponse2 = CallToolResponses[keyof CallToolResponses];

export type ExportAppData = {
    body?: never;
    path: {
        /**
         * Name of the app to export
         */
        name: string;
    };
    query?: never;
    url: '/agent/export_app/{name}';
};

export type ExportAppErrors = {
    /**
     * App not found
     */
    404: ErrorResponse;
    /**
     * Internal server error
     */
    500: ErrorResponse;
};

export type ExportAppError = ExportAppErrors[keyof ExportAppErrors];

export type ExportAppResponses = {
    /**
     * App HTML exported successfully
     */
    200: string;
};

export type ExportAppResponse = ExportAppResponses[keyof ExportAppResponses];

export type ImportAppData = {
    body: ImportAppRequest;
    path?: never;
    query?: never;
    url: '/agent/import_app';
};

export type ImportAppErrors = {
    /**
     * Bad request - Invalid HTML
     */
    400: ErrorResponse;
    /**
     * Internal server error
     */
    500: ErrorResponse;
};

export type ImportAppError = ImportAppErrors[keyof ImportAppErrors];

export type ImportAppResponses = {
    /**
     * App imported successfully
     */
    201: ImportAppResponse;
};

export type ImportAppResponse2 = ImportAppResponses[keyof ImportAppResponses];

export type ListAppsData = {
    body?: never;
    path?: never;
    query?: {
        session_id?: string | null;
    };
    url: '/agent/list_apps';
};

export type ListAppsErrors = {
    /**
     * Unauthorized - Invalid or missing API key
     */
    401: ErrorResponse;
    /**
     * Internal server error
     */
    500: ErrorResponse;
};

export type ListAppsError = ListAppsErrors[keyof ListAppsErrors];

export type ListAppsResponses = {
    /**
     * List of apps retrieved successfully
     */
    200: ListAppsResponse;
};

export type ListAppsResponse2 = ListAppsResponses[keyof ListAppsResponses];

export type ReadResourceData = {
    body: ReadResourceRequest;
    path?: never;
    query?: never;
    url: '/agent/read_resource';
};

export type ReadResourceErrors = {
    /**
     * Unauthorized - invalid secret key
     */
    401: unknown;
    /**
     * Resource not found
     */
    404: unknown;
    /**
     * Agent not initialized
     */
    424: unknown;
    /**
     * Internal server error
     */
    500: unknown;
};

export type ReadResourceResponses = {
    /**
     * Resource read successfully
     */
    200: ReadResourceResponse;
};

export type ReadResourceResponse2 = ReadResourceResponses[keyof ReadResourceResponses];

export type RestartAgentData = {
    body: RestartAgentRequest;
    path?: never;
    query?: never;
    url: '/agent/restart';
};

export type RestartAgentErrors = {
    /**
     * Unauthorized - invalid secret key
     */
    401: unknown;
    /**
     * Session not found
     */
    404: unknown;
    /**
     * Internal server error
     */
    500: unknown;
};

export type RestartAgentResponses = {
    /**
     * Agent restarted successfully
     */
    200: RestartAgentResponse;
};

export type RestartAgentResponse2 = RestartAgentResponses[keyof RestartAgentResponses];

export type ResumeAgentData = {
    body: ResumeAgentRequest;
    path?: never;
    query?: never;
    url: '/agent/resume';
};

export type ResumeAgentErrors = {
    /**
     * Bad request - invalid working directory
     */
    400: unknown;
    /**
     * Unauthorized - invalid secret key
     */
    401: unknown;
    /**
     * Internal server error
     */
    500: unknown;
};

export type ResumeAgentResponses = {
    /**
     * Agent started successfully
     */
    200: ResumeAgentResponse;
};

export type ResumeAgentResponse2 = ResumeAgentResponses[keyof ResumeAgentResponses];

export type StartAgentData = {
    body: StartAgentRequest;
    path?: never;
    query?: never;
    url: '/agent/start';
};

export type StartAgentErrors = {
    /**
     * Bad request
     */
    400: ErrorResponse;
    /**
     * Unauthorized - invalid secret key
     */
    401: unknown;
    /**
     * Internal server error
     */
    500: ErrorResponse;
};

export type StartAgentError = StartAgentErrors[keyof StartAgentErrors];

export type StartAgentResponses = {
    /**
     * Agent started successfully
     */
    200: Session;
};

export type StartAgentResponse = StartAgentResponses[keyof StartAgentResponses];

export type StopAgentData = {
    body: StopAgentRequest;
    path?: never;
    query?: never;
    url: '/agent/stop';
};

export type StopAgentErrors = {
    /**
     * Unauthorized - invalid secret key
     */
    401: unknown;
    /**
     * Session not found
     */
    404: unknown;
    /**
     * Internal server error
     */
    500: unknown;
};

export type StopAgentResponses = {
    /**
     * Agent stopped successfully
     */
    200: string;
};

export type StopAgentResponse = StopAgentResponses[keyof StopAgentResponses];

export type GetToolsData = {
    body?: never;
    path?: never;
    query: {
        /**
         * Optional extension name to filter tools
         */
        extension_name?: string | null;
        /**
         * Required session ID to scope tools to a specific session
         */
        session_id: string;
    };
    url: '/agent/tools';
};

export type GetToolsErrors = {
    /**
     * Unauthorized - invalid secret key
     */
    401: unknown;
    /**
     * Agent not initialized
     */
    424: unknown;
    /**
     * Internal server error
     */
    500: unknown;
};

export type GetToolsResponses = {
    /**
     * Tools retrieved successfully
     */
    200: Array<ToolInfo>;
};

export type GetToolsResponse = GetToolsResponses[keyof GetToolsResponses];

export type UpdateFromSessionData = {
    body: UpdateFromSessionRequest;
    path?: never;
    query?: never;
    url: '/agent/update_from_session';
};

export type UpdateFromSessionErrors = {
    /**
     * Unauthorized - invalid secret key
     */
    401: unknown;
    /**
     * Agent not initialized
     */
    424: unknown;
};

export type UpdateFromSessionResponses = {
    /**
     * Update agent from session data successfully
     */
    200: unknown;
};

export type UpdateAgentProviderData = {
    body: UpdateProviderRequest;
    path?: never;
    query?: never;
    url: '/agent/update_provider';
};

export type UpdateAgentProviderErrors = {
    /**
     * Bad request - missing or invalid parameters
     */
    400: unknown;
    /**
     * Unauthorized - invalid secret key
     */
    401: unknown;
    /**
     * Agent not initialized
     */
    424: unknown;
    /**
     * Internal server error
     */
    500: unknown;
};

export type UpdateAgentProviderResponses = {
    /**
     * Provider updated successfully
     */
    200: unknown;
};

export type UpdateSessionData = {
    body: UpdateSessionRequest;
    path?: never;
    query?: never;
    url: '/agent/update_session';
};

export type UpdateSessionErrors = {
    /**
     * Invalid request
     */
    400: unknown;
    /**
     * Internal error
     */
    500: unknown;
};

export type UpdateSessionResponses = {
    /**
     * Session updated
     */
    200: unknown;
};

export type UpdateWorkingDirData = {
    body: UpdateWorkingDirRequest;
    path?: never;
    query?: never;
    url: '/agent/update_working_dir';
};

export type UpdateWorkingDirErrors = {
    /**
     * Bad request - invalid directory path
     */
    400: unknown;
    /**
     * Unauthorized - invalid secret key
     */
    401: unknown;
    /**
     * Session not found
     */
    404: unknown;
    /**
     * Internal server error
     */
    500: unknown;
};

export type UpdateWorkingDirResponses = {
    /**
     * Working directory updated and agent restarted successfully
     */
    200: unknown;
};

export type ReadAllConfigData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/config';
};

export type ReadAllConfigResponses = {
    /**
     * All configuration values retrieved successfully
     */
    200: ConfigResponse;
};

export type ReadAllConfigResponse = ReadAllConfigResponses[keyof ReadAllConfigResponses];

export type GetCanonicalModelInfoData = {
    body: ModelInfoQuery;
    path?: never;
    query?: never;
    url: '/config/canonical-model-info';
};

export type GetCanonicalModelInfoResponses = {
    /**
     * Model information retrieved successfully
     */
    200: ModelInfoResponse;
};

export type GetCanonicalModelInfoResponse = GetCanonicalModelInfoResponses[keyof GetCanonicalModelInfoResponses];

export type CheckProviderData = {
    body: CheckProviderRequest;
    path?: never;
    query?: never;
    url: '/config/check_provider';
};

export type CreateCustomProviderData = {
    body: UpdateCustomProviderRequest;
    path?: never;
    query?: never;
    url: '/config/custom-providers';
};

export type CreateCustomProviderErrors = {
    /**
     * Invalid request
     */
    400: unknown;
    /**
     * Internal server error
     */
    500: unknown;
};

export type CreateCustomProviderResponses = {
    /**
     * Custom provider created successfully
     */
    200: CreateCustomProviderResponse;
};

export type CreateCustomProviderResponse2 = CreateCustomProviderResponses[keyof CreateCustomProviderResponses];

export type RemoveCustomProviderData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/config/custom-providers/{id}';
};

export type RemoveCustomProviderErrors = {
    /**
     * Provider not found
     */
    404: unknown;
    /**
     * Internal server error
     */
    500: unknown;
};

export type RemoveCustomProviderResponses = {
    /**
     * Custom provider removed successfully
     */
    200: string;
};

export type RemoveCustomProviderResponse = RemoveCustomProviderResponses[keyof RemoveCustomProviderResponses];

export type GetCustomProviderData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/config/custom-providers/{id}';
};

export type GetCustomProviderErrors = {
    /**
     * Provider not found
     */
    404: unknown;
    /**
     * Internal server error
     */
    500: unknown;
};

export type GetCustomProviderResponses = {
    /**
     * Custom provider retrieved successfully
     */
    200: LoadedProvider;
};

export type GetCustomProviderResponse = GetCustomProviderResponses[keyof GetCustomProviderResponses];

export type UpdateCustomProviderData = {
    body: UpdateCustomProviderRequest;
    path: {
        id: string;
    };
    query?: never;
    url: '/config/custom-providers/{id}';
};

export type UpdateCustomProviderErrors = {
    /**
     * Provider not found
     */
    404: unknown;
    /**
     * Internal server error
     */
    500: unknown;
};

export type UpdateCustomProviderResponses = {
    /**
     * Custom provider updated successfully
     */
    200: string;
};

export type UpdateCustomProviderResponse = UpdateCustomProviderResponses[keyof UpdateCustomProviderResponses];

export type UpsertPermissionsData = {
    body: UpsertPermissionsQuery;
    path?: never;
    query?: never;
    url: '/config/permissions';
};

export type UpsertPermissionsErrors = {
    /**
     * Invalid request
     */
    400: unknown;
};

export type UpsertPermissionsResponses = {
    /**
     * Permission update completed
     */
    200: string;
};

export type UpsertPermissionsResponse = UpsertPermissionsResponses[keyof UpsertPermissionsResponses];

export type GetPromptsData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/config/prompts';
};

export type GetPromptsResponses = {
    /**
     * List of all available prompts
     */
    200: PromptsListResponse;
};

export type GetPromptsResponse = GetPromptsResponses[keyof GetPromptsResponses];

export type ResetPromptData = {
    body?: never;
    path: {
        /**
         * Prompt template name (e.g., system.md)
         */
        name: string;
    };
    query?: never;
    url: '/config/prompts/{name}';
};

export type ResetPromptErrors = {
    /**
     * Prompt not found
     */
    404: unknown;
    /**
     * Failed to reset prompt
     */
    500: unknown;
};

export type ResetPromptResponses = {
    /**
     * Prompt reset to default successfully
     */
    200: string;
};

export type ResetPromptResponse = ResetPromptResponses[keyof ResetPromptResponses];

export type GetPromptData = {
    body?: never;
    path: {
        /**
         * Prompt template name (e.g., system.md)
         */
        name: string;
    };
    query?: never;
    url: '/config/prompts/{name}';
};

export type GetPromptErrors = {
    /**
     * Prompt not found
     */
    404: unknown;
};

export type GetPromptResponses = {
    /**
     * Prompt content retrieved successfully
     */
    200: PromptContentResponse;
};

export type GetPromptResponse = GetPromptResponses[keyof GetPromptResponses];

export type SavePromptData = {
    body: SavePromptRequest;
    path: {
        /**
         * Prompt template name (e.g., system.md)
         */
        name: string;
    };
    query?: never;
    url: '/config/prompts/{name}';
};

export type SavePromptErrors = {
    /**
     * Prompt not found
     */
    404: unknown;
    /**
     * Failed to save prompt
     */
    500: unknown;
};

export type SavePromptResponses = {
    /**
     * Prompt saved successfully
     */
    200: string;
};

export type SavePromptResponse = SavePromptResponses[keyof SavePromptResponses];

export type GetProviderCatalogData = {
    body?: never;
    path?: never;
    query?: {
        /**
         * Filter by provider format (openai, anthropic, ollama)
         */
        format?: string | null;
    };
    url: '/config/provider-catalog';
};

export type GetProviderCatalogErrors = {
    /**
     * Invalid format parameter
     */
    400: unknown;
};

export type GetProviderCatalogResponses = {
    /**
     * Provider catalog retrieved successfully
     */
    200: Array<ProviderCatalogEntry>;
};

export type GetProviderCatalogResponse = GetProviderCatalogResponses[keyof GetProviderCatalogResponses];

export type GetProviderCatalogTemplateData = {
    body?: never;
    path: {
        /**
         * Provider ID from models.dev
         */
        id: string;
    };
    query?: never;
    url: '/config/provider-catalog/{id}';
};

export type GetProviderCatalogTemplateErrors = {
    /**
     * Provider not found in catalog
     */
    404: unknown;
};

export type GetProviderCatalogTemplateResponses = {
    /**
     * Provider template retrieved successfully
     */
    200: ProviderTemplate;
};

export type GetProviderCatalogTemplateResponse = GetProviderCatalogTemplateResponses[keyof GetProviderCatalogTemplateResponses];

export type ProvidersData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/config/providers';
};

export type ProvidersResponses = {
    /**
     * All configuration values retrieved successfully
     */
    200: Array<ProviderDetails>;
};

export type ProvidersResponse2 = ProvidersResponses[keyof ProvidersResponses];

export type CleanupProviderCacheData = {
    body?: never;
    path: {
        /**
         * Provider name (e.g., githubcopilot)
         */
        name: string;
    };
    query?: never;
    url: '/config/providers/{name}/cleanup';
};

export type CleanupProviderCacheErrors = {
    /**
     * Internal server error
     */
    500: unknown;
};

export type CleanupProviderCacheResponses = {
    /**
     * Provider cache cleaned up successfully
     */
    200: string;
};

export type CleanupProviderCacheResponse = CleanupProviderCacheResponses[keyof CleanupProviderCacheResponses];

export type GetProviderModelInfoData = {
    body: ProviderModelInfoQuery;
    path: {
        /**
         * Provider name (e.g., openai)
         */
        name: string;
    };
    query?: never;
    url: '/config/providers/{name}/model-info';
};

export type GetProviderModelInfoErrors = {
    /**
     * Unknown provider, provider not configured, or authentication error
     */
    400: unknown;
    /**
     * Rate limit exceeded
     */
    429: unknown;
    /**
     * Internal server error
     */
    500: unknown;
};

export type GetProviderModelInfoResponses = {
    /**
     * Model metadata fetched successfully
     */
    200: ModelInfo;
};

export type GetProviderModelInfoResponse = GetProviderModelInfoResponses[keyof GetProviderModelInfoResponses];

export type GetProviderModelsData = {
    body?: never;
    path: {
        /**
         * Provider name (e.g., openai)
         */
        name: string;
    };
    query?: never;
    url: '/config/providers/{name}/models';
};

export type GetProviderModelsErrors = {
    /**
     * Unknown provider, provider not configured, or authentication error
     */
    400: unknown;
    /**
     * Rate limit exceeded
     */
    429: unknown;
    /**
     * Internal server error
     */
    500: unknown;
};

export type GetProviderModelsResponses = {
    /**
     * Models fetched successfully
     */
    200: Array<ModelInfo>;
};

export type GetProviderModelsResponse = GetProviderModelsResponses[keyof GetProviderModelsResponses];

export type ConfigureProviderOauthData = {
    body?: never;
    path: {
        /**
         * Provider name
         */
        name: string;
    };
    query?: never;
    url: '/config/providers/{name}/oauth';
};

export type ConfigureProviderOauthErrors = {
    /**
     * OAuth configuration failed
     */
    400: unknown;
};

export type ConfigureProviderOauthResponses = {
    /**
     * OAuth configuration completed
     */
    200: unknown;
};

export type ReadConfigData = {
    body: ConfigKeyQuery;
    path?: never;
    query?: never;
    url: '/config/read';
};

export type ReadConfigErrors = {
    /**
     * Unable to get the configuration value
     */
    500: unknown;
};

export type ReadConfigResponses = {
    /**
     * Configuration value retrieved successfully
     */
    200: unknown;
};

export type RemoveConfigData = {
    body: ConfigKeyQuery;
    path?: never;
    query?: never;
    url: '/config/remove';
};

export type RemoveConfigErrors = {
    /**
     * Configuration key not found
     */
    404: unknown;
    /**
     * Internal server error
     */
    500: unknown;
};

export type RemoveConfigResponses = {
    /**
     * Configuration value removed successfully
     */
    200: string;
};

export type RemoveConfigResponse = RemoveConfigResponses[keyof RemoveConfigResponses];

export type SetConfigProviderData = {
    body: SetProviderRequest;
    path?: never;
    query?: never;
    url: '/config/set_provider';
};

export type GetSlashCommandsData = {
    body?: never;
    path?: never;
    query?: {
        /**
         * Optional working directory to discover local skills from
         */
        working_dir?: string | null;
    };
    url: '/config/slash_commands';
};

export type GetSlashCommandsResponses = {
    /**
     * Slash commands retrieved successfully
     */
    200: SlashCommandsResponse;
};

export type GetSlashCommandsResponse = GetSlashCommandsResponses[keyof GetSlashCommandsResponses];

export type UpsertConfigData = {
    body: UpsertConfigQuery;
    path?: never;
    query?: never;
    url: '/config/upsert';
};

export type UpsertConfigErrors = {
    /**
     * Internal server error
     */
    500: unknown;
};

export type UpsertConfigResponses = {
    /**
     * Configuration value upserted successfully
     */
    200: string;
};

export type UpsertConfigResponse = UpsertConfigResponses[keyof UpsertConfigResponses];

export type ValidateConfigData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/config/validate';
};

export type ValidateConfigErrors = {
    /**
     * Config file is corrupted
     */
    422: unknown;
};

export type ValidateConfigResponses = {
    /**
     * Config validation result
     */
    200: string;
};

export type ValidateConfigResponse = ValidateConfigResponses[keyof ValidateConfigResponses];

export type DiagnosticsData = {
    body?: never;
    path: {
        session_id: string;
    };
    query?: never;
    url: '/diagnostics/{session_id}';
};

export type DiagnosticsErrors = {
    /**
     * Failed to generate diagnostics
     */
    500: unknown;
};

export type DiagnosticsResponses = {
    /**
     * Diagnostics zip file
     */
    200: Blob | File;
};

export type DiagnosticsResponse = DiagnosticsResponses[keyof DiagnosticsResponses];

export type GetDictationConfigData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/dictation/config';
};

export type GetDictationConfigResponses = {
    /**
     * Audio transcription provider configurations
     */
    200: {
        [key: string]: DictationProviderStatus;
    };
};

export type GetDictationConfigResponse = GetDictationConfigResponses[keyof GetDictationConfigResponses];

export type ListModelsData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/dictation/models';
};

export type ListModelsResponses = {
    /**
     * List of available Whisper models
     */
    200: Array<WhisperModelResponse>;
};

export type ListModelsResponse = ListModelsResponses[keyof ListModelsResponses];

export type DeleteModelData = {
    body?: never;
    path: {
        model_id: string;
    };
    query?: never;
    url: '/dictation/models/{model_id}';
};

export type DeleteModelErrors = {
    /**
     * Model not found or not downloaded
     */
    404: unknown;
    /**
     * Failed to delete model
     */
    500: unknown;
};

export type DeleteModelResponses = {
    /**
     * Model deleted
     */
    200: unknown;
};

export type CancelDownloadData = {
    body?: never;
    path: {
        model_id: string;
    };
    query?: never;
    url: '/dictation/models/{model_id}/download';
};

export type CancelDownloadErrors = {
    /**
     * Download not found
     */
    404: unknown;
};

export type CancelDownloadResponses = {
    /**
     * Download cancelled
     */
    200: unknown;
};

export type GetDownloadProgressData = {
    body?: never;
    path: {
        model_id: string;
    };
    query?: never;
    url: '/dictation/models/{model_id}/download';
};

export type GetDownloadProgressErrors = {
    /**
     * Download not found
     */
    404: unknown;
};

export type GetDownloadProgressResponses = {
    /**
     * Download progress
     */
    200: DownloadProgress;
};

export type GetDownloadProgressResponse = GetDownloadProgressResponses[keyof GetDownloadProgressResponses];

export type DownloadModelData = {
    body?: never;
    path: {
        model_id: string;
    };
    query?: never;
    url: '/dictation/models/{model_id}/download';
};

export type DownloadModelErrors = {
    /**
     * Download already in progress
     */
    400: unknown;
    /**
     * Internal server error
     */
    500: unknown;
};

export type DownloadModelResponses = {
    /**
     * Download started
     */
    202: unknown;
};

export type TranscribeDictationData = {
    body: TranscribeRequest;
    path?: never;
    query?: never;
    url: '/dictation/transcribe';
};

export type TranscribeDictationErrors = {
    /**
     * Invalid request (bad base64 or unsupported format)
     */
    400: unknown;
    /**
     * Invalid API key
     */
    401: unknown;
    /**
     * Provider not configured
     */
    412: unknown;
    /**
     * Audio file too large (max 50MB)
     */
    413: unknown;
    /**
     * Rate limit exceeded
     */
    429: unknown;
    /**
     * Internal server error
     */
    500: unknown;
    /**
     * Provider API error
     */
    502: unknown;
    /**
     * Service unavailable
     */
    503: unknown;
    /**
     * Request timeout
     */
    504: unknown;
};

export type TranscribeDictationResponses = {
    /**
     * Audio transcribed successfully
     */
    200: TranscribeResponse;
};

export type TranscribeDictationResponse = TranscribeDictationResponses[keyof TranscribeDictationResponses];

export type GetFeaturesData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/features';
};

export type GetFeaturesResponses = {
    /**
     * Compile-time feature flags
     */
    200: FeaturesResponse;
};

export type GetFeaturesResponse = GetFeaturesResponses[keyof GetFeaturesResponses];

export type StartNanogptSetupData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/handle_nanogpt';
};

export type StartNanogptSetupResponses = {
    200: SetupResponse;
};

export type StartNanogptSetupResponse = StartNanogptSetupResponses[keyof StartNanogptSetupResponses];

export type StartOpenrouterSetupData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/handle_openrouter';
};

export type StartOpenrouterSetupResponses = {
    200: SetupResponse;
};

export type StartOpenrouterSetupResponse = StartOpenrouterSetupResponses[keyof StartOpenrouterSetupResponses];

export type StartTetrateSetupData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/handle_tetrate';
};

export type StartTetrateSetupResponses = {
    200: SetupResponse;
};

export type StartTetrateSetupResponse = StartTetrateSetupResponses[keyof StartTetrateSetupResponses];

export type ListBuiltinChatTemplatesData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/local-inference/chat-templates/builtin';
};

export type ListBuiltinChatTemplatesResponses = {
    /**
     * llama.cpp built-in chat template names
     */
    200: Array<string>;
};

export type ListBuiltinChatTemplatesResponse = ListBuiltinChatTemplatesResponses[keyof ListBuiltinChatTemplatesResponses];

export type DownloadHfModelData = {
    body: DownloadModelRequest;
    path?: never;
    query?: never;
    url: '/local-inference/download';
};

export type DownloadHfModelErrors = {
    /**
     * Invalid request
     */
    400: unknown;
};

export type DownloadHfModelResponses = {
    /**
     * Download started
     */
    202: string;
};

export type DownloadHfModelResponse = DownloadHfModelResponses[keyof DownloadHfModelResponses];

export type ListLocalModelsData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/local-inference/models';
};

export type ListLocalModelsResponses = {
    /**
     * List of available local LLM models
     */
    200: Array<LocalModelResponse>;
};

export type ListLocalModelsResponse = ListLocalModelsResponses[keyof ListLocalModelsResponses];

export type DeleteLocalModelData = {
    body?: never;
    path: {
        model_id: string;
    };
    query?: never;
    url: '/local-inference/models/{model_id}';
};

export type DeleteLocalModelErrors = {
    /**
     * Model not found
     */
    404: unknown;
};

export type DeleteLocalModelResponses = {
    /**
     * Model deleted
     */
    200: unknown;
};

export type CancelLocalModelDownloadData = {
    body?: never;
    path: {
        model_id: string;
    };
    query?: never;
    url: '/local-inference/models/{model_id}/download';
};

export type CancelLocalModelDownloadErrors = {
    /**
     * No active download
     */
    404: unknown;
};

export type CancelLocalModelDownloadResponses = {
    /**
     * Download cancelled
     */
    200: unknown;
};

export type GetLocalModelDownloadProgressData = {
    body?: never;
    path: {
        model_id: string;
    };
    query?: never;
    url: '/local-inference/models/{model_id}/download';
};

export type GetLocalModelDownloadProgressErrors = {
    /**
     * No active download
     */
    404: unknown;
};

export type GetLocalModelDownloadProgressResponses = {
    /**
     * Download progress
     */
    200: DownloadProgress;
};

export type GetLocalModelDownloadProgressResponse = GetLocalModelDownloadProgressResponses[keyof GetLocalModelDownloadProgressResponses];

export type GetModelSettingsData = {
    body?: never;
    path: {
        model_id: string;
    };
    query?: never;
    url: '/local-inference/models/{model_id}/settings';
};

export type GetModelSettingsErrors = {
    /**
     * Model not found
     */
    404: unknown;
};

export type GetModelSettingsResponses = {
    /**
     * Model settings
     */
    200: ModelSettings;
};

export type GetModelSettingsResponse = GetModelSettingsResponses[keyof GetModelSettingsResponses];

export type UpdateModelSettingsData = {
    body: ModelSettings;
    path: {
        model_id: string;
    };
    query?: never;
    url: '/local-inference/models/{model_id}/settings';
};

export type UpdateModelSettingsErrors = {
    /**
     * Model not found
     */
    404: unknown;
    /**
     * Failed to save settings
     */
    500: unknown;
};

export type UpdateModelSettingsResponses = {
    /**
     * Settings updated
     */
    200: ModelSettings;
};

export type UpdateModelSettingsResponse = UpdateModelSettingsResponses[keyof UpdateModelSettingsResponses];

export type GetRepoFilesData = {
    body?: never;
    path: {
        author: string;
        repo: string;
    };
    query?: never;
    url: '/local-inference/repo/{author}/{repo}/files';
};

export type GetRepoFilesResponses = {
    /**
     * GGUF files in the repo
     */
    200: RepoVariantsResponse;
};

export type GetRepoFilesResponse = GetRepoFilesResponses[keyof GetRepoFilesResponses];

export type SearchHfModelsData = {
    body?: never;
    path?: never;
    query: {
        /**
         * Search query
         */
        q: string;
        /**
         * Max results
         */
        limit?: number | null;
    };
    url: '/local-inference/search';
};

export type SearchHfModelsErrors = {
    /**
     * Search failed
     */
    500: unknown;
};

export type SearchHfModelsResponses = {
    /**
     * Search results
     */
    200: Array<HfModelInfo>;
};

export type SearchHfModelsResponse = SearchHfModelsResponses[keyof SearchHfModelsResponses];

export type SyncFeaturedModelsData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/local-inference/sync-featured';
};

export type SyncFeaturedModelsResponses = {
    /**
     * Featured models synced to registry
     */
    200: unknown;
};

export type McpUiProxyData = {
    body?: never;
    path?: never;
    query: {
        /**
         * Secret key for authentication
         */
        secret: string;
    };
    url: '/mcp-ui-proxy';
};

export type McpUiProxyErrors = {
    /**
     * Unauthorized - invalid or missing secret
     */
    401: unknown;
};

export type McpUiProxyResponses = {
    /**
     * MCP UI proxy HTML page
     */
    200: unknown;
};

export type CreateRecipeData = {
    body: CreateRecipeRequest;
    path?: never;
    query?: never;
    url: '/recipes/create';
};

export type CreateRecipeErrors = {
    /**
     * Bad request
     */
    400: unknown;
    /**
     * Precondition failed - Agent not available
     */
    412: unknown;
    /**
     * Internal server error
     */
    500: unknown;
};

export type CreateRecipeResponses = {
    /**
     * Recipe created successfully
     */
    200: CreateRecipeResponse;
};

export type CreateRecipeResponse2 = CreateRecipeResponses[keyof CreateRecipeResponses];

export type DecodeRecipeData = {
    body: DecodeRecipeRequest;
    path?: never;
    query?: never;
    url: '/recipes/decode';
};

export type DecodeRecipeErrors = {
    /**
     * Bad request
     */
    400: unknown;
};

export type DecodeRecipeResponses = {
    /**
     * Recipe decoded successfully
     */
    200: DecodeRecipeResponse;
};

export type DecodeRecipeResponse2 = DecodeRecipeResponses[keyof DecodeRecipeResponses];

export type DeleteRecipeData = {
    body: DeleteRecipeRequest;
    path?: never;
    query?: never;
    url: '/recipes/delete';
};

export type DeleteRecipeErrors = {
    /**
     * Unauthorized - Invalid or missing API key
     */
    401: unknown;
    /**
     * Recipe not found
     */
    404: unknown;
    /**
     * Internal server error
     */
    500: unknown;
};

export type DeleteRecipeResponses = {
    /**
     * Recipe deleted successfully
     */
    204: void;
};

export type DeleteRecipeResponse = DeleteRecipeResponses[keyof DeleteRecipeResponses];

export type EncodeRecipeData = {
    body: EncodeRecipeRequest;
    path?: never;
    query?: never;
    url: '/recipes/encode';
};

export type EncodeRecipeErrors = {
    /**
     * Bad request
     */
    400: unknown;
};

export type EncodeRecipeResponses = {
    /**
     * Recipe encoded successfully
     */
    200: EncodeRecipeResponse;
};

export type EncodeRecipeResponse2 = EncodeRecipeResponses[keyof EncodeRecipeResponses];

export type ListRecipesData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/recipes/list';
};

export type ListRecipesErrors = {
    /**
     * Unauthorized - Invalid or missing API key
     */
    401: unknown;
    /**
     * Internal server error
     */
    500: unknown;
};

export type ListRecipesResponses = {
    /**
     * Get recipe list successfully
     */
    200: ListRecipeResponse;
};

export type ListRecipesResponse = ListRecipesResponses[keyof ListRecipesResponses];

export type ParseRecipeData = {
    body: ParseRecipeRequest;
    path?: never;
    query?: never;
    url: '/recipes/parse';
};

export type ParseRecipeErrors = {
    /**
     * Bad request - Invalid recipe format
     */
    400: ErrorResponse;
    /**
     * Internal server error
     */
    500: ErrorResponse;
};

export type ParseRecipeError = ParseRecipeErrors[keyof ParseRecipeErrors];

export type ParseRecipeResponses = {
    /**
     * Recipe parsed successfully
     */
    200: ParseRecipeResponse;
};

export type ParseRecipeResponse2 = ParseRecipeResponses[keyof ParseRecipeResponses];

export type SaveRecipeData = {
    body: SaveRecipeRequest;
    path?: never;
    query?: never;
    url: '/recipes/save';
};

export type SaveRecipeErrors = {
    /**
     * Unauthorized
     */
    401: ErrorResponse;
    /**
     * Not found
     */
    404: ErrorResponse;
    /**
     * Internal server error
     */
    500: ErrorResponse;
};

export type SaveRecipeError = SaveRecipeErrors[keyof SaveRecipeErrors];

export type SaveRecipeResponses = {
    /**
     * Recipe saved to file successfully
     */
    204: SaveRecipeResponse;
};

export type SaveRecipeResponse2 = SaveRecipeResponses[keyof SaveRecipeResponses];

export type ScanRecipeData = {
    body: ScanRecipeRequest;
    path?: never;
    query?: never;
    url: '/recipes/scan';
};

export type ScanRecipeResponses = {
    /**
     * Recipe scanned successfully
     */
    200: ScanRecipeResponse;
};

export type ScanRecipeResponse2 = ScanRecipeResponses[keyof ScanRecipeResponses];

export type ScheduleRecipeData = {
    body: ScheduleRecipeRequest;
    path?: never;
    query?: never;
    url: '/recipes/schedule';
};

export type ScheduleRecipeErrors = {
    /**
     * Recipe not found
     */
    404: unknown;
    /**
     * Internal server error
     */
    500: unknown;
};

export type ScheduleRecipeResponses = {
    /**
     * Recipe scheduled successfully
     */
    200: unknown;
};

export type SetRecipeSlashCommandData = {
    body: SetSlashCommandRequest;
    path?: never;
    query?: never;
    url: '/recipes/slash-command';
};

export type SetRecipeSlashCommandErrors = {
    /**
     * Recipe not found
     */
    404: unknown;
    /**
     * Internal server error
     */
    500: unknown;
};

export type SetRecipeSlashCommandResponses = {
    /**
     * Slash command set successfully
     */
    200: unknown;
};

export type RecipeToYamlData = {
    body: RecipeToYamlRequest;
    path?: never;
    query?: never;
    url: '/recipes/to-yaml';
};

export type RecipeToYamlErrors = {
    /**
     * Bad request - Failed to convert recipe to YAML
     */
    400: ErrorResponse;
};

export type RecipeToYamlError = RecipeToYamlErrors[keyof RecipeToYamlErrors];

export type RecipeToYamlResponses = {
    /**
     * Recipe converted to YAML successfully
     */
    200: RecipeToYamlResponse;
};

export type RecipeToYamlResponse2 = RecipeToYamlResponses[keyof RecipeToYamlResponses];

export type ReplyData = {
    body: ChatRequest;
    path?: never;
    query?: never;
    url: '/reply';
};

export type ReplyErrors = {
    /**
     * Agent not initialized
     */
    424: unknown;
    /**
     * Internal server error
     */
    500: unknown;
};

export type ReplyResponses = {
    /**
     * Streaming response initiated
     */
    200: MessageEvent;
};

export type ReplyResponse = ReplyResponses[keyof ReplyResponses];

export type CreateScheduleData = {
    body: CreateScheduleRequest;
    path?: never;
    query?: never;
    url: '/schedule/create';
};

export type CreateScheduleErrors = {
    /**
     * Invalid cron expression or recipe file
     */
    400: unknown;
    /**
     * Job ID already exists
     */
    409: unknown;
    /**
     * Internal server error
     */
    500: unknown;
};

export type CreateScheduleResponses = {
    /**
     * Scheduled job created successfully
     */
    200: ScheduledJob;
};

export type CreateScheduleResponse = CreateScheduleResponses[keyof CreateScheduleResponses];

export type DeleteScheduleData = {
    body?: never;
    path: {
        /**
         * ID of the schedule to delete
         */
        id: string;
    };
    query?: never;
    url: '/schedule/delete/{id}';
};

export type DeleteScheduleErrors = {
    /**
     * Scheduled job not found
     */
    404: unknown;
    /**
     * Internal server error
     */
    500: unknown;
};

export type DeleteScheduleResponses = {
    /**
     * Scheduled job removed successfully
     */
    204: void;
};

export type DeleteScheduleResponse = DeleteScheduleResponses[keyof DeleteScheduleResponses];

export type ListSchedulesData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/schedule/list';
};

export type ListSchedulesErrors = {
    /**
     * Internal server error
     */
    500: unknown;
};

export type ListSchedulesResponses = {
    /**
     * A list of scheduled jobs
     */
    200: ListSchedulesResponse;
};

export type ListSchedulesResponse2 = ListSchedulesResponses[keyof ListSchedulesResponses];

export type UpdateScheduleData = {
    body: UpdateScheduleRequest;
    path: {
        /**
         * ID of the schedule to update
         */
        id: string;
    };
    query?: never;
    url: '/schedule/{id}';
};

export type UpdateScheduleErrors = {
    /**
     * Cannot update a currently running job or invalid request
     */
    400: unknown;
    /**
     * Scheduled job not found
     */
    404: unknown;
    /**
     * Internal server error
     */
    500: unknown;
};

export type UpdateScheduleResponses = {
    /**
     * Scheduled job updated successfully
     */
    200: ScheduledJob;
};

export type UpdateScheduleResponse = UpdateScheduleResponses[keyof UpdateScheduleResponses];

export type InspectRunningJobData = {
    body?: never;
    path: {
        /**
         * ID of the schedule to inspect
         */
        id: string;
    };
    query?: never;
    url: '/schedule/{id}/inspect';
};

export type InspectRunningJobErrors = {
    /**
     * Scheduled job not found
     */
    404: unknown;
    /**
     * Internal server error
     */
    500: unknown;
};

export type InspectRunningJobResponses = {
    /**
     * Running job information
     */
    200: InspectJobResponse;
};

export type InspectRunningJobResponse = InspectRunningJobResponses[keyof InspectRunningJobResponses];

export type KillRunningJobData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/schedule/{id}/kill';
};

export type KillRunningJobResponses = {
    /**
     * Running job killed successfully
     */
    200: unknown;
};

export type PauseScheduleData = {
    body?: never;
    path: {
        /**
         * ID of the schedule to pause
         */
        id: string;
    };
    query?: never;
    url: '/schedule/{id}/pause';
};

export type PauseScheduleErrors = {
    /**
     * Cannot pause a currently running job
     */
    400: unknown;
    /**
     * Scheduled job not found
     */
    404: unknown;
    /**
     * Internal server error
     */
    500: unknown;
};

export type PauseScheduleResponses = {
    /**
     * Scheduled job paused successfully
     */
    204: void;
};

export type PauseScheduleResponse = PauseScheduleResponses[keyof PauseScheduleResponses];

export type RunNowHandlerData = {
    body?: never;
    path: {
        /**
         * ID of the schedule to run
         */
        id: string;
    };
    query?: never;
    url: '/schedule/{id}/run_now';
};

export type RunNowHandlerErrors = {
    /**
     * Scheduled job not found
     */
    404: unknown;
    /**
     * Internal server error when trying to run the job
     */
    500: unknown;
};

export type RunNowHandlerResponses = {
    /**
     * Scheduled job triggered successfully, returns new session ID
     */
    200: RunNowResponse;
};

export type RunNowHandlerResponse = RunNowHandlerResponses[keyof RunNowHandlerResponses];

export type SessionsHandlerData = {
    body?: never;
    path: {
        /**
         * ID of the schedule
         */
        id: string;
    };
    query: {
        limit: number;
    };
    url: '/schedule/{id}/sessions';
};

export type SessionsHandlerErrors = {
    /**
     * Internal server error
     */
    500: unknown;
};

export type SessionsHandlerResponses = {
    /**
     * A list of session display info
     */
    200: Array<SessionDisplayInfo>;
};

export type SessionsHandlerResponse = SessionsHandlerResponses[keyof SessionsHandlerResponses];

export type UnpauseScheduleData = {
    body?: never;
    path: {
        /**
         * ID of the schedule to unpause
         */
        id: string;
    };
    query?: never;
    url: '/schedule/{id}/unpause';
};

export type UnpauseScheduleErrors = {
    /**
     * Scheduled job not found
     */
    404: unknown;
    /**
     * Internal server error
     */
    500: unknown;
};

export type UnpauseScheduleResponses = {
    /**
     * Scheduled job unpaused successfully
     */
    204: void;
};

export type UnpauseScheduleResponse = UnpauseScheduleResponses[keyof UnpauseScheduleResponses];

export type ListSessionsData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/sessions';
};

export type ListSessionsErrors = {
    /**
     * Unauthorized - Invalid or missing API key
     */
    401: unknown;
    /**
     * Internal server error
     */
    500: unknown;
};

export type ListSessionsResponses = {
    /**
     * List of available sessions retrieved successfully
     */
    200: SessionListResponse;
};

export type ListSessionsResponse = ListSessionsResponses[keyof ListSessionsResponses];

export type ImportSessionData = {
    body: ImportSessionRequest;
    path?: never;
    query?: never;
    url: '/sessions/import';
};

export type ImportSessionErrors = {
    /**
     * Bad request - Invalid JSON
     */
    400: unknown;
    /**
     * Unauthorized - Invalid or missing API key
     */
    401: unknown;
    /**
     * Internal server error
     */
    500: unknown;
};

export type ImportSessionResponses = {
    /**
     * Session imported successfully
     */
    200: Session;
};

export type ImportSessionResponse = ImportSessionResponses[keyof ImportSessionResponses];

export type ImportSessionNostrData = {
    body: ImportSessionNostrRequest;
    path?: never;
    query?: never;
    url: '/sessions/import/nostr';
};

export type ImportSessionNostrErrors = {
    /**
     * Bad request - Invalid Nostr share link
     */
    400: unknown;
    /**
     * Unauthorized - Invalid or missing API key
     */
    401: unknown;
    /**
     * Internal server error
     */
    500: unknown;
};

export type ImportSessionNostrResponses = {
    /**
     * Nostr shared session imported successfully
     */
    200: Session;
};

export type ImportSessionNostrResponse = ImportSessionNostrResponses[keyof ImportSessionNostrResponses];

export type GetSessionInsightsData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/sessions/insights';
};

export type GetSessionInsightsErrors = {
    /**
     * Unauthorized - Invalid or missing API key
     */
    401: unknown;
    /**
     * Internal server error
     */
    500: unknown;
};

export type GetSessionInsightsResponses = {
    /**
     * Session insights retrieved successfully
     */
    200: SessionInsights;
};

export type GetSessionInsightsResponse = GetSessionInsightsResponses[keyof GetSessionInsightsResponses];

export type SearchSessionsData = {
    body?: never;
    path?: never;
    query: {
        /**
         * Search query string
         */
        query: string;
        /**
         * Maximum results (default: 10, max: 50)
         */
        limit?: number | null;
        /**
         * Filter after date (ISO 8601)
         */
        after_date?: string | null;
        /**
         * Filter before date (ISO 8601)
         */
        before_date?: string | null;
    };
    url: '/sessions/search';
};

export type SearchSessionsErrors = {
    /**
     * Bad request - Invalid query
     */
    400: unknown;
    /**
     * Unauthorized
     */
    401: unknown;
    /**
     * Internal server error
     */
    500: unknown;
};

export type SearchSessionsResponses = {
    /**
     * Matching sessions
     */
    200: Array<Session>;
};

export type SearchSessionsResponse = SearchSessionsResponses[keyof SearchSessionsResponses];

export type SessionCancelData = {
    body: CancelRequest;
    path: {
        /**
         * Session ID
         */
        id: string;
    };
    query?: never;
    url: '/sessions/{id}/cancel';
};

export type SessionCancelResponses = {
    /**
     * Cancellation accepted
     */
    200: unknown;
};

export type SessionEventsData = {
    body?: never;
    path: {
        /**
         * Session ID
         */
        id: string;
    };
    query?: never;
    url: '/sessions/{id}/events';
};

export type SessionEventsErrors = {
    /**
     * Session not found
     */
    404: unknown;
};

export type SessionEventsResponses = {
    /**
     * SSE event stream
     */
    200: MessageEvent;
};

export type SessionEventsResponse = SessionEventsResponses[keyof SessionEventsResponses];

export type SessionReplyData = {
    body: SessionReplyRequest;
    path: {
        /**
         * Session ID
         */
        id: string;
    };
    query?: never;
    url: '/sessions/{id}/reply';
};

export type SessionReplyErrors = {
    /**
     * Invalid request
     */
    400: unknown;
    /**
     * Session not found
     */
    404: unknown;
    /**
     * Agent not initialized
     */
    424: unknown;
    /**
     * Internal server error
     */
    500: unknown;
};

export type SessionReplyResponses = {
    /**
     * Request accepted
     */
    200: SessionReplyResponse;
};

export type SessionReplyResponse2 = SessionReplyResponses[keyof SessionReplyResponses];

export type DeleteSessionData = {
    body?: never;
    path: {
        /**
         * Unique identifier for the session
         */
        session_id: string;
    };
    query?: never;
    url: '/sessions/{session_id}';
};

export type DeleteSessionErrors = {
    /**
     * Unauthorized - Invalid or missing API key
     */
    401: unknown;
    /**
     * Session not found
     */
    404: unknown;
    /**
     * Internal server error
     */
    500: unknown;
};

export type DeleteSessionResponses = {
    /**
     * Session deleted successfully
     */
    200: unknown;
};

export type GetSessionData = {
    body?: never;
    path: {
        /**
         * Unique identifier for the session
         */
        session_id: string;
    };
    query?: never;
    url: '/sessions/{session_id}';
};

export type GetSessionErrors = {
    /**
     * Unauthorized - Invalid or missing API key
     */
    401: unknown;
    /**
     * Session not found
     */
    404: unknown;
    /**
     * Internal server error
     */
    500: unknown;
};

export type GetSessionResponses = {
    /**
     * Session history retrieved successfully
     */
    200: Session;
};

export type GetSessionResponse = GetSessionResponses[keyof GetSessionResponses];

export type ExportSessionData = {
    body?: never;
    path: {
        /**
         * Unique identifier for the session
         */
        session_id: string;
    };
    query?: never;
    url: '/sessions/{session_id}/export';
};

export type ExportSessionErrors = {
    /**
     * Unauthorized - Invalid or missing API key
     */
    401: unknown;
    /**
     * Session not found
     */
    404: unknown;
    /**
     * Internal server error
     */
    500: unknown;
};

export type ExportSessionResponses = {
    /**
     * Session exported successfully
     */
    200: string;
};

export type ExportSessionResponse = ExportSessionResponses[keyof ExportSessionResponses];

export type ForkSessionData = {
    body: ForkRequest;
    path: {
        /**
         * Unique identifier for the session
         */
        session_id: string;
    };
    query?: never;
    url: '/sessions/{session_id}/fork';
};

export type ForkSessionErrors = {
    /**
     * Bad request - truncate=true requires timestamp
     */
    400: unknown;
    /**
     * Unauthorized - Invalid or missing API key
     */
    401: unknown;
    /**
     * Session not found
     */
    404: unknown;
    /**
     * Internal server error
     */
    500: unknown;
};

export type ForkSessionResponses = {
    /**
     * Session forked successfully
     */
    200: ForkResponse;
};

export type ForkSessionResponse = ForkSessionResponses[keyof ForkSessionResponses];

export type UpdateSessionNameData = {
    body: UpdateSessionNameRequest;
    path: {
        /**
         * Unique identifier for the session
         */
        session_id: string;
    };
    query?: never;
    url: '/sessions/{session_id}/name';
};

export type UpdateSessionNameErrors = {
    /**
     * Bad request - Name too long (max 200 characters)
     */
    400: unknown;
    /**
     * Unauthorized - Invalid or missing API key
     */
    401: unknown;
    /**
     * Session not found
     */
    404: unknown;
    /**
     * Internal server error
     */
    500: unknown;
};

export type UpdateSessionNameResponses = {
    /**
     * Session name updated successfully
     */
    200: unknown;
};

export type ShareSessionNostrData = {
    body: ShareSessionNostrRequest;
    path: {
        /**
         * Unique identifier for the session
         */
        session_id: string;
    };
    query?: never;
    url: '/sessions/{session_id}/share/nostr';
};

export type ShareSessionNostrErrors = {
    /**
     * Unauthorized - Invalid or missing API key
     */
    401: unknown;
    /**
     * Session not found
     */
    404: unknown;
    /**
     * Internal server error
     */
    500: unknown;
};

export type ShareSessionNostrResponses = {
    /**
     * Session shared to Nostr successfully
     */
    200: ShareSessionNostrResponse;
};

export type ShareSessionNostrResponse2 = ShareSessionNostrResponses[keyof ShareSessionNostrResponses];

export type UpdateSessionUserRecipeValuesData = {
    body: UpdateSessionUserRecipeValuesRequest;
    path: {
        /**
         * Unique identifier for the session
         */
        session_id: string;
    };
    query?: never;
    url: '/sessions/{session_id}/user_recipe_values';
};

export type UpdateSessionUserRecipeValuesErrors = {
    /**
     * Unauthorized - Invalid or missing API key
     */
    401: unknown;
    /**
     * Session not found
     */
    404: ErrorResponse;
    /**
     * Internal server error
     */
    500: ErrorResponse;
};

export type UpdateSessionUserRecipeValuesError = UpdateSessionUserRecipeValuesErrors[keyof UpdateSessionUserRecipeValuesErrors];

export type UpdateSessionUserRecipeValuesResponses = {
    /**
     * Session user recipe values updated successfully
     */
    200: UpdateSessionUserRecipeValuesResponse;
};

export type UpdateSessionUserRecipeValuesResponse2 = UpdateSessionUserRecipeValuesResponses[keyof UpdateSessionUserRecipeValuesResponses];

export type StatusData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/status';
};

export type StatusResponses = {
    /**
     * ok
     */
    200: string;
};

export type StatusResponse = StatusResponses[keyof StatusResponses];

export type SystemInfoData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/system_info';
};

export type SystemInfoResponses = {
    /**
     * System information
     */
    200: SystemInfo;
};

export type SystemInfoResponse = SystemInfoResponses[keyof SystemInfoResponses];

export type SendTelemetryEventData = {
    body: TelemetryEventRequest;
    path?: never;
    query?: never;
    url: '/telemetry/event';
};

export type SendTelemetryEventResponses = {
    /**
     * Event accepted for processing
     */
    202: unknown;
};

export type StartTunnelData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/tunnel/start';
};

export type StartTunnelErrors = {
    /**
     * Bad request
     */
    400: ErrorResponse;
    /**
     * Internal server error
     */
    500: ErrorResponse;
};

export type StartTunnelError = StartTunnelErrors[keyof StartTunnelErrors];

export type StartTunnelResponses = {
    /**
     * Tunnel started successfully
     */
    200: TunnelInfo;
};

export type StartTunnelResponse = StartTunnelResponses[keyof StartTunnelResponses];

export type GetTunnelStatusData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/tunnel/status';
};

export type GetTunnelStatusResponses = {
    /**
     * Tunnel info
     */
    200: TunnelInfo;
};

export type GetTunnelStatusResponse = GetTunnelStatusResponses[keyof GetTunnelStatusResponses];

export type StopTunnelData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/tunnel/stop';
};

export type StopTunnelErrors = {
    /**
     * Internal server error
     */
    500: ErrorResponse;
};

export type StopTunnelError = StopTunnelErrors[keyof StopTunnelErrors];

export type StopTunnelResponses = {
    /**
     * Tunnel stopped successfully
     */
    200: unknown;
};
