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

import * as z from 'zod';

export const zGetBy__Path = z.object({
    '*': z.string()
});

export const zGetCatalogProviderPath = z.object({
    catalog_id: z.string().min(1)
});

export const zPostApiV1ConfigBody = z.object({
    background: z.unknown().optional(),
    default_model: z.string().optional(),
    default_permission_mode: z.string().optional(),
    default_plan_mode: z.boolean().optional(),
    default_provider: z.string().optional(),
    experimental: z.record(z.string(), z.boolean()).optional(),
    extra_skill_dirs: z.array(z.string()).optional(),
    hooks: z.array(z.unknown()).optional(),
    loop_control: z.unknown().optional(),
    merge_all_available_skills: z.boolean().optional(),
    models: z.record(z.string(), z.unknown()).optional(),
    permission: z.unknown().optional(),
    plan_mode: z.boolean().optional(),
    providers: z.record(z.string(), z.unknown()).optional(),
    secondary_model: z.unknown().optional(),
    services: z.unknown().optional(),
    telemetry: z.boolean().optional(),
    thinking: z.unknown().optional(),
    yolo: z.boolean().optional()
});

export const zPostApiV1FilesBody = z.object({
    expires_in_sec: z.number().gte(0).optional(),
    file: z.string(),
    name: z.string().optional()
});

export const zDeleteApiV1FilesByFileIdPath = z.object({
    file_id: z.string().min(1)
});

export const zGetApiV1FilesByFileIdPath = z.object({
    file_id: z.string().min(1)
});

export const zFsBrowseQuery = z.object({
    path: z.string().min(1).optional()
});

export const zFsContentQuery = z.object({
    path: z.string().min(1)
});

export const zFsMkdirBody = z.object({
    path: z.string().min(1)
});

export const zGetApiV1GuiStoreGetItemQuery = z.object({
    key: z.string().min(1).max(256)
});

export const zPostApiV1GuiStoreRemoveItemBody = z.object({
    key: z.string().min(1).max(256)
});

export const zPostApiV1GuiStoreSetItemBody = z.object({
    key: z.string().min(1).max(256),
    value: z.string()
});

export const zRestartMcpServerPath = z.object({
    tail: z.string()
});

export const zSetDefaultModelPath = z.object({
    tail: z.string().min(1)
});

export const zDeleteApiV1OauthLoginQuery = z.object({
    provider: z.string().min(1).optional()
});

export const zGetApiV1OauthLoginQuery = z.object({
    provider: z.string().min(1).optional()
});

export const zPostApiV1OauthLoginBody = z.object({
    provider: z.string().min(1).optional()
});

export const zPostApiV1OauthLogoutBody = z.object({
    provider: z.string().min(1).optional()
});

export const zGetApiV1OauthUsageQuery = z.object({
    provider: z.string().min(1).optional()
});

export const zGetApiV1OauthUserinfoQuery = z.object({
    provider: z.string().min(1).optional()
});

export const zCreateProviderBody = z.object({
    api_key: z.string().optional(),
    base_url: z.string().optional(),
    default_model: z.string().min(1).optional(),
    id: z.string().regex(/^[\p{L}\p{N}][\p{L}\p{N}\-_ ]*$/u),
    models: z.array(z.object({
        adaptive_thinking: z.boolean().optional(),
        capabilities: z.array(z.string()).optional(),
        display_name: z.string().min(1).optional(),
        max_context_size: z.int().gte(1).lte(9007199254740991),
        max_output_size: z.int().gte(1).lte(9007199254740991).optional(),
        model: z.string().min(1),
        support_efforts: z.array(z.string().min(1)).optional()
    })).min(1),
    type: z.enum([
        'kimi',
        'openai',
        'openai_responses',
        'anthropic',
        'google-genai',
        'vertexai'
    ])
});

export const zProviderCollectionActionBody = z.object({
    api_key: z.string().optional(),
    base_url: z.string().optional(),
    catalog_id: z.string().min(1).optional(),
    id: z.string().regex(/^[\p{L}\p{N}][\p{L}\p{N}\-_ ]*$/u).optional(),
    url: z.string().min(1).optional()
});

