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

import type { Client, Options as Options2, TDataShape } from './client';
import { client } from './client.gen';
import type { CallbackGithubData, CallbackGithubErrors, CancelRunData, CancelRunErrors, CancelRunResponses, CancelRuntimeDeployTaskData, CancelRuntimeDeployTaskErrors, CancelRuntimeDeployTaskResponses, CreateUserData, CreateUserErrors, CreateUserResponses, DeleteProjectData, DeleteProjectErrors, DeleteProjectMemberData, DeleteProjectMemberErrors, DeleteProjectMemberResponses, DeleteProjectRepositoryData, DeleteProjectRepositoryErrors, DeleteProjectRepositoryResponses, DeleteProjectResponses, DeleteRunNamespaceData, DeleteRunNamespaceErrors, DeleteRunNamespaceResponses, DeleteUserData, DeleteUserErrors, DeleteUserResponses, ExecuteNextStepActionData, ExecuteNextStepActionErrors, ExecuteNextStepActionResponses, GetMeData, GetMeErrors, GetMeResponses, GetMissionControlCommandData, GetMissionControlCommandErrors, GetMissionControlCommandResponses, GetMissionControlNodeData, GetMissionControlNodeErrors, GetMissionControlNodeResponses, GetMissionControlWorkspaceData, GetMissionControlWorkspaceErrors, GetMissionControlWorkspaceResponses, GetProjectData, GetProjectErrors, GetProjectGitHubTokensData, GetProjectGitHubTokensErrors, GetProjectGitHubTokensResponses, GetProjectResponses, GetRunData, GetRunErrors, GetRunLogsData, GetRunLogsErrors, GetRunLogsResponses, GetRunResponses, GetRuntimeDeployTaskData, GetRuntimeDeployTaskErrors, GetRuntimeDeployTaskResponses, GetSystemSettingData, GetSystemSettingErrors, GetSystemSettingResponses, ImportDocsetData, ImportDocsetErrors, ImportDocsetResponses, IngestGithubWebhookData, IngestGithubWebhookErrors, IngestGithubWebhookResponses, ListDocsetGroupsData, ListDocsetGroupsErrors, ListDocsetGroupsResponses, ListMissionControlNodeActivityData, ListMissionControlNodeActivityErrors, ListMissionControlNodeActivityResponses, ListPendingApprovalsData, ListPendingApprovalsErrors, ListPendingApprovalsResponses, ListProjectMembersData, ListProjectMembersErrors, ListProjectMembersResponses, ListProjectRepositoriesData, ListProjectRepositoriesErrors, ListProjectRepositoriesResponses, ListProjectsData, ListProjectsErrors, ListProjectsResponses, ListRunEventsData, ListRunEventsErrors, ListRunEventsResponses, ListRunLearningFeedbackData, ListRunLearningFeedbackErrors, ListRunLearningFeedbackResponses, ListRuntimeErrorsData, ListRuntimeErrorsErrors, ListRuntimeErrorsResponses, ListRunWaitsData, ListRunWaitsErrors, ListRunWaitsResponses, ListSystemSettingsData, ListSystemSettingsErrors, ListSystemSettingsResponses, ListUsersData, ListUsersErrors, ListUsersResponses, LoginGithubData, LoginGithubErrors, LogoutData, LogoutErrors, LogoutResponses, MarkRuntimeErrorViewedData, MarkRuntimeErrorViewedErrors, MarkRuntimeErrorViewedResponses, McpApproverCallbackData, McpApproverCallbackErrors, McpApproverCallbackResponses, McpExecutorCallbackData, McpExecutorCallbackErrors, McpExecutorCallbackResponses, McpInteractionCallbackData, McpInteractionCallbackErrors, McpInteractionCallbackResponses, MissionControlRealtimeData, MissionControlRealtimeErrors, MissionControlRealtimeResponses, PreviewMissionControlLaunchData, PreviewMissionControlLaunchErrors, PreviewMissionControlLaunchResponses, PreviewNextStepActionData, PreviewNextStepActionErrors, PreviewNextStepActionResponses, ResetSystemSettingData, ResetSystemSettingErrors, ResetSystemSettingResponses, ResolveApprovalDecisionData, ResolveApprovalDecisionErrors, ResolveApprovalDecisionResponses, RunRealtimeData, RunRealtimeErrors, RunRealtimeResponses, RunRepositoryPreflightData, RunRepositoryPreflightErrors, RunRepositoryPreflightResponses, RunsRealtimeData, RunsRealtimeErrors, RunsRealtimeResponses, RuntimeDeployTasksRealtimeData, RuntimeDeployTasksRealtimeErrors, RuntimeDeployTasksRealtimeResponses, SetProjectMemberLearningModeOverrideData, SetProjectMemberLearningModeOverrideErrors, SetProjectMemberLearningModeOverrideResponses, StopRuntimeDeployTaskData, StopRuntimeDeployTaskErrors, StopRuntimeDeployTaskResponses, SubmitMissionControlCommandData, SubmitMissionControlCommandErrors, SubmitMissionControlCommandResponses, SyncDocsetData, SyncDocsetErrors, SyncDocsetResponses, SystemSettingsRealtimeData, SystemSettingsRealtimeErrors, SystemSettingsRealtimeResponses, UpdateSystemSettingBooleanData, UpdateSystemSettingBooleanErrors, UpdateSystemSettingBooleanResponses, UpsertProjectData, UpsertProjectErrors, UpsertProjectGitHubTokensData, UpsertProjectGitHubTokensErrors, UpsertProjectGitHubTokensResponses, UpsertProjectMemberData, UpsertProjectMemberErrors, UpsertProjectMemberResponses, UpsertProjectRepositoryData, UpsertProjectRepositoryErrors, UpsertProjectRepositoryResponses, UpsertProjectResponses, UpsertRepositoryBotParamsData, UpsertRepositoryBotParamsErrors, UpsertRepositoryBotParamsResponses } from './types.gen';

