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

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

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

export type GetResponses = {
    /**
     * Default Response
     */
    200: unknown;
};

export type GetBy__Data = {
    body?: never;
    path: {
        '*': string;
    };
    query?: never;
    url: '/{*}';
};

export type GetBy__Responses = {
    /**
     * Default Response
     */
    200: unknown;
};

export type GetApiV1AuthData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/api/v1/auth';
};

export type GetApiV1AuthResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            default_model: string | null;
            managed_provider: {
                name: string;
                status: 'authenticated' | 'expired' | 'revoked' | 'unauthenticated';
            } | null;
            providers_count: number;
            ready: boolean;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type GetApiV1AuthResponse = GetApiV1AuthResponses[keyof GetApiV1AuthResponses];

export type ListCatalogProvidersData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/api/v1/catalog/providers';
};

export type ListCatalogProvidersResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            items: Array<{
                env_key: string | null;
                guessed: boolean;
                id: string;
                models: Array<{
                    capabilities?: Array<string>;
                    id: string;
                    max_context_size: number;
                    name?: string;
                    reasoning: boolean;
                }>;
                name: string;
                needs_base_url: boolean;
                reject_reason: string | null;
                rejected: boolean;
                wire_type: 'kimi' | 'openai' | 'openai_responses' | 'anthropic' | 'google-genai' | 'vertexai';
            }>;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 50004;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type ListCatalogProvidersResponse = ListCatalogProvidersResponses[keyof ListCatalogProvidersResponses];

export type GetCatalogProviderData = {
    body?: never;
    path: {
        catalog_id: string;
    };
    query?: never;
    url: '/api/v1/catalog/providers/{catalog_id}';
};

export type GetCatalogProviderResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            env_key: string | null;
            guessed: boolean;
            id: string;
            models: Array<{
                capabilities?: Array<string>;
                id: string;
                max_context_size: number;
                name?: string;
                reasoning: boolean;
            }>;
            name: string;
            needs_base_url: boolean;
            reject_reason: string | null;
            rejected: boolean;
            wire_type: 'kimi' | 'openai' | 'openai_responses' | 'anthropic' | 'google-genai' | 'vertexai';
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40417;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 50004;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type GetCatalogProviderResponse = GetCatalogProviderResponses[keyof GetCatalogProviderResponses];

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

export type GetApiV1ConfigResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            background?: unknown;
            default_model?: string;
            default_permission_mode?: string;
            default_plan_mode?: boolean;
            default_provider?: string;
            experimental?: {
                [key: string]: boolean;
            };
            extra_skill_dirs?: Array<string>;
            hooks?: Array<unknown>;
            loop_control?: unknown;
            merge_all_available_skills?: boolean;
            models?: {
                [key: string]: unknown;
            };
            permission?: unknown;
            plan_mode?: boolean;
            providers: {
                [key: string]: {
                    base_url?: string;
                    default_model?: string;
                    has_api_key: boolean;
                    type: string;
                };
            };
            raw?: {
                [key: string]: unknown;
            };
            secondary_model?: unknown;
            services?: unknown;
            telemetry?: boolean;
            thinking?: unknown;
            yolo?: boolean;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type GetApiV1ConfigResponse = GetApiV1ConfigResponses[keyof GetApiV1ConfigResponses];

export type PostApiV1ConfigData = {
    body: {
        background?: unknown;
        default_model?: string;
        default_permission_mode?: string;
        default_plan_mode?: boolean;
        default_provider?: string;
        experimental?: {
            [key: string]: boolean;
        };
        extra_skill_dirs?: Array<string>;
        hooks?: Array<unknown>;
        loop_control?: unknown;
        merge_all_available_skills?: boolean;
        models?: {
            [key: string]: unknown;
        };
        permission?: unknown;
        plan_mode?: boolean;
        providers?: {
            [key: string]: unknown;
        };
        secondary_model?: unknown;
        services?: unknown;
        telemetry?: boolean;
        thinking?: unknown;
        yolo?: boolean;
    };
    path?: never;
    query?: never;
    url: '/api/v1/config';
};

export type PostApiV1ConfigResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            background?: unknown;
            default_model?: string;
            default_permission_mode?: string;
            default_plan_mode?: boolean;
            default_provider?: string;
            experimental?: {
                [key: string]: boolean;
            };
            extra_skill_dirs?: Array<string>;
            hooks?: Array<unknown>;
            loop_control?: unknown;
            merge_all_available_skills?: boolean;
            models?: {
                [key: string]: unknown;
            };
            permission?: unknown;
            plan_mode?: boolean;
            providers: {
                [key: string]: {
                    base_url?: string;
                    default_model?: string;
                    has_api_key: boolean;
                    type: string;
                };
            };
            raw?: {
                [key: string]: unknown;
            };
            secondary_model?: unknown;
            services?: unknown;
            telemetry?: boolean;
            thinking?: unknown;
            yolo?: boolean;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40001;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type PostApiV1ConfigResponse = PostApiV1ConfigResponses[keyof PostApiV1ConfigResponses];

export type GetApiV1ConnectionsData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/api/v1/connections';
};

export type GetApiV1ConnectionsResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            connections: Array<{
                connected_at: unknown;
                has_client_hello: boolean;
                id: string;
                remote_address: string | null;
                subscriptions: Array<string>;
                user_agent: string | null;
            }>;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type GetApiV1ConnectionsResponse = GetApiV1ConnectionsResponses[keyof GetApiV1ConnectionsResponses];

export type PostApiV1FilesData = {
    body: {
        expires_in_sec?: number;
        file: Blob | File;
        name?: string;
    };
    path?: never;
    query?: never;
    url: '/api/v1/files';
};

export type PostApiV1FilesResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            created_at: unknown;
            expires_at?: unknown;
            id: string;
            media_type: string;
            name: string;
            size: number;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type PostApiV1FilesResponse = PostApiV1FilesResponses[keyof PostApiV1FilesResponses];

export type DeleteApiV1FilesByFileIdData = {
    body?: never;
    path: {
        file_id: string;
    };
    query?: never;
    url: '/api/v1/files/{file_id}';
};

export type DeleteApiV1FilesByFileIdResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            deleted: true;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type DeleteApiV1FilesByFileIdResponse = DeleteApiV1FilesByFileIdResponses[keyof DeleteApiV1FilesByFileIdResponses];

export type GetApiV1FilesByFileIdData = {
    body?: never;
    path: {
        file_id: string;
    };
    query?: never;
    url: '/api/v1/files/{file_id}';
};

export type GetApiV1FilesByFileIdErrors = {
    /**
     * File not found
     */
    404: {
        code: number;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
        stack?: string;
    };
};

export type GetApiV1FilesByFileIdError = GetApiV1FilesByFileIdErrors[keyof GetApiV1FilesByFileIdErrors];

export type GetApiV1FilesByFileIdResponses = {
    /**
     * Binary file download
     */
    200: Blob | File;
};

export type GetApiV1FilesByFileIdResponse = GetApiV1FilesByFileIdResponses[keyof GetApiV1FilesByFileIdResponses];

export type FsBrowseData = {
    body?: never;
    path?: never;
    query?: {
        path?: string;
    };
    url: '/api/v1/fs:browse';
};

export type FsBrowseResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            entries: Array<{
                is_dir: true;
                name: string;
                path: string;
            }>;
            parent: string | null;
            path: string;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type FsBrowseResponse = FsBrowseResponses[keyof FsBrowseResponses];

export type FsContentData = {
    body?: never;
    path?: never;
    query: {
        path: string;
    };
    url: '/api/v1/fs:content';
};

export type FsContentResponses = {
    /**
     * Default Response
     */
    200: Blob | File;
    /**
     * Default Response
     */
    206: Blob | File;
};

export type FsContentResponse = FsContentResponses[keyof FsContentResponses];

export type FsHomeData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/api/v1/fs:home';
};

export type FsHomeResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            home: string;
            recent_roots: Array<string>;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type FsHomeResponse = FsHomeResponses[keyof FsHomeResponses];

export type FsMkdirData = {
    body: {
        path: string;
    };
    path?: never;
    query?: never;
    url: '/api/v1/fs:mkdir';
};

export type FsMkdirResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            path: string;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40001;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40409;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40411;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40919;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type FsMkdirResponse = FsMkdirResponses[keyof FsMkdirResponses];

export type PostApiV1GuiStoreClearData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/api/v1/gui/store/clear';
};

export type PostApiV1GuiStoreClearResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type PostApiV1GuiStoreClearResponse = PostApiV1GuiStoreClearResponses[keyof PostApiV1GuiStoreClearResponses];

export type GetApiV1GuiStoreGetItemData = {
    body?: never;
    path?: never;
    query: {
        key: string;
    };
    url: '/api/v1/gui/store/getItem';
};

export type GetApiV1GuiStoreGetItemResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            value: string | null;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40001;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type GetApiV1GuiStoreGetItemResponse = GetApiV1GuiStoreGetItemResponses[keyof GetApiV1GuiStoreGetItemResponses];

export type GetApiV1GuiStoreLengthData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/api/v1/gui/store/length';
};

export type GetApiV1GuiStoreLengthResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            length: number;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type GetApiV1GuiStoreLengthResponse = GetApiV1GuiStoreLengthResponses[keyof GetApiV1GuiStoreLengthResponses];

export type PostApiV1GuiStoreRemoveItemData = {
    body: {
        key: string;
    };
    path?: never;
    query?: never;
    url: '/api/v1/gui/store/removeItem';
};

export type PostApiV1GuiStoreRemoveItemResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40001;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type PostApiV1GuiStoreRemoveItemResponse = PostApiV1GuiStoreRemoveItemResponses[keyof PostApiV1GuiStoreRemoveItemResponses];

export type PostApiV1GuiStoreSetItemData = {
    body: {
        key: string;
        value: string;
    };
    path?: never;
    query?: never;
    url: '/api/v1/gui/store/setItem';
};

export type PostApiV1GuiStoreSetItemResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40001;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type PostApiV1GuiStoreSetItemResponse = PostApiV1GuiStoreSetItemResponses[keyof PostApiV1GuiStoreSetItemResponses];

export type GetApiV1HealthzData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/api/v1/healthz';
};

export type GetApiV1HealthzResponses = {
    /**
     * Default Response
     */
    200: {
        code?: number;
        data?: {
            ok?: boolean;
        };
        msg?: string;
        request_id?: string;
    };
};

export type GetApiV1HealthzResponse = GetApiV1HealthzResponses[keyof GetApiV1HealthzResponses];

export type GetApiV1McpServersData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/api/v1/mcp/servers';
};

export type GetApiV1McpServersResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            servers: Array<{
                id: string;
                last_error?: string;
                name: string;
                status: 'connected' | 'connecting' | 'disconnected' | 'error';
                tool_count: number;
                transport: 'stdio' | 'http' | 'sse';
            }>;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type GetApiV1McpServersResponse = GetApiV1McpServersResponses[keyof GetApiV1McpServersResponses];

export type RestartMcpServerData = {
    body?: never;
    path: {
        tail: string;
    };
    query?: never;
    url: '/api/v1/mcp/servers/{tail}';
};

export type RestartMcpServerResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            restarting: true;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40408;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type RestartMcpServerResponse = RestartMcpServerResponses[keyof RestartMcpServerResponses];

export type GetApiV1MetaData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/api/v1/meta';
};

export type GetApiV1MetaResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            backend?: 'v1' | 'v2';
            capabilities: {
                file_upload: true;
                fs_query: true;
                mcp: true;
                tasks: true;
                terminal: true;
                websocket: true;
            };
            dangerous_bypass_auth: boolean;
            open_in_apps: Array<'finder' | 'cursor' | 'vscode' | 'iterm' | 'terminal'>;
            server_id: string;
            server_version: string;
            started_at: unknown;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type GetApiV1MetaResponse = GetApiV1MetaResponses[keyof GetApiV1MetaResponses];

export type GetApiV1ModelsData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/api/v1/models';
};

export type GetApiV1ModelsResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            items: Array<{
                capabilities?: Array<string>;
                default_effort?: string;
                display_name?: string;
                max_context_size: number;
                model: string;
                provider: string;
                support_efforts?: Array<string>;
            }>;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type GetApiV1ModelsResponse = GetApiV1ModelsResponses[keyof GetApiV1ModelsResponses];

export type SetDefaultModelData = {
    body?: never;
    path: {
        tail: string;
    };
    query?: never;
    url: '/api/v1/models/{tail}';
};

export type SetDefaultModelResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            default_model: string;
            model: {
                capabilities?: Array<string>;
                default_effort?: string;
                display_name?: string;
                max_context_size: number;
                model: string;
                provider: string;
                support_efforts?: Array<string>;
            };
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40001;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40413;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type SetDefaultModelResponse = SetDefaultModelResponses[keyof SetDefaultModelResponses];

export type DeleteApiV1OauthLoginData = {
    body?: never;
    path?: never;
    query?: {
        provider?: string;
    };
    url: '/api/v1/oauth/login';
};

export type DeleteApiV1OauthLoginResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            cancelled: boolean;
            status: 'pending' | 'authenticated' | 'denied' | 'expired' | 'cancelled';
        };
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type DeleteApiV1OauthLoginResponse = DeleteApiV1OauthLoginResponses[keyof DeleteApiV1OauthLoginResponses];

export type GetApiV1OauthLoginData = {
    body?: never;
    path?: never;
    query?: {
        provider?: string;
    };
    url: '/api/v1/oauth/login';
};

export type GetApiV1OauthLoginResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            error_message?: string;
            expires_at: unknown;
            expires_in: number;
            flow_id: string;
            interval: number;
            provider: string;
            resolved_at?: unknown;
            status: 'pending' | 'authenticated' | 'denied' | 'expired' | 'cancelled';
            user_code: string;
            verification_uri: string;
            verification_uri_complete: string;
        } | null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type GetApiV1OauthLoginResponse = GetApiV1OauthLoginResponses[keyof GetApiV1OauthLoginResponses];

export type PostApiV1OauthLoginData = {
    body: {
        provider?: string;
    };
    path?: never;
    query?: never;
    url: '/api/v1/oauth/login';
};