export const zProviderCollectionActionPath = z.object({
    action: z.string().min(1)
});

export const zDeleteProviderPath = z.object({
    provider_id: z.string().min(1)
});

export const zGetApiV1ProvidersByProviderIdPath = z.object({
    provider_id: z.string().min(1)
});

export const zReplaceProviderBody = z.object({
    api_key: z.string().optional(),
    base_url: z.string().optional(),
    default_model: z.string().min(1).optional(),
    models: z.array(z.object({
        adaptive_thinking: z.boolean().optional(),
        capabilities: z.array(z.string()).optional(),
        display_name: z.string().min(1).optional(),
        max_context_size: z.int().gte(1).lte(9007199254740991),
        max_output_size: z.int().gte(1).lte(9007199254740991).optional(),
        model: z.string().min(1),
        support_efforts: z.array(z.string().min(1)).optional()
    })).min(1),
    new_id: z.string().regex(/^[\p{L}\p{N}][\p{L}\p{N}\-_ ]*$/u).optional(),
    type: z.enum([
        'kimi',
        'openai',
        'openai_responses',
        'anthropic',
        'google-genai',
        'vertexai'
    ])
});

export const zReplaceProviderPath = z.object({
    provider_id: z.string().min(1)
});

export const zRefreshProviderPath = z.object({
    tail: z.string().min(1)
});

export const zPostApiV1SearchBody = z.object({
    container: z.object({
        agent_id: z.string().min(1).optional(),
        session_id: z.string().min(1).optional()
    }).optional(),
    end_time: z.int().gte(0).lte(9007199254740991).optional(),
    mode: z.enum(['terms', 'literal']).optional(),
    op: z.enum(['AND', 'OR']).optional(),
    page_size: z.int().gte(1).lte(50).optional(),
    page_token: z.string().min(1).optional(),
    query: z.string().min(1),
    role: z.enum([
        'user',
        'assistant',
        'title'
    ]).optional(),
    sort: z.enum([
        'score',
        'time_desc',
        'time_asc'
    ]).optional(),
    start_time: z.int().gte(0).lte(9007199254740991).optional()
});

export const zGetApiV1SessionsQuery = z.object({
    before_id: z.string().min(1).optional(),
    after_id: z.string().min(1).optional(),
    page_size: z.int().gte(1).lte(100).optional(),
    busy: z.boolean(),
    include_archive: z.boolean(),
    exclude_empty: z.boolean(),
    archived_only: z.boolean(),
    workspace_id: z.string().regex(/^wd_[a-z0-9._-]+_[0-9a-f]{12}$/).optional()
});

export const zPostApiV1SessionsBody = z.object({
    agent_config: z.object({
        goal_control: z.enum([
            'pause',
            'resume',
            'cancel'
        ]).optional(),
        goal_objective: z.string().optional(),
        mcp_servers: z.array(z.string()).optional(),
        model: z.string().optional(),
        permission_mode: z.enum([
            'manual',
            'yolo',
            'auto'
        ]).optional(),
        plan_mode: z.boolean().optional(),
        swarm_mode: z.boolean().optional(),
        system_prompt: z.string().optional(),
        thinking: z.string().min(1).optional(),
        tools: z.array(z.string()).optional()
    }).optional(),
    metadata: z.object({
        cwd: z.string().min(1)
    }).optional(),
    title: z.string().min(1).optional(),
    workspace_id: z.string().regex(/^wd_[a-z0-9._-]+_[0-9a-f]{12}$/).optional()
});

export const zGetApiV1SessionsBySessionIdPath = z.object({
    session_id: z.string().min(1)
});

export const zRunSessionArchiveActionBody = z.object({
    count: z.int().lte(9007199254740991).optional(),
    instruction: z.string().optional(),
    metadata: z.record(z.string(), z.unknown()).optional(),
    page_size: z.int().gte(1).lte(100).optional(),
    title: z.string().min(1).optional()
});

export const zRunSessionArchiveActionPath = z.object({
    session_id: z.string().min(1)
});