export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<TData, ThrowOnError> & {
    /**
     * You can provide a client instance returned by `createClient()` instead of
     * individual options. This might be also useful if you want to implement a
     * custom client.
     */
    client?: Client;
    /**
     * You can pass arbitrary values through the `meta` object. This can be
     * used to access values that aren't defined as part of the SDK function.
     */
    meta?: Record<string, unknown>;
};

/**
 * Ingest GitHub webhook delivery
 */
export const ingestGithubWebhook = <ThrowOnError extends boolean = false>(options: Options<IngestGithubWebhookData, ThrowOnError>) => (options.client ?? client).post<IngestGithubWebhookResponses, IngestGithubWebhookErrors, ThrowOnError>({
    responseType: 'json',
    url: '/api/v1/webhooks/github',
    ...options,
    headers: {
        'Content-Type': 'application/json',
        ...options.headers
    }
});

/**
 * Resolve one MCP approval request from external approver callback
 */
export const mcpApproverCallback = <ThrowOnError extends boolean = false>(options: Options<McpApproverCallbackData, ThrowOnError>) => (options.client ?? client).post<McpApproverCallbackResponses, McpApproverCallbackErrors, ThrowOnError>({
    responseType: 'json',
    url: '/api/v1/mcp/approver/callback',
    ...options,
    headers: {
        'Content-Type': 'application/json',
        ...options.headers
    }
});

/**
 * Resolve one MCP approval request from external executor callback
 */
export const mcpExecutorCallback = <ThrowOnError extends boolean = false>(options: Options<McpExecutorCallbackData, ThrowOnError>) => (options.client ?? client).post<McpExecutorCallbackResponses, McpExecutorCallbackErrors, ThrowOnError>({
    responseType: 'json',
    url: '/api/v1/mcp/executor/callback',
    ...options,
    headers: {
        'Content-Type': 'application/json',
        ...options.headers
    }
});

/**
 * Apply one built-in MCP user interaction callback
 */
export const mcpInteractionCallback = <ThrowOnError extends boolean = false>(options: Options<McpInteractionCallbackData, ThrowOnError>) => (options.client ?? client).post<McpInteractionCallbackResponses, McpInteractionCallbackErrors, ThrowOnError>({
    responseType: 'json',
    url: '/api/v1/mcp/interactions/callback',
    ...options,
    headers: {
        'Content-Type': 'application/json',
        ...options.headers
    }
});