export type PostApiV1OauthLoginResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            expires_at: unknown;
            expires_in: number;
            flow_id: string;
            interval: number;
            provider: string;
            status: 'pending';
            user_code: string;
            verification_uri: string;
            verification_uri_complete: string;
        } | {
            flow_id: string;
            provider: string;
            status: 'authenticated';
        };
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type PostApiV1OauthLoginResponse = PostApiV1OauthLoginResponses[keyof PostApiV1OauthLoginResponses];

export type PostApiV1OauthLogoutData = {
    body: {
        provider?: string;
    };
    path?: never;
    query?: never;
    url: '/api/v1/oauth/logout';
};

export type PostApiV1OauthLogoutResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            logged_out: true;
            provider: string;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type PostApiV1OauthLogoutResponse = PostApiV1OauthLogoutResponses[keyof PostApiV1OauthLogoutResponses];

export type GetApiV1OauthUsageData = {
    body?: never;
    path?: never;
    query?: {
        provider?: string;
    };
    url: '/api/v1/oauth/usage';
};

export type GetApiV1OauthUsageResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            extra_usage: {
                balance_cents: number;
                currency: string;
                monthly_charge_limit_cents: number;
                monthly_charge_limit_enabled: boolean;
                monthly_used_cents: number;
                total_cents: number;
            } | null;
            kind: 'ok';
            limits: Array<{
                limit: number;
                name?: string;
                reset_at?: string;
                used: number;
                window?: {
                    duration: number;
                    unit: 'minute' | 'hour' | 'day' | 'week';
                };
            }>;
            summary: {
                limit: number;
                name?: string;
                reset_at?: string;
                used: number;
                window?: {
                    duration: number;
                    unit: 'minute' | 'hour' | 'day' | 'week';
                };
            } | null;
        } | {
            kind: 'error';
            message: string;
            status?: number;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type GetApiV1OauthUsageResponse = GetApiV1OauthUsageResponses[keyof GetApiV1OauthUsageResponses];

export type GetApiV1OauthUserinfoData = {
    body?: never;
    path?: never;
    query?: {
        provider?: string;
    };
    url: '/api/v1/oauth/userinfo';
};

export type GetApiV1OauthUserinfoResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            kind: 'ok';
            userInfo: {
                avatar?: string;
                bio?: string;
                createdTime?: string;
                domain: number;
                domainName: string;
                email?: string;
                globalId?: string;
                lastLoginTime?: string;
                nickname: string;
                phone?: {
                    countryCode: string;
                    number: string;
                };
                region: string;
                status: string;
                userId: string;
                userLevel: number;
                userLevelName: string;
                username?: string;
            };
        } | {
            kind: 'error';
            message: string;
            status?: number;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type GetApiV1OauthUserinfoResponse = GetApiV1OauthUserinfoResponses[keyof GetApiV1OauthUserinfoResponses];

export type GetApiV1ProvidersData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/api/v1/providers';
};

export type GetApiV1ProvidersResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            items: Array<{
                base_url?: string;
                default_model?: string;
                has_api_key: boolean;
                id: string;
                models?: Array<string>;
                status: 'connected' | 'error' | 'unconfigured';
                type: string;
            }>;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type GetApiV1ProvidersResponse = GetApiV1ProvidersResponses[keyof GetApiV1ProvidersResponses];

export type CreateProviderData = {
    body: {
        api_key?: string;
        base_url?: string;
        default_model?: string;
        id: string;
        models: Array<{
            adaptive_thinking?: boolean;
            capabilities?: Array<string>;
            display_name?: string;
            max_context_size: number;
            max_output_size?: number;
            model: string;
            support_efforts?: Array<string>;
        }>;
        type: 'kimi' | 'openai' | 'openai_responses' | 'anthropic' | 'google-genai' | 'vertexai';
    };
    path?: never;
    query?: never;
    url: '/api/v1/providers';
};

export type CreateProviderResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            base_url?: string;
            default_model?: string;
            has_api_key: boolean;
            id: string;
            models?: Array<string>;
            status: 'connected' | 'error' | 'unconfigured';
            type: string;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40001;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40921;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type CreateProviderResponse = CreateProviderResponses[keyof CreateProviderResponses];

export type ProviderCollectionActionData = {
    body: {
        api_key?: string;
        base_url?: string;
        catalog_id?: string;
        id?: string;
        url?: string;
    };
    path: {
        action: string;
    };
    query?: never;
    url: '/api/v1/providers{action}';
};

export type ProviderCollectionActionResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            changed: Array<{
                added: number;
                provider_id: string;
                provider_name: string;
                removed: number;
            }>;
            failed: Array<{
                provider: string;
                reason: string;
            }>;
            unchanged: Array<string>;
        } | {
            models_imported: number;
            provider: {
                base_url?: string;
                default_model?: string;
                has_api_key: boolean;
                id: string;
                models?: Array<string>;
                status: 'connected' | 'error' | 'unconfigured';
                type: string;
            };
        } | {
            models_imported: number;
            providers: Array<{
                base_url?: string;
                default_model?: string;
                has_api_key: boolean;
                id: string;
                models?: Array<string>;
                status: 'connected' | 'error' | 'unconfigured';
                type: string;
            }>;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40001;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40003;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40004;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40005;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40417;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 50004;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type ProviderCollectionActionResponse = ProviderCollectionActionResponses[keyof ProviderCollectionActionResponses];

export type DeleteProviderData = {
    body?: never;
    path: {
        provider_id: string;
    };
    query?: never;
    url: '/api/v1/providers/{provider_id}';
};

export type DeleteProviderResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40001;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40003;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40412;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
    /**
     * Provider deleted.
     */
    204: unknown;
};

export type DeleteProviderResponse = DeleteProviderResponses[keyof DeleteProviderResponses];

export type GetApiV1ProvidersByProviderIdData = {
    body?: never;
    path: {
        provider_id: string;
    };
    query?: never;
    url: '/api/v1/providers/{provider_id}';
};

export type GetApiV1ProvidersByProviderIdResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            api_key?: string;
            base_url?: string;
            default_model?: string;
            has_api_key: boolean;
            id: string;
            models?: Array<string>;
            status: 'connected' | 'error' | 'unconfigured';
            type: string;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40001;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40412;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type GetApiV1ProvidersByProviderIdResponse = GetApiV1ProvidersByProviderIdResponses[keyof GetApiV1ProvidersByProviderIdResponses];

export type ReplaceProviderData = {
    body: {
        api_key?: string;
        base_url?: string;
        default_model?: string;
        models: Array<{
            adaptive_thinking?: boolean;
            capabilities?: Array<string>;
            display_name?: string;
            max_context_size: number;
            max_output_size?: number;
            model: string;
            support_efforts?: Array<string>;
        }>;
        new_id?: string;
        type: 'kimi' | 'openai' | 'openai_responses' | 'anthropic' | 'google-genai' | 'vertexai';
    };
    path: {
        provider_id: string;
    };
    query?: never;
    url: '/api/v1/providers/{provider_id}';
};

export type ReplaceProviderResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            provider: {
                base_url?: string;
                default_model?: string;
                has_api_key: boolean;
                id: string;
                models?: Array<string>;
                status: 'connected' | 'error' | 'unconfigured';
                type: string;
            };
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40001;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40003;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40412;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40921;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type ReplaceProviderResponse = ReplaceProviderResponses[keyof ReplaceProviderResponses];

export type RefreshProviderData = {
    body?: never;
    path: {
        tail: string;
    };
    query?: never;
    url: '/api/v1/providers/{tail}';
};

export type RefreshProviderResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            changed: Array<{
                added: number;
                provider_id: string;
                provider_name: string;
                removed: number;
            }>;
            failed: Array<{
                provider: string;
                reason: string;
            }>;
            unchanged: Array<string>;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40001;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40412;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type RefreshProviderResponse = RefreshProviderResponses[keyof RefreshProviderResponses];

export type PostApiV1SearchData = {
    body: {
        container?: {
            agent_id?: string;
            session_id?: string;
        };
        end_time?: number;
        mode?: 'terms' | 'literal';
        op?: 'AND' | 'OR';
        page_size?: number;
        page_token?: string;
        query: string;
        role?: 'user' | 'assistant' | 'title';
        sort?: 'score' | 'time_desc' | 'time_asc';
        start_time?: number;
    };
    path?: never;
    query?: never;
    url: '/api/v1/search';
};

export type PostApiV1SearchResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            has_more: boolean;
            incomplete?: 'candidate_cap';
            index_state: {
                documents: number;
                indexed_sessions: number;
                state: 'building' | 'ready' | 'readonly';
                total_sessions: number;
            };
            items: Array<{
                agent_id: string;
                role: 'user' | 'assistant' | 'title';
                score: number;
                session_id: string;
                session_title: string;
                snippet: string;
                step_id?: string;
                time: number;
                turn?: number;
                workspace_id: string;
            }>;
            page_token?: string;
            source: 'live' | 'index';
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40001;
        data: null;
        details?: Array<{
            message: string;
            path: string;
        }> | null;
        msg: string;
        request_id: string;
    };
};

export type PostApiV1SearchResponse = PostApiV1SearchResponses[keyof PostApiV1SearchResponses];

export type GetApiV1SessionsData = {
    body?: never;
    path?: never;
    query: {
        before_id?: string;
        after_id?: string;
        page_size?: number;
        busy: boolean;
        include_archive: boolean;
        exclude_empty: boolean;
        archived_only: boolean;
        workspace_id?: string;
    };
    url: '/api/v1/sessions';
};