export const zFsActionBody = z.union([
    z.object({
        depth: z.int().gte(1).lte(10).optional().default(1),
        exclude_globs: z.array(z.string()).optional(),
        follow_gitignore: z.boolean().optional().default(true),
        include_git_status: z.boolean().optional().default(false),
        limit: z.int().gte(1).lte(1000).optional().default(200),
        path: z.string().optional().default('.'),
        show_hidden: z.boolean().optional().default(false),
        sort: z.enum([
            'type_first',
            'name_asc',
            'name_desc',
            'mtime_desc',
            'size_desc'
        ]).optional().default('type_first')
    }),
    z.object({
        encoding: z.enum([
            'auto',
            'utf-8',
            'base64'
        ]).optional().default('auto'),
        length: z.int().gte(1).lte(10485760).optional().default(1048576),
        offset: z.int().gte(0).lte(9007199254740991).optional().default(0),
        path: z.string().min(1)
    }),
    z.object({
        depth: z.int().gte(1).lte(10).optional().default(1),
        exclude_globs: z.array(z.string()).optional(),
        follow_gitignore: z.boolean().optional().default(true),
        include_git_status: z.boolean().optional().default(false),
        limit: z.int().gte(1).lte(1000).optional().default(200),
        paths: z.array(z.string().min(1)).min(1).max(100),
        show_hidden: z.boolean().optional().default(false),
        sort: z.enum([
            'type_first',
            'name_asc',
            'name_desc',
            'mtime_desc',
            'size_desc'
        ]).optional().default('type_first')
    }),
    z.object({
        path: z.string().min(1)
    }),
    z.object({
        paths: z.array(z.string().min(1)).min(1).max(1000)
    }),
    z.object({
        path: z.string().min(1),
        recursive: z.boolean().optional().default(false)
    }),
    z.object({
        exclude_globs: z.array(z.string()).optional(),
        follow_gitignore: z.boolean().optional().default(true),
        include_globs: z.array(z.string()).optional(),
        limit: z.int().gte(1).lte(200).optional().default(50),
        query: z.string()
    }),
    z.object({
        case_sensitive: z.boolean().optional().default(true),
        context_lines: z.int().gte(0).lte(10).optional().default(2),
        exclude_globs: z.array(z.string()).optional(),
        follow_gitignore: z.boolean().optional().default(true),
        include_globs: z.array(z.string()).optional(),
        max_files: z.int().gte(1).lte(10000).optional().default(200),
        max_matches_per_file: z.int().gte(1).lte(10000).optional().default(50),
        max_total_matches: z.int().gte(1).lte(100000).optional().default(5000),
        pattern: z.string().min(1),
        regex: z.boolean().optional().default(false)
    }),
    z.object({
        paths: z.array(z.string().min(1)).optional()
    }),
    z.object({
        path: z.string().min(1)
    }),
    z.object({
        line: z.int().lte(9007199254740991).optional(),
        path: z.string().min(1)
    }),
    z.object({
        app_id: z.enum([
            'finder',
            'cursor',
            'vscode',
            'iterm',
            'terminal'
        ]),
        line: z.int().lte(9007199254740991).optional(),
        path: z.string().min(1)
    }),
    z.object({
        path: z.string().min(1)
    })
]);

export const zFsActionPath = z.object({
    session_id: z.string().min(1),
    tail: z.string().min(1)
});

export const zGetApiV1SessionsBySessionIdApprovalsPath = z.object({
    session_id: z.string().min(1)
});

export const zGetApiV1SessionsBySessionIdApprovalsQuery = z.object({
    status: z.enum(['pending'])
});

export const zPostApiV1SessionsBySessionIdApprovalsByApprovalIdBody = z.object({
    decision: z.enum([
        'approved',
        'rejected',
        'cancelled'
    ]),
    feedback: z.string().optional(),
    scope: z.enum(['session']).optional(),
    selected_label: z.string().optional()
});

export const zPostApiV1SessionsBySessionIdApprovalsByApprovalIdPath = z.object({
    session_id: z.string().min(1),
    approval_id: z.string().min(1)
});

export const zGetApiV1SessionsBySessionIdChildrenPath = z.object({
    session_id: z.string().min(1)
});

export const zGetApiV1SessionsBySessionIdChildrenQuery = z.object({
    before_id: z.string().min(1).optional(),
    after_id: z.string().min(1).optional(),
    page_size: z.int().gte(1).lte(100).optional(),
    busy: z.boolean()
});