/**
 * Start GitHub OAuth login
 */
export const loginGithub = <ThrowOnError extends boolean = false>(options?: Options<LoginGithubData, ThrowOnError>) => (options?.client ?? client).get<unknown, LoginGithubErrors, ThrowOnError>({ url: '/api/v1/auth/github/login', ...options });

/**
 * Complete GitHub OAuth callback and set auth cookie
 */
export const callbackGithub = <ThrowOnError extends boolean = false>(options: Options<CallbackGithubData, ThrowOnError>) => (options.client ?? client).get<unknown, CallbackGithubErrors, ThrowOnError>({ url: '/api/v1/auth/github/callback', ...options });

/**
 * Logout current staff user
 */
export const logout = <ThrowOnError extends boolean = false>(options?: Options<LogoutData, ThrowOnError>) => (options?.client ?? client).post<LogoutResponses, LogoutErrors, ThrowOnError>({ url: '/api/v1/auth/logout', ...options });

/**
 * Get current authenticated staff principal
 */
export const getMe = <ThrowOnError extends boolean = false>(options?: Options<GetMeData, ThrowOnError>) => (options?.client ?? client).get<GetMeResponses, GetMeErrors, ThrowOnError>({
    responseType: 'json',
    url: '/api/v1/auth/me',
    ...options
});

/**
 * List projects
 */
export const listProjects = <ThrowOnError extends boolean = false>(options?: Options<ListProjectsData, ThrowOnError>) => (options?.client ?? client).get<ListProjectsResponses, ListProjectsErrors, ThrowOnError>({
    responseType: 'json',
    url: '/api/v1/staff/projects',
    ...options
});

/**
 * Create or update a project by slug
 */
export const upsertProject = <ThrowOnError extends boolean = false>(options: Options<UpsertProjectData, ThrowOnError>) => (options.client ?? client).post<UpsertProjectResponses, UpsertProjectErrors, ThrowOnError>({
    responseType: 'json',
    url: '/api/v1/staff/projects',
    ...options,
    headers: {
        'Content-Type': 'application/json',
        ...options.headers
    }
});

/**
 * Delete project by id
 */
export const deleteProject = <ThrowOnError extends boolean = false>(options: Options<DeleteProjectData, ThrowOnError>) => (options.client ?? client).delete<DeleteProjectResponses, DeleteProjectErrors, ThrowOnError>({ url: '/api/v1/staff/projects/{project_id}', ...options });

/**
 * Get project by id
 */
export const getProject = <ThrowOnError extends boolean = false>(options: Options<GetProjectData, ThrowOnError>) => (options.client ?? client).get<GetProjectResponses, GetProjectErrors, ThrowOnError>({
    responseType: 'json',
    url: '/api/v1/staff/projects/{project_id}',
    ...options
});

/**
 * List wait queue runs
 */
export const listRunWaits = <ThrowOnError extends boolean = false>(options?: Options<ListRunWaitsData, ThrowOnError>) => (options?.client ?? client).get<ListRunWaitsResponses, ListRunWaitsErrors, ThrowOnError>({
    responseType: 'json',
    url: '/api/v1/staff/runs/waits',
    ...options
});

/**
 * Open realtime runs list stream (WebSocket upgrade)
 */
export const runsRealtime = <ThrowOnError extends boolean = false>(options?: Options<RunsRealtimeData, ThrowOnError>) => (options?.client ?? client).get<RunsRealtimeResponses, RunsRealtimeErrors, ThrowOnError>({ url: '/api/v1/staff/runs/realtime', ...options });

/**
 * List pending approval requests
 */
export const listPendingApprovals = <ThrowOnError extends boolean = false>(options?: Options<ListPendingApprovalsData, ThrowOnError>) => (options?.client ?? client).get<ListPendingApprovalsResponses, ListPendingApprovalsErrors, ThrowOnError>({
    responseType: 'json',
    url: '/api/v1/staff/approvals',
    ...options
});