export type GetApiV1SessionsResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            has_more: boolean;
            items: Array<{
                agent_config: {
                    goal_control?: 'pause' | 'resume' | 'cancel';
                    goal_objective?: string;
                    mcp_servers?: Array<string>;
                    model: string;
                    permission_mode?: 'manual' | 'yolo' | 'auto';
                    plan_mode?: boolean;
                    swarm_mode?: boolean;
                    system_prompt?: string;
                    thinking?: string;
                    tools?: Array<string>;
                };
                archived?: boolean;
                busy: boolean;
                created_at: unknown;
                current_prompt_id?: string;
                id: string;
                last_prompt?: string;
                last_seq: number;
                last_turn_reason?: 'completed' | 'cancelled' | 'failed';
                main_turn_active?: boolean;
                message_count: number;
                metadata: {
                    cwd: string;
                    [key: string]: unknown;
                };
                pending_interaction?: 'none' | 'approval' | 'question';
                permission_rules: Array<{
                    created_at: unknown;
                    created_by: 'user' | 'agent';
                    decision: 'approved';
                    id: string;
                    matcher?: {
                        kind: 'command_prefix' | 'path_glob' | 'exact_input' | 'always';
                        value?: string;
                    };
                    tool_name: string;
                }>;
                title: string;
                updated_at: unknown;
                usage: {
                    cache_creation_tokens: number;
                    cache_read_tokens: number;
                    context_limit: number;
                    context_tokens: number;
                    input_tokens: number;
                    output_tokens: number;
                    total_cost_usd: number;
                    turn_count: number;
                };
                workspace_id: string;
            }>;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40001;
        data: null;
        details?: Array<{
            message: string;
            path: string;
        }> | null;
        msg: string;
        request_id: string;
    } | {
        code: 40410;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type GetApiV1SessionsResponse = GetApiV1SessionsResponses[keyof GetApiV1SessionsResponses];

export type PostApiV1SessionsData = {
    body: {
        agent_config?: {
            goal_control?: 'pause' | 'resume' | 'cancel';
            goal_objective?: string;
            mcp_servers?: Array<string>;
            model?: string;
            permission_mode?: 'manual' | 'yolo' | 'auto';
            plan_mode?: boolean;
            swarm_mode?: boolean;
            system_prompt?: string;
            thinking?: string;
            tools?: Array<string>;
        };
        metadata?: {
            cwd: string;
            [key: string]: unknown;
        };
        title?: string;
        workspace_id?: string;
    };
    path?: never;
    query?: never;
    url: '/api/v1/sessions';
};

export type PostApiV1SessionsResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            agent_config: {
                goal_control?: 'pause' | 'resume' | 'cancel';
                goal_objective?: string;
                mcp_servers?: Array<string>;
                model: string;
                permission_mode?: 'manual' | 'yolo' | 'auto';
                plan_mode?: boolean;
                swarm_mode?: boolean;
                system_prompt?: string;
                thinking?: string;
                tools?: Array<string>;
            };
            archived?: boolean;
            busy: boolean;
            created_at: unknown;
            current_prompt_id?: string;
            id: string;
            last_prompt?: string;
            last_seq: number;
            last_turn_reason?: 'completed' | 'cancelled' | 'failed';
            main_turn_active?: boolean;
            message_count: number;
            metadata: {
                cwd: string;
                [key: string]: unknown;
            };
            pending_interaction?: 'none' | 'approval' | 'question';
            permission_rules: Array<{
                created_at: unknown;
                created_by: 'user' | 'agent';
                decision: 'approved';
                id: string;
                matcher?: {
                    kind: 'command_prefix' | 'path_glob' | 'exact_input' | 'always';
                    value?: string;
                };
                tool_name: string;
            }>;
            title: string;
            updated_at: unknown;
            usage: {
                cache_creation_tokens: number;
                cache_read_tokens: number;
                context_limit: number;
                context_tokens: number;
                input_tokens: number;
                output_tokens: number;
                total_cost_usd: number;
                turn_count: number;
            };
            workspace_id: string;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40001;
        data: null;
        details?: Array<{
            message: string;
            path: string;
        }> | null;
        msg: string;
        request_id: string;
    } | {
        code: 40409;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40410;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type PostApiV1SessionsResponse = PostApiV1SessionsResponses[keyof PostApiV1SessionsResponses];

export type GetApiV1SessionsBySessionIdData = {
    body?: never;
    path: {
        session_id: string;
    };
    query?: never;
    url: '/api/v1/sessions/{session_id}';
};

export type GetApiV1SessionsBySessionIdResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            agent_config: {
                goal_control?: 'pause' | 'resume' | 'cancel';
                goal_objective?: string;
                mcp_servers?: Array<string>;
                model: string;
                permission_mode?: 'manual' | 'yolo' | 'auto';
                plan_mode?: boolean;
                swarm_mode?: boolean;
                system_prompt?: string;
                thinking?: string;
                tools?: Array<string>;
            };
            archived?: boolean;
            busy: boolean;
            created_at: unknown;
            current_prompt_id?: string;
            id: string;
            last_prompt?: string;
            last_seq: number;
            last_turn_reason?: 'completed' | 'cancelled' | 'failed';
            main_turn_active?: boolean;
            message_count: number;
            metadata: {
                cwd: string;
                [key: string]: unknown;
            };
            pending_interaction?: 'none' | 'approval' | 'question';
            permission_rules: Array<{
                created_at: unknown;
                created_by: 'user' | 'agent';
                decision: 'approved';
                id: string;
                matcher?: {
                    kind: 'command_prefix' | 'path_glob' | 'exact_input' | 'always';
                    value?: string;
                };
                tool_name: string;
            }>;
            title: string;
            updated_at: unknown;
            usage: {
                cache_creation_tokens: number;
                cache_read_tokens: number;
                context_limit: number;
                context_tokens: number;
                input_tokens: number;
                output_tokens: number;
                total_cost_usd: number;
                turn_count: number;
            };
            workspace_id: string;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40001;
        data: null;
        details?: Array<{
            message: string;
            path: string;
        }> | null;
        msg: string;
        request_id: string;
    } | {
        code: 40401;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type GetApiV1SessionsBySessionIdResponse = GetApiV1SessionsBySessionIdResponses[keyof GetApiV1SessionsBySessionIdResponses];

export type RunSessionArchiveActionData = {
    body: {
        count?: number;
        instruction?: string;
        metadata?: {
            [key: string]: unknown;
        };
        page_size?: number;
        title?: string;
    };
    path: {
        session_id: string;
    };
    query?: never;
    url: '/api/v1/sessions/{session_id}:archive';
};

export type RunSessionArchiveActionResponses = {
    /**
     * Session archive response
     */
    200: {
        code: number;
        data: {
            archived: true;
        } | null;
        details?: unknown;
        msg: string;
        request_id: string;
        stack?: string;
    };
};

export type RunSessionArchiveActionResponse = RunSessionArchiveActionResponses[keyof RunSessionArchiveActionResponses];

export type FsActionData = {
    body: {
        depth?: number;
        exclude_globs?: Array<string>;
        follow_gitignore?: boolean;
        include_git_status?: boolean;
        limit?: number;
        path?: string;
        show_hidden?: boolean;
        sort?: 'type_first' | 'name_asc' | 'name_desc' | 'mtime_desc' | 'size_desc';
    } | {
        encoding?: 'auto' | 'utf-8' | 'base64';
        length?: number;
        offset?: number;
        path: string;
    } | {
        depth?: number;
        exclude_globs?: Array<string>;
        follow_gitignore?: boolean;
        include_git_status?: boolean;
        limit?: number;
        paths: Array<string>;
        show_hidden?: boolean;
        sort?: 'type_first' | 'name_asc' | 'name_desc' | 'mtime_desc' | 'size_desc';
    } | {
        path: string;
    } | {
        paths: Array<string>;
    } | {
        path: string;
        recursive?: boolean;
    } | {
        exclude_globs?: Array<string>;
        follow_gitignore?: boolean;
        include_globs?: Array<string>;
        limit?: number;
        query: string;
    } | {
        case_sensitive?: boolean;
        context_lines?: number;
        exclude_globs?: Array<string>;
        follow_gitignore?: boolean;
        include_globs?: Array<string>;
        max_files?: number;
        max_matches_per_file?: number;
        max_total_matches?: number;
        pattern: string;
        regex?: boolean;
    } | {
        paths?: Array<string>;
    } | {
        path: string;
    } | {
        line?: number;
        path: string;
    } | {
        app_id: 'finder' | 'cursor' | 'vscode' | 'iterm' | 'terminal';
        line?: number;
        path: string;
    } | {
        path: string;
    };
    path: {
        session_id: string;
        tail: string;
    };
    query?: never;
    url: '/api/v1/sessions/{session_id}/{tail}';
};

export type FsActionResponses = {
    /**
     * Filesystem action response
     */
    200: {
        code: number;
        data: {
            children_by_path?: {
                [key: string]: Array<{
                    child_count?: number;
                    etag?: string;
                    git_status?: 'clean' | 'modified' | 'added' | 'deleted' | 'renamed' | 'untracked' | 'ignored' | 'conflicted';
                    is_binary?: boolean;
                    is_symlink_to?: string;
                    kind: 'file' | 'directory' | 'symlink';
                    language_id?: string;
                    mime?: string;
                    modified_at: unknown;
                    name: string;
                    path: string;
                    size?: number;
                }>;
            };
            items: Array<{
                child_count?: number;
                etag?: string;
                git_status?: 'clean' | 'modified' | 'added' | 'deleted' | 'renamed' | 'untracked' | 'ignored' | 'conflicted';
                is_binary?: boolean;
                is_symlink_to?: string;
                kind: 'file' | 'directory' | 'symlink';
                language_id?: string;
                mime?: string;
                modified_at: unknown;
                name: string;
                path: string;
                size?: number;
            }>;
            truncated: boolean;
        } | null;
        details?: unknown;
        msg: string;
        request_id: string;
        stack?: string;
    } | {
        code: number;
        data: {
            content: string;
            encoding: 'utf-8' | 'base64';
            etag: string;
            is_binary: boolean;
            language_id?: string;
            line_count?: number;
            mime: string;
            path: string;
            size: number;
            truncated: boolean;
        } | null;
        details?: unknown;
        msg: string;
        request_id: string;
        stack?: string;
    } | {
        code: number;
        data: {
            partial_errors?: {
                [key: string]: {
                    code: number;
                    msg: string;
                };
            };
            results: {
                [key: string]: Array<{
                    child_count?: number;
                    etag?: string;
                    git_status?: 'clean' | 'modified' | 'added' | 'deleted' | 'renamed' | 'untracked' | 'ignored' | 'conflicted';
                    is_binary?: boolean;
                    is_symlink_to?: string;
                    kind: 'file' | 'directory' | 'symlink';
                    language_id?: string;
                    mime?: string;
                    modified_at: unknown;
                    name: string;
                    path: string;
                    size?: number;
                }>;
            };
            truncated_paths?: Array<string>;
        } | null;
        details?: unknown;
        msg: string;
        request_id: string;
        stack?: string;
    } | {
        code: number;
        data: {
            child_count?: number;
            etag?: string;
            git_status?: 'clean' | 'modified' | 'added' | 'deleted' | 'renamed' | 'untracked' | 'ignored' | 'conflicted';
            is_binary?: boolean;
            is_symlink_to?: string;
            kind: 'file' | 'directory' | 'symlink';
            language_id?: string;
            mime?: string;
            modified_at: unknown;
            name: string;
            path: string;
            size?: number;
        } | null;
        details?: unknown;
        msg: string;
        request_id: string;
        stack?: string;
    } | {
        code: number;
        data: {
            entries: {
                [key: string]: {
                    child_count?: number;
                    etag?: string;
                    git_status?: 'clean' | 'modified' | 'added' | 'deleted' | 'renamed' | 'untracked' | 'ignored' | 'conflicted';
                    is_binary?: boolean;
                    is_symlink_to?: string;
                    kind: 'file' | 'directory' | 'symlink';
                    language_id?: string;
                    mime?: string;
                    modified_at: unknown;
                    name: string;
                    path: string;
                    size?: number;
                } | null;
            };
        } | null;
        details?: unknown;
        msg: string;
        request_id: string;
        stack?: string;
    } | {
        code: number;
        data: {
            child_count?: number;
            etag?: string;
            git_status?: 'clean' | 'modified' | 'added' | 'deleted' | 'renamed' | 'untracked' | 'ignored' | 'conflicted';
            is_binary?: boolean;
            is_symlink_to?: string;
            kind: 'file' | 'directory' | 'symlink';
            language_id?: string;
            mime?: string;
            modified_at: unknown;
            name: string;
            path: string;
            size?: number;
        } | null;
        details?: unknown;
        msg: string;
        request_id: string;
        stack?: string;
    } | {
        code: number;
        data: {
            items: Array<{
                kind: 'file' | 'directory' | 'symlink';
                match_positions: Array<number>;
                name: string;
                path: string;
                score: number;
            }>;
            truncated: boolean;
        } | null;
        details?: unknown;
        msg: string;
        request_id: string;
        stack?: string;
    } | {
        code: number;
        data: {
            elapsed_ms: number;
            files: Array<{
                matches: Array<{
                    after: Array<string>;
                    before: Array<string>;
                    col: number;
                    line: number;
                    text: string;
                }>;
                path: string;
            }>;
            files_scanned: number;
            truncated: boolean;
        } | null;
        details?: unknown;
        msg: string;
        request_id: string;
        stack?: string;
    } | {
        code: number;
        data: {
            additions: number;
            ahead: number;
            behind: number;
            branch: string;
            deletions: number;
            entries: {
                [key: string]: 'clean' | 'modified' | 'added' | 'deleted' | 'renamed' | 'untracked' | 'ignored' | 'conflicted';
            };
            pullRequest: {
                number: number;
                state: 'open' | 'merged' | 'closed' | 'draft';
                url: string;
            } | null;
        } | null;
        details?: unknown;
        msg: string;
        request_id: string;
        stack?: string;
    } | {
        code: number;
        data: {
            diff: string;
            path: string;
            truncated: boolean;
        } | null;
        details?: unknown;
        msg: string;
        request_id: string;
        stack?: string;
    } | {
        code: number;
        data: {
            opened: true;
        } | null;
        details?: unknown;
        msg: string;
        request_id: string;
        stack?: string;
    } | {
        code: number;
        data: {
            opened: true;
        } | null;
        details?: unknown;
        msg: string;
        request_id: string;
        stack?: string;
    } | {
        code: number;
        data: {
            revealed: true;
        } | null;
        details?: unknown;
        msg: string;
        request_id: string;
        stack?: string;
    };
};

export type FsActionResponse = FsActionResponses[keyof FsActionResponses];

export type GetApiV1SessionsBySessionIdApprovalsData = {
    body?: never;
    path: {
        session_id: string;
    };
    query: {
        status: 'pending';
    };
    url: '/api/v1/sessions/{session_id}/approvals';
};

export type GetApiV1SessionsBySessionIdApprovalsResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            items: Array<{
                action: string;
                approval_id: string;
                created_at: unknown;
                expires_at: unknown;
                session_id: string;
                tool_call_id: string;
                tool_input_display: unknown;
                tool_name: string;
                turn_id?: number;
            }>;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40001;
        data: null;
        details?: Array<{
            message: string;
            path: string;
        }> | null;
        msg: string;
        request_id: string;
    } | {
        code: 40401;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type GetApiV1SessionsBySessionIdApprovalsResponse = GetApiV1SessionsBySessionIdApprovalsResponses[keyof GetApiV1SessionsBySessionIdApprovalsResponses];

export type PostApiV1SessionsBySessionIdApprovalsByApprovalIdData = {
    body: {
        decision: 'approved' | 'rejected' | 'cancelled';
        feedback?: string;
        scope?: 'session';
        selected_label?: string;
    };
    path: {
        session_id: string;
        approval_id: string;
    };
    query?: never;
    url: '/api/v1/sessions/{session_id}/approvals/{approval_id}';
};

export type PostApiV1SessionsBySessionIdApprovalsByApprovalIdResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            resolved: true;
            resolved_at: unknown;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40001;
        data: null;
        details?: Array<{
            message: string;
            path: string;
        }> | null;
        msg: string;
        request_id: string;
    } | {
        code: 40401;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40404;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40902;
        data: {
            resolved: false;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type PostApiV1SessionsBySessionIdApprovalsByApprovalIdResponse = PostApiV1SessionsBySessionIdApprovalsByApprovalIdResponses[keyof PostApiV1SessionsBySessionIdApprovalsByApprovalIdResponses];

export type GetApiV1SessionsBySessionIdChildrenData = {
    body?: never;
    path: {
        session_id: string;
    };
    query: {
        before_id?: string;
        after_id?: string;
        page_size?: number;
        busy: boolean;
    };
    url: '/api/v1/sessions/{session_id}/children';
};

export type GetApiV1SessionsBySessionIdChildrenResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            has_more: boolean;
            items: Array<{
                agent_config: {
                    goal_control?: 'pause' | 'resume' | 'cancel';
                    goal_objective?: string;
                    mcp_servers?: Array<string>;
                    model: string;
                    permission_mode?: 'manual' | 'yolo' | 'auto';
                    plan_mode?: boolean;
                    swarm_mode?: boolean;
                    system_prompt?: string;
                    thinking?: string;
                    tools?: Array<string>;
                };
                archived?: boolean;
                busy: boolean;
                created_at: unknown;
                current_prompt_id?: string;
                id: string;
                last_prompt?: string;
                last_seq: number;
                last_turn_reason?: 'completed' | 'cancelled' | 'failed';
                main_turn_active?: boolean;
                message_count: number;
                metadata: {
                    cwd: string;
                    [key: string]: unknown;
                };
                pending_interaction?: 'none' | 'approval' | 'question';
                permission_rules: Array<{
                    created_at: unknown;
                    created_by: 'user' | 'agent';
                    decision: 'approved';
                    id: string;
                    matcher?: {
                        kind: 'command_prefix' | 'path_glob' | 'exact_input' | 'always';
                        value?: string;
                    };
                    tool_name: string;
                }>;
                title: string;
                updated_at: unknown;
                usage: {
                    cache_creation_tokens: number;
                    cache_read_tokens: number;
                    context_limit: number;
                    context_tokens: number;
                    input_tokens: number;
                    output_tokens: number;
                    total_cost_usd: number;
                    turn_count: number;
                };
                workspace_id: string;
            }>;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40001;
        data: null;
        details?: Array<{
            message: string;
            path: string;
        }> | null;
        msg: string;
        request_id: string;
    } | {
        code: 40401;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type GetApiV1SessionsBySessionIdChildrenResponse = GetApiV1SessionsBySessionIdChildrenResponses[keyof GetApiV1SessionsBySessionIdChildrenResponses];

export type PostApiV1SessionsBySessionIdChildrenData = {
    body: {
        metadata?: {
            [key: string]: unknown;
        };
        title?: string;
    };
    path: {
        session_id: string;
    };
    query?: never;
    url: '/api/v1/sessions/{session_id}/children';
};

export type PostApiV1SessionsBySessionIdChildrenResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            agent_config: {
                goal_control?: 'pause' | 'resume' | 'cancel';
                goal_objective?: string;
                mcp_servers?: Array<string>;
                model: string;
                permission_mode?: 'manual' | 'yolo' | 'auto';
                plan_mode?: boolean;
                swarm_mode?: boolean;
                system_prompt?: string;
                thinking?: string;
                tools?: Array<string>;
            };
            archived?: boolean;
            busy: boolean;
            created_at: unknown;
            current_prompt_id?: string;
            id: string;
            last_prompt?: string;
            last_seq: number;
            last_turn_reason?: 'completed' | 'cancelled' | 'failed';
            main_turn_active?: boolean;
            message_count: number;
            metadata: {
                cwd: string;
                [key: string]: unknown;
            };
            pending_interaction?: 'none' | 'approval' | 'question';
            permission_rules: Array<{
                created_at: unknown;
                created_by: 'user' | 'agent';
                decision: 'approved';
                id: string;
                matcher?: {
                    kind: 'command_prefix' | 'path_glob' | 'exact_input' | 'always';
                    value?: string;
                };
                tool_name: string;
            }>;
            title: string;
            updated_at: unknown;
            usage: {
                cache_creation_tokens: number;
                cache_read_tokens: number;
                context_limit: number;
                context_tokens: number;
                input_tokens: number;
                output_tokens: number;
                total_cost_usd: number;
                turn_count: number;
            };
            workspace_id: string;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40001;
        data: null;
        details?: Array<{
            message: string;
            path: string;
        }> | null;
        msg: string;
        request_id: string;
    } | {
        code: 40401;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40901;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type PostApiV1SessionsBySessionIdChildrenResponse = PostApiV1SessionsBySessionIdChildrenResponses[keyof PostApiV1SessionsBySessionIdChildrenResponses];

export type PostApiV1SessionsBySessionIdExportData = {
    body: {
        desktop?: boolean;
        web_log?: string;
    };
    path: {
        session_id: string;
    };
    query?: never;
    url: '/api/v1/sessions/{session_id}/export';
};

export type PostApiV1SessionsBySessionIdExportResponses = {
    /**
     * Session export archive or JSON error envelope
     */
    200: {
        code: number;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
        stack?: string;
    };
};

export type PostApiV1SessionsBySessionIdExportResponse = PostApiV1SessionsBySessionIdExportResponses[keyof PostApiV1SessionsBySessionIdExportResponses];

export type DownloadFileData = {
    body?: never;
    path: {
        session_id: string;
        '*': string;
    };
    query?: never;
    url: '/api/v1/sessions/{session_id}/fs/{*}';
};

export type DownloadFileResponses = {
    /**
     * Binary workspace file download
     */
    200: Blob | File;
    /**
     * Partial binary workspace file download
     */
    206: Blob | File;
};

export type DownloadFileResponse = DownloadFileResponses[keyof DownloadFileResponses];

export type GetApiV1SessionsBySessionIdGoalData = {
    body?: never;
    path: {
        session_id: string;
    };
    query?: never;
    url: '/api/v1/sessions/{session_id}/goal';
};

export type GetApiV1SessionsBySessionIdGoalResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            budget: {
                overBudget: boolean;
                remainingTokens: number | null;
                remainingTurns: number | null;
                remainingWallClockMs: number | null;
                tokenBudget: number | null;
                tokenBudgetReached: boolean;
                turnBudget: number | null;
                turnBudgetReached: boolean;
                wallClockBudgetMs: number | null;
                wallClockBudgetReached: boolean;
            };
            completionCriterion?: string;
            goalId: string;
            objective: string;
            status: 'active' | 'paused' | 'blocked' | 'complete';
            terminalReason?: string;
            tokensUsed: number;
            turnsUsed: number;
            wallClockMs: number;
        } | null;
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40001;
        data: null;
        details?: Array<{
            message: string;
            path: string;
        }> | null;
        msg: string;
        request_id: string;
    } | {
        code: 40401;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type GetApiV1SessionsBySessionIdGoalResponse = GetApiV1SessionsBySessionIdGoalResponses[keyof GetApiV1SessionsBySessionIdGoalResponses];

export type GetApiV1SessionsBySessionIdMessagesData = {
    body?: never;
    path: {
        session_id: string;
    };
    query?: {
        before_id?: string;
        after_id?: string;
        page_size?: number;
        role?: 'user' | 'assistant' | 'tool' | 'system';
    };
    url: '/api/v1/sessions/{session_id}/messages';
};

export type GetApiV1SessionsBySessionIdMessagesResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            has_more: boolean;
            items: Array<{
                content: Array<{
                    text: string;
                    type: 'text';
                } | {
                    input: unknown;
                    tool_call_id: string;
                    tool_name: string;
                    type: 'tool_use';
                } | {
                    is_error?: boolean;
                    output: unknown;
                    tool_call_id: string;
                    type: 'tool_result';
                } | {
                    source: {
                        id?: string;
                        kind: 'url';
                        url: string;
                    } | {
                        data: string;
                        kind: 'base64';
                        media_type: string;
                    } | {
                        file_id: string;
                        kind: 'file';
                    };
                    type: 'image';
                } | {
                    source: {
                        id?: string;
                        kind: 'url';
                        url: string;
                    } | {
                        data: string;
                        kind: 'base64';
                        media_type: string;
                    } | {
                        file_id: string;
                        kind: 'file';
                    };
                    type: 'video';
                } | {
                    file_id: string;
                    media_type: string;
                    name: string;
                    size: number;
                    type: 'file';
                } | {
                    signature?: string;
                    thinking: string;
                    type: 'thinking';
                }>;
                created_at: unknown;
                id: string;
                metadata?: {
                    [key: string]: unknown;
                };
                parent_message_id?: string;
                prompt_id?: string;
                role: 'user' | 'assistant' | 'tool' | 'system';
                session_id: string;
            }>;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40001;
        data: null;
        details?: Array<{
            message: string;
            path: string;
        }> | null;
        msg: string;
        request_id: string;
    } | {
        code: 40401;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type GetApiV1SessionsBySessionIdMessagesResponse = GetApiV1SessionsBySessionIdMessagesResponses[keyof GetApiV1SessionsBySessionIdMessagesResponses];

export type GetApiV1SessionsBySessionIdMessagesByMessageIdData = {
    body?: never;
    path: {
        session_id: string;
        message_id: string;
    };
    query?: never;
    url: '/api/v1/sessions/{session_id}/messages/{message_id}';
};

export type GetApiV1SessionsBySessionIdMessagesByMessageIdResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            content: Array<{
                text: string;
                type: 'text';
            } | {
                input: unknown;
                tool_call_id: string;
                tool_name: string;
                type: 'tool_use';
            } | {
                is_error?: boolean;
                output: unknown;
                tool_call_id: string;
                type: 'tool_result';
            } | {
                source: {
                    id?: string;
                    kind: 'url';
                    url: string;
                } | {
                    data: string;
                    kind: 'base64';
                    media_type: string;
                } | {
                    file_id: string;
                    kind: 'file';
                };
                type: 'image';
            } | {
                source: {
                    id?: string;
                    kind: 'url';
                    url: string;
                } | {
                    data: string;
                    kind: 'base64';
                    media_type: string;
                } | {
                    file_id: string;
                    kind: 'file';
                };
                type: 'video';
            } | {
                file_id: string;
                media_type: string;
                name: string;
                size: number;
                type: 'file';
            } | {
                signature?: string;
                thinking: string;
                type: 'thinking';
            }>;
            created_at: unknown;
            id: string;
            metadata?: {
                [key: string]: unknown;
            };
            parent_message_id?: string;
            prompt_id?: string;
            role: 'user' | 'assistant' | 'tool' | 'system';
            session_id: string;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40001;
        data: null;
        details?: Array<{
            message: string;
            path: string;
        }> | null;
        msg: string;
        request_id: string;
    } | {
        code: 40401;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40403;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type GetApiV1SessionsBySessionIdMessagesByMessageIdResponse = GetApiV1SessionsBySessionIdMessagesByMessageIdResponses[keyof GetApiV1SessionsBySessionIdMessagesByMessageIdResponses];

export type GetApiV1SessionsBySessionIdProfileData = {
    body?: never;
    path: {
        session_id: string;
    };
    query?: never;
    url: '/api/v1/sessions/{session_id}/profile';
};

export type GetApiV1SessionsBySessionIdProfileResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            agent_config: {
                goal_control?: 'pause' | 'resume' | 'cancel';
                goal_objective?: string;
                mcp_servers?: Array<string>;
                model: string;
                permission_mode?: 'manual' | 'yolo' | 'auto';
                plan_mode?: boolean;
                swarm_mode?: boolean;
                system_prompt?: string;
                thinking?: string;
                tools?: Array<string>;
            };
            archived?: boolean;
            busy: boolean;
            created_at: unknown;
            current_prompt_id?: string;
            id: string;
            last_prompt?: string;
            last_seq: number;
            last_turn_reason?: 'completed' | 'cancelled' | 'failed';
            main_turn_active?: boolean;
            message_count: number;
            metadata: {
                cwd: string;
                [key: string]: unknown;
            };
            pending_interaction?: 'none' | 'approval' | 'question';
            permission_rules: Array<{
                created_at: unknown;
                created_by: 'user' | 'agent';
                decision: 'approved';
                id: string;
                matcher?: {
                    kind: 'command_prefix' | 'path_glob' | 'exact_input' | 'always';
                    value?: string;
                };
                tool_name: string;
            }>;
            title: string;
            updated_at: unknown;
            usage: {
                cache_creation_tokens: number;
                cache_read_tokens: number;
                context_limit: number;
                context_tokens: number;
                input_tokens: number;
                output_tokens: number;
                total_cost_usd: number;
                turn_count: number;
            };
            workspace_id: string;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40001;
        data: null;
        details?: Array<{
            message: string;
            path: string;
        }> | null;
        msg: string;
        request_id: string;
    } | {
        code: 40401;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type GetApiV1SessionsBySessionIdProfileResponse = GetApiV1SessionsBySessionIdProfileResponses[keyof GetApiV1SessionsBySessionIdProfileResponses];

export type PostApiV1SessionsBySessionIdProfileData = {
    body: {
        agent_config?: {
            goal_control?: 'pause' | 'resume' | 'cancel';
            goal_objective?: string;
            mcp_servers?: Array<string>;
            model?: string;
            permission_mode?: 'manual' | 'yolo' | 'auto';
            plan_mode?: boolean;
            swarm_mode?: boolean;
            system_prompt?: string;
            thinking?: string;
            tools?: Array<string>;
        };
        metadata?: {
            cwd?: string;
            [key: string]: unknown;
        };
        permission_rules?: Array<{
            created_at: string;
            created_by: 'user' | 'agent';
            decision: 'approved';
            id: string;
            matcher?: {
                kind: 'command_prefix' | 'path_glob' | 'exact_input' | 'always';
                value?: string;
            };
            tool_name: string;
        }>;
        title?: string;
    };
    path: {
        session_id: string;
    };
    query?: never;
    url: '/api/v1/sessions/{session_id}/profile';
};

export type PostApiV1SessionsBySessionIdProfileResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            agent_config: {
                goal_control?: 'pause' | 'resume' | 'cancel';
                goal_objective?: string;
                mcp_servers?: Array<string>;
                model: string;
                permission_mode?: 'manual' | 'yolo' | 'auto';
                plan_mode?: boolean;
                swarm_mode?: boolean;
                system_prompt?: string;
                thinking?: string;
                tools?: Array<string>;
            };
            archived?: boolean;
            busy: boolean;
            created_at: unknown;
            current_prompt_id?: string;
            id: string;
            last_prompt?: string;
            last_seq: number;
            last_turn_reason?: 'completed' | 'cancelled' | 'failed';
            main_turn_active?: boolean;
            message_count: number;
            metadata: {
                cwd: string;
                [key: string]: unknown;
            };
            pending_interaction?: 'none' | 'approval' | 'question';
            permission_rules: Array<{
                created_at: unknown;
                created_by: 'user' | 'agent';
                decision: 'approved';
                id: string;
                matcher?: {
                    kind: 'command_prefix' | 'path_glob' | 'exact_input' | 'always';
                    value?: string;
                };
                tool_name: string;
            }>;
            title: string;
            updated_at: unknown;
            usage: {
                cache_creation_tokens: number;
                cache_read_tokens: number;
                context_limit: number;
                context_tokens: number;
                input_tokens: number;
                output_tokens: number;
                total_cost_usd: number;
                turn_count: number;
            };
            workspace_id: string;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40001;
        data: null;
        details?: Array<{
            message: string;
            path: string;
        }> | null;
        msg: string;
        request_id: string;
    } | {
        code: 40401;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type PostApiV1SessionsBySessionIdProfileResponse = PostApiV1SessionsBySessionIdProfileResponses[keyof PostApiV1SessionsBySessionIdProfileResponses];

export type ListPromptsData = {
    body?: never;
    path: {
        session_id: string;
    };
    query?: never;
    url: '/api/v1/sessions/{session_id}/prompts';
};

export type ListPromptsResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            active: {
                content: Array<{
                    text: string;
                    type: 'text';
                } | {
                    input: unknown;
                    tool_call_id: string;
                    tool_name: string;
                    type: 'tool_use';
                } | {
                    is_error?: boolean;
                    output: unknown;
                    tool_call_id: string;
                    type: 'tool_result';
                } | {
                    source: {
                        id?: string;
                        kind: 'url';
                        url: string;
                    } | {
                        data: string;
                        kind: 'base64';
                        media_type: string;
                    } | {
                        file_id: string;
                        kind: 'file';
                    };
                    type: 'image';
                } | {
                    source: {
                        id?: string;
                        kind: 'url';
                        url: string;
                    } | {
                        data: string;
                        kind: 'base64';
                        media_type: string;
                    } | {
                        file_id: string;
                        kind: 'file';
                    };
                    type: 'video';
                } | {
                    file_id: string;
                    media_type: string;
                    name: string;
                    size: number;
                    type: 'file';
                } | {
                    signature?: string;
                    thinking: string;
                    type: 'thinking';
                }>;
                created_at: unknown;
                prompt_id: string;
                status: 'running' | 'queued' | 'blocked';
                user_message_id: string;
            } | null;
            queued: Array<{
                content: Array<{
                    text: string;
                    type: 'text';
                } | {
                    input: unknown;
                    tool_call_id: string;
                    tool_name: string;
                    type: 'tool_use';
                } | {
                    is_error?: boolean;
                    output: unknown;
                    tool_call_id: string;
                    type: 'tool_result';
                } | {
                    source: {
                        id?: string;
                        kind: 'url';
                        url: string;
                    } | {
                        data: string;
                        kind: 'base64';
                        media_type: string;
                    } | {
                        file_id: string;
                        kind: 'file';
                    };
                    type: 'image';
                } | {
                    source: {
                        id?: string;
                        kind: 'url';
                        url: string;
                    } | {
                        data: string;
                        kind: 'base64';
                        media_type: string;
                    } | {
                        file_id: string;
                        kind: 'file';
                    };
                    type: 'video';
                } | {
                    file_id: string;
                    media_type: string;
                    name: string;
                    size: number;
                    type: 'file';
                } | {
                    signature?: string;
                    thinking: string;
                    type: 'thinking';
                }>;
                created_at: unknown;
                prompt_id: string;
                status: 'running' | 'queued' | 'blocked';
                user_message_id: string;
            }>;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40401;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type ListPromptsResponse = ListPromptsResponses[keyof ListPromptsResponses];

export type SubmitPromptData = {
    body: {
        agent_id?: string;
        content: Array<{
            text: string;
            type: 'text';
        } | {
            input: unknown;
            tool_call_id: string;
            tool_name: string;
            type: 'tool_use';
        } | {
            is_error?: boolean;
            output: unknown;
            tool_call_id: string;
            type: 'tool_result';
        } | {
            source: {
                id?: string;
                kind: 'url';
                url: string;
            } | {
                data: string;
                kind: 'base64';
                media_type: string;
            } | {
                file_id: string;
                kind: 'file';
            };
            type: 'image';
        } | {
            source: {
                id?: string;
                kind: 'url';
                url: string;
            } | {
                data: string;
                kind: 'base64';
                media_type: string;
            } | {
                file_id: string;
                kind: 'file';
            };
            type: 'video';
        } | {
            file_id: string;
            media_type: string;
            name: string;
            size: number;
            type: 'file';
        } | {
            signature?: string;
            thinking: string;
            type: 'thinking';
        }>;
        disabled_tools?: Array<string>;
        goal_control?: 'pause' | 'resume' | 'cancel';
        goal_objective?: string;
        metadata?: {
            [key: string]: unknown;
        };
        model?: string;
        permission_mode?: 'manual' | 'yolo' | 'auto';
        plan_mode?: boolean;
        profile?: string;
        swarm_mode?: boolean;
        thinking?: string;
    };
    path: {
        session_id: string;
    };
    query?: never;
    url: '/api/v1/sessions/{session_id}/prompts';
};

export type SubmitPromptResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            content: Array<{
                text: string;
                type: 'text';
            } | {
                input: unknown;
                tool_call_id: string;
                tool_name: string;
                type: 'tool_use';
            } | {
                is_error?: boolean;
                output: unknown;
                tool_call_id: string;
                type: 'tool_result';
            } | {
                source: {
                    id?: string;
                    kind: 'url';
                    url: string;
                } | {
                    data: string;
                    kind: 'base64';
                    media_type: string;
                } | {
                    file_id: string;
                    kind: 'file';
                };
                type: 'image';
            } | {
                source: {
                    id?: string;
                    kind: 'url';
                    url: string;
                } | {
                    data: string;
                    kind: 'base64';
                    media_type: string;
                } | {
                    file_id: string;
                    kind: 'file';
                };
                type: 'video';
            } | {
                file_id: string;
                media_type: string;
                name: string;
                size: number;
                type: 'file';
            } | {
                signature?: string;
                thinking: string;
                type: 'thinking';
            }>;
            created_at: unknown;
            prompt_id: string;
            status: 'running' | 'queued' | 'blocked';
            user_message_id: string;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40001;
        data: null;
        details?: Array<{
            message: string;
            path: string;
        }> | null;
        msg: string;
        request_id: string;
    } | {
        code: 40110;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40111;
        data: null;
        details?: {
            provider_id: string;
        } | null;
        msg: string;
        request_id: string;
    } | {
        code: 40112;
        data: null;
        details?: {
            provider_id: string;
        } | null;
        msg: string;
        request_id: string;
    } | {
        code: 40113;
        data: null;
        details?: {
            model_id?: string;
            provider_id?: string;
        } | null;
        msg: string;
        request_id: string;
    } | {
        code: 40401;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40903;
        data: {
            aborted: false;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type SubmitPromptResponse = SubmitPromptResponses[keyof SubmitPromptResponses];

export type SteerPromptsData = {
    body: {
        prompt_ids: Array<string>;
    };
    path: {
        session_id: string;
    };
    query?: never;
    url: '/api/v1/sessions/{session_id}/prompts:steer';
};

export type SteerPromptsResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            prompt_ids: Array<string>;
            steered: true;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40001;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40401;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40402;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type SteerPromptsResponse = SteerPromptsResponses[keyof SteerPromptsResponses];

export type PromptActionData = {
    body?: never;
    path: {
        session_id: string;
        tail: string;
    };
    query?: never;
    url: '/api/v1/sessions/{session_id}/prompts/{tail}';
};

export type PromptActionResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            aborted: boolean;
            at_seq?: number;
        } | {
            prompt_ids: Array<string>;
            steered: true;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40001;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40401;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40402;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40903;
        data: {
            aborted: false;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type PromptActionResponse = PromptActionResponses[keyof PromptActionResponses];

export type GetApiV1SessionsBySessionIdQuestionsData = {
    body?: never;
    path: {
        session_id: string;
    };
    query: {
        status: 'pending';
    };
    url: '/api/v1/sessions/{session_id}/questions';
};

export type GetApiV1SessionsBySessionIdQuestionsResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            items: Array<{
                created_at: unknown;
                question_id: string;
                questions: Array<{
                    allow_other?: boolean;
                    body?: string;
                    header?: string;
                    id: string;
                    multi_select?: boolean;
                    options: Array<{
                        description?: string;
                        id: string;
                        label: string;
                    }>;
                    other_description?: string;
                    other_label?: string;
                    question: string;
                }>;
                session_id: string;
                tool_call_id?: string;
                turn_id?: number;
            }>;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40001;
        data: null;
        details?: Array<{
            message: string;
            path: string;
        }> | null;
        msg: string;
        request_id: string;
    } | {
        code: 40401;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type GetApiV1SessionsBySessionIdQuestionsResponse = GetApiV1SessionsBySessionIdQuestionsResponses[keyof GetApiV1SessionsBySessionIdQuestionsResponses];

export type PostApiV1SessionsBySessionIdQuestionsByTailData = {
    body?: {
        answers: {
            [key: string]: {
                kind: 'single';
                option_id: string;
            } | {
                kind: 'multi';
                option_ids: Array<string>;
            } | {
                kind: 'other';
                text: string;
            } | {
                kind: 'multi_with_other';
                option_ids: Array<string>;
                other_text: string;
            } | {
                kind: 'skipped';
            };
        };
        method?: 'enter' | 'space' | 'number_key' | 'click';
        note?: string;
    };
    path: {
        session_id: string;
        tail: string;
    };
    query?: never;
    url: '/api/v1/sessions/{session_id}/questions/{tail}';
};

export type PostApiV1SessionsBySessionIdQuestionsByTailResponses = {
    /**
     * Question resolved or dismissed
     */
    200: {
        code: number;
        data: {
            resolved: true;
            resolved_at: unknown;
        } | null;
        details?: unknown;
        msg: string;
        request_id: string;
        stack?: string;
    } | {
        code: number;
        data: {
            dismissed: true;
            dismissed_at: unknown;
        } | null;
        details?: unknown;
        msg: string;
        request_id: string;
        stack?: string;
    };
};

export type PostApiV1SessionsBySessionIdQuestionsByTailResponse = PostApiV1SessionsBySessionIdQuestionsByTailResponses[keyof PostApiV1SessionsBySessionIdQuestionsByTailResponses];

export type ListSkillsData = {
    body?: never;
    path: {
        session_id: string;
    };
    query?: never;
    url: '/api/v1/sessions/{session_id}/skills';
};

export type ListSkillsResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            skills: Array<{
                description: string;
                disable_model_invocation?: boolean;
                name: string;
                path: string;
                source: 'project' | 'user' | 'extra' | 'builtin';
                type?: string;
            }>;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40401;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type ListSkillsResponse = ListSkillsResponses[keyof ListSkillsResponses];

export type ActivateSkillData = {
    body: {
        args?: string;
    };
    path: {
        session_id: string;
        tail: string;
    };
    query?: never;
    url: '/api/v1/sessions/{session_id}/skills/{tail}';
};

export type ActivateSkillResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            activated: true;
            skill_name: string;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40001;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40401;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40415;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40912;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type ActivateSkillResponse = ActivateSkillResponses[keyof ActivateSkillResponses];

export type GetApiV1SessionsBySessionIdSnapshotData = {
    body?: never;
    path: {
        session_id: string;
    };
    query?: never;
    url: '/api/v1/sessions/{session_id}/snapshot';
};

export type GetApiV1SessionsBySessionIdSnapshotResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            as_of_seq: number;
            epoch: string;
            in_flight_turn: {
                assistant_text: string;
                current_prompt_id?: string;
                running_tools: Array<{
                    args?: unknown;
                    description?: string;
                    display?: unknown;
                    last_progress?: {
                        kind: 'stdout' | 'stderr' | 'progress' | 'status' | 'custom';
                        percent?: number;
                        text?: string;
                    };
                    name: string;
                    tool_call_id: string;
                }>;
                thinking_text: string;
                turn_id: number;
            } | null;
            messages: {
                has_more: boolean;
                items: Array<{
                    content: Array<{
                        text: string;
                        type: 'text';
                    } | {
                        input: unknown;
                        tool_call_id: string;
                        tool_name: string;
                        type: 'tool_use';
                    } | {
                        is_error?: boolean;
                        output: unknown;
                        tool_call_id: string;
                        type: 'tool_result';
                    } | {
                        source: {
                            id?: string;
                            kind: 'url';
                            url: string;
                        } | {
                            data: string;
                            kind: 'base64';
                            media_type: string;
                        } | {
                            file_id: string;
                            kind: 'file';
                        };
                        type: 'image';
                    } | {
                        source: {
                            id?: string;
                            kind: 'url';
                            url: string;
                        } | {
                            data: string;
                            kind: 'base64';
                            media_type: string;
                        } | {
                            file_id: string;
                            kind: 'file';
                        };
                        type: 'video';
                    } | {
                        file_id: string;
                        media_type: string;
                        name: string;
                        size: number;
                        type: 'file';
                    } | {
                        signature?: string;
                        thinking: string;
                        type: 'thinking';
                    }>;
                    created_at: unknown;
                    id: string;
                    metadata?: {
                        [key: string]: unknown;
                    };
                    parent_message_id?: string;
                    prompt_id?: string;
                    role: 'user' | 'assistant' | 'tool' | 'system';
                    session_id: string;
                }>;
            };
            pending_approvals: Array<{
                action: string;
                approval_id: string;
                created_at: unknown;
                expires_at: unknown;
                session_id: string;
                tool_call_id: string;
                tool_input_display: unknown;
                tool_name: string;
                turn_id?: number;
            }>;
            pending_questions: Array<{
                created_at: unknown;
                question_id: string;
                questions: Array<{
                    allow_other?: boolean;
                    body?: string;
                    header?: string;
                    id: string;
                    multi_select?: boolean;
                    options: Array<{
                        description?: string;
                        id: string;
                        label: string;
                    }>;
                    other_description?: string;
                    other_label?: string;
                    question: string;
                }>;
                session_id: string;
                tool_call_id?: string;
                turn_id?: number;
            }>;
            session: {
                agent_config: {
                    goal_control?: 'pause' | 'resume' | 'cancel';
                    goal_objective?: string;
                    mcp_servers?: Array<string>;
                    model: string;
                    permission_mode?: 'manual' | 'yolo' | 'auto';
                    plan_mode?: boolean;
                    swarm_mode?: boolean;
                    system_prompt?: string;
                    thinking?: string;
                    tools?: Array<string>;
                };
                archived?: boolean;
                busy: boolean;
                created_at: unknown;
                current_prompt_id?: string;
                id: string;
                last_prompt?: string;
                last_seq: number;
                last_turn_reason?: 'completed' | 'cancelled' | 'failed';
                main_turn_active?: boolean;
                message_count: number;
                metadata: {
                    cwd: string;
                    [key: string]: unknown;
                };
                pending_interaction?: 'none' | 'approval' | 'question';
                permission_rules: Array<{
                    created_at: unknown;
                    created_by: 'user' | 'agent';
                    decision: 'approved';
                    id: string;
                    matcher?: {
                        kind: 'command_prefix' | 'path_glob' | 'exact_input' | 'always';
                        value?: string;
                    };
                    tool_name: string;
                }>;
                title: string;
                updated_at: unknown;
                usage: {
                    cache_creation_tokens: number;
                    cache_read_tokens: number;
                    context_limit: number;
                    context_tokens: number;
                    input_tokens: number;
                    output_tokens: number;
                    total_cost_usd: number;
                    turn_count: number;
                };
                workspace_id: string;
            };
            subagents?: Array<{
                command?: string;
                completed_at?: unknown;
                created_at: unknown;
                description: string;
                id: string;
                kind: 'subagent' | 'bash' | 'tool';
                output_bytes?: number;
                output_preview?: string;
                parent_tool_call_id?: string;
                run_in_background?: boolean;
                session_id: string;
                started_at?: unknown;
                status: 'running' | 'completed' | 'failed' | 'cancelled';
                subagent_phase?: 'queued' | 'working' | 'suspended' | 'completed' | 'failed';
                subagent_type?: string;
                suspended_reason?: string;
                swarm_index?: number;
            }>;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40401;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 50001;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type GetApiV1SessionsBySessionIdSnapshotResponse = GetApiV1SessionsBySessionIdSnapshotResponses[keyof GetApiV1SessionsBySessionIdSnapshotResponses];

export type GetApiV1SessionsBySessionIdStatusData = {
    body?: never;
    path: {
        session_id: string;
    };
    query?: never;
    url: '/api/v1/sessions/{session_id}/status';
};

export type GetApiV1SessionsBySessionIdStatusResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            busy: boolean;
            context_tokens: number;
            context_usage: number;
            max_context_tokens: number;
            model?: string;
            permission: string;
            plan_mode: boolean;
            swarm_mode: boolean;
            thinking_level: string;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40001;
        data: null;
        details?: Array<{
            message: string;
            path: string;
        }> | null;
        msg: string;
        request_id: string;
    } | {
        code: 40401;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type GetApiV1SessionsBySessionIdStatusResponse = GetApiV1SessionsBySessionIdStatusResponses[keyof GetApiV1SessionsBySessionIdStatusResponses];

export type GetApiV1SessionsBySessionIdTasksData = {
    body?: never;
    path: {
        session_id: string;
    };
    query?: {
        status?: 'running' | 'completed' | 'failed' | 'cancelled';
    };
    url: '/api/v1/sessions/{session_id}/tasks';
};

export type GetApiV1SessionsBySessionIdTasksResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            items: Array<{
                command?: string;
                completed_at?: unknown;
                created_at: unknown;
                description: string;
                id: string;
                kind: 'subagent' | 'bash' | 'tool';
                output_bytes?: number;
                output_preview?: string;
                session_id: string;
                started_at?: unknown;
                status: 'running' | 'completed' | 'failed' | 'cancelled';
            }>;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40001;
        data: null;
        details?: Array<{
            message: string;
            path: string;
        }> | null;
        msg: string;
        request_id: string;
    } | {
        code: 40401;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type GetApiV1SessionsBySessionIdTasksResponse = GetApiV1SessionsBySessionIdTasksResponses[keyof GetApiV1SessionsBySessionIdTasksResponses];

export type CancelTaskData = {
    body?: never;
    path: {
        session_id: string;
        tail: string;
    };
    query?: never;
    url: '/api/v1/sessions/{session_id}/tasks/{tail}';
};

export type CancelTaskResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            cancelled: true;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40001;
        data: null;
        details?: Array<{
            message: string;
            path: string;
        }> | null;
        msg: string;
        request_id: string;
    } | {
        code: 40401;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40406;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40904;
        data: {
            cancelled: false;
        };
        details?: {
            current_status: string;
        } | null;
        msg: string;
        request_id: string;
    };
};

export type CancelTaskResponse = CancelTaskResponses[keyof CancelTaskResponses];

export type GetApiV1SessionsBySessionIdTasksByTaskIdData = {
    body?: never;
    path: {
        session_id: string;
        task_id: string;
    };
    query?: {
        with_output?: boolean;
        output_bytes?: number;
    };
    url: '/api/v1/sessions/{session_id}/tasks/{task_id}';
};

export type GetApiV1SessionsBySessionIdTasksByTaskIdResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            command?: string;
            completed_at?: unknown;
            created_at: unknown;
            description: string;
            id: string;
            kind: 'subagent' | 'bash' | 'tool';
            output_bytes?: number;
            output_preview?: string;
            session_id: string;
            started_at?: unknown;
            status: 'running' | 'completed' | 'failed' | 'cancelled';
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40001;
        data: null;
        details?: Array<{
            message: string;
            path: string;
        }> | null;
        msg: string;
        request_id: string;
    } | {
        code: 40401;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40406;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type GetApiV1SessionsBySessionIdTasksByTaskIdResponse = GetApiV1SessionsBySessionIdTasksByTaskIdResponses[keyof GetApiV1SessionsBySessionIdTasksByTaskIdResponses];

export type GetApiV1SessionsBySessionIdTerminalsData = {
    body?: never;
    path: {
        session_id: string;
    };
    query?: never;
    url: '/api/v1/sessions/{session_id}/terminals';
};

export type GetApiV1SessionsBySessionIdTerminalsResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            items: Array<{
                cols: number;
                created_at: unknown;
                cwd: string;
                exit_code?: number | null;
                exited_at?: unknown;
                id: string;
                rows: number;
                session_id: string;
                shell: string;
                status: 'running' | 'exited';
            }>;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40001;
        data: null;
        details?: Array<{
            message: string;
            path: string;
        }> | null;
        msg: string;
        request_id: string;
    } | {
        code: 40401;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type GetApiV1SessionsBySessionIdTerminalsResponse = GetApiV1SessionsBySessionIdTerminalsResponses[keyof GetApiV1SessionsBySessionIdTerminalsResponses];

export type PostApiV1SessionsBySessionIdTerminalsData = {
    body: {
        cols?: number;
        cwd?: string;
        rows?: number;
        shell?: string;
    };
    path: {
        session_id: string;
    };
    query?: never;
    url: '/api/v1/sessions/{session_id}/terminals';
};

export type PostApiV1SessionsBySessionIdTerminalsResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            cols: number;
            created_at: unknown;
            cwd: string;
            exit_code?: number | null;
            exited_at?: unknown;
            id: string;
            rows: number;
            session_id: string;
            shell: string;
            status: 'running' | 'exited';
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40001;
        data: null;
        details?: Array<{
            message: string;
            path: string;
        }> | null;
        msg: string;
        request_id: string;
    } | {
        code: 40401;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 41304;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type PostApiV1SessionsBySessionIdTerminalsResponse = PostApiV1SessionsBySessionIdTerminalsResponses[keyof PostApiV1SessionsBySessionIdTerminalsResponses];

export type CloseTerminalData = {
    body?: never;
    path: {
        session_id: string;
        tail: string;
    };
    query?: never;
    url: '/api/v1/sessions/{session_id}/terminals/{tail}';
};

export type CloseTerminalResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            closed: true;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40001;
        data: null;
        details?: Array<{
            message: string;
            path: string;
        }> | null;
        msg: string;
        request_id: string;
    } | {
        code: 40401;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40414;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type CloseTerminalResponse = CloseTerminalResponses[keyof CloseTerminalResponses];

export type GetApiV1SessionsBySessionIdTerminalsByTerminalIdData = {
    body?: never;
    path: {
        session_id: string;
        terminal_id: string;
    };
    query?: never;
    url: '/api/v1/sessions/{session_id}/terminals/{terminal_id}';
};

export type GetApiV1SessionsBySessionIdTerminalsByTerminalIdResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            cols: number;
            created_at: unknown;
            cwd: string;
            exit_code?: number | null;
            exited_at?: unknown;
            id: string;
            rows: number;
            session_id: string;
            shell: string;
            status: 'running' | 'exited';
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40001;
        data: null;
        details?: Array<{
            message: string;
            path: string;
        }> | null;
        msg: string;
        request_id: string;
    } | {
        code: 40401;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40414;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type GetApiV1SessionsBySessionIdTerminalsByTerminalIdResponse = GetApiV1SessionsBySessionIdTerminalsByTerminalIdResponses[keyof GetApiV1SessionsBySessionIdTerminalsByTerminalIdResponses];

export type GetApiV1SessionsBySessionIdTranscriptData = {
    body?: never;
    path: {
        session_id: string;
    };
    query: {
        agent_id: string;
        before_turn?: string;
        after_turn?: string;
        page_size?: number;
    };
    url: '/api/v1/sessions/{session_id}/transcript';
};

export type GetApiV1SessionsBySessionIdTranscriptResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            agent_id: string;
            agents: Array<{
                agentId: string;
                createdAt?: string;
                disposedAt?: string;
                label?: string;
                parentAgentId?: string;
                type?: 'main' | 'sub' | 'independent';
            }>;
            attachments: Array<{
                attachmentId: string;
                mediaType: string;
                name?: string;
                placeholder?: string;
                size?: number;
                source?: {
                    kind: 'url';
                    url: string;
                } | {
                    fileId: string;
                    kind: 'file';
                };
            }>;
            has_more: boolean;
            interactions: Array<{
                interactionId: string;
                interactionKind: 'approval' | 'question';
                request?: unknown;
                response?: unknown;
                state: 'pending' | 'approved' | 'rejected' | 'cancelled' | 'answered' | 'dismissed';
                toolCallId?: string;
            }>;
            items: Array<{
                attachmentIds?: Array<string>;
                durationMs?: number;
                endedAt?: string;
                error?: string;
                kind: 'turn';
                ordinal: number;
                origin: {
                    kind: 'user';
                    payload?: unknown;
                } | {
                    kind: 'cron';
                    payload?: unknown;
                    taskId?: string;
                } | {
                    kind: 'task';
                    payload?: unknown;
                    taskId: string;
                } | {
                    kind: 'hook';
                    payload?: unknown;
                } | {
                    kind: 'compaction';
                    payload?: unknown;
                } | {
                    kind: 'side';
                    payload?: unknown;
                } | {
                    kind: 'other';
                    payload?: unknown;
                };
                prompt?: string;
                startedAt?: string;
                state: 'queued' | 'running' | 'completed' | 'failed' | 'cancelled';
                steps: Array<{
                    endedAt?: string;
                    endMessage?: string;
                    endReason?: string;
                    finishReason?: string;
                    frames: Array<{
                        attachmentIds?: Array<string>;
                        frameId: string;
                        kind: 'text';
                        role: 'assistant' | 'user';
                        taskId?: string;
                        text: string;
                    } | {
                        frameId: string;
                        kind: 'thinking';
                        text: string;
                    } | {
                        agentRefs?: Array<{
                            agentId: string;
                            role?: 'child' | 'member';
                        }>;
                        approvalId?: string;
                        display?: unknown;
                        error?: string;
                        frameId: string;
                        input?: unknown;
                        inputText?: string;
                        kind: 'tool';
                        name: string;
                        output?: unknown;
                        progress?: {
                            customData?: unknown;
                            customKind?: string;
                            kind: 'stdout' | 'stderr' | 'progress' | 'status' | 'custom';
                            percent?: number;
                            text?: string;
                        };
                        state: 'running' | 'done' | 'error';
                        taskId?: string;
                        todoId?: string;
                        toolCallId: string;
                        view?: string;
                    } | {
                        detail?: unknown;
                        frameId: string;
                        kind: 'notice';
                        level: 'error' | 'warning' | 'info';
                        message: string;
                        source?: string;
                    }>;
                    kind: 'step';
                    ordinal: number;
                    retry?: {
                        delayMs: number;
                        errorMessage: string;
                        errorName: string;
                        failedAttempt: number;
                        maxAttempts: number;
                        nextAttempt: number;
                        statusCode?: number;
                    };
                    startedAt?: string;
                    state: 'running' | 'completed' | 'interrupted' | 'failed';
                    stepId: string;
                    timing?: {
                        llmClientConsumeMs?: number;
                        llmFirstTokenLatencyMs?: number;
                        llmRequestBuildMs?: number;
                        llmServerDecodeMs?: number;
                        llmServerFirstTokenMs?: number;
                        llmStreamDurationMs?: number;
                    };
                    turnId: string;
                    usage?: {
                        inputCacheCreation: number;
                        inputCacheRead: number;
                        inputOther: number;
                        output: number;
                    };
                }>;
                turnId: string;
                usage?: {
                    cachedTokens?: number;
                    cost?: number;
                    inputTokens?: number;
                    outputTokens?: number;
                };
            } | {
                at?: string;
                kind: 'marker';
                marker: string;
                markerId: string;
                payload?: unknown;
            } | {
                at?: string;
                kind: 'taskref';
                refId: string;
                taskId: string;
            }>;
            meta: {
                activity?: 'idle' | 'turn' | 'disposing' | 'unknown';
                agent?: {
                    contextTokens?: number;
                    contextUsage?: number;
                    maxContextTokens?: number;
                    model?: string;
                    permission?: 'manual' | 'yolo' | 'auto';
                    phase?: {
                        kind: 'idle';
                    } | {
                        kind: 'running';
                        since: number;
                        step: number;
                        stepId: string;
                        turnId: number;
                    } | {
                        kind: 'streaming';
                        since: number;
                        step: number;
                        stepId: string;
                        stream: 'assistant' | 'thinking' | 'tool_call';
                        toolCallId?: string;
                        toolName?: string;
                        turnId: number;
                    } | {
                        kind: 'tool_call';
                        name: string;
                        since: number;
                        step: number;
                        toolCallId: string;
                        turnId: number;
                    } | {
                        delayMs: number;
                        errorName?: string;
                        failedAttempt: number;
                        kind: 'retrying';
                        maxAttempts: number;
                        nextAttempt: number;
                        since: number;
                        statusCode?: number;
                        step: number;
                        stepId: string;
                        turnId: number;
                    } | {
                        approval?: unknown;
                        kind: 'awaiting_approval';
                        since: number;
                        step?: number;
                        turnId: number;
                    } | {
                        at: number;
                        kind: 'interrupted';
                        message?: string;
                        reason: 'aborted' | 'max_steps' | 'error';
                        step?: number;
                        turnId: number;
                    } | {
                        at: number;
                        durationMs?: number;
                        kind: 'ended';
                        reason: 'completed' | 'cancelled' | 'failed' | 'blocked';
                        turnId: number;
                    };
                    thinkingEffort?: string;
                    usage?: {
                        byModel?: {
                            [key: string]: {
                                inputCacheCreation: number;
                                inputCacheRead: number;
                                inputOther: number;
                                output: number;
                            };
                        };
                        currentTurn?: {
                            inputCacheCreation: number;
                            inputCacheRead: number;
                            inputOther: number;
                            output: number;
                        };
                        total?: {
                            inputCacheCreation: number;
                            inputCacheRead: number;
                            inputOther: number;
                            output: number;
                        };
                    };
                };
                goal?: {
                    budgetLimit?: number;
                    budgetUsed?: number;
                    completionCriterion?: string;
                    objective: string;
                    status: 'active' | 'paused' | 'blocked' | 'complete';
                };
                modes?: {
                    plan?: {
                        reviewPath?: string;
                        version?: number;
                    };
                    swarm?: {
                        trigger?: string;
                    };
                };
            };
            pending_interactions: Array<string>;
            prompts: Array<{
                content?: unknown;
                createdAt: string;
                finishedAt?: string;
                promptId: string;
                status: 'running' | 'queued' | 'blocked' | 'completed' | 'failed' | 'aborted';
                steeredAt?: string;
                userMessageId?: string;
            }>;
            seq?: number;
            tasks: Array<{
                agentId?: string;
                description?: string;
                detached: boolean;
                endedAt?: string;
                error?: string;
                kind: 'shell' | 'subagent' | 'tool' | 'other';
                outputTail: string;
                resultSummary?: string;
                startedAt?: string;
                state: 'running' | 'completed' | 'failed' | 'timed_out' | 'killed' | 'lost';
                stateReason?: string;
                taskId: string;
                usage?: {
                    inputCacheCreation: number;
                    inputCacheRead: number;
                    inputOther: number;
                    output: number;
                };
            }>;
            todos: Array<{
                items: Array<{
                    status: 'pending' | 'in_progress' | 'done';
                    title: string;
                }>;
                todoId: string;
                updatedAt?: string;
            }>;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40001;
        data: null;
        details?: Array<{
            message: string;
            path: string;
        }> | null;
        msg: string;
        request_id: string;
    } | {
        code: 40401;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type GetApiV1SessionsBySessionIdTranscriptResponse = GetApiV1SessionsBySessionIdTranscriptResponses[keyof GetApiV1SessionsBySessionIdTranscriptResponses];

export type GetApiV1SessionsBySessionIdTranscriptOpsData = {
    body?: never;
    path: {
        session_id: string;
    };
    query: {
        agent_id: string;
        since_seq: number;
    };
    url: '/api/v1/sessions/{session_id}/transcript/ops';
};

export type GetApiV1SessionsBySessionIdTranscriptOpsResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            agent_id: string;
            batches: Array<{
                ops: Array<{
                    agentId: string;
                    op: 'reset';
                    snapshot: {
                        attachments: Array<{
                            attachmentId: string;
                            mediaType: string;
                            name?: string;
                            placeholder?: string;
                            size?: number;
                            source?: {
                                kind: 'url';
                                url: string;
                            } | {
                                fileId: string;
                                kind: 'file';
                            };
                        }>;
                        hasMoreOlder?: boolean;
                        interactions: Array<{
                            interactionId: string;
                            interactionKind: 'approval' | 'question';
                            request?: unknown;
                            response?: unknown;
                            state: 'pending' | 'approved' | 'rejected' | 'cancelled' | 'answered' | 'dismissed';
                            toolCallId?: string;
                        }>;
                        items: Array<{
                            attachmentIds?: Array<string>;
                            durationMs?: number;
                            endedAt?: string;
                            error?: string;
                            kind: 'turn';
                            ordinal: number;
                            origin: {
                                kind: 'user';
                                payload?: unknown;
                            } | {
                                kind: 'cron';
                                payload?: unknown;
                                taskId?: string;
                            } | {
                                kind: 'task';
                                payload?: unknown;
                                taskId: string;
                            } | {
                                kind: 'hook';
                                payload?: unknown;
                            } | {
                                kind: 'compaction';
                                payload?: unknown;
                            } | {
                                kind: 'side';
                                payload?: unknown;
                            } | {
                                kind: 'other';
                                payload?: unknown;
                            };
                            prompt?: string;
                            startedAt?: string;
                            state: 'queued' | 'running' | 'completed' | 'failed' | 'cancelled';
                            steps: Array<{
                                endedAt?: string;
                                endMessage?: string;
                                endReason?: string;
                                finishReason?: string;
                                frames: Array<{
                                    attachmentIds?: Array<string>;
                                    frameId: string;
                                    kind: 'text';
                                    role: 'assistant' | 'user';
                                    taskId?: string;
                                    text: string;
                                } | {
                                    frameId: string;
                                    kind: 'thinking';
                                    text: string;
                                } | {
                                    agentRefs?: Array<{
                                        agentId: string;
                                        role?: 'child' | 'member';
                                    }>;
                                    approvalId?: string;
                                    display?: unknown;
                                    error?: string;
                                    frameId: string;
                                    input?: unknown;
                                    inputText?: string;
                                    kind: 'tool';
                                    name: string;
                                    output?: unknown;
                                    progress?: {
                                        customData?: unknown;
                                        customKind?: string;
                                        kind: 'stdout' | 'stderr' | 'progress' | 'status' | 'custom';
                                        percent?: number;
                                        text?: string;
                                    };
                                    state: 'running' | 'done' | 'error';
                                    taskId?: string;
                                    todoId?: string;
                                    toolCallId: string;
                                    view?: string;
                                } | {
                                    detail?: unknown;
                                    frameId: string;
                                    kind: 'notice';
                                    level: 'error' | 'warning' | 'info';
                                    message: string;
                                    source?: string;
                                }>;
                                kind: 'step';
                                ordinal: number;
                                retry?: {
                                    delayMs: number;
                                    errorMessage: string;
                                    errorName: string;
                                    failedAttempt: number;
                                    maxAttempts: number;
                                    nextAttempt: number;
                                    statusCode?: number;
                                };
                                startedAt?: string;
                                state: 'running' | 'completed' | 'interrupted' | 'failed';
                                stepId: string;
                                timing?: {
                                    llmClientConsumeMs?: number;
                                    llmFirstTokenLatencyMs?: number;
                                    llmRequestBuildMs?: number;
                                    llmServerDecodeMs?: number;
                                    llmServerFirstTokenMs?: number;
                                    llmStreamDurationMs?: number;
                                };
                                turnId: string;
                                usage?: {
                                    inputCacheCreation: number;
                                    inputCacheRead: number;
                                    inputOther: number;
                                    output: number;
                                };
                            }>;
                            turnId: string;
                            usage?: {
                                cachedTokens?: number;
                                cost?: number;
                                inputTokens?: number;
                                outputTokens?: number;
                            };
                        } | {
                            at?: string;
                            kind: 'marker';
                            marker: string;
                            markerId: string;
                            payload?: unknown;
                        } | {
                            at?: string;
                            kind: 'taskref';
                            refId: string;
                            taskId: string;
                        }>;
                        meta: {
                            activity?: 'idle' | 'turn' | 'disposing' | 'unknown';
                            agent?: {
                                contextTokens?: number;
                                contextUsage?: number;
                                maxContextTokens?: number;
                                model?: string;
                                permission?: 'manual' | 'yolo' | 'auto';
                                phase?: {
                                    kind: 'idle';
                                } | {
                                    kind: 'running';
                                    since: number;
                                    step: number;
                                    stepId: string;
                                    turnId: number;
                                } | {
                                    kind: 'streaming';
                                    since: number;
                                    step: number;
                                    stepId: string;
                                    stream: 'assistant' | 'thinking' | 'tool_call';
                                    toolCallId?: string;
                                    toolName?: string;
                                    turnId: number;
                                } | {
                                    kind: 'tool_call';
                                    name: string;
                                    since: number;
                                    step: number;
                                    toolCallId: string;
                                    turnId: number;
                                } | {
                                    delayMs: number;
                                    errorName?: string;
                                    failedAttempt: number;
                                    kind: 'retrying';
                                    maxAttempts: number;
                                    nextAttempt: number;
                                    since: number;
                                    statusCode?: number;
                                    step: number;
                                    stepId: string;
                                    turnId: number;
                                } | {
                                    approval?: unknown;
                                    kind: 'awaiting_approval';
                                    since: number;
                                    step?: number;
                                    turnId: number;
                                } | {
                                    at: number;
                                    kind: 'interrupted';
                                    message?: string;
                                    reason: 'aborted' | 'max_steps' | 'error';
                                    step?: number;
                                    turnId: number;
                                } | {
                                    at: number;
                                    durationMs?: number;
                                    kind: 'ended';
                                    reason: 'completed' | 'cancelled' | 'failed' | 'blocked';
                                    turnId: number;
                                };
                                thinkingEffort?: string;
                                usage?: {
                                    byModel?: {
                                        [key: string]: {
                                            inputCacheCreation: number;
                                            inputCacheRead: number;
                                            inputOther: number;
                                            output: number;
                                        };
                                    };
                                    currentTurn?: {
                                        inputCacheCreation: number;
                                        inputCacheRead: number;
                                        inputOther: number;
                                        output: number;
                                    };
                                    total?: {
                                        inputCacheCreation: number;
                                        inputCacheRead: number;
                                        inputOther: number;
                                        output: number;
                                    };
                                };
                            };
                            goal?: {
                                budgetLimit?: number;
                                budgetUsed?: number;
                                completionCriterion?: string;
                                objective: string;
                                status: 'active' | 'paused' | 'blocked' | 'complete';
                            };
                            modes?: {
                                plan?: {
                                    reviewPath?: string;
                                    version?: number;
                                };
                                swarm?: {
                                    trigger?: string;
                                };
                            };
                        };
                        prompts: Array<{
                            content?: unknown;
                            createdAt: string;
                            finishedAt?: string;
                            promptId: string;
                            status: 'running' | 'queued' | 'blocked' | 'completed' | 'failed' | 'aborted';
                            steeredAt?: string;
                            userMessageId?: string;
                        }>;
                        tasks: Array<{
                            agentId?: string;
                            description?: string;
                            detached: boolean;
                            endedAt?: string;
                            error?: string;
                            kind: 'shell' | 'subagent' | 'tool' | 'other';
                            outputTail: string;
                            resultSummary?: string;
                            startedAt?: string;
                            state: 'running' | 'completed' | 'failed' | 'timed_out' | 'killed' | 'lost';
                            stateReason?: string;
                            taskId: string;
                            usage?: {
                                inputCacheCreation: number;
                                inputCacheRead: number;
                                inputOther: number;
                                output: number;
                            };
                        }>;
                        todos: Array<{
                            items: Array<{
                                status: 'pending' | 'in_progress' | 'done';
                                title: string;
                            }>;
                            todoId: string;
                            updatedAt?: string;
                        }>;
                    };
                } | {
                    op: 'turn.upsert';
                    turn: {
                        attachmentIds?: Array<string>;
                        durationMs?: number;
                        endedAt?: string;
                        error?: string;
                        kind: 'turn';
                        ordinal: number;
                        origin: {
                            kind: 'user';
                            payload?: unknown;
                        } | {
                            kind: 'cron';
                            payload?: unknown;
                            taskId?: string;
                        } | {
                            kind: 'task';
                            payload?: unknown;
                            taskId: string;
                        } | {
                            kind: 'hook';
                            payload?: unknown;
                        } | {
                            kind: 'compaction';
                            payload?: unknown;
                        } | {
                            kind: 'side';
                            payload?: unknown;
                        } | {
                            kind: 'other';
                            payload?: unknown;
                        };
                        prompt?: string;
                        startedAt?: string;
                        state: 'queued' | 'running' | 'completed' | 'failed' | 'cancelled';
                        turnId: string;
                        usage?: {
                            cachedTokens?: number;
                            cost?: number;
                            inputTokens?: number;
                            outputTokens?: number;
                        };
                    };
                } | {
                    op: 'step.upsert';
                    step: {
                        endedAt?: string;
                        endMessage?: string;
                        endReason?: string;
                        finishReason?: string;
                        kind: 'step';
                        ordinal: number;
                        retry?: {
                            delayMs: number;
                            errorMessage: string;
                            errorName: string;
                            failedAttempt: number;
                            maxAttempts: number;
                            nextAttempt: number;
                            statusCode?: number;
                        };
                        startedAt?: string;
                        state: 'running' | 'completed' | 'interrupted' | 'failed';
                        stepId: string;
                        timing?: {
                            llmClientConsumeMs?: number;
                            llmFirstTokenLatencyMs?: number;
                            llmRequestBuildMs?: number;
                            llmServerDecodeMs?: number;
                            llmServerFirstTokenMs?: number;
                            llmStreamDurationMs?: number;
                        };
                        turnId: string;
                        usage?: {
                            inputCacheCreation: number;
                            inputCacheRead: number;
                            inputOther: number;
                            output: number;
                        };
                    };
                    turnId: string;
                } | {
                    frame: {
                        attachmentIds?: Array<string>;
                        frameId: string;
                        kind: 'text';
                        role: 'assistant' | 'user';
                        taskId?: string;
                        text: string;
                    } | {
                        frameId: string;
                        kind: 'thinking';
                        text: string;
                    } | {
                        agentRefs?: Array<{
                            agentId: string;
                            role?: 'child' | 'member';
                        }>;
                        approvalId?: string;
                        display?: unknown;
                        error?: string;
                        frameId: string;
                        input?: unknown;
                        inputText?: string;
                        kind: 'tool';
                        name: string;
                        output?: unknown;
                        progress?: {
                            customData?: unknown;
                            customKind?: string;
                            kind: 'stdout' | 'stderr' | 'progress' | 'status' | 'custom';
                            percent?: number;
                            text?: string;
                        };
                        state: 'running' | 'done' | 'error';
                        taskId?: string;
                        todoId?: string;
                        toolCallId: string;
                        view?: string;
                    } | {
                        detail?: unknown;
                        frameId: string;
                        kind: 'notice';
                        level: 'error' | 'warning' | 'info';
                        message: string;
                        source?: string;
                    };
                    op: 'frame.upsert';
                    stepId: string;
                    turnId: string;
                } | {
                    offset: number;
                    op: 'append';
                    target: {
                        frameId: string;
                        stepId: string;
                        turnId: string;
                        type: 'frame';
                    } | {
                        taskId: string;
                        type: 'task';
                    };
                    text: string;
                } | {
                    beforeTurn?: number;
                    item: {
                        at?: string;
                        kind: 'marker';
                        marker: string;
                        markerId: string;
                        payload?: unknown;
                    };
                    op: 'marker.upsert';
                } | {
                    beforeTurn?: number;
                    item: {
                        at?: string;
                        kind: 'taskref';
                        refId: string;
                        taskId: string;
                    };
                    op: 'taskref.upsert';
                } | {
                    op: 'task.upsert';
                    task: {
                        agentId?: string;
                        description?: string;
                        detached: boolean;
                        endedAt?: string;
                        error?: string;
                        kind: 'shell' | 'subagent' | 'tool' | 'other';
                        outputTail: string;
                        resultSummary?: string;
                        startedAt?: string;
                        state: 'running' | 'completed' | 'failed' | 'timed_out' | 'killed' | 'lost';
                        stateReason?: string;
                        taskId: string;
                        usage?: {
                            inputCacheCreation: number;
                            inputCacheRead: number;
                            inputOther: number;
                            output: number;
                        };
                    };
                } | {
                    interaction: {
                        interactionId: string;
                        interactionKind: 'approval' | 'question';
                        request?: unknown;
                        response?: unknown;
                        state: 'pending' | 'approved' | 'rejected' | 'cancelled' | 'answered' | 'dismissed';
                        toolCallId?: string;
                    };
                    op: 'interaction.upsert';
                } | {
                    attachment: {
                        attachmentId: string;
                        mediaType: string;
                        name?: string;
                        placeholder?: string;
                        size?: number;
                        source?: {
                            kind: 'url';
                            url: string;
                        } | {
                            fileId: string;
                            kind: 'file';
                        };
                    };
                    op: 'attachment.upsert';
                } | {
                    op: 'todo.upsert';
                    todo: {
                        items: Array<{
                            status: 'pending' | 'in_progress' | 'done';
                            title: string;
                        }>;
                        todoId: string;
                        updatedAt?: string;
                    };
                } | {
                    op: 'prompt.upsert';
                    prompt: {
                        content?: unknown;
                        createdAt: string;
                        finishedAt?: string;
                        promptId: string;
                        status: 'running' | 'queued' | 'blocked' | 'completed' | 'failed' | 'aborted';
                        steeredAt?: string;
                        userMessageId?: string;
                    };
                } | {
                    meta: {
                        activity?: 'idle' | 'turn' | 'disposing' | 'unknown';
                        agent?: {
                            contextTokens?: number;
                            contextUsage?: number;
                            maxContextTokens?: number;
                            model?: string;
                            permission?: 'manual' | 'yolo' | 'auto';
                            phase?: {
                                kind: 'idle';
                            } | {
                                kind: 'running';
                                since: number;
                                step: number;
                                stepId: string;
                                turnId: number;
                            } | {
                                kind: 'streaming';
                                since: number;
                                step: number;
                                stepId: string;
                                stream: 'assistant' | 'thinking' | 'tool_call';
                                toolCallId?: string;
                                toolName?: string;
                                turnId: number;
                            } | {
                                kind: 'tool_call';
                                name: string;
                                since: number;
                                step: number;
                                toolCallId: string;
                                turnId: number;
                            } | {
                                delayMs: number;
                                errorName?: string;
                                failedAttempt: number;
                                kind: 'retrying';
                                maxAttempts: number;
                                nextAttempt: number;
                                since: number;
                                statusCode?: number;
                                step: number;
                                stepId: string;
                                turnId: number;
                            } | {
                                approval?: unknown;
                                kind: 'awaiting_approval';
                                since: number;
                                step?: number;
                                turnId: number;
                            } | {
                                at: number;
                                kind: 'interrupted';
                                message?: string;
                                reason: 'aborted' | 'max_steps' | 'error';
                                step?: number;
                                turnId: number;
                            } | {
                                at: number;
                                durationMs?: number;
                                kind: 'ended';
                                reason: 'completed' | 'cancelled' | 'failed' | 'blocked';
                                turnId: number;
                            };
                            thinkingEffort?: string;
                            usage?: {
                                byModel?: {
                                    [key: string]: {
                                        inputCacheCreation: number;
                                        inputCacheRead: number;
                                        inputOther: number;
                                        output: number;
                                    };
                                };
                                currentTurn?: {
                                    inputCacheCreation: number;
                                    inputCacheRead: number;
                                    inputOther: number;
                                    output: number;
                                };
                                total?: {
                                    inputCacheCreation: number;
                                    inputCacheRead: number;
                                    inputOther: number;
                                    output: number;
                                };
                            };
                        };
                        goal?: {
                            budgetLimit?: number;
                            budgetUsed?: number;
                            completionCriterion?: string;
                            objective: string;
                            status: 'active' | 'paused' | 'blocked' | 'complete';
                        };
                        modes?: {
                            plan?: {
                                reviewPath?: string;
                                version?: number;
                            } | null;
                            swarm?: {
                                trigger?: string;
                            } | null;
                        };
                    };
                    op: 'meta.merge';
                } | {
                    ids: Array<string>;
                    op: 'items.remove';
                }>;
                seq: number;
            }>;
            complete: boolean;
            latest_seq: number;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40001;
        data: null;
        details?: Array<{
            message: string;
            path: string;
        }> | null;
        msg: string;
        request_id: string;
    } | {
        code: 40401;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type GetApiV1SessionsBySessionIdTranscriptOpsResponse = GetApiV1SessionsBySessionIdTranscriptOpsResponses[keyof GetApiV1SessionsBySessionIdTranscriptOpsResponses];

export type GetApiV1SessionsBySessionIdTranscriptPlanData = {
    body?: never;
    path: {
        session_id: string;
    };
    query: {
        agent_id: string;
        tool_call_id?: string;
    };
    url: '/api/v1/sessions/{session_id}/transcript/plan';
};

export type GetApiV1SessionsBySessionIdTranscriptPlanResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            agent_id: string;
            plans: Array<{
                options?: Array<{
                    description?: string;
                    label: string;
                }>;
                path?: string;
                plan: string;
                review?: {
                    feedback?: string;
                    selected_option?: string;
                    state: 'pending' | 'approved' | 'rejected' | 'cancelled';
                };
                source: 'interaction' | 'display' | 'output';
                tool_call_id: string;
                turn_id: string;
            }>;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40001;
        data: null;
        details?: Array<{
            message: string;
            path: string;
        }> | null;
        msg: string;
        request_id: string;
    } | {
        code: 40401;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40416;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type GetApiV1SessionsBySessionIdTranscriptPlanResponse = GetApiV1SessionsBySessionIdTranscriptPlanResponses[keyof GetApiV1SessionsBySessionIdTranscriptPlanResponses];

export type GetApiV1SessionsBySessionIdTranscriptUserMessagesData = {
    body?: never;
    path: {
        session_id: string;
    };
    query?: {
        agent_id?: string;
    };
    url: '/api/v1/sessions/{session_id}/transcript/user-messages';
};

export type GetApiV1SessionsBySessionIdTranscriptUserMessagesResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            agents: Array<{
                agent_id: string;
                attachments: Array<{
                    attachmentId: string;
                    mediaType: string;
                    name?: string;
                    placeholder?: string;
                    size?: number;
                    source?: {
                        kind: 'url';
                        url: string;
                    } | {
                        fileId: string;
                        kind: 'file';
                    };
                }>;
                messages: Array<{
                    attachment_ids?: Array<string>;
                    ordinal: number;
                    origin: {
                        kind: 'user';
                        payload?: unknown;
                    } | {
                        kind: 'cron';
                        payload?: unknown;
                        taskId?: string;
                    } | {
                        kind: 'task';
                        payload?: unknown;
                        taskId: string;
                    } | {
                        kind: 'hook';
                        payload?: unknown;
                    } | {
                        kind: 'compaction';
                        payload?: unknown;
                    } | {
                        kind: 'side';
                        payload?: unknown;
                    } | {
                        kind: 'other';
                        payload?: unknown;
                    };
                    prompt: string;
                    started_at?: string;
                    state: 'queued' | 'running' | 'completed' | 'failed' | 'cancelled';
                    turn_id: string;
                }>;
            }>;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40001;
        data: null;
        details?: Array<{
            message: string;
            path: string;
        }> | null;
        msg: string;
        request_id: string;
    } | {
        code: 40401;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type GetApiV1SessionsBySessionIdTranscriptUserMessagesResponse = GetApiV1SessionsBySessionIdTranscriptUserMessagesResponses[keyof GetApiV1SessionsBySessionIdTranscriptUserMessagesResponses];

export type GetApiV1SessionsBySessionIdWarningsData = {
    body?: never;
    path: {
        session_id: string;
    };
    query?: never;
    url: '/api/v1/sessions/{session_id}/warnings';
};

export type GetApiV1SessionsBySessionIdWarningsResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            warnings: Array<{
                code: string;
                message: string;
                severity: 'info' | 'warning' | 'error';
            }>;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40001;
        data: null;
        details?: Array<{
            message: string;
            path: string;
        }> | null;
        msg: string;
        request_id: string;
    } | {
        code: 40401;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type GetApiV1SessionsBySessionIdWarningsResponse = GetApiV1SessionsBySessionIdWarningsResponses[keyof GetApiV1SessionsBySessionIdWarningsResponses];

export type PostApiV1ShutdownData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/api/v1/shutdown';
};