export const zPostApiV1SessionsBySessionIdChildrenBody = z.object({
    metadata: z.record(z.string(), z.unknown()).optional(),
    title: z.string().min(1).optional()
});

export const zPostApiV1SessionsBySessionIdChildrenPath = z.object({
    session_id: z.string().min(1)
});

export const zPostApiV1SessionsBySessionIdExportBody = z.object({
    desktop: z.boolean().optional(),
    web_log: z.string().optional()
});

export const zPostApiV1SessionsBySessionIdExportPath = z.object({
    session_id: z.string().min(1)
});

export const zDownloadFilePath = z.object({
    session_id: z.string(),
    '*': z.string()
});

export const zGetApiV1SessionsBySessionIdGoalPath = z.object({
    session_id: z.string().min(1)
});

export const zGetApiV1SessionsBySessionIdMessagesPath = z.object({
    session_id: z.string().min(1)
});

export const zGetApiV1SessionsBySessionIdMessagesQuery = z.object({
    before_id: z.string().min(1).optional(),
    after_id: z.string().min(1).optional(),
    page_size: z.int().gte(1).lte(100).optional(),
    role: z.enum([
        'user',
        'assistant',
        'tool',
        'system'
    ]).optional()
});

export const zGetApiV1SessionsBySessionIdMessagesByMessageIdPath = z.object({
    session_id: z.string().min(1),
    message_id: z.string().min(1)
});

export const zGetApiV1SessionsBySessionIdProfilePath = z.object({
    session_id: z.string().min(1)
});

export const zPostApiV1SessionsBySessionIdProfileBody = z.object({
    agent_config: z.object({
        goal_control: z.enum([
            'pause',
            'resume',
            'cancel'
        ]).optional(),
        goal_objective: z.string().optional(),
        mcp_servers: z.array(z.string()).optional(),
        model: z.string().optional(),
        permission_mode: z.enum([
            'manual',
            'yolo',
            'auto'
        ]).optional(),
        plan_mode: z.boolean().optional(),
        swarm_mode: z.boolean().optional(),
        system_prompt: z.string().optional(),
        thinking: z.string().min(1).optional(),
        tools: z.array(z.string()).optional()
    }).optional(),
    metadata: z.object({
        cwd: z.string().min(1).optional()
    }).optional(),
    permission_rules: z.array(z.object({
        created_at: z.string(),
        created_by: z.enum(['user', 'agent']),
        decision: z.enum(['approved']),
        id: z.string().min(1),
        matcher: z.object({
            kind: z.enum([
                'command_prefix',
                'path_glob',
                'exact_input',
                'always'
            ]),
            value: z.string().optional()
        }).optional(),
        tool_name: z.string().min(1)
    })).optional(),
    title: z.string().min(1).optional()
});

export const zPostApiV1SessionsBySessionIdProfilePath = z.object({
    session_id: z.string().min(1)
});

export const zListPromptsPath = z.object({
    session_id: z.string().min(1)
});