/**
 * Resolve one approval request (approve/deny/expire/fail)
 */
export const resolveApprovalDecision = <ThrowOnError extends boolean = false>(options: Options<ResolveApprovalDecisionData, ThrowOnError>) => (options.client ?? client).post<ResolveApprovalDecisionResponses, ResolveApprovalDecisionErrors, ThrowOnError>({
    responseType: 'json',
    url: '/api/v1/staff/approvals/{approval_request_id}/decision',
    ...options,
    headers: {
        'Content-Type': 'application/json',
        ...options.headers
    }
});

/**
 * List platform system settings
 */
export const listSystemSettings = <ThrowOnError extends boolean = false>(options?: Options<ListSystemSettingsData, ThrowOnError>) => (options?.client ?? client).get<ListSystemSettingsResponses, ListSystemSettingsErrors, ThrowOnError>({
    responseType: 'json',
    url: '/api/v1/staff/system-settings',
    ...options
});

/**
 * Open system settings realtime stream (WebSocket upgrade)
 */
export const systemSettingsRealtime = <ThrowOnError extends boolean = false>(options?: Options<SystemSettingsRealtimeData, ThrowOnError>) => (options?.client ?? client).get<SystemSettingsRealtimeResponses, SystemSettingsRealtimeErrors, ThrowOnError>({ url: '/api/v1/staff/system-settings/realtime', ...options });

/**
 * Get platform system setting by key
 */
export const getSystemSetting = <ThrowOnError extends boolean = false>(options: Options<GetSystemSettingData, ThrowOnError>) => (options.client ?? client).get<GetSystemSettingResponses, GetSystemSettingErrors, ThrowOnError>({
    responseType: 'json',
    url: '/api/v1/staff/system-settings/{setting_key}',
    ...options
});

/**
 * Update boolean platform system setting
 */
export const updateSystemSettingBoolean = <ThrowOnError extends boolean = false>(options: Options<UpdateSystemSettingBooleanData, ThrowOnError>) => (options.client ?? client).put<UpdateSystemSettingBooleanResponses, UpdateSystemSettingBooleanErrors, ThrowOnError>({
    responseType: 'json',
    url: '/api/v1/staff/system-settings/{setting_key}',
    ...options,
    headers: {
        'Content-Type': 'application/json',
        ...options.headers
    }
});

/**
 * Reset platform system setting to catalog default
 */
export const resetSystemSetting = <ThrowOnError extends boolean = false>(options: Options<ResetSystemSettingData, ThrowOnError>) => (options.client ?? client).post<ResetSystemSettingResponses, ResetSystemSettingErrors, ThrowOnError>({
    responseType: 'json',
    url: '/api/v1/staff/system-settings/{setting_key}/reset',
    ...options
});

/**
 * Get run by id
 */
export const getRun = <ThrowOnError extends boolean = false>(options: Options<GetRunData, ThrowOnError>) => (options.client ?? client).get<GetRunResponses, GetRunErrors, ThrowOnError>({
    responseType: 'json',
    url: '/api/v1/staff/runs/{run_id}',
    ...options
});

/**
 * Cancel run and stop active runtime artifacts
 */
export const cancelRun = <ThrowOnError extends boolean = false>(options: Options<CancelRunData, ThrowOnError>) => (options.client ?? client).post<CancelRunResponses, CancelRunErrors, ThrowOnError>({
    responseType: 'json',
    url: '/api/v1/staff/runs/{run_id}/cancel',
    ...options,
    headers: {
        'Content-Type': 'application/json',
        ...options.headers
    }
});

/**
 * Force delete run namespace
 */
export const deleteRunNamespace = <ThrowOnError extends boolean = false>(options: Options<DeleteRunNamespaceData, ThrowOnError>) => (options.client ?? client).delete<DeleteRunNamespaceResponses, DeleteRunNamespaceErrors, ThrowOnError>({
    responseType: 'json',
    url: '/api/v1/staff/runs/{run_id}/namespace',
    ...options
});

/**
 * List run flow events
 */