export type PostApiV1ShutdownResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            ok: true;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type PostApiV1ShutdownResponse = PostApiV1ShutdownResponses[keyof PostApiV1ShutdownResponses];

export type GetApiV1ToolsData = {
    body?: never;
    path?: never;
    query?: {
        session_id?: string;
    };
    url: '/api/v1/tools';
};

export type GetApiV1ToolsResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            tools: Array<{
                active?: boolean;
                description: string;
                input_schema: unknown;
                mcp_server_id?: string;
                name: string;
                source: 'builtin' | 'skill' | 'mcp';
            }>;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type GetApiV1ToolsResponse = GetApiV1ToolsResponses[keyof GetApiV1ToolsResponses];

export type WorkspaceFsSearchData = {
    body: {
        exclude_globs?: Array<string>;
        follow_gitignore?: boolean;
        include_globs?: Array<string>;
        limit?: number;
        query: string;
        workspace: string;
    };
    path?: never;
    query?: never;
    url: '/api/v1/workspace/fs:search';
};

export type WorkspaceFsSearchResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            items: Array<{
                kind: 'file' | 'directory' | 'symlink';
                match_positions: Array<number>;
                name: string;
                path: string;
                score: number;
            }>;
            truncated: boolean;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40001;
        data: null;
        details?: Array<{
            message: string;
            path: string;
        }> | null;
        msg: string;
        request_id: string;
    } | {
        code: 40410;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 41303;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type WorkspaceFsSearchResponse = WorkspaceFsSearchResponses[keyof WorkspaceFsSearchResponses];

export type GetApiV1WorkspacesData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/api/v1/workspaces';
};