export const zSubmitPromptBody = z.object({
    agent_id: z.string().min(1).optional(),
    content: z.array(z.union([
        z.object({
            text: z.string(),
            type: z.enum(['text'])
        }),
        z.object({
            input: z.unknown(),
            tool_call_id: z.string().min(1),
            tool_name: z.string().min(1),
            type: z.enum(['tool_use'])
        }),
        z.object({
            is_error: z.boolean().optional(),
            output: z.unknown(),
            tool_call_id: z.string().min(1),
            type: z.enum(['tool_result'])
        }),
        z.object({
            source: z.union([
                z.object({
                    id: z.string().min(1).optional(),
                    kind: z.enum(['url']),
                    url: z.string().min(1)
                }),
                z.object({
                    data: z.string().min(1),
                    kind: z.enum(['base64']),
                    media_type: z.string().min(1)
                }),
                z.object({
                    file_id: z.string().min(1),
                    kind: z.enum(['file'])
                })
            ]),
            type: z.enum(['image'])
        }),
        z.object({
            source: z.union([
                z.object({
                    id: z.string().min(1).optional(),
                    kind: z.enum(['url']),
                    url: z.string().min(1)
                }),
                z.object({
                    data: z.string().min(1),
                    kind: z.enum(['base64']),
                    media_type: z.string().min(1)
                }),
                z.object({
                    file_id: z.string().min(1),
                    kind: z.enum(['file'])
                })
            ]),
            type: z.enum(['video'])
        }),
        z.object({
            file_id: z.string().min(1),
            media_type: z.string().min(1),
            name: z.string(),
            size: z.int().gte(0).lte(9007199254740991),
            type: z.enum(['file'])
        }),
        z.object({
            signature: z.string().optional(),
            thinking: z.string(),
            type: z.enum(['thinking'])
        })
    ])).min(1),
    disabled_tools: z.array(z.string()).optional(),
    goal_control: z.enum([
        'pause',
        'resume',
        'cancel'
    ]).optional(),
    goal_objective: z.string().optional(),
    metadata: z.record(z.string(), z.unknown()).optional(),
    model: z.string().min(1).optional(),
    permission_mode: z.enum([
        'manual',
        'yolo',
        'auto'
    ]).optional(),
    plan_mode: z.boolean().optional(),
    profile: z.string().min(1).optional(),
    swarm_mode: z.boolean().optional(),
    thinking: z.string().min(1).optional()
});

export const zSubmitPromptPath = z.object({
    session_id: z.string().min(1)
});

export const zSteerPromptsBody = z.object({
    prompt_ids: z.array(z.string().min(1)).min(1)
});

export const zSteerPromptsPath = z.object({
    session_id: z.string().min(1)
});

export const zPromptActionPath = z.object({
    session_id: z.string(),
    tail: z.string()
});

export const zGetApiV1SessionsBySessionIdQuestionsPath = z.object({
    session_id: z.string().min(1)
});

export const zGetApiV1SessionsBySessionIdQuestionsQuery = z.object({
    status: z.enum(['pending'])
});

export const zPostApiV1SessionsBySessionIdQuestionsByTailBody = z.object({
    answers: z.record(z.string(), z.union([
        z.object({
            kind: z.enum(['single']),
            option_id: z.string().min(1)
        }),
        z.object({
            kind: z.enum(['multi']),
            option_ids: z.array(z.string().min(1)).min(1)
        }),
        z.object({
            kind: z.enum(['other']),
            text: z.string()
        }),
        z.object({
            kind: z.enum(['multi_with_other']),
            option_ids: z.array(z.string().min(1)),
            other_text: z.string()
        }),
        z.object({
            kind: z.enum(['skipped'])
        })
    ])),
    method: z.enum([
        'enter',
        'space',
        'number_key',
        'click'
    ]).optional(),
    note: z.string().optional()
});

export const zPostApiV1SessionsBySessionIdQuestionsByTailPath = z.object({
    session_id: z.string().min(1),
    tail: z.string().min(1)
});

export const zListSkillsPath = z.object({
    session_id: z.string().min(1)
});

export const zActivateSkillBody = z.object({
    args: z.string().optional()
});

export const zActivateSkillPath = z.object({
    session_id: z.string().min(1),
    tail: z.string().min(1)
});

export const zGetApiV1SessionsBySessionIdSnapshotPath = z.object({
    session_id: z.string().min(1)
});

export const zGetApiV1SessionsBySessionIdStatusPath = z.object({
    session_id: z.string().min(1)
});

export const zGetApiV1SessionsBySessionIdTasksPath = z.object({
    session_id: z.string().min(1)
});

export const zGetApiV1SessionsBySessionIdTasksQuery = z.object({
    status: z.enum([
        'running',
        'completed',
        'failed',
        'cancelled'
    ]).optional()
});

export const zCancelTaskPath = z.object({
    session_id: z.string(),
    tail: z.string()
});

export const zGetApiV1SessionsBySessionIdTasksByTaskIdPath = z.object({
    session_id: z.string().min(1),
    task_id: z.string().min(1)
});

export const zGetApiV1SessionsBySessionIdTasksByTaskIdQuery = z.object({
    with_output: z.boolean().optional(),
    output_bytes: z.int().gte(0).lte(9007199254740991).optional()
});