export const listRunEvents = <ThrowOnError extends boolean = false>(options: Options<ListRunEventsData, ThrowOnError>) => (options.client ?? client).get<ListRunEventsResponses, ListRunEventsErrors, ThrowOnError>({
    responseType: 'json',
    url: '/api/v1/staff/runs/{run_id}/events',
    ...options
});

/**
 * Open realtime run stream (WebSocket upgrade)
 */
export const runRealtime = <ThrowOnError extends boolean = false>(options: Options<RunRealtimeData, ThrowOnError>) => (options.client ?? client).get<RunRealtimeResponses, RunRealtimeErrors, ThrowOnError>({
    responseType: 'json',
    url: '/api/v1/staff/runs/{run_id}/realtime',
    ...options
});

/**
 * Get run logs snapshot with tail lines
 */
export const getRunLogs = <ThrowOnError extends boolean = false>(options: Options<GetRunLogsData, ThrowOnError>) => (options.client ?? client).get<GetRunLogsResponses, GetRunLogsErrors, ThrowOnError>({
    responseType: 'json',
    url: '/api/v1/staff/runs/{run_id}/logs',
    ...options
});

/**
 * List run learning feedback
 */
export const listRunLearningFeedback = <ThrowOnError extends boolean = false>(options: Options<ListRunLearningFeedbackData, ThrowOnError>) => (options.client ?? client).get<ListRunLearningFeedbackResponses, ListRunLearningFeedbackErrors, ThrowOnError>({
    responseType: 'json',
    url: '/api/v1/staff/runs/{run_id}/learning-feedback',
    ...options
});

/**
 * Open realtime runtime deploy tasks list stream (WebSocket upgrade)
 */
export const runtimeDeployTasksRealtime = <ThrowOnError extends boolean = false>(options?: Options<RuntimeDeployTasksRealtimeData, ThrowOnError>) => (options?.client ?? client).get<RuntimeDeployTasksRealtimeResponses, RuntimeDeployTasksRealtimeErrors, ThrowOnError>({ url: '/api/v1/staff/runtime-deploy/tasks/realtime', ...options });

/**
 * Get runtime deploy task details
 */
export const getRuntimeDeployTask = <ThrowOnError extends boolean = false>(options: Options<GetRuntimeDeployTaskData, ThrowOnError>) => (options.client ?? client).get<GetRuntimeDeployTaskResponses, GetRuntimeDeployTaskErrors, ThrowOnError>({
    responseType: 'json',
    url: '/api/v1/staff/runtime-deploy/tasks/{run_id}',
    ...options
});

/**
 * Cancel runtime deploy task
 */
export const cancelRuntimeDeployTask = <ThrowOnError extends boolean = false>(options: Options<CancelRuntimeDeployTaskData, ThrowOnError>) => (options.client ?? client).post<CancelRuntimeDeployTaskResponses, CancelRuntimeDeployTaskErrors, ThrowOnError>({
    responseType: 'json',
    url: '/api/v1/staff/runtime-deploy/tasks/{run_id}/cancel',
    ...options,
    headers: {
        'Content-Type': 'application/json',
        ...options.headers
    }
});

/**
 * Stop runtime deploy task
 */
export const stopRuntimeDeployTask = <ThrowOnError extends boolean = false>(options: Options<StopRuntimeDeployTaskData, ThrowOnError>) => (options.client ?? client).post<StopRuntimeDeployTaskResponses, StopRuntimeDeployTaskErrors, ThrowOnError>({
    responseType: 'json',
    url: '/api/v1/staff/runtime-deploy/tasks/{run_id}/stop',
    ...options,
    headers: {
        'Content-Type': 'application/json',
        ...options.headers
    }
});

/**
 * List runtime error journal entries
 */
export const listRuntimeErrors = <ThrowOnError extends boolean = false>(options?: Options<ListRuntimeErrorsData, ThrowOnError>) => (options?.client ?? client).get<ListRuntimeErrorsResponses, ListRuntimeErrorsErrors, ThrowOnError>({
    responseType: 'json',
    url: '/api/v1/staff/runtime-errors',
    ...options
});

/**
 * Mark runtime error as viewed
 */