export type GetApiV1WorkspacesResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            items: Array<{
                created_at: unknown;
                id: string;
                last_opened_at: unknown;
                name: string;
                root: string;
                session_count: number;
            }>;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type GetApiV1WorkspacesResponse = GetApiV1WorkspacesResponses[keyof GetApiV1WorkspacesResponses];

export type PostApiV1WorkspacesData = {
    body: {
        name?: string;
        root: string;
    };
    path?: never;
    query?: never;
    url: '/api/v1/workspaces';
};

export type PostApiV1WorkspacesResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            created_at: unknown;
            id: string;
            last_opened_at: unknown;
            name: string;
            root: string;
            session_count: number;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40001;
        data: null;
        details?: Array<{
            message: string;
            path: string;
        }> | null;
        msg: string;
        request_id: string;
    } | {
        code: 40409;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type PostApiV1WorkspacesResponse = PostApiV1WorkspacesResponses[keyof PostApiV1WorkspacesResponses];

export type DeleteApiV1WorkspacesByWorkspaceIdData = {
    body?: never;
    path: {
        workspace_id: string;
    };
    query?: never;
    url: '/api/v1/workspaces/{workspace_id}';
};

export type DeleteApiV1WorkspacesByWorkspaceIdResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            deleted: true;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40001;
        data: null;
        details?: Array<{
            message: string;
            path: string;
        }> | null;
        msg: string;
        request_id: string;
    } | {
        code: 40410;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type DeleteApiV1WorkspacesByWorkspaceIdResponse = DeleteApiV1WorkspacesByWorkspaceIdResponses[keyof DeleteApiV1WorkspacesByWorkspaceIdResponses];

export type PatchApiV1WorkspacesByWorkspaceIdData = {
    body: {
        name: string;
    };
    path: {
        workspace_id: string;
    };
    query?: never;
    url: '/api/v1/workspaces/{workspace_id}';
};

export type PatchApiV1WorkspacesByWorkspaceIdResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            created_at: unknown;
            id: string;
            last_opened_at: unknown;
            name: string;
            root: string;
            session_count: number;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40001;
        data: null;
        details?: Array<{
            message: string;
            path: string;
        }> | null;
        msg: string;
        request_id: string;
    } | {
        code: 40410;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type PatchApiV1WorkspacesByWorkspaceIdResponse = PatchApiV1WorkspacesByWorkspaceIdResponses[keyof PatchApiV1WorkspacesByWorkspaceIdResponses];

export type ListWorkspaceSkillsData = {
    body?: never;
    path: {
        workspace_id: string;
    };
    query?: never;
    url: '/api/v1/workspaces/{workspace_id}/skills';
};

export type ListWorkspaceSkillsResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            skills: Array<{
                description: string;
                disable_model_invocation?: boolean;
                name: string;
                path: string;
                source: 'project' | 'user' | 'extra' | 'builtin';
                type?: string;
            }>;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40410;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type ListWorkspaceSkillsResponse = ListWorkspaceSkillsResponses[keyof ListWorkspaceSkillsResponses];

export type GetApiV1WorkspacesByWorkspaceIdTrustData = {
    body?: never;
    path: {
        workspace_id: string;
    };
    query?: never;
    url: '/api/v1/workspaces/{workspace_id}/trust';
};

export type GetApiV1WorkspacesByWorkspaceIdTrustResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            trusted: boolean;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40410;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type GetApiV1WorkspacesByWorkspaceIdTrustResponse = GetApiV1WorkspacesByWorkspaceIdTrustResponses[keyof GetApiV1WorkspacesByWorkspaceIdTrustResponses];

export type PostApiV1WorkspacesByWorkspaceIdTrustData = {
    body?: never;
    path: {
        workspace_id: string;
    };
    query?: never;
    url: '/api/v1/workspaces/{workspace_id}/trust';
};

export type PostApiV1WorkspacesByWorkspaceIdTrustResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            trusted: boolean;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40410;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type PostApiV1WorkspacesByWorkspaceIdTrustResponse = PostApiV1WorkspacesByWorkspaceIdTrustResponses[keyof PostApiV1WorkspacesByWorkspaceIdTrustResponses];

export type PostApiV1WorkspacesByWorkspaceIdUntrustData = {
    body?: never;
    path: {
        workspace_id: string;
    };
    query?: never;
    url: '/api/v1/workspaces/{workspace_id}/untrust';
};

export type PostApiV1WorkspacesByWorkspaceIdUntrustResponses = {
    /**
     * Default Response
     */
    200: {
        code: 0;
        data: {
            trusted: boolean;
        };
        details?: unknown;
        msg: string;
        request_id: string;
    } | {
        code: 40410;
        data: null;
        details?: unknown;
        msg: string;
        request_id: string;
    };
};

export type PostApiV1WorkspacesByWorkspaceIdUntrustResponse = PostApiV1WorkspacesByWorkspaceIdUntrustResponses[keyof PostApiV1WorkspacesByWorkspaceIdUntrustResponses];

export type GetAsyncapiJsonData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/asyncapi.json';
};

export type GetAsyncapiJsonResponses = {
    /**
     * Default Response
     */
    200: unknown;
};

export type GetOpenapiJsonData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/openapi.json';
};

export type GetOpenapiJsonResponses = {
    /**
     * Default Response
     */
    200: unknown;
};