export const zGetApiV1SessionsBySessionIdTerminalsPath = z.object({
    session_id: z.string().min(1)
});

export const zPostApiV1SessionsBySessionIdTerminalsBody = z.object({
    cols: z.int().lte(9007199254740991).optional(),
    cwd: z.string().min(1).optional(),
    rows: z.int().lte(9007199254740991).optional(),
    shell: z.string().min(1).optional()
});

export const zPostApiV1SessionsBySessionIdTerminalsPath = z.object({
    session_id: z.string().min(1)
});

export const zCloseTerminalPath = z.object({
    session_id: z.string().min(1),
    tail: z.string().min(1)
});

export const zGetApiV1SessionsBySessionIdTerminalsByTerminalIdPath = z.object({
    session_id: z.string().min(1),
    terminal_id: z.string().min(1)
});

export const zGetApiV1SessionsBySessionIdTranscriptPath = z.object({
    session_id: z.string().min(1)
});

export const zGetApiV1SessionsBySessionIdTranscriptQuery = z.object({
    agent_id: z.string().min(1),
    before_turn: z.string().min(1).optional(),
    after_turn: z.string().min(1).optional(),
    page_size: z.int().gte(1).lte(100).optional()
});

export const zGetApiV1SessionsBySessionIdTranscriptOpsPath = z.object({
    session_id: z.string().min(1)
});

export const zGetApiV1SessionsBySessionIdTranscriptOpsQuery = z.object({
    agent_id: z.string().min(1),
    since_seq: z.int().gte(0).lte(9007199254740991)
});

export const zGetApiV1SessionsBySessionIdTranscriptPlanPath = z.object({
    session_id: z.string().min(1)
});

export const zGetApiV1SessionsBySessionIdTranscriptPlanQuery = z.object({
    agent_id: z.string().min(1),
    tool_call_id: z.string().min(1).optional()
});

export const zGetApiV1SessionsBySessionIdTranscriptUserMessagesPath = z.object({
    session_id: z.string().min(1)
});

export const zGetApiV1SessionsBySessionIdTranscriptUserMessagesQuery = z.object({
    agent_id: z.string().min(1).optional()
});

export const zGetApiV1SessionsBySessionIdWarningsPath = z.object({
    session_id: z.string().min(1)
});

export const zGetApiV1ToolsQuery = z.object({
    session_id: z.string().min(1).optional()
});

export const zWorkspaceFsSearchBody = z.object({
    exclude_globs: z.array(z.string()).optional(),
    follow_gitignore: z.boolean().optional().default(true),
    include_globs: z.array(z.string()).optional(),
    limit: z.int().gte(1).lte(200).optional().default(50),
    query: z.string(),
    workspace: z.string().min(1)
});

export const zPostApiV1WorkspacesBody = z.object({
    name: z.string().min(1).max(100).optional(),
    root: z.string().min(1)
});

export const zDeleteApiV1WorkspacesByWorkspaceIdPath = z.object({
    workspace_id: z.string().regex(/^wd_[a-z0-9._-]+_[0-9a-f]{12}$/)
});

export const zPatchApiV1WorkspacesByWorkspaceIdBody = z.object({
    name: z.string().min(1).max(100)
});

export const zPatchApiV1WorkspacesByWorkspaceIdPath = z.object({
    workspace_id: z.string().regex(/^wd_[a-z0-9._-]+_[0-9a-f]{12}$/)
});

export const zListWorkspaceSkillsPath = z.object({
    workspace_id: z.string().regex(/^wd_[a-z0-9._-]+_[0-9a-f]{12}$/)
});

export const zGetApiV1WorkspacesByWorkspaceIdTrustPath = z.object({
    workspace_id: z.string().regex(/^wd_[a-z0-9._-]+_[0-9a-f]{12}$/)
});

export const zPostApiV1WorkspacesByWorkspaceIdTrustPath = z.object({
    workspace_id: z.string().regex(/^wd_[a-z0-9._-]+_[0-9a-f]{12}$/)
});

export const zPostApiV1WorkspacesByWorkspaceIdUntrustPath = z.object({
    workspace_id: z.string().regex(/^wd_[a-z0-9._-]+_[0-9a-f]{12}$/)
});