export const markRuntimeErrorViewed = <ThrowOnError extends boolean = false>(options: Options<MarkRuntimeErrorViewedData, ThrowOnError>) => (options.client ?? client).post<MarkRuntimeErrorViewedResponses, MarkRuntimeErrorViewedErrors, ThrowOnError>({
    responseType: 'json',
    url: '/api/v1/staff/runtime-errors/{runtime_error_id}/viewed',
    ...options
});

/**
 * List users
 */
export const listUsers = <ThrowOnError extends boolean = false>(options?: Options<ListUsersData, ThrowOnError>) => (options?.client ?? client).get<ListUsersResponses, ListUsersErrors, ThrowOnError>({
    responseType: 'json',
    url: '/api/v1/staff/users',
    ...options
});

/**
 * Create allowed user
 */
export const createUser = <ThrowOnError extends boolean = false>(options: Options<CreateUserData, ThrowOnError>) => (options.client ?? client).post<CreateUserResponses, CreateUserErrors, ThrowOnError>({
    responseType: 'json',
    url: '/api/v1/staff/users',
    ...options,
    headers: {
        'Content-Type': 'application/json',
        ...options.headers
    }
});

/**
 * Delete user
 */
export const deleteUser = <ThrowOnError extends boolean = false>(options: Options<DeleteUserData, ThrowOnError>) => (options.client ?? client).delete<DeleteUserResponses, DeleteUserErrors, ThrowOnError>({ url: '/api/v1/staff/users/{user_id}', ...options });

/**
 * List project members
 */
export const listProjectMembers = <ThrowOnError extends boolean = false>(options: Options<ListProjectMembersData, ThrowOnError>) => (options.client ?? client).get<ListProjectMembersResponses, ListProjectMembersErrors, ThrowOnError>({
    responseType: 'json',
    url: '/api/v1/staff/projects/{project_id}/members',
    ...options
});

/**
 * Add or update project member
 */
export const upsertProjectMember = <ThrowOnError extends boolean = false>(options: Options<UpsertProjectMemberData, ThrowOnError>) => (options.client ?? client).post<UpsertProjectMemberResponses, UpsertProjectMemberErrors, ThrowOnError>({
    url: '/api/v1/staff/projects/{project_id}/members',
    ...options,
    headers: {
        'Content-Type': 'application/json',
        ...options.headers
    }
});

/**
 * Delete project member
 */
export const deleteProjectMember = <ThrowOnError extends boolean = false>(options: Options<DeleteProjectMemberData, ThrowOnError>) => (options.client ?? client).delete<DeleteProjectMemberResponses, DeleteProjectMemberErrors, ThrowOnError>({ url: '/api/v1/staff/projects/{project_id}/members/{user_id}', ...options });

/**
 * Set project member learning mode override
 */
export const setProjectMemberLearningModeOverride = <ThrowOnError extends boolean = false>(options: Options<SetProjectMemberLearningModeOverrideData, ThrowOnError>) => (options.client ?? client).put<SetProjectMemberLearningModeOverrideResponses, SetProjectMemberLearningModeOverrideErrors, ThrowOnError>({
    url: '/api/v1/staff/projects/{project_id}/members/{user_id}/learning-mode',
    ...options,
    headers: {
        'Content-Type': 'application/json',
        ...options.headers
    }
});

/**
 * List project repositories
 */
export const listProjectRepositories = <ThrowOnError extends boolean = false>(options: Options<ListProjectRepositoriesData, ThrowOnError>) => (options.client ?? client).get<ListProjectRepositoriesResponses, ListProjectRepositoriesErrors, ThrowOnError>({
    responseType: 'json',
    url: '/api/v1/staff/projects/{project_id}/repositories',
    ...options
});

/**
 * Add or update project repository binding
 */
export const upsertProjectRepository = <ThrowOnError extends boolean = false>(options: Options<UpsertProjectRepositoryData, ThrowOnError>) => (options.client ?? client).post<UpsertProjectRepositoryResponses, UpsertProjectRepositoryErrors, ThrowOnError>({
    responseType: 'json',
    url: '/api/v1/staff/projects/{project_id}/repositories',
    ...options,
    headers: {
        'Content-Type': 'application/json',
        ...options.headers
    }
});

/**
 * Delete project repository binding
 */
export const deleteProjectRepository = <ThrowOnError extends boolean = false>(options: Options<DeleteProjectRepositoryData, ThrowOnError>) => (options.client ?? client).delete<DeleteProjectRepositoryResponses, DeleteProjectRepositoryErrors, ThrowOnError>({ url: '/api/v1/staff/projects/{project_id}/repositories/{repository_id}', ...options });

/**
 * Update repository bot parameters (token/login/email)
 */
export const upsertRepositoryBotParams = <ThrowOnError extends boolean = false>(options: Options<UpsertRepositoryBotParamsData, ThrowOnError>) => (options.client ?? client).put<UpsertRepositoryBotParamsResponses, UpsertRepositoryBotParamsErrors, ThrowOnError>({
    url: '/api/v1/staff/projects/{project_id}/repositories/{repository_id}/bot-params',
    ...options,
    headers: {
        'Content-Type': 'application/json',
        ...options.headers
    }
});

/**
 * Run repository onboarding preflight
 */
export const runRepositoryPreflight = <ThrowOnError extends boolean = false>(options: Options<RunRepositoryPreflightData, ThrowOnError>) => (options.client ?? client).post<RunRepositoryPreflightResponses, RunRepositoryPreflightErrors, ThrowOnError>({
    responseType: 'json',
    url: '/api/v1/staff/projects/{project_id}/repositories/{repository_id}/preflight',
    ...options
});

/**
 * Get project-scoped GitHub tokens status
 */
export const getProjectGitHubTokens = <ThrowOnError extends boolean = false>(options: Options<GetProjectGitHubTokensData, ThrowOnError>) => (options.client ?? client).get<GetProjectGitHubTokensResponses, GetProjectGitHubTokensErrors, ThrowOnError>({
    responseType: 'json',
    url: '/api/v1/staff/projects/{project_id}/github-tokens',
    ...options
});

/**
 * Upsert project-scoped GitHub tokens
 */
export const upsertProjectGitHubTokens = <ThrowOnError extends boolean = false>(options: Options<UpsertProjectGitHubTokensData, ThrowOnError>) => (options.client ?? client).put<UpsertProjectGitHubTokensResponses, UpsertProjectGitHubTokensErrors, ThrowOnError>({
    url: '/api/v1/staff/projects/{project_id}/github-tokens',
    ...options,
    headers: {
        'Content-Type': 'application/json',
        ...options.headers
    }
});

/**
 * Preview one GitHub next-step action
 */
export const previewNextStepAction = <ThrowOnError extends boolean = false>(options: Options<PreviewNextStepActionData, ThrowOnError>) => (options.client ?? client).post<PreviewNextStepActionResponses, PreviewNextStepActionErrors, ThrowOnError>({
    responseType: 'json',
    url: '/api/v1/staff/github/next-step-actions/preview',
    ...options,
    headers: {
        'Content-Type': 'application/json',
        ...options.headers
    }
});

/**
 * Execute one GitHub next-step action
 */
export const executeNextStepAction = <ThrowOnError extends boolean = false>(options: Options<ExecuteNextStepActionData, ThrowOnError>) => (options.client ?? client).post<ExecuteNextStepActionResponses, ExecuteNextStepActionErrors, ThrowOnError>({
    responseType: 'json',
    url: '/api/v1/staff/github/next-step-actions/execute',
    ...options,
    headers: {
        'Content-Type': 'application/json',
        ...options.headers
    }
});

/**
 * List docset groups (manifest v1)
 */
export const listDocsetGroups = <ThrowOnError extends boolean = false>(options?: Options<ListDocsetGroupsData, ThrowOnError>) => (options?.client ?? client).get<ListDocsetGroupsResponses, ListDocsetGroupsErrors, ThrowOnError>({
    responseType: 'json',
    url: '/api/v1/staff/docset/groups',
    ...options
});

/**
 * Import docset into project repository (PR-based)
 */
export const importDocset = <ThrowOnError extends boolean = false>(options: Options<ImportDocsetData, ThrowOnError>) => (options.client ?? client).post<ImportDocsetResponses, ImportDocsetErrors, ThrowOnError>({
    responseType: 'json',
    url: '/api/v1/staff/projects/{project_id}/docset/import',
    ...options,
    headers: {
        'Content-Type': 'application/json',
        ...options.headers
    }
});

/**
 * Safe sync docset into project repository (PR-based)
 */
export const syncDocset = <ThrowOnError extends boolean = false>(options: Options<SyncDocsetData, ThrowOnError>) => (options.client ?? client).post<SyncDocsetResponses, SyncDocsetErrors, ThrowOnError>({
    responseType: 'json',
    url: '/api/v1/staff/projects/{project_id}/docset/sync',
    ...options,
    headers: {
        'Content-Type': 'application/json',
        ...options.headers
    }
});

/**
 * Get Mission Control workspace snapshot
 */
export const getMissionControlWorkspace = <ThrowOnError extends boolean = false>(options?: Options<GetMissionControlWorkspaceData, ThrowOnError>) => (options?.client ?? client).get<GetMissionControlWorkspaceResponses, GetMissionControlWorkspaceErrors, ThrowOnError>({
    responseType: 'json',
    url: '/api/v1/staff/mission-control/workspace',
    ...options
});

/**
 * Get Mission Control node details
 */
export const getMissionControlNode = <ThrowOnError extends boolean = false>(options: Options<GetMissionControlNodeData, ThrowOnError>) => (options.client ?? client).get<GetMissionControlNodeResponses, GetMissionControlNodeErrors, ThrowOnError>({
    responseType: 'json',
    url: '/api/v1/staff/mission-control/nodes/{node_kind}/{node_public_id}',
    ...options
});

/**
 * List Mission Control node activity
 */
export const listMissionControlNodeActivity = <ThrowOnError extends boolean = false>(options: Options<ListMissionControlNodeActivityData, ThrowOnError>) => (options.client ?? client).get<ListMissionControlNodeActivityResponses, ListMissionControlNodeActivityErrors, ThrowOnError>({
    responseType: 'json',
    url: '/api/v1/staff/mission-control/nodes/{node_kind}/{node_public_id}/activity',
    ...options
});

/**
 * Preview Mission Control launch
 */
export const previewMissionControlLaunch = <ThrowOnError extends boolean = false>(options: Options<PreviewMissionControlLaunchData, ThrowOnError>) => (options.client ?? client).post<PreviewMissionControlLaunchResponses, PreviewMissionControlLaunchErrors, ThrowOnError>({
    responseType: 'json',
    url: '/api/v1/staff/mission-control/launch-preview',
    ...options,
    headers: {
        'Content-Type': 'application/json',
        ...options.headers
    }
});

/**
 * Submit Mission Control command
 */
export const submitMissionControlCommand = <ThrowOnError extends boolean = false>(options: Options<SubmitMissionControlCommandData, ThrowOnError>) => (options.client ?? client).post<SubmitMissionControlCommandResponses, SubmitMissionControlCommandErrors, ThrowOnError>({
    responseType: 'json',
    url: '/api/v1/staff/mission-control/commands',
    ...options,
    headers: {
        'Content-Type': 'application/json',
        ...options.headers
    }
});

/**
 * Get Mission Control command status
 */
export const getMissionControlCommand = <ThrowOnError extends boolean = false>(options: Options<GetMissionControlCommandData, ThrowOnError>) => (options.client ?? client).get<GetMissionControlCommandResponses, GetMissionControlCommandErrors, ThrowOnError>({
    responseType: 'json',
    url: '/api/v1/staff/mission-control/commands/{command_id}',
    ...options
});

/**
 * Open Mission Control realtime stream (WebSocket upgrade)
 */
export const missionControlRealtime = <ThrowOnError extends boolean = false>(options: Options<MissionControlRealtimeData, ThrowOnError>) => (options.client ?? client).get<MissionControlRealtimeResponses, MissionControlRealtimeErrors, ThrowOnError>({ url: '/api/v1/staff/mission-control/realtime', ...options });
