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

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

export type PostAuthWebsocketTicketData = {
    body: {
        audience: string;
    };
    path?: never;
    query?: never;
    url: '/auth/websocket-ticket';
};

export type PostAuthWebsocketTicketResponses = {
    /**
     * Response for status 200
     */
    200: {
        ticket: string;
        expiresAt: number;
    };
};

export type PostAuthWebsocketTicketResponse = PostAuthWebsocketTicketResponses[keyof PostAuthWebsocketTicketResponses];

export type PostAuthBrowserSessionData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/auth/browser-session';
};

export type PostAuthBrowserSessionResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type PostAuthBrowserSessionResponse = PostAuthBrowserSessionResponses[keyof PostAuthBrowserSessionResponses];

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

export type GetHealthResponses = {
    /**
     * Response for status 200
     */
    200: {
        status: 'ok';
        uptime: number;
        memory: {
            heapUsed: number;
            heapTotal: number;
            rss: number;
            external: number;
        };
        cpu: {
            percent: number | null;
            userMicros: number;
            systemMicros: number;
            sampleMs: number | null;
            usedMicros: number | null;
            windowReady: boolean;
        };
        timestamp: number;
    };
};

export type GetHealthResponse = GetHealthResponses[keyof GetHealthResponses];

export type GetPreferencesAppData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/preferences/app';
};

export type GetPreferencesAppResponses = {
    /**
     * Response for status 200
     */
    200: {
        featureFlags: {
            multiWorkspacePoc: boolean;
            localAuthForDangerousActions?: boolean;
            continueBlockedCodexGoals?: boolean;
            blockCodexAppServerLogInserts?: boolean;
            codexCliCompatibleIdentity?: boolean;
            nativeProviderSkillProjection?: boolean;
            turnCheckpoints?: boolean;
            threadHandoffs?: boolean;
        };
        worktreeCleanup?: {
            maxWorktrees: number;
            maxTotalSizeGb: number;
        };
    };
};

export type GetPreferencesAppResponse = GetPreferencesAppResponses[keyof GetPreferencesAppResponses];

export type PutPreferencesAppData = {
    body: {
        featureFlags: {
            multiWorkspacePoc: boolean;
            localAuthForDangerousActions?: boolean;
            continueBlockedCodexGoals?: boolean;
            blockCodexAppServerLogInserts?: boolean;
            codexCliCompatibleIdentity?: boolean;
            nativeProviderSkillProjection?: boolean;
            turnCheckpoints?: boolean;
            threadHandoffs?: boolean;
        };
        worktreeCleanup?: {
            maxWorktrees: number;
            maxTotalSizeGb: number;
        };
    };
    path?: never;
    query?: never;
    url: '/preferences/app';
};

export type PutPreferencesAppResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type PutPreferencesAppResponse = PutPreferencesAppResponses[keyof PutPreferencesAppResponses];

export type GetPreferencesChatData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/preferences/chat';
};

export type GetPreferencesChatResponses = {
    /**
     * Response for status 200
     */
    200: {
        modelId: string | null;
        configSelections: {
            [key: string]: unknown;
        };
        continuationBehavior: 'queue' | 'steer';
        titleGeneration: {
            providerTargetId: string | null;
            modelId: string | null;
            thinkingEffort: 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';
        };
    };
};

export type GetPreferencesChatResponse = GetPreferencesChatResponses[keyof GetPreferencesChatResponses];

export type PutPreferencesChatData = {
    body: {
        modelId: string | null;
        configSelections: {
            [key: string]: unknown;
        };
        continuationBehavior?: 'queue' | 'steer';
        titleGeneration?: {
            providerTargetId: string | null;
            modelId: string | null;
            thinkingEffort: 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';
        };
    };
    path?: never;
    query?: never;
    url: '/preferences/chat';
};

export type PutPreferencesChatResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type PutPreferencesChatResponse = PutPreferencesChatResponses[keyof PutPreferencesChatResponses];

export type GetPreferencesKeybindingsData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/preferences/keybindings';
};

export type GetPreferencesKeybindingsResponses = {
    /**
     * Response for status 200
     */
    200: {
        configPath: string;
        rules: Array<{
            command: string;
            key: string;
            when?: string;
        }>;
        errors: Array<string>;
    };
};

export type GetPreferencesKeybindingsResponse = GetPreferencesKeybindingsResponses[keyof GetPreferencesKeybindingsResponses];

export type GetPreferencesCodexData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/preferences/codex';
};

export type GetPreferencesCodexResponses = {
    /**
     * Response for status 200
     */
    200: {
        useCradleUserAgent: boolean;
    };
};

export type GetPreferencesCodexResponse = GetPreferencesCodexResponses[keyof GetPreferencesCodexResponses];

export type PutPreferencesCodexData = {
    body: {
        useCradleUserAgent: boolean;
    };
    path?: never;
    query?: never;
    url: '/preferences/codex';
};

export type PutPreferencesCodexResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type PutPreferencesCodexResponse = PutPreferencesCodexResponses[keyof PutPreferencesCodexResponses];

export type GetPreferencesDesktopData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/preferences/desktop';
};

export type GetPreferencesDesktopResponses = {
    /**
     * Response for status 200
     */
    200: {
        requireDoubleCommandQToQuit: boolean;
        appshotHotkeyEnabled: boolean;
        appshotHotkeyTrigger: 'DoubleCommand' | 'DoubleOption' | 'DoubleShift';
        autoCheckForUpdates: boolean;
        autoDownloadUpdates: boolean;
        lastSeenChangelogVersion: string | null;
        externalTerminalApp: string | null;
    };
};

export type GetPreferencesDesktopResponse = GetPreferencesDesktopResponses[keyof GetPreferencesDesktopResponses];

export type PutPreferencesDesktopData = {
    body: {
        requireDoubleCommandQToQuit: boolean;
        appshotHotkeyEnabled: boolean;
        appshotHotkeyTrigger: 'DoubleCommand' | 'DoubleOption' | 'DoubleShift';
        autoCheckForUpdates: boolean;
        autoDownloadUpdates: boolean;
        lastSeenChangelogVersion: string | null;
        externalTerminalApp: string | null;
    };
    path?: never;
    query?: never;
    url: '/preferences/desktop';
};

export type PutPreferencesDesktopResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type PutPreferencesDesktopResponse = PutPreferencesDesktopResponses[keyof PutPreferencesDesktopResponses];

export type GetPreferencesNetworkData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/preferences/network';
};

export type GetPreferencesNetworkResponses = {
    /**
     * Response for status 200
     */
    200: {
        proxyEnabled: boolean;
        proxyMode: 'system' | 'custom' | 'environment';
        customProxyUrl: string | null;
        inbound?: {
            serverAccessMode: 'local' | 'network';
            managedRelayAccessMode: 'local' | 'network';
            managedRelayPublicUrl: string | null;
        };
    };
};

export type GetPreferencesNetworkResponse = GetPreferencesNetworkResponses[keyof GetPreferencesNetworkResponses];

export type PutPreferencesNetworkData = {
    body: {
        proxyEnabled: boolean;
        proxyMode: 'system' | 'custom' | 'environment';
        customProxyUrl: string | null;
        inbound?: {
            serverAccessMode: 'local' | 'network';
            managedRelayAccessMode: 'local' | 'network';
            managedRelayPublicUrl: string | null;
        };
    };
    path?: never;
    query?: never;
    url: '/preferences/network';
};

export type PutPreferencesNetworkResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type PutPreferencesNetworkResponse = PutPreferencesNetworkResponses[keyof PutPreferencesNetworkResponses];

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

export type GetPreferencesNetworkStatusResponses = {
    /**
     * Response for status 200
     */
    200: {
        enabled: boolean;
        mode: 'system' | 'custom' | 'environment' | 'off';
        source: 'none' | 'system' | 'custom' | 'environment';
        proxyUrl: string | null;
        reason: string | null;
        checkedAt: string;
    };
};

export type GetPreferencesNetworkStatusResponse = GetPreferencesNetworkStatusResponses[keyof GetPreferencesNetworkStatusResponses];

export type GetPreferencesJarvisData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/preferences/jarvis';
};

export type GetPreferencesJarvisResponses = {
    /**
     * Response for status 200
     */
    200: {
        /**
         * Chat runtime ID used by Jarvis sessions
         */
        runtimeKind?: string;
        /**
         * ID of the agent profile to use for Jarvis
         */
        profileId: string | null;
        /**
         * Explicit model ID for Jarvis (e.g. gpt-4o, claude-3-7-sonnet)
         */
        model?: string;
        thinkingLevel: 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';
    };
};

export type GetPreferencesJarvisResponse = GetPreferencesJarvisResponses[keyof GetPreferencesJarvisResponses];

export type PutPreferencesJarvisData = {
    body: {
        /**
         * Chat runtime ID used by Jarvis sessions
         */
        runtimeKind?: string;
        /**
         * ID of the agent profile to use for Jarvis
         */
        profileId: string | null;
        /**
         * Explicit model ID for Jarvis (e.g. gpt-4o, claude-3-7-sonnet)
         */
        model?: string;
        thinkingLevel: 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';
    };
    path?: never;
    query?: never;
    url: '/preferences/jarvis';
};

export type PutPreferencesJarvisResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type PutPreferencesJarvisResponse = PutPreferencesJarvisResponses[keyof PutPreferencesJarvisResponses];

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

export type GetWorkspacesResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        name: string;
        locator: {
            hostId: string;
            path: string;
            kind?: 'project' | 'managed-worktree';
            sourceWorkspaceId?: string | null;
        };
        gitIdentity: {
            originUrl?: string | null;
            repoRoot?: string | null;
            headSha?: string | null;
            branch?: string | null;
        };
        identifier: string;
        availability: 'available' | 'missing' | 'remote';
        multiFolder: boolean;
        pinned: number;
        createdAt: number;
        updatedAt: number;
    }>;
};

export type GetWorkspacesResponse = GetWorkspacesResponses[keyof GetWorkspacesResponses];

export type PostWorkspacesData = {
    body: {
        name: string;
        locator: {
            hostId: string;
            path: string;
            kind?: 'project' | 'managed-worktree';
            sourceWorkspaceId?: string | null;
        };
        gitIdentity?: {
            originUrl?: string | null;
            repoRoot?: string | null;
            headSha?: string | null;
            branch?: string | null;
        };
    };
    path?: never;
    query?: never;
    url: '/workspaces';
};

export type PostWorkspacesErrors = {
    /**
     * Response for status 409
     */
    409: {
        code: 'workspace_locator_exists';
        message: string;
        details: {
            locator: {
                hostId: string;
                path: string;
                kind?: 'project' | 'managed-worktree';
                sourceWorkspaceId?: string | null;
            };
        };
    };
};

export type PostWorkspacesError = PostWorkspacesErrors[keyof PostWorkspacesErrors];

export type PostWorkspacesResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        name: string;
        locator: {
            hostId: string;
            path: string;
            kind?: 'project' | 'managed-worktree';
            sourceWorkspaceId?: string | null;
        };
        gitIdentity: {
            originUrl?: string | null;
            repoRoot?: string | null;
            headSha?: string | null;
            branch?: string | null;
        };
        identifier: string;
        availability: 'available' | 'missing' | 'remote';
        multiFolder: boolean;
        pinned: number;
        createdAt: number;
        updatedAt: number;
    };
};

export type PostWorkspacesResponse = PostWorkspacesResponses[keyof PostWorkspacesResponses];

export type PostWorkspacesFromDirectoryData = {
    body: {
        path: string;
    };
    path?: never;
    query?: never;
    url: '/workspaces/from-directory';
};

export type PostWorkspacesFromDirectoryErrors = {
    /**
     * Response for status 409
     */
    409: {
        code: 'workspace_locator_exists';
        message: string;
        details: {
            locator: {
                hostId: string;
                path: string;
                kind?: 'project' | 'managed-worktree';
                sourceWorkspaceId?: string | null;
            };
        };
    };
};

export type PostWorkspacesFromDirectoryError = PostWorkspacesFromDirectoryErrors[keyof PostWorkspacesFromDirectoryErrors];

export type PostWorkspacesFromDirectoryResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        name: string;
        locator: {
            hostId: string;
            path: string;
            kind?: 'project' | 'managed-worktree';
            sourceWorkspaceId?: string | null;
        };
        gitIdentity: {
            originUrl?: string | null;
            repoRoot?: string | null;
            headSha?: string | null;
            branch?: string | null;
        };
        identifier: string;
        availability: 'available' | 'missing' | 'remote';
        multiFolder: boolean;
        pinned: number;
        createdAt: number;
        updatedAt: number;
    };
};

export type PostWorkspacesFromDirectoryResponse = PostWorkspacesFromDirectoryResponses[keyof PostWorkspacesFromDirectoryResponses];

export type PostWorkspacesInspectDirectoryData = {
    body: {
        path: string;
    };
    path?: never;
    query?: never;
    url: '/workspaces/inspect-directory';
};

export type PostWorkspacesInspectDirectoryResponses = {
    /**
     * Response for status 200
     */
    200: {
        path: string;
        cradleWorkspaceDetected: boolean;
        config: {
            name: string;
            folders: Array<{
                name: string;
                path: string;
            }>;
        } | null;
        configValid: boolean;
        configError: string | null;
        featureFlagEnabled: boolean;
        alreadyImported: boolean;
        recommendedAction: 'multi-folder' | 'single-folder';
    };
};

export type PostWorkspacesInspectDirectoryResponse = PostWorkspacesInspectDirectoryResponses[keyof PostWorkspacesInspectDirectoryResponses];

export type PostWorkspacesMultiFolderData = {
    body: {
        name: string;
        folders: Array<{
            name: string;
            path: string;
        }>;
    };
    path?: never;
    query?: never;
    url: '/workspaces/multi-folder';
};

export type PostWorkspacesMultiFolderErrors = {
    /**
     * Response for status 409
     */
    409: {
        code: 'workspace_locator_exists';
        message: string;
        details: {
            locator: {
                hostId: string;
                path: string;
                kind?: 'project' | 'managed-worktree';
                sourceWorkspaceId?: string | null;
            };
        };
    };
};

export type PostWorkspacesMultiFolderError = PostWorkspacesMultiFolderErrors[keyof PostWorkspacesMultiFolderErrors];

export type PostWorkspacesMultiFolderResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        name: string;
        locator: {
            hostId: string;
            path: string;
            kind?: 'project' | 'managed-worktree';
            sourceWorkspaceId?: string | null;
        };
        gitIdentity: {
            originUrl?: string | null;
            repoRoot?: string | null;
            headSha?: string | null;
            branch?: string | null;
        };
        identifier: string;
        availability: 'available' | 'missing' | 'remote';
        multiFolder: boolean;
        pinned: number;
        createdAt: number;
        updatedAt: number;
    };
};

export type PostWorkspacesMultiFolderResponse = PostWorkspacesMultiFolderResponses[keyof PostWorkspacesMultiFolderResponses];

export type PostWorkspacesMultiFolderFromConfigData = {
    body: {
        path: string;
    };
    path?: never;
    query?: never;
    url: '/workspaces/multi-folder/from-config';
};

export type PostWorkspacesMultiFolderFromConfigErrors = {
    /**
     * Response for status 409
     */
    409: {
        code: 'workspace_locator_exists';
        message: string;
        details: {
            locator: {
                hostId: string;
                path: string;
                kind?: 'project' | 'managed-worktree';
                sourceWorkspaceId?: string | null;
            };
        };
    };
};

export type PostWorkspacesMultiFolderFromConfigError = PostWorkspacesMultiFolderFromConfigErrors[keyof PostWorkspacesMultiFolderFromConfigErrors];

export type PostWorkspacesMultiFolderFromConfigResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        name: string;
        locator: {
            hostId: string;
            path: string;
            kind?: 'project' | 'managed-worktree';
            sourceWorkspaceId?: string | null;
        };
        gitIdentity: {
            originUrl?: string | null;
            repoRoot?: string | null;
            headSha?: string | null;
            branch?: string | null;
        };
        identifier: string;
        availability: 'available' | 'missing' | 'remote';
        multiFolder: boolean;
        pinned: number;
        createdAt: number;
        updatedAt: number;
    };
};

export type PostWorkspacesMultiFolderFromConfigResponse = PostWorkspacesMultiFolderFromConfigResponses[keyof PostWorkspacesMultiFolderFromConfigResponses];

export type GetWorkspacesResolveData = {
    body?: never;
    path?: never;
    query: {
        hostId: string;
        path: string;
    };
    url: '/workspaces/resolve';
};

export type GetWorkspacesResolveResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        name: string;
        locator: {
            hostId: string;
            path: string;
            kind?: 'project' | 'managed-worktree';
            sourceWorkspaceId?: string | null;
        };
        gitIdentity: {
            originUrl?: string | null;
            repoRoot?: string | null;
            headSha?: string | null;
            branch?: string | null;
        };
        identifier: string;
        availability: 'available' | 'missing' | 'remote';
        multiFolder: boolean;
        pinned: number;
        createdAt: number;
        updatedAt: number;
    } | null;
};

export type GetWorkspacesResolveResponse = GetWorkspacesResolveResponses[keyof GetWorkspacesResolveResponses];

export type GetWorkspacesByWorkspaceIdFilesData = {
    body?: never;
    path: {
        workspaceId: string;
    };
    query?: never;
    url: '/workspaces/{workspaceId}/files';
};

export type GetWorkspacesByWorkspaceIdFilesResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        type: 'file' | 'directory';
        name: string;
        path: string;
    }>;
};

export type GetWorkspacesByWorkspaceIdFilesResponse = GetWorkspacesByWorkspaceIdFilesResponses[keyof GetWorkspacesByWorkspaceIdFilesResponses];

export type GetWorkspacesByWorkspaceIdFilesChildrenData = {
    body?: never;
    path: {
        workspaceId: string;
    };
    query?: {
        path?: string;
    };
    url: '/workspaces/{workspaceId}/files/children';
};

export type GetWorkspacesByWorkspaceIdFilesChildrenResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        type: 'file' | 'directory';
        name: string;
        path: string;
    }>;
};

export type GetWorkspacesByWorkspaceIdFilesChildrenResponse = GetWorkspacesByWorkspaceIdFilesChildrenResponses[keyof GetWorkspacesByWorkspaceIdFilesChildrenResponses];

export type GetWorkspacesByWorkspaceIdFilesSearchData = {
    body?: never;
    path: {
        workspaceId: string;
    };
    query?: {
        q?: string;
        limit?: number;
    };
    url: '/workspaces/{workspaceId}/files/search';
};

export type GetWorkspacesByWorkspaceIdFilesSearchResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        type: 'file' | 'directory';
        name: string;
        path: string;
    }>;
};

export type GetWorkspacesByWorkspaceIdFilesSearchResponse = GetWorkspacesByWorkspaceIdFilesSearchResponses[keyof GetWorkspacesByWorkspaceIdFilesSearchResponses];

export type GetWorkspacesByWorkspaceIdFilesEventsData = {
    body?: never;
    path: {
        workspaceId: string;
    };
    query?: never;
    url: '/workspaces/{workspaceId}/files/events';
};

export type GetWorkspacesByWorkspaceIdFilesEventsResponses = {
    /**
     * Server-sent event stream of workspace directory refresh hints for loaded file tree directories.
     */
    200: string;
};

export type GetWorkspacesByWorkspaceIdFilesEventsResponse = GetWorkspacesByWorkspaceIdFilesEventsResponses[keyof GetWorkspacesByWorkspaceIdFilesEventsResponses];

export type GetWorkspacesByWorkspaceIdFilesContentData = {
    body?: never;
    path: {
        workspaceId: string;
    };
    query: {
        path: string;
    };
    url: '/workspaces/{workspaceId}/files/content';
};

export type GetWorkspacesByWorkspaceIdFilesContentResponses = {
    /**
     * Response for status 200
     */
    200: {
        content: string | null;
    };
};

export type GetWorkspacesByWorkspaceIdFilesContentResponse = GetWorkspacesByWorkspaceIdFilesContentResponses[keyof GetWorkspacesByWorkspaceIdFilesContentResponses];

export type PutWorkspacesByWorkspaceIdFilesContentData = {
    body: {
        path: string;
        content: string;
        confirmedNonCradleOwnedWrite: boolean;
    };
    path: {
        workspaceId: string;
    };
    query?: never;
    url: '/workspaces/{workspaceId}/files/content';
};

export type PutWorkspacesByWorkspaceIdFilesContentResponses = {
    /**
     * Response for status 200
     */
    200: {
        success: boolean;
        ownerBoundary: {
            classification: 'non-cradle-owned';
            owner: 'workspace';
            consentRequired: boolean;
            consentConfirmed: boolean;
            workspacePath: string | null;
            relativePath: string;
            targetPath: string | null;
        };
    };
};

export type PutWorkspacesByWorkspaceIdFilesContentResponse = PutWorkspacesByWorkspaceIdFilesContentResponses[keyof PutWorkspacesByWorkspaceIdFilesContentResponses];

export type GetWorkspacesByWorkspaceIdFilesInfoData = {
    body?: never;
    path: {
        workspaceId: string;
    };
    query: {
        path: string;
    };
    url: '/workspaces/{workspaceId}/files/info';
};

export type GetWorkspacesByWorkspaceIdFilesInfoResponses = {
    /**
     * Response for status 200
     */
    200: {
        name: string;
        path: string;
        size: number;
        modifiedAt: number;
        mimeType: string;
        extension: string;
        previewKind: 'text' | 'markdown' | 'image' | 'pdf' | 'office' | 'unsupported';
    };
};

export type GetWorkspacesByWorkspaceIdFilesInfoResponse = GetWorkspacesByWorkspaceIdFilesInfoResponses[keyof GetWorkspacesByWorkspaceIdFilesInfoResponses];

export type GetWorkspacesByWorkspaceIdFilesRawData = {
    body?: never;
    path: {
        workspaceId: string;
    };
    query: {
        path: string;
    };
    url: '/workspaces/{workspaceId}/files/raw';
};

export type GetWorkspacesByWorkspaceIdFilesRenditionPdfData = {
    body?: never;
    path: {
        workspaceId: string;
    };
    query: {
        path: string;
    };
    url: '/workspaces/{workspaceId}/files/rendition/pdf';
};

export type PostWorkspacesByWorkspaceIdFilesFileData = {
    body: {
        path: string;
        confirmedNonCradleOwnedWrite: boolean;
    };
    path: {
        workspaceId: string;
    };
    query?: never;
    url: '/workspaces/{workspaceId}/files/file';
};

export type PostWorkspacesByWorkspaceIdFilesFileResponses = {
    /**
     * Response for status 200
     */
    200: {
        success: boolean;
        ownerBoundary: {
            classification: 'non-cradle-owned';
            owner: 'workspace';
            consentRequired: boolean;
            consentConfirmed: boolean;
            workspacePath: string | null;
            relativePath: string;
            targetPath: string | null;
        };
    };
};

export type PostWorkspacesByWorkspaceIdFilesFileResponse = PostWorkspacesByWorkspaceIdFilesFileResponses[keyof PostWorkspacesByWorkspaceIdFilesFileResponses];

export type PostWorkspacesByWorkspaceIdFilesFolderData = {
    body: {
        path: string;
        confirmedNonCradleOwnedWrite: boolean;
    };
    path: {
        workspaceId: string;
    };
    query?: never;
    url: '/workspaces/{workspaceId}/files/folder';
};

export type PostWorkspacesByWorkspaceIdFilesFolderResponses = {
    /**
     * Response for status 200
     */
    200: {
        success: boolean;
        ownerBoundary: {
            classification: 'non-cradle-owned';
            owner: 'workspace';
            consentRequired: boolean;
            consentConfirmed: boolean;
            workspacePath: string | null;
            relativePath: string;
            targetPath: string | null;
        };
    };
};

export type PostWorkspacesByWorkspaceIdFilesFolderResponse = PostWorkspacesByWorkspaceIdFilesFolderResponses[keyof PostWorkspacesByWorkspaceIdFilesFolderResponses];

export type PatchWorkspacesByWorkspaceIdFilesPathData = {
    body: {
        sourcePath: string;
        destinationPath: string;
        confirmedNonCradleOwnedWrite: boolean;
    };
    path: {
        workspaceId: string;
    };
    query?: never;
    url: '/workspaces/{workspaceId}/files/path';
};

export type PatchWorkspacesByWorkspaceIdFilesPathResponses = {
    /**
     * Response for status 200
     */
    200: {
        success: boolean;
        sourceBoundary: {
            classification: 'non-cradle-owned';
            owner: 'workspace';
            consentRequired: boolean;
            consentConfirmed: boolean;
            workspacePath: string | null;
            relativePath: string;
            targetPath: string | null;
        };
        destinationBoundary: {
            classification: 'non-cradle-owned';
            owner: 'workspace';
            consentRequired: boolean;
            consentConfirmed: boolean;
            workspacePath: string | null;
            relativePath: string;
            targetPath: string | null;
        };
    };
};

export type PatchWorkspacesByWorkspaceIdFilesPathResponse = PatchWorkspacesByWorkspaceIdFilesPathResponses[keyof PatchWorkspacesByWorkspaceIdFilesPathResponses];

export type DeleteWorkspacesByWorkspaceIdData = {
    body?: never;
    path: {
        workspaceId: string;
    };
    query?: never;
    url: '/workspaces/{workspaceId}';
};

export type DeleteWorkspacesByWorkspaceIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type DeleteWorkspacesByWorkspaceIdResponse = DeleteWorkspacesByWorkspaceIdResponses[keyof DeleteWorkspacesByWorkspaceIdResponses];

export type GetWorkspacesByWorkspaceIdData = {
    body?: never;
    path: {
        workspaceId: string;
    };
    query?: never;
    url: '/workspaces/{workspaceId}';
};

export type GetWorkspacesByWorkspaceIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        name: string;
        locator: {
            hostId: string;
            path: string;
            kind?: 'project' | 'managed-worktree';
            sourceWorkspaceId?: string | null;
        };
        gitIdentity: {
            originUrl?: string | null;
            repoRoot?: string | null;
            headSha?: string | null;
            branch?: string | null;
        };
        identifier: string;
        availability: 'available' | 'missing' | 'remote';
        multiFolder: boolean;
        pinned: number;
        createdAt: number;
        updatedAt: number;
    } | null;
};

export type GetWorkspacesByWorkspaceIdResponse = GetWorkspacesByWorkspaceIdResponses[keyof GetWorkspacesByWorkspaceIdResponses];

export type PatchWorkspacesByWorkspaceIdData = {
    body: {
        name?: string;
        pinned?: boolean;
    };
    path: {
        workspaceId: string;
    };
    query?: never;
    url: '/workspaces/{workspaceId}';
};

export type PatchWorkspacesByWorkspaceIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        name: string;
        locator: {
            hostId: string;
            path: string;
            kind?: 'project' | 'managed-worktree';
            sourceWorkspaceId?: string | null;
        };
        gitIdentity: {
            originUrl?: string | null;
            repoRoot?: string | null;
            headSha?: string | null;
            branch?: string | null;
        };
        identifier: string;
        availability: 'available' | 'missing' | 'remote';
        multiFolder: boolean;
        pinned: number;
        createdAt: number;
        updatedAt: number;
    } | null;
};

export type PatchWorkspacesByWorkspaceIdResponse = PatchWorkspacesByWorkspaceIdResponses[keyof PatchWorkspacesByWorkspaceIdResponses];

export type PatchWorkspacesByWorkspaceIdLocationData = {
    body: {
        path: string;
    };
    path: {
        workspaceId: string;
    };
    query?: never;
    url: '/workspaces/{workspaceId}/location';
};

export type PatchWorkspacesByWorkspaceIdLocationResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        name: string;
        locator: {
            hostId: string;
            path: string;
            kind?: 'project' | 'managed-worktree';
            sourceWorkspaceId?: string | null;
        };
        gitIdentity: {
            originUrl?: string | null;
            repoRoot?: string | null;
            headSha?: string | null;
            branch?: string | null;
        };
        identifier: string;
        availability: 'available' | 'missing' | 'remote';
        multiFolder: boolean;
        pinned: number;
        createdAt: number;
        updatedAt: number;
    } | null;
};

export type PatchWorkspacesByWorkspaceIdLocationResponse = PatchWorkspacesByWorkspaceIdLocationResponses[keyof PatchWorkspacesByWorkspaceIdLocationResponses];

export type PostWorkspacesByWorkspaceIdMigrateData = {
    body: {
        targetWorkspaceId: string;
        /**
         * Which entity types to migrate. Defaults to all three.
         */
        entities?: Array<'issues' | 'kanban' | 'automation'>;
        /**
         * Map source status name → target status name. Unmapped statuses fall back to target default.
         */
        statusMappings?: {
            [key: string]: unknown;
        };
        /**
         * Map source milestone title → target milestone title. Unmapped milestones are cleared.
         */
        milestoneMappings?: {
            [key: string]: unknown;
        };
        /**
         * Preview the migration without making changes.
         */
        dryRun?: boolean;
    };
    path: {
        workspaceId: string;
    };
    query?: never;
    url: '/workspaces/{workspaceId}/migrate';
};

export type PostWorkspacesByWorkspaceIdMigrateResponses = {
    /**
     * Response for status 200
     */
    200: {
        dryRun: boolean;
        issues: {
            processed: number;
            updated: number;
            numbersReassigned: number;
            statusesMapped: Array<{
                from: string;
                to: string;
            }>;
            milestonesMapped: Array<{
                from: string;
                to: string | null;
            }>;
            parentIssuesCleared: number;
        };
        kanban: {
            boardsMoved: number;
        };
        automation: {
            definitionsMoved: number;
        };
    };
};

export type PostWorkspacesByWorkspaceIdMigrateResponse = PostWorkspacesByWorkspaceIdMigrateResponses[keyof PostWorkspacesByWorkspaceIdMigrateResponses];

export type GetFilesystemBrowseData = {
    body?: never;
    path?: never;
    query?: {
        path?: string;
    };
    url: '/filesystem/browse';
};

export type GetFilesystemBrowseResponses = {
    /**
     * Response for status 200
     */
    200: {
        current: string;
        parent: string | null;
        entries: Array<{
            name: string;
            path: string;
            type: 'directory' | 'file';
            size: number | null;
            modifiedAt: number | null;
        }>;
    };
};

export type GetFilesystemBrowseResponse = GetFilesystemBrowseResponses[keyof GetFilesystemBrowseResponses];

export type GetFilesystemFavoritesData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/filesystem/favorites';
};

export type GetFilesystemFavoritesResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        name: string;
        path: string;
        icon: string;
    }>;
};

export type GetFilesystemFavoritesResponse = GetFilesystemFavoritesResponses[keyof GetFilesystemFavoritesResponses];

export type PostUsageReconcileClaudeData = {
    body?: never;
    path?: never;
    query?: {
        maxBindings?: string | number;
    };
    url: '/usage/reconcile/claude';
};

export type PostUsageReconcileClaudeResponses = {
    /**
     * Response for status 200
     */
    200: {
        bindings: number;
        transcripts: number;
        inserted: number;
        duplicates: number;
        incidents: number;
    };
};

export type PostUsageReconcileClaudeResponse = PostUsageReconcileClaudeResponses[keyof PostUsageReconcileClaudeResponses];

export type GetUsageDailyData = {
    body?: never;
    path?: never;
    query?: {
        days?: string | number;
    };
    url: '/usage/daily';
};

export type GetUsageDailyResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        date: string;
        promptTokens: number;
        completionTokens: number;
        totalTokens: number;
        count: number;
    }>;
};

export type GetUsageDailyResponse = GetUsageDailyResponses[keyof GetUsageDailyResponses];

export type GetUsageDailyByModelData = {
    body?: never;
    path?: never;
    query?: {
        days?: string | number;
    };
    url: '/usage/daily-by-model';
};

export type GetUsageDailyByModelResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        date: string;
        modelId: string;
        totalTokens: number;
        count: number;
    }>;
};

export type GetUsageDailyByModelResponse = GetUsageDailyByModelResponses[keyof GetUsageDailyByModelResponses];

export type GetUsagePatternsHourlyData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/usage/patterns/hourly';
};

export type GetUsagePatternsHourlyResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        hour: number;
        promptTokens: number;
        completionTokens: number;
        totalTokens: number;
        count: number;
    }>;
};

export type GetUsagePatternsHourlyResponse = GetUsagePatternsHourlyResponses[keyof GetUsagePatternsHourlyResponses];

export type GetUsageSummaryData = {
    body?: never;
    path?: never;
    query?: {
        from?: string;
        to?: string;
    };
    url: '/usage/summary';
};

export type GetUsageSummaryResponses = {
    /**
     * Response for status 200
     */
    200: {
        totalPromptTokens: number;
        totalCompletionTokens: number;
        totalTokens: number;
        totalTurns: number;
        byAgent: Array<{
            agentId: string;
            agentName: string;
            totalTokens: number;
            count: number;
        }>;
        byProviderTarget: Array<{
            providerTargetId: string;
            providerTargetName: string | null;
            totalTokens: number;
            count: number;
        }>;
        byModel: Array<{
            modelId: string;
            totalTokens: number;
            count: number;
        }>;
    };
};

export type GetUsageSummaryResponse = GetUsageSummaryResponses[keyof GetUsageSummaryResponses];

export type GetUsageStatsData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/usage/stats';
};

export type GetUsageStatsResponses = {
    /**
     * Response for status 200
     */
    200: {
        currentStreak: number;
        longestStreak: number;
        activeDays: number;
        avgDailyTokens: number;
        peakDay: {
            date: string;
            totalTokens: number;
        } | null;
        todayTokens: number;
    };
};

export type GetUsageStatsResponse = GetUsageStatsResponses[keyof GetUsageStatsResponses];

export type GetUsageSessionsRecentData = {
    body?: never;
    path?: never;
    query?: {
        limit?: string | number;
    };
    url: '/usage/sessions/recent';
};

export type GetUsageSessionsRecentResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        sessionId: string;
        title: string;
        agentId: string | null;
        agentName: string | null;
        modelId: string;
        costUsd: number;
        promptTokens: number;
        completionTokens: number;
        totalTokens: number;
        turnCount: number;
        createdAt: number;
        updatedAt: number;
        lastUsageAt: number;
    }>;
};

export type GetUsageSessionsRecentResponse = GetUsageSessionsRecentResponses[keyof GetUsageSessionsRecentResponses];

export type GetUsageSessionsBySessionIdData = {
    body?: never;
    path: {
        sessionId: string;
    };
    query?: never;
    url: '/usage/sessions/{sessionId}';
};

export type GetUsageSessionsBySessionIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        totalTokens: number;
        promptTokens: number;
        completionTokens: number;
        count: number;
        byModel: Array<{
            modelId: string;
            promptTokens: number;
            completionTokens: number;
            totalTokens: number;
            turnCount: number;
        }>;
    };
};

export type GetUsageSessionsBySessionIdResponse = GetUsageSessionsBySessionIdResponses[keyof GetUsageSessionsBySessionIdResponses];

export type GetUsageCostSummaryData = {
    body?: never;
    path?: never;
    query?: {
        from?: string;
        to?: string;
    };
    url: '/usage/cost/summary';
};

export type GetUsageCostSummaryResponses = {
    /**
     * Response for status 200
     */
    200: {
        totalCostUsd: number;
        totalPromptTokens: number;
        totalUncachedInputTokens: number;
        totalCachedInputTokens: number;
        totalCacheWriteInputTokens: number;
        totalCompletionTokens: number;
        totalTokens: number;
        uncachedInputCostUsd: number;
        cacheReadCostUsd: number;
        cacheWriteCostUsd: number;
        outputCostUsd: number;
        byModel: Array<{
            modelId: string;
            costUsd: number;
            promptTokens: number;
            uncachedInputTokens: number;
            cachedInputTokens: number;
            cacheWriteInputTokens: number;
            completionTokens: number;
            totalTokens: number;
            uncachedInputCostUsd: number;
            cacheReadCostUsd: number;
            cacheWriteCostUsd: number;
            outputCostUsd: number;
            count: number;
        }>;
        byAgent: Array<{
            agentId: string;
            agentName: string;
            costUsd: number;
            promptTokens: number;
            uncachedInputTokens: number;
            cachedInputTokens: number;
            cacheWriteInputTokens: number;
            completionTokens: number;
            totalTokens: number;
            uncachedInputCostUsd: number;
            cacheReadCostUsd: number;
            cacheWriteCostUsd: number;
            outputCostUsd: number;
            count: number;
        }>;
        byProviderTarget: Array<{
            providerTargetId: string;
            providerTargetName: string | null;
            costUsd: number;
            promptTokens: number;
            uncachedInputTokens: number;
            cachedInputTokens: number;
            cacheWriteInputTokens: number;
            completionTokens: number;
            totalTokens: number;
            uncachedInputCostUsd: number;
            cacheReadCostUsd: number;
            cacheWriteCostUsd: number;
            outputCostUsd: number;
            count: number;
        }>;
    };
};

export type GetUsageCostSummaryResponse = GetUsageCostSummaryResponses[keyof GetUsageCostSummaryResponses];

export type GetUsageCostSessionsData = {
    body?: never;
    path?: never;
    query?: {
        from?: string;
        to?: string;
    };
    url: '/usage/cost/sessions';
};

export type GetUsageCostSessionsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        sessionId: string;
        costUsd: number;
        promptTokens: number;
        completionTokens: number;
        totalTokens: number;
        stepCount: number;
    }>;
};

export type GetUsageCostSessionsResponse = GetUsageCostSessionsResponses[keyof GetUsageCostSessionsResponses];

export type GetUsageCostDailyData = {
    body?: never;
    path?: never;
    query?: {
        from?: string;
        to?: string;
    };
    url: '/usage/cost/daily';
};

export type GetUsageCostDailyResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        date: string;
        modelId: string;
        costUsd: number;
        promptTokens: number;
        uncachedInputTokens: number;
        cachedInputTokens: number;
        cacheWriteInputTokens: number;
        completionTokens: number;
        totalTokens: number;
        uncachedInputCostUsd: number;
        cacheReadCostUsd: number;
        cacheWriteCostUsd: number;
        outputCostUsd: number;
        stepCount: number;
    }>;
};

export type GetUsageCostDailyResponse = GetUsageCostDailyResponses[keyof GetUsageCostDailyResponses];

export type GetUsagePerformanceData = {
    body?: never;
    path?: never;
    query?: {
        from?: string;
        to?: string;
    };
    url: '/usage/performance';
};

export type GetUsagePerformanceResponses = {
    /**
     * Response for status 200
     */
    200: {
        coverageStartedAt: number | null;
        coverageEndedAt: number | null;
        summary: {
            sampleCount: number;
            firstTokenSampleCount: number;
            p50FirstTokenMs: number | null;
            p95FirstTokenMs: number | null;
            p50TotalDurationMs: number | null;
            p95TotalDurationMs: number | null;
        };
        byRuntime: Array<{
            runtimeKind: string;
            sampleCount: number;
            firstTokenSampleCount: number;
            p50FirstTokenMs: number | null;
            p95FirstTokenMs: number | null;
            p50TotalDurationMs: number | null;
            p95TotalDurationMs: number | null;
        }>;
        byProviderTarget: Array<{
            providerTargetId: string | null;
            providerTargetName: string | null;
            sampleCount: number;
            firstTokenSampleCount: number;
            p50FirstTokenMs: number | null;
            p95FirstTokenMs: number | null;
            p50TotalDurationMs: number | null;
            p95TotalDurationMs: number | null;
        }>;
        byModel: Array<{
            modelId: string;
            sampleCount: number;
            firstTokenSampleCount: number;
            p50FirstTokenMs: number | null;
            p95FirstTokenMs: number | null;
            p50TotalDurationMs: number | null;
            p95TotalDurationMs: number | null;
        }>;
        daily: Array<{
            date: string;
            runtimeKind: string;
            sampleCount: number;
            firstTokenSampleCount: number;
            p50FirstTokenMs: number | null;
            p95FirstTokenMs: number | null;
            p50TotalDurationMs: number | null;
            p95TotalDurationMs: number | null;
        }>;
    };
};

export type GetUsagePerformanceResponse = GetUsagePerformanceResponses[keyof GetUsagePerformanceResponses];

export type GetUsageToolsData = {
    body?: never;
    path?: never;
    query?: {
        from?: string;
        to?: string;
    };
    url: '/usage/tools';
};

export type GetUsageToolsResponses = {
    /**
     * Response for status 200
     */
    200: {
        overall: Array<{
            toolName: string;
            count: number;
            successCount: number;
            failureCount: number;
            deniedCount: number;
            interruptedCount: number;
            medianDurationMs: number | null;
        }>;
        byRuntime: Array<{
            runtimeKind: string;
            tools: Array<{
                toolName: string;
                count: number;
                successCount: number;
                failureCount: number;
                deniedCount: number;
                interruptedCount: number;
                medianDurationMs: number | null;
            }>;
        }>;
        byModel: Array<{
            modelId: string;
            tools: Array<{
                toolName: string;
                count: number;
                successCount: number;
                failureCount: number;
                deniedCount: number;
                interruptedCount: number;
                medianDurationMs: number | null;
            }>;
        }>;
        summary: {
            totalCalls: number;
            successCount: number;
            failureCount: number;
            deniedCount: number;
            interruptedCount: number;
            successRatePct: number;
            uniqueToolCount: number;
            medianDurationMs: number | null;
        };
        daily: Array<{
            date: string;
            toolName: string;
            count: number;
        }>;
        dailyByRuntime: Array<{
            date: string;
            runtimeKind: string;
            toolName: string;
            count: number;
        }>;
        dailyByModel: Array<{
            date: string;
            modelId: string;
            toolName: string;
            count: number;
        }>;
    };
};

export type GetUsageToolsResponse = GetUsageToolsResponses[keyof GetUsageToolsResponses];

export type GetUsageCostEfficiencyData = {
    body?: never;
    path?: never;
    query?: {
        days?: string | number;
    };
    url: '/usage/cost-efficiency';
};

export type GetUsageCostEfficiencyResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        date: string;
        totalTokens: number;
        runCount: number;
        avgTokensPerRun: number;
        totalCostUsd: number;
        avgCostPerRun: number;
    }>;
};

export type GetUsageCostEfficiencyResponse = GetUsageCostEfficiencyResponses[keyof GetUsageCostEfficiencyResponses];

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

export type GetProfilesResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        name: string;
        providerKind: 'openai-compatible' | 'anthropic' | 'universal';
        enabled: boolean;
        configJson: string;
        credentialRef: string | null;
        customModels: string;
        iconSlug: string | null;
        providerId: string | null;
        createdAt: number;
        updatedAt: number;
    }>;
};

export type GetProfilesResponse = GetProfilesResponses[keyof GetProfilesResponses];

export type DeleteProfilesByIdData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/profiles/{id}';
};

export type DeleteProfilesByIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type DeleteProfilesByIdResponse = DeleteProfilesByIdResponses[keyof DeleteProfilesByIdResponses];

export type GetProfilesByIdData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/profiles/{id}';
};

export type GetProfilesByIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        name: string;
        providerKind: 'openai-compatible' | 'anthropic' | 'universal';
        enabled: boolean;
        configJson: string;
        credentialRef: string | null;
        customModels: string;
        iconSlug: string | null;
        providerId: string | null;
        createdAt: number;
        updatedAt: number;
    };
};

export type GetProfilesByIdResponse = GetProfilesByIdResponses[keyof GetProfilesByIdResponses];

export type PutProfilesByIdData = {
    body: {
        name: string;
        providerKind: 'openai-compatible' | 'anthropic' | 'universal';
        enabled: boolean;
        config: {
            [key: string]: unknown;
        };
        credentialRef?: string | null;
        iconSlug?: string | null;
        providerId?: string | null;
    };
    path: {
        id: string;
    };
    query?: never;
    url: '/profiles/{id}';
};

export type PutProfilesByIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        name: string;
        providerKind: 'openai-compatible' | 'anthropic' | 'universal';
        enabled: boolean;
        configJson: string;
        credentialRef: string | null;
        customModels: string;
        iconSlug: string | null;
        providerId: string | null;
        createdAt: number;
        updatedAt: number;
    };
};

export type PutProfilesByIdResponse = PutProfilesByIdResponses[keyof PutProfilesByIdResponses];

export type PostProfilesByIdBindProviderData = {
    body: {
        providerId: string;
        applyEndpointDefaults?: boolean;
    };
    path: {
        id: string;
    };
    query?: never;
    url: '/profiles/{id}/bind-provider';
};

export type PostProfilesByIdBindProviderResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        name: string;
        providerKind: 'openai-compatible' | 'anthropic' | 'universal';
        enabled: boolean;
        configJson: string;
        credentialRef: string | null;
        customModels: string;
        iconSlug: string | null;
        providerId: string | null;
        createdAt: number;
        updatedAt: number;
    };
};

export type PostProfilesByIdBindProviderResponse = PostProfilesByIdBindProviderResponses[keyof PostProfilesByIdBindProviderResponses];

export type PatchProfilesByIdIconData = {
    body: {
        iconSlug: string | null;
    };
    path: {
        id: string;
    };
    query?: never;
    url: '/profiles/{id}/icon';
};

export type PatchProfilesByIdIconResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        name: string;
        providerKind: 'openai-compatible' | 'anthropic' | 'universal';
        enabled: boolean;
        configJson: string;
        credentialRef: string | null;
        customModels: string;
        iconSlug: string | null;
        providerId: string | null;
        createdAt: number;
        updatedAt: number;
    };
};

export type PatchProfilesByIdIconResponse = PatchProfilesByIdIconResponses[keyof PatchProfilesByIdIconResponses];

export type PatchProfilesByIdCustomModelsData = {
    body: {
        models: Array<{
            id: string;
            label?: string;
            capabilities?: {
                contextWindow?: number;
                maxOutput?: number;
                inputModalities?: Array<string>;
                outputModalities?: Array<string>;
                reasoning?: boolean;
                reasoningEfforts?: Array<'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra'>;
                toolCall?: boolean;
                temperature?: boolean;
                structuredOutput?: boolean;
                cost?: {
                    input?: number;
                    output?: number;
                    cacheRead?: number;
                    cacheWrite?: number;
                };
                family?: string;
                knowledgeCutoff?: string;
                releaseDate?: string;
                registryMatch?: 'exact' | 'fuzzy' | 'manual' | 'alias' | 'unmatched';
                registryModelId?: string;
                registryModelLabel?: string;
            };
        }>;
    };
    path: {
        id: string;
    };
    query?: never;
    url: '/profiles/{id}/custom-models';
};

export type PatchProfilesByIdCustomModelsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        label: string;
        capabilities: {
            contextWindow?: number;
            maxOutput?: number;
            inputModalities?: Array<string>;
            outputModalities?: Array<string>;
            reasoning?: boolean;
            reasoningEfforts?: Array<'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra'>;
            toolCall?: boolean;
            temperature?: boolean;
            structuredOutput?: boolean;
            cost?: {
                input?: number;
                output?: number;
                cacheRead?: number;
                cacheWrite?: number;
            };
            family?: string;
            knowledgeCutoff?: string;
            releaseDate?: string;
            registryMatch?: 'exact' | 'fuzzy' | 'manual' | 'alias' | 'unmatched';
            registryModelId?: string;
            registryModelLabel?: string;
        };
    }>;
};

export type PatchProfilesByIdCustomModelsResponse = PatchProfilesByIdCustomModelsResponses[keyof PatchProfilesByIdCustomModelsResponses];

export type GetProviderTargetsData = {
    body?: never;
    path?: never;
    query?: {
        runtimeKind?: string;
        workspaceId?: string;
    };
    url: '/provider-targets/';
};

export type GetProviderTargetsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        kind: 'manual' | 'external';
        providerKind: 'openai-compatible' | 'anthropic' | 'universal';
        displayName: string;
        enabled: boolean;
        iconSlug: string | null;
        connectionConfigJson: string;
        credentialRef: string | null;
        enabledModelsJson: string;
        customModelsJson: string;
        sourceKey: string | null;
        externalRecordId: string | null;
        sourceFingerprint: string | null;
        createdAt: number;
        updatedAt: number;
    }>;
};

export type GetProviderTargetsResponse = GetProviderTargetsResponses[keyof GetProviderTargetsResponses];

export type DeleteProviderTargetsByProviderTargetIdData = {
    body?: never;
    path: {
        providerTargetId: string;
    };
    query?: never;
    url: '/provider-targets/{providerTargetId}';
};

export type DeleteProviderTargetsByProviderTargetIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type DeleteProviderTargetsByProviderTargetIdResponse = DeleteProviderTargetsByProviderTargetIdResponses[keyof DeleteProviderTargetsByProviderTargetIdResponses];

export type PutProviderTargetsByProviderTargetIdData = {
    body: {
        displayName: string;
        providerKind: 'openai-compatible' | 'anthropic' | 'universal';
        enabled?: boolean;
        connectionConfig: {
            [key: string]: unknown;
        };
        credentialRef?: string | null;
        iconSlug?: string | null;
    };
    path: {
        providerTargetId: string;
    };
    query?: never;
    url: '/provider-targets/{providerTargetId}';
};

export type PutProviderTargetsByProviderTargetIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        kind: 'manual' | 'external';
        providerKind: 'openai-compatible' | 'anthropic' | 'universal';
        displayName: string;
        enabled: boolean;
        iconSlug: string | null;
        connectionConfigJson: string;
        credentialRef: string | null;
        enabledModelsJson: string;
        customModelsJson: string;
        sourceKey: string | null;
        externalRecordId: string | null;
        sourceFingerprint: string | null;
        createdAt: number;
        updatedAt: number;
    };
};

export type PutProviderTargetsByProviderTargetIdResponse = PutProviderTargetsByProviderTargetIdResponses[keyof PutProviderTargetsByProviderTargetIdResponses];

export type PostProviderTargetsCredentialsChatgptLoginData = {
    body: {
        label?: string | null;
    };
    path?: never;
    query?: never;
    url: '/provider-targets/credentials/chatgpt/login';
};

export type PostProviderTargetsCredentialsChatgptLoginResponses = {
    /**
     * Response for status 200
     */
    200: {
        loginId: string;
        verificationUrl: string;
        userCode: string;
        expiresAt: number;
    };
};

export type PostProviderTargetsCredentialsChatgptLoginResponse = PostProviderTargetsCredentialsChatgptLoginResponses[keyof PostProviderTargetsCredentialsChatgptLoginResponses];

export type GetProviderTargetsCredentialsChatgptLoginByLoginIdData = {
    body?: never;
    path: {
        loginId: string;
    };
    query?: never;
    url: '/provider-targets/credentials/chatgpt/login/{loginId}';
};

export type GetProviderTargetsCredentialsChatgptLoginByLoginIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        loginId: string;
        state: 'pending' | 'completed' | 'failed' | 'cancelled';
        startedAt: number;
        completedAt: number | null;
        credentialRef: string | null;
        email: string | null;
        planType: string | null;
        error: string | null;
    };
};

export type GetProviderTargetsCredentialsChatgptLoginByLoginIdResponse = GetProviderTargetsCredentialsChatgptLoginByLoginIdResponses[keyof GetProviderTargetsCredentialsChatgptLoginByLoginIdResponses];

export type PostProviderTargetsCredentialsChatgptLoginByLoginIdCancelData = {
    body?: never;
    path: {
        loginId: string;
    };
    query?: never;
    url: '/provider-targets/credentials/chatgpt/login/{loginId}/cancel';
};

export type PostProviderTargetsCredentialsChatgptLoginByLoginIdCancelResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type PostProviderTargetsCredentialsChatgptLoginByLoginIdCancelResponse = PostProviderTargetsCredentialsChatgptLoginByLoginIdCancelResponses[keyof PostProviderTargetsCredentialsChatgptLoginByLoginIdCancelResponses];

export type GetProviderTargetsByProviderTargetIdModelSettingsData = {
    body?: never;
    path: {
        providerTargetId: string;
    };
    query?: never;
    url: '/provider-targets/{providerTargetId}/model-settings';
};

export type GetProviderTargetsByProviderTargetIdModelSettingsResponses = {
    /**
     * Response for status 200
     */
    200: {
        providerTargetKind?: 'manual' | 'external';
        providerTargetId: string;
        connectionConfigJson: string;
        enabledModelsJson: string;
        configJson: string;
        customModelsJson: string;
    };
};

export type GetProviderTargetsByProviderTargetIdModelSettingsResponse = GetProviderTargetsByProviderTargetIdModelSettingsResponses[keyof GetProviderTargetsByProviderTargetIdModelSettingsResponses];

export type PatchProviderTargetsByProviderTargetIdModelSettingsData = {
    body: {
        claudeAgent: {
            modelAliases?: {
                haiku?: string;
                sonnet?: string;
                opus?: string;
            };
        } | null;
    };
    path: {
        providerTargetId: string;
    };
    query?: never;
    url: '/provider-targets/{providerTargetId}/model-settings';
};

export type PatchProviderTargetsByProviderTargetIdModelSettingsResponses = {
    /**
     * Response for status 200
     */
    200: {
        providerTargetKind?: 'manual' | 'external';
        providerTargetId: string;
        connectionConfigJson: string;
        enabledModelsJson: string;
        configJson: string;
        customModelsJson: string;
    };
};

export type PatchProviderTargetsByProviderTargetIdModelSettingsResponse = PatchProviderTargetsByProviderTargetIdModelSettingsResponses[keyof PatchProviderTargetsByProviderTargetIdModelSettingsResponses];

export type GetProviderTargetsByProviderTargetIdAuthDiagnosticsData = {
    body?: never;
    path: {
        providerTargetId: string;
    };
    query?: never;
    url: '/provider-targets/{providerTargetId}/auth-diagnostics';
};

export type GetProviderTargetsByProviderTargetIdAuthDiagnosticsResponses = {
    /**
     * Response for status 200
     */
    200: {
        providerTargetId: string;
        supported: boolean;
        unavailableReason: string | null;
        refreshedAt: number | null;
        status: 'ready' | 'warning' | 'error' | 'unknown';
        available: boolean;
        authStatus: 'authenticated' | 'unauthenticated' | 'unknown';
        authMode: 'apiKey' | 'claudeAi' | null;
        authType: string | null;
        authLabel: string | null;
        version: string | null;
        message: string | null;
        account: {
            email: string | null;
            organization: string | null;
            subscriptionType: string | null;
            tokenSource: string | null;
            apiKeySource: string | null;
            apiProvider: string | null;
        } | null;
    };
};

export type GetProviderTargetsByProviderTargetIdAuthDiagnosticsResponse = GetProviderTargetsByProviderTargetIdAuthDiagnosticsResponses[keyof GetProviderTargetsByProviderTargetIdAuthDiagnosticsResponses];

export type GetProviderTargetsByProviderTargetIdCodexAccountDiagnosticsData = {
    body?: never;
    path: {
        providerTargetId: string;
    };
    query?: never;
    url: '/provider-targets/{providerTargetId}/codex/account-diagnostics';
};

export type GetProviderTargetsByProviderTargetIdCodexAccountDiagnosticsResponses = {
    /**
     * Response for status 200
     */
    200: {
        providerTargetId: string;
        supported: boolean;
        unavailableReason: string | null;
        refreshedAt: number | null;
        account: {
            authMode: 'chatgptAuthTokens';
            accountType: 'apiKey' | 'chatgpt' | 'amazonBedrock' | null;
            email: string | null;
            planType: string | null;
            requiresOpenaiAuth: boolean | null;
        } | null;
        rateLimits: {
            limitId: string | null;
            limitName: string | null;
            primary: {
                usedPercent: number;
                windowDurationMins: number | null;
                resetsAt: number | null;
            } | null;
            secondary: {
                usedPercent: number;
                windowDurationMins: number | null;
                resetsAt: number | null;
            } | null;
            credits: {
                hasCredits: boolean;
                unlimited: boolean;
                balance: string | null;
            } | null;
            individualLimit: {
                limit: string;
                used: string;
                remainingPercent: number;
                resetsAt: number;
            } | null;
            planType: string | null;
            rateLimitReachedType: string | null;
        } | null;
        rateLimitsByLimitId: {
            [key: string]: {
                limitId: string | null;
                limitName: string | null;
                primary: {
                    usedPercent: number;
                    windowDurationMins: number | null;
                    resetsAt: number | null;
                } | null;
                secondary: {
                    usedPercent: number;
                    windowDurationMins: number | null;
                    resetsAt: number | null;
                } | null;
                credits: {
                    hasCredits: boolean;
                    unlimited: boolean;
                    balance: string | null;
                } | null;
                individualLimit: {
                    limit: string;
                    used: string;
                    remainingPercent: number;
                    resetsAt: number;
                } | null;
                planType: string | null;
                rateLimitReachedType: string | null;
            };
        } | null;
        rateLimitResetCredits: {
            availableCount: string;
            credits: Array<{
                id: string;
                resetType: 'codexRateLimits' | 'unknown';
                status: 'available' | 'redeeming' | 'redeemed' | 'unknown';
                grantedAt: number;
                expiresAt: number | null;
                title: string | null;
                description: string | null;
            }> | null;
        } | null;
        tokenUsage: {
            summary: {
                lifetimeTokens: string | null;
                peakDailyTokens: string | null;
                longestRunningTurnSec: string | null;
                currentStreakDays: string | null;
                longestStreakDays: string | null;
            };
            dailyUsageBuckets: Array<{
                startDate: string;
                tokens: string;
            }>;
        } | null;
    };
};

export type GetProviderTargetsByProviderTargetIdCodexAccountDiagnosticsResponse = GetProviderTargetsByProviderTargetIdCodexAccountDiagnosticsResponses[keyof GetProviderTargetsByProviderTargetIdCodexAccountDiagnosticsResponses];

export type GetProviderTargetsByProviderTargetIdCodexWhamDiagnosticsData = {
    body?: never;
    path: {
        providerTargetId: string;
    };
    query?: never;
    url: '/provider-targets/{providerTargetId}/codex/wham-diagnostics';
};

export type GetProviderTargetsByProviderTargetIdCodexWhamDiagnosticsResponses = {
    /**
     * Response for status 200
     */
    200: {
        providerTargetId: string;
        supported: boolean;
        unavailableReason: string | null;
        refreshedAt: number | null;
        account: {
            authMode: 'chatgptAuthTokens';
            chatgptAccountId: string;
            planType: string | null;
        } | null;
        endpoints: {
            usage: {
                key: 'usage' | 'rateLimitResetCredits' | 'referralEligibilityRules';
                url: string;
                ok: boolean;
                status: number | null;
                reason: string | null;
                body: unknown;
            } | null;
            rateLimitResetCredits: {
                key: 'usage' | 'rateLimitResetCredits' | 'referralEligibilityRules';
                url: string;
                ok: boolean;
                status: number | null;
                reason: string | null;
                body: unknown;
            } | null;
            referralEligibilityRules: {
                key: 'usage' | 'rateLimitResetCredits' | 'referralEligibilityRules';
                url: string;
                ok: boolean;
                status: number | null;
                reason: string | null;
                body: unknown;
            } | null;
        };
    };
};

export type GetProviderTargetsByProviderTargetIdCodexWhamDiagnosticsResponse = GetProviderTargetsByProviderTargetIdCodexWhamDiagnosticsResponses[keyof GetProviderTargetsByProviderTargetIdCodexWhamDiagnosticsResponses];

export type PostProviderTargetsByProviderTargetIdCodexRateLimitResetCreditConsumeData = {
    body: {
        idempotencyKey: string;
    };
    path: {
        providerTargetId: string;
    };
    query?: never;
    url: '/provider-targets/{providerTargetId}/codex/rate-limit-reset-credit/consume';
};

export type PostProviderTargetsByProviderTargetIdCodexRateLimitResetCreditConsumeResponses = {
    /**
     * Response for status 200
     */
    200: {
        providerTargetId: string;
        outcome: 'reset' | 'nothingToReset' | 'noCredit' | 'alreadyRedeemed';
        consumedAt: number;
    };
};

export type PostProviderTargetsByProviderTargetIdCodexRateLimitResetCreditConsumeResponse = PostProviderTargetsByProviderTargetIdCodexRateLimitResetCreditConsumeResponses[keyof PostProviderTargetsByProviderTargetIdCodexRateLimitResetCreditConsumeResponses];

export type PatchProviderTargetsByProviderTargetIdModelVisibilityData = {
    body: {
        enabledModels: Array<string>;
    };
    path: {
        providerTargetId: string;
    };
    query?: never;
    url: '/provider-targets/{providerTargetId}/model-visibility';
};

export type PatchProviderTargetsByProviderTargetIdModelVisibilityResponses = {
    /**
     * Response for status 200
     */
    200: {
        providerTargetKind?: 'manual' | 'external';
        providerTargetId: string;
        connectionConfigJson: string;
        enabledModelsJson: string;
        configJson: string;
        customModelsJson: string;
    };
};

export type PatchProviderTargetsByProviderTargetIdModelVisibilityResponse = PatchProviderTargetsByProviderTargetIdModelVisibilityResponses[keyof PatchProviderTargetsByProviderTargetIdModelVisibilityResponses];

export type PatchProviderTargetsByProviderTargetIdCustomModelsData = {
    body: {
        models: Array<{
            id: string;
            label?: string;
        }>;
    };
    path: {
        providerTargetId: string;
    };
    query?: never;
    url: '/provider-targets/{providerTargetId}/custom-models';
};

export type PatchProviderTargetsByProviderTargetIdCustomModelsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        label: string;
        capabilities: {
            contextWindow?: number;
            maxOutput?: number;
            inputModalities?: Array<string>;
            outputModalities?: Array<string>;
            reasoning?: boolean;
            reasoningEfforts?: Array<'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra'>;
            toolCall?: boolean;
            temperature?: boolean;
            structuredOutput?: boolean;
            cost?: {
                input?: number;
                output?: number;
                cacheRead?: number;
                cacheWrite?: number;
            };
            family?: string;
            knowledgeCutoff?: string;
            releaseDate?: string;
            registryMatch?: 'exact' | 'fuzzy' | 'manual' | 'alias' | 'unmatched';
            registryModelId?: string;
            registryModelLabel?: string;
        };
    }>;
};

export type PatchProviderTargetsByProviderTargetIdCustomModelsResponse = PatchProviderTargetsByProviderTargetIdCustomModelsResponses[keyof PatchProviderTargetsByProviderTargetIdCustomModelsResponses];

export type GetProviderTargetsByProviderTargetIdTestData = {
    body?: never;
    path: {
        providerTargetId: string;
    };
    query?: never;
    url: '/provider-targets/{providerTargetId}/test';
};

export type GetProviderTargetsByProviderTargetIdTestErrors = {
    /**
     * Response for status 404
     */
    404: {
        error: 'no_cached_result';
    };
};

export type GetProviderTargetsByProviderTargetIdTestError = GetProviderTargetsByProviderTargetIdTestErrors[keyof GetProviderTargetsByProviderTargetIdTestErrors];

export type GetProviderTargetsByProviderTargetIdTestResponses = {
    /**
     * Response for status 200
     */
    200: {
        status: 'ok' | 'auth_failed' | 'network_error' | 'endpoint_error' | 'model_unavailable';
        latencyMs: number;
        checkedAt: string;
        modelsCount?: number;
        detail?: string;
        deep?: boolean;
        model?: string;
    };
};

export type GetProviderTargetsByProviderTargetIdTestResponse = GetProviderTargetsByProviderTargetIdTestResponses[keyof GetProviderTargetsByProviderTargetIdTestResponses];

export type PostProviderTargetsByProviderTargetIdTestData = {
    body: {
        deep?: boolean;
        model?: string;
    };
    path: {
        providerTargetId: string;
    };
    query?: never;
    url: '/provider-targets/{providerTargetId}/test';
};

export type PostProviderTargetsByProviderTargetIdTestResponses = {
    /**
     * Response for status 200
     */
    200: {
        status: 'ok' | 'auth_failed' | 'network_error' | 'endpoint_error' | 'model_unavailable';
        latencyMs: number;
        checkedAt: string;
        modelsCount?: number;
        detail?: string;
        deep?: boolean;
        model?: string;
    };
};

export type PostProviderTargetsByProviderTargetIdTestResponse = PostProviderTargetsByProviderTargetIdTestResponses[keyof PostProviderTargetsByProviderTargetIdTestResponses];

export type GetRelayServersData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/relay-servers';
};

export type GetRelayServersResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        displayName: string;
        relayUrl: string;
        enabled: boolean;
        isDefault: boolean;
        createdAt: number;
        updatedAt: number;
    }>;
};

export type GetRelayServersResponse = GetRelayServersResponses[keyof GetRelayServersResponses];

export type PostRelayServersData = {
    body: {
        id?: string;
        displayName: string;
        relayUrl: string;
        enabled?: boolean;
        isDefault?: boolean;
    };
    path?: never;
    query?: never;
    url: '/relay-servers';
};

export type PostRelayServersResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        displayName: string;
        relayUrl: string;
        enabled: boolean;
        isDefault: boolean;
        createdAt: number;
        updatedAt: number;
    };
};

export type PostRelayServersResponse = PostRelayServersResponses[keyof PostRelayServersResponses];

export type DeleteRelayServersByRelayServerIdData = {
    body?: never;
    path: {
        relayServerId: string;
    };
    query?: never;
    url: '/relay-servers/{relayServerId}';
};

export type DeleteRelayServersByRelayServerIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type DeleteRelayServersByRelayServerIdResponse = DeleteRelayServersByRelayServerIdResponses[keyof DeleteRelayServersByRelayServerIdResponses];

export type PatchRelayServersByRelayServerIdData = {
    body: {
        displayName?: string;
        relayUrl?: string;
        enabled?: boolean;
        isDefault?: boolean;
    };
    path: {
        relayServerId: string;
    };
    query?: never;
    url: '/relay-servers/{relayServerId}';
};

export type PatchRelayServersByRelayServerIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        displayName: string;
        relayUrl: string;
        enabled: boolean;
        isDefault: boolean;
        createdAt: number;
        updatedAt: number;
    };
};

export type PatchRelayServersByRelayServerIdResponse = PatchRelayServersByRelayServerIdResponses[keyof PatchRelayServersByRelayServerIdResponses];

export type GetRelayTransportHostEnrollmentsData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/relay-transport/host-enrollments';
};

export type GetRelayTransportHostEnrollmentsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        displayName: string;
        relayUrl: string;
        roomId: string;
        hostPubkey: string;
        hostKeyFingerprint: string;
        pinnedControllerPubkey: string | null;
        status: 'pending' | 'paired' | 'offline';
        pairable: boolean;
        lastError: string | null;
        createdAt: number;
        updatedAt: number;
        live: {
            connected: boolean;
            controllerName: string | null;
            lastReadyAt: number | null;
            activeStreams: number;
        } | null;
    }>;
};

export type GetRelayTransportHostEnrollmentsResponse = GetRelayTransportHostEnrollmentsResponses[keyof GetRelayTransportHostEnrollmentsResponses];

export type PostRelayTransportHostEnrollmentsData = {
    body: {
        id?: string;
        displayName: string;
        relayUrl: string;
    };
    path?: never;
    query?: never;
    url: '/relay-transport/host-enrollments';
};

export type PostRelayTransportHostEnrollmentsResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        displayName: string;
        relayUrl: string;
        roomId: string;
        hostPubkey: string;
        hostKeyFingerprint: string;
        pinnedControllerPubkey: string | null;
        status: 'pending' | 'paired' | 'offline';
        pairable: boolean;
        lastError: string | null;
        createdAt: number;
        updatedAt: number;
        live: {
            connected: boolean;
            controllerName: string | null;
            lastReadyAt: number | null;
            activeStreams: number;
        } | null;
        pairingString: string;
        pairingCodeExpiresAt: string | null;
    };
};

export type PostRelayTransportHostEnrollmentsResponse = PostRelayTransportHostEnrollmentsResponses[keyof PostRelayTransportHostEnrollmentsResponses];

export type DeleteRelayTransportHostEnrollmentsByEnrollmentIdData = {
    body?: never;
    path: {
        enrollmentId: string;
    };
    query?: never;
    url: '/relay-transport/host-enrollments/{enrollmentId}';
};

export type DeleteRelayTransportHostEnrollmentsByEnrollmentIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type DeleteRelayTransportHostEnrollmentsByEnrollmentIdResponse = DeleteRelayTransportHostEnrollmentsByEnrollmentIdResponses[keyof DeleteRelayTransportHostEnrollmentsByEnrollmentIdResponses];

export type GetRelayTransportHostEnrollmentsByEnrollmentIdData = {
    body?: never;
    path: {
        enrollmentId: string;
    };
    query?: never;
    url: '/relay-transport/host-enrollments/{enrollmentId}';
};

export type GetRelayTransportHostEnrollmentsByEnrollmentIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        displayName: string;
        relayUrl: string;
        roomId: string;
        hostPubkey: string;
        hostKeyFingerprint: string;
        pinnedControllerPubkey: string | null;
        status: 'pending' | 'paired' | 'offline';
        pairable: boolean;
        lastError: string | null;
        createdAt: number;
        updatedAt: number;
        live: {
            connected: boolean;
            controllerName: string | null;
            lastReadyAt: number | null;
            activeStreams: number;
        } | null;
    };
};

export type GetRelayTransportHostEnrollmentsByEnrollmentIdResponse = GetRelayTransportHostEnrollmentsByEnrollmentIdResponses[keyof GetRelayTransportHostEnrollmentsByEnrollmentIdResponses];

export type GetRelayTransportHostEnrollmentsByEnrollmentIdPairingStringData = {
    body?: never;
    path: {
        enrollmentId: string;
    };
    query?: never;
    url: '/relay-transport/host-enrollments/{enrollmentId}/pairing-string';
};

export type GetRelayTransportHostEnrollmentsByEnrollmentIdPairingStringResponses = {
    /**
     * Response for status 200
     */
    200: {
        pairingString: string;
        pairingCode: string;
        hostKeyFingerprint: string;
    };
};

export type GetRelayTransportHostEnrollmentsByEnrollmentIdPairingStringResponse = GetRelayTransportHostEnrollmentsByEnrollmentIdPairingStringResponses[keyof GetRelayTransportHostEnrollmentsByEnrollmentIdPairingStringResponses];

export type GetRemoteHostsData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/remote-hosts';
};

export type GetRemoteHostsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        displayName: string;
        enabled: boolean;
        lastSeenAt: number | null;
        connectionConfigJson: string;
        capabilitiesJson: string;
        createdAt: number;
        updatedAt: number;
        connectionState: 'idle' | 'warming' | 'connected' | 'offline';
        lastError: string | null;
    }>;
};

export type GetRemoteHostsResponse = GetRemoteHostsResponses[keyof GetRemoteHostsResponses];

export type PostRemoteHostsData = {
    body: {
        id?: string;
        displayName: string;
        enabled?: boolean;
        connectionConfig?: {
            transport?: 'ssh' | 'direct-url' | 'relay';
            baseUrl?: string;
            ssh?: {
                hostName: string;
                user?: string | null;
                port?: string | number | null;
                auth?: 'default' | 'identityFile';
                identityFilePath?: string | null;
            };
            sshExecutable?: string;
            sshArgs?: Array<string>;
            connectTimeoutMs?: string | number;
            relay?: {
                relayServerId?: string | null;
                relayUrl?: string | null;
                roomId?: string | null;
                pinnedHostPubkey?: string | null;
                controllerKeyRef?: string | null;
            };
        };
        capabilities?: {
            cradleServer?: {
                enabled?: boolean;
                remoteHost?: string;
                remotePort?: string | number;
            };
        };
    };
    path?: never;
    query?: never;
    url: '/remote-hosts';
};

export type PostRemoteHostsResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        displayName: string;
        enabled: boolean;
        lastSeenAt: number | null;
        connectionConfigJson: string;
        capabilitiesJson: string;
        createdAt: number;
        updatedAt: number;
        connectionState: 'idle' | 'warming' | 'connected' | 'offline';
        lastError: string | null;
    };
};

export type PostRemoteHostsResponse = PostRemoteHostsResponses[keyof PostRemoteHostsResponses];

export type DeleteRemoteHostsByHostIdData = {
    body?: never;
    path: {
        hostId: string;
    };
    query?: never;
    url: '/remote-hosts/{hostId}';
};

export type DeleteRemoteHostsByHostIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type DeleteRemoteHostsByHostIdResponse = DeleteRemoteHostsByHostIdResponses[keyof DeleteRemoteHostsByHostIdResponses];

export type PatchRemoteHostsByHostIdData = {
    body: {
        displayName?: string;
        enabled?: boolean;
        connectionConfig?: {
            transport?: 'ssh' | 'direct-url' | 'relay';
            baseUrl?: string;
            ssh?: {
                hostName: string;
                user?: string | null;
                port?: string | number | null;
                auth?: 'default' | 'identityFile';
                identityFilePath?: string | null;
            };
            sshExecutable?: string;
            sshArgs?: Array<string>;
            connectTimeoutMs?: string | number;
            relay?: {
                relayServerId?: string | null;
                relayUrl?: string | null;
                roomId?: string | null;
                pinnedHostPubkey?: string | null;
                controllerKeyRef?: string | null;
            };
        };
        capabilities?: {
            cradleServer?: {
                enabled?: boolean;
                remoteHost?: string;
                remotePort?: string | number;
            };
        };
    };
    path: {
        hostId: string;
    };
    query?: never;
    url: '/remote-hosts/{hostId}';
};

export type PatchRemoteHostsByHostIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        displayName: string;
        enabled: boolean;
        lastSeenAt: number | null;
        connectionConfigJson: string;
        capabilitiesJson: string;
        createdAt: number;
        updatedAt: number;
        connectionState: 'idle' | 'warming' | 'connected' | 'offline';
        lastError: string | null;
    };
};

export type PatchRemoteHostsByHostIdResponse = PatchRemoteHostsByHostIdResponses[keyof PatchRemoteHostsByHostIdResponses];

export type PostRemoteHostsByHostIdCradleServerConnectData = {
    body?: never;
    path: {
        hostId: string;
    };
    query?: never;
    url: '/remote-hosts/{hostId}/cradle-server/connect';
};

export type PostRemoteHostsByHostIdCradleServerConnectResponses = {
    /**
     * Response for status 200
     */
    200: {
        hostId: string;
        state: 'idle' | 'warming' | 'connected' | 'offline';
        localBaseUrl: string | null;
        lastError: string | null;
        relayPerformance: {
            connectionAttempts: Array<{
                attempt: number;
                startedAt: number;
                websocketOpenedAt: number | null;
                handshakeReadyAt: number | null;
                failedAt: number | null;
            }>;
            localListenerReadyAt: number | null;
            activeStreams: Array<{
                streamId: string;
                openedAt: number;
                firstRequestByteAt: number | null;
                firstResponseByteAt: number | null;
                closedAt: number | null;
            }>;
            completedStreams: Array<{
                streamId: string;
                openedAt: number;
                firstRequestByteAt: number | null;
                firstResponseByteAt: number | null;
                closedAt: number | null;
            }>;
        } | null;
    };
};

export type PostRemoteHostsByHostIdCradleServerConnectResponse = PostRemoteHostsByHostIdCradleServerConnectResponses[keyof PostRemoteHostsByHostIdCradleServerConnectResponses];

export type PostRemoteHostsByHostIdCradleServerDisconnectData = {
    body?: never;
    path: {
        hostId: string;
    };
    query?: never;
    url: '/remote-hosts/{hostId}/cradle-server/disconnect';
};

export type PostRemoteHostsByHostIdCradleServerDisconnectResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type PostRemoteHostsByHostIdCradleServerDisconnectResponse = PostRemoteHostsByHostIdCradleServerDisconnectResponses[keyof PostRemoteHostsByHostIdCradleServerDisconnectResponses];

export type GetRemoteHostsByHostIdCradleServerHealthData = {
    body?: never;
    path: {
        hostId: string;
    };
    query?: never;
    url: '/remote-hosts/{hostId}/cradle-server/health';
};

export type GetRemoteHostsByHostIdCradleServerHealthResponses = {
    /**
     * Response for status 200
     */
    200: {
        hostId: string;
        state: 'idle' | 'warming' | 'connected' | 'offline';
        localBaseUrl: string | null;
        lastError: string | null;
        relayPerformance: {
            connectionAttempts: Array<{
                attempt: number;
                startedAt: number;
                websocketOpenedAt: number | null;
                handshakeReadyAt: number | null;
                failedAt: number | null;
            }>;
            localListenerReadyAt: number | null;
            activeStreams: Array<{
                streamId: string;
                openedAt: number;
                firstRequestByteAt: number | null;
                firstResponseByteAt: number | null;
                closedAt: number | null;
            }>;
            completedStreams: Array<{
                streamId: string;
                openedAt: number;
                firstRequestByteAt: number | null;
                firstResponseByteAt: number | null;
                closedAt: number | null;
            }>;
        } | null;
        status: 'ok';
        health: {
            status: 'ok';
            uptime: number;
            memory: {
                heapUsed: number;
                heapTotal: number;
                rss: number;
                external: number;
            };
            cpu: {
                percent: number | null;
                userMicros: number;
                systemMicros: number;
                sampleMs: number | null;
                usedMicros: number | null;
                windowReady: boolean;
            };
            timestamp: number;
        };
    };
};

export type GetRemoteHostsByHostIdCradleServerHealthResponse = GetRemoteHostsByHostIdCradleServerHealthResponses[keyof GetRemoteHostsByHostIdCradleServerHealthResponses];

export type PostRemoteHostsByHostIdCradleServerTestData = {
    body?: never;
    path: {
        hostId: string;
    };
    query?: never;
    url: '/remote-hosts/{hostId}/cradle-server/test';
};

export type PostRemoteHostsByHostIdCradleServerTestResponses = {
    /**
     * Response for status 200
     */
    200: {
        hostId: string;
        state: 'idle' | 'warming' | 'connected' | 'offline';
        localBaseUrl: string | null;
        lastError: string | null;
        relayPerformance: {
            connectionAttempts: Array<{
                attempt: number;
                startedAt: number;
                websocketOpenedAt: number | null;
                handshakeReadyAt: number | null;
                failedAt: number | null;
            }>;
            localListenerReadyAt: number | null;
            activeStreams: Array<{
                streamId: string;
                openedAt: number;
                firstRequestByteAt: number | null;
                firstResponseByteAt: number | null;
                closedAt: number | null;
            }>;
            completedStreams: Array<{
                streamId: string;
                openedAt: number;
                firstRequestByteAt: number | null;
                firstResponseByteAt: number | null;
                closedAt: number | null;
            }>;
        } | null;
        status: 'ok';
        health: {
            status: 'ok';
            uptime: number;
            memory: {
                heapUsed: number;
                heapTotal: number;
                rss: number;
                external: number;
            };
            cpu: {
                percent: number | null;
                userMicros: number;
                systemMicros: number;
                sampleMs: number | null;
                usedMicros: number | null;
                windowReady: boolean;
            };
            timestamp: number;
        };
    };
};

export type PostRemoteHostsByHostIdCradleServerTestResponse = PostRemoteHostsByHostIdCradleServerTestResponses[keyof PostRemoteHostsByHostIdCradleServerTestResponses];

export type PostRemoteHostsByHostIdRelayClaimData = {
    body: {
        pairingString: string;
    };
    path: {
        hostId: string;
    };
    query?: never;
    url: '/remote-hosts/{hostId}/relay/claim';
};

export type PostRemoteHostsByHostIdRelayClaimResponses = {
    /**
     * Response for status 200
     */
    200: {
        hostId: string;
        state: 'idle' | 'warming' | 'connected' | 'offline';
        localBaseUrl: string | null;
        lastError: string | null;
        relayPerformance: {
            connectionAttempts: Array<{
                attempt: number;
                startedAt: number;
                websocketOpenedAt: number | null;
                handshakeReadyAt: number | null;
                failedAt: number | null;
            }>;
            localListenerReadyAt: number | null;
            activeStreams: Array<{
                streamId: string;
                openedAt: number;
                firstRequestByteAt: number | null;
                firstResponseByteAt: number | null;
                closedAt: number | null;
            }>;
            completedStreams: Array<{
                streamId: string;
                openedAt: number;
                firstRequestByteAt: number | null;
                firstResponseByteAt: number | null;
                closedAt: number | null;
            }>;
        } | null;
    };
};

export type PostRemoteHostsByHostIdRelayClaimResponse = PostRemoteHostsByHostIdRelayClaimResponses[keyof PostRemoteHostsByHostIdRelayClaimResponses];

export type AllRemoteHostsByHostIdUpstreamData = {
    body?: never;
    path: {
        hostId: string;
        '*': string;
    };
    query?: never;
    url: '/remote-hosts/{hostId}/upstream/*';
};

export type AllRemoteHostsByHostIdUpstream2Data = {
    body?: never;
    path: {
        hostId: string;
        '*': string;
    };
    query?: never;
    url: '/remote-hosts/{hostId}/upstream/*';
};

export type AllRemoteHostsByHostIdUpstream3Data = {
    body?: never;
    path: {
        hostId: string;
        '*': string;
    };
    query?: never;
    url: '/remote-hosts/{hostId}/upstream/*';
};

export type AllRemoteHostsByHostIdUpstream4Data = {
    body?: never;
    path: {
        hostId: string;
        '*': string;
    };
    query?: never;
    url: '/remote-hosts/{hostId}/upstream/*';
};

export type AllRemoteHostsByHostIdUpstream5Data = {
    body?: never;
    path: {
        hostId: string;
        '*': string;
    };
    query?: never;
    url: '/remote-hosts/{hostId}/upstream/*';
};

export type AllRemoteHostsByHostIdUpstream6Data = {
    body?: never;
    path: {
        hostId: string;
        '*': string;
    };
    query?: never;
    url: '/remote-hosts/{hostId}/upstream/*';
};

export type AllRemoteHostsByHostIdUpstream7Data = {
    body?: never;
    path: {
        hostId: string;
        '*': string;
    };
    query?: never;
    url: '/remote-hosts/{hostId}/upstream/*';
};

export type AllRemoteHostsByHostIdUpstream8Data = {
    body?: never;
    path: {
        hostId: string;
        '*': string;
    };
    query?: never;
    url: '/remote-hosts/{hostId}/upstream/*';
};

export type GetExternalIssueSourcesData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/external-issue-sources';
};

export type GetExternalIssueSourcesResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        pluginName: string;
        sourceId: string;
        label: string;
        description: string | null;
        enabled: boolean;
        registrationStatus: 'registered' | 'unregistered';
        capabilities: {
            [key: string]: unknown;
        };
        inventory: {
            [key: string]: unknown;
        };
        warnings: Array<{
            code: string;
            message: string;
            severity: 'info' | 'warning' | 'error';
        }>;
        lastSyncStatus: 'never' | 'ok' | 'warning' | 'error' | 'rate-limited' | 'not-modified';
        lastSyncMessage: string | null;
        lastSyncError: string | null;
        lastSyncAt: number | null;
        registeredAt: number;
    }>;
};

export type GetExternalIssueSourcesResponse = GetExternalIssueSourcesResponses[keyof GetExternalIssueSourcesResponses];

export type GetExternalIssueSourcesBindingsData = {
    body?: never;
    path?: never;
    query?: {
        workspaceId?: string;
        sourceKey?: string;
    };
    url: '/external-issue-sources/bindings';
};

export type GetExternalIssueSourcesBindingsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        workspaceId: string;
        sourceKey: string;
        repositoryOwner: string;
        repositoryName: string;
        enabled: boolean;
        scheduleEnabled: boolean;
        refreshIntervalSeconds: number;
        lastRefreshStatus: 'never' | 'ok' | 'warning' | 'error' | 'rate-limited' | 'not-modified';
        lastRefreshMessage: string | null;
        lastRefreshError: string | null;
        lastRefreshAt: number | null;
        nextRefreshAfter: number | null;
        createdAt: number;
        updatedAt: number;
    }>;
};

export type GetExternalIssueSourcesBindingsResponse = GetExternalIssueSourcesBindingsResponses[keyof GetExternalIssueSourcesBindingsResponses];

export type PostExternalIssueSourcesBySourceKeyBindingsData = {
    body: {
        workspaceId: string;
        repositoryOwner: string;
        repositoryName: string;
        scheduleEnabled?: boolean;
        refreshIntervalSeconds?: number;
        refreshNow?: boolean;
    };
    path: {
        sourceKey: string;
    };
    query?: never;
    url: '/external-issue-sources/{sourceKey}/bindings';
};

export type PostExternalIssueSourcesBySourceKeyBindingsResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string;
        sourceKey: string;
        repositoryOwner: string;
        repositoryName: string;
        enabled: boolean;
        scheduleEnabled: boolean;
        refreshIntervalSeconds: number;
        lastRefreshStatus: 'never' | 'ok' | 'warning' | 'error' | 'rate-limited' | 'not-modified';
        lastRefreshMessage: string | null;
        lastRefreshError: string | null;
        lastRefreshAt: number | null;
        nextRefreshAfter: number | null;
        createdAt: number;
        updatedAt: number;
    };
};

export type PostExternalIssueSourcesBySourceKeyBindingsResponse = PostExternalIssueSourcesBySourceKeyBindingsResponses[keyof PostExternalIssueSourcesBySourceKeyBindingsResponses];

export type DeleteExternalIssueSourcesBindingsByBindingIdData = {
    body?: never;
    path: {
        bindingId: string;
    };
    query?: never;
    url: '/external-issue-sources/bindings/{bindingId}';
};

export type DeleteExternalIssueSourcesBindingsByBindingIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type DeleteExternalIssueSourcesBindingsByBindingIdResponse = DeleteExternalIssueSourcesBindingsByBindingIdResponses[keyof DeleteExternalIssueSourcesBindingsByBindingIdResponses];

export type PatchExternalIssueSourcesBindingsByBindingIdData = {
    body: {
        enabled?: boolean;
        scheduleEnabled?: boolean;
        refreshIntervalSeconds?: number;
    };
    path: {
        bindingId: string;
    };
    query?: never;
    url: '/external-issue-sources/bindings/{bindingId}';
};

export type PatchExternalIssueSourcesBindingsByBindingIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string;
        sourceKey: string;
        repositoryOwner: string;
        repositoryName: string;
        enabled: boolean;
        scheduleEnabled: boolean;
        refreshIntervalSeconds: number;
        lastRefreshStatus: 'never' | 'ok' | 'warning' | 'error' | 'rate-limited' | 'not-modified';
        lastRefreshMessage: string | null;
        lastRefreshError: string | null;
        lastRefreshAt: number | null;
        nextRefreshAfter: number | null;
        createdAt: number;
        updatedAt: number;
    };
};

export type PatchExternalIssueSourcesBindingsByBindingIdResponse = PatchExternalIssueSourcesBindingsByBindingIdResponses[keyof PatchExternalIssueSourcesBindingsByBindingIdResponses];

export type PostExternalIssueSourcesBindingsByBindingIdRefreshData = {
    body: {
        force?: boolean;
    };
    path: {
        bindingId: string;
    };
    query?: never;
    url: '/external-issue-sources/bindings/{bindingId}/refresh';
};

export type PostExternalIssueSourcesBindingsByBindingIdRefreshResponses = {
    /**
     * Response for status 200
     */
    200: {
        sourceKey: string;
        bindingId: string;
        workspaceId: string;
        repositoryOwner: string;
        repositoryName: string;
        status: 'never' | 'ok' | 'warning' | 'error' | 'rate-limited' | 'not-modified';
        recordsSeen: number;
        recordsProjected: number;
        recordsMissing: number;
        notModified: boolean;
        rateLimitRemaining: number | null;
        rateLimitResetAt: number | null;
        message?: string;
    };
};

export type PostExternalIssueSourcesBindingsByBindingIdRefreshResponse = PostExternalIssueSourcesBindingsByBindingIdRefreshResponses[keyof PostExternalIssueSourcesBindingsByBindingIdRefreshResponses];

export type PostExternalIssueSourcesBySourceKeyRefreshData = {
    body: {
        workspaceId: string;
        force?: boolean;
    };
    path: {
        sourceKey: string;
    };
    query?: never;
    url: '/external-issue-sources/{sourceKey}/refresh';
};

export type PostExternalIssueSourcesBySourceKeyRefreshResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        sourceKey: string;
        bindingId: string;
        workspaceId: string;
        repositoryOwner: string;
        repositoryName: string;
        status: 'never' | 'ok' | 'warning' | 'error' | 'rate-limited' | 'not-modified';
        recordsSeen: number;
        recordsProjected: number;
        recordsMissing: number;
        notModified: boolean;
        rateLimitRemaining: number | null;
        rateLimitResetAt: number | null;
        message?: string;
    }>;
};

export type PostExternalIssueSourcesBySourceKeyRefreshResponse = PostExternalIssueSourcesBySourceKeyRefreshResponses[keyof PostExternalIssueSourcesBySourceKeyRefreshResponses];

export type GetExternalIssueSourcesItemsData = {
    body?: never;
    path?: never;
    query?: {
        workspaceId?: string;
        sourceKey?: string;
        syncStatus?: 'active' | 'missing' | 'error';
    };
    url: '/external-issue-sources/items';
};

export type GetExternalIssueSourcesItemsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        bindingId: string;
        workspaceId: string;
        statusId: string | null;
        sourceKey: string;
        externalId: string;
        externalKey: string;
        externalUrl: string | null;
        repositoryOwner: string;
        repositoryName: string;
        number: number;
        title: string;
        body: string | null;
        sourceState: 'open' | 'closed';
        labels: Array<string>;
        assignees: Array<string>;
        milestone: string | null;
        sourceCreatedAt: string | null;
        sourceUpdatedAt: string | null;
        sourceClosedAt: string | null;
        syncStatus: 'active' | 'missing' | 'error';
        fingerprint: string;
        metadata: {
            [key: string]: unknown;
        };
        warnings: Array<{
            code: string;
            message: string;
            severity: 'info' | 'warning' | 'error';
        }>;
        lastSeenAt: number;
        createdAt: number;
        updatedAt: number;
    }>;
};

export type GetExternalIssueSourcesItemsResponse = GetExternalIssueSourcesItemsResponses[keyof GetExternalIssueSourcesItemsResponses];

export type PatchExternalIssueSourcesItemsByIdData = {
    body: {
        [key: string]: unknown;
    };
    path: {
        id: string;
    };
    query?: never;
    url: '/external-issue-sources/items/{id}';
};

export type PatchExternalIssueSourcesItemsByIdStatusData = {
    body: {
        statusId: string;
    };
    path: {
        id: string;
    };
    query?: never;
    url: '/external-issue-sources/items/{id}/status';
};

export type PatchExternalIssueSourcesItemsByIdStatusResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        bindingId: string;
        workspaceId: string;
        statusId: string | null;
        sourceKey: string;
        externalId: string;
        externalKey: string;
        externalUrl: string | null;
        repositoryOwner: string;
        repositoryName: string;
        number: number;
        title: string;
        body: string | null;
        sourceState: 'open' | 'closed';
        labels: Array<string>;
        assignees: Array<string>;
        milestone: string | null;
        sourceCreatedAt: string | null;
        sourceUpdatedAt: string | null;
        sourceClosedAt: string | null;
        syncStatus: 'active' | 'missing' | 'error';
        fingerprint: string;
        metadata: {
            [key: string]: unknown;
        };
        warnings: Array<{
            code: string;
            message: string;
            severity: 'info' | 'warning' | 'error';
        }>;
        lastSeenAt: number;
        createdAt: number;
        updatedAt: number;
    };
};

export type PatchExternalIssueSourcesItemsByIdStatusResponse = PatchExternalIssueSourcesItemsByIdStatusResponses[keyof PatchExternalIssueSourcesItemsByIdStatusResponses];

export type DeleteGithubAuthConnectionData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/github-auth/connection';
};

export type DeleteGithubAuthConnectionResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type DeleteGithubAuthConnectionResponse = DeleteGithubAuthConnectionResponses[keyof DeleteGithubAuthConnectionResponses];

export type GetGithubAuthConnectionData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/github-auth/connection';
};

export type GetGithubAuthConnectionResponses = {
    /**
     * Response for status 200
     */
    200: {
        state: 'unconfigured' | 'disconnected' | 'pending' | 'connected' | 'expired' | 'error';
        appName: string | null;
        appSlug: string | null;
        installationUrl: string | null;
        viewer: {
            login: string;
            avatarUrl: string | null;
            profileUrl: string | null;
        } | null;
        expiresAt: number | null;
        refreshTokenExpiresAt: number | null;
        error: string | null;
    };
};

export type GetGithubAuthConnectionResponse = GetGithubAuthConnectionResponses[keyof GetGithubAuthConnectionResponses];

export type PostGithubAuthDeviceLoginData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/github-auth/device-login';
};

export type PostGithubAuthDeviceLoginResponses = {
    /**
     * Response for status 200
     */
    200: {
        loginId: string;
        verificationUri: string;
        userCode: string;
        expiresAt: number;
        pollInterval: number;
    };
};

export type PostGithubAuthDeviceLoginResponse = PostGithubAuthDeviceLoginResponses[keyof PostGithubAuthDeviceLoginResponses];

export type GetGithubAuthDeviceLoginByLoginIdData = {
    body?: never;
    path: {
        loginId: string;
    };
    query?: never;
    url: '/github-auth/device-login/{loginId}';
};

export type GetGithubAuthDeviceLoginByLoginIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        loginId: string;
        state: 'pending' | 'completed' | 'failed' | 'cancelled';
        startedAt: number;
        completedAt: number | null;
        error: string | null;
    };
};

export type GetGithubAuthDeviceLoginByLoginIdResponse = GetGithubAuthDeviceLoginByLoginIdResponses[keyof GetGithubAuthDeviceLoginByLoginIdResponses];

export type PostGithubAuthDeviceLoginByLoginIdCancelData = {
    body?: never;
    path: {
        loginId: string;
    };
    query?: never;
    url: '/github-auth/device-login/{loginId}/cancel';
};

export type PostGithubAuthDeviceLoginByLoginIdCancelResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type PostGithubAuthDeviceLoginByLoginIdCancelResponse = PostGithubAuthDeviceLoginByLoginIdCancelResponses[keyof PostGithubAuthDeviceLoginByLoginIdCancelResponses];

export type GetExternalProviderSourcesData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/external-provider-sources';
};

export type GetExternalProviderSourcesResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        pluginName: string;
        sourceId: string;
        label: string;
        description: string | null;
        enabled: boolean;
        capabilities: {
            [key: string]: unknown;
        };
        inventory: {
            [key: string]: unknown;
        };
        warnings: Array<{
            code: string;
            message: string;
            severity: 'info' | 'warning' | 'error';
        }>;
        lastSyncStatus: 'never' | 'ok' | 'warning' | 'error';
        lastSyncMessage: string | null;
        lastSyncError: string | null;
        lastSyncAt: number | null;
        registeredAt: number;
    }>;
};

export type GetExternalProviderSourcesResponse = GetExternalProviderSourcesResponses[keyof GetExternalProviderSourcesResponses];

export type PostExternalProviderSourcesRefreshData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/external-provider-sources/refresh';
};

export type PostExternalProviderSourcesRefreshResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        sourceKey: string;
        status: 'never' | 'ok' | 'warning' | 'error';
        recordsSeen: number;
        recordsProjected: number;
        recordsMissing: number;
        message?: string;
    }>;
};

export type PostExternalProviderSourcesRefreshResponse = PostExternalProviderSourcesRefreshResponses[keyof PostExternalProviderSourcesRefreshResponses];

export type PostExternalProviderSourcesLocalScanData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/external-provider-sources/local-scan';
};

export type PostExternalProviderSourcesLocalScanResponses = {
    /**
     * Response for status 200
     */
    200: {
        sourceKey: string;
        status: 'never' | 'ok' | 'warning' | 'error';
        recordsSeen: number;
        recordsProjected: number;
        recordsMissing: number;
        message?: string;
    };
};

export type PostExternalProviderSourcesLocalScanResponse = PostExternalProviderSourcesLocalScanResponses[keyof PostExternalProviderSourcesLocalScanResponses];

export type PostExternalProviderSourcesBySourceKeyRefreshData = {
    body?: never;
    path: {
        sourceKey: string;
    };
    query?: never;
    url: '/external-provider-sources/{sourceKey}/refresh';
};

export type PostExternalProviderSourcesBySourceKeyRefreshResponses = {
    /**
     * Response for status 200
     */
    200: {
        sourceKey: string;
        status: 'never' | 'ok' | 'warning' | 'error';
        recordsSeen: number;
        recordsProjected: number;
        recordsMissing: number;
        message?: string;
    };
};

export type PostExternalProviderSourcesBySourceKeyRefreshResponse = PostExternalProviderSourcesBySourceKeyRefreshResponses[keyof PostExternalProviderSourcesBySourceKeyRefreshResponses];

export type GetExternalProviderSourcesRecordsData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/external-provider-sources/records';
};

export type GetExternalProviderSourcesRecordsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        providerTargetId: string | null;
        sourceKey: string;
        externalId: string;
        app: string;
        name: string;
        providerKind: 'anthropic' | 'openai-compatible' | 'universal' | 'cli-tool';
        status: 'active' | 'stale' | 'missing' | 'unsupported' | 'error';
        runtimeTargetEnabled: boolean;
        fingerprint: string;
        metadata: {
            [key: string]: unknown;
        };
        warnings: Array<{
            code: string;
            message: string;
            severity: 'info' | 'warning' | 'error';
        }>;
        lastSeenAt: number;
        createdAt: number;
        updatedAt: number;
    }>;
};

export type GetExternalProviderSourcesRecordsResponse = GetExternalProviderSourcesRecordsResponses[keyof GetExternalProviderSourcesRecordsResponses];

export type GetExternalProviderSourcesBySourceKeyRecordsByExternalRecordIdRuntimeTargetData = {
    body?: never;
    path: {
        sourceKey: string;
        externalRecordId: string;
    };
    query?: never;
    url: '/external-provider-sources/{sourceKey}/records/{externalRecordId}/runtime-target';
};

export type GetExternalProviderSourcesBySourceKeyRecordsByExternalRecordIdRuntimeTargetResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        sourceKey: string;
        externalRecordId: string;
        providerKind: 'anthropic' | 'openai-compatible' | 'universal' | 'cli-tool';
        displayName: string;
        enabled: boolean;
        credentialRef: string | null;
        iconSlug: string | null;
        lastResolvedFingerprint: string;
        createdAt: number;
        updatedAt: number;
    };
};

export type GetExternalProviderSourcesBySourceKeyRecordsByExternalRecordIdRuntimeTargetResponse = GetExternalProviderSourcesBySourceKeyRecordsByExternalRecordIdRuntimeTargetResponses[keyof GetExternalProviderSourcesBySourceKeyRecordsByExternalRecordIdRuntimeTargetResponses];

export type PatchExternalProviderSourcesBySourceKeyRecordsByExternalRecordIdRuntimeTargetData = {
    body: {
        enabled: boolean;
    };
    path: {
        sourceKey: string;
        externalRecordId: string;
    };
    query?: never;
    url: '/external-provider-sources/{sourceKey}/records/{externalRecordId}/runtime-target';
};

export type PatchExternalProviderSourcesBySourceKeyRecordsByExternalRecordIdRuntimeTargetResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        sourceKey: string;
        externalRecordId: string;
        providerKind: 'anthropic' | 'openai-compatible' | 'universal' | 'cli-tool';
        displayName: string;
        enabled: boolean;
        credentialRef: string | null;
        iconSlug: string | null;
        lastResolvedFingerprint: string;
        createdAt: number;
        updatedAt: number;
    };
};

export type PatchExternalProviderSourcesBySourceKeyRecordsByExternalRecordIdRuntimeTargetResponse = PatchExternalProviderSourcesBySourceKeyRecordsByExternalRecordIdRuntimeTargetResponses[keyof PatchExternalProviderSourcesBySourceKeyRecordsByExternalRecordIdRuntimeTargetResponses];

export type PostExternalSessionImportScansData = {
    body: {
        sourceHostId?: string;
        sourceApps?: Array<'claude' | 'codex'>;
        limitPerSource?: number;
    };
    path?: never;
    query?: never;
    url: '/external-session-import/scans';
};

export type PostExternalSessionImportScansResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        createdAt: number;
        candidates: Array<{
            candidateId: string;
            sourceHostId: string;
            sourceApp: 'claude' | 'codex';
            externalSessionId: string;
            sourceRevision: string;
            title: string;
            summary: string | null;
            workspacePath: string;
            createdAt: number | null;
            updatedAt: number | null;
            archived: boolean;
            estimatedBytes: number | null;
            childSessionCount: number | null;
            alreadyImported: boolean;
            importState: 'available' | 'imported' | 'update-available';
            importRecordId: string | null;
            workspacePlan: {
                kind: 'existing' | 'create';
                reason: 'exact-path' | 'containing-path' | 'git-identity' | 'import-record' | 'available-project-root' | 'offline-historical-root';
                historicalKey: string;
                workspaceId: string | null;
                name: string;
                path: string;
                availability: 'available' | 'missing' | 'remote';
            };
        }>;
        warnings: Array<string>;
    };
};

export type PostExternalSessionImportScansResponse = PostExternalSessionImportScansResponses[keyof PostExternalSessionImportScansResponses];

export type GetExternalSessionImportScansByScanIdData = {
    body?: never;
    path: {
        scanId: string;
    };
    query?: never;
    url: '/external-session-import/scans/{scanId}';
};

export type GetExternalSessionImportScansByScanIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        createdAt: number;
        candidates: Array<{
            candidateId: string;
            sourceHostId: string;
            sourceApp: 'claude' | 'codex';
            externalSessionId: string;
            sourceRevision: string;
            title: string;
            summary: string | null;
            workspacePath: string;
            createdAt: number | null;
            updatedAt: number | null;
            archived: boolean;
            estimatedBytes: number | null;
            childSessionCount: number | null;
            alreadyImported: boolean;
            importState: 'available' | 'imported' | 'update-available';
            importRecordId: string | null;
            workspacePlan: {
                kind: 'existing' | 'create';
                reason: 'exact-path' | 'containing-path' | 'git-identity' | 'import-record' | 'available-project-root' | 'offline-historical-root';
                historicalKey: string;
                workspaceId: string | null;
                name: string;
                path: string;
                availability: 'available' | 'missing' | 'remote';
            };
        }>;
        warnings: Array<string>;
    };
};

export type GetExternalSessionImportScansByScanIdResponse = GetExternalSessionImportScansByScanIdResponses[keyof GetExternalSessionImportScansByScanIdResponses];

export type GetExternalSessionImportImportsData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/external-session-import/imports';
};

export type GetExternalSessionImportImportsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        sourceHostId: string;
        sourceApp: 'claude' | 'codex';
        externalSessionId: string;
        sourcePath: string | null;
        sourceWorkspacePath: string;
        sourceRevision: string;
        contentHash: string;
        sourceGitIdentityJson: string;
        workspaceId: string;
        sessionId: string;
        fidelityJson: string;
        checkpointJson: string;
        status: 'imported' | 'update-available' | 'error';
        statusReason: string | null;
        importedAt: number;
        lastSyncedAt: number;
        createdAt: number;
        updatedAt: number;
    }>;
};

export type GetExternalSessionImportImportsResponse = GetExternalSessionImportImportsResponses[keyof GetExternalSessionImportImportsResponses];

export type PostExternalSessionImportImportsData = {
    body: {
        scanId: string;
        candidateIds: Array<string>;
    };
    path?: never;
    query?: never;
    url: '/external-session-import/imports';
};

export type PostExternalSessionImportImportsResponses = {
    /**
     * Response for status 200
     */
    200: {
        imported: number;
        duplicates: number;
        errors: number;
        items: Array<{
            candidateId: string;
            status: 'imported' | 'duplicate' | 'error';
            sessionId: string | null;
            workspaceId: string | null;
            recordId: string | null;
            reason: string | null;
        }>;
    };
};

export type PostExternalSessionImportImportsResponse = PostExternalSessionImportImportsResponses[keyof PostExternalSessionImportImportsResponses];

export type PostExternalSessionImportImportsByImportIdSyncData = {
    body: {
        scanId: string;
        candidateId: string;
    };
    path: {
        importId: string;
    };
    query?: never;
    url: '/external-session-import/imports/{importId}/sync';
};

export type PostExternalSessionImportImportsByImportIdSyncResponses = {
    /**
     * Response for status 200
     */
    200: {
        importId: string;
        sessionId: string;
        workspaceId: string;
        status: 'unchanged' | 'synced' | 'diverged';
        appendedMessages: number;
        reason: string | null;
    };
};

export type PostExternalSessionImportImportsByImportIdSyncResponse = PostExternalSessionImportImportsByImportIdSyncResponses[keyof PostExternalSessionImportImportsByImportIdSyncResponses];

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

export type GetSecretsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        kind: string;
        label: string;
        maskedSecret: string;
        chatgpt?: {
            chatgptAccountId: string;
            chatgptPlanType: string | null;
            updatedAt: number;
        } | null;
        createdAt: number;
        updatedAt: number;
    }>;
};

export type GetSecretsResponse = GetSecretsResponses[keyof GetSecretsResponses];

export type PostSecretsData = {
    body: {
        kind: string;
        label: string;
        secret: string;
    };
    path?: never;
    query?: never;
    url: '/secrets/';
};

export type PostSecretsResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        kind: string;
        label: string;
        maskedSecret: string;
        chatgpt?: {
            chatgptAccountId: string;
            chatgptPlanType: string | null;
            updatedAt: number;
        } | null;
        createdAt: number;
        updatedAt: number;
    };
};

export type PostSecretsResponse = PostSecretsResponses[keyof PostSecretsResponses];

export type PostSecretsByIdRevealData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/secrets/{id}/reveal';
};

export type PostSecretsByIdRevealResponses = {
    /**
     * Response for status 200
     */
    200: {
        secret: string;
    };
};

export type PostSecretsByIdRevealResponse = PostSecretsByIdRevealResponses[keyof PostSecretsByIdRevealResponses];

export type DeleteSecretsByIdData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/secrets/{id}';
};

export type DeleteSecretsByIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type DeleteSecretsByIdResponse = DeleteSecretsByIdResponses[keyof DeleteSecretsByIdResponses];

export type GetModelRegistryMappingsData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/model-registry/mappings';
};

export type GetModelRegistryMappingsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        modelId: string;
        registryModelId: string;
        matchType: 'manual' | 'alias';
        model?: {
            id: string;
            name?: string;
            limit?: {
                context?: number;
                output?: number;
            };
            modalities?: {
                input?: Array<string>;
                output?: Array<string>;
            };
            reasoning?: boolean;
            tool_call?: boolean;
            temperature?: boolean;
            structured_output?: boolean;
            cost?: {
                input?: number;
                output?: number;
                cache_read?: number;
                cache_write?: number;
            };
            family?: string;
            knowledge?: string;
            release_date?: string;
        };
        createdAt: number;
        updatedAt: number;
    }>;
};

export type GetModelRegistryMappingsResponse = GetModelRegistryMappingsResponses[keyof GetModelRegistryMappingsResponses];

export type DeleteModelRegistryMappingsByModelIdData = {
    body?: never;
    path: {
        modelId: string;
    };
    query?: never;
    url: '/model-registry/mappings/{modelId}';
};

export type DeleteModelRegistryMappingsByModelIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type DeleteModelRegistryMappingsByModelIdResponse = DeleteModelRegistryMappingsByModelIdResponses[keyof DeleteModelRegistryMappingsByModelIdResponses];

export type PutModelRegistryMappingsByModelIdData = {
    body: {
        registryModelId?: string;
        matchType?: 'manual' | 'alias';
        model?: {
            id: string;
            name?: string;
            limit?: {
                context?: number;
                output?: number;
            };
            modalities?: {
                input?: Array<string>;
                output?: Array<string>;
            };
            reasoning?: boolean;
            tool_call?: boolean;
            temperature?: boolean;
            structured_output?: boolean;
            cost?: {
                input?: number;
                output?: number;
                cache_read?: number;
                cache_write?: number;
            };
            family?: string;
            knowledge?: string;
            release_date?: string;
        };
    };
    path: {
        modelId: string;
    };
    query?: never;
    url: '/model-registry/mappings/{modelId}';
};

export type PutModelRegistryMappingsByModelIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        modelId: string;
        registryModelId: string;
        matchType: 'manual' | 'alias';
        model?: {
            id: string;
            name?: string;
            limit?: {
                context?: number;
                output?: number;
            };
            modalities?: {
                input?: Array<string>;
                output?: Array<string>;
            };
            reasoning?: boolean;
            tool_call?: boolean;
            temperature?: boolean;
            structured_output?: boolean;
            cost?: {
                input?: number;
                output?: number;
                cache_read?: number;
                cache_write?: number;
            };
            family?: string;
            knowledge?: string;
            release_date?: string;
        };
        createdAt: number;
        updatedAt: number;
    };
};

export type PutModelRegistryMappingsByModelIdResponse = PutModelRegistryMappingsByModelIdResponses[keyof PutModelRegistryMappingsByModelIdResponses];

export type GetMcpServersRegistryServersData = {
    body?: never;
    path?: never;
    query?: {
        search?: string;
        cursor?: string;
    };
    url: '/mcp-servers/registry/servers';
};

export type GetMcpServersRegistryServersResponses = {
    /**
     * Response for status 200
     */
    200: {
        servers: Array<{
            name: string;
            title: string | null;
            description: string | null;
            version: string | null;
            publishedAt: string | null;
            packageRegistry: 'npm' | 'pypi' | 'oci' | null;
            env: Array<{
                name: string;
                description: string | null;
                required: boolean;
            }>;
            installHint: {
                transport: 'stdio';
                command: string;
                args: Array<string>;
            } | {
                transport: 'streamable-http';
                url: string;
            } | null;
        }>;
        nextCursor: string | null;
    };
};

export type GetMcpServersRegistryServersResponse = GetMcpServersRegistryServersResponses[keyof GetMcpServersRegistryServersResponses];

export type GetMcpServersData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/mcp-servers/';
};

export type GetMcpServersResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        name: string;
        transport: 'stdio' | 'streamable-http';
        enabled: boolean;
        command?: string;
        args?: Array<string>;
        url?: string;
        secretKeys: Array<string>;
        status: 'ready' | 'disabled' | 'error';
        error?: string;
        supportedRuntimes: Array<string>;
        createdAt: number;
        updatedAt: number;
    }>;
};

export type GetMcpServersResponse = GetMcpServersResponses[keyof GetMcpServersResponses];

export type PostMcpServersData = {
    body: {
        transport: 'stdio';
        name: string;
        enabled: boolean;
        command: string;
        args: Array<string>;
        secretValues?: {
            [key: string]: unknown;
        };
    } | {
        transport: 'streamable-http';
        name: string;
        enabled: boolean;
        url: string;
        secretValues?: {
            [key: string]: unknown;
        };
    };
    path?: never;
    query?: never;
    url: '/mcp-servers/';
};

export type PostMcpServersResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        name: string;
        transport: 'stdio' | 'streamable-http';
        enabled: boolean;
        command?: string;
        args?: Array<string>;
        url?: string;
        secretKeys: Array<string>;
        status: 'ready' | 'disabled' | 'error';
        error?: string;
        supportedRuntimes: Array<string>;
        createdAt: number;
        updatedAt: number;
    };
};

export type PostMcpServersResponse = PostMcpServersResponses[keyof PostMcpServersResponses];

export type DeleteMcpServersByIdData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/mcp-servers/{id}';
};

export type DeleteMcpServersByIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type DeleteMcpServersByIdResponse = DeleteMcpServersByIdResponses[keyof DeleteMcpServersByIdResponses];

export type PutMcpServersByIdData = {
    body: {
        transport: 'stdio';
        name: string;
        enabled: boolean;
        command: string;
        args: Array<string>;
        secretValues?: {
            [key: string]: unknown;
        };
    } | {
        transport: 'streamable-http';
        name: string;
        enabled: boolean;
        url: string;
        secretValues?: {
            [key: string]: unknown;
        };
    };
    path: {
        id: string;
    };
    query?: never;
    url: '/mcp-servers/{id}';
};

export type PutMcpServersByIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        name: string;
        transport: 'stdio' | 'streamable-http';
        enabled: boolean;
        command?: string;
        args?: Array<string>;
        url?: string;
        secretKeys: Array<string>;
        status: 'ready' | 'disabled' | 'error';
        error?: string;
        supportedRuntimes: Array<string>;
        createdAt: number;
        updatedAt: number;
    };
};

export type PutMcpServersByIdResponse = PutMcpServersByIdResponses[keyof PutMcpServersByIdResponses];

export type PatchMcpServersByIdEnabledData = {
    body: {
        enabled: boolean;
    };
    path: {
        id: string;
    };
    query?: never;
    url: '/mcp-servers/{id}/enabled';
};

export type PatchMcpServersByIdEnabledResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        name: string;
        transport: 'stdio' | 'streamable-http';
        enabled: boolean;
        command?: string;
        args?: Array<string>;
        url?: string;
        secretKeys: Array<string>;
        status: 'ready' | 'disabled' | 'error';
        error?: string;
        supportedRuntimes: Array<string>;
        createdAt: number;
        updatedAt: number;
    };
};

export type PatchMcpServersByIdEnabledResponse = PatchMcpServersByIdEnabledResponses[keyof PatchMcpServersByIdEnabledResponses];

export type PostProvidersModelsData = {
    body: {
        providerKind: 'openai-compatible' | 'anthropic' | 'universal';
        label: string;
        config: {
            [key: string]: unknown;
        };
        secretRef?: string | null;
        profileId?: string | null;
        providerTargetKind?: 'manual' | 'external' | null;
        providerTargetId?: string | null;
        workspaceId?: string | null;
    };
    path?: never;
    query?: never;
    url: '/providers/models';
};

export type PostProvidersModelsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        label: string;
        providerKind: 'openai-compatible' | 'anthropic' | 'universal';
        capabilities: {
            contextWindow?: number;
            maxOutput?: number;
            inputModalities?: Array<string>;
            outputModalities?: Array<string>;
            reasoning?: boolean;
            reasoningEfforts?: Array<'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra'>;
            toolCall?: boolean;
            temperature?: boolean;
            structuredOutput?: boolean;
            cost?: {
                input?: number;
                output?: number;
                cacheRead?: number;
                cacheWrite?: number;
            };
            family?: string;
            knowledgeCutoff?: string;
            releaseDate?: string;
            registryMatch?: 'exact' | 'fuzzy' | 'manual' | 'alias' | 'unmatched';
            registryModelId?: string;
            registryModelLabel?: string;
        };
    }>;
};

export type PostProvidersModelsResponse = PostProvidersModelsResponses[keyof PostProvidersModelsResponses];

export type GetProvidersTargetsByProviderTargetIdModelsCacheData = {
    body?: never;
    path: {
        providerTargetId: string;
    };
    query?: never;
    url: '/providers/targets/{providerTargetId}/models-cache';
};

export type GetProvidersTargetsByProviderTargetIdModelsCacheResponses = {
    /**
     * Response for status 200
     */
    200: {
        models: Array<{
            id: string;
            label: string;
            providerKind: 'openai-compatible' | 'anthropic' | 'universal';
            capabilities: {
                contextWindow?: number;
                maxOutput?: number;
                inputModalities?: Array<string>;
                outputModalities?: Array<string>;
                reasoning?: boolean;
                reasoningEfforts?: Array<'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra'>;
                toolCall?: boolean;
                temperature?: boolean;
                structuredOutput?: boolean;
                cost?: {
                    input?: number;
                    output?: number;
                    cacheRead?: number;
                    cacheWrite?: number;
                };
                family?: string;
                knowledgeCutoff?: string;
                releaseDate?: string;
                registryMatch?: 'exact' | 'fuzzy' | 'manual' | 'alias' | 'unmatched';
                registryModelId?: string;
                registryModelLabel?: string;
            };
        }>;
        cached: boolean;
        stale: boolean;
        coolingDown: boolean;
        providerLabel: string;
    };
};

export type GetProvidersTargetsByProviderTargetIdModelsCacheResponse = GetProvidersTargetsByProviderTargetIdModelsCacheResponses[keyof GetProvidersTargetsByProviderTargetIdModelsCacheResponses];

export type GetProvidersByProfileIdModelsCacheData = {
    body?: never;
    path: {
        profileId: string;
    };
    query?: never;
    url: '/providers/{profileId}/models-cache';
};

export type GetProvidersByProfileIdModelsCacheResponses = {
    /**
     * Response for status 200
     */
    200: {
        models: Array<{
            id: string;
            label: string;
            providerKind: 'openai-compatible' | 'anthropic' | 'universal';
            capabilities: {
                contextWindow?: number;
                maxOutput?: number;
                inputModalities?: Array<string>;
                outputModalities?: Array<string>;
                reasoning?: boolean;
                reasoningEfforts?: Array<'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra'>;
                toolCall?: boolean;
                temperature?: boolean;
                structuredOutput?: boolean;
                cost?: {
                    input?: number;
                    output?: number;
                    cacheRead?: number;
                    cacheWrite?: number;
                };
                family?: string;
                knowledgeCutoff?: string;
                releaseDate?: string;
                registryMatch?: 'exact' | 'fuzzy' | 'manual' | 'alias' | 'unmatched';
                registryModelId?: string;
                registryModelLabel?: string;
            };
        }>;
        cached: boolean;
        stale: boolean;
        coolingDown: boolean;
    };
};

export type GetProvidersByProfileIdModelsCacheResponse = GetProvidersByProfileIdModelsCacheResponses[keyof GetProvidersByProfileIdModelsCacheResponses];

export type PostProvidersModelLookupData = {
    body: {
        modelId: string;
    };
    path?: never;
    query?: never;
    url: '/providers/model-lookup';
};

export type PostProvidersModelLookupResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        label: string;
        capabilities: {
            contextWindow?: number;
            maxOutput?: number;
            inputModalities?: Array<string>;
            outputModalities?: Array<string>;
            reasoning?: boolean;
            reasoningEfforts?: Array<'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra'>;
            toolCall?: boolean;
            temperature?: boolean;
            structuredOutput?: boolean;
            cost?: {
                input?: number;
                output?: number;
                cacheRead?: number;
                cacheWrite?: number;
            };
            family?: string;
            knowledgeCutoff?: string;
            releaseDate?: string;
            registryMatch?: 'exact' | 'fuzzy' | 'manual' | 'alias' | 'unmatched';
            registryModelId?: string;
            registryModelLabel?: string;
        };
    } | null;
};

export type PostProvidersModelLookupResponse = PostProvidersModelLookupResponses[keyof PostProvidersModelLookupResponses];

export type PostProvidersModelSearchData = {
    body: {
        query: string;
    };
    path?: never;
    query?: never;
    url: '/providers/model-search';
};

export type PostProvidersModelSearchResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        label: string;
        capabilities: {
            contextWindow?: number;
            maxOutput?: number;
            inputModalities?: Array<string>;
            outputModalities?: Array<string>;
            reasoning?: boolean;
            reasoningEfforts?: Array<'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra'>;
            toolCall?: boolean;
            temperature?: boolean;
            structuredOutput?: boolean;
            cost?: {
                input?: number;
                output?: number;
                cacheRead?: number;
                cacheWrite?: number;
            };
            family?: string;
            knowledgeCutoff?: string;
            releaseDate?: string;
            registryMatch?: 'exact' | 'fuzzy' | 'manual' | 'alias' | 'unmatched';
            registryModelId?: string;
            registryModelLabel?: string;
        };
    }>;
};

export type PostProvidersModelSearchResponse = PostProvidersModelSearchResponses[keyof PostProvidersModelSearchResponses];

export type GetProviderPresetsData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/provider-presets';
};

export type GetProviderPresetsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        name: string;
        providerKind: 'openai-compatible' | 'anthropic' | 'universal';
        baseUrl: string;
        iconSlug?: string;
        docsUrl?: string;
        local: boolean;
        requiresApiKey: boolean;
        source: 'models.dev' | 'overlay' | 'builtin';
        providerId: string;
        tier: 'first-class' | 'generic';
        featured?: boolean;
        authMethods: Array<{
            id: string;
            label: string;
        }>;
        endpointProfiles: Array<{
            id: string;
            label: string;
            wireKind: 'openai-compatible' | 'anthropic' | 'universal';
            defaultBaseUrl?: string;
            optional?: boolean;
        }>;
        models: Array<{
            id: string;
            name?: string;
            reasoning?: boolean;
            toolCall?: boolean;
            vision?: boolean;
        }>;
    }>;
};

export type GetProviderPresetsResponse = GetProviderPresetsResponses[keyof GetProviderPresetsResponses];

export type GetAgentsData = {
    body?: never;
    path?: never;
    query?: {
        enabled?: string;
        providerTargetId?: string;
    };
    url: '/agents/';
};

export type GetAgentsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        name: string;
        description: string | null;
        avatarUrl: string | null;
        avatarStyle: string;
        avatarSeed: string;
        providerTargetId: string | null;
        modelId: string | null;
        thinkingEffort: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra';
        runtimeKind: string;
        configJson: string;
        enabled: boolean;
        createdAt: number;
        updatedAt: number;
    }>;
};

export type GetAgentsResponse = GetAgentsResponses[keyof GetAgentsResponses];

export type PostAgentsData = {
    body: {
        name: string;
        description?: string | null;
        avatarStyle: string;
        avatarSeed: string;
        providerTargetId?: string | null;
        modelId?: string | null;
        thinkingEffort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra';
        runtimeKind?: string;
        configJson?: string;
    };
    path?: never;
    query?: never;
    url: '/agents/';
};

export type PostAgentsResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        name: string;
        description: string | null;
        avatarUrl: string | null;
        avatarStyle: string;
        avatarSeed: string;
        providerTargetId: string | null;
        modelId: string | null;
        thinkingEffort: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra';
        runtimeKind: string;
        configJson: string;
        enabled: boolean;
        createdAt: number;
        updatedAt: number;
    };
};

export type PostAgentsResponse = PostAgentsResponses[keyof PostAgentsResponses];

export type DeleteAgentsByIdData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/agents/{id}';
};

export type DeleteAgentsByIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type DeleteAgentsByIdResponse = DeleteAgentsByIdResponses[keyof DeleteAgentsByIdResponses];

export type GetAgentsByIdData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/agents/{id}';
};

export type GetAgentsByIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        name: string;
        description: string | null;
        avatarUrl: string | null;
        avatarStyle: string;
        avatarSeed: string;
        providerTargetId: string | null;
        modelId: string | null;
        thinkingEffort: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra';
        runtimeKind: string;
        configJson: string;
        enabled: boolean;
        createdAt: number;
        updatedAt: number;
    };
};

export type GetAgentsByIdResponse = GetAgentsByIdResponses[keyof GetAgentsByIdResponses];

export type PatchAgentsByIdData = {
    body: {
        name?: string;
        description?: string | null;
        avatarStyle?: string;
        avatarSeed?: string;
        providerTargetId?: string | null;
        modelId?: string | null;
        thinkingEffort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra';
        runtimeKind?: string;
        configJson?: string;
        enabled?: boolean;
    };
    path: {
        id: string;
    };
    query?: never;
    url: '/agents/{id}';
};

export type PatchAgentsByIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        name: string;
        description: string | null;
        avatarUrl: string | null;
        avatarStyle: string;
        avatarSeed: string;
        providerTargetId: string | null;
        modelId: string | null;
        thinkingEffort: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra';
        runtimeKind: string;
        configJson: string;
        enabled: boolean;
        createdAt: number;
        updatedAt: number;
    };
};

export type PatchAgentsByIdResponse = PatchAgentsByIdResponses[keyof PatchAgentsByIdResponses];

export type PostAgentsImportLocalConfigData = {
    body: {
        includeProcessEnv?: boolean;
        candidateIds?: Array<string>;
    };
    path?: never;
    query?: never;
    url: '/agents/import/local-config';
};

export type PostAgentsImportLocalConfigResponses = {
    /**
     * Response for status 200
     */
    200: {
        preview: {
            candidates: Array<{
                id: string;
                app: 'claude' | 'codex' | 'gemini' | 'pi' | 'kimi';
                runtimeKind: 'claude-agent' | 'codex' | 'cli-tui';
                sourceKind: 'cc-switch' | 'local-config';
                sourceLabel: string;
                externalRecordId: string;
                providerTargetId: string | null;
                agentName: string;
                resolvedProviderName: string;
                name: string;
                modelId: string | null;
                endpoint: string | null;
                executable: string | null;
                iconSlug: string | null;
                avatarUrl: string | null;
                importable: boolean;
                alreadyConfigured: boolean;
                reason: string | null;
                notes: Array<string>;
                agent: {
                    id: string;
                    name: string;
                    description: string | null;
                    avatarUrl: string | null;
                    avatarStyle: string;
                    avatarSeed: string;
                    providerTargetId: string | null;
                    modelId: string | null;
                    thinkingEffort: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra';
                    runtimeKind: string;
                    configJson: string;
                    enabled: boolean;
                    createdAt: number;
                    updatedAt: number;
                } | null;
            }>;
            sourceRefreshes: Array<{
                sourceKey: string;
                sourceLabel: string;
                status: 'ok' | 'warning' | 'error';
                recordsSeen: number;
                recordsProjected: number;
                recordsMissing: number;
                message: string | null;
            }>;
        };
        created: number;
        existing: number;
        skipped: number;
        agents: Array<{
            app: 'claude' | 'codex' | 'gemini' | 'pi' | 'kimi';
            candidateId: string;
            sourceKind: 'cc-switch' | 'local-config';
            externalRecordId: string;
            providerTargetId: string | null;
            runtimeKind: 'claude-agent' | 'codex' | 'cli-tui';
            status: 'created' | 'existing' | 'skipped';
            reason: string | null;
            agent: {
                id: string;
                name: string;
                description: string | null;
                avatarUrl: string | null;
                avatarStyle: string;
                avatarSeed: string;
                providerTargetId: string | null;
                modelId: string | null;
                thinkingEffort: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra';
                runtimeKind: string;
                configJson: string;
                enabled: boolean;
                createdAt: number;
                updatedAt: number;
            } | null;
        }>;
    };
};

export type PostAgentsImportLocalConfigResponse = PostAgentsImportLocalConfigResponses[keyof PostAgentsImportLocalConfigResponses];

export type PostAgentsImportLocalConfigPreviewData = {
    body: {
        includeProcessEnv?: boolean;
        candidateIds?: Array<string>;
    };
    path?: never;
    query?: never;
    url: '/agents/import/local-config/preview';
};

export type PostAgentsImportLocalConfigPreviewResponses = {
    /**
     * Response for status 200
     */
    200: {
        candidates: Array<{
            id: string;
            app: 'claude' | 'codex' | 'gemini' | 'pi' | 'kimi';
            runtimeKind: 'claude-agent' | 'codex' | 'cli-tui';
            sourceKind: 'cc-switch' | 'local-config';
            sourceLabel: string;
            externalRecordId: string;
            providerTargetId: string | null;
            agentName: string;
            resolvedProviderName: string;
            name: string;
            modelId: string | null;
            endpoint: string | null;
            executable: string | null;
            iconSlug: string | null;
            avatarUrl: string | null;
            importable: boolean;
            alreadyConfigured: boolean;
            reason: string | null;
            notes: Array<string>;
            agent: {
                id: string;
                name: string;
                description: string | null;
                avatarUrl: string | null;
                avatarStyle: string;
                avatarSeed: string;
                providerTargetId: string | null;
                modelId: string | null;
                thinkingEffort: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra';
                runtimeKind: string;
                configJson: string;
                enabled: boolean;
                createdAt: number;
                updatedAt: number;
            } | null;
        }>;
        sourceRefreshes: Array<{
            sourceKey: string;
            sourceLabel: string;
            status: 'ok' | 'warning' | 'error';
            recordsSeen: number;
            recordsProjected: number;
            recordsMissing: number;
            message: string | null;
        }>;
    };
};

export type PostAgentsImportLocalConfigPreviewResponse = PostAgentsImportLocalConfigPreviewResponses[keyof PostAgentsImportLocalConfigPreviewResponses];

export type GetAutomationsData = {
    body?: never;
    path?: never;
    query?: {
        workspaceId?: string;
        enabled?: boolean;
    };
    url: '/automations/';
};

export type GetAutomationsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        workspaceId: string | null;
        title: string;
        description: string;
        enabled: boolean;
        trigger: {
            type: 'rrule';
            rrule: string;
            timezone: string;
            misfirePolicy?: 'skip' | 'run_latest';
        };
        recipe: {
            kind: 'agent_task';
            prompt: string;
            inputs: Array<{
                type: 'file_ref';
                path: string;
            } | {
                type: 'inline_file';
                name: string;
                content: string;
            } | {
                type: 'text';
                name: string;
                content: string;
            } | {
                type: 'url';
                url: string;
            }>;
            artifactRequests: Array<{
                kind: 'markdown' | 'text' | 'json' | 'file_ref';
                name: string;
                description?: string;
            }>;
            agentId?: string;
            providerTargetId?: string;
            runtimeKind?: string;
            modelId?: string;
            thinkingEffort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra';
            sessionPolicy?: 'new' | 'heartbeat';
            isolationPolicy?: 'workspace' | 'worktree_per_run';
            completionPolicy?: {
                stopWhen?: 'agent_complete';
                noFindingsBehavior?: 'archive' | 'triage';
            };
        };
        createdByKind: 'agent' | 'user' | 'system';
        createdById: string | null;
        lastRunAt: number | null;
        nextRunAt: number | null;
        createdAt: number;
        updatedAt: number;
        latestRun: {
            id: string;
            automationDefinitionId: string;
            workspaceId: string | null;
            triggerType: 'manual' | 'scheduled';
            occurrenceKey: string | null;
            status: 'queued' | 'running' | 'complete' | 'failed' | 'cancelled';
            triggerSnapshot: {
                type: 'rrule';
                rrule: string;
                timezone: string;
                misfirePolicy?: 'skip' | 'run_latest';
            };
            recipeSnapshot: {
                kind: 'agent_task';
                prompt: string;
                inputs: Array<{
                    type: 'file_ref';
                    path: string;
                } | {
                    type: 'inline_file';
                    name: string;
                    content: string;
                } | {
                    type: 'text';
                    name: string;
                    content: string;
                } | {
                    type: 'url';
                    url: string;
                }>;
                artifactRequests: Array<{
                    kind: 'markdown' | 'text' | 'json' | 'file_ref';
                    name: string;
                    description?: string;
                }>;
                agentId?: string;
                providerTargetId?: string;
                runtimeKind?: string;
                modelId?: string;
                thinkingEffort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra';
                sessionPolicy?: 'new' | 'heartbeat';
                isolationPolicy?: 'workspace' | 'worktree_per_run';
                completionPolicy?: {
                    stopWhen?: 'agent_complete';
                    noFindingsBehavior?: 'archive' | 'triage';
                };
            };
            chatSessionId: string | null;
            backendRunId: string | null;
            artifactCount: number;
            errorText: string | null;
            resultKind: 'findings' | 'no_findings' | 'stopped' | 'error' | null;
            resultSummary: string | null;
            triageStatus: 'unread' | 'read' | 'resolved' | 'archived' | null;
            triagedAt: number | null;
            scheduledFor: number | null;
            claimedAt: number | null;
            startedAt: number | null;
            finishedAt: number | null;
            createdAt: number;
            updatedAt: number;
        } | null;
    }>;
};

export type GetAutomationsResponse = GetAutomationsResponses[keyof GetAutomationsResponses];

export type PostAutomationsData = {
    body: {
        id?: string;
        workspaceId?: string | null;
        title: string;
        description?: string;
        enabled?: boolean;
        trigger: {
            type: 'rrule';
            rrule: string;
            timezone: string;
            misfirePolicy?: 'skip' | 'run_latest';
        };
        recipe: {
            kind: 'agent_task';
            prompt: string;
            inputs: Array<{
                type: 'file_ref';
                path: string;
            } | {
                type: 'inline_file';
                name: string;
                content: string;
            } | {
                type: 'text';
                name: string;
                content: string;
            } | {
                type: 'url';
                url: string;
            }>;
            artifactRequests: Array<{
                kind: 'markdown' | 'text' | 'json' | 'file_ref';
                name: string;
                description?: string;
            }>;
            agentId?: string;
            providerTargetId?: string;
            runtimeKind?: string;
            modelId?: string;
            thinkingEffort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra';
            sessionPolicy?: 'new' | 'heartbeat';
            isolationPolicy?: 'workspace' | 'worktree_per_run';
            completionPolicy?: {
                stopWhen?: 'agent_complete';
                noFindingsBehavior?: 'archive' | 'triage';
            };
        };
        createdByKind?: 'agent' | 'user' | 'system';
        createdById?: string | null;
    };
    path?: never;
    query?: never;
    url: '/automations/';
};

export type PostAutomationsResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string | null;
        title: string;
        description: string;
        enabled: boolean;
        trigger: {
            type: 'rrule';
            rrule: string;
            timezone: string;
            misfirePolicy?: 'skip' | 'run_latest';
        };
        recipe: {
            kind: 'agent_task';
            prompt: string;
            inputs: Array<{
                type: 'file_ref';
                path: string;
            } | {
                type: 'inline_file';
                name: string;
                content: string;
            } | {
                type: 'text';
                name: string;
                content: string;
            } | {
                type: 'url';
                url: string;
            }>;
            artifactRequests: Array<{
                kind: 'markdown' | 'text' | 'json' | 'file_ref';
                name: string;
                description?: string;
            }>;
            agentId?: string;
            providerTargetId?: string;
            runtimeKind?: string;
            modelId?: string;
            thinkingEffort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra';
            sessionPolicy?: 'new' | 'heartbeat';
            isolationPolicy?: 'workspace' | 'worktree_per_run';
            completionPolicy?: {
                stopWhen?: 'agent_complete';
                noFindingsBehavior?: 'archive' | 'triage';
            };
        };
        createdByKind: 'agent' | 'user' | 'system';
        createdById: string | null;
        lastRunAt: number | null;
        nextRunAt: number | null;
        createdAt: number;
        updatedAt: number;
    };
};

export type PostAutomationsResponse = PostAutomationsResponses[keyof PostAutomationsResponses];

export type DeleteAutomationsByIdData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/automations/{id}';
};

export type DeleteAutomationsByIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type DeleteAutomationsByIdResponse = DeleteAutomationsByIdResponses[keyof DeleteAutomationsByIdResponses];

export type GetAutomationsByIdData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/automations/{id}';
};

export type GetAutomationsByIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string | null;
        title: string;
        description: string;
        enabled: boolean;
        trigger: {
            type: 'rrule';
            rrule: string;
            timezone: string;
            misfirePolicy?: 'skip' | 'run_latest';
        };
        recipe: {
            kind: 'agent_task';
            prompt: string;
            inputs: Array<{
                type: 'file_ref';
                path: string;
            } | {
                type: 'inline_file';
                name: string;
                content: string;
            } | {
                type: 'text';
                name: string;
                content: string;
            } | {
                type: 'url';
                url: string;
            }>;
            artifactRequests: Array<{
                kind: 'markdown' | 'text' | 'json' | 'file_ref';
                name: string;
                description?: string;
            }>;
            agentId?: string;
            providerTargetId?: string;
            runtimeKind?: string;
            modelId?: string;
            thinkingEffort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra';
            sessionPolicy?: 'new' | 'heartbeat';
            isolationPolicy?: 'workspace' | 'worktree_per_run';
            completionPolicy?: {
                stopWhen?: 'agent_complete';
                noFindingsBehavior?: 'archive' | 'triage';
            };
        };
        createdByKind: 'agent' | 'user' | 'system';
        createdById: string | null;
        lastRunAt: number | null;
        nextRunAt: number | null;
        createdAt: number;
        updatedAt: number;
    };
};

export type GetAutomationsByIdResponse = GetAutomationsByIdResponses[keyof GetAutomationsByIdResponses];

export type PatchAutomationsByIdData = {
    body: {
        title?: string;
        description?: string;
        trigger?: {
            type: 'rrule';
            rrule: string;
            timezone: string;
            misfirePolicy?: 'skip' | 'run_latest';
        };
        recipe?: {
            kind: 'agent_task';
            prompt: string;
            inputs: Array<{
                type: 'file_ref';
                path: string;
            } | {
                type: 'inline_file';
                name: string;
                content: string;
            } | {
                type: 'text';
                name: string;
                content: string;
            } | {
                type: 'url';
                url: string;
            }>;
            artifactRequests: Array<{
                kind: 'markdown' | 'text' | 'json' | 'file_ref';
                name: string;
                description?: string;
            }>;
            agentId?: string;
            providerTargetId?: string;
            runtimeKind?: string;
            modelId?: string;
            thinkingEffort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra';
            sessionPolicy?: 'new' | 'heartbeat';
            isolationPolicy?: 'workspace' | 'worktree_per_run';
            completionPolicy?: {
                stopWhen?: 'agent_complete';
                noFindingsBehavior?: 'archive' | 'triage';
            };
        };
        createdByKind?: 'agent' | 'user' | 'system';
        createdById?: string | null;
    };
    path: {
        id: string;
    };
    query?: never;
    url: '/automations/{id}';
};

export type PatchAutomationsByIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string | null;
        title: string;
        description: string;
        enabled: boolean;
        trigger: {
            type: 'rrule';
            rrule: string;
            timezone: string;
            misfirePolicy?: 'skip' | 'run_latest';
        };
        recipe: {
            kind: 'agent_task';
            prompt: string;
            inputs: Array<{
                type: 'file_ref';
                path: string;
            } | {
                type: 'inline_file';
                name: string;
                content: string;
            } | {
                type: 'text';
                name: string;
                content: string;
            } | {
                type: 'url';
                url: string;
            }>;
            artifactRequests: Array<{
                kind: 'markdown' | 'text' | 'json' | 'file_ref';
                name: string;
                description?: string;
            }>;
            agentId?: string;
            providerTargetId?: string;
            runtimeKind?: string;
            modelId?: string;
            thinkingEffort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra';
            sessionPolicy?: 'new' | 'heartbeat';
            isolationPolicy?: 'workspace' | 'worktree_per_run';
            completionPolicy?: {
                stopWhen?: 'agent_complete';
                noFindingsBehavior?: 'archive' | 'triage';
            };
        };
        createdByKind: 'agent' | 'user' | 'system';
        createdById: string | null;
        lastRunAt: number | null;
        nextRunAt: number | null;
        createdAt: number;
        updatedAt: number;
    };
};

export type PatchAutomationsByIdResponse = PatchAutomationsByIdResponses[keyof PatchAutomationsByIdResponses];

export type PostAutomationsByIdEnableData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/automations/{id}/enable';
};

export type PostAutomationsByIdEnableResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string | null;
        title: string;
        description: string;
        enabled: boolean;
        trigger: {
            type: 'rrule';
            rrule: string;
            timezone: string;
            misfirePolicy?: 'skip' | 'run_latest';
        };
        recipe: {
            kind: 'agent_task';
            prompt: string;
            inputs: Array<{
                type: 'file_ref';
                path: string;
            } | {
                type: 'inline_file';
                name: string;
                content: string;
            } | {
                type: 'text';
                name: string;
                content: string;
            } | {
                type: 'url';
                url: string;
            }>;
            artifactRequests: Array<{
                kind: 'markdown' | 'text' | 'json' | 'file_ref';
                name: string;
                description?: string;
            }>;
            agentId?: string;
            providerTargetId?: string;
            runtimeKind?: string;
            modelId?: string;
            thinkingEffort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra';
            sessionPolicy?: 'new' | 'heartbeat';
            isolationPolicy?: 'workspace' | 'worktree_per_run';
            completionPolicy?: {
                stopWhen?: 'agent_complete';
                noFindingsBehavior?: 'archive' | 'triage';
            };
        };
        createdByKind: 'agent' | 'user' | 'system';
        createdById: string | null;
        lastRunAt: number | null;
        nextRunAt: number | null;
        createdAt: number;
        updatedAt: number;
    };
};

export type PostAutomationsByIdEnableResponse = PostAutomationsByIdEnableResponses[keyof PostAutomationsByIdEnableResponses];

export type PostAutomationsByIdDisableData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/automations/{id}/disable';
};

export type PostAutomationsByIdDisableResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string | null;
        title: string;
        description: string;
        enabled: boolean;
        trigger: {
            type: 'rrule';
            rrule: string;
            timezone: string;
            misfirePolicy?: 'skip' | 'run_latest';
        };
        recipe: {
            kind: 'agent_task';
            prompt: string;
            inputs: Array<{
                type: 'file_ref';
                path: string;
            } | {
                type: 'inline_file';
                name: string;
                content: string;
            } | {
                type: 'text';
                name: string;
                content: string;
            } | {
                type: 'url';
                url: string;
            }>;
            artifactRequests: Array<{
                kind: 'markdown' | 'text' | 'json' | 'file_ref';
                name: string;
                description?: string;
            }>;
            agentId?: string;
            providerTargetId?: string;
            runtimeKind?: string;
            modelId?: string;
            thinkingEffort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra';
            sessionPolicy?: 'new' | 'heartbeat';
            isolationPolicy?: 'workspace' | 'worktree_per_run';
            completionPolicy?: {
                stopWhen?: 'agent_complete';
                noFindingsBehavior?: 'archive' | 'triage';
            };
        };
        createdByKind: 'agent' | 'user' | 'system';
        createdById: string | null;
        lastRunAt: number | null;
        nextRunAt: number | null;
        createdAt: number;
        updatedAt: number;
    };
};

export type PostAutomationsByIdDisableResponse = PostAutomationsByIdDisableResponses[keyof PostAutomationsByIdDisableResponses];

export type PostAutomationsByIdRunData = {
    body: {
        occurrenceKey?: string;
        scheduledFor?: number;
    };
    path: {
        id: string;
    };
    query?: never;
    url: '/automations/{id}/run';
};

export type PostAutomationsByIdRunResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        automationDefinitionId: string;
        workspaceId: string | null;
        triggerType: 'manual' | 'scheduled';
        occurrenceKey: string | null;
        status: 'queued' | 'running' | 'complete' | 'failed' | 'cancelled';
        triggerSnapshot: {
            type: 'rrule';
            rrule: string;
            timezone: string;
            misfirePolicy?: 'skip' | 'run_latest';
        };
        recipeSnapshot: {
            kind: 'agent_task';
            prompt: string;
            inputs: Array<{
                type: 'file_ref';
                path: string;
            } | {
                type: 'inline_file';
                name: string;
                content: string;
            } | {
                type: 'text';
                name: string;
                content: string;
            } | {
                type: 'url';
                url: string;
            }>;
            artifactRequests: Array<{
                kind: 'markdown' | 'text' | 'json' | 'file_ref';
                name: string;
                description?: string;
            }>;
            agentId?: string;
            providerTargetId?: string;
            runtimeKind?: string;
            modelId?: string;
            thinkingEffort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra';
            sessionPolicy?: 'new' | 'heartbeat';
            isolationPolicy?: 'workspace' | 'worktree_per_run';
            completionPolicy?: {
                stopWhen?: 'agent_complete';
                noFindingsBehavior?: 'archive' | 'triage';
            };
        };
        chatSessionId: string | null;
        backendRunId: string | null;
        artifactCount: number;
        errorText: string | null;
        resultKind: 'findings' | 'no_findings' | 'stopped' | 'error' | null;
        resultSummary: string | null;
        triageStatus: 'unread' | 'read' | 'resolved' | 'archived' | null;
        triagedAt: number | null;
        scheduledFor: number | null;
        claimedAt: number | null;
        startedAt: number | null;
        finishedAt: number | null;
        createdAt: number;
        updatedAt: number;
    };
};

export type PostAutomationsByIdRunResponse = PostAutomationsByIdRunResponses[keyof PostAutomationsByIdRunResponses];

export type GetAutomationsByIdRunsData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/automations/{id}/runs';
};

export type GetAutomationsByIdRunsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        automationDefinitionId: string;
        workspaceId: string | null;
        triggerType: 'manual' | 'scheduled';
        occurrenceKey: string | null;
        status: 'queued' | 'running' | 'complete' | 'failed' | 'cancelled';
        triggerSnapshot: {
            type: 'rrule';
            rrule: string;
            timezone: string;
            misfirePolicy?: 'skip' | 'run_latest';
        };
        recipeSnapshot: {
            kind: 'agent_task';
            prompt: string;
            inputs: Array<{
                type: 'file_ref';
                path: string;
            } | {
                type: 'inline_file';
                name: string;
                content: string;
            } | {
                type: 'text';
                name: string;
                content: string;
            } | {
                type: 'url';
                url: string;
            }>;
            artifactRequests: Array<{
                kind: 'markdown' | 'text' | 'json' | 'file_ref';
                name: string;
                description?: string;
            }>;
            agentId?: string;
            providerTargetId?: string;
            runtimeKind?: string;
            modelId?: string;
            thinkingEffort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra';
            sessionPolicy?: 'new' | 'heartbeat';
            isolationPolicy?: 'workspace' | 'worktree_per_run';
            completionPolicy?: {
                stopWhen?: 'agent_complete';
                noFindingsBehavior?: 'archive' | 'triage';
            };
        };
        chatSessionId: string | null;
        backendRunId: string | null;
        artifactCount: number;
        errorText: string | null;
        resultKind: 'findings' | 'no_findings' | 'stopped' | 'error' | null;
        resultSummary: string | null;
        triageStatus: 'unread' | 'read' | 'resolved' | 'archived' | null;
        triagedAt: number | null;
        scheduledFor: number | null;
        claimedAt: number | null;
        startedAt: number | null;
        finishedAt: number | null;
        createdAt: number;
        updatedAt: number;
    }>;
};

export type GetAutomationsByIdRunsResponse = GetAutomationsByIdRunsResponses[keyof GetAutomationsByIdRunsResponses];

export type GetAutomationsByIdRunsByRunIdData = {
    body?: never;
    path: {
        id: string;
        runId: string;
    };
    query?: never;
    url: '/automations/{id}/runs/{runId}';
};

export type GetAutomationsByIdRunsByRunIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        automationDefinitionId: string;
        workspaceId: string | null;
        triggerType: 'manual' | 'scheduled';
        occurrenceKey: string | null;
        status: 'queued' | 'running' | 'complete' | 'failed' | 'cancelled';
        triggerSnapshot: {
            type: 'rrule';
            rrule: string;
            timezone: string;
            misfirePolicy?: 'skip' | 'run_latest';
        };
        recipeSnapshot: {
            kind: 'agent_task';
            prompt: string;
            inputs: Array<{
                type: 'file_ref';
                path: string;
            } | {
                type: 'inline_file';
                name: string;
                content: string;
            } | {
                type: 'text';
                name: string;
                content: string;
            } | {
                type: 'url';
                url: string;
            }>;
            artifactRequests: Array<{
                kind: 'markdown' | 'text' | 'json' | 'file_ref';
                name: string;
                description?: string;
            }>;
            agentId?: string;
            providerTargetId?: string;
            runtimeKind?: string;
            modelId?: string;
            thinkingEffort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra';
            sessionPolicy?: 'new' | 'heartbeat';
            isolationPolicy?: 'workspace' | 'worktree_per_run';
            completionPolicy?: {
                stopWhen?: 'agent_complete';
                noFindingsBehavior?: 'archive' | 'triage';
            };
        };
        chatSessionId: string | null;
        backendRunId: string | null;
        artifactCount: number;
        errorText: string | null;
        resultKind: 'findings' | 'no_findings' | 'stopped' | 'error' | null;
        resultSummary: string | null;
        triageStatus: 'unread' | 'read' | 'resolved' | 'archived' | null;
        triagedAt: number | null;
        scheduledFor: number | null;
        claimedAt: number | null;
        startedAt: number | null;
        finishedAt: number | null;
        createdAt: number;
        updatedAt: number;
    };
};

export type GetAutomationsByIdRunsByRunIdResponse = GetAutomationsByIdRunsByRunIdResponses[keyof GetAutomationsByIdRunsByRunIdResponses];

export type PostAutomationsByIdRunsByRunIdStopData = {
    body?: never;
    path: {
        id: string;
        runId: string;
    };
    query?: never;
    url: '/automations/{id}/runs/{runId}/stop';
};

export type PostAutomationsByIdRunsByRunIdStopResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        automationDefinitionId: string;
        workspaceId: string | null;
        triggerType: 'manual' | 'scheduled';
        occurrenceKey: string | null;
        status: 'queued' | 'running' | 'complete' | 'failed' | 'cancelled';
        triggerSnapshot: {
            type: 'rrule';
            rrule: string;
            timezone: string;
            misfirePolicy?: 'skip' | 'run_latest';
        };
        recipeSnapshot: {
            kind: 'agent_task';
            prompt: string;
            inputs: Array<{
                type: 'file_ref';
                path: string;
            } | {
                type: 'inline_file';
                name: string;
                content: string;
            } | {
                type: 'text';
                name: string;
                content: string;
            } | {
                type: 'url';
                url: string;
            }>;
            artifactRequests: Array<{
                kind: 'markdown' | 'text' | 'json' | 'file_ref';
                name: string;
                description?: string;
            }>;
            agentId?: string;
            providerTargetId?: string;
            runtimeKind?: string;
            modelId?: string;
            thinkingEffort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra';
            sessionPolicy?: 'new' | 'heartbeat';
            isolationPolicy?: 'workspace' | 'worktree_per_run';
            completionPolicy?: {
                stopWhen?: 'agent_complete';
                noFindingsBehavior?: 'archive' | 'triage';
            };
        };
        chatSessionId: string | null;
        backendRunId: string | null;
        artifactCount: number;
        errorText: string | null;
        resultKind: 'findings' | 'no_findings' | 'stopped' | 'error' | null;
        resultSummary: string | null;
        triageStatus: 'unread' | 'read' | 'resolved' | 'archived' | null;
        triagedAt: number | null;
        scheduledFor: number | null;
        claimedAt: number | null;
        startedAt: number | null;
        finishedAt: number | null;
        createdAt: number;
        updatedAt: number;
    };
};

export type PostAutomationsByIdRunsByRunIdStopResponse = PostAutomationsByIdRunsByRunIdStopResponses[keyof PostAutomationsByIdRunsByRunIdStopResponses];

export type PatchAutomationsByIdRunsByRunIdTriageData = {
    body: {
        status: 'unread' | 'read' | 'resolved' | 'archived';
    };
    path: {
        id: string;
        runId: string;
    };
    query?: never;
    url: '/automations/{id}/runs/{runId}/triage';
};

export type PatchAutomationsByIdRunsByRunIdTriageResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        automationDefinitionId: string;
        workspaceId: string | null;
        triggerType: 'manual' | 'scheduled';
        occurrenceKey: string | null;
        status: 'queued' | 'running' | 'complete' | 'failed' | 'cancelled';
        triggerSnapshot: {
            type: 'rrule';
            rrule: string;
            timezone: string;
            misfirePolicy?: 'skip' | 'run_latest';
        };
        recipeSnapshot: {
            kind: 'agent_task';
            prompt: string;
            inputs: Array<{
                type: 'file_ref';
                path: string;
            } | {
                type: 'inline_file';
                name: string;
                content: string;
            } | {
                type: 'text';
                name: string;
                content: string;
            } | {
                type: 'url';
                url: string;
            }>;
            artifactRequests: Array<{
                kind: 'markdown' | 'text' | 'json' | 'file_ref';
                name: string;
                description?: string;
            }>;
            agentId?: string;
            providerTargetId?: string;
            runtimeKind?: string;
            modelId?: string;
            thinkingEffort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra';
            sessionPolicy?: 'new' | 'heartbeat';
            isolationPolicy?: 'workspace' | 'worktree_per_run';
            completionPolicy?: {
                stopWhen?: 'agent_complete';
                noFindingsBehavior?: 'archive' | 'triage';
            };
        };
        chatSessionId: string | null;
        backendRunId: string | null;
        artifactCount: number;
        errorText: string | null;
        resultKind: 'findings' | 'no_findings' | 'stopped' | 'error' | null;
        resultSummary: string | null;
        triageStatus: 'unread' | 'read' | 'resolved' | 'archived' | null;
        triagedAt: number | null;
        scheduledFor: number | null;
        claimedAt: number | null;
        startedAt: number | null;
        finishedAt: number | null;
        createdAt: number;
        updatedAt: number;
    };
};

export type PatchAutomationsByIdRunsByRunIdTriageResponse = PatchAutomationsByIdRunsByRunIdTriageResponses[keyof PatchAutomationsByIdRunsByRunIdTriageResponses];

export type GetAutomationsByIdRunsByRunIdArtifactsData = {
    body?: never;
    path: {
        id: string;
        runId: string;
    };
    query?: never;
    url: '/automations/{id}/runs/{runId}/artifacts';
};

export type GetAutomationsByIdRunsByRunIdArtifactsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        automationRunId: string;
        automationDefinitionId: string | null;
        kind: 'markdown' | 'text' | 'json' | 'file_ref';
        name: string;
        mimeType: string | null;
        content: string | null;
        metadata: {
            [key: string]: unknown;
        };
        createdAt: number;
        updatedAt: number;
    }>;
};

export type GetAutomationsByIdRunsByRunIdArtifactsResponse = GetAutomationsByIdRunsByRunIdArtifactsResponses[keyof GetAutomationsByIdRunsByRunIdArtifactsResponses];

export type GetAutomationsByIdArtifactsData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/automations/{id}/artifacts';
};

export type GetAutomationsByIdArtifactsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        automationRunId: string;
        automationDefinitionId: string | null;
        kind: 'markdown' | 'text' | 'json' | 'file_ref';
        name: string;
        mimeType: string | null;
        content: string | null;
        metadata: {
            [key: string]: unknown;
        };
        createdAt: number;
        updatedAt: number;
    }>;
};

export type GetAutomationsByIdArtifactsResponse = GetAutomationsByIdArtifactsResponses[keyof GetAutomationsByIdArtifactsResponses];

export type GetAutomationsByIdArtifactsByArtifactIdData = {
    body?: never;
    path: {
        id: string;
        artifactId: string;
    };
    query?: never;
    url: '/automations/{id}/artifacts/{artifactId}';
};

export type GetAutomationsByIdArtifactsByArtifactIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        automationRunId: string;
        automationDefinitionId: string | null;
        kind: 'markdown' | 'text' | 'json' | 'file_ref';
        name: string;
        mimeType: string | null;
        content: string | null;
        metadata: {
            [key: string]: unknown;
        };
        createdAt: number;
        updatedAt: number;
    };
};

export type GetAutomationsByIdArtifactsByArtifactIdResponse = GetAutomationsByIdArtifactsByArtifactIdResponses[keyof GetAutomationsByIdArtifactsByArtifactIdResponses];

export type GetAutomationTriageData = {
    body?: never;
    path?: never;
    query?: {
        workspaceId?: string;
        status?: 'unread' | 'read' | 'resolved' | 'archived' | 'all';
    };
    url: '/automation-triage/';
};

export type GetAutomationTriageResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        automationDefinitionId: string;
        workspaceId: string | null;
        triggerType: 'manual' | 'scheduled';
        occurrenceKey: string | null;
        status: 'queued' | 'running' | 'complete' | 'failed' | 'cancelled';
        triggerSnapshot: {
            type: 'rrule';
            rrule: string;
            timezone: string;
            misfirePolicy?: 'skip' | 'run_latest';
        };
        recipeSnapshot: {
            kind: 'agent_task';
            prompt: string;
            inputs: Array<{
                type: 'file_ref';
                path: string;
            } | {
                type: 'inline_file';
                name: string;
                content: string;
            } | {
                type: 'text';
                name: string;
                content: string;
            } | {
                type: 'url';
                url: string;
            }>;
            artifactRequests: Array<{
                kind: 'markdown' | 'text' | 'json' | 'file_ref';
                name: string;
                description?: string;
            }>;
            agentId?: string;
            providerTargetId?: string;
            runtimeKind?: string;
            modelId?: string;
            thinkingEffort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra';
            sessionPolicy?: 'new' | 'heartbeat';
            isolationPolicy?: 'workspace' | 'worktree_per_run';
            completionPolicy?: {
                stopWhen?: 'agent_complete';
                noFindingsBehavior?: 'archive' | 'triage';
            };
        };
        chatSessionId: string | null;
        backendRunId: string | null;
        artifactCount: number;
        errorText: string | null;
        resultKind: 'findings' | 'no_findings' | 'stopped' | 'error' | null;
        resultSummary: string | null;
        triageStatus: 'unread' | 'read' | 'resolved' | 'archived' | null;
        triagedAt: number | null;
        scheduledFor: number | null;
        claimedAt: number | null;
        startedAt: number | null;
        finishedAt: number | null;
        createdAt: number;
        updatedAt: number;
    }>;
};

export type GetAutomationTriageResponse = GetAutomationTriageResponses[keyof GetAutomationTriageResponses];

export type GetCronJobsData = {
    body?: never;
    path?: never;
    query?: {
        workspaceId?: string;
        enabled?: boolean;
    };
    url: '/cron/jobs';
};

export type PostCronJobsData = {
    body: {
        id: string;
        workspaceId?: string | null;
        title: string;
        description?: string;
        enabled?: boolean;
        scheduleKind: 'rrule';
        scheduleConfig: string;
        timezone: string;
        prompt: string;
        providerTargetId?: string;
        modelId?: string;
    };
    path?: never;
    query?: never;
    url: '/cron/jobs';
};

export type DeleteCronJobsByIdData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/cron/jobs/{id}';
};

export type DeleteCronJobsByIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type DeleteCronJobsByIdResponse = DeleteCronJobsByIdResponses[keyof DeleteCronJobsByIdResponses];

export type GetCronJobsByIdData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/cron/jobs/{id}';
};

export type PutCronJobsByIdData = {
    body: {
        title?: string;
        description?: string;
        enabled?: boolean;
        scheduleKind?: 'rrule';
        scheduleConfig?: string;
        timezone?: string;
        prompt?: string;
        providerTargetId?: string;
        modelId?: string;
    };
    path: {
        id: string;
    };
    query?: never;
    url: '/cron/jobs/{id}';
};

export type GetCronRunsData = {
    body?: never;
    path?: never;
    query: {
        jobId: string;
    };
    url: '/cron/runs';
};

export type GetCronRunsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        automationDefinitionId: string;
        workspaceId: string | null;
        triggerType: 'manual' | 'scheduled';
        occurrenceKey: string | null;
        status: 'queued' | 'running' | 'complete' | 'failed' | 'cancelled';
        triggerSnapshot: {
            type: 'rrule';
            rrule: string;
            timezone: string;
            misfirePolicy?: 'skip' | 'run_latest';
        };
        recipeSnapshot: {
            kind: 'agent_task';
            prompt: string;
            inputs: Array<{
                type: 'file_ref';
                path: string;
            } | {
                type: 'inline_file';
                name: string;
                content: string;
            } | {
                type: 'text';
                name: string;
                content: string;
            } | {
                type: 'url';
                url: string;
            }>;
            artifactRequests: Array<{
                kind: 'markdown' | 'text' | 'json' | 'file_ref';
                name: string;
                description?: string;
            }>;
            agentId?: string;
            providerTargetId?: string;
            runtimeKind?: string;
            modelId?: string;
            thinkingEffort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra';
            sessionPolicy?: 'new' | 'heartbeat';
            isolationPolicy?: 'workspace' | 'worktree_per_run';
            completionPolicy?: {
                stopWhen?: 'agent_complete';
                noFindingsBehavior?: 'archive' | 'triage';
            };
        };
        chatSessionId: string | null;
        backendRunId: string | null;
        artifactCount: number;
        errorText: string | null;
        resultKind: 'findings' | 'no_findings' | 'stopped' | 'error' | null;
        resultSummary: string | null;
        triageStatus: 'unread' | 'read' | 'resolved' | 'archived' | null;
        triagedAt: number | null;
        scheduledFor: number | null;
        claimedAt: number | null;
        startedAt: number | null;
        finishedAt: number | null;
        createdAt: number;
        updatedAt: number;
    }>;
};

export type GetCronRunsResponse = GetCronRunsResponses[keyof GetCronRunsResponses];

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

export type PostAssetsResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string | null;
        filename: string;
        mediaType: string;
        byteSize: number;
        width: number | null;
        height: number | null;
        sha256: string;
        storagePath: string;
        url: string;
        markdownUrl: string;
        createdAt: number;
    };
};

export type PostAssetsResponse = PostAssetsResponses[keyof PostAssetsResponses];

export type DeleteAssetsByIdData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/assets/{id}';
};

export type DeleteAssetsByIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type DeleteAssetsByIdResponse = DeleteAssetsByIdResponses[keyof DeleteAssetsByIdResponses];

export type GetAssetsByIdData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/assets/{id}';
};

export type GetAssetsByIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string | null;
        filename: string;
        mediaType: string;
        byteSize: number;
        width: number | null;
        height: number | null;
        sha256: string;
        storagePath: string;
        url: string;
        markdownUrl: string;
        createdAt: number;
    };
};

export type GetAssetsByIdResponse = GetAssetsByIdResponses[keyof GetAssetsByIdResponses];

export type GetAssetsByIdContentData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/assets/{id}/content';
};

export type GetBlobsByIdData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/blobs/{id}';
};

export type GetBlobsByIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        sha256: string;
        mediaType: string;
        byteSize: number;
        storagePath: string;
        createdAt: number;
    };
};

export type GetBlobsByIdResponse = GetBlobsByIdResponses[keyof GetBlobsByIdResponses];

export type GetBackgroundActivitiesData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/background-activities';
};

export type GetBackgroundActivitiesResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        ownerNamespace: string;
        key: string;
        title: string;
        priority: 'low' | 'normal' | 'high';
        trigger: string;
        manuallyRunnable: boolean;
        status: 'idle' | 'running' | 'succeeded' | 'failed';
        progress: unknown;
        lastError: string | null;
        createdAt: number;
        updatedAt: number;
        startedAt: number | null;
        finishedAt: number | null;
    }>;
};

export type GetBackgroundActivitiesResponse = GetBackgroundActivitiesResponses[keyof GetBackgroundActivitiesResponses];

export type PostBackgroundActivitiesByOwnerNamespaceByKeyRunData = {
    body?: never;
    path: {
        ownerNamespace: string;
        key: string;
    };
    query?: never;
    url: '/background-activities/{ownerNamespace}/{key}/run';
};

export type PostBackgroundActivitiesByOwnerNamespaceByKeyRunResponses = {
    /**
     * Response for status 200
     */
    200: {
        ownerNamespace: string;
        key: string;
        title: string;
        priority: 'low' | 'normal' | 'high';
        trigger: string;
        manuallyRunnable: boolean;
        status: 'idle' | 'running' | 'succeeded' | 'failed';
        progress: unknown;
        lastError: string | null;
        createdAt: number;
        updatedAt: number;
        startedAt: number | null;
        finishedAt: number | null;
    };
};

export type PostBackgroundActivitiesByOwnerNamespaceByKeyRunResponse = PostBackgroundActivitiesByOwnerNamespaceByKeyRunResponses[keyof PostBackgroundActivitiesByOwnerNamespaceByKeyRunResponses];

export type GetBackgroundJobsData = {
    body?: never;
    path?: never;
    query?: {
        workspaceId?: string;
        ownerNamespace?: string;
        ownerResourceType?: string;
        ownerResourceId?: string;
        ownerResourceKey?: string;
        kind?: string;
        status?: 'pending' | 'running' | 'succeeded' | 'failed' | 'cancelled';
        limit?: number;
    };
    url: '/background-jobs/';
};

export type GetBackgroundJobsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        workspaceId: string | null;
        ownerNamespace: string;
        ownerResourceType: string;
        ownerResourceId: string;
        ownerResourceKey: string | null;
        kind: string;
        status: 'pending' | 'running' | 'succeeded' | 'failed' | 'cancelled';
        sourceKind: string;
        sourceSessionId: string | null;
        sourceRunId: string | null;
        attempts: number;
        maxAttempts: number;
        context: unknown;
        progress: unknown;
        result: unknown;
        errorCode: string | null;
        errorMessage: string | null;
        errorDetails: unknown;
        cancelRequestedAt: number | null;
        startedAt: number | null;
        finishedAt: number | null;
        projectedAt: number | null;
        projectionAttempts: number;
        projectionError: string | null;
        createdAt: number;
        updatedAt: number;
    }>;
};

export type GetBackgroundJobsResponse = GetBackgroundJobsResponses[keyof GetBackgroundJobsResponses];

export type GetBackgroundJobsByIdData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/background-jobs/{id}';
};

export type GetBackgroundJobsByIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string | null;
        ownerNamespace: string;
        ownerResourceType: string;
        ownerResourceId: string;
        ownerResourceKey: string | null;
        kind: string;
        status: 'pending' | 'running' | 'succeeded' | 'failed' | 'cancelled';
        sourceKind: string;
        sourceSessionId: string | null;
        sourceRunId: string | null;
        attempts: number;
        maxAttempts: number;
        context: unknown;
        progress: unknown;
        result: unknown;
        errorCode: string | null;
        errorMessage: string | null;
        errorDetails: unknown;
        cancelRequestedAt: number | null;
        startedAt: number | null;
        finishedAt: number | null;
        projectedAt: number | null;
        projectionAttempts: number;
        projectionError: string | null;
        createdAt: number;
        updatedAt: number;
    };
};

export type GetBackgroundJobsByIdResponse = GetBackgroundJobsByIdResponses[keyof GetBackgroundJobsByIdResponses];

export type PostBackgroundJobsByIdCancelData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/background-jobs/{id}/cancel';
};

export type PostBackgroundJobsByIdCancelResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string | null;
        ownerNamespace: string;
        ownerResourceType: string;
        ownerResourceId: string;
        ownerResourceKey: string | null;
        kind: string;
        status: 'pending' | 'running' | 'succeeded' | 'failed' | 'cancelled';
        sourceKind: string;
        sourceSessionId: string | null;
        sourceRunId: string | null;
        attempts: number;
        maxAttempts: number;
        context: unknown;
        progress: unknown;
        result: unknown;
        errorCode: string | null;
        errorMessage: string | null;
        errorDetails: unknown;
        cancelRequestedAt: number | null;
        startedAt: number | null;
        finishedAt: number | null;
        projectedAt: number | null;
        projectionAttempts: number;
        projectionError: string | null;
        createdAt: number;
        updatedAt: number;
    };
};

export type PostBackgroundJobsByIdCancelResponse = PostBackgroundJobsByIdCancelResponses[keyof PostBackgroundJobsByIdCancelResponses];

export type GetSessionsData = {
    body?: never;
    path?: never;
    query?: {
        workspaceId?: string;
        origin?: string;
        sessionGroupId?: string;
        archived?: boolean;
    };
    url: '/sessions/';
};

export type GetSessionsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        execution: {
            kind: 'local';
        } | {
            kind: 'remote-host';
            hostId: string;
            remoteSessionId: string;
        };
        parentSessionId: string | null;
        sideContextSource: 'provider-native' | 'cradle-context' | null;
        workspaceId: string | null;
        title: string | null;
        origin: string;
        providerTargetId: string | null;
        agentId: string | null;
        modelId: string | null;
        thinkingEffort: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra' | null;
        linkedIssueId: string | null;
        sessionGroupId: string | null;
        runtimeKind: string;
        status: 'idle' | 'streaming' | 'error';
        pinned: number;
        archivedAt: number | null;
        lastReadAt: number | null;
        createdAt: number;
        updatedAt: number;
        latestUserMessageAt: number | null;
        latestAssistantMessageAt: number | null;
        unread: boolean;
        isIsolated: boolean;
        worktreeId: string | null;
        worktreeBranch: string | null;
        worktreePath: string | null;
        worktreeHealth: 'ok' | 'missing' | 'stale' | null;
        pendingWorktreeId: string | null;
        isolationBoundaryRequired: boolean;
    }>;
};

export type GetSessionsResponse = GetSessionsResponses[keyof GetSessionsResponses];

export type PostSessionsData = {
    body: {
        workspaceId?: string | null;
        title: string;
        origin?: string;
        providerTargetId?: string;
        modelId?: string | null;
        agentId?: string;
        acpAgentId?: string;
        acpDraftSessionId?: string;
        runtimeKind?: string;
        runtimeSettings?: {
            permissionMode?: 'default' | 'acceptEdits' | 'bypassPermissions' | 'plan' | null;
            accessMode?: 'approval-required' | 'full-access' | null;
            interactionMode?: 'default' | 'plan' | null;
            claudeAgent?: {
                modelAliases?: {
                    haiku?: string;
                    sonnet?: string;
                    opus?: string;
                };
            } | null;
            [key: string]: string | number | boolean | null | 'default' | 'acceptEdits' | 'bypassPermissions' | 'plan' | null | 'approval-required' | 'full-access' | null | 'default' | 'plan' | null | {
                modelAliases?: {
                    haiku?: string;
                    sonnet?: string;
                    opus?: string;
                };
            } | null | undefined;
        };
        thinkingEffort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra';
        linkedIssueId?: string | null;
        sessionGroupId?: string | null;
        worktreeId?: string;
        id?: string;
    };
    path?: never;
    query?: never;
    url: '/sessions/';
};

export type PostSessionsResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        execution: {
            kind: 'local';
        } | {
            kind: 'remote-host';
            hostId: string;
            remoteSessionId: string;
        };
        parentSessionId: string | null;
        sideContextSource: 'provider-native' | 'cradle-context' | null;
        workspaceId: string | null;
        title: string | null;
        origin: string;
        providerTargetId: string | null;
        agentId: string | null;
        modelId: string | null;
        thinkingEffort: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra' | null;
        linkedIssueId: string | null;
        sessionGroupId: string | null;
        runtimeKind: string;
        status: 'idle' | 'streaming' | 'error';
        pinned: number;
        archivedAt: number | null;
        lastReadAt: number | null;
        createdAt: number;
        updatedAt: number;
        latestUserMessageAt: number | null;
        latestAssistantMessageAt: number | null;
        unread: boolean;
        isIsolated: boolean;
        worktreeId: string | null;
        worktreeBranch: string | null;
        worktreePath: string | null;
        worktreeHealth: 'ok' | 'missing' | 'stale' | null;
        pendingWorktreeId: string | null;
        isolationBoundaryRequired: boolean;
    };
};

export type PostSessionsResponse = PostSessionsResponses[keyof PostSessionsResponses];

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

export type DeleteSessionsByIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type DeleteSessionsByIdResponse = DeleteSessionsByIdResponses[keyof DeleteSessionsByIdResponses];

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

export type GetSessionsByIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        execution: {
            kind: 'local';
        } | {
            kind: 'remote-host';
            hostId: string;
            remoteSessionId: string;
        };
        parentSessionId: string | null;
        sideContextSource: 'provider-native' | 'cradle-context' | null;
        workspaceId: string | null;
        title: string | null;
        origin: string;
        providerTargetId: string | null;
        agentId: string | null;
        modelId: string | null;
        thinkingEffort: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra' | null;
        linkedIssueId: string | null;
        sessionGroupId: string | null;
        runtimeKind: string;
        status: 'idle' | 'streaming' | 'error';
        pinned: number;
        archivedAt: number | null;
        lastReadAt: number | null;
        createdAt: number;
        updatedAt: number;
        latestUserMessageAt: number | null;
        latestAssistantMessageAt: number | null;
        unread: boolean;
        isIsolated: boolean;
        worktreeId: string | null;
        worktreeBranch: string | null;
        worktreePath: string | null;
        worktreeHealth: 'ok' | 'missing' | 'stale' | null;
        pendingWorktreeId: string | null;
        isolationBoundaryRequired: boolean;
    };
};

export type GetSessionsByIdResponse = GetSessionsByIdResponses[keyof GetSessionsByIdResponses];

export type PatchSessionsByIdData = {
    body: {
        title?: string;
        pinned?: boolean;
        providerTargetId?: string;
        modelId?: string | null;
        thinkingEffort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra' | null;
        sessionGroupId?: string | null;
    };
    path: {
        id: string;
    };
    query?: never;
    url: '/sessions/{id}';
};

export type PatchSessionsByIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        execution: {
            kind: 'local';
        } | {
            kind: 'remote-host';
            hostId: string;
            remoteSessionId: string;
        };
        parentSessionId: string | null;
        sideContextSource: 'provider-native' | 'cradle-context' | null;
        workspaceId: string | null;
        title: string | null;
        origin: string;
        providerTargetId: string | null;
        agentId: string | null;
        modelId: string | null;
        thinkingEffort: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra' | null;
        linkedIssueId: string | null;
        sessionGroupId: string | null;
        runtimeKind: string;
        status: 'idle' | 'streaming' | 'error';
        pinned: number;
        archivedAt: number | null;
        lastReadAt: number | null;
        createdAt: number;
        updatedAt: number;
        latestUserMessageAt: number | null;
        latestAssistantMessageAt: number | null;
        unread: boolean;
        isIsolated: boolean;
        worktreeId: string | null;
        worktreeBranch: string | null;
        worktreePath: string | null;
        worktreeHealth: 'ok' | 'missing' | 'stale' | null;
        pendingWorktreeId: string | null;
        isolationBoundaryRequired: boolean;
    };
};

export type PatchSessionsByIdResponse = PatchSessionsByIdResponses[keyof PatchSessionsByIdResponses];

export type PostSessionsByIdArchiveData = {
    body: {
        archived: boolean;
    };
    path: {
        id: string;
    };
    query?: never;
    url: '/sessions/{id}/archive';
};

export type PostSessionsByIdArchiveResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        execution: {
            kind: 'local';
        } | {
            kind: 'remote-host';
            hostId: string;
            remoteSessionId: string;
        };
        parentSessionId: string | null;
        sideContextSource: 'provider-native' | 'cradle-context' | null;
        workspaceId: string | null;
        title: string | null;
        origin: string;
        providerTargetId: string | null;
        agentId: string | null;
        modelId: string | null;
        thinkingEffort: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra' | null;
        linkedIssueId: string | null;
        sessionGroupId: string | null;
        runtimeKind: string;
        status: 'idle' | 'streaming' | 'error';
        pinned: number;
        archivedAt: number | null;
        lastReadAt: number | null;
        createdAt: number;
        updatedAt: number;
        latestUserMessageAt: number | null;
        latestAssistantMessageAt: number | null;
        unread: boolean;
        isIsolated: boolean;
        worktreeId: string | null;
        worktreeBranch: string | null;
        worktreePath: string | null;
        worktreeHealth: 'ok' | 'missing' | 'stale' | null;
        pendingWorktreeId: string | null;
        isolationBoundaryRequired: boolean;
    };
};

export type PostSessionsByIdArchiveResponse = PostSessionsByIdArchiveResponses[keyof PostSessionsByIdArchiveResponses];

export type PostSessionsByIdReadData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/sessions/{id}/read';
};

export type PostSessionsByIdReadResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        execution: {
            kind: 'local';
        } | {
            kind: 'remote-host';
            hostId: string;
            remoteSessionId: string;
        };
        parentSessionId: string | null;
        sideContextSource: 'provider-native' | 'cradle-context' | null;
        workspaceId: string | null;
        title: string | null;
        origin: string;
        providerTargetId: string | null;
        agentId: string | null;
        modelId: string | null;
        thinkingEffort: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra' | null;
        linkedIssueId: string | null;
        sessionGroupId: string | null;
        runtimeKind: string;
        status: 'idle' | 'streaming' | 'error';
        pinned: number;
        archivedAt: number | null;
        lastReadAt: number | null;
        createdAt: number;
        updatedAt: number;
        latestUserMessageAt: number | null;
        latestAssistantMessageAt: number | null;
        unread: boolean;
        isIsolated: boolean;
        worktreeId: string | null;
        worktreeBranch: string | null;
        worktreePath: string | null;
        worktreeHealth: 'ok' | 'missing' | 'stale' | null;
        pendingWorktreeId: string | null;
        isolationBoundaryRequired: boolean;
    };
};

export type PostSessionsByIdReadResponse = PostSessionsByIdReadResponses[keyof PostSessionsByIdReadResponses];

export type PostSessionsByIdUnreadData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/sessions/{id}/unread';
};

export type PostSessionsByIdUnreadResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        execution: {
            kind: 'local';
        } | {
            kind: 'remote-host';
            hostId: string;
            remoteSessionId: string;
        };
        parentSessionId: string | null;
        sideContextSource: 'provider-native' | 'cradle-context' | null;
        workspaceId: string | null;
        title: string | null;
        origin: string;
        providerTargetId: string | null;
        agentId: string | null;
        modelId: string | null;
        thinkingEffort: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra' | null;
        linkedIssueId: string | null;
        sessionGroupId: string | null;
        runtimeKind: string;
        status: 'idle' | 'streaming' | 'error';
        pinned: number;
        archivedAt: number | null;
        lastReadAt: number | null;
        createdAt: number;
        updatedAt: number;
        latestUserMessageAt: number | null;
        latestAssistantMessageAt: number | null;
        unread: boolean;
        isIsolated: boolean;
        worktreeId: string | null;
        worktreeBranch: string | null;
        worktreePath: string | null;
        worktreeHealth: 'ok' | 'missing' | 'stale' | null;
        pendingWorktreeId: string | null;
        isolationBoundaryRequired: boolean;
    };
};

export type PostSessionsByIdUnreadResponse = PostSessionsByIdUnreadResponses[keyof PostSessionsByIdUnreadResponses];

export type GetSessionsByIdExportMarkdownData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/sessions/{id}/export/markdown';
};

export type GetSessionsByIdExportMarkdownResponses = {
    /**
     * Response for status 200
     */
    200: {
        markdown: string;
    };
};

export type GetSessionsByIdExportMarkdownResponse = GetSessionsByIdExportMarkdownResponses[keyof GetSessionsByIdExportMarkdownResponses];

export type GetSessionsByIdExportZipData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/sessions/{id}/export/zip';
};

export type DeleteSessionsByIdLinkedIssueData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/sessions/{id}/linked-issue';
};

export type DeleteSessionsByIdLinkedIssueResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type DeleteSessionsByIdLinkedIssueResponse = DeleteSessionsByIdLinkedIssueResponses[keyof DeleteSessionsByIdLinkedIssueResponses];

export type GetSessionsByIdLinkedIssueData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/sessions/{id}/linked-issue';
};

export type GetSessionsByIdLinkedIssueResponses = {
    /**
     * Response for status 200
     */
    200: {
        issueId: string | null;
    };
};

export type GetSessionsByIdLinkedIssueResponse = GetSessionsByIdLinkedIssueResponses[keyof GetSessionsByIdLinkedIssueResponses];

export type PostSessionsByIdLinkedIssueData = {
    body: {
        issueId: string;
    };
    path: {
        id: string;
    };
    query?: never;
    url: '/sessions/{id}/linked-issue';
};

export type PostSessionsByIdLinkedIssueResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type PostSessionsByIdLinkedIssueResponse = PostSessionsByIdLinkedIssueResponses[keyof PostSessionsByIdLinkedIssueResponses];

export type PostSessionsByIdIsolationStartData = {
    body: {
        slug?: string;
    };
    path: {
        id: string;
    };
    query?: never;
    url: '/sessions/{id}/isolation/start';
};

export type PostSessionsByIdIsolationStartResponses = {
    /**
     * Response for status 200
     */
    200: {
        worktree: {
            id: string;
            sourceWorkspaceId: string;
            name: string;
            path: string;
            branch: string;
            baseRef: string;
            status: 'active' | 'merged' | 'abandoned';
            createdBySessionId: string | null;
            createdAt: number;
            updatedAt: number;
        };
        pending: boolean;
    };
};

export type PostSessionsByIdIsolationStartResponse = PostSessionsByIdIsolationStartResponses[keyof PostSessionsByIdIsolationStartResponses];

export type PostSessionsByIdIsolationActivateData = {
    body: {
        mode: 'migrate' | 'leave-main' | 'cancel';
    };
    path: {
        id: string;
    };
    query?: never;
    url: '/sessions/{id}/isolation/activate';
};

export type PostSessionsByIdIsolationActivateResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type PostSessionsByIdIsolationActivateResponse = PostSessionsByIdIsolationActivateResponses[keyof PostSessionsByIdIsolationActivateResponses];

export type PostSessionsByIdIsolationCancelData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/sessions/{id}/isolation/cancel';
};

export type PostSessionsByIdIsolationCancelResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type PostSessionsByIdIsolationCancelResponse = PostSessionsByIdIsolationCancelResponses[keyof PostSessionsByIdIsolationCancelResponses];

export type PostSessionsByIdIsolationLeaveData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/sessions/{id}/isolation/leave';
};

export type PostSessionsByIdIsolationLeaveResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type PostSessionsByIdIsolationLeaveResponse = PostSessionsByIdIsolationLeaveResponses[keyof PostSessionsByIdIsolationLeaveResponses];

export type PostSessionsByIdIsolationRepairData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/sessions/{id}/isolation/repair';
};

export type PostSessionsByIdIsolationRepairResponses = {
    /**
     * Response for status 200
     */
    200: {
        worktree: {
            id: string;
            sourceWorkspaceId: string;
            name: string;
            path: string;
            branch: string;
            baseRef: string;
            status: 'active' | 'merged' | 'abandoned';
            createdBySessionId: string | null;
            createdAt: number;
            updatedAt: number;
        };
    };
};

export type PostSessionsByIdIsolationRepairResponse = PostSessionsByIdIsolationRepairResponses[keyof PostSessionsByIdIsolationRepairResponses];

export type PostSessionsByIdIsolationAttachData = {
    body: {
        worktreeId: string;
    };
    path: {
        id: string;
    };
    query?: never;
    url: '/sessions/{id}/isolation/attach';
};

export type PostSessionsByIdIsolationAttachResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type PostSessionsByIdIsolationAttachResponse = PostSessionsByIdIsolationAttachResponses[keyof PostSessionsByIdIsolationAttachResponses];

export type GetSessionsByIdIsolationData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/sessions/{id}/isolation';
};

export type GetSessionsByIdIsolationResponses = {
    /**
     * Response for status 200
     */
    200: {
        isIsolated: boolean;
        worktreeId: string | null;
        worktreeBranch: string | null;
        worktreePath: string | null;
        worktreeHealth: 'ok' | 'missing' | 'stale' | null;
        pendingWorktreeId: string | null;
        isolationBoundaryRequired: boolean;
    };
};

export type GetSessionsByIdIsolationResponse = GetSessionsByIdIsolationResponses[keyof GetSessionsByIdIsolationResponses];

export type GetSessionsByIdEnvironmentData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/sessions/{id}/environment';
};

export type GetSessionsByIdEnvironmentResponses = {
    /**
     * Response for status 200
     */
    200: {
        sessionId: string;
        notes: string;
        pins: Array<{
            sessionId: string;
            messageId: string;
            label: string | null;
            done: boolean;
            pinnedAt: number;
            updatedAt: number;
        }>;
        markers: Array<{
            id: string;
            sessionId: string;
            messageId: string;
            startOffset: number;
            endOffset: number;
            selectedText: string;
            style: 'highlight' | 'underline';
            color: 'yellow' | 'blue' | 'green' | 'pink';
            label: string | null;
            done: boolean;
            createdAt: number;
            updatedAt: number;
        }>;
        usage: {
            totalTokens: number;
            promptTokens: number;
            completionTokens: number;
            count: number;
            byModel: Array<{
                modelId: string;
                promptTokens: number;
                completionTokens: number;
                totalTokens: number;
                turnCount: number;
            }>;
        };
        pullRequest: {
            owner: string;
            repo: string;
            number: number;
            url: string;
            title: string;
            isDraft: boolean;
            state: 'open' | 'closed';
            merged: boolean;
            headRef: string;
            baseRef: string;
            headSha: string | null;
            createdAt: number;
            updatedAt: number;
            author?: {
                login: string;
                avatarUrl: string;
                url: string;
            } | null;
            additions?: number;
            deletions?: number;
        } | null;
        automationRuns: Array<{
            id: string;
            automationDefinitionId: string;
            workspaceId: string | null;
            triggerType: 'manual' | 'scheduled';
            occurrenceKey: string | null;
            status: 'queued' | 'running' | 'complete' | 'failed' | 'cancelled';
            triggerSnapshot: {
                type: 'rrule';
                rrule: string;
                timezone: string;
                misfirePolicy?: 'skip' | 'run_latest';
            };
            recipeSnapshot: {
                kind: 'agent_task';
                prompt: string;
                inputs: Array<{
                    type: 'file_ref';
                    path: string;
                } | {
                    type: 'inline_file';
                    name: string;
                    content: string;
                } | {
                    type: 'text';
                    name: string;
                    content: string;
                } | {
                    type: 'url';
                    url: string;
                }>;
                artifactRequests: Array<{
                    kind: 'markdown' | 'text' | 'json' | 'file_ref';
                    name: string;
                    description?: string;
                }>;
                agentId?: string;
                providerTargetId?: string;
                runtimeKind?: string;
                modelId?: string;
                thinkingEffort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra';
                sessionPolicy?: 'new' | 'heartbeat';
                isolationPolicy?: 'workspace' | 'worktree_per_run';
                completionPolicy?: {
                    stopWhen?: 'agent_complete';
                    noFindingsBehavior?: 'archive' | 'triage';
                };
            };
            chatSessionId: string | null;
            backendRunId: string | null;
            artifactCount: number;
            errorText: string | null;
            resultKind: 'findings' | 'no_findings' | 'stopped' | 'error' | null;
            resultSummary: string | null;
            triageStatus: 'unread' | 'read' | 'resolved' | 'archived' | null;
            triagedAt: number | null;
            scheduledFor: number | null;
            claimedAt: number | null;
            startedAt: number | null;
            finishedAt: number | null;
            createdAt: number;
            updatedAt: number;
        }>;
        checkpoints: Array<{
            id: string;
            sessionId: string;
            runId: string;
            assistantMessageId: string | null;
            workspaceId: string | null;
            workspacePath: string;
            startRef: string;
            endRef: string | null;
            status: 'capturing' | 'completed' | 'failed' | 'cleanup_pending';
            cleanupReason: string | null;
            cleanupClaimedAt: number | null;
            changedFiles: number;
            additions: number;
            deletions: number;
            errorText: string | null;
            completedAt: number | null;
            restoredAt: number | null;
            createdAt: number;
            updatedAt: number;
        }>;
        handoff: {
            id: string;
            requestId: string;
            sourceSessionId: string;
            destinationSessionId: string;
            sourceProviderTargetId: string | null;
            destinationProviderTargetId: string | null;
            importedMessageCount: number;
            createdAt: number;
        } | null;
    };
};

export type GetSessionsByIdEnvironmentResponse = GetSessionsByIdEnvironmentResponses[keyof GetSessionsByIdEnvironmentResponses];

export type PutSessionsByIdEnvironmentNotesData = {
    body: {
        notes: string;
    };
    path: {
        id: string;
    };
    query?: never;
    url: '/sessions/{id}/environment/notes';
};

export type PutSessionsByIdEnvironmentNotesResponses = {
    /**
     * Response for status 200
     */
    200: {
        sessionId: string;
        notes: string;
        updatedAt: number;
    };
};

export type PutSessionsByIdEnvironmentNotesResponse = PutSessionsByIdEnvironmentNotesResponses[keyof PutSessionsByIdEnvironmentNotesResponses];

export type DeleteSessionsByIdEnvironmentPinsByMessageIdData = {
    body?: never;
    path: {
        id: string;
        messageId: string;
    };
    query?: never;
    url: '/sessions/{id}/environment/pins/{messageId}';
};

export type DeleteSessionsByIdEnvironmentPinsByMessageIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type DeleteSessionsByIdEnvironmentPinsByMessageIdResponse = DeleteSessionsByIdEnvironmentPinsByMessageIdResponses[keyof DeleteSessionsByIdEnvironmentPinsByMessageIdResponses];

export type PatchSessionsByIdEnvironmentPinsByMessageIdData = {
    body: {
        label?: string | null;
        done?: boolean;
    };
    path: {
        id: string;
        messageId: string;
    };
    query?: never;
    url: '/sessions/{id}/environment/pins/{messageId}';
};

export type PatchSessionsByIdEnvironmentPinsByMessageIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        sessionId: string;
        messageId: string;
        label: string | null;
        done: boolean;
        pinnedAt: number;
        updatedAt: number;
    };
};

export type PatchSessionsByIdEnvironmentPinsByMessageIdResponse = PatchSessionsByIdEnvironmentPinsByMessageIdResponses[keyof PatchSessionsByIdEnvironmentPinsByMessageIdResponses];

export type PostSessionsByIdEnvironmentPinsByMessageIdData = {
    body?: never;
    path: {
        id: string;
        messageId: string;
    };
    query?: never;
    url: '/sessions/{id}/environment/pins/{messageId}';
};

export type PostSessionsByIdEnvironmentPinsByMessageIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        sessionId: string;
        messageId: string;
        label: string | null;
        done: boolean;
        pinnedAt: number;
        updatedAt: number;
    };
};

export type PostSessionsByIdEnvironmentPinsByMessageIdResponse = PostSessionsByIdEnvironmentPinsByMessageIdResponses[keyof PostSessionsByIdEnvironmentPinsByMessageIdResponses];

export type PostSessionsByIdEnvironmentMarkersData = {
    body: {
        messageId: string;
        startOffset: number;
        endOffset: number;
        selectedText: string;
        style: 'highlight' | 'underline';
        color: 'yellow' | 'blue' | 'green' | 'pink';
    };
    path: {
        id: string;
    };
    query?: never;
    url: '/sessions/{id}/environment/markers';
};

export type PostSessionsByIdEnvironmentMarkersResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        sessionId: string;
        messageId: string;
        startOffset: number;
        endOffset: number;
        selectedText: string;
        style: 'highlight' | 'underline';
        color: 'yellow' | 'blue' | 'green' | 'pink';
        label: string | null;
        done: boolean;
        createdAt: number;
        updatedAt: number;
    };
};

export type PostSessionsByIdEnvironmentMarkersResponse = PostSessionsByIdEnvironmentMarkersResponses[keyof PostSessionsByIdEnvironmentMarkersResponses];

export type DeleteSessionsByIdEnvironmentMarkersByMarkerIdData = {
    body?: never;
    path: {
        id: string;
        markerId: string;
    };
    query?: never;
    url: '/sessions/{id}/environment/markers/{markerId}';
};

export type DeleteSessionsByIdEnvironmentMarkersByMarkerIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type DeleteSessionsByIdEnvironmentMarkersByMarkerIdResponse = DeleteSessionsByIdEnvironmentMarkersByMarkerIdResponses[keyof DeleteSessionsByIdEnvironmentMarkersByMarkerIdResponses];

export type PatchSessionsByIdEnvironmentMarkersByMarkerIdData = {
    body: {
        label?: string | null;
        done?: boolean;
    };
    path: {
        id: string;
        markerId: string;
    };
    query?: never;
    url: '/sessions/{id}/environment/markers/{markerId}';
};

export type PatchSessionsByIdEnvironmentMarkersByMarkerIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        sessionId: string;
        messageId: string;
        startOffset: number;
        endOffset: number;
        selectedText: string;
        style: 'highlight' | 'underline';
        color: 'yellow' | 'blue' | 'green' | 'pink';
        label: string | null;
        done: boolean;
        createdAt: number;
        updatedAt: number;
    };
};

export type PatchSessionsByIdEnvironmentMarkersByMarkerIdResponse = PatchSessionsByIdEnvironmentMarkersByMarkerIdResponses[keyof PatchSessionsByIdEnvironmentMarkersByMarkerIdResponses];

export type PostThreadHandoffsData = {
    body: {
        requestId: string;
        sourceSessionId: string;
        destinationRuntimeKind: string;
        destinationProviderTargetId?: string | null;
        modelId?: string | null;
        thinkingEffort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra' | null;
    };
    path?: never;
    query?: never;
    url: '/thread-handoffs';
};

export type PostThreadHandoffsResponses = {
    /**
     * Response for status 200
     */
    200: {
        handoff: {
            id: string;
            requestId: string;
            sourceSessionId: string;
            destinationSessionId: string;
            sourceProviderTargetId: string | null;
            destinationProviderTargetId: string | null;
            importedMessageCount: number;
            createdAt: number;
        };
        session: {
            id: string;
            execution: {
                kind: 'local';
            } | {
                kind: 'remote-host';
                hostId: string;
                remoteSessionId: string;
            };
            parentSessionId: string | null;
            sideContextSource: 'provider-native' | 'cradle-context' | null;
            workspaceId: string | null;
            title: string | null;
            origin: string;
            providerTargetId: string | null;
            agentId: string | null;
            modelId: string | null;
            thinkingEffort: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra' | null;
            linkedIssueId: string | null;
            sessionGroupId: string | null;
            runtimeKind: string;
            status: 'idle' | 'streaming' | 'error';
            pinned: number;
            archivedAt: number | null;
            lastReadAt: number | null;
            createdAt: number;
            updatedAt: number;
            latestUserMessageAt: number | null;
            latestAssistantMessageAt: number | null;
            unread: boolean;
            isIsolated: boolean;
            worktreeId: string | null;
            worktreeBranch: string | null;
            worktreePath: string | null;
            worktreeHealth: 'ok' | 'missing' | 'stale' | null;
            pendingWorktreeId: string | null;
            isolationBoundaryRequired: boolean;
        };
    };
};

export type PostThreadHandoffsResponse = PostThreadHandoffsResponses[keyof PostThreadHandoffsResponses];

export type GetThreadHandoffsDestinationBySessionIdData = {
    body?: never;
    path: {
        sessionId: string;
    };
    query?: never;
    url: '/thread-handoffs/destination/{sessionId}';
};

export type GetThreadHandoffsDestinationBySessionIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        requestId: string;
        sourceSessionId: string;
        destinationSessionId: string;
        sourceProviderTargetId: string | null;
        destinationProviderTargetId: string | null;
        importedMessageCount: number;
        createdAt: number;
    } | null;
};

export type GetThreadHandoffsDestinationBySessionIdResponse = GetThreadHandoffsDestinationBySessionIdResponses[keyof GetThreadHandoffsDestinationBySessionIdResponses];

export type GetSessionsByIdTurnCheckpointsData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/sessions/{id}/turn-checkpoints';
};

export type GetSessionsByIdTurnCheckpointsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        sessionId: string;
        runId: string;
        assistantMessageId: string | null;
        workspaceId: string | null;
        workspacePath: string;
        startRef: string;
        endRef: string | null;
        status: 'capturing' | 'completed' | 'failed' | 'cleanup_pending';
        cleanupReason: string | null;
        cleanupClaimedAt: number | null;
        changedFiles: number;
        additions: number;
        deletions: number;
        errorText: string | null;
        completedAt: number | null;
        restoredAt: number | null;
        createdAt: number;
        updatedAt: number;
    }>;
};

export type GetSessionsByIdTurnCheckpointsResponse = GetSessionsByIdTurnCheckpointsResponses[keyof GetSessionsByIdTurnCheckpointsResponses];

export type PostSessionsByIdTurnCheckpointsByCheckpointIdRestoreData = {
    body?: never;
    path: {
        id: string;
        checkpointId: string;
    };
    query?: never;
    url: '/sessions/{id}/turn-checkpoints/{checkpointId}/restore';
};

export type PostSessionsByIdTurnCheckpointsByCheckpointIdRestoreResponses = {
    /**
     * Response for status 200
     */
    200: {
        checkpoint: {
            id: string;
            sessionId: string;
            runId: string;
            assistantMessageId: string | null;
            workspaceId: string | null;
            workspacePath: string;
            startRef: string;
            endRef: string | null;
            status: 'capturing' | 'completed' | 'failed' | 'cleanup_pending';
            cleanupReason: string | null;
            cleanupClaimedAt: number | null;
            changedFiles: number;
            additions: number;
            deletions: number;
            errorText: string | null;
            completedAt: number | null;
            restoredAt: number | null;
            createdAt: number;
            updatedAt: number;
        };
        transcriptReverted: boolean;
        providerRolledBackTurns: number;
    };
};

export type PostSessionsByIdTurnCheckpointsByCheckpointIdRestoreResponse = PostSessionsByIdTurnCheckpointsByCheckpointIdRestoreResponses[keyof PostSessionsByIdTurnCheckpointsByCheckpointIdRestoreResponses];

export type PostSessionsByIdTurnCheckpointsByCheckpointIdRewindData = {
    body?: never;
    path: {
        id: string;
        checkpointId: string;
    };
    query?: never;
    url: '/sessions/{id}/turn-checkpoints/{checkpointId}/rewind';
};

export type PostSessionsByIdTurnCheckpointsByCheckpointIdRewindResponses = {
    /**
     * Response for status 200
     */
    200: {
        checkpoint: {
            id: string;
            sessionId: string;
            runId: string;
            assistantMessageId: string | null;
            workspaceId: string | null;
            workspacePath: string;
            startRef: string;
            endRef: string | null;
            status: 'capturing' | 'completed' | 'failed' | 'cleanup_pending';
            cleanupReason: string | null;
            cleanupClaimedAt: number | null;
            changedFiles: number;
            additions: number;
            deletions: number;
            errorText: string | null;
            completedAt: number | null;
            restoredAt: number | null;
            createdAt: number;
            updatedAt: number;
        };
        transcriptReverted: boolean;
        rewoundTurns: number;
        providerRolledBackTurns: number;
        removedCheckpointIds: Array<string>;
    };
};

export type PostSessionsByIdTurnCheckpointsByCheckpointIdRewindResponse = PostSessionsByIdTurnCheckpointsByCheckpointIdRewindResponses[keyof PostSessionsByIdTurnCheckpointsByCheckpointIdRewindResponses];

export type GetWorksData = {
    body?: never;
    path?: never;
    query?: {
        workspaceId?: string;
        linkedIssueId?: string;
        archived?: boolean;
    };
    url: '/works';
};

export type GetWorksResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        title: string;
        objective: string;
        linkedIssueId: string | null;
        handoffTitle: string | null;
        handoffSummary: string | null;
        handoffTestPlan: string | null;
        preparedAt: number | null;
        lastSubmittedAt: number | null;
        closedAt: number | null;
        archivedAt: number | null;
        createdAt: number;
        updatedAt: number;
        workspaceId: string;
        primarySessionId: string;
        activity: 'idle' | 'running' | 'waiting' | 'blocked';
        pullRequest: {
            owner: string;
            repo: string;
            number: number;
            url: string;
            title: string;
            isDraft: boolean;
            state: 'open' | 'closed';
            merged: boolean;
            headRef: string;
            baseRef: string;
            headSha: string | null;
            createdAt: number;
            updatedAt: number;
            author?: {
                login: string;
                avatarUrl: string;
                url: string;
            } | null;
            additions?: number;
            deletions?: number;
        } | null;
    }>;
};

export type GetWorksResponse = GetWorksResponses[keyof GetWorksResponses];

export type PostWorksData = {
    body: {
        workspaceId: string;
        title: string;
        goal?: string;
        objective?: string;
        linkedIssueId?: string;
        baseBranch?: string;
        providerTargetId?: string;
        modelId?: string | null;
        thinkingEffort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra';
        runtimeKind?: string;
        runtimeSettings?: {
            permissionMode?: 'default' | 'acceptEdits' | 'bypassPermissions' | 'plan' | null;
            accessMode?: 'approval-required' | 'full-access' | null;
            interactionMode?: 'default' | 'plan' | null;
            claudeAgent?: {
                modelAliases?: {
                    haiku?: string;
                    sonnet?: string;
                    opus?: string;
                };
            } | null;
            [key: string]: string | number | boolean | null | 'default' | 'acceptEdits' | 'bypassPermissions' | 'plan' | null | 'approval-required' | 'full-access' | null | 'default' | 'plan' | null | {
                modelAliases?: {
                    haiku?: string;
                    sonnet?: string;
                    opus?: string;
                };
            } | null | undefined;
        };
        agentId?: string;
    };
    path?: never;
    query?: never;
    url: '/works';
};

export type PostWorksResponses = {
    /**
     * Response for status 200
     */
    200: {
        work: {
            id: string;
            title: string;
            objective: string;
            linkedIssueId: string | null;
            handoffTitle: string | null;
            handoffSummary: string | null;
            handoffTestPlan: string | null;
            preparedAt: number | null;
            lastSubmittedAt: number | null;
            closedAt: number | null;
            archivedAt: number | null;
            createdAt: number;
            updatedAt: number;
        };
        primaryThread: {
            id: string;
            execution: {
                kind: 'local';
            } | {
                kind: 'remote-host';
                hostId: string;
                remoteSessionId: string;
            };
            parentSessionId: string | null;
            sideContextSource: 'provider-native' | 'cradle-context' | null;
            workspaceId: string | null;
            title: string | null;
            origin: string;
            providerTargetId: string | null;
            agentId: string | null;
            modelId: string | null;
            thinkingEffort: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra' | null;
            linkedIssueId: string | null;
            sessionGroupId: string | null;
            runtimeKind: string;
            status: 'idle' | 'streaming' | 'error';
            pinned: number;
            archivedAt: number | null;
            lastReadAt: number | null;
            createdAt: number;
            updatedAt: number;
            latestUserMessageAt: number | null;
            latestAssistantMessageAt: number | null;
            unread: boolean;
            isIsolated: boolean;
            worktreeId: string | null;
            worktreeBranch: string | null;
            worktreePath: string | null;
            worktreeHealth: 'ok' | 'missing' | 'stale' | null;
            pendingWorktreeId: string | null;
            isolationBoundaryRequired: boolean;
        };
        execution: {
            isIsolated: boolean;
            worktreeId: string | null;
            worktreeBranch: string | null;
            worktreePath: string | null;
            worktreeHealth: 'ok' | 'missing' | 'stale' | null;
            pendingWorktreeId: string | null;
            isolationBoundaryRequired: boolean;
        };
        readiness: {
            isolated: boolean;
            clean: boolean;
            branch: string | null;
            baseRef: string | null;
            commitsAhead: number;
            changedFiles: number;
        };
        pullRequest: {
            owner: string;
            repo: string;
            number: number;
            url: string;
            title: string;
            isDraft: boolean;
            state: 'open' | 'closed';
            merged: boolean;
            headRef: string;
            baseRef: string;
            headSha: string | null;
            createdAt: number;
            updatedAt: number;
            author?: {
                login: string;
                avatarUrl: string;
                url: string;
            } | null;
            additions?: number;
            deletions?: number;
        } | null;
        activity: 'idle' | 'running' | 'waiting' | 'blocked';
    };
};

export type PostWorksResponse = PostWorksResponses[keyof PostWorksResponses];

export type GetWorksByIdData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/works/{id}';
};

export type GetWorksByIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        work: {
            id: string;
            title: string;
            objective: string;
            linkedIssueId: string | null;
            handoffTitle: string | null;
            handoffSummary: string | null;
            handoffTestPlan: string | null;
            preparedAt: number | null;
            lastSubmittedAt: number | null;
            closedAt: number | null;
            archivedAt: number | null;
            createdAt: number;
            updatedAt: number;
        };
        primaryThread: {
            id: string;
            execution: {
                kind: 'local';
            } | {
                kind: 'remote-host';
                hostId: string;
                remoteSessionId: string;
            };
            parentSessionId: string | null;
            sideContextSource: 'provider-native' | 'cradle-context' | null;
            workspaceId: string | null;
            title: string | null;
            origin: string;
            providerTargetId: string | null;
            agentId: string | null;
            modelId: string | null;
            thinkingEffort: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra' | null;
            linkedIssueId: string | null;
            sessionGroupId: string | null;
            runtimeKind: string;
            status: 'idle' | 'streaming' | 'error';
            pinned: number;
            archivedAt: number | null;
            lastReadAt: number | null;
            createdAt: number;
            updatedAt: number;
            latestUserMessageAt: number | null;
            latestAssistantMessageAt: number | null;
            unread: boolean;
            isIsolated: boolean;
            worktreeId: string | null;
            worktreeBranch: string | null;
            worktreePath: string | null;
            worktreeHealth: 'ok' | 'missing' | 'stale' | null;
            pendingWorktreeId: string | null;
            isolationBoundaryRequired: boolean;
        };
        execution: {
            isIsolated: boolean;
            worktreeId: string | null;
            worktreeBranch: string | null;
            worktreePath: string | null;
            worktreeHealth: 'ok' | 'missing' | 'stale' | null;
            pendingWorktreeId: string | null;
            isolationBoundaryRequired: boolean;
        };
        readiness: {
            isolated: boolean;
            clean: boolean;
            branch: string | null;
            baseRef: string | null;
            commitsAhead: number;
            changedFiles: number;
        };
        pullRequest: {
            owner: string;
            repo: string;
            number: number;
            url: string;
            title: string;
            isDraft: boolean;
            state: 'open' | 'closed';
            merged: boolean;
            headRef: string;
            baseRef: string;
            headSha: string | null;
            createdAt: number;
            updatedAt: number;
            author?: {
                login: string;
                avatarUrl: string;
                url: string;
            } | null;
            additions?: number;
            deletions?: number;
        } | null;
        activity: 'idle' | 'running' | 'waiting' | 'blocked';
    };
};

export type GetWorksByIdResponse = GetWorksByIdResponses[keyof GetWorksByIdResponses];

export type PostWorksByIdArchiveData = {
    body: {
        archived: boolean;
    };
    path: {
        id: string;
    };
    query?: never;
    url: '/works/{id}/archive';
};

export type PostWorksByIdArchiveResponses = {
    /**
     * Response for status 200
     */
    200: {
        work: {
            id: string;
            title: string;
            objective: string;
            linkedIssueId: string | null;
            handoffTitle: string | null;
            handoffSummary: string | null;
            handoffTestPlan: string | null;
            preparedAt: number | null;
            lastSubmittedAt: number | null;
            closedAt: number | null;
            archivedAt: number | null;
            createdAt: number;
            updatedAt: number;
        };
        primaryThread: {
            id: string;
            execution: {
                kind: 'local';
            } | {
                kind: 'remote-host';
                hostId: string;
                remoteSessionId: string;
            };
            parentSessionId: string | null;
            sideContextSource: 'provider-native' | 'cradle-context' | null;
            workspaceId: string | null;
            title: string | null;
            origin: string;
            providerTargetId: string | null;
            agentId: string | null;
            modelId: string | null;
            thinkingEffort: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra' | null;
            linkedIssueId: string | null;
            sessionGroupId: string | null;
            runtimeKind: string;
            status: 'idle' | 'streaming' | 'error';
            pinned: number;
            archivedAt: number | null;
            lastReadAt: number | null;
            createdAt: number;
            updatedAt: number;
            latestUserMessageAt: number | null;
            latestAssistantMessageAt: number | null;
            unread: boolean;
            isIsolated: boolean;
            worktreeId: string | null;
            worktreeBranch: string | null;
            worktreePath: string | null;
            worktreeHealth: 'ok' | 'missing' | 'stale' | null;
            pendingWorktreeId: string | null;
            isolationBoundaryRequired: boolean;
        };
        execution: {
            isIsolated: boolean;
            worktreeId: string | null;
            worktreeBranch: string | null;
            worktreePath: string | null;
            worktreeHealth: 'ok' | 'missing' | 'stale' | null;
            pendingWorktreeId: string | null;
            isolationBoundaryRequired: boolean;
        };
        readiness: {
            isolated: boolean;
            clean: boolean;
            branch: string | null;
            baseRef: string | null;
            commitsAhead: number;
            changedFiles: number;
        };
        pullRequest: {
            owner: string;
            repo: string;
            number: number;
            url: string;
            title: string;
            isDraft: boolean;
            state: 'open' | 'closed';
            merged: boolean;
            headRef: string;
            baseRef: string;
            headSha: string | null;
            createdAt: number;
            updatedAt: number;
            author?: {
                login: string;
                avatarUrl: string;
                url: string;
            } | null;
            additions?: number;
            deletions?: number;
        } | null;
        activity: 'idle' | 'running' | 'waiting' | 'blocked';
    };
};

export type PostWorksByIdArchiveResponse = PostWorksByIdArchiveResponses[keyof PostWorksByIdArchiveResponses];

export type PostWorksByIdPrepareData = {
    body: {
        title: string;
        summary: string;
        testPlan: string;
    };
    path: {
        id: string;
    };
    query?: never;
    url: '/works/{id}/prepare';
};

export type PostWorksByIdPrepareResponses = {
    /**
     * Response for status 200
     */
    200: {
        work: {
            id: string;
            title: string;
            objective: string;
            linkedIssueId: string | null;
            handoffTitle: string | null;
            handoffSummary: string | null;
            handoffTestPlan: string | null;
            preparedAt: number | null;
            lastSubmittedAt: number | null;
            closedAt: number | null;
            archivedAt: number | null;
            createdAt: number;
            updatedAt: number;
        };
        primaryThread: {
            id: string;
            execution: {
                kind: 'local';
            } | {
                kind: 'remote-host';
                hostId: string;
                remoteSessionId: string;
            };
            parentSessionId: string | null;
            sideContextSource: 'provider-native' | 'cradle-context' | null;
            workspaceId: string | null;
            title: string | null;
            origin: string;
            providerTargetId: string | null;
            agentId: string | null;
            modelId: string | null;
            thinkingEffort: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra' | null;
            linkedIssueId: string | null;
            sessionGroupId: string | null;
            runtimeKind: string;
            status: 'idle' | 'streaming' | 'error';
            pinned: number;
            archivedAt: number | null;
            lastReadAt: number | null;
            createdAt: number;
            updatedAt: number;
            latestUserMessageAt: number | null;
            latestAssistantMessageAt: number | null;
            unread: boolean;
            isIsolated: boolean;
            worktreeId: string | null;
            worktreeBranch: string | null;
            worktreePath: string | null;
            worktreeHealth: 'ok' | 'missing' | 'stale' | null;
            pendingWorktreeId: string | null;
            isolationBoundaryRequired: boolean;
        };
        execution: {
            isIsolated: boolean;
            worktreeId: string | null;
            worktreeBranch: string | null;
            worktreePath: string | null;
            worktreeHealth: 'ok' | 'missing' | 'stale' | null;
            pendingWorktreeId: string | null;
            isolationBoundaryRequired: boolean;
        };
        readiness: {
            isolated: boolean;
            clean: boolean;
            branch: string | null;
            baseRef: string | null;
            commitsAhead: number;
            changedFiles: number;
        };
        pullRequest: {
            owner: string;
            repo: string;
            number: number;
            url: string;
            title: string;
            isDraft: boolean;
            state: 'open' | 'closed';
            merged: boolean;
            headRef: string;
            baseRef: string;
            headSha: string | null;
            createdAt: number;
            updatedAt: number;
            author?: {
                login: string;
                avatarUrl: string;
                url: string;
            } | null;
            additions?: number;
            deletions?: number;
        } | null;
        activity: 'idle' | 'running' | 'waiting' | 'blocked';
    };
};

export type PostWorksByIdPrepareResponse = PostWorksByIdPrepareResponses[keyof PostWorksByIdPrepareResponses];

export type PostWorksByIdSubmitData = {
    body: {
        title?: string;
        summary?: string;
        testPlan?: string;
        base?: string;
    };
    path: {
        id: string;
    };
    query?: never;
    url: '/works/{id}/submit';
};

export type PostWorksByIdSubmitResponses = {
    /**
     * Response for status 200
     */
    200: {
        work: {
            id: string;
            title: string;
            objective: string;
            linkedIssueId: string | null;
            handoffTitle: string | null;
            handoffSummary: string | null;
            handoffTestPlan: string | null;
            preparedAt: number | null;
            lastSubmittedAt: number | null;
            closedAt: number | null;
            archivedAt: number | null;
            createdAt: number;
            updatedAt: number;
        };
        primaryThread: {
            id: string;
            execution: {
                kind: 'local';
            } | {
                kind: 'remote-host';
                hostId: string;
                remoteSessionId: string;
            };
            parentSessionId: string | null;
            sideContextSource: 'provider-native' | 'cradle-context' | null;
            workspaceId: string | null;
            title: string | null;
            origin: string;
            providerTargetId: string | null;
            agentId: string | null;
            modelId: string | null;
            thinkingEffort: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra' | null;
            linkedIssueId: string | null;
            sessionGroupId: string | null;
            runtimeKind: string;
            status: 'idle' | 'streaming' | 'error';
            pinned: number;
            archivedAt: number | null;
            lastReadAt: number | null;
            createdAt: number;
            updatedAt: number;
            latestUserMessageAt: number | null;
            latestAssistantMessageAt: number | null;
            unread: boolean;
            isIsolated: boolean;
            worktreeId: string | null;
            worktreeBranch: string | null;
            worktreePath: string | null;
            worktreeHealth: 'ok' | 'missing' | 'stale' | null;
            pendingWorktreeId: string | null;
            isolationBoundaryRequired: boolean;
        };
        execution: {
            isIsolated: boolean;
            worktreeId: string | null;
            worktreeBranch: string | null;
            worktreePath: string | null;
            worktreeHealth: 'ok' | 'missing' | 'stale' | null;
            pendingWorktreeId: string | null;
            isolationBoundaryRequired: boolean;
        };
        readiness: {
            isolated: boolean;
            clean: boolean;
            branch: string | null;
            baseRef: string | null;
            commitsAhead: number;
            changedFiles: number;
        };
        pullRequest: {
            owner: string;
            repo: string;
            number: number;
            url: string;
            title: string;
            isDraft: boolean;
            state: 'open' | 'closed';
            merged: boolean;
            headRef: string;
            baseRef: string;
            headSha: string | null;
            createdAt: number;
            updatedAt: number;
            author?: {
                login: string;
                avatarUrl: string;
                url: string;
            } | null;
            additions?: number;
            deletions?: number;
        } | null;
        activity: 'idle' | 'running' | 'waiting' | 'blocked';
    };
};

export type PostWorksByIdSubmitResponse = PostWorksByIdSubmitResponses[keyof PostWorksByIdSubmitResponses];

export type PostWorksByIdBranchData = {
    body: {
        branch: string;
    };
    path: {
        id: string;
    };
    query?: never;
    url: '/works/{id}/branch';
};

export type PostWorksByIdBranchResponses = {
    /**
     * Response for status 200
     */
    200: {
        work: {
            id: string;
            title: string;
            objective: string;
            linkedIssueId: string | null;
            handoffTitle: string | null;
            handoffSummary: string | null;
            handoffTestPlan: string | null;
            preparedAt: number | null;
            lastSubmittedAt: number | null;
            closedAt: number | null;
            archivedAt: number | null;
            createdAt: number;
            updatedAt: number;
        };
        primaryThread: {
            id: string;
            execution: {
                kind: 'local';
            } | {
                kind: 'remote-host';
                hostId: string;
                remoteSessionId: string;
            };
            parentSessionId: string | null;
            sideContextSource: 'provider-native' | 'cradle-context' | null;
            workspaceId: string | null;
            title: string | null;
            origin: string;
            providerTargetId: string | null;
            agentId: string | null;
            modelId: string | null;
            thinkingEffort: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra' | null;
            linkedIssueId: string | null;
            sessionGroupId: string | null;
            runtimeKind: string;
            status: 'idle' | 'streaming' | 'error';
            pinned: number;
            archivedAt: number | null;
            lastReadAt: number | null;
            createdAt: number;
            updatedAt: number;
            latestUserMessageAt: number | null;
            latestAssistantMessageAt: number | null;
            unread: boolean;
            isIsolated: boolean;
            worktreeId: string | null;
            worktreeBranch: string | null;
            worktreePath: string | null;
            worktreeHealth: 'ok' | 'missing' | 'stale' | null;
            pendingWorktreeId: string | null;
            isolationBoundaryRequired: boolean;
        };
        execution: {
            isIsolated: boolean;
            worktreeId: string | null;
            worktreeBranch: string | null;
            worktreePath: string | null;
            worktreeHealth: 'ok' | 'missing' | 'stale' | null;
            pendingWorktreeId: string | null;
            isolationBoundaryRequired: boolean;
        };
        readiness: {
            isolated: boolean;
            clean: boolean;
            branch: string | null;
            baseRef: string | null;
            commitsAhead: number;
            changedFiles: number;
        };
        pullRequest: {
            owner: string;
            repo: string;
            number: number;
            url: string;
            title: string;
            isDraft: boolean;
            state: 'open' | 'closed';
            merged: boolean;
            headRef: string;
            baseRef: string;
            headSha: string | null;
            createdAt: number;
            updatedAt: number;
            author?: {
                login: string;
                avatarUrl: string;
                url: string;
            } | null;
            additions?: number;
            deletions?: number;
        } | null;
        activity: 'idle' | 'running' | 'waiting' | 'blocked';
    };
};

export type PostWorksByIdBranchResponse = PostWorksByIdBranchResponses[keyof PostWorksByIdBranchResponses];

export type GetSessionsByIdWorkData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/sessions/{id}/work';
};

export type GetSessionsByIdWorkResponses = {
    /**
     * Response for status 200
     */
    200: {
        work: {
            id: string;
            title: string;
            objective: string;
            linkedIssueId: string | null;
            handoffTitle: string | null;
            handoffSummary: string | null;
            handoffTestPlan: string | null;
            preparedAt: number | null;
            lastSubmittedAt: number | null;
            closedAt: number | null;
            archivedAt: number | null;
            createdAt: number;
            updatedAt: number;
            workspaceId: string;
            primarySessionId: string;
            activity: 'idle' | 'running' | 'waiting' | 'blocked';
            pullRequest: {
                owner: string;
                repo: string;
                number: number;
                url: string;
                title: string;
                isDraft: boolean;
                state: 'open' | 'closed';
                merged: boolean;
                headRef: string;
                baseRef: string;
                headSha: string | null;
                createdAt: number;
                updatedAt: number;
                author?: {
                    login: string;
                    avatarUrl: string;
                    url: string;
                } | null;
                additions?: number;
                deletions?: number;
            } | null;
        } | null;
    };
};

export type GetSessionsByIdWorkResponse = GetSessionsByIdWorkResponses[keyof GetSessionsByIdWorkResponses];

export type GetSessionsByIdPullRequestData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/sessions/{id}/pull-request';
};

export type GetSessionsByIdPullRequestResponses = {
    /**
     * Response for status 200
     */
    200: {
        pullRequest: {
            owner: string;
            repo: string;
            number: number;
            url: string;
            title: string;
            isDraft: boolean;
            state: 'open' | 'closed';
            merged: boolean;
            headRef: string;
            baseRef: string;
            headSha: string | null;
            createdAt: number;
            updatedAt: number;
            author?: {
                login: string;
                avatarUrl: string;
                url: string;
            } | null;
            additions?: number;
            deletions?: number;
        } | null;
    };
};

export type GetSessionsByIdPullRequestResponse = GetSessionsByIdPullRequestResponses[keyof GetSessionsByIdPullRequestResponses];

export type PostSessionsByIdPullRequestData = {
    body: {
        title: string;
        body?: string;
        base?: string;
    };
    path: {
        id: string;
    };
    query?: never;
    url: '/sessions/{id}/pull-request';
};

export type PostSessionsByIdPullRequestResponses = {
    /**
     * Response for status 200
     */
    200: {
        pullRequest: {
            owner: string;
            repo: string;
            number: number;
            url: string;
            title: string;
            isDraft: boolean;
            state: 'open' | 'closed';
            merged: boolean;
            headRef: string;
            baseRef: string;
            headSha: string | null;
            createdAt: number;
            updatedAt: number;
            author?: {
                login: string;
                avatarUrl: string;
                url: string;
            } | null;
            additions?: number;
            deletions?: number;
        };
    };
};

export type PostSessionsByIdPullRequestResponse = PostSessionsByIdPullRequestResponses[keyof PostSessionsByIdPullRequestResponses];

export type GetSessionsByIdPullRequestDetailData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/sessions/{id}/pull-request/detail';
};

export type GetSessionsByIdPullRequestDetailResponses = {
    /**
     * Response for status 200
     */
    200: {
        pullRequest: {
            owner: string;
            repo: string;
            number: number;
            url: string;
            title: string;
            isDraft: boolean;
            state: 'open' | 'closed';
            merged: boolean;
            headRef: string;
            baseRef: string;
            headSha: string | null;
            createdAt: number;
            updatedAt: number;
            author: {
                login: string;
                avatarUrl: string;
                url: string;
            } | null;
            additions: number;
            deletions: number;
            body: string | null;
            changedFiles: number;
            commits: number;
            comments: number;
            reviewComments: number;
            mergeable: boolean | null;
            mergeableState: string;
            createdAtIso: string;
            updatedAtIso: string;
            closedAtIso: string | null;
            mergedAtIso: string | null;
            reviewers: Array<{
                login: string;
                avatarUrl: string;
                url: string;
            }>;
            assignees: Array<{
                login: string;
                avatarUrl: string;
                url: string;
            }>;
            labels: Array<{
                name: string;
                color: string;
            }>;
            checksState: 'success' | 'failure' | 'pending' | 'neutral';
            checks: Array<{
                id: string;
                name: string;
                status: 'queued' | 'in_progress' | 'completed';
                conclusion: string | null;
                url: string | null;
            }>;
            allowedMergeMethods: Array<'merge' | 'squash' | 'rebase'>;
            mergeBlockers: Array<string>;
            canMerge: boolean;
        };
        timeline: Array<{
            id: string;
            kind: 'comment' | 'review';
            author: {
                login: string;
                avatarUrl: string | null;
                url: string | null;
            } | null;
            body: string | null;
            state: string | null;
            createdAt: string;
            url: string | null;
        }>;
        files: Array<{
            sha: string;
            filename: string;
            previousFilename: string | null;
            status: string;
            additions: number;
            deletions: number;
            changes: number;
            patch: string | null;
            blobUrl: string;
            rawUrl: string;
        }>;
    };
};

export type GetSessionsByIdPullRequestDetailResponse = GetSessionsByIdPullRequestDetailResponses[keyof GetSessionsByIdPullRequestDetailResponses];

export type PostSessionsByIdPullRequestReadyData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/sessions/{id}/pull-request/ready';
};

export type PostSessionsByIdPullRequestReadyResponses = {
    /**
     * Response for status 200
     */
    200: {
        pullRequest: {
            owner: string;
            repo: string;
            number: number;
            url: string;
            title: string;
            isDraft: boolean;
            state: 'open' | 'closed';
            merged: boolean;
            headRef: string;
            baseRef: string;
            headSha: string | null;
            createdAt: number;
            updatedAt: number;
            author?: {
                login: string;
                avatarUrl: string;
                url: string;
            } | null;
            additions?: number;
            deletions?: number;
        };
    };
};

export type PostSessionsByIdPullRequestReadyResponse = PostSessionsByIdPullRequestReadyResponses[keyof PostSessionsByIdPullRequestReadyResponses];

export type GetPullRequestsViewerData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/pull-requests/viewer';
};

export type GetPullRequestsViewerResponses = {
    /**
     * Response for status 200
     */
    200: {
        viewer: {
            login: string;
            avatarUrl: string;
            url: string;
        };
    };
};

export type GetPullRequestsViewerResponse = GetPullRequestsViewerResponses[keyof GetPullRequestsViewerResponses];

export type GetPullRequestsAuthoredData = {
    body?: never;
    path?: never;
    query: {
        login: string;
        after?: string;
    };
    url: '/pull-requests/authored';
};

export type GetPullRequestsAuthoredResponses = {
    /**
     * Response for status 200
     */
    200: {
        items: Array<{
            owner: string;
            repo: string;
            number: number;
            url: string;
            title: string;
            isDraft: boolean;
            state: 'open' | 'closed';
            merged: boolean;
            headRef: string;
            baseRef: string;
            headSha: string | null;
            createdAt: number;
            updatedAt: number;
            author?: {
                login: string;
                avatarUrl: string;
                url: string;
            } | null;
            additions?: number;
            deletions?: number;
            checksState: 'success' | 'failure' | 'pending' | 'neutral';
        }>;
        hasNextPage: boolean;
        endCursor: string | null;
    };
};

export type GetPullRequestsAuthoredResponse = GetPullRequestsAuthoredResponses[keyof GetPullRequestsAuthoredResponses];

export type GetPullRequestsReviewingData = {
    body?: never;
    path?: never;
    query: {
        login: string;
        after?: string;
    };
    url: '/pull-requests/reviewing';
};

export type GetPullRequestsReviewingResponses = {
    /**
     * Response for status 200
     */
    200: {
        items: Array<{
            owner: string;
            repo: string;
            number: number;
            url: string;
            title: string;
            isDraft: boolean;
            state: 'open' | 'closed';
            merged: boolean;
            headRef: string;
            baseRef: string;
            headSha: string | null;
            createdAt: number;
            updatedAt: number;
            author?: {
                login: string;
                avatarUrl: string;
                url: string;
            } | null;
            additions?: number;
            deletions?: number;
            checksState: 'success' | 'failure' | 'pending' | 'neutral';
        }>;
        hasNextPage: boolean;
        endCursor: string | null;
    };
};

export type GetPullRequestsReviewingResponse = GetPullRequestsReviewingResponses[keyof GetPullRequestsReviewingResponses];

export type GetPullRequestsByOwnerByRepoAssignableUsersData = {
    body?: never;
    path: {
        owner: string;
        repo: string;
    };
    query?: never;
    url: '/pull-requests/{owner}/{repo}/assignable-users';
};

export type GetPullRequestsByOwnerByRepoAssignableUsersResponses = {
    /**
     * Response for status 200
     */
    200: {
        users: Array<{
            login: string;
            avatarUrl: string;
            url: string;
        }>;
    };
};

export type GetPullRequestsByOwnerByRepoAssignableUsersResponse = GetPullRequestsByOwnerByRepoAssignableUsersResponses[keyof GetPullRequestsByOwnerByRepoAssignableUsersResponses];

export type GetPullRequestsByOwnerByRepoByNumberDetailData = {
    body?: never;
    path: {
        owner: string;
        repo: string;
        number: string;
    };
    query?: never;
    url: '/pull-requests/{owner}/{repo}/{number}/detail';
};

export type GetPullRequestsByOwnerByRepoByNumberDetailResponses = {
    /**
     * Response for status 200
     */
    200: {
        pullRequest: {
            owner: string;
            repo: string;
            number: number;
            url: string;
            title: string;
            isDraft: boolean;
            state: 'open' | 'closed';
            merged: boolean;
            headRef: string;
            baseRef: string;
            headSha: string | null;
            createdAt: number;
            updatedAt: number;
            author: {
                login: string;
                avatarUrl: string;
                url: string;
            } | null;
            additions: number;
            deletions: number;
            body: string | null;
            changedFiles: number;
            commits: number;
            comments: number;
            reviewComments: number;
            mergeable: boolean | null;
            mergeableState: string;
            createdAtIso: string;
            updatedAtIso: string;
            closedAtIso: string | null;
            mergedAtIso: string | null;
            reviewers: Array<{
                login: string;
                avatarUrl: string;
                url: string;
            }>;
            assignees: Array<{
                login: string;
                avatarUrl: string;
                url: string;
            }>;
            labels: Array<{
                name: string;
                color: string;
            }>;
            checksState: 'success' | 'failure' | 'pending' | 'neutral';
            checks: Array<{
                id: string;
                name: string;
                status: 'queued' | 'in_progress' | 'completed';
                conclusion: string | null;
                url: string | null;
            }>;
            allowedMergeMethods: Array<'merge' | 'squash' | 'rebase'>;
            mergeBlockers: Array<string>;
            canMerge: boolean;
        };
        timeline: Array<{
            id: string;
            kind: 'comment' | 'review';
            author: {
                login: string;
                avatarUrl: string | null;
                url: string | null;
            } | null;
            body: string | null;
            state: string | null;
            createdAt: string;
            url: string | null;
        }>;
        files: Array<{
            sha: string;
            filename: string;
            previousFilename: string | null;
            status: string;
            additions: number;
            deletions: number;
            changes: number;
            patch: string | null;
            blobUrl: string;
            rawUrl: string;
        }>;
    };
};

export type GetPullRequestsByOwnerByRepoByNumberDetailResponse = GetPullRequestsByOwnerByRepoByNumberDetailResponses[keyof GetPullRequestsByOwnerByRepoByNumberDetailResponses];

export type GetPullRequestsByOwnerByRepoByNumberFingerprintData = {
    body?: never;
    path: {
        owner: string;
        repo: string;
        number: string;
    };
    query?: never;
    url: '/pull-requests/{owner}/{repo}/{number}/fingerprint';
};

export type GetPullRequestsByOwnerByRepoByNumberFingerprintResponses = {
    /**
     * Response for status 200
     */
    200: {
        fingerprint: {
            updatedAt: string;
            headSha: string;
            state: 'open' | 'closed';
            merged: boolean;
            isDraft: boolean;
            mergeableState: string;
            comments: number;
            reviewComments: number;
            commits: number;
            checksState: 'success' | 'failure' | 'pending' | 'neutral';
        };
        changed: boolean;
    };
};

export type GetPullRequestsByOwnerByRepoByNumberFingerprintResponse = GetPullRequestsByOwnerByRepoByNumberFingerprintResponses[keyof GetPullRequestsByOwnerByRepoByNumberFingerprintResponses];

export type PostPullRequestsByOwnerByRepoByNumberFingerprintProbeData = {
    body: {
        previous?: {
            updatedAt: string;
            headSha: string;
            state: 'open' | 'closed';
            merged: boolean;
            isDraft: boolean;
            mergeableState: string;
            comments: number;
            reviewComments: number;
            commits: number;
            checksState: 'success' | 'failure' | 'pending' | 'neutral';
        } | null;
    };
    path: {
        owner: string;
        repo: string;
        number: string;
    };
    query?: never;
    url: '/pull-requests/{owner}/{repo}/{number}/fingerprint/probe';
};

export type PostPullRequestsByOwnerByRepoByNumberFingerprintProbeResponses = {
    /**
     * Response for status 200
     */
    200: {
        fingerprint: {
            updatedAt: string;
            headSha: string;
            state: 'open' | 'closed';
            merged: boolean;
            isDraft: boolean;
            mergeableState: string;
            comments: number;
            reviewComments: number;
            commits: number;
            checksState: 'success' | 'failure' | 'pending' | 'neutral';
        };
        changed: boolean;
    };
};

export type PostPullRequestsByOwnerByRepoByNumberFingerprintProbeResponse = PostPullRequestsByOwnerByRepoByNumberFingerprintProbeResponses[keyof PostPullRequestsByOwnerByRepoByNumberFingerprintProbeResponses];

export type PostPullRequestsByOwnerByRepoByNumberCommentData = {
    body: {
        body: string;
    };
    path: {
        owner: string;
        repo: string;
        number: string;
    };
    query?: never;
    url: '/pull-requests/{owner}/{repo}/{number}/comment';
};

export type PostPullRequestsByOwnerByRepoByNumberCommentResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        body: string;
        url: string;
        createdAt: string;
    };
};

export type PostPullRequestsByOwnerByRepoByNumberCommentResponse = PostPullRequestsByOwnerByRepoByNumberCommentResponses[keyof PostPullRequestsByOwnerByRepoByNumberCommentResponses];

export type PostPullRequestsByOwnerByRepoByNumberReviewData = {
    body: {
        event: 'APPROVE' | 'REQUEST_CHANGES' | 'COMMENT';
        body?: string;
    };
    path: {
        owner: string;
        repo: string;
        number: string;
    };
    query?: never;
    url: '/pull-requests/{owner}/{repo}/{number}/review';
};

export type PostPullRequestsByOwnerByRepoByNumberReviewResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: number;
        state: string;
        body: string | null;
        htmlUrl: string;
    };
};

export type PostPullRequestsByOwnerByRepoByNumberReviewResponse = PostPullRequestsByOwnerByRepoByNumberReviewResponses[keyof PostPullRequestsByOwnerByRepoByNumberReviewResponses];

export type PostPullRequestsByOwnerByRepoByNumberMergeData = {
    body: {
        mergeMethod: 'merge' | 'squash' | 'rebase';
        commitTitle?: string;
        commitMessage?: string;
    };
    path: {
        owner: string;
        repo: string;
        number: string;
    };
    query?: never;
    url: '/pull-requests/{owner}/{repo}/{number}/merge';
};

export type PostPullRequestsByOwnerByRepoByNumberMergeResponses = {
    /**
     * Response for status 200
     */
    200: {
        sha: string;
        merged: boolean;
        message: string;
    };
};

export type PostPullRequestsByOwnerByRepoByNumberMergeResponse = PostPullRequestsByOwnerByRepoByNumberMergeResponses[keyof PostPullRequestsByOwnerByRepoByNumberMergeResponses];

export type PostPullRequestsByOwnerByRepoByNumberAssigneesData = {
    body: {
        add?: Array<string>;
        remove?: Array<string>;
    };
    path: {
        owner: string;
        repo: string;
        number: string;
    };
    query?: never;
    url: '/pull-requests/{owner}/{repo}/{number}/assignees';
};

export type PostPullRequestsByOwnerByRepoByNumberAssigneesResponses = {
    /**
     * Response for status 200
     */
    200: {
        added: Array<string>;
        removed: Array<string>;
    };
};

export type PostPullRequestsByOwnerByRepoByNumberAssigneesResponse = PostPullRequestsByOwnerByRepoByNumberAssigneesResponses[keyof PostPullRequestsByOwnerByRepoByNumberAssigneesResponses];

export type PostPullRequestsByOwnerByRepoByNumberReviewersData = {
    body: {
        add?: Array<string>;
        remove?: Array<string>;
    };
    path: {
        owner: string;
        repo: string;
        number: string;
    };
    query?: never;
    url: '/pull-requests/{owner}/{repo}/{number}/reviewers';
};

export type PostPullRequestsByOwnerByRepoByNumberReviewersResponses = {
    /**
     * Response for status 200
     */
    200: {
        added: Array<string>;
        removed: Array<string>;
    };
};

export type PostPullRequestsByOwnerByRepoByNumberReviewersResponse = PostPullRequestsByOwnerByRepoByNumberReviewersResponses[keyof PostPullRequestsByOwnerByRepoByNumberReviewersResponses];

export type PostPullRequestsByOwnerByRepoByNumberReadyData = {
    body?: never;
    path: {
        owner: string;
        repo: string;
        number: string;
    };
    query?: never;
    url: '/pull-requests/{owner}/{repo}/{number}/ready';
};

export type PostPullRequestsByOwnerByRepoByNumberReadyResponses = {
    /**
     * Response for status 200
     */
    200: {
        pullRequest: {
            owner: string;
            repo: string;
            number: number;
            url: string;
            title: string;
            isDraft: boolean;
            state: 'open' | 'closed';
            merged: boolean;
            headRef: string;
            baseRef: string;
            headSha: string | null;
            createdAt: number;
            updatedAt: number;
            author?: {
                login: string;
                avatarUrl: string;
                url: string;
            } | null;
            additions?: number;
            deletions?: number;
        };
    };
};

export type PostPullRequestsByOwnerByRepoByNumberReadyResponse = PostPullRequestsByOwnerByRepoByNumberReadyResponses[keyof PostPullRequestsByOwnerByRepoByNumberReadyResponses];

export type PostPullRequestsByOwnerByRepoByNumberDraftData = {
    body?: never;
    path: {
        owner: string;
        repo: string;
        number: string;
    };
    query?: never;
    url: '/pull-requests/{owner}/{repo}/{number}/draft';
};

export type PostPullRequestsByOwnerByRepoByNumberDraftResponses = {
    /**
     * Response for status 200
     */
    200: {
        pullRequest: {
            owner: string;
            repo: string;
            number: number;
            url: string;
            title: string;
            isDraft: boolean;
            state: 'open' | 'closed';
            merged: boolean;
            headRef: string;
            baseRef: string;
            headSha: string | null;
            createdAt: number;
            updatedAt: number;
            author?: {
                login: string;
                avatarUrl: string;
                url: string;
            } | null;
            additions?: number;
            deletions?: number;
        };
    };
};

export type PostPullRequestsByOwnerByRepoByNumberDraftResponse = PostPullRequestsByOwnerByRepoByNumberDraftResponses[keyof PostPullRequestsByOwnerByRepoByNumberDraftResponses];

export type GetSessionGroupsData = {
    body?: never;
    path?: never;
    query?: {
        workspaceId?: string;
        linkedIssueId?: string;
        archived?: boolean;
    };
    url: '/session-groups';
};

export type GetSessionGroupsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        workspaceId: string;
        title: string;
        description: string | null;
        linkedIssueId: string | null;
        status: 'active' | 'archived';
        configJson: string;
        archivedAt: number | null;
        createdAt: number;
        updatedAt: number;
        sessionCount: number;
        statusAggregate: 'idle' | 'streaming' | 'error';
        latestActivityAt: number | null;
    }>;
};

export type GetSessionGroupsResponse = GetSessionGroupsResponses[keyof GetSessionGroupsResponses];

export type PostSessionGroupsData = {
    body: {
        workspaceId: string;
        title: string;
        description?: string | null;
        linkedIssueId?: string | null;
        sessionIds?: Array<string>;
    };
    path?: never;
    query?: never;
    url: '/session-groups';
};

export type PostSessionGroupsResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string;
        title: string;
        description: string | null;
        linkedIssueId: string | null;
        status: 'active' | 'archived';
        configJson: string;
        archivedAt: number | null;
        createdAt: number;
        updatedAt: number;
        sessionCount: number;
        statusAggregate: 'idle' | 'streaming' | 'error';
        latestActivityAt: number | null;
        sessions: Array<{
            id: string;
            title: string | null;
            status: 'idle' | 'streaming' | 'error';
            latestUserMessageAt: number | null;
        }>;
    };
};

export type PostSessionGroupsResponse = PostSessionGroupsResponses[keyof PostSessionGroupsResponses];

export type DeleteSessionGroupsByIdData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/session-groups/{id}';
};

export type DeleteSessionGroupsByIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type DeleteSessionGroupsByIdResponse = DeleteSessionGroupsByIdResponses[keyof DeleteSessionGroupsByIdResponses];

export type GetSessionGroupsByIdData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/session-groups/{id}';
};

export type GetSessionGroupsByIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string;
        title: string;
        description: string | null;
        linkedIssueId: string | null;
        status: 'active' | 'archived';
        configJson: string;
        archivedAt: number | null;
        createdAt: number;
        updatedAt: number;
        sessionCount: number;
        statusAggregate: 'idle' | 'streaming' | 'error';
        latestActivityAt: number | null;
        sessions: Array<{
            id: string;
            title: string | null;
            status: 'idle' | 'streaming' | 'error';
            latestUserMessageAt: number | null;
        }>;
    };
};

export type GetSessionGroupsByIdResponse = GetSessionGroupsByIdResponses[keyof GetSessionGroupsByIdResponses];

export type PatchSessionGroupsByIdData = {
    body: {
        title?: string;
        description?: string | null;
        linkedIssueId?: string | null;
        archived?: boolean;
    };
    path: {
        id: string;
    };
    query?: never;
    url: '/session-groups/{id}';
};

export type PatchSessionGroupsByIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string;
        title: string;
        description: string | null;
        linkedIssueId: string | null;
        status: 'active' | 'archived';
        configJson: string;
        archivedAt: number | null;
        createdAt: number;
        updatedAt: number;
        sessionCount: number;
        statusAggregate: 'idle' | 'streaming' | 'error';
        latestActivityAt: number | null;
        sessions: Array<{
            id: string;
            title: string | null;
            status: 'idle' | 'streaming' | 'error';
            latestUserMessageAt: number | null;
        }>;
    };
};

export type PatchSessionGroupsByIdResponse = PatchSessionGroupsByIdResponses[keyof PatchSessionGroupsByIdResponses];

export type PostSessionGroupsByIdMembersData = {
    body: {
        sessionIds: Array<string>;
    };
    path: {
        id: string;
    };
    query?: never;
    url: '/session-groups/{id}/members';
};

export type PostSessionGroupsByIdMembersResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string;
        title: string;
        description: string | null;
        linkedIssueId: string | null;
        status: 'active' | 'archived';
        configJson: string;
        archivedAt: number | null;
        createdAt: number;
        updatedAt: number;
        sessionCount: number;
        statusAggregate: 'idle' | 'streaming' | 'error';
        latestActivityAt: number | null;
        sessions: Array<{
            id: string;
            title: string | null;
            status: 'idle' | 'streaming' | 'error';
            latestUserMessageAt: number | null;
        }>;
    };
};

export type PostSessionGroupsByIdMembersResponse = PostSessionGroupsByIdMembersResponses[keyof PostSessionGroupsByIdMembersResponses];

export type DeleteSessionGroupsByIdMembersBySessionIdData = {
    body?: never;
    path: {
        id: string;
        sessionId: string;
    };
    query?: never;
    url: '/session-groups/{id}/members/{sessionId}';
};

export type DeleteSessionGroupsByIdMembersBySessionIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string;
        title: string;
        description: string | null;
        linkedIssueId: string | null;
        status: 'active' | 'archived';
        configJson: string;
        archivedAt: number | null;
        createdAt: number;
        updatedAt: number;
        sessionCount: number;
        statusAggregate: 'idle' | 'streaming' | 'error';
        latestActivityAt: number | null;
        sessions: Array<{
            id: string;
            title: string | null;
            status: 'idle' | 'streaming' | 'error';
            latestUserMessageAt: number | null;
        }>;
    };
};

export type DeleteSessionGroupsByIdMembersBySessionIdResponse = DeleteSessionGroupsByIdMembersBySessionIdResponses[keyof DeleteSessionGroupsByIdMembersBySessionIdResponses];

export type GetSessionAwaitsData = {
    body?: never;
    path?: never;
    query: {
        sessionId: string;
    };
    url: '/session-awaits/';
};

export type GetSessionAwaitsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        chatSessionId: string;
        workspaceId: string;
        source: string;
        filterJson: string;
        status: 'pending' | 'triggered' | 'expired' | 'cancelled' | 'failed';
        reason: string | null;
        resumeText: string | null;
        resumePayloadJson: string | null;
        failureKind: 'source' | 'delivery' | null;
        bypassedChecksJson: string | null;
        createdAt: number;
        triggeredAt: number | null;
        expiresAt: number | null;
        fireAt: number | null;
        lastCheckedAt: number | null;
        lastErrorText: string | null;
        lastObservationJson: string | null;
        consecutiveErrorCount: number;
    }>;
};

export type GetSessionAwaitsResponse = GetSessionAwaitsResponses[keyof GetSessionAwaitsResponses];

export type PostSessionAwaitsData = {
    body: {
        chatSessionId: string;
        workspaceId: string;
        source: string;
        filterJson: string;
        reason?: string | null;
        expiresAt?: number | null;
        fireAt?: number | null;
    };
    path?: never;
    query?: never;
    url: '/session-awaits/';
};

export type PostSessionAwaitsResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        chatSessionId: string;
        workspaceId: string;
        source: string;
        filterJson: string;
        status: 'pending' | 'triggered' | 'expired' | 'cancelled' | 'failed';
        reason: string | null;
        resumeText: string | null;
        resumePayloadJson: string | null;
        failureKind: 'source' | 'delivery' | null;
        bypassedChecksJson: string | null;
        createdAt: number;
        triggeredAt: number | null;
        expiresAt: number | null;
        fireAt: number | null;
        lastCheckedAt: number | null;
        lastErrorText: string | null;
        lastObservationJson: string | null;
        consecutiveErrorCount: number;
    };
};

export type PostSessionAwaitsResponse = PostSessionAwaitsResponses[keyof PostSessionAwaitsResponses];

export type GetSessionAwaitsByIdData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/session-awaits/{id}';
};

export type GetSessionAwaitsByIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        chatSessionId: string;
        workspaceId: string;
        source: string;
        filterJson: string;
        status: 'pending' | 'triggered' | 'expired' | 'cancelled' | 'failed';
        reason: string | null;
        resumeText: string | null;
        resumePayloadJson: string | null;
        failureKind: 'source' | 'delivery' | null;
        bypassedChecksJson: string | null;
        createdAt: number;
        triggeredAt: number | null;
        expiresAt: number | null;
        fireAt: number | null;
        lastCheckedAt: number | null;
        lastErrorText: string | null;
        lastObservationJson: string | null;
        consecutiveErrorCount: number;
    };
};

export type GetSessionAwaitsByIdResponse = GetSessionAwaitsByIdResponses[keyof GetSessionAwaitsByIdResponses];

export type PostSessionAwaitsByIdCancelData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/session-awaits/{id}/cancel';
};

export type PostSessionAwaitsByIdCancelResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        chatSessionId: string;
        workspaceId: string;
        source: string;
        filterJson: string;
        status: 'pending' | 'triggered' | 'expired' | 'cancelled' | 'failed';
        reason: string | null;
        resumeText: string | null;
        resumePayloadJson: string | null;
        failureKind: 'source' | 'delivery' | null;
        bypassedChecksJson: string | null;
        createdAt: number;
        triggeredAt: number | null;
        expiresAt: number | null;
        fireAt: number | null;
        lastCheckedAt: number | null;
        lastErrorText: string | null;
        lastObservationJson: string | null;
        consecutiveErrorCount: number;
    };
};

export type PostSessionAwaitsByIdCancelResponse = PostSessionAwaitsByIdCancelResponses[keyof PostSessionAwaitsByIdCancelResponses];

export type PostSessionAwaitsByIdTriggerData = {
    body: {
        resumeText: string;
        resumePayloadJson?: string | null;
    };
    path: {
        id: string;
    };
    query?: never;
    url: '/session-awaits/{id}/trigger';
};

export type PostSessionAwaitsByIdTriggerResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        chatSessionId: string;
        workspaceId: string;
        source: string;
        filterJson: string;
        status: 'pending' | 'triggered' | 'expired' | 'cancelled' | 'failed';
        reason: string | null;
        resumeText: string | null;
        resumePayloadJson: string | null;
        failureKind: 'source' | 'delivery' | null;
        bypassedChecksJson: string | null;
        createdAt: number;
        triggeredAt: number | null;
        expiresAt: number | null;
        fireAt: number | null;
        lastCheckedAt: number | null;
        lastErrorText: string | null;
        lastObservationJson: string | null;
        consecutiveErrorCount: number;
    };
};

export type PostSessionAwaitsByIdTriggerResponse = PostSessionAwaitsByIdTriggerResponses[keyof PostSessionAwaitsByIdTriggerResponses];

export type PostSessionAwaitsByIdRetryDeliveryData = {
    body: {
        resumeText?: string;
        resumePayloadJson?: string | null;
    };
    path: {
        id: string;
    };
    query?: never;
    url: '/session-awaits/{id}/retry-delivery';
};

export type PostSessionAwaitsByIdRetryDeliveryResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        chatSessionId: string;
        workspaceId: string;
        source: string;
        filterJson: string;
        status: 'pending' | 'triggered' | 'expired' | 'cancelled' | 'failed';
        reason: string | null;
        resumeText: string | null;
        resumePayloadJson: string | null;
        failureKind: 'source' | 'delivery' | null;
        bypassedChecksJson: string | null;
        createdAt: number;
        triggeredAt: number | null;
        expiresAt: number | null;
        fireAt: number | null;
        lastCheckedAt: number | null;
        lastErrorText: string | null;
        lastObservationJson: string | null;
        consecutiveErrorCount: number;
    };
};

export type PostSessionAwaitsByIdRetryDeliveryResponse = PostSessionAwaitsByIdRetryDeliveryResponses[keyof PostSessionAwaitsByIdRetryDeliveryResponses];

export type GetSessionAwaitsSummaryData = {
    body?: never;
    path?: never;
    query: {
        sessionId: string;
    };
    url: '/session-awaits/summary';
};

export type GetSessionAwaitsSummaryResponses = {
    /**
     * Response for status 200
     */
    200: {
        awaiting: boolean;
        pendingCount: number;
        primaryAwaitId: string | null;
        primarySource: string | null;
        reason: string | null;
    };
};

export type GetSessionAwaitsSummaryResponse = GetSessionAwaitsSummaryResponses[keyof GetSessionAwaitsSummaryResponses];

export type GetSessionAwaitsDiscoveredReposData = {
    body?: never;
    path?: never;
    query: {
        workspaceId: string;
    };
    url: '/session-awaits/discovered-repos';
};

export type GetSessionAwaitsDiscoveredReposResponses = {
    /**
     * Response for status 200
     */
    200: Array<string>;
};

export type GetSessionAwaitsDiscoveredReposResponse = GetSessionAwaitsDiscoveredReposResponses[keyof GetSessionAwaitsDiscoveredReposResponses];

export type GetSessionAwaitsAvailableChecksData = {
    body?: never;
    path?: never;
    query: {
        owner: string;
        repo: string;
    };
    url: '/session-awaits/available-checks';
};

export type GetSessionAwaitsAvailableChecksResponses = {
    /**
     * Response for status 200
     */
    200: {
        owner: string;
        repo: string;
        defaultBranch: string;
        checks: Array<{
            name: string;
            required: boolean;
            source: 'check-run' | 'status';
        }>;
    };
};

export type GetSessionAwaitsAvailableChecksResponse = GetSessionAwaitsAvailableChecksResponses[keyof GetSessionAwaitsAvailableChecksResponses];

export type PostSessionAwaitsByIdBypassCheckData = {
    body: {
        checkName: string;
    };
    path: {
        id: string;
    };
    query?: never;
    url: '/session-awaits/{id}/bypass-check';
};

export type PostSessionAwaitsByIdBypassCheckResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        chatSessionId: string;
        workspaceId: string;
        source: string;
        filterJson: string;
        status: 'pending' | 'triggered' | 'expired' | 'cancelled' | 'failed';
        reason: string | null;
        resumeText: string | null;
        resumePayloadJson: string | null;
        failureKind: 'source' | 'delivery' | null;
        bypassedChecksJson: string | null;
        createdAt: number;
        triggeredAt: number | null;
        expiresAt: number | null;
        fireAt: number | null;
        lastCheckedAt: number | null;
        lastErrorText: string | null;
        lastObservationJson: string | null;
        consecutiveErrorCount: number;
    };
};

export type PostSessionAwaitsByIdBypassCheckResponse = PostSessionAwaitsByIdBypassCheckResponses[keyof PostSessionAwaitsByIdBypassCheckResponses];

export type PostSessionAwaitsByIdEvaluateNowData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/session-awaits/{id}/evaluate-now';
};

export type PostSessionAwaitsByIdEvaluateNowResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
        matched?: boolean;
        observationJson?: string | null;
        resumeText?: string;
        resumePayloadJson?: string;
        error?: string;
    };
};

export type PostSessionAwaitsByIdEvaluateNowResponse = PostSessionAwaitsByIdEvaluateNowResponses[keyof PostSessionAwaitsByIdEvaluateNowResponses];

export type GetSessionAwaitsByIdLiveStatusData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/session-awaits/{id}/live-status';
};

export type GetSessionAwaitsBypassRulesData = {
    body?: never;
    path?: never;
    query: {
        workspaceId: string;
    };
    url: '/session-awaits/bypass-rules';
};

export type GetSessionAwaitsBypassRulesResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        workspaceId: string;
        repo: string;
        checkPattern: string;
        enabled: number;
        createdAt: number;
    }>;
};

export type GetSessionAwaitsBypassRulesResponse = GetSessionAwaitsBypassRulesResponses[keyof GetSessionAwaitsBypassRulesResponses];

export type PostSessionAwaitsBypassRulesData = {
    body: {
        workspaceId: string;
        repo: string;
        checkPattern: string;
    };
    path?: never;
    query?: never;
    url: '/session-awaits/bypass-rules';
};

export type PostSessionAwaitsBypassRulesResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string;
        repo: string;
        checkPattern: string;
        enabled: number;
        createdAt: number;
    };
};

export type PostSessionAwaitsBypassRulesResponse = PostSessionAwaitsBypassRulesResponses[keyof PostSessionAwaitsBypassRulesResponses];

export type DeleteSessionAwaitsBypassRulesByIdData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/session-awaits/bypass-rules/{id}';
};

export type PatchSessionAwaitsBypassRulesByIdData = {
    body: {
        enabled: boolean;
    };
    path: {
        id: string;
    };
    query?: never;
    url: '/session-awaits/bypass-rules/{id}';
};

export type PatchSessionAwaitsBypassRulesByIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string;
        repo: string;
        checkPattern: string;
        enabled: number;
        createdAt: number;
    };
};

export type PatchSessionAwaitsBypassRulesByIdResponse = PatchSessionAwaitsBypassRulesByIdResponses[keyof PatchSessionAwaitsBypassRulesByIdResponses];

export type PostJavascriptEvaluateData = {
    body: {
        program: string;
        timeoutMs?: number;
        cwd?: string;
    };
    path?: never;
    query?: never;
    url: '/javascript/evaluate';
};

export type PostJavascriptEvaluateResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
        result?: unknown;
        error?: string;
        kind?: string;
    };
};

export type PostJavascriptEvaluateResponse = PostJavascriptEvaluateResponses[keyof PostJavascriptEvaluateResponses];

export type GetIssuesStatusesData = {
    body?: never;
    path?: never;
    query?: {
        workspaceId?: string;
    };
    url: '/issues/statuses';
};

export type GetIssuesStatusesResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        workspaceId: string;
        name: string;
        color: string | null;
        category: string;
        order: number;
        createdAt: number;
    }>;
};

export type GetIssuesStatusesResponse = GetIssuesStatusesResponses[keyof GetIssuesStatusesResponses];

export type PostIssuesStatusesData = {
    body: {
        workspaceId: string;
        name: string;
        color?: string | null;
        category?: 'triage' | 'backlog' | 'unstarted' | 'started' | 'completed' | 'canceled';
    };
    path?: never;
    query?: never;
    url: '/issues/statuses';
};

export type PostIssuesStatusesResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string;
        name: string;
        color: string | null;
        category: string;
        order: number;
        createdAt: number;
    };
};

export type PostIssuesStatusesResponse = PostIssuesStatusesResponses[keyof PostIssuesStatusesResponses];

export type PostIssuesStatusesReorderData = {
    body: {
        workspaceId: string;
        orderedIds: Array<string>;
    };
    path?: never;
    query?: never;
    url: '/issues/statuses/reorder';
};

export type PostIssuesStatusesReorderResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type PostIssuesStatusesReorderResponse = PostIssuesStatusesReorderResponses[keyof PostIssuesStatusesReorderResponses];

export type DeleteIssuesStatusesByIdData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/issues/statuses/{id}';
};

export type DeleteIssuesStatusesByIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type DeleteIssuesStatusesByIdResponse = DeleteIssuesStatusesByIdResponses[keyof DeleteIssuesStatusesByIdResponses];

export type PatchIssuesStatusesByIdData = {
    body: {
        name?: string;
        color?: string | null;
    };
    path: {
        id: string;
    };
    query?: never;
    url: '/issues/statuses/{id}';
};

export type PatchIssuesStatusesByIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string;
        name: string;
        color: string | null;
        category: string;
        order: number;
        createdAt: number;
    };
};

export type PatchIssuesStatusesByIdResponse = PatchIssuesStatusesByIdResponses[keyof PatchIssuesStatusesByIdResponses];

export type GetIssuesMilestonesData = {
    body?: never;
    path?: never;
    query?: {
        workspaceId?: string;
    };
    url: '/issues/milestones';
};

export type GetIssuesMilestonesResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        workspaceId: string;
        title: string;
        description: string | null;
        dueDate: number | null;
        status: 'open' | 'closed';
        createdAt: number;
        updatedAt: number;
    }>;
};

export type GetIssuesMilestonesResponse = GetIssuesMilestonesResponses[keyof GetIssuesMilestonesResponses];

export type PostIssuesMilestonesData = {
    body: {
        workspaceId: string;
        title: string;
        description?: string | null;
        dueDate?: number | null;
        status?: 'open' | 'closed';
    };
    path?: never;
    query?: never;
    url: '/issues/milestones';
};

export type PostIssuesMilestonesResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string;
        title: string;
        description: string | null;
        dueDate: number | null;
        status: 'open' | 'closed';
        createdAt: number;
        updatedAt: number;
    };
};

export type PostIssuesMilestonesResponse = PostIssuesMilestonesResponses[keyof PostIssuesMilestonesResponses];

export type DeleteIssuesMilestonesByIdData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/issues/milestones/{id}';
};

export type DeleteIssuesMilestonesByIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type DeleteIssuesMilestonesByIdResponse = DeleteIssuesMilestonesByIdResponses[keyof DeleteIssuesMilestonesByIdResponses];

export type PatchIssuesMilestonesByIdData = {
    body: {
        title?: string;
        description?: string | null;
        dueDate?: number | null;
        status?: 'open' | 'closed';
    };
    path: {
        id: string;
    };
    query?: never;
    url: '/issues/milestones/{id}';
};

export type PatchIssuesMilestonesByIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string;
        title: string;
        description: string | null;
        dueDate: number | null;
        status: 'open' | 'closed';
        createdAt: number;
        updatedAt: number;
    };
};

export type PatchIssuesMilestonesByIdResponse = PatchIssuesMilestonesByIdResponses[keyof PatchIssuesMilestonesByIdResponses];

export type GetIssuesSearchData = {
    body?: never;
    path?: never;
    query: {
        q: string;
        limit?: string;
    };
    url: '/issues/search';
};

export type GetIssuesSearchResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        workspaceId: string;
        number: number;
        statusId: string | null;
        milestoneId: string | null;
        parentIssueId: string | null;
        title: string;
        description: string | null;
        priority: 'none' | 'low' | 'medium' | 'high' | 'urgent';
        labels: Array<string>;
        assigneeKind: string | null;
        assigneeId: string | null;
        dueDate: number | null;
        createdByKind: 'user' | 'agent' | 'provider-target' | 'system';
        createdById: string;
        sourceChatSessionId: string | null;
        delegateAgentId: string | null;
        delegateProviderTargetId: string | null;
        contextRefs: string;
        order: number;
        createdAt: number;
        updatedAt: number;
    }>;
};

export type GetIssuesSearchResponse = GetIssuesSearchResponses[keyof GetIssuesSearchResponses];

export type GetIssuesData = {
    body?: never;
    path?: never;
    query?: {
        workspaceId?: string;
        milestoneId?: string;
        parentIssueId?: string;
        priority?: string;
        labels?: Array<string> | string;
        statusId?: string;
    };
    url: '/issues/';
};

export type GetIssuesResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        workspaceId: string;
        number: number;
        statusId: string | null;
        milestoneId: string | null;
        parentIssueId: string | null;
        title: string;
        description: string | null;
        priority: 'none' | 'low' | 'medium' | 'high' | 'urgent';
        labels: Array<string>;
        assigneeKind: string | null;
        assigneeId: string | null;
        dueDate: number | null;
        createdByKind: 'user' | 'agent' | 'provider-target' | 'system';
        createdById: string;
        sourceChatSessionId: string | null;
        delegateAgentId: string | null;
        delegateProviderTargetId: string | null;
        contextRefs: string;
        order: number;
        createdAt: number;
        updatedAt: number;
    }>;
};

export type GetIssuesResponse = GetIssuesResponses[keyof GetIssuesResponses];

export type PostIssuesData = {
    body: {
        workspaceId: string;
        title: string;
        description?: string | null;
        priority?: 'none' | 'low' | 'medium' | 'high' | 'urgent';
        labels?: Array<string>;
        milestoneId?: string | null;
        parentIssueId?: string | null;
        statusId?: string | null;
        /**
         * Issue status name or slug, for example "In Progress" or "in_progress".
         */
        statusName?: string | null;
        dueDate?: number | null;
        assigneeKind?: string | null;
        assigneeId?: string | null;
    };
    path?: never;
    query?: never;
    url: '/issues/';
};

export type PostIssuesResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string;
        number: number;
        statusId: string | null;
        milestoneId: string | null;
        parentIssueId: string | null;
        title: string;
        description: string | null;
        priority: 'none' | 'low' | 'medium' | 'high' | 'urgent';
        labels: Array<string>;
        assigneeKind: string | null;
        assigneeId: string | null;
        dueDate: number | null;
        createdByKind: 'user' | 'agent' | 'provider-target' | 'system';
        createdById: string;
        sourceChatSessionId: string | null;
        delegateAgentId: string | null;
        delegateProviderTargetId: string | null;
        contextRefs: string;
        order: number;
        createdAt: number;
        updatedAt: number;
    };
};

export type PostIssuesResponse = PostIssuesResponses[keyof PostIssuesResponses];

export type PostIssuesReorderData = {
    body: {
        workspaceId: string;
        orderedIds: Array<string>;
        patch?: {
            issueIds: Array<string>;
            fields: {
                priority?: 'none' | 'low' | 'medium' | 'high' | 'urgent';
                milestoneId?: string | null;
                statusId?: string | null;
                assigneeKind?: string | null;
                assigneeId?: string | null;
            };
        };
    };
    path?: never;
    query?: never;
    url: '/issues/reorder';
};

export type PostIssuesReorderResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        workspaceId: string;
        number: number;
        statusId: string | null;
        milestoneId: string | null;
        parentIssueId: string | null;
        title: string;
        description: string | null;
        priority: 'none' | 'low' | 'medium' | 'high' | 'urgent';
        labels: Array<string>;
        assigneeKind: string | null;
        assigneeId: string | null;
        dueDate: number | null;
        createdByKind: 'user' | 'agent' | 'provider-target' | 'system';
        createdById: string;
        sourceChatSessionId: string | null;
        delegateAgentId: string | null;
        delegateProviderTargetId: string | null;
        contextRefs: string;
        order: number;
        createdAt: number;
        updatedAt: number;
    }>;
};

export type PostIssuesReorderResponse = PostIssuesReorderResponses[keyof PostIssuesReorderResponses];

export type DeleteIssuesByIdData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/issues/{id}';
};

export type DeleteIssuesByIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type DeleteIssuesByIdResponse = DeleteIssuesByIdResponses[keyof DeleteIssuesByIdResponses];

export type GetIssuesByIdData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/issues/{id}';
};

export type GetIssuesByIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string;
        number: number;
        statusId: string | null;
        milestoneId: string | null;
        parentIssueId: string | null;
        title: string;
        description: string | null;
        priority: 'none' | 'low' | 'medium' | 'high' | 'urgent';
        labels: Array<string>;
        assigneeKind: string | null;
        assigneeId: string | null;
        dueDate: number | null;
        createdByKind: 'user' | 'agent' | 'provider-target' | 'system';
        createdById: string;
        sourceChatSessionId: string | null;
        delegateAgentId: string | null;
        delegateProviderTargetId: string | null;
        contextRefs: string;
        order: number;
        createdAt: number;
        updatedAt: number;
    };
};

export type GetIssuesByIdResponse = GetIssuesByIdResponses[keyof GetIssuesByIdResponses];

export type PatchIssuesByIdData = {
    body: {
        workspaceId?: string;
        title?: string;
        description?: string | null;
        priority?: 'none' | 'low' | 'medium' | 'high' | 'urgent';
        labels?: Array<string>;
        milestoneId?: string | null;
        parentIssueId?: string | null;
        statusId?: string | null;
        /**
         * Issue status name or slug, for example "In Progress" or "in_progress".
         */
        statusName?: string | null;
        assigneeKind?: string | null;
        assigneeId?: string | null;
        dueDate?: number | null;
        order?: number;
    };
    path: {
        id: string;
    };
    query?: never;
    url: '/issues/{id}';
};

export type PatchIssuesByIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string;
        number: number;
        statusId: string | null;
        milestoneId: string | null;
        parentIssueId: string | null;
        title: string;
        description: string | null;
        priority: 'none' | 'low' | 'medium' | 'high' | 'urgent';
        labels: Array<string>;
        assigneeKind: string | null;
        assigneeId: string | null;
        dueDate: number | null;
        createdByKind: 'user' | 'agent' | 'provider-target' | 'system';
        createdById: string;
        sourceChatSessionId: string | null;
        delegateAgentId: string | null;
        delegateProviderTargetId: string | null;
        contextRefs: string;
        order: number;
        createdAt: number;
        updatedAt: number;
    };
};

export type PatchIssuesByIdResponse = PatchIssuesByIdResponses[keyof PatchIssuesByIdResponses];

export type GetIssuesByIdSessionsData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/issues/{id}/sessions';
};

export type GetIssuesByIdSessionsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        execution: {
            kind: 'local';
        } | {
            kind: 'remote-host';
            hostId: string;
            remoteSessionId: string;
        };
        parentSessionId: string | null;
        sideContextSource: 'provider-native' | 'cradle-context' | null;
        workspaceId: string | null;
        title: string | null;
        origin: string;
        providerTargetId: string | null;
        agentId: string | null;
        modelId: string | null;
        thinkingEffort: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra' | null;
        linkedIssueId: string | null;
        sessionGroupId: string | null;
        runtimeKind: string;
        status: 'idle' | 'streaming' | 'error';
        pinned: number;
        archivedAt: number | null;
        lastReadAt: number | null;
        createdAt: number;
        updatedAt: number;
        latestUserMessageAt: number | null;
        latestAssistantMessageAt: number | null;
        unread: boolean;
        isIsolated: boolean;
        worktreeId: string | null;
        worktreeBranch: string | null;
        worktreePath: string | null;
        worktreeHealth: 'ok' | 'missing' | 'stale' | null;
        pendingWorktreeId: string | null;
        isolationBoundaryRequired: boolean;
    }>;
};

export type GetIssuesByIdSessionsResponse = GetIssuesByIdSessionsResponses[keyof GetIssuesByIdSessionsResponses];

export type GetIssuesByIdSessionGroupsData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/issues/{id}/session-groups';
};

export type GetIssuesByIdSessionGroupsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        workspaceId: string;
        title: string;
        description: string | null;
        linkedIssueId: string | null;
        status: 'active' | 'archived';
        configJson: string;
        archivedAt: number | null;
        createdAt: number;
        updatedAt: number;
        sessionCount: number;
        statusAggregate: 'idle' | 'streaming' | 'error';
        latestActivityAt: number | null;
    }>;
};

export type GetIssuesByIdSessionGroupsResponse = GetIssuesByIdSessionGroupsResponses[keyof GetIssuesByIdSessionGroupsResponses];

export type GetIssuesByIdIsolationContextData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/issues/{id}/isolation-context';
};

export type GetIssuesByIdIsolationContextResponses = {
    /**
     * Response for status 200
     */
    200: {
        groups: Array<{
            worktreeId: string;
            name: string;
            branch: string;
            sessionIds: Array<string>;
            sessionTitles: Array<string>;
        }>;
    };
};

export type GetIssuesByIdIsolationContextResponse = GetIssuesByIdIsolationContextResponses[keyof GetIssuesByIdIsolationContextResponses];

export type PatchIssuesBulkData = {
    body: {
        issueIds: Array<string>;
        update: {
            statusId?: string | null;
            priority?: 'none' | 'low' | 'medium' | 'high' | 'urgent';
            labels?: Array<string>;
            milestoneId?: string | null;
            assigneeKind?: string | null;
            assigneeId?: string | null;
            dueDate?: number | null;
        };
    };
    path?: never;
    query?: never;
    url: '/issues/bulk';
};

export type PatchIssuesBulkResponses = {
    /**
     * Response for status 200
     */
    200: {
        updated: number;
    };
};

export type PatchIssuesBulkResponse = PatchIssuesBulkResponses[keyof PatchIssuesBulkResponses];

export type PatchIssuesByIdStatusByStatusNameData = {
    body?: never;
    path: {
        id: string;
        /**
         * Issue status name or slug, for example "In Progress" or "in_progress".
         */
        statusName: string;
    };
    query?: never;
    url: '/issues/{id}/status/{statusName}';
};

export type PatchIssuesByIdStatusByStatusNameResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string;
        number: number;
        statusId: string | null;
        milestoneId: string | null;
        parentIssueId: string | null;
        title: string;
        description: string | null;
        priority: 'none' | 'low' | 'medium' | 'high' | 'urgent';
        labels: Array<string>;
        assigneeKind: string | null;
        assigneeId: string | null;
        dueDate: number | null;
        createdByKind: 'user' | 'agent' | 'provider-target' | 'system';
        createdById: string;
        sourceChatSessionId: string | null;
        delegateAgentId: string | null;
        delegateProviderTargetId: string | null;
        contextRefs: string;
        order: number;
        createdAt: number;
        updatedAt: number;
    };
};

export type PatchIssuesByIdStatusByStatusNameResponse = PatchIssuesByIdStatusByStatusNameResponses[keyof PatchIssuesByIdStatusByStatusNameResponses];

export type GetIssuesByIdActivityData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/issues/{id}/activity';
};

export type GetIssuesByIdActivityResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        issueId: string;
        kind: 'comment' | 'created' | 'field-change';
        actor: {
            kind: 'user' | 'agent' | 'provider-target' | 'system';
            id: string | null;
            displayName: string;
            avatarUrl: string | null;
            label: string | null;
        };
        comment: {
            content: string;
            systemKind: 'delegated' | 'system' | 'undelegated' | null;
        } | null;
        fieldChange: {
            action: 'added-description' | 'changed-field' | 'cleared-description' | 'renamed-issue' | 'updated-description';
            field: 'assignee' | 'description' | 'due-date' | 'labels' | 'metadata' | 'milestone' | 'parent' | 'priority' | 'status' | 'title' | 'workspace' | null;
            fromValue: {
                kind: 'date';
                timestamp: number;
            } | {
                kind: 'text';
                text: string;
            } | {
                kind: 'token';
                token: 'changed' | 'current-user' | 'empty' | 'no-due-date' | 'no-labels' | 'no-milestone' | 'no-parent' | 'no-status' | 'priority-high' | 'priority-low' | 'priority-medium' | 'priority-none' | 'priority-urgent' | 'unassigned' | 'unknown-issue' | 'unknown-milestone' | 'unknown-status' | 'unknown-user';
            } | null;
            toValue: {
                kind: 'date';
                timestamp: number;
            } | {
                kind: 'text';
                text: string;
            } | {
                kind: 'token';
                token: 'changed' | 'current-user' | 'empty' | 'no-due-date' | 'no-labels' | 'no-milestone' | 'no-parent' | 'no-status' | 'priority-high' | 'priority-low' | 'priority-medium' | 'priority-none' | 'priority-urgent' | 'unassigned' | 'unknown-issue' | 'unknown-milestone' | 'unknown-status' | 'unknown-user';
            } | null;
        } | null;
        sourceChatSessionId: string | null;
        createdAt: number;
    }>;
};

export type GetIssuesByIdActivityResponse = GetIssuesByIdActivityResponses[keyof GetIssuesByIdActivityResponses];

export type GetIssuesByIdFieldChangesData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/issues/{id}/field-changes';
};

export type GetIssuesByIdFieldChangesResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        issueId: string;
        field: string;
        fromValue: string | null;
        toValue: string | null;
        actorKind: 'user' | 'agent' | 'provider-target' | 'system';
        actorId: string | null;
        sourceChatSessionId: string | null;
        createdAt: number;
    }>;
};

export type GetIssuesByIdFieldChangesResponse = GetIssuesByIdFieldChangesResponses[keyof GetIssuesByIdFieldChangesResponses];

export type GetIssuesByIdCommentsData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/issues/{id}/comments';
};

export type GetIssuesByIdCommentsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        issueId: string;
        content: string;
        authorKind: 'user' | 'agent' | 'provider-target' | 'system' | 'system.delegated' | 'system.undelegated';
        authorId: string | null;
        author: {
            kind: 'user' | 'agent' | 'provider-target' | 'system';
            id: string | null;
            displayName: string;
            avatarUrl: string | null;
            label: string | null;
        };
        sourceChatSessionId: string | null;
        agentActivityId: string | null;
        createdAt: number;
    }>;
};

export type GetIssuesByIdCommentsResponse = GetIssuesByIdCommentsResponses[keyof GetIssuesByIdCommentsResponses];

export type PostIssuesByIdCommentsData = {
    body: {
        content: string;
    };
    path: {
        id: string;
    };
    query?: never;
    url: '/issues/{id}/comments';
};

export type PostIssuesByIdCommentsResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        issueId: string;
        content: string;
        authorKind: 'user' | 'agent' | 'provider-target' | 'system' | 'system.delegated' | 'system.undelegated';
        authorId: string | null;
        author: {
            kind: 'user' | 'agent' | 'provider-target' | 'system';
            id: string | null;
            displayName: string;
            avatarUrl: string | null;
            label: string | null;
        };
        sourceChatSessionId: string | null;
        agentActivityId: string | null;
        createdAt: number;
    };
};

export type PostIssuesByIdCommentsResponse = PostIssuesByIdCommentsResponses[keyof PostIssuesByIdCommentsResponses];

export type DeleteIssuesCommentsByIdData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/issues/comments/{id}';
};

export type DeleteIssuesCommentsByIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type DeleteIssuesCommentsByIdResponse = DeleteIssuesCommentsByIdResponses[keyof DeleteIssuesCommentsByIdResponses];

export type GetIssuesByIdRelationsData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/issues/{id}/relations';
};

export type GetIssuesByIdRelationsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        sourceIssueId: string;
        targetIssueId: string;
        type: 'blocks' | 'duplicates' | 'relates_to';
        createdAt: number;
        direction: 'outgoing' | 'incoming';
        counterpart: {
            id: string;
            workspaceId: string;
            number: number;
            title: string;
            statusId: string | null;
            priority: 'none' | 'low' | 'medium' | 'high' | 'urgent';
        } | null;
    }>;
};

export type GetIssuesByIdRelationsResponse = GetIssuesByIdRelationsResponses[keyof GetIssuesByIdRelationsResponses];

export type PostIssuesRelationsData = {
    body: {
        sourceIssueId: string;
        targetIssueId: string;
        type: 'blocks' | 'duplicates' | 'relates_to';
    };
    path?: never;
    query?: never;
    url: '/issues/relations';
};

export type PostIssuesRelationsResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        sourceIssueId: string;
        targetIssueId: string;
        type: 'blocks' | 'duplicates' | 'relates_to';
        createdAt: number;
    };
};

export type PostIssuesRelationsResponse = PostIssuesRelationsResponses[keyof PostIssuesRelationsResponses];

export type DeleteIssuesRelationsByIdData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/issues/relations/{id}';
};

export type DeleteIssuesRelationsByIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type DeleteIssuesRelationsByIdResponse = DeleteIssuesRelationsByIdResponses[keyof DeleteIssuesRelationsByIdResponses];

export type PostIssuesByIdContextRefsData = {
    body: {
        ref: string;
    };
    path: {
        id: string;
    };
    query?: never;
    url: '/issues/{id}/context-refs';
};

export type PostIssuesByIdContextRefsResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string;
        number: number;
        statusId: string | null;
        milestoneId: string | null;
        parentIssueId: string | null;
        title: string;
        description: string | null;
        priority: 'none' | 'low' | 'medium' | 'high' | 'urgent';
        labels: Array<string>;
        assigneeKind: string | null;
        assigneeId: string | null;
        dueDate: number | null;
        createdByKind: 'user' | 'agent' | 'provider-target' | 'system';
        createdById: string;
        sourceChatSessionId: string | null;
        delegateAgentId: string | null;
        delegateProviderTargetId: string | null;
        contextRefs: string;
        order: number;
        createdAt: number;
        updatedAt: number;
    };
};

export type PostIssuesByIdContextRefsResponse = PostIssuesByIdContextRefsResponses[keyof PostIssuesByIdContextRefsResponses];

export type DeleteIssuesByIdContextRefsByIndexData = {
    body?: never;
    path: {
        id: string;
        index: string;
    };
    query?: never;
    url: '/issues/{id}/context-refs/{index}';
};

export type DeleteIssuesByIdContextRefsByIndexResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string;
        number: number;
        statusId: string | null;
        milestoneId: string | null;
        parentIssueId: string | null;
        title: string;
        description: string | null;
        priority: 'none' | 'low' | 'medium' | 'high' | 'urgent';
        labels: Array<string>;
        assigneeKind: string | null;
        assigneeId: string | null;
        dueDate: number | null;
        createdByKind: 'user' | 'agent' | 'provider-target' | 'system';
        createdById: string;
        sourceChatSessionId: string | null;
        delegateAgentId: string | null;
        delegateProviderTargetId: string | null;
        contextRefs: string;
        order: number;
        createdAt: number;
        updatedAt: number;
    };
};

export type DeleteIssuesByIdContextRefsByIndexResponse = DeleteIssuesByIdContextRefsByIndexResponses[keyof DeleteIssuesByIdContextRefsByIndexResponses];

export type PostImageOcrRecognizeData = {
    body: {
        files: Array<{
            type: 'file';
            mediaType: string;
            filename?: string;
            url: string;
            providerMetadata?: unknown;
            [key: string]: unknown;
        }>;
    };
    path?: never;
    query?: never;
    url: '/image-ocr/recognize';
};

export type PostImageOcrRecognizeResponses = {
    /**
     * Response for status 200
     */
    200: {
        items: Array<{
            index: number;
            text: string;
            lineCount: number;
            modelBundleId: string;
        }>;
    };
};

export type PostImageOcrRecognizeResponse = PostImageOcrRecognizeResponses[keyof PostImageOcrRecognizeResponses];

export type GetKanbanBoardsData = {
    body?: never;
    path?: never;
    query?: {
        workspaceId?: string;
    };
    url: '/kanban/boards';
};

export type GetKanbanBoardsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        workspaceId: string;
        name: string;
        filterConfig: string | null;
        createdAt: number;
        updatedAt: number;
    }>;
};

export type GetKanbanBoardsResponse = GetKanbanBoardsResponses[keyof GetKanbanBoardsResponses];

export type PostKanbanBoardsData = {
    body: {
        workspaceId: string;
        name: string;
        filterConfig?: string | null;
    };
    path?: never;
    query?: never;
    url: '/kanban/boards';
};

export type PostKanbanBoardsResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string;
        name: string;
        filterConfig: string | null;
        createdAt: number;
        updatedAt: number;
    };
};

export type PostKanbanBoardsResponse = PostKanbanBoardsResponses[keyof PostKanbanBoardsResponses];

export type DeleteKanbanBoardsByIdData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/kanban/boards/{id}';
};

export type DeleteKanbanBoardsByIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type DeleteKanbanBoardsByIdResponse = DeleteKanbanBoardsByIdResponses[keyof DeleteKanbanBoardsByIdResponses];

export type PatchKanbanBoardsByIdData = {
    body: {
        name?: string;
        filterConfig?: string | null;
    };
    path: {
        id: string;
    };
    query?: never;
    url: '/kanban/boards/{id}';
};

export type PatchKanbanBoardsByIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string;
        name: string;
        filterConfig: string | null;
        createdAt: number;
        updatedAt: number;
    };
};

export type PatchKanbanBoardsByIdResponse = PatchKanbanBoardsByIdResponses[keyof PatchKanbanBoardsByIdResponses];

export type GetLinkPreviewData = {
    body?: never;
    path?: never;
    query: {
        /**
         * Absolute http(s) URL to unfurl into a link card
         */
        url: string;
    };
    url: '/link-preview/';
};

export type GetLinkPreviewResponses = {
    /**
     * Response for status 200
     */
    200: {
        url: string;
        title: string | null;
        description: string | null;
        image: string | null;
        siteName: string | null;
        favicon: string | null;
    };
};

export type GetLinkPreviewResponse = GetLinkPreviewResponses[keyof GetLinkPreviewResponses];

export type GetSearchThreadsData = {
    body?: never;
    path?: never;
    query: {
        query: string;
        workspaceId?: string;
        origin?: string;
        limit?: string | number;
        snippetsPerHit?: string | number;
    };
    url: '/search/threads';
};

export type GetSearchThreadsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        sessionId: string;
        workspaceId: string | null;
        workspaceName: string | null;
        sessionTitle: string | null;
        origin: string;
        titleRanges: Array<{
            start: number;
            end: number;
        }>;
        snippets: Array<{
            text: string;
            ranges: Array<{
                start: number;
                end: number;
            }>;
            messageRole: 'user' | 'assistant';
            messageId: string;
            createdAt: number;
        }>;
        matchCount: number;
        score: number;
        updatedAt: number;
    }>;
};

export type GetSearchThreadsResponse = GetSearchThreadsResponses[keyof GetSearchThreadsResponses];

export type GetSearchChronicleData = {
    body?: never;
    path?: never;
    query: {
        query: string;
        workspaceId?: string;
        limit?: string | number;
    };
    url: '/search/chronicle';
};

export type GetSearchChronicleResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        type: 'memory' | 'knowledge';
        id: string;
        workspaceId: string | null;
        workspaceName: string | null;
        title: string;
        titleRanges: Array<{
            start: number;
            end: number;
        }>;
        snippet: {
            text: string;
            ranges: Array<{
                start: number;
                end: number;
            }>;
        };
        matchCount: number;
        score: number;
        updatedAt: number;
        memoryType?: '10min' | '6h';
        memorySource?: 'llm' | 'local' | 'imported';
        cardType?: 'fact' | 'insight' | 'decision' | 'task' | 'pattern';
        dimension?: 'technical' | 'business' | 'personal' | 'project' | 'general';
        status?: 'active' | 'merged' | 'archived' | 'deleted';
    }>;
};

export type GetSearchChronicleResponse = GetSearchChronicleResponses[keyof GetSearchChronicleResponses];

export type PostRecallQueryData = {
    body: {
        chatSessionId: string;
        code: string;
    };
    path?: never;
    query?: never;
    url: '/recall/query';
};

export type PostRecallQueryResponses = {
    /**
     * Response for status 200
     */
    200: {
        kind: string;
        result?: unknown;
        error?: string;
    };
};

export type PostRecallQueryResponse = PostRecallQueryResponses[keyof PostRecallQueryResponses];

export type PostRecallAttuneData = {
    body: {
        chatSessionId: string;
        code: string;
    };
    path?: never;
    query?: never;
    url: '/recall/attune';
};

export type PostRecallAttuneByIdResolveData = {
    body: {
        chatSessionId: string;
        approved: boolean;
    };
    path: {
        id: string;
    };
    query?: never;
    url: '/recall/attune/{id}/resolve';
};

export type GetPluginsMarketplaceData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/plugins/marketplace';
};

export type GetPluginsMarketplaceResponses = {
    /**
     * Response for status 200
     */
    200: {
        plugins: Array<{
            id: string;
            displayName: string;
            description: string;
            icon: string | null;
            category: 'automation' | 'mcp' | 'integration' | 'skill' | 'dev';
            tags: Array<string>;
            author: {
                name: string;
                url: string | null;
            };
            homepage: string | null;
            bundled: boolean;
            source: {
                kind: 'git' | 'npm';
                location: string;
                ref: string | null;
                subPath: string | null;
            } | null;
            featured: boolean;
            version: string | null;
        }>;
        stale: boolean;
        fetchedAt: number | null;
    };
};

export type GetPluginsMarketplaceResponse = GetPluginsMarketplaceResponses[keyof GetPluginsMarketplaceResponses];

export type PostPluginsMarketplaceRefreshData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/plugins/marketplace/refresh';
};

export type PostPluginsMarketplaceRefreshResponses = {
    /**
     * Response for status 200
     */
    200: {
        plugins: Array<{
            id: string;
            displayName: string;
            description: string;
            icon: string | null;
            category: 'automation' | 'mcp' | 'integration' | 'skill' | 'dev';
            tags: Array<string>;
            author: {
                name: string;
                url: string | null;
            };
            homepage: string | null;
            bundled: boolean;
            source: {
                kind: 'git' | 'npm';
                location: string;
                ref: string | null;
                subPath: string | null;
            } | null;
            featured: boolean;
            version: string | null;
        }>;
        stale: boolean;
        fetchedAt: number | null;
    };
};

export type PostPluginsMarketplaceRefreshResponse = PostPluginsMarketplaceRefreshResponses[keyof PostPluginsMarketplaceRefreshResponses];

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

export type GetPluginsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        identity: string;
        routeSegment: string;
        name: string;
        version: string;
        displayName: string;
        description: string | null;
        iconUrl: string | null;
        source: {
            kind: 'workspaceDev' | 'bundledResource' | 'externalLocal';
            packageDir: string;
            trusted: boolean;
            reason: string | null;
            checksum: string | null;
        };
        activation: {
            enabled: boolean;
            source: 'default' | 'user';
            reason: string | null;
            updatedAt: number | null;
        };
        layers: {
            server: {
                layer: 'server' | 'web' | 'desktop';
                status: 'discovered' | 'invalid' | 'skipped' | 'disabled' | 'activating' | 'active' | 'failed' | 'partial';
                entry: string | null;
                error: string | null;
                activatedAt: string | null;
            };
            web: {
                layer: 'server' | 'web' | 'desktop';
                status: 'discovered' | 'invalid' | 'skipped' | 'disabled' | 'activating' | 'active' | 'failed' | 'partial';
                entry: string | null;
                error: string | null;
                activatedAt: string | null;
            };
            desktop: {
                layer: 'server' | 'web' | 'desktop';
                status: 'discovered' | 'invalid' | 'skipped' | 'disabled' | 'activating' | 'active' | 'failed' | 'partial';
                entry: string | null;
                error: string | null;
                activatedAt: string | null;
            };
        };
        declaredCapabilities: Array<{
            id: string;
            owner: string;
            localId: string;
            type: string;
            layer: 'server' | 'web' | 'desktop' | null;
            label: string | null;
            description: string | null;
            permissions: Array<string>;
            metadata: {
                [key: string]: unknown;
            };
        }>;
        declaredPermissions: Array<{
            id: string;
            owner: string;
            localId: string;
            label: string | null;
            description: string | null;
            required: boolean;
        }>;
        capabilities: Array<{
            id: string;
            owner: string;
            type: string;
            layer: 'server' | 'web' | 'desktop';
            status: 'registered' | 'failed' | 'unsupported';
            label: string | null;
            metadata: {
                [key: string]: unknown;
            };
        }>;
        warnings: Array<string>;
        active: boolean;
        hasWeb: boolean;
        hasServer: boolean;
        hasDesktop: boolean;
        serverEntry: string | null;
        webEntry: string | null;
        desktopEntry: string | null;
    }>;
};

export type GetPluginsResponse = GetPluginsResponses[keyof GetPluginsResponses];

export type GetPluginsMentionsData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/plugins/mentions';
};

export type GetPluginsMentionsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        pluginName: string;
        displayName: string;
        description: string | null;
        iconUrl: string | null;
        routeSegment: string;
        capabilities: Array<{
            id: string;
            type: string;
            layer: 'server' | 'web' | 'desktop';
            label: string | null;
        }>;
        mcpServers: Array<string>;
        active: boolean;
    }>;
};

export type GetPluginsMentionsResponse = GetPluginsMentionsResponses[keyof GetPluginsMentionsResponses];

export type GetPluginsSourcesData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/plugins/sources';
};

export type GetPluginsSourcesResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        kind: 'localPath' | 'git' | 'npm';
        location: string;
        ref: string | null;
        subPath: string | null;
        label: string | null;
        addedReason: string;
        createdAt: number;
        updatedAt: number;
        resolvedDirectory: string | null;
        error: string | null;
        plugins: Array<{
            identity: string;
            routeSegment: string;
            name: string;
            version: string;
            displayName: string;
            description: string | null;
            iconUrl: string | null;
            source: {
                kind: 'workspaceDev' | 'bundledResource' | 'externalLocal';
                packageDir: string;
                trusted: boolean;
                reason: string | null;
                checksum: string | null;
            };
            activation: {
                enabled: boolean;
                source: 'default' | 'user';
                reason: string | null;
                updatedAt: number | null;
            };
            layers: {
                server: {
                    layer: 'server' | 'web' | 'desktop';
                    status: 'discovered' | 'invalid' | 'skipped' | 'disabled' | 'activating' | 'active' | 'failed' | 'partial';
                    entry: string | null;
                    error: string | null;
                    activatedAt: string | null;
                };
                web: {
                    layer: 'server' | 'web' | 'desktop';
                    status: 'discovered' | 'invalid' | 'skipped' | 'disabled' | 'activating' | 'active' | 'failed' | 'partial';
                    entry: string | null;
                    error: string | null;
                    activatedAt: string | null;
                };
                desktop: {
                    layer: 'server' | 'web' | 'desktop';
                    status: 'discovered' | 'invalid' | 'skipped' | 'disabled' | 'activating' | 'active' | 'failed' | 'partial';
                    entry: string | null;
                    error: string | null;
                    activatedAt: string | null;
                };
            };
            declaredCapabilities: Array<{
                id: string;
                owner: string;
                localId: string;
                type: string;
                layer: 'server' | 'web' | 'desktop' | null;
                label: string | null;
                description: string | null;
                permissions: Array<string>;
                metadata: {
                    [key: string]: unknown;
                };
            }>;
            declaredPermissions: Array<{
                id: string;
                owner: string;
                localId: string;
                label: string | null;
                description: string | null;
                required: boolean;
            }>;
            capabilities: Array<{
                id: string;
                owner: string;
                type: string;
                layer: 'server' | 'web' | 'desktop';
                status: 'registered' | 'failed' | 'unsupported';
                label: string | null;
                metadata: {
                    [key: string]: unknown;
                };
            }>;
            warnings: Array<string>;
            active: boolean;
            hasWeb: boolean;
            hasServer: boolean;
            hasDesktop: boolean;
            serverEntry: string | null;
            webEntry: string | null;
            desktopEntry: string | null;
        }>;
    }>;
};

export type GetPluginsSourcesResponse = GetPluginsSourcesResponses[keyof GetPluginsSourcesResponses];

export type PostPluginsSourcesData = {
    body: {
        kind: 'localPath' | 'git' | 'npm';
        location: string;
        ref?: string | null;
        subPath?: string | null;
        label?: string | null;
        addedReason?: string | null;
    };
    path?: never;
    query?: never;
    url: '/plugins/sources';
};

export type PostPluginsSourcesResponses = {
    /**
     * Response for status 200
     */
    200: {
        source: {
            id: string;
            kind: 'localPath' | 'git' | 'npm';
            location: string;
            ref: string | null;
            subPath: string | null;
            label: string | null;
            addedReason: string;
            createdAt: number;
            updatedAt: number;
            resolvedDirectory: string | null;
            error: string | null;
            plugins: Array<{
                identity: string;
                routeSegment: string;
                name: string;
                version: string;
                displayName: string;
                description: string | null;
                iconUrl: string | null;
                source: {
                    kind: 'workspaceDev' | 'bundledResource' | 'externalLocal';
                    packageDir: string;
                    trusted: boolean;
                    reason: string | null;
                    checksum: string | null;
                };
                activation: {
                    enabled: boolean;
                    source: 'default' | 'user';
                    reason: string | null;
                    updatedAt: number | null;
                };
                layers: {
                    server: {
                        layer: 'server' | 'web' | 'desktop';
                        status: 'discovered' | 'invalid' | 'skipped' | 'disabled' | 'activating' | 'active' | 'failed' | 'partial';
                        entry: string | null;
                        error: string | null;
                        activatedAt: string | null;
                    };
                    web: {
                        layer: 'server' | 'web' | 'desktop';
                        status: 'discovered' | 'invalid' | 'skipped' | 'disabled' | 'activating' | 'active' | 'failed' | 'partial';
                        entry: string | null;
                        error: string | null;
                        activatedAt: string | null;
                    };
                    desktop: {
                        layer: 'server' | 'web' | 'desktop';
                        status: 'discovered' | 'invalid' | 'skipped' | 'disabled' | 'activating' | 'active' | 'failed' | 'partial';
                        entry: string | null;
                        error: string | null;
                        activatedAt: string | null;
                    };
                };
                declaredCapabilities: Array<{
                    id: string;
                    owner: string;
                    localId: string;
                    type: string;
                    layer: 'server' | 'web' | 'desktop' | null;
                    label: string | null;
                    description: string | null;
                    permissions: Array<string>;
                    metadata: {
                        [key: string]: unknown;
                    };
                }>;
                declaredPermissions: Array<{
                    id: string;
                    owner: string;
                    localId: string;
                    label: string | null;
                    description: string | null;
                    required: boolean;
                }>;
                capabilities: Array<{
                    id: string;
                    owner: string;
                    type: string;
                    layer: 'server' | 'web' | 'desktop';
                    status: 'registered' | 'failed' | 'unsupported';
                    label: string | null;
                    metadata: {
                        [key: string]: unknown;
                    };
                }>;
                warnings: Array<string>;
                active: boolean;
                hasWeb: boolean;
                hasServer: boolean;
                hasDesktop: boolean;
                serverEntry: string | null;
                webEntry: string | null;
                desktopEntry: string | null;
            }>;
        };
        discoveredPlugins: Array<{
            identity: string;
            routeSegment: string;
            name: string;
            version: string;
            displayName: string;
            description: string | null;
            iconUrl: string | null;
            source: {
                kind: 'workspaceDev' | 'bundledResource' | 'externalLocal';
                packageDir: string;
                trusted: boolean;
                reason: string | null;
                checksum: string | null;
            };
            activation: {
                enabled: boolean;
                source: 'default' | 'user';
                reason: string | null;
                updatedAt: number | null;
            };
            layers: {
                server: {
                    layer: 'server' | 'web' | 'desktop';
                    status: 'discovered' | 'invalid' | 'skipped' | 'disabled' | 'activating' | 'active' | 'failed' | 'partial';
                    entry: string | null;
                    error: string | null;
                    activatedAt: string | null;
                };
                web: {
                    layer: 'server' | 'web' | 'desktop';
                    status: 'discovered' | 'invalid' | 'skipped' | 'disabled' | 'activating' | 'active' | 'failed' | 'partial';
                    entry: string | null;
                    error: string | null;
                    activatedAt: string | null;
                };
                desktop: {
                    layer: 'server' | 'web' | 'desktop';
                    status: 'discovered' | 'invalid' | 'skipped' | 'disabled' | 'activating' | 'active' | 'failed' | 'partial';
                    entry: string | null;
                    error: string | null;
                    activatedAt: string | null;
                };
            };
            declaredCapabilities: Array<{
                id: string;
                owner: string;
                localId: string;
                type: string;
                layer: 'server' | 'web' | 'desktop' | null;
                label: string | null;
                description: string | null;
                permissions: Array<string>;
                metadata: {
                    [key: string]: unknown;
                };
            }>;
            declaredPermissions: Array<{
                id: string;
                owner: string;
                localId: string;
                label: string | null;
                description: string | null;
                required: boolean;
            }>;
            capabilities: Array<{
                id: string;
                owner: string;
                type: string;
                layer: 'server' | 'web' | 'desktop';
                status: 'registered' | 'failed' | 'unsupported';
                label: string | null;
                metadata: {
                    [key: string]: unknown;
                };
            }>;
            warnings: Array<string>;
            active: boolean;
            hasWeb: boolean;
            hasServer: boolean;
            hasDesktop: boolean;
            serverEntry: string | null;
            webEntry: string | null;
            desktopEntry: string | null;
        }>;
    };
};

export type PostPluginsSourcesResponse = PostPluginsSourcesResponses[keyof PostPluginsSourcesResponses];

export type GetPluginsDevSessionsData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/plugins/dev-sessions';
};

export type GetPluginsDevSessionsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        pluginName: string;
        routeSegment: string;
        displayName: string;
        packageDir: string;
        entries: {
            server: string | null;
            web: string | null;
            desktop: string | null;
        };
        revisions: {
            server: string | number;
            web: string | number;
            desktop: string | number;
        };
        createdAt: number;
        updatedAt: number;
    }>;
};

export type GetPluginsDevSessionsResponse = GetPluginsDevSessionsResponses[keyof GetPluginsDevSessionsResponses];

export type PostPluginsDevSessionsData = {
    body: {
        packageDir: string;
        entries: {
            server?: string;
            web?: string;
            desktop?: string;
        };
    };
    path?: never;
    query?: never;
    url: '/plugins/dev-sessions';
};

export type PostPluginsDevSessionsResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        pluginName: string;
        routeSegment: string;
        displayName: string;
        packageDir: string;
        entries: {
            server: string | null;
            web: string | null;
            desktop: string | null;
        };
        revisions: {
            server: string | number;
            web: string | number;
            desktop: string | number;
        };
        createdAt: number;
        updatedAt: number;
    };
};

export type PostPluginsDevSessionsResponse = PostPluginsDevSessionsResponses[keyof PostPluginsDevSessionsResponses];

export type PostPluginsDevSessionsByIdReloadData = {
    body: {
        layer: 'server' | 'web' | 'desktop';
    };
    path: {
        id: string;
    };
    query?: never;
    url: '/plugins/dev-sessions/{id}/reload';
};

export type PostPluginsDevSessionsByIdReloadResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        pluginName: string;
        routeSegment: string;
        displayName: string;
        packageDir: string;
        entries: {
            server: string | null;
            web: string | null;
            desktop: string | null;
        };
        revisions: {
            server: string | number;
            web: string | number;
            desktop: string | number;
        };
        createdAt: number;
        updatedAt: number;
    };
};

export type PostPluginsDevSessionsByIdReloadResponse = PostPluginsDevSessionsByIdReloadResponses[keyof PostPluginsDevSessionsByIdReloadResponses];

export type PostPluginsDevSessionsByIdHeartbeatData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/plugins/dev-sessions/{id}/heartbeat';
};

export type PostPluginsDevSessionsByIdHeartbeatResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        pluginName: string;
        routeSegment: string;
        displayName: string;
        packageDir: string;
        entries: {
            server: string | null;
            web: string | null;
            desktop: string | null;
        };
        revisions: {
            server: string | number;
            web: string | number;
            desktop: string | number;
        };
        createdAt: number;
        updatedAt: number;
    };
};

export type PostPluginsDevSessionsByIdHeartbeatResponse = PostPluginsDevSessionsByIdHeartbeatResponses[keyof PostPluginsDevSessionsByIdHeartbeatResponses];

export type DeletePluginsDevSessionsByIdData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/plugins/dev-sessions/{id}';
};

export type DeletePluginsDevSessionsByIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        removed: boolean;
    };
};

export type DeletePluginsDevSessionsByIdResponse = DeletePluginsDevSessionsByIdResponses[keyof DeletePluginsDevSessionsByIdResponses];

export type GetPluginsDevSessionsEventsData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/plugins/dev-sessions/events';
};

export type PostPluginsSourcesPreviewData = {
    body: {
        kind: 'git' | 'npm';
        location: string;
        ref?: string | null;
        subPath?: string | null;
    };
    path?: never;
    query?: never;
    url: '/plugins/sources/preview';
};

export type PostPluginsSourcesPreviewResponses = {
    /**
     * Response for status 200
     */
    200: {
        source: {
            kind: 'git' | 'npm';
            location: string;
            ref: string | null;
            subPath: string | null;
        };
        plugins: Array<{
            name: string;
            version: string;
            displayName: string;
            description: string | null;
            iconAvailable: boolean;
            trusted: boolean;
            trustReason: string | null;
            declaredPermissions: Array<{
                id: string;
                owner: string;
                localId: string;
                label: string | null;
                description: string | null;
                required: boolean;
            }>;
            warnings: Array<string>;
            hasWeb: boolean;
            hasServer: boolean;
            hasDesktop: boolean;
        }>;
        warnings: Array<string>;
    };
};

export type PostPluginsSourcesPreviewResponse = PostPluginsSourcesPreviewResponses[keyof PostPluginsSourcesPreviewResponses];

export type DeletePluginsSourcesByIdData = {
    body: {
        confirmationToken: string;
    };
    path: {
        id: string;
    };
    query?: never;
    url: '/plugins/sources/{id}';
};

export type DeletePluginsSourcesByIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        removed: boolean;
    };
};

export type DeletePluginsSourcesByIdResponse = DeletePluginsSourcesByIdResponses[keyof DeletePluginsSourcesByIdResponses];

export type GetPluginsSourcesByIdData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/plugins/sources/{id}';
};

export type GetPluginsSourcesByIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        kind: 'localPath' | 'git' | 'npm';
        location: string;
        ref: string | null;
        subPath: string | null;
        label: string | null;
        addedReason: string;
        createdAt: number;
        updatedAt: number;
        resolvedDirectory: string | null;
        error: string | null;
        plugins: Array<{
            identity: string;
            routeSegment: string;
            name: string;
            version: string;
            displayName: string;
            description: string | null;
            iconUrl: string | null;
            source: {
                kind: 'workspaceDev' | 'bundledResource' | 'externalLocal';
                packageDir: string;
                trusted: boolean;
                reason: string | null;
                checksum: string | null;
            };
            activation: {
                enabled: boolean;
                source: 'default' | 'user';
                reason: string | null;
                updatedAt: number | null;
            };
            layers: {
                server: {
                    layer: 'server' | 'web' | 'desktop';
                    status: 'discovered' | 'invalid' | 'skipped' | 'disabled' | 'activating' | 'active' | 'failed' | 'partial';
                    entry: string | null;
                    error: string | null;
                    activatedAt: string | null;
                };
                web: {
                    layer: 'server' | 'web' | 'desktop';
                    status: 'discovered' | 'invalid' | 'skipped' | 'disabled' | 'activating' | 'active' | 'failed' | 'partial';
                    entry: string | null;
                    error: string | null;
                    activatedAt: string | null;
                };
                desktop: {
                    layer: 'server' | 'web' | 'desktop';
                    status: 'discovered' | 'invalid' | 'skipped' | 'disabled' | 'activating' | 'active' | 'failed' | 'partial';
                    entry: string | null;
                    error: string | null;
                    activatedAt: string | null;
                };
            };
            declaredCapabilities: Array<{
                id: string;
                owner: string;
                localId: string;
                type: string;
                layer: 'server' | 'web' | 'desktop' | null;
                label: string | null;
                description: string | null;
                permissions: Array<string>;
                metadata: {
                    [key: string]: unknown;
                };
            }>;
            declaredPermissions: Array<{
                id: string;
                owner: string;
                localId: string;
                label: string | null;
                description: string | null;
                required: boolean;
            }>;
            capabilities: Array<{
                id: string;
                owner: string;
                type: string;
                layer: 'server' | 'web' | 'desktop';
                status: 'registered' | 'failed' | 'unsupported';
                label: string | null;
                metadata: {
                    [key: string]: unknown;
                };
            }>;
            warnings: Array<string>;
            active: boolean;
            hasWeb: boolean;
            hasServer: boolean;
            hasDesktop: boolean;
            serverEntry: string | null;
            webEntry: string | null;
            desktopEntry: string | null;
        }>;
    };
};

export type GetPluginsSourcesByIdResponse = GetPluginsSourcesByIdResponses[keyof GetPluginsSourcesByIdResponses];

export type PostPluginsSourcesByIdRefreshData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/plugins/sources/{id}/refresh';
};

export type PostPluginsSourcesByIdRefreshResponses = {
    /**
     * Response for status 200
     */
    200: {
        source: {
            id: string;
            kind: 'localPath' | 'git' | 'npm';
            location: string;
            ref: string | null;
            subPath: string | null;
            label: string | null;
            addedReason: string;
            createdAt: number;
            updatedAt: number;
            resolvedDirectory: string | null;
            error: string | null;
            plugins: Array<{
                identity: string;
                routeSegment: string;
                name: string;
                version: string;
                displayName: string;
                description: string | null;
                iconUrl: string | null;
                source: {
                    kind: 'workspaceDev' | 'bundledResource' | 'externalLocal';
                    packageDir: string;
                    trusted: boolean;
                    reason: string | null;
                    checksum: string | null;
                };
                activation: {
                    enabled: boolean;
                    source: 'default' | 'user';
                    reason: string | null;
                    updatedAt: number | null;
                };
                layers: {
                    server: {
                        layer: 'server' | 'web' | 'desktop';
                        status: 'discovered' | 'invalid' | 'skipped' | 'disabled' | 'activating' | 'active' | 'failed' | 'partial';
                        entry: string | null;
                        error: string | null;
                        activatedAt: string | null;
                    };
                    web: {
                        layer: 'server' | 'web' | 'desktop';
                        status: 'discovered' | 'invalid' | 'skipped' | 'disabled' | 'activating' | 'active' | 'failed' | 'partial';
                        entry: string | null;
                        error: string | null;
                        activatedAt: string | null;
                    };
                    desktop: {
                        layer: 'server' | 'web' | 'desktop';
                        status: 'discovered' | 'invalid' | 'skipped' | 'disabled' | 'activating' | 'active' | 'failed' | 'partial';
                        entry: string | null;
                        error: string | null;
                        activatedAt: string | null;
                    };
                };
                declaredCapabilities: Array<{
                    id: string;
                    owner: string;
                    localId: string;
                    type: string;
                    layer: 'server' | 'web' | 'desktop' | null;
                    label: string | null;
                    description: string | null;
                    permissions: Array<string>;
                    metadata: {
                        [key: string]: unknown;
                    };
                }>;
                declaredPermissions: Array<{
                    id: string;
                    owner: string;
                    localId: string;
                    label: string | null;
                    description: string | null;
                    required: boolean;
                }>;
                capabilities: Array<{
                    id: string;
                    owner: string;
                    type: string;
                    layer: 'server' | 'web' | 'desktop';
                    status: 'registered' | 'failed' | 'unsupported';
                    label: string | null;
                    metadata: {
                        [key: string]: unknown;
                    };
                }>;
                warnings: Array<string>;
                active: boolean;
                hasWeb: boolean;
                hasServer: boolean;
                hasDesktop: boolean;
                serverEntry: string | null;
                webEntry: string | null;
                desktopEntry: string | null;
            }>;
        };
        discoveredPlugins: Array<{
            identity: string;
            routeSegment: string;
            name: string;
            version: string;
            displayName: string;
            description: string | null;
            iconUrl: string | null;
            source: {
                kind: 'workspaceDev' | 'bundledResource' | 'externalLocal';
                packageDir: string;
                trusted: boolean;
                reason: string | null;
                checksum: string | null;
            };
            activation: {
                enabled: boolean;
                source: 'default' | 'user';
                reason: string | null;
                updatedAt: number | null;
            };
            layers: {
                server: {
                    layer: 'server' | 'web' | 'desktop';
                    status: 'discovered' | 'invalid' | 'skipped' | 'disabled' | 'activating' | 'active' | 'failed' | 'partial';
                    entry: string | null;
                    error: string | null;
                    activatedAt: string | null;
                };
                web: {
                    layer: 'server' | 'web' | 'desktop';
                    status: 'discovered' | 'invalid' | 'skipped' | 'disabled' | 'activating' | 'active' | 'failed' | 'partial';
                    entry: string | null;
                    error: string | null;
                    activatedAt: string | null;
                };
                desktop: {
                    layer: 'server' | 'web' | 'desktop';
                    status: 'discovered' | 'invalid' | 'skipped' | 'disabled' | 'activating' | 'active' | 'failed' | 'partial';
                    entry: string | null;
                    error: string | null;
                    activatedAt: string | null;
                };
            };
            declaredCapabilities: Array<{
                id: string;
                owner: string;
                localId: string;
                type: string;
                layer: 'server' | 'web' | 'desktop' | null;
                label: string | null;
                description: string | null;
                permissions: Array<string>;
                metadata: {
                    [key: string]: unknown;
                };
            }>;
            declaredPermissions: Array<{
                id: string;
                owner: string;
                localId: string;
                label: string | null;
                description: string | null;
                required: boolean;
            }>;
            capabilities: Array<{
                id: string;
                owner: string;
                type: string;
                layer: 'server' | 'web' | 'desktop';
                status: 'registered' | 'failed' | 'unsupported';
                label: string | null;
                metadata: {
                    [key: string]: unknown;
                };
            }>;
            warnings: Array<string>;
            active: boolean;
            hasWeb: boolean;
            hasServer: boolean;
            hasDesktop: boolean;
            serverEntry: string | null;
            webEntry: string | null;
            desktopEntry: string | null;
        }>;
    };
};

export type PostPluginsSourcesByIdRefreshResponse = PostPluginsSourcesByIdRefreshResponses[keyof PostPluginsSourcesByIdRefreshResponses];

export type GetPluginsSourcesByIdUninstallPlanData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/plugins/sources/{id}/uninstall-plan';
};

export type GetPluginsSourcesByIdUninstallPlanResponses = {
    /**
     * Response for status 200
     */
    200: {
        sourceId: string;
        plugins: Array<{
            identity: string;
            displayName: string;
            processes: Array<{
                id: string;
                displayName: string;
                pid: number | null;
                state: 'starting' | 'running' | 'stopping';
                startedAt: string;
            }>;
            resources: Array<{
                key: {
                    namespace: string;
                    resourceType: string;
                    resourceId: string;
                };
                displayName: string;
                description: string | null;
                kind: string;
                required: boolean;
                state: 'not-installed' | 'installing' | 'installed' | 'update-available' | 'error' | 'unavailable';
                installationSource: 'built-in' | 'managed' | 'external' | null;
                installedVersion: string | null;
                availableVersion: string | null;
                installedSizeBytes: number | null;
                downloadSizeBytes: number | null;
                actions: {
                    install: {
                        available: boolean;
                        reasonCode: string | null;
                    };
                    update: {
                        available: boolean;
                        reasonCode: string | null;
                    };
                    uninstall: {
                        available: boolean;
                        reasonCode: string | null;
                    };
                };
            }>;
            lifecycle: {
                summary: string;
                data: Array<{
                    id: string;
                    label: string;
                    effect: 'remove' | 'preserve';
                    description?: string;
                }>;
                warnings?: Array<string>;
            } | null;
            blockedReasons: Array<string>;
        }>;
        blocked: boolean;
        confirmationToken: string;
        expiresAt: string;
    };
};

export type GetPluginsSourcesByIdUninstallPlanResponse = GetPluginsSourcesByIdUninstallPlanResponses[keyof GetPluginsSourcesByIdUninstallPlanResponses];

export type GetPluginsByRouteSegmentIconData = {
    body?: never;
    path: {
        routeSegment: string;
    };
    query?: never;
    url: '/plugins/{routeSegment}/icon';
};

export type GetPluginsByRouteSegmentData = {
    body?: never;
    path: {
        routeSegment: string;
    };
    query?: never;
    url: '/plugins/{routeSegment}';
};

export type GetPluginsByRouteSegmentResponses = {
    /**
     * Response for status 200
     */
    200: {
        identity: string;
        routeSegment: string;
        name: string;
        version: string;
        displayName: string;
        description: string | null;
        iconUrl: string | null;
        source: {
            kind: 'workspaceDev' | 'bundledResource' | 'externalLocal';
            packageDir: string;
            trusted: boolean;
            reason: string | null;
            checksum: string | null;
        };
        activation: {
            enabled: boolean;
            source: 'default' | 'user';
            reason: string | null;
            updatedAt: number | null;
        };
        layers: {
            server: {
                layer: 'server' | 'web' | 'desktop';
                status: 'discovered' | 'invalid' | 'skipped' | 'disabled' | 'activating' | 'active' | 'failed' | 'partial';
                entry: string | null;
                error: string | null;
                activatedAt: string | null;
            };
            web: {
                layer: 'server' | 'web' | 'desktop';
                status: 'discovered' | 'invalid' | 'skipped' | 'disabled' | 'activating' | 'active' | 'failed' | 'partial';
                entry: string | null;
                error: string | null;
                activatedAt: string | null;
            };
            desktop: {
                layer: 'server' | 'web' | 'desktop';
                status: 'discovered' | 'invalid' | 'skipped' | 'disabled' | 'activating' | 'active' | 'failed' | 'partial';
                entry: string | null;
                error: string | null;
                activatedAt: string | null;
            };
        };
        declaredCapabilities: Array<{
            id: string;
            owner: string;
            localId: string;
            type: string;
            layer: 'server' | 'web' | 'desktop' | null;
            label: string | null;
            description: string | null;
            permissions: Array<string>;
            metadata: {
                [key: string]: unknown;
            };
        }>;
        declaredPermissions: Array<{
            id: string;
            owner: string;
            localId: string;
            label: string | null;
            description: string | null;
            required: boolean;
        }>;
        capabilities: Array<{
            id: string;
            owner: string;
            type: string;
            layer: 'server' | 'web' | 'desktop';
            status: 'registered' | 'failed' | 'unsupported';
            label: string | null;
            metadata: {
                [key: string]: unknown;
            };
        }>;
        warnings: Array<string>;
        active: boolean;
        hasWeb: boolean;
        hasServer: boolean;
        hasDesktop: boolean;
        serverEntry: string | null;
        webEntry: string | null;
        desktopEntry: string | null;
    };
};

export type GetPluginsByRouteSegmentResponse = GetPluginsByRouteSegmentResponses[keyof GetPluginsByRouteSegmentResponses];

export type PatchPluginsByRouteSegmentEnabledData = {
    body: {
        enabled: boolean;
        reason?: string | null;
    };
    path: {
        routeSegment: string;
    };
    query?: never;
    url: '/plugins/{routeSegment}/enabled';
};

export type PatchPluginsByRouteSegmentEnabledResponses = {
    /**
     * Response for status 200
     */
    200: {
        identity: string;
        routeSegment: string;
        name: string;
        version: string;
        displayName: string;
        description: string | null;
        iconUrl: string | null;
        source: {
            kind: 'workspaceDev' | 'bundledResource' | 'externalLocal';
            packageDir: string;
            trusted: boolean;
            reason: string | null;
            checksum: string | null;
        };
        activation: {
            enabled: boolean;
            source: 'default' | 'user';
            reason: string | null;
            updatedAt: number | null;
        };
        layers: {
            server: {
                layer: 'server' | 'web' | 'desktop';
                status: 'discovered' | 'invalid' | 'skipped' | 'disabled' | 'activating' | 'active' | 'failed' | 'partial';
                entry: string | null;
                error: string | null;
                activatedAt: string | null;
            };
            web: {
                layer: 'server' | 'web' | 'desktop';
                status: 'discovered' | 'invalid' | 'skipped' | 'disabled' | 'activating' | 'active' | 'failed' | 'partial';
                entry: string | null;
                error: string | null;
                activatedAt: string | null;
            };
            desktop: {
                layer: 'server' | 'web' | 'desktop';
                status: 'discovered' | 'invalid' | 'skipped' | 'disabled' | 'activating' | 'active' | 'failed' | 'partial';
                entry: string | null;
                error: string | null;
                activatedAt: string | null;
            };
        };
        declaredCapabilities: Array<{
            id: string;
            owner: string;
            localId: string;
            type: string;
            layer: 'server' | 'web' | 'desktop' | null;
            label: string | null;
            description: string | null;
            permissions: Array<string>;
            metadata: {
                [key: string]: unknown;
            };
        }>;
        declaredPermissions: Array<{
            id: string;
            owner: string;
            localId: string;
            label: string | null;
            description: string | null;
            required: boolean;
        }>;
        capabilities: Array<{
            id: string;
            owner: string;
            type: string;
            layer: 'server' | 'web' | 'desktop';
            status: 'registered' | 'failed' | 'unsupported';
            label: string | null;
            metadata: {
                [key: string]: unknown;
            };
        }>;
        warnings: Array<string>;
        active: boolean;
        hasWeb: boolean;
        hasServer: boolean;
        hasDesktop: boolean;
        serverEntry: string | null;
        webEntry: string | null;
        desktopEntry: string | null;
    };
};

export type PatchPluginsByRouteSegmentEnabledResponse = PatchPluginsByRouteSegmentEnabledResponses[keyof PatchPluginsByRouteSegmentEnabledResponses];

export type GetSkillsData = {
    body?: never;
    path?: never;
    query?: {
        workspaceId?: string;
        agentId?: string;
    };
    url: '/skills';
};

export type GetSkillsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        name: string;
        description: string | null;
        location: string;
        scope: 'builtin' | 'legacy' | 'global' | 'repository' | 'workspace' | 'agent';
        rootDir: string;
        skillDir: string;
        active: boolean;
        shadowedBy: 'builtin' | 'legacy' | 'global' | 'repository' | 'workspace' | 'agent' | null;
    }>;
};

export type GetSkillsResponse = GetSkillsResponses[keyof GetSkillsResponses];

export type PostSkillsData = {
    body: {
        scope: 'builtin' | 'legacy' | 'global' | 'repository' | 'workspace' | 'agent';
        name: string;
        description: string;
        body: string;
        workspaceId?: string | null;
        agentId?: string | null;
        frontmatter?: {
            [key: string]: unknown;
        };
    };
    path?: never;
    query?: never;
    url: '/skills';
};

export type PostSkillsResponses = {
    /**
     * Response for status 200
     */
    200: {
        name: string;
        description: string | null;
        location: string;
        scope: 'builtin' | 'legacy' | 'global' | 'repository' | 'workspace' | 'agent';
        rootDir: string;
        skillDir: string;
        body: string;
        frontmatter: {
            [key: string]: unknown;
        };
    };
};

export type PostSkillsResponse = PostSkillsResponses[keyof PostSkillsResponses];

export type DeleteSkillsDocumentData = {
    body?: never;
    path?: never;
    query: {
        scope: 'builtin' | 'legacy' | 'global' | 'repository' | 'workspace' | 'agent';
        name: string;
        workspaceId?: string;
        agentId?: string;
    };
    url: '/skills/document';
};

export type DeleteSkillsDocumentResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type DeleteSkillsDocumentResponse = DeleteSkillsDocumentResponses[keyof DeleteSkillsDocumentResponses];

export type GetSkillsDocumentData = {
    body?: never;
    path?: never;
    query: {
        scope: 'builtin' | 'legacy' | 'global' | 'repository' | 'workspace' | 'agent';
        name: string;
        workspaceId?: string;
        agentId?: string;
    };
    url: '/skills/document';
};

export type GetSkillsDocumentResponses = {
    /**
     * Response for status 200
     */
    200: {
        name: string;
        description: string | null;
        location: string;
        scope: 'builtin' | 'legacy' | 'global' | 'repository' | 'workspace' | 'agent';
        rootDir: string;
        skillDir: string;
        body: string;
        frontmatter: {
            [key: string]: unknown;
        };
    };
};

export type GetSkillsDocumentResponse = GetSkillsDocumentResponses[keyof GetSkillsDocumentResponses];

export type PutSkillsDocumentData = {
    body: {
        scope: 'builtin' | 'legacy' | 'global' | 'repository' | 'workspace' | 'agent';
        name: string;
        workspaceId?: string | null;
        agentId?: string | null;
        document: {
            name: string;
            description: string;
            body: string;
            frontmatter?: {
                [key: string]: unknown;
            };
        };
    };
    path?: never;
    query?: never;
    url: '/skills/document';
};

export type PutSkillsDocumentResponses = {
    /**
     * Response for status 200
     */
    200: {
        name: string;
        description: string | null;
        location: string;
        scope: 'builtin' | 'legacy' | 'global' | 'repository' | 'workspace' | 'agent';
        rootDir: string;
        skillDir: string;
        body: string;
        frontmatter: {
            [key: string]: unknown;
        };
    };
};

export type PutSkillsDocumentResponse = PutSkillsDocumentResponses[keyof PutSkillsDocumentResponses];

export type PostSkillsImportData = {
    body: {
        scope: 'builtin' | 'legacy' | 'global' | 'repository' | 'workspace' | 'agent';
        sourceDir: string;
        overwrite?: boolean;
        workspaceId?: string | null;
        agentId?: string | null;
    };
    path?: never;
    query?: never;
    url: '/skills/import';
};

export type PostSkillsImportResponses = {
    /**
     * Response for status 200
     */
    200: {
        name: string;
        description: string | null;
        location: string;
        scope: 'builtin' | 'legacy' | 'global' | 'repository' | 'workspace' | 'agent';
        rootDir: string;
        skillDir: string;
        body: string;
        frontmatter: {
            [key: string]: unknown;
        };
    };
};

export type PostSkillsImportResponse = PostSkillsImportResponses[keyof PostSkillsImportResponses];

export type PostSkillsExportData = {
    body: {
        scope: 'builtin' | 'legacy' | 'global' | 'repository' | 'workspace' | 'agent';
        name: string;
        destinationDir: string;
        confirmedNonCradleOwnedWrite: boolean;
        overwrite?: boolean;
        workspaceId?: string | null;
        agentId?: string | null;
    };
    path?: never;
    query?: never;
    url: '/skills/export';
};

export type PostSkillsExportResponses = {
    /**
     * Response for status 200
     */
    200: {
        destinationDir: string;
        ownerBoundary: {
            classification: 'non-cradle-owned';
            owner: 'user-selected-export-directory';
            consentRequired: boolean;
            consentConfirmed: boolean;
            destinationDir: string;
            targetPath: string;
        };
    };
};

export type PostSkillsExportResponse = PostSkillsExportResponses[keyof PostSkillsExportResponses];

export type PostSkillsFetchSourceData = {
    body: {
        source: string;
    };
    path?: never;
    query?: never;
    url: '/skills/fetch-source';
};

export type PostSkillsFetchSourceResponses = {
    /**
     * Response for status 200
     */
    200: {
        sessionId: string;
        source: {
            type: 'github' | 'gitlab' | 'git' | 'local';
            url: string;
            ref?: string;
            subpath?: string;
            label: string;
        };
        skills: Array<{
            skillDir: string;
            relativePath: string;
            name: string;
            description: string | null;
        }>;
    };
};

export type PostSkillsFetchSourceResponse = PostSkillsFetchSourceResponses[keyof PostSkillsFetchSourceResponses];

export type PostSkillsImportFromFetchData = {
    body: {
        sessionId: string;
        selectedDirs: Array<string>;
        scope: 'builtin' | 'legacy' | 'global' | 'repository' | 'workspace' | 'agent';
        overwrite?: boolean;
        workspaceId?: string | null;
        agentId?: string | null;
    };
    path?: never;
    query?: never;
    url: '/skills/import-from-fetch';
};

export type PostSkillsImportFromFetchResponses = {
    /**
     * Response for status 200
     */
    200: {
        imported: Array<{
            name: string;
            description: string | null;
            location: string;
            scope: 'builtin' | 'legacy' | 'global' | 'repository' | 'workspace' | 'agent';
            rootDir: string;
            skillDir: string;
            body: string;
            frontmatter: {
                [key: string]: unknown;
            };
        }>;
        errors: Array<{
            dir: string;
            error: string;
        }>;
    };
};

export type PostSkillsImportFromFetchResponse = PostSkillsImportFromFetchResponses[keyof PostSkillsImportFromFetchResponses];

export type PostSkillsCancelFetchData = {
    body: {
        sessionId: string;
    };
    path?: never;
    query?: never;
    url: '/skills/cancel-fetch';
};

export type PostSkillsCancelFetchResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type PostSkillsCancelFetchResponse = PostSkillsCancelFetchResponses[keyof PostSkillsCancelFetchResponses];

export type GetWorkflowRulesByWorkspaceIdListData = {
    body?: never;
    path: {
        workspaceId: string;
    };
    query?: never;
    url: '/workflow-rules/{workspaceId}/list';
};

export type GetWorkflowRulesByWorkspaceIdListResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        type: 'global' | 'agent';
        agentId: string | null;
        content: string;
    }>;
};

export type GetWorkflowRulesByWorkspaceIdListResponse = GetWorkflowRulesByWorkspaceIdListResponses[keyof GetWorkflowRulesByWorkspaceIdListResponses];

export type DeleteWorkflowRulesByWorkspaceIdData = {
    body?: never;
    path: {
        workspaceId: string;
    };
    query?: {
        agentId?: string;
    };
    url: '/workflow-rules/{workspaceId}';
};

export type DeleteWorkflowRulesByWorkspaceIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type DeleteWorkflowRulesByWorkspaceIdResponse = DeleteWorkflowRulesByWorkspaceIdResponses[keyof DeleteWorkflowRulesByWorkspaceIdResponses];

export type GetWorkflowRulesByWorkspaceIdData = {
    body?: never;
    path: {
        workspaceId: string;
    };
    query?: {
        agentId?: string;
    };
    url: '/workflow-rules/{workspaceId}';
};

export type GetWorkflowRulesByWorkspaceIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        global: string | null;
        agentSpecific: string | null;
    };
};

export type GetWorkflowRulesByWorkspaceIdResponse = GetWorkflowRulesByWorkspaceIdResponses[keyof GetWorkflowRulesByWorkspaceIdResponses];

export type PutWorkflowRulesByWorkspaceIdData = {
    body: {
        agentId?: string | null;
        content: string;
    };
    path: {
        workspaceId: string;
    };
    query?: never;
    url: '/workflow-rules/{workspaceId}';
};

export type PutWorkflowRulesByWorkspaceIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type PutWorkflowRulesByWorkspaceIdResponse = PutWorkflowRulesByWorkspaceIdResponses[keyof PutWorkflowRulesByWorkspaceIdResponses];

export type GetWorkspacesByWorkspaceIdGitRepositoriesData = {
    body?: never;
    path: {
        workspaceId: string;
    };
    query?: {
        repo?: string;
        sessionId?: string;
    };
    url: '/workspaces/{workspaceId}/git/repositories';
};

export type GetWorkspacesByWorkspaceIdGitRepositoriesResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        path: string;
        name: string;
        absolutePath: string;
        branch: string;
        tracking: string | null;
        ahead: number;
        behind: number;
        isDetached: boolean;
        files: Array<{
            path: string;
            workspacePath: string;
            status: 'added' | 'modified' | 'deleted' | 'renamed' | 'untracked';
        }>;
    }>;
};

export type GetWorkspacesByWorkspaceIdGitRepositoriesResponse = GetWorkspacesByWorkspaceIdGitRepositoriesResponses[keyof GetWorkspacesByWorkspaceIdGitRepositoriesResponses];

export type GetWorkspacesByWorkspaceIdGitStatusData = {
    body?: never;
    path: {
        workspaceId: string;
    };
    query?: {
        repo?: string;
        sessionId?: string;
    };
    url: '/workspaces/{workspaceId}/git/status';
};

export type GetWorkspacesByWorkspaceIdGitStatusResponses = {
    /**
     * Response for status 200
     */
    200: {
        repositoryPath: string;
        repositoryName: string;
        branch: string;
        tracking: string | null;
        ahead: number;
        behind: number;
        isDetached: boolean;
        files: Array<{
            path: string;
            workspacePath: string;
            status: 'added' | 'modified' | 'deleted' | 'renamed' | 'untracked';
        }>;
    };
};

export type GetWorkspacesByWorkspaceIdGitStatusResponse = GetWorkspacesByWorkspaceIdGitStatusResponses[keyof GetWorkspacesByWorkspaceIdGitStatusResponses];

export type GetWorkspacesByWorkspaceIdGitBranchesData = {
    body?: never;
    path: {
        workspaceId: string;
    };
    query?: {
        repo?: string;
        sessionId?: string;
    };
    url: '/workspaces/{workspaceId}/git/branches';
};

export type GetWorkspacesByWorkspaceIdGitBranchesResponses = {
    /**
     * Response for status 200
     */
    200: {
        local: Array<{
            name: string;
            isCurrent: boolean;
            tracking?: string;
        }>;
        remote: Array<{
            name: string;
        }>;
    };
};

export type GetWorkspacesByWorkspaceIdGitBranchesResponse = GetWorkspacesByWorkspaceIdGitBranchesResponses[keyof GetWorkspacesByWorkspaceIdGitBranchesResponses];

export type PostWorkspacesByWorkspaceIdGitBranchesData = {
    body: {
        repo?: string;
        name: string;
        from?: string;
    };
    path: {
        workspaceId: string;
    };
    query?: never;
    url: '/workspaces/{workspaceId}/git/branches';
};

export type PostWorkspacesByWorkspaceIdGitBranchesResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type PostWorkspacesByWorkspaceIdGitBranchesResponse = PostWorkspacesByWorkspaceIdGitBranchesResponses[keyof PostWorkspacesByWorkspaceIdGitBranchesResponses];

export type GetWorkspacesByWorkspaceIdGitRemotesData = {
    body?: never;
    path: {
        workspaceId: string;
    };
    query?: {
        repo?: string;
        sessionId?: string;
    };
    url: '/workspaces/{workspaceId}/git/remotes';
};

export type GetWorkspacesByWorkspaceIdGitRemotesResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        name: string;
        fetchUrl: string | null;
        pushUrl: string | null;
    }>;
};

export type GetWorkspacesByWorkspaceIdGitRemotesResponse = GetWorkspacesByWorkspaceIdGitRemotesResponses[keyof GetWorkspacesByWorkspaceIdGitRemotesResponses];

export type GetWorkspacesByWorkspaceIdGitGraphData = {
    body?: never;
    path: {
        workspaceId: string;
    };
    query?: {
        repo?: string;
        limit?: string | number;
    };
    url: '/workspaces/{workspaceId}/git/graph';
};

export type GetWorkspacesByWorkspaceIdGitGraphResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        sha: string;
        shortSha: string;
        parents: Array<string>;
        refs: Array<string>;
        subject: string;
        authorName: string;
        authorEmail: string;
        gravatarHash: string;
        date: string;
        timestamp: number;
    }>;
};

export type GetWorkspacesByWorkspaceIdGitGraphResponse = GetWorkspacesByWorkspaceIdGitGraphResponses[keyof GetWorkspacesByWorkspaceIdGitGraphResponses];

export type PostWorkspacesByWorkspaceIdGitCheckoutData = {
    body: {
        repo?: string;
        branch: string;
    };
    path: {
        workspaceId: string;
    };
    query?: never;
    url: '/workspaces/{workspaceId}/git/checkout';
};

export type PostWorkspacesByWorkspaceIdGitCheckoutResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type PostWorkspacesByWorkspaceIdGitCheckoutResponse = PostWorkspacesByWorkspaceIdGitCheckoutResponses[keyof PostWorkspacesByWorkspaceIdGitCheckoutResponses];

export type PostWorkspacesByWorkspaceIdGitFetchData = {
    body: {
        repo?: string;
    };
    path: {
        workspaceId: string;
    };
    query?: never;
    url: '/workspaces/{workspaceId}/git/fetch';
};

export type PostWorkspacesByWorkspaceIdGitFetchResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type PostWorkspacesByWorkspaceIdGitFetchResponse = PostWorkspacesByWorkspaceIdGitFetchResponses[keyof PostWorkspacesByWorkspaceIdGitFetchResponses];

export type GetWorkspacesByWorkspaceIdGitDiffData = {
    body?: never;
    path: {
        workspaceId: string;
    };
    query?: {
        repo?: string;
        paths?: string;
        sessionId?: string;
    };
    url: '/workspaces/{workspaceId}/git/diff';
};

export type GetWorkspacesByWorkspaceIdGitDiffResponses = {
    /**
     * Response for status 200
     */
    200: string;
};

export type GetWorkspacesByWorkspaceIdGitDiffResponse = GetWorkspacesByWorkspaceIdGitDiffResponses[keyof GetWorkspacesByWorkspaceIdGitDiffResponses];

export type GetWorkspacesByWorkspaceIdGitMergeBaseData = {
    body?: never;
    path: {
        workspaceId: string;
    };
    query: {
        repo?: string;
        baseBranch: string;
    };
    url: '/workspaces/{workspaceId}/git/merge-base';
};

export type GetWorkspacesByWorkspaceIdGitMergeBaseResponses = {
    /**
     * Response for status 200
     */
    200: {
        mergeBaseSha: string | null;
    };
};

export type GetWorkspacesByWorkspaceIdGitMergeBaseResponse = GetWorkspacesByWorkspaceIdGitMergeBaseResponses[keyof GetWorkspacesByWorkspaceIdGitMergeBaseResponses];

export type GetWorkspacesByWorkspaceIdGitBranchCompareData = {
    body?: never;
    path: {
        workspaceId: string;
    };
    query: {
        repo?: string;
        baseRef: string;
        headRef: string;
    };
    url: '/workspaces/{workspaceId}/git/branch-compare';
};

export type GetWorkspacesByWorkspaceIdGitBranchCompareResponses = {
    /**
     * Response for status 200
     */
    200: {
        repositoryPath: string;
        repositoryName: string;
        baseRef: string;
        headRef: string;
        baseSha: string;
        headSha: string;
        mergeBaseSha: string | null;
        patch: string;
    };
};

export type GetWorkspacesByWorkspaceIdGitBranchCompareResponse = GetWorkspacesByWorkspaceIdGitBranchCompareResponses[keyof GetWorkspacesByWorkspaceIdGitBranchCompareResponses];

export type GetWorktreesManagedData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/worktrees/managed';
};

export type GetWorktreesManagedResponses = {
    /**
     * Response for status 200
     */
    200: {
        worktrees: Array<{
            id: string;
            sourceWorkspaceId: string;
            workspaceName: string;
            name: string;
            path: string;
            branch: string;
            baseRef: string;
            status: 'active' | 'merged' | 'abandoned';
            createdBySessionId: string | null;
            createdAt: number;
            updatedAt: number;
            sizeBytes: number;
            sizeMeasuredAt: number | null;
            sizeMeasurementError: string | null;
            sessionCount: number;
        }>;
        totalSizeBytes: number;
    };
};

export type GetWorktreesManagedResponse = GetWorktreesManagedResponses[keyof GetWorktreesManagedResponses];

export type PostWorktreesCleanupData = {
    body: {
        maxWorktrees: number;
        maxTotalSizeGb: number;
    };
    path?: never;
    query?: never;
    url: '/worktrees/cleanup';
};

export type PostWorktreesCleanupResponses = {
    /**
     * Response for status 200
     */
    200: {
        cleaned: Array<{
            id: string;
            sourceWorkspaceId: string;
            workspaceName: string;
            name: string;
            path: string;
            branch: string;
            baseRef: string;
            status: 'active' | 'merged' | 'abandoned';
            createdBySessionId: string | null;
            createdAt: number;
            updatedAt: number;
            sizeBytes: number;
            sizeMeasuredAt: number | null;
            sizeMeasurementError: string | null;
            sessionCount: number;
        }>;
        skipped: number;
        totalSizeBytes: number;
    };
};

export type PostWorktreesCleanupResponse = PostWorktreesCleanupResponses[keyof PostWorktreesCleanupResponses];

export type GetWorkspacesByWorkspaceIdWorktreesData = {
    body?: never;
    path: {
        workspaceId: string;
    };
    query?: never;
    url: '/workspaces/{workspaceId}/worktrees';
};

export type GetWorkspacesByWorkspaceIdWorktreesResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        sourceWorkspaceId: string;
        name: string;
        path: string;
        branch: string;
        baseRef: string;
        status: 'active' | 'merged' | 'abandoned';
        createdBySessionId: string | null;
        createdAt: number;
        updatedAt: number;
    }>;
};

export type GetWorkspacesByWorkspaceIdWorktreesResponse = GetWorkspacesByWorkspaceIdWorktreesResponses[keyof GetWorkspacesByWorkspaceIdWorktreesResponses];

export type PostWorkspacesByWorkspaceIdWorktreesData = {
    body: {
        sessionId: string;
        slug?: string;
        bindSession?: boolean;
        confirmedSetupHooks?: boolean;
    };
    path: {
        workspaceId: string;
    };
    query?: never;
    url: '/workspaces/{workspaceId}/worktrees';
};

export type PostWorkspacesByWorkspaceIdWorktreesResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        sourceWorkspaceId: string;
        name: string;
        path: string;
        branch: string;
        baseRef: string;
        status: 'active' | 'merged' | 'abandoned';
        createdBySessionId: string | null;
        createdAt: number;
        updatedAt: number;
    };
};

export type PostWorkspacesByWorkspaceIdWorktreesResponse = PostWorkspacesByWorkspaceIdWorktreesResponses[keyof PostWorkspacesByWorkspaceIdWorktreesResponses];

export type PostWorkspacesByWorkspaceIdWorktreesByWorktreeIdCleanupData = {
    body: {
        mode: 'merge-and-close' | 'abandon';
        targetBranch?: string;
    };
    path: {
        workspaceId: string;
        worktreeId: string;
    };
    query?: never;
    url: '/workspaces/{workspaceId}/worktrees/{worktreeId}/cleanup';
};

export type PostWorkspacesByWorkspaceIdWorktreesByWorktreeIdCleanupResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type PostWorkspacesByWorkspaceIdWorktreesByWorktreeIdCleanupResponse = PostWorkspacesByWorkspaceIdWorktreesByWorktreeIdCleanupResponses[keyof PostWorkspacesByWorkspaceIdWorktreesByWorktreeIdCleanupResponses];

export type GetWorkspacesByWorkspaceIdDiffReviewsData = {
    body?: never;
    path: {
        workspaceId: string;
    };
    query?: never;
    url: '/workspaces/{workspaceId}/diff-reviews';
};

export type GetWorkspacesByWorkspaceIdDiffReviewsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        workspaceId: string;
        sourceId: string | null;
        repositoryPath: string;
        sourceKind: 'local-working-tree' | 'local-branch-compare' | 'local-commit' | 'agent-change-set' | 'github-pull-request' | 'external-import';
        githubPullRequest: {
            owner: string;
            repo: string;
            number: string | number;
            detail?: {
                url: string;
                title: string;
                body: string | null;
                isDraft: boolean;
                state: 'open' | 'closed';
                merged: boolean;
                mergeable: boolean | null;
                mergeableState: string;
                headRef: string;
                baseRef: string;
                headSha: string | null;
                author: {
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                } | null;
                reviewers: Array<{
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                }>;
                assignees: Array<{
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                }>;
                labels: Array<{
                    name: string;
                    color: string;
                }>;
                checksState: 'success' | 'failure' | 'pending' | 'neutral';
                checks: Array<{
                    id: string;
                    name: string;
                    status: 'queued' | 'in_progress' | 'completed';
                    conclusion: string | null;
                    url: string | null;
                }>;
                timeline: Array<{
                    id: string;
                    kind: 'comment' | 'review';
                    author: {
                        login: string;
                        avatarUrl: string | null;
                        url: string | null;
                    } | null;
                    body: string | null;
                    state: string | null;
                    createdAt: string;
                    url: string | null;
                }>;
            };
        } | null;
        title: string;
        status: 'open' | 'merged' | 'closed' | 'abandoned';
        reviewState: 'unreviewed' | 'in-review' | 'changes-requested' | 'approved' | 'commented';
        currentRevisionId: string | null;
        createdAt: number;
        updatedAt: number;
        currentRevision: {
            id: string;
            reviewId: string;
            sourceVersion: string;
            patchHash: string;
            fileCount: number;
            additions: number;
            deletions: number;
            generatedAt: number;
            patch: string;
        } | null;
        files: Array<{
            id: string;
            revisionId: string;
            path: string;
            previousPath: string | null;
            status: 'added' | 'modified' | 'deleted' | 'renamed' | 'untracked';
            additions: number;
            deletions: number;
            isGenerated: boolean;
            isBinary: boolean;
            isViewed: boolean;
        }>;
        threads: Array<{
            id: string;
            reviewId: string;
            originalRevisionId: string;
            currentRevisionId: string | null;
            fileId: string | null;
            anchor: {
                revisionId: string;
                fileId: string;
                path: string;
                side: 'base' | 'head';
                startLine: number;
                endLine: number;
                startColumn?: number;
                endColumn?: number;
                hunkHeader: string;
                lineHash: string;
                contextBeforeHash?: string;
                contextAfterHash?: string;
            } | null;
            state: 'open' | 'resolved' | 'stale';
            createdBy: string;
            createdAt: number;
            updatedAt: number;
            resolvedBy: string | null;
            resolvedAt: number | null;
            comments: Array<{
                id: string;
                threadId: string;
                authorKind: 'user' | 'agent' | 'external';
                authorId: string;
                bodyMarkdown: string;
                externalUrl: string | null;
                createdAt: number;
                updatedAt: number;
            }>;
        }>;
        submissions: Array<{
            id: string;
            reviewId: string;
            revisionId: string;
            actorId: string;
            decision: 'approve' | 'request-changes' | 'comment';
            bodyMarkdown: string | null;
            submittedAt: number;
            sourceSyncState: 'local-only' | 'pending' | 'synced' | 'failed';
        }>;
        events: Array<{
            id: string;
            reviewId: string;
            eventKind: string;
            actorKind: 'user' | 'agent' | 'external' | 'system';
            actorId: string | null;
            payload: unknown;
            createdAt: number;
        }>;
        preferences: {
            id: string;
            workspaceId: string;
            userId: string;
            diffStyle: 'split' | 'unified';
            codeTheme: string;
            fontSize: number;
            lineHeight: number;
            hideWhitespaceOnly: boolean;
            structuralHighlighting: boolean;
            collapseGeneratedFiles: boolean;
            notificationMode: 'all-activity' | 'all-activity-by-people' | 'reviews-and-comments' | 'reviews-and-comments-by-people' | 'none';
            createdAt: number;
            updatedAt: number;
        };
        agentFixes: Array<{
            id: string;
            reviewId: string;
            targetRevisionId: string | null;
            threadId: string | null;
            anchor: {
                revisionId: string;
                fileId: string;
                path: string;
                side: 'base' | 'head';
                startLine: number;
                endLine: number;
                startColumn?: number;
                endColumn?: number;
                hunkHeader: string;
                lineHash: string;
                contextBeforeHash?: string;
                contextAfterHash?: string;
            } | null;
            instruction: string;
            profileId: string | null;
            expectedOutput: 'working-tree-change' | 'patch-artifact';
            status: 'pending' | 'running' | 'completed' | 'failed' | 'cancelled';
            sessionId: string | null;
            runId: string | null;
            artifactId: string | null;
            resultRevisionId: string | null;
            errorMessage: string | null;
            createdAt: number;
            updatedAt: number;
        }>;
    }>;
};

export type GetWorkspacesByWorkspaceIdDiffReviewsResponse = GetWorkspacesByWorkspaceIdDiffReviewsResponses[keyof GetWorkspacesByWorkspaceIdDiffReviewsResponses];

export type GetWorkspacesByWorkspaceIdDiffReviewsSourceReadinessData = {
    body?: never;
    path: {
        workspaceId: string;
    };
    query?: never;
    url: '/workspaces/{workspaceId}/diff-reviews/source-readiness';
};

export type GetWorkspacesByWorkspaceIdDiffReviewsSourceReadinessResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        sourceKind: 'local-working-tree' | 'local-branch-compare' | 'local-commit' | 'agent-change-set' | 'github-pull-request' | 'external-import';
        workspaceId: string;
        state: 'ready' | 'workspace-integration-missing' | 'repository-code-access-missing' | 'personal-connection-missing' | 'permission-insufficient';
        actions: Array<{
            label: string;
            url?: string;
            ownerKind: 'workspace-admin' | 'github-org-owner' | 'current-user';
        }>;
    }>;
};

export type GetWorkspacesByWorkspaceIdDiffReviewsSourceReadinessResponse = GetWorkspacesByWorkspaceIdDiffReviewsSourceReadinessResponses[keyof GetWorkspacesByWorkspaceIdDiffReviewsSourceReadinessResponses];

export type PostWorkspacesByWorkspaceIdDiffReviewsLocalWorkingTreeData = {
    body: {
        repo?: string;
    };
    path: {
        workspaceId: string;
    };
    query?: never;
    url: '/workspaces/{workspaceId}/diff-reviews/local-working-tree';
};

export type PostWorkspacesByWorkspaceIdDiffReviewsLocalWorkingTreeResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string;
        sourceId: string | null;
        repositoryPath: string;
        sourceKind: 'local-working-tree' | 'local-branch-compare' | 'local-commit' | 'agent-change-set' | 'github-pull-request' | 'external-import';
        githubPullRequest: {
            owner: string;
            repo: string;
            number: string | number;
            detail?: {
                url: string;
                title: string;
                body: string | null;
                isDraft: boolean;
                state: 'open' | 'closed';
                merged: boolean;
                mergeable: boolean | null;
                mergeableState: string;
                headRef: string;
                baseRef: string;
                headSha: string | null;
                author: {
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                } | null;
                reviewers: Array<{
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                }>;
                assignees: Array<{
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                }>;
                labels: Array<{
                    name: string;
                    color: string;
                }>;
                checksState: 'success' | 'failure' | 'pending' | 'neutral';
                checks: Array<{
                    id: string;
                    name: string;
                    status: 'queued' | 'in_progress' | 'completed';
                    conclusion: string | null;
                    url: string | null;
                }>;
                timeline: Array<{
                    id: string;
                    kind: 'comment' | 'review';
                    author: {
                        login: string;
                        avatarUrl: string | null;
                        url: string | null;
                    } | null;
                    body: string | null;
                    state: string | null;
                    createdAt: string;
                    url: string | null;
                }>;
            };
        } | null;
        title: string;
        status: 'open' | 'merged' | 'closed' | 'abandoned';
        reviewState: 'unreviewed' | 'in-review' | 'changes-requested' | 'approved' | 'commented';
        currentRevisionId: string | null;
        createdAt: number;
        updatedAt: number;
        currentRevision: {
            id: string;
            reviewId: string;
            sourceVersion: string;
            patchHash: string;
            fileCount: number;
            additions: number;
            deletions: number;
            generatedAt: number;
            patch: string;
        } | null;
        files: Array<{
            id: string;
            revisionId: string;
            path: string;
            previousPath: string | null;
            status: 'added' | 'modified' | 'deleted' | 'renamed' | 'untracked';
            additions: number;
            deletions: number;
            isGenerated: boolean;
            isBinary: boolean;
            isViewed: boolean;
        }>;
        threads: Array<{
            id: string;
            reviewId: string;
            originalRevisionId: string;
            currentRevisionId: string | null;
            fileId: string | null;
            anchor: {
                revisionId: string;
                fileId: string;
                path: string;
                side: 'base' | 'head';
                startLine: number;
                endLine: number;
                startColumn?: number;
                endColumn?: number;
                hunkHeader: string;
                lineHash: string;
                contextBeforeHash?: string;
                contextAfterHash?: string;
            } | null;
            state: 'open' | 'resolved' | 'stale';
            createdBy: string;
            createdAt: number;
            updatedAt: number;
            resolvedBy: string | null;
            resolvedAt: number | null;
            comments: Array<{
                id: string;
                threadId: string;
                authorKind: 'user' | 'agent' | 'external';
                authorId: string;
                bodyMarkdown: string;
                externalUrl: string | null;
                createdAt: number;
                updatedAt: number;
            }>;
        }>;
        submissions: Array<{
            id: string;
            reviewId: string;
            revisionId: string;
            actorId: string;
            decision: 'approve' | 'request-changes' | 'comment';
            bodyMarkdown: string | null;
            submittedAt: number;
            sourceSyncState: 'local-only' | 'pending' | 'synced' | 'failed';
        }>;
        events: Array<{
            id: string;
            reviewId: string;
            eventKind: string;
            actorKind: 'user' | 'agent' | 'external' | 'system';
            actorId: string | null;
            payload: unknown;
            createdAt: number;
        }>;
        preferences: {
            id: string;
            workspaceId: string;
            userId: string;
            diffStyle: 'split' | 'unified';
            codeTheme: string;
            fontSize: number;
            lineHeight: number;
            hideWhitespaceOnly: boolean;
            structuralHighlighting: boolean;
            collapseGeneratedFiles: boolean;
            notificationMode: 'all-activity' | 'all-activity-by-people' | 'reviews-and-comments' | 'reviews-and-comments-by-people' | 'none';
            createdAt: number;
            updatedAt: number;
        };
        agentFixes: Array<{
            id: string;
            reviewId: string;
            targetRevisionId: string | null;
            threadId: string | null;
            anchor: {
                revisionId: string;
                fileId: string;
                path: string;
                side: 'base' | 'head';
                startLine: number;
                endLine: number;
                startColumn?: number;
                endColumn?: number;
                hunkHeader: string;
                lineHash: string;
                contextBeforeHash?: string;
                contextAfterHash?: string;
            } | null;
            instruction: string;
            profileId: string | null;
            expectedOutput: 'working-tree-change' | 'patch-artifact';
            status: 'pending' | 'running' | 'completed' | 'failed' | 'cancelled';
            sessionId: string | null;
            runId: string | null;
            artifactId: string | null;
            resultRevisionId: string | null;
            errorMessage: string | null;
            createdAt: number;
            updatedAt: number;
        }>;
    };
};

export type PostWorkspacesByWorkspaceIdDiffReviewsLocalWorkingTreeResponse = PostWorkspacesByWorkspaceIdDiffReviewsLocalWorkingTreeResponses[keyof PostWorkspacesByWorkspaceIdDiffReviewsLocalWorkingTreeResponses];

export type PostWorkspacesByWorkspaceIdDiffReviewsLocalBranchCompareData = {
    body: {
        repo?: string;
        baseRef: string;
        headRef: string;
    };
    path: {
        workspaceId: string;
    };
    query?: never;
    url: '/workspaces/{workspaceId}/diff-reviews/local-branch-compare';
};

export type PostWorkspacesByWorkspaceIdDiffReviewsLocalBranchCompareResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string;
        sourceId: string | null;
        repositoryPath: string;
        sourceKind: 'local-working-tree' | 'local-branch-compare' | 'local-commit' | 'agent-change-set' | 'github-pull-request' | 'external-import';
        githubPullRequest: {
            owner: string;
            repo: string;
            number: string | number;
            detail?: {
                url: string;
                title: string;
                body: string | null;
                isDraft: boolean;
                state: 'open' | 'closed';
                merged: boolean;
                mergeable: boolean | null;
                mergeableState: string;
                headRef: string;
                baseRef: string;
                headSha: string | null;
                author: {
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                } | null;
                reviewers: Array<{
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                }>;
                assignees: Array<{
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                }>;
                labels: Array<{
                    name: string;
                    color: string;
                }>;
                checksState: 'success' | 'failure' | 'pending' | 'neutral';
                checks: Array<{
                    id: string;
                    name: string;
                    status: 'queued' | 'in_progress' | 'completed';
                    conclusion: string | null;
                    url: string | null;
                }>;
                timeline: Array<{
                    id: string;
                    kind: 'comment' | 'review';
                    author: {
                        login: string;
                        avatarUrl: string | null;
                        url: string | null;
                    } | null;
                    body: string | null;
                    state: string | null;
                    createdAt: string;
                    url: string | null;
                }>;
            };
        } | null;
        title: string;
        status: 'open' | 'merged' | 'closed' | 'abandoned';
        reviewState: 'unreviewed' | 'in-review' | 'changes-requested' | 'approved' | 'commented';
        currentRevisionId: string | null;
        createdAt: number;
        updatedAt: number;
        currentRevision: {
            id: string;
            reviewId: string;
            sourceVersion: string;
            patchHash: string;
            fileCount: number;
            additions: number;
            deletions: number;
            generatedAt: number;
            patch: string;
        } | null;
        files: Array<{
            id: string;
            revisionId: string;
            path: string;
            previousPath: string | null;
            status: 'added' | 'modified' | 'deleted' | 'renamed' | 'untracked';
            additions: number;
            deletions: number;
            isGenerated: boolean;
            isBinary: boolean;
            isViewed: boolean;
        }>;
        threads: Array<{
            id: string;
            reviewId: string;
            originalRevisionId: string;
            currentRevisionId: string | null;
            fileId: string | null;
            anchor: {
                revisionId: string;
                fileId: string;
                path: string;
                side: 'base' | 'head';
                startLine: number;
                endLine: number;
                startColumn?: number;
                endColumn?: number;
                hunkHeader: string;
                lineHash: string;
                contextBeforeHash?: string;
                contextAfterHash?: string;
            } | null;
            state: 'open' | 'resolved' | 'stale';
            createdBy: string;
            createdAt: number;
            updatedAt: number;
            resolvedBy: string | null;
            resolvedAt: number | null;
            comments: Array<{
                id: string;
                threadId: string;
                authorKind: 'user' | 'agent' | 'external';
                authorId: string;
                bodyMarkdown: string;
                externalUrl: string | null;
                createdAt: number;
                updatedAt: number;
            }>;
        }>;
        submissions: Array<{
            id: string;
            reviewId: string;
            revisionId: string;
            actorId: string;
            decision: 'approve' | 'request-changes' | 'comment';
            bodyMarkdown: string | null;
            submittedAt: number;
            sourceSyncState: 'local-only' | 'pending' | 'synced' | 'failed';
        }>;
        events: Array<{
            id: string;
            reviewId: string;
            eventKind: string;
            actorKind: 'user' | 'agent' | 'external' | 'system';
            actorId: string | null;
            payload: unknown;
            createdAt: number;
        }>;
        preferences: {
            id: string;
            workspaceId: string;
            userId: string;
            diffStyle: 'split' | 'unified';
            codeTheme: string;
            fontSize: number;
            lineHeight: number;
            hideWhitespaceOnly: boolean;
            structuralHighlighting: boolean;
            collapseGeneratedFiles: boolean;
            notificationMode: 'all-activity' | 'all-activity-by-people' | 'reviews-and-comments' | 'reviews-and-comments-by-people' | 'none';
            createdAt: number;
            updatedAt: number;
        };
        agentFixes: Array<{
            id: string;
            reviewId: string;
            targetRevisionId: string | null;
            threadId: string | null;
            anchor: {
                revisionId: string;
                fileId: string;
                path: string;
                side: 'base' | 'head';
                startLine: number;
                endLine: number;
                startColumn?: number;
                endColumn?: number;
                hunkHeader: string;
                lineHash: string;
                contextBeforeHash?: string;
                contextAfterHash?: string;
            } | null;
            instruction: string;
            profileId: string | null;
            expectedOutput: 'working-tree-change' | 'patch-artifact';
            status: 'pending' | 'running' | 'completed' | 'failed' | 'cancelled';
            sessionId: string | null;
            runId: string | null;
            artifactId: string | null;
            resultRevisionId: string | null;
            errorMessage: string | null;
            createdAt: number;
            updatedAt: number;
        }>;
    };
};

export type PostWorkspacesByWorkspaceIdDiffReviewsLocalBranchCompareResponse = PostWorkspacesByWorkspaceIdDiffReviewsLocalBranchCompareResponses[keyof PostWorkspacesByWorkspaceIdDiffReviewsLocalBranchCompareResponses];

export type PostWorkspacesByWorkspaceIdDiffReviewsLocalCommitData = {
    body: {
        repo?: string;
        commitRef: string;
    };
    path: {
        workspaceId: string;
    };
    query?: never;
    url: '/workspaces/{workspaceId}/diff-reviews/local-commit';
};

export type PostWorkspacesByWorkspaceIdDiffReviewsLocalCommitResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string;
        sourceId: string | null;
        repositoryPath: string;
        sourceKind: 'local-working-tree' | 'local-branch-compare' | 'local-commit' | 'agent-change-set' | 'github-pull-request' | 'external-import';
        githubPullRequest: {
            owner: string;
            repo: string;
            number: string | number;
            detail?: {
                url: string;
                title: string;
                body: string | null;
                isDraft: boolean;
                state: 'open' | 'closed';
                merged: boolean;
                mergeable: boolean | null;
                mergeableState: string;
                headRef: string;
                baseRef: string;
                headSha: string | null;
                author: {
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                } | null;
                reviewers: Array<{
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                }>;
                assignees: Array<{
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                }>;
                labels: Array<{
                    name: string;
                    color: string;
                }>;
                checksState: 'success' | 'failure' | 'pending' | 'neutral';
                checks: Array<{
                    id: string;
                    name: string;
                    status: 'queued' | 'in_progress' | 'completed';
                    conclusion: string | null;
                    url: string | null;
                }>;
                timeline: Array<{
                    id: string;
                    kind: 'comment' | 'review';
                    author: {
                        login: string;
                        avatarUrl: string | null;
                        url: string | null;
                    } | null;
                    body: string | null;
                    state: string | null;
                    createdAt: string;
                    url: string | null;
                }>;
            };
        } | null;
        title: string;
        status: 'open' | 'merged' | 'closed' | 'abandoned';
        reviewState: 'unreviewed' | 'in-review' | 'changes-requested' | 'approved' | 'commented';
        currentRevisionId: string | null;
        createdAt: number;
        updatedAt: number;
        currentRevision: {
            id: string;
            reviewId: string;
            sourceVersion: string;
            patchHash: string;
            fileCount: number;
            additions: number;
            deletions: number;
            generatedAt: number;
            patch: string;
        } | null;
        files: Array<{
            id: string;
            revisionId: string;
            path: string;
            previousPath: string | null;
            status: 'added' | 'modified' | 'deleted' | 'renamed' | 'untracked';
            additions: number;
            deletions: number;
            isGenerated: boolean;
            isBinary: boolean;
            isViewed: boolean;
        }>;
        threads: Array<{
            id: string;
            reviewId: string;
            originalRevisionId: string;
            currentRevisionId: string | null;
            fileId: string | null;
            anchor: {
                revisionId: string;
                fileId: string;
                path: string;
                side: 'base' | 'head';
                startLine: number;
                endLine: number;
                startColumn?: number;
                endColumn?: number;
                hunkHeader: string;
                lineHash: string;
                contextBeforeHash?: string;
                contextAfterHash?: string;
            } | null;
            state: 'open' | 'resolved' | 'stale';
            createdBy: string;
            createdAt: number;
            updatedAt: number;
            resolvedBy: string | null;
            resolvedAt: number | null;
            comments: Array<{
                id: string;
                threadId: string;
                authorKind: 'user' | 'agent' | 'external';
                authorId: string;
                bodyMarkdown: string;
                externalUrl: string | null;
                createdAt: number;
                updatedAt: number;
            }>;
        }>;
        submissions: Array<{
            id: string;
            reviewId: string;
            revisionId: string;
            actorId: string;
            decision: 'approve' | 'request-changes' | 'comment';
            bodyMarkdown: string | null;
            submittedAt: number;
            sourceSyncState: 'local-only' | 'pending' | 'synced' | 'failed';
        }>;
        events: Array<{
            id: string;
            reviewId: string;
            eventKind: string;
            actorKind: 'user' | 'agent' | 'external' | 'system';
            actorId: string | null;
            payload: unknown;
            createdAt: number;
        }>;
        preferences: {
            id: string;
            workspaceId: string;
            userId: string;
            diffStyle: 'split' | 'unified';
            codeTheme: string;
            fontSize: number;
            lineHeight: number;
            hideWhitespaceOnly: boolean;
            structuralHighlighting: boolean;
            collapseGeneratedFiles: boolean;
            notificationMode: 'all-activity' | 'all-activity-by-people' | 'reviews-and-comments' | 'reviews-and-comments-by-people' | 'none';
            createdAt: number;
            updatedAt: number;
        };
        agentFixes: Array<{
            id: string;
            reviewId: string;
            targetRevisionId: string | null;
            threadId: string | null;
            anchor: {
                revisionId: string;
                fileId: string;
                path: string;
                side: 'base' | 'head';
                startLine: number;
                endLine: number;
                startColumn?: number;
                endColumn?: number;
                hunkHeader: string;
                lineHash: string;
                contextBeforeHash?: string;
                contextAfterHash?: string;
            } | null;
            instruction: string;
            profileId: string | null;
            expectedOutput: 'working-tree-change' | 'patch-artifact';
            status: 'pending' | 'running' | 'completed' | 'failed' | 'cancelled';
            sessionId: string | null;
            runId: string | null;
            artifactId: string | null;
            resultRevisionId: string | null;
            errorMessage: string | null;
            createdAt: number;
            updatedAt: number;
        }>;
    };
};

export type PostWorkspacesByWorkspaceIdDiffReviewsLocalCommitResponse = PostWorkspacesByWorkspaceIdDiffReviewsLocalCommitResponses[keyof PostWorkspacesByWorkspaceIdDiffReviewsLocalCommitResponses];

export type PostWorkspacesByWorkspaceIdDiffReviewsGithubPullRequestData = {
    body: {
        owner: string;
        repo: string;
        number: string | number;
    };
    path: {
        workspaceId: string;
    };
    query?: never;
    url: '/workspaces/{workspaceId}/diff-reviews/github-pull-request';
};

export type PostWorkspacesByWorkspaceIdDiffReviewsGithubPullRequestResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string;
        sourceId: string | null;
        repositoryPath: string;
        sourceKind: 'local-working-tree' | 'local-branch-compare' | 'local-commit' | 'agent-change-set' | 'github-pull-request' | 'external-import';
        githubPullRequest: {
            owner: string;
            repo: string;
            number: string | number;
            detail?: {
                url: string;
                title: string;
                body: string | null;
                isDraft: boolean;
                state: 'open' | 'closed';
                merged: boolean;
                mergeable: boolean | null;
                mergeableState: string;
                headRef: string;
                baseRef: string;
                headSha: string | null;
                author: {
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                } | null;
                reviewers: Array<{
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                }>;
                assignees: Array<{
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                }>;
                labels: Array<{
                    name: string;
                    color: string;
                }>;
                checksState: 'success' | 'failure' | 'pending' | 'neutral';
                checks: Array<{
                    id: string;
                    name: string;
                    status: 'queued' | 'in_progress' | 'completed';
                    conclusion: string | null;
                    url: string | null;
                }>;
                timeline: Array<{
                    id: string;
                    kind: 'comment' | 'review';
                    author: {
                        login: string;
                        avatarUrl: string | null;
                        url: string | null;
                    } | null;
                    body: string | null;
                    state: string | null;
                    createdAt: string;
                    url: string | null;
                }>;
            };
        } | null;
        title: string;
        status: 'open' | 'merged' | 'closed' | 'abandoned';
        reviewState: 'unreviewed' | 'in-review' | 'changes-requested' | 'approved' | 'commented';
        currentRevisionId: string | null;
        createdAt: number;
        updatedAt: number;
        currentRevision: {
            id: string;
            reviewId: string;
            sourceVersion: string;
            patchHash: string;
            fileCount: number;
            additions: number;
            deletions: number;
            generatedAt: number;
            patch: string;
        } | null;
        files: Array<{
            id: string;
            revisionId: string;
            path: string;
            previousPath: string | null;
            status: 'added' | 'modified' | 'deleted' | 'renamed' | 'untracked';
            additions: number;
            deletions: number;
            isGenerated: boolean;
            isBinary: boolean;
            isViewed: boolean;
        }>;
        threads: Array<{
            id: string;
            reviewId: string;
            originalRevisionId: string;
            currentRevisionId: string | null;
            fileId: string | null;
            anchor: {
                revisionId: string;
                fileId: string;
                path: string;
                side: 'base' | 'head';
                startLine: number;
                endLine: number;
                startColumn?: number;
                endColumn?: number;
                hunkHeader: string;
                lineHash: string;
                contextBeforeHash?: string;
                contextAfterHash?: string;
            } | null;
            state: 'open' | 'resolved' | 'stale';
            createdBy: string;
            createdAt: number;
            updatedAt: number;
            resolvedBy: string | null;
            resolvedAt: number | null;
            comments: Array<{
                id: string;
                threadId: string;
                authorKind: 'user' | 'agent' | 'external';
                authorId: string;
                bodyMarkdown: string;
                externalUrl: string | null;
                createdAt: number;
                updatedAt: number;
            }>;
        }>;
        submissions: Array<{
            id: string;
            reviewId: string;
            revisionId: string;
            actorId: string;
            decision: 'approve' | 'request-changes' | 'comment';
            bodyMarkdown: string | null;
            submittedAt: number;
            sourceSyncState: 'local-only' | 'pending' | 'synced' | 'failed';
        }>;
        events: Array<{
            id: string;
            reviewId: string;
            eventKind: string;
            actorKind: 'user' | 'agent' | 'external' | 'system';
            actorId: string | null;
            payload: unknown;
            createdAt: number;
        }>;
        preferences: {
            id: string;
            workspaceId: string;
            userId: string;
            diffStyle: 'split' | 'unified';
            codeTheme: string;
            fontSize: number;
            lineHeight: number;
            hideWhitespaceOnly: boolean;
            structuralHighlighting: boolean;
            collapseGeneratedFiles: boolean;
            notificationMode: 'all-activity' | 'all-activity-by-people' | 'reviews-and-comments' | 'reviews-and-comments-by-people' | 'none';
            createdAt: number;
            updatedAt: number;
        };
        agentFixes: Array<{
            id: string;
            reviewId: string;
            targetRevisionId: string | null;
            threadId: string | null;
            anchor: {
                revisionId: string;
                fileId: string;
                path: string;
                side: 'base' | 'head';
                startLine: number;
                endLine: number;
                startColumn?: number;
                endColumn?: number;
                hunkHeader: string;
                lineHash: string;
                contextBeforeHash?: string;
                contextAfterHash?: string;
            } | null;
            instruction: string;
            profileId: string | null;
            expectedOutput: 'working-tree-change' | 'patch-artifact';
            status: 'pending' | 'running' | 'completed' | 'failed' | 'cancelled';
            sessionId: string | null;
            runId: string | null;
            artifactId: string | null;
            resultRevisionId: string | null;
            errorMessage: string | null;
            createdAt: number;
            updatedAt: number;
        }>;
    };
};

export type PostWorkspacesByWorkspaceIdDiffReviewsGithubPullRequestResponse = PostWorkspacesByWorkspaceIdDiffReviewsGithubPullRequestResponses[keyof PostWorkspacesByWorkspaceIdDiffReviewsGithubPullRequestResponses];

export type GetWorkspacesByWorkspaceIdDiffReviewsByReviewIdData = {
    body?: never;
    path: {
        workspaceId: string;
        reviewId: string;
    };
    query?: never;
    url: '/workspaces/{workspaceId}/diff-reviews/{reviewId}';
};

export type GetWorkspacesByWorkspaceIdDiffReviewsByReviewIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string;
        sourceId: string | null;
        repositoryPath: string;
        sourceKind: 'local-working-tree' | 'local-branch-compare' | 'local-commit' | 'agent-change-set' | 'github-pull-request' | 'external-import';
        githubPullRequest: {
            owner: string;
            repo: string;
            number: string | number;
            detail?: {
                url: string;
                title: string;
                body: string | null;
                isDraft: boolean;
                state: 'open' | 'closed';
                merged: boolean;
                mergeable: boolean | null;
                mergeableState: string;
                headRef: string;
                baseRef: string;
                headSha: string | null;
                author: {
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                } | null;
                reviewers: Array<{
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                }>;
                assignees: Array<{
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                }>;
                labels: Array<{
                    name: string;
                    color: string;
                }>;
                checksState: 'success' | 'failure' | 'pending' | 'neutral';
                checks: Array<{
                    id: string;
                    name: string;
                    status: 'queued' | 'in_progress' | 'completed';
                    conclusion: string | null;
                    url: string | null;
                }>;
                timeline: Array<{
                    id: string;
                    kind: 'comment' | 'review';
                    author: {
                        login: string;
                        avatarUrl: string | null;
                        url: string | null;
                    } | null;
                    body: string | null;
                    state: string | null;
                    createdAt: string;
                    url: string | null;
                }>;
            };
        } | null;
        title: string;
        status: 'open' | 'merged' | 'closed' | 'abandoned';
        reviewState: 'unreviewed' | 'in-review' | 'changes-requested' | 'approved' | 'commented';
        currentRevisionId: string | null;
        createdAt: number;
        updatedAt: number;
        currentRevision: {
            id: string;
            reviewId: string;
            sourceVersion: string;
            patchHash: string;
            fileCount: number;
            additions: number;
            deletions: number;
            generatedAt: number;
            patch: string;
        } | null;
        files: Array<{
            id: string;
            revisionId: string;
            path: string;
            previousPath: string | null;
            status: 'added' | 'modified' | 'deleted' | 'renamed' | 'untracked';
            additions: number;
            deletions: number;
            isGenerated: boolean;
            isBinary: boolean;
            isViewed: boolean;
        }>;
        threads: Array<{
            id: string;
            reviewId: string;
            originalRevisionId: string;
            currentRevisionId: string | null;
            fileId: string | null;
            anchor: {
                revisionId: string;
                fileId: string;
                path: string;
                side: 'base' | 'head';
                startLine: number;
                endLine: number;
                startColumn?: number;
                endColumn?: number;
                hunkHeader: string;
                lineHash: string;
                contextBeforeHash?: string;
                contextAfterHash?: string;
            } | null;
            state: 'open' | 'resolved' | 'stale';
            createdBy: string;
            createdAt: number;
            updatedAt: number;
            resolvedBy: string | null;
            resolvedAt: number | null;
            comments: Array<{
                id: string;
                threadId: string;
                authorKind: 'user' | 'agent' | 'external';
                authorId: string;
                bodyMarkdown: string;
                externalUrl: string | null;
                createdAt: number;
                updatedAt: number;
            }>;
        }>;
        submissions: Array<{
            id: string;
            reviewId: string;
            revisionId: string;
            actorId: string;
            decision: 'approve' | 'request-changes' | 'comment';
            bodyMarkdown: string | null;
            submittedAt: number;
            sourceSyncState: 'local-only' | 'pending' | 'synced' | 'failed';
        }>;
        events: Array<{
            id: string;
            reviewId: string;
            eventKind: string;
            actorKind: 'user' | 'agent' | 'external' | 'system';
            actorId: string | null;
            payload: unknown;
            createdAt: number;
        }>;
        preferences: {
            id: string;
            workspaceId: string;
            userId: string;
            diffStyle: 'split' | 'unified';
            codeTheme: string;
            fontSize: number;
            lineHeight: number;
            hideWhitespaceOnly: boolean;
            structuralHighlighting: boolean;
            collapseGeneratedFiles: boolean;
            notificationMode: 'all-activity' | 'all-activity-by-people' | 'reviews-and-comments' | 'reviews-and-comments-by-people' | 'none';
            createdAt: number;
            updatedAt: number;
        };
        agentFixes: Array<{
            id: string;
            reviewId: string;
            targetRevisionId: string | null;
            threadId: string | null;
            anchor: {
                revisionId: string;
                fileId: string;
                path: string;
                side: 'base' | 'head';
                startLine: number;
                endLine: number;
                startColumn?: number;
                endColumn?: number;
                hunkHeader: string;
                lineHash: string;
                contextBeforeHash?: string;
                contextAfterHash?: string;
            } | null;
            instruction: string;
            profileId: string | null;
            expectedOutput: 'working-tree-change' | 'patch-artifact';
            status: 'pending' | 'running' | 'completed' | 'failed' | 'cancelled';
            sessionId: string | null;
            runId: string | null;
            artifactId: string | null;
            resultRevisionId: string | null;
            errorMessage: string | null;
            createdAt: number;
            updatedAt: number;
        }>;
    };
};

export type GetWorkspacesByWorkspaceIdDiffReviewsByReviewIdResponse = GetWorkspacesByWorkspaceIdDiffReviewsByReviewIdResponses[keyof GetWorkspacesByWorkspaceIdDiffReviewsByReviewIdResponses];

export type PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdRefreshData = {
    body?: never;
    path: {
        workspaceId: string;
        reviewId: string;
    };
    query?: never;
    url: '/workspaces/{workspaceId}/diff-reviews/{reviewId}/refresh';
};

export type PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdRefreshResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string;
        sourceId: string | null;
        repositoryPath: string;
        sourceKind: 'local-working-tree' | 'local-branch-compare' | 'local-commit' | 'agent-change-set' | 'github-pull-request' | 'external-import';
        githubPullRequest: {
            owner: string;
            repo: string;
            number: string | number;
            detail?: {
                url: string;
                title: string;
                body: string | null;
                isDraft: boolean;
                state: 'open' | 'closed';
                merged: boolean;
                mergeable: boolean | null;
                mergeableState: string;
                headRef: string;
                baseRef: string;
                headSha: string | null;
                author: {
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                } | null;
                reviewers: Array<{
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                }>;
                assignees: Array<{
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                }>;
                labels: Array<{
                    name: string;
                    color: string;
                }>;
                checksState: 'success' | 'failure' | 'pending' | 'neutral';
                checks: Array<{
                    id: string;
                    name: string;
                    status: 'queued' | 'in_progress' | 'completed';
                    conclusion: string | null;
                    url: string | null;
                }>;
                timeline: Array<{
                    id: string;
                    kind: 'comment' | 'review';
                    author: {
                        login: string;
                        avatarUrl: string | null;
                        url: string | null;
                    } | null;
                    body: string | null;
                    state: string | null;
                    createdAt: string;
                    url: string | null;
                }>;
            };
        } | null;
        title: string;
        status: 'open' | 'merged' | 'closed' | 'abandoned';
        reviewState: 'unreviewed' | 'in-review' | 'changes-requested' | 'approved' | 'commented';
        currentRevisionId: string | null;
        createdAt: number;
        updatedAt: number;
        currentRevision: {
            id: string;
            reviewId: string;
            sourceVersion: string;
            patchHash: string;
            fileCount: number;
            additions: number;
            deletions: number;
            generatedAt: number;
            patch: string;
        } | null;
        files: Array<{
            id: string;
            revisionId: string;
            path: string;
            previousPath: string | null;
            status: 'added' | 'modified' | 'deleted' | 'renamed' | 'untracked';
            additions: number;
            deletions: number;
            isGenerated: boolean;
            isBinary: boolean;
            isViewed: boolean;
        }>;
        threads: Array<{
            id: string;
            reviewId: string;
            originalRevisionId: string;
            currentRevisionId: string | null;
            fileId: string | null;
            anchor: {
                revisionId: string;
                fileId: string;
                path: string;
                side: 'base' | 'head';
                startLine: number;
                endLine: number;
                startColumn?: number;
                endColumn?: number;
                hunkHeader: string;
                lineHash: string;
                contextBeforeHash?: string;
                contextAfterHash?: string;
            } | null;
            state: 'open' | 'resolved' | 'stale';
            createdBy: string;
            createdAt: number;
            updatedAt: number;
            resolvedBy: string | null;
            resolvedAt: number | null;
            comments: Array<{
                id: string;
                threadId: string;
                authorKind: 'user' | 'agent' | 'external';
                authorId: string;
                bodyMarkdown: string;
                externalUrl: string | null;
                createdAt: number;
                updatedAt: number;
            }>;
        }>;
        submissions: Array<{
            id: string;
            reviewId: string;
            revisionId: string;
            actorId: string;
            decision: 'approve' | 'request-changes' | 'comment';
            bodyMarkdown: string | null;
            submittedAt: number;
            sourceSyncState: 'local-only' | 'pending' | 'synced' | 'failed';
        }>;
        events: Array<{
            id: string;
            reviewId: string;
            eventKind: string;
            actorKind: 'user' | 'agent' | 'external' | 'system';
            actorId: string | null;
            payload: unknown;
            createdAt: number;
        }>;
        preferences: {
            id: string;
            workspaceId: string;
            userId: string;
            diffStyle: 'split' | 'unified';
            codeTheme: string;
            fontSize: number;
            lineHeight: number;
            hideWhitespaceOnly: boolean;
            structuralHighlighting: boolean;
            collapseGeneratedFiles: boolean;
            notificationMode: 'all-activity' | 'all-activity-by-people' | 'reviews-and-comments' | 'reviews-and-comments-by-people' | 'none';
            createdAt: number;
            updatedAt: number;
        };
        agentFixes: Array<{
            id: string;
            reviewId: string;
            targetRevisionId: string | null;
            threadId: string | null;
            anchor: {
                revisionId: string;
                fileId: string;
                path: string;
                side: 'base' | 'head';
                startLine: number;
                endLine: number;
                startColumn?: number;
                endColumn?: number;
                hunkHeader: string;
                lineHash: string;
                contextBeforeHash?: string;
                contextAfterHash?: string;
            } | null;
            instruction: string;
            profileId: string | null;
            expectedOutput: 'working-tree-change' | 'patch-artifact';
            status: 'pending' | 'running' | 'completed' | 'failed' | 'cancelled';
            sessionId: string | null;
            runId: string | null;
            artifactId: string | null;
            resultRevisionId: string | null;
            errorMessage: string | null;
            createdAt: number;
            updatedAt: number;
        }>;
    };
};

export type PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdRefreshResponse = PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdRefreshResponses[keyof PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdRefreshResponses];

export type PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdCloseData = {
    body?: never;
    path: {
        workspaceId: string;
        reviewId: string;
    };
    query?: never;
    url: '/workspaces/{workspaceId}/diff-reviews/{reviewId}/close';
};

export type PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdCloseResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string;
        sourceId: string | null;
        repositoryPath: string;
        sourceKind: 'local-working-tree' | 'local-branch-compare' | 'local-commit' | 'agent-change-set' | 'github-pull-request' | 'external-import';
        githubPullRequest: {
            owner: string;
            repo: string;
            number: string | number;
            detail?: {
                url: string;
                title: string;
                body: string | null;
                isDraft: boolean;
                state: 'open' | 'closed';
                merged: boolean;
                mergeable: boolean | null;
                mergeableState: string;
                headRef: string;
                baseRef: string;
                headSha: string | null;
                author: {
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                } | null;
                reviewers: Array<{
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                }>;
                assignees: Array<{
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                }>;
                labels: Array<{
                    name: string;
                    color: string;
                }>;
                checksState: 'success' | 'failure' | 'pending' | 'neutral';
                checks: Array<{
                    id: string;
                    name: string;
                    status: 'queued' | 'in_progress' | 'completed';
                    conclusion: string | null;
                    url: string | null;
                }>;
                timeline: Array<{
                    id: string;
                    kind: 'comment' | 'review';
                    author: {
                        login: string;
                        avatarUrl: string | null;
                        url: string | null;
                    } | null;
                    body: string | null;
                    state: string | null;
                    createdAt: string;
                    url: string | null;
                }>;
            };
        } | null;
        title: string;
        status: 'open' | 'merged' | 'closed' | 'abandoned';
        reviewState: 'unreviewed' | 'in-review' | 'changes-requested' | 'approved' | 'commented';
        currentRevisionId: string | null;
        createdAt: number;
        updatedAt: number;
        currentRevision: {
            id: string;
            reviewId: string;
            sourceVersion: string;
            patchHash: string;
            fileCount: number;
            additions: number;
            deletions: number;
            generatedAt: number;
            patch: string;
        } | null;
        files: Array<{
            id: string;
            revisionId: string;
            path: string;
            previousPath: string | null;
            status: 'added' | 'modified' | 'deleted' | 'renamed' | 'untracked';
            additions: number;
            deletions: number;
            isGenerated: boolean;
            isBinary: boolean;
            isViewed: boolean;
        }>;
        threads: Array<{
            id: string;
            reviewId: string;
            originalRevisionId: string;
            currentRevisionId: string | null;
            fileId: string | null;
            anchor: {
                revisionId: string;
                fileId: string;
                path: string;
                side: 'base' | 'head';
                startLine: number;
                endLine: number;
                startColumn?: number;
                endColumn?: number;
                hunkHeader: string;
                lineHash: string;
                contextBeforeHash?: string;
                contextAfterHash?: string;
            } | null;
            state: 'open' | 'resolved' | 'stale';
            createdBy: string;
            createdAt: number;
            updatedAt: number;
            resolvedBy: string | null;
            resolvedAt: number | null;
            comments: Array<{
                id: string;
                threadId: string;
                authorKind: 'user' | 'agent' | 'external';
                authorId: string;
                bodyMarkdown: string;
                externalUrl: string | null;
                createdAt: number;
                updatedAt: number;
            }>;
        }>;
        submissions: Array<{
            id: string;
            reviewId: string;
            revisionId: string;
            actorId: string;
            decision: 'approve' | 'request-changes' | 'comment';
            bodyMarkdown: string | null;
            submittedAt: number;
            sourceSyncState: 'local-only' | 'pending' | 'synced' | 'failed';
        }>;
        events: Array<{
            id: string;
            reviewId: string;
            eventKind: string;
            actorKind: 'user' | 'agent' | 'external' | 'system';
            actorId: string | null;
            payload: unknown;
            createdAt: number;
        }>;
        preferences: {
            id: string;
            workspaceId: string;
            userId: string;
            diffStyle: 'split' | 'unified';
            codeTheme: string;
            fontSize: number;
            lineHeight: number;
            hideWhitespaceOnly: boolean;
            structuralHighlighting: boolean;
            collapseGeneratedFiles: boolean;
            notificationMode: 'all-activity' | 'all-activity-by-people' | 'reviews-and-comments' | 'reviews-and-comments-by-people' | 'none';
            createdAt: number;
            updatedAt: number;
        };
        agentFixes: Array<{
            id: string;
            reviewId: string;
            targetRevisionId: string | null;
            threadId: string | null;
            anchor: {
                revisionId: string;
                fileId: string;
                path: string;
                side: 'base' | 'head';
                startLine: number;
                endLine: number;
                startColumn?: number;
                endColumn?: number;
                hunkHeader: string;
                lineHash: string;
                contextBeforeHash?: string;
                contextAfterHash?: string;
            } | null;
            instruction: string;
            profileId: string | null;
            expectedOutput: 'working-tree-change' | 'patch-artifact';
            status: 'pending' | 'running' | 'completed' | 'failed' | 'cancelled';
            sessionId: string | null;
            runId: string | null;
            artifactId: string | null;
            resultRevisionId: string | null;
            errorMessage: string | null;
            createdAt: number;
            updatedAt: number;
        }>;
    };
};

export type PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdCloseResponse = PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdCloseResponses[keyof PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdCloseResponses];

export type PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdFilesByFileIdViewedData = {
    body: {
        viewed: boolean;
    };
    path: {
        workspaceId: string;
        reviewId: string;
        fileId: string;
    };
    query?: never;
    url: '/workspaces/{workspaceId}/diff-reviews/{reviewId}/files/{fileId}/viewed';
};

export type PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdFilesByFileIdViewedResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string;
        sourceId: string | null;
        repositoryPath: string;
        sourceKind: 'local-working-tree' | 'local-branch-compare' | 'local-commit' | 'agent-change-set' | 'github-pull-request' | 'external-import';
        githubPullRequest: {
            owner: string;
            repo: string;
            number: string | number;
            detail?: {
                url: string;
                title: string;
                body: string | null;
                isDraft: boolean;
                state: 'open' | 'closed';
                merged: boolean;
                mergeable: boolean | null;
                mergeableState: string;
                headRef: string;
                baseRef: string;
                headSha: string | null;
                author: {
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                } | null;
                reviewers: Array<{
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                }>;
                assignees: Array<{
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                }>;
                labels: Array<{
                    name: string;
                    color: string;
                }>;
                checksState: 'success' | 'failure' | 'pending' | 'neutral';
                checks: Array<{
                    id: string;
                    name: string;
                    status: 'queued' | 'in_progress' | 'completed';
                    conclusion: string | null;
                    url: string | null;
                }>;
                timeline: Array<{
                    id: string;
                    kind: 'comment' | 'review';
                    author: {
                        login: string;
                        avatarUrl: string | null;
                        url: string | null;
                    } | null;
                    body: string | null;
                    state: string | null;
                    createdAt: string;
                    url: string | null;
                }>;
            };
        } | null;
        title: string;
        status: 'open' | 'merged' | 'closed' | 'abandoned';
        reviewState: 'unreviewed' | 'in-review' | 'changes-requested' | 'approved' | 'commented';
        currentRevisionId: string | null;
        createdAt: number;
        updatedAt: number;
        currentRevision: {
            id: string;
            reviewId: string;
            sourceVersion: string;
            patchHash: string;
            fileCount: number;
            additions: number;
            deletions: number;
            generatedAt: number;
            patch: string;
        } | null;
        files: Array<{
            id: string;
            revisionId: string;
            path: string;
            previousPath: string | null;
            status: 'added' | 'modified' | 'deleted' | 'renamed' | 'untracked';
            additions: number;
            deletions: number;
            isGenerated: boolean;
            isBinary: boolean;
            isViewed: boolean;
        }>;
        threads: Array<{
            id: string;
            reviewId: string;
            originalRevisionId: string;
            currentRevisionId: string | null;
            fileId: string | null;
            anchor: {
                revisionId: string;
                fileId: string;
                path: string;
                side: 'base' | 'head';
                startLine: number;
                endLine: number;
                startColumn?: number;
                endColumn?: number;
                hunkHeader: string;
                lineHash: string;
                contextBeforeHash?: string;
                contextAfterHash?: string;
            } | null;
            state: 'open' | 'resolved' | 'stale';
            createdBy: string;
            createdAt: number;
            updatedAt: number;
            resolvedBy: string | null;
            resolvedAt: number | null;
            comments: Array<{
                id: string;
                threadId: string;
                authorKind: 'user' | 'agent' | 'external';
                authorId: string;
                bodyMarkdown: string;
                externalUrl: string | null;
                createdAt: number;
                updatedAt: number;
            }>;
        }>;
        submissions: Array<{
            id: string;
            reviewId: string;
            revisionId: string;
            actorId: string;
            decision: 'approve' | 'request-changes' | 'comment';
            bodyMarkdown: string | null;
            submittedAt: number;
            sourceSyncState: 'local-only' | 'pending' | 'synced' | 'failed';
        }>;
        events: Array<{
            id: string;
            reviewId: string;
            eventKind: string;
            actorKind: 'user' | 'agent' | 'external' | 'system';
            actorId: string | null;
            payload: unknown;
            createdAt: number;
        }>;
        preferences: {
            id: string;
            workspaceId: string;
            userId: string;
            diffStyle: 'split' | 'unified';
            codeTheme: string;
            fontSize: number;
            lineHeight: number;
            hideWhitespaceOnly: boolean;
            structuralHighlighting: boolean;
            collapseGeneratedFiles: boolean;
            notificationMode: 'all-activity' | 'all-activity-by-people' | 'reviews-and-comments' | 'reviews-and-comments-by-people' | 'none';
            createdAt: number;
            updatedAt: number;
        };
        agentFixes: Array<{
            id: string;
            reviewId: string;
            targetRevisionId: string | null;
            threadId: string | null;
            anchor: {
                revisionId: string;
                fileId: string;
                path: string;
                side: 'base' | 'head';
                startLine: number;
                endLine: number;
                startColumn?: number;
                endColumn?: number;
                hunkHeader: string;
                lineHash: string;
                contextBeforeHash?: string;
                contextAfterHash?: string;
            } | null;
            instruction: string;
            profileId: string | null;
            expectedOutput: 'working-tree-change' | 'patch-artifact';
            status: 'pending' | 'running' | 'completed' | 'failed' | 'cancelled';
            sessionId: string | null;
            runId: string | null;
            artifactId: string | null;
            resultRevisionId: string | null;
            errorMessage: string | null;
            createdAt: number;
            updatedAt: number;
        }>;
    };
};

export type PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdFilesByFileIdViewedResponse = PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdFilesByFileIdViewedResponses[keyof PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdFilesByFileIdViewedResponses];

export type PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdThreadsData = {
    body: {
        fileId?: string | null;
        anchor?: {
            fileId: string;
            side?: 'base' | 'head';
            startLine: number;
            endLine?: number;
            startColumn?: number;
            endColumn?: number;
        } | null;
        bodyMarkdown: string;
    };
    path: {
        workspaceId: string;
        reviewId: string;
    };
    query?: never;
    url: '/workspaces/{workspaceId}/diff-reviews/{reviewId}/threads';
};

export type PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdThreadsResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string;
        sourceId: string | null;
        repositoryPath: string;
        sourceKind: 'local-working-tree' | 'local-branch-compare' | 'local-commit' | 'agent-change-set' | 'github-pull-request' | 'external-import';
        githubPullRequest: {
            owner: string;
            repo: string;
            number: string | number;
            detail?: {
                url: string;
                title: string;
                body: string | null;
                isDraft: boolean;
                state: 'open' | 'closed';
                merged: boolean;
                mergeable: boolean | null;
                mergeableState: string;
                headRef: string;
                baseRef: string;
                headSha: string | null;
                author: {
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                } | null;
                reviewers: Array<{
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                }>;
                assignees: Array<{
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                }>;
                labels: Array<{
                    name: string;
                    color: string;
                }>;
                checksState: 'success' | 'failure' | 'pending' | 'neutral';
                checks: Array<{
                    id: string;
                    name: string;
                    status: 'queued' | 'in_progress' | 'completed';
                    conclusion: string | null;
                    url: string | null;
                }>;
                timeline: Array<{
                    id: string;
                    kind: 'comment' | 'review';
                    author: {
                        login: string;
                        avatarUrl: string | null;
                        url: string | null;
                    } | null;
                    body: string | null;
                    state: string | null;
                    createdAt: string;
                    url: string | null;
                }>;
            };
        } | null;
        title: string;
        status: 'open' | 'merged' | 'closed' | 'abandoned';
        reviewState: 'unreviewed' | 'in-review' | 'changes-requested' | 'approved' | 'commented';
        currentRevisionId: string | null;
        createdAt: number;
        updatedAt: number;
        currentRevision: {
            id: string;
            reviewId: string;
            sourceVersion: string;
            patchHash: string;
            fileCount: number;
            additions: number;
            deletions: number;
            generatedAt: number;
            patch: string;
        } | null;
        files: Array<{
            id: string;
            revisionId: string;
            path: string;
            previousPath: string | null;
            status: 'added' | 'modified' | 'deleted' | 'renamed' | 'untracked';
            additions: number;
            deletions: number;
            isGenerated: boolean;
            isBinary: boolean;
            isViewed: boolean;
        }>;
        threads: Array<{
            id: string;
            reviewId: string;
            originalRevisionId: string;
            currentRevisionId: string | null;
            fileId: string | null;
            anchor: {
                revisionId: string;
                fileId: string;
                path: string;
                side: 'base' | 'head';
                startLine: number;
                endLine: number;
                startColumn?: number;
                endColumn?: number;
                hunkHeader: string;
                lineHash: string;
                contextBeforeHash?: string;
                contextAfterHash?: string;
            } | null;
            state: 'open' | 'resolved' | 'stale';
            createdBy: string;
            createdAt: number;
            updatedAt: number;
            resolvedBy: string | null;
            resolvedAt: number | null;
            comments: Array<{
                id: string;
                threadId: string;
                authorKind: 'user' | 'agent' | 'external';
                authorId: string;
                bodyMarkdown: string;
                externalUrl: string | null;
                createdAt: number;
                updatedAt: number;
            }>;
        }>;
        submissions: Array<{
            id: string;
            reviewId: string;
            revisionId: string;
            actorId: string;
            decision: 'approve' | 'request-changes' | 'comment';
            bodyMarkdown: string | null;
            submittedAt: number;
            sourceSyncState: 'local-only' | 'pending' | 'synced' | 'failed';
        }>;
        events: Array<{
            id: string;
            reviewId: string;
            eventKind: string;
            actorKind: 'user' | 'agent' | 'external' | 'system';
            actorId: string | null;
            payload: unknown;
            createdAt: number;
        }>;
        preferences: {
            id: string;
            workspaceId: string;
            userId: string;
            diffStyle: 'split' | 'unified';
            codeTheme: string;
            fontSize: number;
            lineHeight: number;
            hideWhitespaceOnly: boolean;
            structuralHighlighting: boolean;
            collapseGeneratedFiles: boolean;
            notificationMode: 'all-activity' | 'all-activity-by-people' | 'reviews-and-comments' | 'reviews-and-comments-by-people' | 'none';
            createdAt: number;
            updatedAt: number;
        };
        agentFixes: Array<{
            id: string;
            reviewId: string;
            targetRevisionId: string | null;
            threadId: string | null;
            anchor: {
                revisionId: string;
                fileId: string;
                path: string;
                side: 'base' | 'head';
                startLine: number;
                endLine: number;
                startColumn?: number;
                endColumn?: number;
                hunkHeader: string;
                lineHash: string;
                contextBeforeHash?: string;
                contextAfterHash?: string;
            } | null;
            instruction: string;
            profileId: string | null;
            expectedOutput: 'working-tree-change' | 'patch-artifact';
            status: 'pending' | 'running' | 'completed' | 'failed' | 'cancelled';
            sessionId: string | null;
            runId: string | null;
            artifactId: string | null;
            resultRevisionId: string | null;
            errorMessage: string | null;
            createdAt: number;
            updatedAt: number;
        }>;
    };
};

export type PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdThreadsResponse = PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdThreadsResponses[keyof PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdThreadsResponses];

export type PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdThreadsByThreadIdCommentsData = {
    body: {
        bodyMarkdown: string;
    };
    path: {
        workspaceId: string;
        reviewId: string;
        threadId: string;
    };
    query?: never;
    url: '/workspaces/{workspaceId}/diff-reviews/{reviewId}/threads/{threadId}/comments';
};

export type PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdThreadsByThreadIdCommentsResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string;
        sourceId: string | null;
        repositoryPath: string;
        sourceKind: 'local-working-tree' | 'local-branch-compare' | 'local-commit' | 'agent-change-set' | 'github-pull-request' | 'external-import';
        githubPullRequest: {
            owner: string;
            repo: string;
            number: string | number;
            detail?: {
                url: string;
                title: string;
                body: string | null;
                isDraft: boolean;
                state: 'open' | 'closed';
                merged: boolean;
                mergeable: boolean | null;
                mergeableState: string;
                headRef: string;
                baseRef: string;
                headSha: string | null;
                author: {
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                } | null;
                reviewers: Array<{
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                }>;
                assignees: Array<{
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                }>;
                labels: Array<{
                    name: string;
                    color: string;
                }>;
                checksState: 'success' | 'failure' | 'pending' | 'neutral';
                checks: Array<{
                    id: string;
                    name: string;
                    status: 'queued' | 'in_progress' | 'completed';
                    conclusion: string | null;
                    url: string | null;
                }>;
                timeline: Array<{
                    id: string;
                    kind: 'comment' | 'review';
                    author: {
                        login: string;
                        avatarUrl: string | null;
                        url: string | null;
                    } | null;
                    body: string | null;
                    state: string | null;
                    createdAt: string;
                    url: string | null;
                }>;
            };
        } | null;
        title: string;
        status: 'open' | 'merged' | 'closed' | 'abandoned';
        reviewState: 'unreviewed' | 'in-review' | 'changes-requested' | 'approved' | 'commented';
        currentRevisionId: string | null;
        createdAt: number;
        updatedAt: number;
        currentRevision: {
            id: string;
            reviewId: string;
            sourceVersion: string;
            patchHash: string;
            fileCount: number;
            additions: number;
            deletions: number;
            generatedAt: number;
            patch: string;
        } | null;
        files: Array<{
            id: string;
            revisionId: string;
            path: string;
            previousPath: string | null;
            status: 'added' | 'modified' | 'deleted' | 'renamed' | 'untracked';
            additions: number;
            deletions: number;
            isGenerated: boolean;
            isBinary: boolean;
            isViewed: boolean;
        }>;
        threads: Array<{
            id: string;
            reviewId: string;
            originalRevisionId: string;
            currentRevisionId: string | null;
            fileId: string | null;
            anchor: {
                revisionId: string;
                fileId: string;
                path: string;
                side: 'base' | 'head';
                startLine: number;
                endLine: number;
                startColumn?: number;
                endColumn?: number;
                hunkHeader: string;
                lineHash: string;
                contextBeforeHash?: string;
                contextAfterHash?: string;
            } | null;
            state: 'open' | 'resolved' | 'stale';
            createdBy: string;
            createdAt: number;
            updatedAt: number;
            resolvedBy: string | null;
            resolvedAt: number | null;
            comments: Array<{
                id: string;
                threadId: string;
                authorKind: 'user' | 'agent' | 'external';
                authorId: string;
                bodyMarkdown: string;
                externalUrl: string | null;
                createdAt: number;
                updatedAt: number;
            }>;
        }>;
        submissions: Array<{
            id: string;
            reviewId: string;
            revisionId: string;
            actorId: string;
            decision: 'approve' | 'request-changes' | 'comment';
            bodyMarkdown: string | null;
            submittedAt: number;
            sourceSyncState: 'local-only' | 'pending' | 'synced' | 'failed';
        }>;
        events: Array<{
            id: string;
            reviewId: string;
            eventKind: string;
            actorKind: 'user' | 'agent' | 'external' | 'system';
            actorId: string | null;
            payload: unknown;
            createdAt: number;
        }>;
        preferences: {
            id: string;
            workspaceId: string;
            userId: string;
            diffStyle: 'split' | 'unified';
            codeTheme: string;
            fontSize: number;
            lineHeight: number;
            hideWhitespaceOnly: boolean;
            structuralHighlighting: boolean;
            collapseGeneratedFiles: boolean;
            notificationMode: 'all-activity' | 'all-activity-by-people' | 'reviews-and-comments' | 'reviews-and-comments-by-people' | 'none';
            createdAt: number;
            updatedAt: number;
        };
        agentFixes: Array<{
            id: string;
            reviewId: string;
            targetRevisionId: string | null;
            threadId: string | null;
            anchor: {
                revisionId: string;
                fileId: string;
                path: string;
                side: 'base' | 'head';
                startLine: number;
                endLine: number;
                startColumn?: number;
                endColumn?: number;
                hunkHeader: string;
                lineHash: string;
                contextBeforeHash?: string;
                contextAfterHash?: string;
            } | null;
            instruction: string;
            profileId: string | null;
            expectedOutput: 'working-tree-change' | 'patch-artifact';
            status: 'pending' | 'running' | 'completed' | 'failed' | 'cancelled';
            sessionId: string | null;
            runId: string | null;
            artifactId: string | null;
            resultRevisionId: string | null;
            errorMessage: string | null;
            createdAt: number;
            updatedAt: number;
        }>;
    };
};

export type PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdThreadsByThreadIdCommentsResponse = PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdThreadsByThreadIdCommentsResponses[keyof PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdThreadsByThreadIdCommentsResponses];

export type PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdThreadsByThreadIdResolveData = {
    body?: never;
    path: {
        workspaceId: string;
        reviewId: string;
        threadId: string;
    };
    query?: never;
    url: '/workspaces/{workspaceId}/diff-reviews/{reviewId}/threads/{threadId}/resolve';
};

export type PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdThreadsByThreadIdResolveResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string;
        sourceId: string | null;
        repositoryPath: string;
        sourceKind: 'local-working-tree' | 'local-branch-compare' | 'local-commit' | 'agent-change-set' | 'github-pull-request' | 'external-import';
        githubPullRequest: {
            owner: string;
            repo: string;
            number: string | number;
            detail?: {
                url: string;
                title: string;
                body: string | null;
                isDraft: boolean;
                state: 'open' | 'closed';
                merged: boolean;
                mergeable: boolean | null;
                mergeableState: string;
                headRef: string;
                baseRef: string;
                headSha: string | null;
                author: {
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                } | null;
                reviewers: Array<{
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                }>;
                assignees: Array<{
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                }>;
                labels: Array<{
                    name: string;
                    color: string;
                }>;
                checksState: 'success' | 'failure' | 'pending' | 'neutral';
                checks: Array<{
                    id: string;
                    name: string;
                    status: 'queued' | 'in_progress' | 'completed';
                    conclusion: string | null;
                    url: string | null;
                }>;
                timeline: Array<{
                    id: string;
                    kind: 'comment' | 'review';
                    author: {
                        login: string;
                        avatarUrl: string | null;
                        url: string | null;
                    } | null;
                    body: string | null;
                    state: string | null;
                    createdAt: string;
                    url: string | null;
                }>;
            };
        } | null;
        title: string;
        status: 'open' | 'merged' | 'closed' | 'abandoned';
        reviewState: 'unreviewed' | 'in-review' | 'changes-requested' | 'approved' | 'commented';
        currentRevisionId: string | null;
        createdAt: number;
        updatedAt: number;
        currentRevision: {
            id: string;
            reviewId: string;
            sourceVersion: string;
            patchHash: string;
            fileCount: number;
            additions: number;
            deletions: number;
            generatedAt: number;
            patch: string;
        } | null;
        files: Array<{
            id: string;
            revisionId: string;
            path: string;
            previousPath: string | null;
            status: 'added' | 'modified' | 'deleted' | 'renamed' | 'untracked';
            additions: number;
            deletions: number;
            isGenerated: boolean;
            isBinary: boolean;
            isViewed: boolean;
        }>;
        threads: Array<{
            id: string;
            reviewId: string;
            originalRevisionId: string;
            currentRevisionId: string | null;
            fileId: string | null;
            anchor: {
                revisionId: string;
                fileId: string;
                path: string;
                side: 'base' | 'head';
                startLine: number;
                endLine: number;
                startColumn?: number;
                endColumn?: number;
                hunkHeader: string;
                lineHash: string;
                contextBeforeHash?: string;
                contextAfterHash?: string;
            } | null;
            state: 'open' | 'resolved' | 'stale';
            createdBy: string;
            createdAt: number;
            updatedAt: number;
            resolvedBy: string | null;
            resolvedAt: number | null;
            comments: Array<{
                id: string;
                threadId: string;
                authorKind: 'user' | 'agent' | 'external';
                authorId: string;
                bodyMarkdown: string;
                externalUrl: string | null;
                createdAt: number;
                updatedAt: number;
            }>;
        }>;
        submissions: Array<{
            id: string;
            reviewId: string;
            revisionId: string;
            actorId: string;
            decision: 'approve' | 'request-changes' | 'comment';
            bodyMarkdown: string | null;
            submittedAt: number;
            sourceSyncState: 'local-only' | 'pending' | 'synced' | 'failed';
        }>;
        events: Array<{
            id: string;
            reviewId: string;
            eventKind: string;
            actorKind: 'user' | 'agent' | 'external' | 'system';
            actorId: string | null;
            payload: unknown;
            createdAt: number;
        }>;
        preferences: {
            id: string;
            workspaceId: string;
            userId: string;
            diffStyle: 'split' | 'unified';
            codeTheme: string;
            fontSize: number;
            lineHeight: number;
            hideWhitespaceOnly: boolean;
            structuralHighlighting: boolean;
            collapseGeneratedFiles: boolean;
            notificationMode: 'all-activity' | 'all-activity-by-people' | 'reviews-and-comments' | 'reviews-and-comments-by-people' | 'none';
            createdAt: number;
            updatedAt: number;
        };
        agentFixes: Array<{
            id: string;
            reviewId: string;
            targetRevisionId: string | null;
            threadId: string | null;
            anchor: {
                revisionId: string;
                fileId: string;
                path: string;
                side: 'base' | 'head';
                startLine: number;
                endLine: number;
                startColumn?: number;
                endColumn?: number;
                hunkHeader: string;
                lineHash: string;
                contextBeforeHash?: string;
                contextAfterHash?: string;
            } | null;
            instruction: string;
            profileId: string | null;
            expectedOutput: 'working-tree-change' | 'patch-artifact';
            status: 'pending' | 'running' | 'completed' | 'failed' | 'cancelled';
            sessionId: string | null;
            runId: string | null;
            artifactId: string | null;
            resultRevisionId: string | null;
            errorMessage: string | null;
            createdAt: number;
            updatedAt: number;
        }>;
    };
};

export type PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdThreadsByThreadIdResolveResponse = PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdThreadsByThreadIdResolveResponses[keyof PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdThreadsByThreadIdResolveResponses];

export type PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdSubmitData = {
    body: {
        decision: 'approve' | 'request-changes' | 'comment';
        bodyMarkdown?: string | null;
    };
    path: {
        workspaceId: string;
        reviewId: string;
    };
    query?: never;
    url: '/workspaces/{workspaceId}/diff-reviews/{reviewId}/submit';
};

export type PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdSubmitResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string;
        sourceId: string | null;
        repositoryPath: string;
        sourceKind: 'local-working-tree' | 'local-branch-compare' | 'local-commit' | 'agent-change-set' | 'github-pull-request' | 'external-import';
        githubPullRequest: {
            owner: string;
            repo: string;
            number: string | number;
            detail?: {
                url: string;
                title: string;
                body: string | null;
                isDraft: boolean;
                state: 'open' | 'closed';
                merged: boolean;
                mergeable: boolean | null;
                mergeableState: string;
                headRef: string;
                baseRef: string;
                headSha: string | null;
                author: {
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                } | null;
                reviewers: Array<{
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                }>;
                assignees: Array<{
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                }>;
                labels: Array<{
                    name: string;
                    color: string;
                }>;
                checksState: 'success' | 'failure' | 'pending' | 'neutral';
                checks: Array<{
                    id: string;
                    name: string;
                    status: 'queued' | 'in_progress' | 'completed';
                    conclusion: string | null;
                    url: string | null;
                }>;
                timeline: Array<{
                    id: string;
                    kind: 'comment' | 'review';
                    author: {
                        login: string;
                        avatarUrl: string | null;
                        url: string | null;
                    } | null;
                    body: string | null;
                    state: string | null;
                    createdAt: string;
                    url: string | null;
                }>;
            };
        } | null;
        title: string;
        status: 'open' | 'merged' | 'closed' | 'abandoned';
        reviewState: 'unreviewed' | 'in-review' | 'changes-requested' | 'approved' | 'commented';
        currentRevisionId: string | null;
        createdAt: number;
        updatedAt: number;
        currentRevision: {
            id: string;
            reviewId: string;
            sourceVersion: string;
            patchHash: string;
            fileCount: number;
            additions: number;
            deletions: number;
            generatedAt: number;
            patch: string;
        } | null;
        files: Array<{
            id: string;
            revisionId: string;
            path: string;
            previousPath: string | null;
            status: 'added' | 'modified' | 'deleted' | 'renamed' | 'untracked';
            additions: number;
            deletions: number;
            isGenerated: boolean;
            isBinary: boolean;
            isViewed: boolean;
        }>;
        threads: Array<{
            id: string;
            reviewId: string;
            originalRevisionId: string;
            currentRevisionId: string | null;
            fileId: string | null;
            anchor: {
                revisionId: string;
                fileId: string;
                path: string;
                side: 'base' | 'head';
                startLine: number;
                endLine: number;
                startColumn?: number;
                endColumn?: number;
                hunkHeader: string;
                lineHash: string;
                contextBeforeHash?: string;
                contextAfterHash?: string;
            } | null;
            state: 'open' | 'resolved' | 'stale';
            createdBy: string;
            createdAt: number;
            updatedAt: number;
            resolvedBy: string | null;
            resolvedAt: number | null;
            comments: Array<{
                id: string;
                threadId: string;
                authorKind: 'user' | 'agent' | 'external';
                authorId: string;
                bodyMarkdown: string;
                externalUrl: string | null;
                createdAt: number;
                updatedAt: number;
            }>;
        }>;
        submissions: Array<{
            id: string;
            reviewId: string;
            revisionId: string;
            actorId: string;
            decision: 'approve' | 'request-changes' | 'comment';
            bodyMarkdown: string | null;
            submittedAt: number;
            sourceSyncState: 'local-only' | 'pending' | 'synced' | 'failed';
        }>;
        events: Array<{
            id: string;
            reviewId: string;
            eventKind: string;
            actorKind: 'user' | 'agent' | 'external' | 'system';
            actorId: string | null;
            payload: unknown;
            createdAt: number;
        }>;
        preferences: {
            id: string;
            workspaceId: string;
            userId: string;
            diffStyle: 'split' | 'unified';
            codeTheme: string;
            fontSize: number;
            lineHeight: number;
            hideWhitespaceOnly: boolean;
            structuralHighlighting: boolean;
            collapseGeneratedFiles: boolean;
            notificationMode: 'all-activity' | 'all-activity-by-people' | 'reviews-and-comments' | 'reviews-and-comments-by-people' | 'none';
            createdAt: number;
            updatedAt: number;
        };
        agentFixes: Array<{
            id: string;
            reviewId: string;
            targetRevisionId: string | null;
            threadId: string | null;
            anchor: {
                revisionId: string;
                fileId: string;
                path: string;
                side: 'base' | 'head';
                startLine: number;
                endLine: number;
                startColumn?: number;
                endColumn?: number;
                hunkHeader: string;
                lineHash: string;
                contextBeforeHash?: string;
                contextAfterHash?: string;
            } | null;
            instruction: string;
            profileId: string | null;
            expectedOutput: 'working-tree-change' | 'patch-artifact';
            status: 'pending' | 'running' | 'completed' | 'failed' | 'cancelled';
            sessionId: string | null;
            runId: string | null;
            artifactId: string | null;
            resultRevisionId: string | null;
            errorMessage: string | null;
            createdAt: number;
            updatedAt: number;
        }>;
    };
};

export type PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdSubmitResponse = PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdSubmitResponses[keyof PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdSubmitResponses];

export type PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdMergeData = {
    body: {
        mergeMethod: 'merge' | 'squash' | 'rebase';
    };
    path: {
        workspaceId: string;
        reviewId: string;
    };
    query?: never;
    url: '/workspaces/{workspaceId}/diff-reviews/{reviewId}/merge';
};

export type PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdMergeResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string;
        sourceId: string | null;
        repositoryPath: string;
        sourceKind: 'local-working-tree' | 'local-branch-compare' | 'local-commit' | 'agent-change-set' | 'github-pull-request' | 'external-import';
        githubPullRequest: {
            owner: string;
            repo: string;
            number: string | number;
            detail?: {
                url: string;
                title: string;
                body: string | null;
                isDraft: boolean;
                state: 'open' | 'closed';
                merged: boolean;
                mergeable: boolean | null;
                mergeableState: string;
                headRef: string;
                baseRef: string;
                headSha: string | null;
                author: {
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                } | null;
                reviewers: Array<{
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                }>;
                assignees: Array<{
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                }>;
                labels: Array<{
                    name: string;
                    color: string;
                }>;
                checksState: 'success' | 'failure' | 'pending' | 'neutral';
                checks: Array<{
                    id: string;
                    name: string;
                    status: 'queued' | 'in_progress' | 'completed';
                    conclusion: string | null;
                    url: string | null;
                }>;
                timeline: Array<{
                    id: string;
                    kind: 'comment' | 'review';
                    author: {
                        login: string;
                        avatarUrl: string | null;
                        url: string | null;
                    } | null;
                    body: string | null;
                    state: string | null;
                    createdAt: string;
                    url: string | null;
                }>;
            };
        } | null;
        title: string;
        status: 'open' | 'merged' | 'closed' | 'abandoned';
        reviewState: 'unreviewed' | 'in-review' | 'changes-requested' | 'approved' | 'commented';
        currentRevisionId: string | null;
        createdAt: number;
        updatedAt: number;
        currentRevision: {
            id: string;
            reviewId: string;
            sourceVersion: string;
            patchHash: string;
            fileCount: number;
            additions: number;
            deletions: number;
            generatedAt: number;
            patch: string;
        } | null;
        files: Array<{
            id: string;
            revisionId: string;
            path: string;
            previousPath: string | null;
            status: 'added' | 'modified' | 'deleted' | 'renamed' | 'untracked';
            additions: number;
            deletions: number;
            isGenerated: boolean;
            isBinary: boolean;
            isViewed: boolean;
        }>;
        threads: Array<{
            id: string;
            reviewId: string;
            originalRevisionId: string;
            currentRevisionId: string | null;
            fileId: string | null;
            anchor: {
                revisionId: string;
                fileId: string;
                path: string;
                side: 'base' | 'head';
                startLine: number;
                endLine: number;
                startColumn?: number;
                endColumn?: number;
                hunkHeader: string;
                lineHash: string;
                contextBeforeHash?: string;
                contextAfterHash?: string;
            } | null;
            state: 'open' | 'resolved' | 'stale';
            createdBy: string;
            createdAt: number;
            updatedAt: number;
            resolvedBy: string | null;
            resolvedAt: number | null;
            comments: Array<{
                id: string;
                threadId: string;
                authorKind: 'user' | 'agent' | 'external';
                authorId: string;
                bodyMarkdown: string;
                externalUrl: string | null;
                createdAt: number;
                updatedAt: number;
            }>;
        }>;
        submissions: Array<{
            id: string;
            reviewId: string;
            revisionId: string;
            actorId: string;
            decision: 'approve' | 'request-changes' | 'comment';
            bodyMarkdown: string | null;
            submittedAt: number;
            sourceSyncState: 'local-only' | 'pending' | 'synced' | 'failed';
        }>;
        events: Array<{
            id: string;
            reviewId: string;
            eventKind: string;
            actorKind: 'user' | 'agent' | 'external' | 'system';
            actorId: string | null;
            payload: unknown;
            createdAt: number;
        }>;
        preferences: {
            id: string;
            workspaceId: string;
            userId: string;
            diffStyle: 'split' | 'unified';
            codeTheme: string;
            fontSize: number;
            lineHeight: number;
            hideWhitespaceOnly: boolean;
            structuralHighlighting: boolean;
            collapseGeneratedFiles: boolean;
            notificationMode: 'all-activity' | 'all-activity-by-people' | 'reviews-and-comments' | 'reviews-and-comments-by-people' | 'none';
            createdAt: number;
            updatedAt: number;
        };
        agentFixes: Array<{
            id: string;
            reviewId: string;
            targetRevisionId: string | null;
            threadId: string | null;
            anchor: {
                revisionId: string;
                fileId: string;
                path: string;
                side: 'base' | 'head';
                startLine: number;
                endLine: number;
                startColumn?: number;
                endColumn?: number;
                hunkHeader: string;
                lineHash: string;
                contextBeforeHash?: string;
                contextAfterHash?: string;
            } | null;
            instruction: string;
            profileId: string | null;
            expectedOutput: 'working-tree-change' | 'patch-artifact';
            status: 'pending' | 'running' | 'completed' | 'failed' | 'cancelled';
            sessionId: string | null;
            runId: string | null;
            artifactId: string | null;
            resultRevisionId: string | null;
            errorMessage: string | null;
            createdAt: number;
            updatedAt: number;
        }>;
    };
};

export type PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdMergeResponse = PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdMergeResponses[keyof PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdMergeResponses];

export type PutWorkspacesByWorkspaceIdDiffReviewsPreferencesData = {
    body: {
        diffStyle?: 'split' | 'unified';
        codeTheme?: string;
        fontSize?: number;
        lineHeight?: number;
        hideWhitespaceOnly?: boolean;
        structuralHighlighting?: boolean;
        collapseGeneratedFiles?: boolean;
        notificationMode?: 'all-activity' | 'all-activity-by-people' | 'reviews-and-comments' | 'reviews-and-comments-by-people' | 'none';
    };
    path: {
        workspaceId: string;
    };
    query?: never;
    url: '/workspaces/{workspaceId}/diff-reviews/preferences';
};

export type PutWorkspacesByWorkspaceIdDiffReviewsPreferencesResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string;
        userId: string;
        diffStyle: 'split' | 'unified';
        codeTheme: string;
        fontSize: number;
        lineHeight: number;
        hideWhitespaceOnly: boolean;
        structuralHighlighting: boolean;
        collapseGeneratedFiles: boolean;
        notificationMode: 'all-activity' | 'all-activity-by-people' | 'reviews-and-comments' | 'reviews-and-comments-by-people' | 'none';
        createdAt: number;
        updatedAt: number;
    };
};

export type PutWorkspacesByWorkspaceIdDiffReviewsPreferencesResponse = PutWorkspacesByWorkspaceIdDiffReviewsPreferencesResponses[keyof PutWorkspacesByWorkspaceIdDiffReviewsPreferencesResponses];

export type PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdAgentFixesData = {
    body: {
        threadId?: string | null;
        anchor?: {
            fileId: string;
            side?: 'base' | 'head';
            startLine: number;
            endLine?: number;
            startColumn?: number;
            endColumn?: number;
        } | null;
        instruction: string;
        agentId?: string | null;
        expectedOutput: 'working-tree-change' | 'patch-artifact';
    };
    path: {
        workspaceId: string;
        reviewId: string;
    };
    query?: never;
    url: '/workspaces/{workspaceId}/diff-reviews/{reviewId}/agent-fixes';
};

export type PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdAgentFixesResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string;
        sourceId: string | null;
        repositoryPath: string;
        sourceKind: 'local-working-tree' | 'local-branch-compare' | 'local-commit' | 'agent-change-set' | 'github-pull-request' | 'external-import';
        githubPullRequest: {
            owner: string;
            repo: string;
            number: string | number;
            detail?: {
                url: string;
                title: string;
                body: string | null;
                isDraft: boolean;
                state: 'open' | 'closed';
                merged: boolean;
                mergeable: boolean | null;
                mergeableState: string;
                headRef: string;
                baseRef: string;
                headSha: string | null;
                author: {
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                } | null;
                reviewers: Array<{
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                }>;
                assignees: Array<{
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                }>;
                labels: Array<{
                    name: string;
                    color: string;
                }>;
                checksState: 'success' | 'failure' | 'pending' | 'neutral';
                checks: Array<{
                    id: string;
                    name: string;
                    status: 'queued' | 'in_progress' | 'completed';
                    conclusion: string | null;
                    url: string | null;
                }>;
                timeline: Array<{
                    id: string;
                    kind: 'comment' | 'review';
                    author: {
                        login: string;
                        avatarUrl: string | null;
                        url: string | null;
                    } | null;
                    body: string | null;
                    state: string | null;
                    createdAt: string;
                    url: string | null;
                }>;
            };
        } | null;
        title: string;
        status: 'open' | 'merged' | 'closed' | 'abandoned';
        reviewState: 'unreviewed' | 'in-review' | 'changes-requested' | 'approved' | 'commented';
        currentRevisionId: string | null;
        createdAt: number;
        updatedAt: number;
        currentRevision: {
            id: string;
            reviewId: string;
            sourceVersion: string;
            patchHash: string;
            fileCount: number;
            additions: number;
            deletions: number;
            generatedAt: number;
            patch: string;
        } | null;
        files: Array<{
            id: string;
            revisionId: string;
            path: string;
            previousPath: string | null;
            status: 'added' | 'modified' | 'deleted' | 'renamed' | 'untracked';
            additions: number;
            deletions: number;
            isGenerated: boolean;
            isBinary: boolean;
            isViewed: boolean;
        }>;
        threads: Array<{
            id: string;
            reviewId: string;
            originalRevisionId: string;
            currentRevisionId: string | null;
            fileId: string | null;
            anchor: {
                revisionId: string;
                fileId: string;
                path: string;
                side: 'base' | 'head';
                startLine: number;
                endLine: number;
                startColumn?: number;
                endColumn?: number;
                hunkHeader: string;
                lineHash: string;
                contextBeforeHash?: string;
                contextAfterHash?: string;
            } | null;
            state: 'open' | 'resolved' | 'stale';
            createdBy: string;
            createdAt: number;
            updatedAt: number;
            resolvedBy: string | null;
            resolvedAt: number | null;
            comments: Array<{
                id: string;
                threadId: string;
                authorKind: 'user' | 'agent' | 'external';
                authorId: string;
                bodyMarkdown: string;
                externalUrl: string | null;
                createdAt: number;
                updatedAt: number;
            }>;
        }>;
        submissions: Array<{
            id: string;
            reviewId: string;
            revisionId: string;
            actorId: string;
            decision: 'approve' | 'request-changes' | 'comment';
            bodyMarkdown: string | null;
            submittedAt: number;
            sourceSyncState: 'local-only' | 'pending' | 'synced' | 'failed';
        }>;
        events: Array<{
            id: string;
            reviewId: string;
            eventKind: string;
            actorKind: 'user' | 'agent' | 'external' | 'system';
            actorId: string | null;
            payload: unknown;
            createdAt: number;
        }>;
        preferences: {
            id: string;
            workspaceId: string;
            userId: string;
            diffStyle: 'split' | 'unified';
            codeTheme: string;
            fontSize: number;
            lineHeight: number;
            hideWhitespaceOnly: boolean;
            structuralHighlighting: boolean;
            collapseGeneratedFiles: boolean;
            notificationMode: 'all-activity' | 'all-activity-by-people' | 'reviews-and-comments' | 'reviews-and-comments-by-people' | 'none';
            createdAt: number;
            updatedAt: number;
        };
        agentFixes: Array<{
            id: string;
            reviewId: string;
            targetRevisionId: string | null;
            threadId: string | null;
            anchor: {
                revisionId: string;
                fileId: string;
                path: string;
                side: 'base' | 'head';
                startLine: number;
                endLine: number;
                startColumn?: number;
                endColumn?: number;
                hunkHeader: string;
                lineHash: string;
                contextBeforeHash?: string;
                contextAfterHash?: string;
            } | null;
            instruction: string;
            profileId: string | null;
            expectedOutput: 'working-tree-change' | 'patch-artifact';
            status: 'pending' | 'running' | 'completed' | 'failed' | 'cancelled';
            sessionId: string | null;
            runId: string | null;
            artifactId: string | null;
            resultRevisionId: string | null;
            errorMessage: string | null;
            createdAt: number;
            updatedAt: number;
        }>;
    };
};

export type PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdAgentFixesResponse = PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdAgentFixesResponses[keyof PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdAgentFixesResponses];

export type PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdAgentFixesByAgentFixIdStartData = {
    body: {
        agentId?: string | null;
        providerTargetId?: string | null;
        runtimeKind?: string | null;
        modelId?: string | null;
        outputLocale?: 'en-US' | 'zh-CN' | 'ja-JP' | 'es-ES' | null;
    };
    path: {
        workspaceId: string;
        reviewId: string;
        agentFixId: string;
    };
    query?: never;
    url: '/workspaces/{workspaceId}/diff-reviews/{reviewId}/agent-fixes/{agentFixId}/start';
};

export type PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdAgentFixesByAgentFixIdStartResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string;
        sourceId: string | null;
        repositoryPath: string;
        sourceKind: 'local-working-tree' | 'local-branch-compare' | 'local-commit' | 'agent-change-set' | 'github-pull-request' | 'external-import';
        githubPullRequest: {
            owner: string;
            repo: string;
            number: string | number;
            detail?: {
                url: string;
                title: string;
                body: string | null;
                isDraft: boolean;
                state: 'open' | 'closed';
                merged: boolean;
                mergeable: boolean | null;
                mergeableState: string;
                headRef: string;
                baseRef: string;
                headSha: string | null;
                author: {
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                } | null;
                reviewers: Array<{
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                }>;
                assignees: Array<{
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                }>;
                labels: Array<{
                    name: string;
                    color: string;
                }>;
                checksState: 'success' | 'failure' | 'pending' | 'neutral';
                checks: Array<{
                    id: string;
                    name: string;
                    status: 'queued' | 'in_progress' | 'completed';
                    conclusion: string | null;
                    url: string | null;
                }>;
                timeline: Array<{
                    id: string;
                    kind: 'comment' | 'review';
                    author: {
                        login: string;
                        avatarUrl: string | null;
                        url: string | null;
                    } | null;
                    body: string | null;
                    state: string | null;
                    createdAt: string;
                    url: string | null;
                }>;
            };
        } | null;
        title: string;
        status: 'open' | 'merged' | 'closed' | 'abandoned';
        reviewState: 'unreviewed' | 'in-review' | 'changes-requested' | 'approved' | 'commented';
        currentRevisionId: string | null;
        createdAt: number;
        updatedAt: number;
        currentRevision: {
            id: string;
            reviewId: string;
            sourceVersion: string;
            patchHash: string;
            fileCount: number;
            additions: number;
            deletions: number;
            generatedAt: number;
            patch: string;
        } | null;
        files: Array<{
            id: string;
            revisionId: string;
            path: string;
            previousPath: string | null;
            status: 'added' | 'modified' | 'deleted' | 'renamed' | 'untracked';
            additions: number;
            deletions: number;
            isGenerated: boolean;
            isBinary: boolean;
            isViewed: boolean;
        }>;
        threads: Array<{
            id: string;
            reviewId: string;
            originalRevisionId: string;
            currentRevisionId: string | null;
            fileId: string | null;
            anchor: {
                revisionId: string;
                fileId: string;
                path: string;
                side: 'base' | 'head';
                startLine: number;
                endLine: number;
                startColumn?: number;
                endColumn?: number;
                hunkHeader: string;
                lineHash: string;
                contextBeforeHash?: string;
                contextAfterHash?: string;
            } | null;
            state: 'open' | 'resolved' | 'stale';
            createdBy: string;
            createdAt: number;
            updatedAt: number;
            resolvedBy: string | null;
            resolvedAt: number | null;
            comments: Array<{
                id: string;
                threadId: string;
                authorKind: 'user' | 'agent' | 'external';
                authorId: string;
                bodyMarkdown: string;
                externalUrl: string | null;
                createdAt: number;
                updatedAt: number;
            }>;
        }>;
        submissions: Array<{
            id: string;
            reviewId: string;
            revisionId: string;
            actorId: string;
            decision: 'approve' | 'request-changes' | 'comment';
            bodyMarkdown: string | null;
            submittedAt: number;
            sourceSyncState: 'local-only' | 'pending' | 'synced' | 'failed';
        }>;
        events: Array<{
            id: string;
            reviewId: string;
            eventKind: string;
            actorKind: 'user' | 'agent' | 'external' | 'system';
            actorId: string | null;
            payload: unknown;
            createdAt: number;
        }>;
        preferences: {
            id: string;
            workspaceId: string;
            userId: string;
            diffStyle: 'split' | 'unified';
            codeTheme: string;
            fontSize: number;
            lineHeight: number;
            hideWhitespaceOnly: boolean;
            structuralHighlighting: boolean;
            collapseGeneratedFiles: boolean;
            notificationMode: 'all-activity' | 'all-activity-by-people' | 'reviews-and-comments' | 'reviews-and-comments-by-people' | 'none';
            createdAt: number;
            updatedAt: number;
        };
        agentFixes: Array<{
            id: string;
            reviewId: string;
            targetRevisionId: string | null;
            threadId: string | null;
            anchor: {
                revisionId: string;
                fileId: string;
                path: string;
                side: 'base' | 'head';
                startLine: number;
                endLine: number;
                startColumn?: number;
                endColumn?: number;
                hunkHeader: string;
                lineHash: string;
                contextBeforeHash?: string;
                contextAfterHash?: string;
            } | null;
            instruction: string;
            profileId: string | null;
            expectedOutput: 'working-tree-change' | 'patch-artifact';
            status: 'pending' | 'running' | 'completed' | 'failed' | 'cancelled';
            sessionId: string | null;
            runId: string | null;
            artifactId: string | null;
            resultRevisionId: string | null;
            errorMessage: string | null;
            createdAt: number;
            updatedAt: number;
        }>;
    };
};

export type PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdAgentFixesByAgentFixIdStartResponse = PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdAgentFixesByAgentFixIdStartResponses[keyof PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdAgentFixesByAgentFixIdStartResponses];

export type GetWorkspacesByWorkspaceIdDiffReviewsByReviewIdAgentFixesByAgentFixIdArtifactData = {
    body?: never;
    path: {
        workspaceId: string;
        reviewId: string;
        agentFixId: string;
    };
    query?: never;
    url: '/workspaces/{workspaceId}/diff-reviews/{reviewId}/agent-fixes/{agentFixId}/artifact';
};

export type GetWorkspacesByWorkspaceIdDiffReviewsByReviewIdAgentFixesByAgentFixIdArtifactResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        reviewId: string;
        agentFixId: string;
        sessionId: string;
        runId: string;
        kind: 'patch' | 'assistant-summary';
        mimeType: string;
        content: string;
        contentHash: string;
        createdAt: number;
    };
};

export type GetWorkspacesByWorkspaceIdDiffReviewsByReviewIdAgentFixesByAgentFixIdArtifactResponse = GetWorkspacesByWorkspaceIdDiffReviewsByReviewIdAgentFixesByAgentFixIdArtifactResponses[keyof GetWorkspacesByWorkspaceIdDiffReviewsByReviewIdAgentFixesByAgentFixIdArtifactResponses];

export type PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdAgentFixesByAgentFixIdCancelData = {
    body: {
        [key: string]: never;
    };
    path: {
        workspaceId: string;
        reviewId: string;
        agentFixId: string;
    };
    query?: never;
    url: '/workspaces/{workspaceId}/diff-reviews/{reviewId}/agent-fixes/{agentFixId}/cancel';
};

export type PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdAgentFixesByAgentFixIdCancelResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string;
        sourceId: string | null;
        repositoryPath: string;
        sourceKind: 'local-working-tree' | 'local-branch-compare' | 'local-commit' | 'agent-change-set' | 'github-pull-request' | 'external-import';
        githubPullRequest: {
            owner: string;
            repo: string;
            number: string | number;
            detail?: {
                url: string;
                title: string;
                body: string | null;
                isDraft: boolean;
                state: 'open' | 'closed';
                merged: boolean;
                mergeable: boolean | null;
                mergeableState: string;
                headRef: string;
                baseRef: string;
                headSha: string | null;
                author: {
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                } | null;
                reviewers: Array<{
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                }>;
                assignees: Array<{
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                }>;
                labels: Array<{
                    name: string;
                    color: string;
                }>;
                checksState: 'success' | 'failure' | 'pending' | 'neutral';
                checks: Array<{
                    id: string;
                    name: string;
                    status: 'queued' | 'in_progress' | 'completed';
                    conclusion: string | null;
                    url: string | null;
                }>;
                timeline: Array<{
                    id: string;
                    kind: 'comment' | 'review';
                    author: {
                        login: string;
                        avatarUrl: string | null;
                        url: string | null;
                    } | null;
                    body: string | null;
                    state: string | null;
                    createdAt: string;
                    url: string | null;
                }>;
            };
        } | null;
        title: string;
        status: 'open' | 'merged' | 'closed' | 'abandoned';
        reviewState: 'unreviewed' | 'in-review' | 'changes-requested' | 'approved' | 'commented';
        currentRevisionId: string | null;
        createdAt: number;
        updatedAt: number;
        currentRevision: {
            id: string;
            reviewId: string;
            sourceVersion: string;
            patchHash: string;
            fileCount: number;
            additions: number;
            deletions: number;
            generatedAt: number;
            patch: string;
        } | null;
        files: Array<{
            id: string;
            revisionId: string;
            path: string;
            previousPath: string | null;
            status: 'added' | 'modified' | 'deleted' | 'renamed' | 'untracked';
            additions: number;
            deletions: number;
            isGenerated: boolean;
            isBinary: boolean;
            isViewed: boolean;
        }>;
        threads: Array<{
            id: string;
            reviewId: string;
            originalRevisionId: string;
            currentRevisionId: string | null;
            fileId: string | null;
            anchor: {
                revisionId: string;
                fileId: string;
                path: string;
                side: 'base' | 'head';
                startLine: number;
                endLine: number;
                startColumn?: number;
                endColumn?: number;
                hunkHeader: string;
                lineHash: string;
                contextBeforeHash?: string;
                contextAfterHash?: string;
            } | null;
            state: 'open' | 'resolved' | 'stale';
            createdBy: string;
            createdAt: number;
            updatedAt: number;
            resolvedBy: string | null;
            resolvedAt: number | null;
            comments: Array<{
                id: string;
                threadId: string;
                authorKind: 'user' | 'agent' | 'external';
                authorId: string;
                bodyMarkdown: string;
                externalUrl: string | null;
                createdAt: number;
                updatedAt: number;
            }>;
        }>;
        submissions: Array<{
            id: string;
            reviewId: string;
            revisionId: string;
            actorId: string;
            decision: 'approve' | 'request-changes' | 'comment';
            bodyMarkdown: string | null;
            submittedAt: number;
            sourceSyncState: 'local-only' | 'pending' | 'synced' | 'failed';
        }>;
        events: Array<{
            id: string;
            reviewId: string;
            eventKind: string;
            actorKind: 'user' | 'agent' | 'external' | 'system';
            actorId: string | null;
            payload: unknown;
            createdAt: number;
        }>;
        preferences: {
            id: string;
            workspaceId: string;
            userId: string;
            diffStyle: 'split' | 'unified';
            codeTheme: string;
            fontSize: number;
            lineHeight: number;
            hideWhitespaceOnly: boolean;
            structuralHighlighting: boolean;
            collapseGeneratedFiles: boolean;
            notificationMode: 'all-activity' | 'all-activity-by-people' | 'reviews-and-comments' | 'reviews-and-comments-by-people' | 'none';
            createdAt: number;
            updatedAt: number;
        };
        agentFixes: Array<{
            id: string;
            reviewId: string;
            targetRevisionId: string | null;
            threadId: string | null;
            anchor: {
                revisionId: string;
                fileId: string;
                path: string;
                side: 'base' | 'head';
                startLine: number;
                endLine: number;
                startColumn?: number;
                endColumn?: number;
                hunkHeader: string;
                lineHash: string;
                contextBeforeHash?: string;
                contextAfterHash?: string;
            } | null;
            instruction: string;
            profileId: string | null;
            expectedOutput: 'working-tree-change' | 'patch-artifact';
            status: 'pending' | 'running' | 'completed' | 'failed' | 'cancelled';
            sessionId: string | null;
            runId: string | null;
            artifactId: string | null;
            resultRevisionId: string | null;
            errorMessage: string | null;
            createdAt: number;
            updatedAt: number;
        }>;
    };
};

export type PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdAgentFixesByAgentFixIdCancelResponse = PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdAgentFixesByAgentFixIdCancelResponses[keyof PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdAgentFixesByAgentFixIdCancelResponses];

export type PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdAgentFixesByAgentFixIdRerunData = {
    body: {
        agentId?: string | null;
        providerTargetId?: string | null;
        runtimeKind?: string | null;
        modelId?: string | null;
        outputLocale?: 'en-US' | 'zh-CN' | 'ja-JP' | 'es-ES' | null;
    };
    path: {
        workspaceId: string;
        reviewId: string;
        agentFixId: string;
    };
    query?: never;
    url: '/workspaces/{workspaceId}/diff-reviews/{reviewId}/agent-fixes/{agentFixId}/rerun';
};

export type PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdAgentFixesByAgentFixIdRerunResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string;
        sourceId: string | null;
        repositoryPath: string;
        sourceKind: 'local-working-tree' | 'local-branch-compare' | 'local-commit' | 'agent-change-set' | 'github-pull-request' | 'external-import';
        githubPullRequest: {
            owner: string;
            repo: string;
            number: string | number;
            detail?: {
                url: string;
                title: string;
                body: string | null;
                isDraft: boolean;
                state: 'open' | 'closed';
                merged: boolean;
                mergeable: boolean | null;
                mergeableState: string;
                headRef: string;
                baseRef: string;
                headSha: string | null;
                author: {
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                } | null;
                reviewers: Array<{
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                }>;
                assignees: Array<{
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                }>;
                labels: Array<{
                    name: string;
                    color: string;
                }>;
                checksState: 'success' | 'failure' | 'pending' | 'neutral';
                checks: Array<{
                    id: string;
                    name: string;
                    status: 'queued' | 'in_progress' | 'completed';
                    conclusion: string | null;
                    url: string | null;
                }>;
                timeline: Array<{
                    id: string;
                    kind: 'comment' | 'review';
                    author: {
                        login: string;
                        avatarUrl: string | null;
                        url: string | null;
                    } | null;
                    body: string | null;
                    state: string | null;
                    createdAt: string;
                    url: string | null;
                }>;
            };
        } | null;
        title: string;
        status: 'open' | 'merged' | 'closed' | 'abandoned';
        reviewState: 'unreviewed' | 'in-review' | 'changes-requested' | 'approved' | 'commented';
        currentRevisionId: string | null;
        createdAt: number;
        updatedAt: number;
        currentRevision: {
            id: string;
            reviewId: string;
            sourceVersion: string;
            patchHash: string;
            fileCount: number;
            additions: number;
            deletions: number;
            generatedAt: number;
            patch: string;
        } | null;
        files: Array<{
            id: string;
            revisionId: string;
            path: string;
            previousPath: string | null;
            status: 'added' | 'modified' | 'deleted' | 'renamed' | 'untracked';
            additions: number;
            deletions: number;
            isGenerated: boolean;
            isBinary: boolean;
            isViewed: boolean;
        }>;
        threads: Array<{
            id: string;
            reviewId: string;
            originalRevisionId: string;
            currentRevisionId: string | null;
            fileId: string | null;
            anchor: {
                revisionId: string;
                fileId: string;
                path: string;
                side: 'base' | 'head';
                startLine: number;
                endLine: number;
                startColumn?: number;
                endColumn?: number;
                hunkHeader: string;
                lineHash: string;
                contextBeforeHash?: string;
                contextAfterHash?: string;
            } | null;
            state: 'open' | 'resolved' | 'stale';
            createdBy: string;
            createdAt: number;
            updatedAt: number;
            resolvedBy: string | null;
            resolvedAt: number | null;
            comments: Array<{
                id: string;
                threadId: string;
                authorKind: 'user' | 'agent' | 'external';
                authorId: string;
                bodyMarkdown: string;
                externalUrl: string | null;
                createdAt: number;
                updatedAt: number;
            }>;
        }>;
        submissions: Array<{
            id: string;
            reviewId: string;
            revisionId: string;
            actorId: string;
            decision: 'approve' | 'request-changes' | 'comment';
            bodyMarkdown: string | null;
            submittedAt: number;
            sourceSyncState: 'local-only' | 'pending' | 'synced' | 'failed';
        }>;
        events: Array<{
            id: string;
            reviewId: string;
            eventKind: string;
            actorKind: 'user' | 'agent' | 'external' | 'system';
            actorId: string | null;
            payload: unknown;
            createdAt: number;
        }>;
        preferences: {
            id: string;
            workspaceId: string;
            userId: string;
            diffStyle: 'split' | 'unified';
            codeTheme: string;
            fontSize: number;
            lineHeight: number;
            hideWhitespaceOnly: boolean;
            structuralHighlighting: boolean;
            collapseGeneratedFiles: boolean;
            notificationMode: 'all-activity' | 'all-activity-by-people' | 'reviews-and-comments' | 'reviews-and-comments-by-people' | 'none';
            createdAt: number;
            updatedAt: number;
        };
        agentFixes: Array<{
            id: string;
            reviewId: string;
            targetRevisionId: string | null;
            threadId: string | null;
            anchor: {
                revisionId: string;
                fileId: string;
                path: string;
                side: 'base' | 'head';
                startLine: number;
                endLine: number;
                startColumn?: number;
                endColumn?: number;
                hunkHeader: string;
                lineHash: string;
                contextBeforeHash?: string;
                contextAfterHash?: string;
            } | null;
            instruction: string;
            profileId: string | null;
            expectedOutput: 'working-tree-change' | 'patch-artifact';
            status: 'pending' | 'running' | 'completed' | 'failed' | 'cancelled';
            sessionId: string | null;
            runId: string | null;
            artifactId: string | null;
            resultRevisionId: string | null;
            errorMessage: string | null;
            createdAt: number;
            updatedAt: number;
        }>;
    };
};

export type PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdAgentFixesByAgentFixIdRerunResponse = PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdAgentFixesByAgentFixIdRerunResponses[keyof PostWorkspacesByWorkspaceIdDiffReviewsByReviewIdAgentFixesByAgentFixIdRerunResponses];

export type DeleteWorkspacesByWorkspaceIdDiffReviewsByReviewIdAgentFixesByAgentFixIdData = {
    body?: never;
    path: {
        workspaceId: string;
        reviewId: string;
        agentFixId: string;
    };
    query?: never;
    url: '/workspaces/{workspaceId}/diff-reviews/{reviewId}/agent-fixes/{agentFixId}';
};

export type DeleteWorkspacesByWorkspaceIdDiffReviewsByReviewIdAgentFixesByAgentFixIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string;
        sourceId: string | null;
        repositoryPath: string;
        sourceKind: 'local-working-tree' | 'local-branch-compare' | 'local-commit' | 'agent-change-set' | 'github-pull-request' | 'external-import';
        githubPullRequest: {
            owner: string;
            repo: string;
            number: string | number;
            detail?: {
                url: string;
                title: string;
                body: string | null;
                isDraft: boolean;
                state: 'open' | 'closed';
                merged: boolean;
                mergeable: boolean | null;
                mergeableState: string;
                headRef: string;
                baseRef: string;
                headSha: string | null;
                author: {
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                } | null;
                reviewers: Array<{
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                }>;
                assignees: Array<{
                    login: string;
                    avatarUrl: string | null;
                    url: string | null;
                }>;
                labels: Array<{
                    name: string;
                    color: string;
                }>;
                checksState: 'success' | 'failure' | 'pending' | 'neutral';
                checks: Array<{
                    id: string;
                    name: string;
                    status: 'queued' | 'in_progress' | 'completed';
                    conclusion: string | null;
                    url: string | null;
                }>;
                timeline: Array<{
                    id: string;
                    kind: 'comment' | 'review';
                    author: {
                        login: string;
                        avatarUrl: string | null;
                        url: string | null;
                    } | null;
                    body: string | null;
                    state: string | null;
                    createdAt: string;
                    url: string | null;
                }>;
            };
        } | null;
        title: string;
        status: 'open' | 'merged' | 'closed' | 'abandoned';
        reviewState: 'unreviewed' | 'in-review' | 'changes-requested' | 'approved' | 'commented';
        currentRevisionId: string | null;
        createdAt: number;
        updatedAt: number;
        currentRevision: {
            id: string;
            reviewId: string;
            sourceVersion: string;
            patchHash: string;
            fileCount: number;
            additions: number;
            deletions: number;
            generatedAt: number;
            patch: string;
        } | null;
        files: Array<{
            id: string;
            revisionId: string;
            path: string;
            previousPath: string | null;
            status: 'added' | 'modified' | 'deleted' | 'renamed' | 'untracked';
            additions: number;
            deletions: number;
            isGenerated: boolean;
            isBinary: boolean;
            isViewed: boolean;
        }>;
        threads: Array<{
            id: string;
            reviewId: string;
            originalRevisionId: string;
            currentRevisionId: string | null;
            fileId: string | null;
            anchor: {
                revisionId: string;
                fileId: string;
                path: string;
                side: 'base' | 'head';
                startLine: number;
                endLine: number;
                startColumn?: number;
                endColumn?: number;
                hunkHeader: string;
                lineHash: string;
                contextBeforeHash?: string;
                contextAfterHash?: string;
            } | null;
            state: 'open' | 'resolved' | 'stale';
            createdBy: string;
            createdAt: number;
            updatedAt: number;
            resolvedBy: string | null;
            resolvedAt: number | null;
            comments: Array<{
                id: string;
                threadId: string;
                authorKind: 'user' | 'agent' | 'external';
                authorId: string;
                bodyMarkdown: string;
                externalUrl: string | null;
                createdAt: number;
                updatedAt: number;
            }>;
        }>;
        submissions: Array<{
            id: string;
            reviewId: string;
            revisionId: string;
            actorId: string;
            decision: 'approve' | 'request-changes' | 'comment';
            bodyMarkdown: string | null;
            submittedAt: number;
            sourceSyncState: 'local-only' | 'pending' | 'synced' | 'failed';
        }>;
        events: Array<{
            id: string;
            reviewId: string;
            eventKind: string;
            actorKind: 'user' | 'agent' | 'external' | 'system';
            actorId: string | null;
            payload: unknown;
            createdAt: number;
        }>;
        preferences: {
            id: string;
            workspaceId: string;
            userId: string;
            diffStyle: 'split' | 'unified';
            codeTheme: string;
            fontSize: number;
            lineHeight: number;
            hideWhitespaceOnly: boolean;
            structuralHighlighting: boolean;
            collapseGeneratedFiles: boolean;
            notificationMode: 'all-activity' | 'all-activity-by-people' | 'reviews-and-comments' | 'reviews-and-comments-by-people' | 'none';
            createdAt: number;
            updatedAt: number;
        };
        agentFixes: Array<{
            id: string;
            reviewId: string;
            targetRevisionId: string | null;
            threadId: string | null;
            anchor: {
                revisionId: string;
                fileId: string;
                path: string;
                side: 'base' | 'head';
                startLine: number;
                endLine: number;
                startColumn?: number;
                endColumn?: number;
                hunkHeader: string;
                lineHash: string;
                contextBeforeHash?: string;
                contextAfterHash?: string;
            } | null;
            instruction: string;
            profileId: string | null;
            expectedOutput: 'working-tree-change' | 'patch-artifact';
            status: 'pending' | 'running' | 'completed' | 'failed' | 'cancelled';
            sessionId: string | null;
            runId: string | null;
            artifactId: string | null;
            resultRevisionId: string | null;
            errorMessage: string | null;
            createdAt: number;
            updatedAt: number;
        }>;
    };
};

export type DeleteWorkspacesByWorkspaceIdDiffReviewsByReviewIdAgentFixesByAgentFixIdResponse = DeleteWorkspacesByWorkspaceIdDiffReviewsByReviewIdAgentFixesByAgentFixIdResponses[keyof DeleteWorkspacesByWorkspaceIdDiffReviewsByReviewIdAgentFixesByAgentFixIdResponses];

export type GetAcpRegistryData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/acp/registry';
};

export type GetAcpRegistryResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        name: string;
        version: string;
        description: string | null;
        repository?: string | null;
        website?: string | null;
        authors?: Array<string>;
        license?: string | null;
        icon?: string | null;
        distribution: {
            binary?: unknown;
            npx?: unknown;
            uvx?: unknown;
        };
    }>;
};

export type GetAcpRegistryResponse = GetAcpRegistryResponses[keyof GetAcpRegistryResponses];

export type GetAcpRegistryByAgentIdDistributionTypesData = {
    body?: never;
    path: {
        agentId: string;
    };
    query?: never;
    url: '/acp/registry/{agentId}/distribution-types';
};

export type GetAcpRegistryByAgentIdDistributionTypesResponses = {
    /**
     * Response for status 200
     */
    200: {
        agentId: string;
        types: Array<string>;
    };
};

export type GetAcpRegistryByAgentIdDistributionTypesResponse = GetAcpRegistryByAgentIdDistributionTypesResponses[keyof GetAcpRegistryByAgentIdDistributionTypesResponses];

export type GetAcpAgentsData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/acp/agents';
};

export type GetAcpAgentsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        name: string;
        version: string | null;
        source: string;
        distributionType: string;
        installPath: string | null;
        cmd: string | null;
        args: string | null;
        env: string | null;
        overrideCmd: string | null;
        overrideArgs: string | null;
        overrideEnv: string | null;
        status: string;
        createdAt: number;
        updatedAt: number;
    }>;
};

export type GetAcpAgentsResponse = GetAcpAgentsResponses[keyof GetAcpAgentsResponses];

export type PostAcpAgentsData = {
    body: {
        id?: string;
        name: string;
        cmd: string;
        args?: Array<string>;
        env?: {
            [key: string]: unknown;
        };
        distributionType?: 'command' | 'npx' | 'uvx';
        version?: string;
    };
    path?: never;
    query?: never;
    url: '/acp/agents';
};

export type PostAcpAgentsResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        name: string;
        version: string | null;
        source: string;
        distributionType: string;
        installPath: string | null;
        cmd: string | null;
        args: string | null;
        env: string | null;
        overrideCmd: string | null;
        overrideArgs: string | null;
        overrideEnv: string | null;
        status: string;
        createdAt: number;
        updatedAt: number;
    };
};

export type PostAcpAgentsResponse = PostAcpAgentsResponses[keyof PostAcpAgentsResponses];

export type DeleteAcpAgentsByAgentIdData = {
    body?: never;
    path: {
        agentId: string;
    };
    query?: never;
    url: '/acp/agents/{agentId}';
};

export type DeleteAcpAgentsByAgentIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type DeleteAcpAgentsByAgentIdResponse = DeleteAcpAgentsByAgentIdResponses[keyof DeleteAcpAgentsByAgentIdResponses];

export type GetAcpAgentsByAgentIdData = {
    body?: never;
    path: {
        agentId: string;
    };
    query?: never;
    url: '/acp/agents/{agentId}';
};

export type GetAcpAgentsByAgentIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        name: string;
        version: string | null;
        source: string;
        distributionType: string;
        installPath: string | null;
        cmd: string | null;
        args: string | null;
        env: string | null;
        overrideCmd: string | null;
        overrideArgs: string | null;
        overrideEnv: string | null;
        status: string;
        createdAt: number;
        updatedAt: number;
    };
};

export type GetAcpAgentsByAgentIdResponse = GetAcpAgentsByAgentIdResponses[keyof GetAcpAgentsByAgentIdResponses];

export type PatchAcpAgentsByAgentIdLaunchConfigData = {
    body: {
        name?: string;
        overrideCmd?: string | null;
        overrideArgs?: Array<string> | null;
        overrideEnv?: {
            [key: string]: unknown;
        } | null;
        cmd?: string;
        args?: Array<string>;
        env?: {
            [key: string]: unknown;
        };
        distributionType?: 'command' | 'npx' | 'uvx';
        version?: string;
    };
    path: {
        agentId: string;
    };
    query?: never;
    url: '/acp/agents/{agentId}/launch-config';
};

export type PatchAcpAgentsByAgentIdLaunchConfigResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        name: string;
        version: string | null;
        source: string;
        distributionType: string;
        installPath: string | null;
        cmd: string | null;
        args: string | null;
        env: string | null;
        overrideCmd: string | null;
        overrideArgs: string | null;
        overrideEnv: string | null;
        status: string;
        createdAt: number;
        updatedAt: number;
    };
};

export type PatchAcpAgentsByAgentIdLaunchConfigResponse = PatchAcpAgentsByAgentIdLaunchConfigResponses[keyof PatchAcpAgentsByAgentIdLaunchConfigResponses];

export type PostAcpAgentsByAgentIdDraftSessionData = {
    body: {
        workspaceId?: string;
    };
    path: {
        agentId: string;
    };
    query?: never;
    url: '/acp/agents/{agentId}/draft-session';
};

export type PostAcpAgentsByAgentIdDraftSessionResponses = {
    /**
     * Response for status 200
     */
    200: {
        sessionId: string;
        selectedModelId: string | null;
        models: Array<{
            id: string;
            label: string;
        }>;
    };
};

export type PostAcpAgentsByAgentIdDraftSessionResponse = PostAcpAgentsByAgentIdDraftSessionResponses[keyof PostAcpAgentsByAgentIdDraftSessionResponses];

export type DeleteAcpAgentsByAgentIdInstallationData = {
    body?: never;
    path: {
        agentId: string;
    };
    query?: never;
    url: '/acp/agents/{agentId}/installation';
};

export type DeleteAcpAgentsByAgentIdInstallationResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type DeleteAcpAgentsByAgentIdInstallationResponse = DeleteAcpAgentsByAgentIdInstallationResponses[keyof DeleteAcpAgentsByAgentIdInstallationResponses];

export type PutAcpAgentsByAgentIdInstallationData = {
    body: {
        distributionType: 'binary' | 'npx' | 'uvx';
    };
    path: {
        agentId: string;
    };
    query?: never;
    url: '/acp/agents/{agentId}/installation';
};

export type PutAcpAgentsByAgentIdInstallationResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        name: string;
        version: string | null;
        source: string;
        distributionType: string;
        installPath: string | null;
        cmd: string | null;
        args: string | null;
        env: string | null;
        overrideCmd: string | null;
        overrideArgs: string | null;
        overrideEnv: string | null;
        status: string;
        createdAt: number;
        updatedAt: number;
    };
};

export type PutAcpAgentsByAgentIdInstallationResponse = PutAcpAgentsByAgentIdInstallationResponses[keyof PutAcpAgentsByAgentIdInstallationResponses];

export type GetAcpAuditData = {
    body?: never;
    path?: never;
    query?: {
        agentId?: string;
    };
    url: '/acp/audit';
};

export type GetAcpAuditResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: number;
        agentId: string;
        action: string;
        path: string | null;
        details: string | null;
        createdAt: number;
    }>;
};

export type GetAcpAuditResponse = GetAcpAuditResponses[keyof GetAcpAuditResponses];

export type GetAcpAgentsByAgentIdInstallPathData = {
    body?: never;
    path: {
        agentId: string;
    };
    query?: never;
    url: '/acp/agents/{agentId}/install-path';
};

export type GetAcpAgentsByAgentIdInstallPathResponses = {
    /**
     * Response for status 200
     */
    200: {
        path: string;
    };
};

export type GetAcpAgentsByAgentIdInstallPathResponse = GetAcpAgentsByAgentIdInstallPathResponses[keyof GetAcpAgentsByAgentIdInstallPathResponses];

export type GetEventsData = {
    body?: never;
    path?: never;
    query: {
        scope: 'sessions';
        afterSequenceId?: number;
        workspaceId?: string;
        limit?: number;
    };
    url: '/events';
};

export type GetEventsResponses = {
    /**
     * Server-sent event stream of slim session lifecycle events after the requested global sequence id.
     */
    200: string;
};

export type GetEventsResponse = GetEventsResponses[keyof GetEventsResponses];

export type GetChatSessionsBySessionIdEventsData = {
    body?: never;
    path: {
        sessionId: string;
    };
    query?: {
        afterVersion?: number;
        limit?: number;
    };
    url: '/chat/sessions/{sessionId}/events';
};

export type GetChatSessionsBySessionIdEventsResponses = {
    /**
     * Server-sent event stream of slim chat session lifecycle events after the requested aggregate version.
     */
    200: string;
};

export type GetChatSessionsBySessionIdEventsResponse = GetChatSessionsBySessionIdEventsResponses[keyof GetChatSessionsBySessionIdEventsResponses];

export type GetChatSessionsBySessionIdBlobsByBlobIdContentData = {
    body?: never;
    path: {
        sessionId: string;
        blobId: string;
    };
    query?: never;
    url: '/chat/sessions/{sessionId}/blobs/{blobId}/content';
};

export type DeleteChatComposerDraftsBySurfaceIdData = {
    body?: never;
    path: {
        surfaceId: string;
    };
    query?: never;
    url: '/chat/composer-drafts/{surfaceId}';
};

export type DeleteChatComposerDraftsBySurfaceIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        surfaceId: string;
        draft: {
            text: string;
            contextParts: Array<{
                type: 'data-cradle-skill';
                name: string;
                path: string;
                scope: 'builtin' | 'legacy' | 'global' | 'repository' | 'workspace' | 'agent';
                description: string | null;
                position?: number;
            } | {
                type: 'data-cradle-plugin';
                provider?: 'cradle' | 'codex';
                pluginName: string;
                displayName: string;
                description: string | null;
                iconUrl?: string | null;
                routeSegment: string;
                capabilities: Array<{
                    id: string;
                    type: string;
                    layer: 'server' | 'web' | 'desktop';
                    label: string | null;
                }>;
                mcpServers: Array<string>;
                nativeMention?: {
                    name: string;
                    path: string;
                } | null;
                position?: number;
            } | {
                type: 'data-cradle-file-line-comment';
                workspaceId: string;
                path: string;
                lineStart: number;
                lineEnd: number;
                comment: string;
                position?: number;
            } | {
                type: 'data-cradle-intent';
                intentId: 'review' | 'commit' | 'push';
                name: string;
                label: string;
                prompt: string;
                position?: number;
            }>;
            files: Array<{
                type: 'file';
                mediaType: string;
                filename?: string;
                url: string;
                providerMetadata?: unknown;
                [key: string]: unknown;
            }>;
            pastedTexts: Array<{
                id: string;
                text: string;
                lineCount: number;
                charCount: number;
            }>;
        } | null;
        revision: number;
        updatedAt: number | null;
        deletedAt: number | null;
    };
};

export type DeleteChatComposerDraftsBySurfaceIdResponse = DeleteChatComposerDraftsBySurfaceIdResponses[keyof DeleteChatComposerDraftsBySurfaceIdResponses];

export type GetChatComposerDraftsBySurfaceIdData = {
    body?: never;
    path: {
        surfaceId: string;
    };
    query?: never;
    url: '/chat/composer-drafts/{surfaceId}';
};

export type GetChatComposerDraftsBySurfaceIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        surfaceId: string;
        draft: {
            text: string;
            contextParts: Array<{
                type: 'data-cradle-skill';
                name: string;
                path: string;
                scope: 'builtin' | 'legacy' | 'global' | 'repository' | 'workspace' | 'agent';
                description: string | null;
                position?: number;
            } | {
                type: 'data-cradle-plugin';
                provider?: 'cradle' | 'codex';
                pluginName: string;
                displayName: string;
                description: string | null;
                iconUrl?: string | null;
                routeSegment: string;
                capabilities: Array<{
                    id: string;
                    type: string;
                    layer: 'server' | 'web' | 'desktop';
                    label: string | null;
                }>;
                mcpServers: Array<string>;
                nativeMention?: {
                    name: string;
                    path: string;
                } | null;
                position?: number;
            } | {
                type: 'data-cradle-file-line-comment';
                workspaceId: string;
                path: string;
                lineStart: number;
                lineEnd: number;
                comment: string;
                position?: number;
            } | {
                type: 'data-cradle-intent';
                intentId: 'review' | 'commit' | 'push';
                name: string;
                label: string;
                prompt: string;
                position?: number;
            }>;
            files: Array<{
                type: 'file';
                mediaType: string;
                filename?: string;
                url: string;
                providerMetadata?: unknown;
                [key: string]: unknown;
            }>;
            pastedTexts: Array<{
                id: string;
                text: string;
                lineCount: number;
                charCount: number;
            }>;
        } | null;
        revision: number;
        updatedAt: number | null;
        deletedAt: number | null;
    };
};

export type GetChatComposerDraftsBySurfaceIdResponse = GetChatComposerDraftsBySurfaceIdResponses[keyof GetChatComposerDraftsBySurfaceIdResponses];

export type PutChatComposerDraftsBySurfaceIdData = {
    body: {
        draft: {
            text: string;
            contextParts: Array<{
                type: 'data-cradle-skill';
                name: string;
                path: string;
                scope: 'builtin' | 'legacy' | 'global' | 'repository' | 'workspace' | 'agent';
                description: string | null;
                position?: number;
            } | {
                type: 'data-cradle-plugin';
                provider?: 'cradle' | 'codex';
                pluginName: string;
                displayName: string;
                description: string | null;
                iconUrl?: string | null;
                routeSegment: string;
                capabilities: Array<{
                    id: string;
                    type: string;
                    layer: 'server' | 'web' | 'desktop';
                    label: string | null;
                }>;
                mcpServers: Array<string>;
                nativeMention?: {
                    name: string;
                    path: string;
                } | null;
                position?: number;
            } | {
                type: 'data-cradle-file-line-comment';
                workspaceId: string;
                path: string;
                lineStart: number;
                lineEnd: number;
                comment: string;
                position?: number;
            } | {
                type: 'data-cradle-intent';
                intentId: 'review' | 'commit' | 'push';
                name: string;
                label: string;
                prompt: string;
                position?: number;
            }>;
            files: Array<{
                type: 'file';
                mediaType: string;
                filename?: string;
                url: string;
                providerMetadata?: unknown;
                [key: string]: unknown;
            }>;
            pastedTexts: Array<{
                id: string;
                text: string;
                lineCount: number;
                charCount: number;
            }>;
        };
    };
    path: {
        surfaceId: string;
    };
    query?: never;
    url: '/chat/composer-drafts/{surfaceId}';
};

export type PutChatComposerDraftsBySurfaceIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        surfaceId: string;
        draft: {
            text: string;
            contextParts: Array<{
                type: 'data-cradle-skill';
                name: string;
                path: string;
                scope: 'builtin' | 'legacy' | 'global' | 'repository' | 'workspace' | 'agent';
                description: string | null;
                position?: number;
            } | {
                type: 'data-cradle-plugin';
                provider?: 'cradle' | 'codex';
                pluginName: string;
                displayName: string;
                description: string | null;
                iconUrl?: string | null;
                routeSegment: string;
                capabilities: Array<{
                    id: string;
                    type: string;
                    layer: 'server' | 'web' | 'desktop';
                    label: string | null;
                }>;
                mcpServers: Array<string>;
                nativeMention?: {
                    name: string;
                    path: string;
                } | null;
                position?: number;
            } | {
                type: 'data-cradle-file-line-comment';
                workspaceId: string;
                path: string;
                lineStart: number;
                lineEnd: number;
                comment: string;
                position?: number;
            } | {
                type: 'data-cradle-intent';
                intentId: 'review' | 'commit' | 'push';
                name: string;
                label: string;
                prompt: string;
                position?: number;
            }>;
            files: Array<{
                type: 'file';
                mediaType: string;
                filename?: string;
                url: string;
                providerMetadata?: unknown;
                [key: string]: unknown;
            }>;
            pastedTexts: Array<{
                id: string;
                text: string;
                lineCount: number;
                charCount: number;
            }>;
        } | null;
        revision: number;
        updatedAt: number | null;
        deletedAt: number | null;
    };
};

export type PutChatComposerDraftsBySurfaceIdResponse = PutChatComposerDraftsBySurfaceIdResponses[keyof PutChatComposerDraftsBySurfaceIdResponses];

export type GetChatRuntimesData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/chat/runtimes';
};

export type GetChatRuntimesResponses = {
    /**
     * Response for status 200
     */
    200: {
        items: Array<{
            runtimeKind: string;
            label: string;
            description?: string;
            providerKinds: Array<string>;
            providerBinding?: 'required' | 'runtime-owned' | 'none';
            sessionLaunchMode: 'runtime-provider' | 'agent-terminal';
            iconKey?: string;
            surfaces?: Array<'chat' | 'jarvis'>;
            sortOrder?: number;
            stability?: 'stable' | 'experimental';
            availability: 'stable' | 'preview' | 'dev-only' | 'hidden';
            degradations?: Array<{
                capability: string;
                status: 'unsupported' | 'partial' | 'experimental';
                reason: string;
            }>;
            icon: {
                key: string;
            } | {
                svg: string;
            } | {
                url: string;
            };
            composer: {
                inputMode: 'rich' | 'collapsed' | 'none';
                allowEmptySubmit?: boolean;
                modelSelection: 'provider-model' | 'runtime-owned' | 'alias-matrix' | 'none';
                thinking: {
                    efforts: Array<string>;
                } | 'per-model' | 'unsupported';
            };
            slots: Array<{
                id: string;
                name: string;
                label: string;
                description: string;
                argumentHint: string;
                aliases?: Array<string>;
                iconKey?: 'alert' | 'approvals' | 'code-review' | 'compact' | 'config' | 'diff' | 'feedback' | 'filesystem' | 'goal' | 'crew' | 'ide-context' | 'mcp' | 'model' | 'personality' | 'plugin' | 'plan' | 'progress' | 'quick-question' | 'user-input' | 'reasoning' | 'search' | 'side-chat' | 'skills' | 'status' | 'terminal' | 'tool-activity' | 'usage';
                commandText?: string;
                commandAction?: {
                    kind: 'insertText';
                } | {
                    kind: 'submitText';
                    requiresEmptyComposer?: boolean;
                } | {
                    kind: 'uiAction';
                    actionId: string;
                };
                requiresSession?: boolean;
                surfaces: Array<'slashCommand' | 'toolbarPicker' | 'composerState' | 'messageInline' | 'runtimePanel' | 'streamEvidence' | 'recordOnly'>;
            }>;
            settingsSchema?: {
                [key: string]: unknown;
            };
            source: 'builtin' | 'plugin';
            pluginOwner: string | null;
            capabilities: {
                steer: 'native' | 'queue-fallback' | 'unsupported';
                supportsShellExecution: boolean;
                supportsLastTurnRollback: boolean;
                supportsRuntimeSettings: boolean;
                supportsUiSlotStates: boolean;
                supportsDynamicCapabilities: boolean;
                supportsTitleGeneration: boolean;
                sessionModelSwitch: 'in-session' | 'restart-session' | 'unsupported';
            } | null;
        }>;
    };
};

export type GetChatRuntimesResponse = GetChatRuntimesResponses[keyof GetChatRuntimesResponses];

export type GetChatRuntimesHealthData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/chat/runtimes/health';
};

export type GetChatRuntimesHealthResponses = {
    /**
     * Response for status 200
     */
    200: {
        items: Array<{
            runtimeKind: string;
            source: 'builtin' | 'plugin';
            pluginOwner: string | null;
            hasHealthCheck: boolean;
            status: 'healthy' | 'unhealthy' | 'unknown';
            message?: string;
            latencyMs?: number;
            lastCheckedAt: number;
        }>;
    };
};

export type GetChatRuntimesHealthResponse = GetChatRuntimesHealthResponses[keyof GetChatRuntimesHealthResponses];

export type GetChatRuntimesByRuntimeKindModelsData = {
    body?: never;
    path: {
        runtimeKind: string;
    };
    query?: {
        workspaceId?: string;
    };
    url: '/chat/runtimes/{runtimeKind}/models';
};

export type GetChatRuntimesByRuntimeKindModelsResponses = {
    /**
     * Response for status 200
     */
    200: {
        runtimeKind: string;
        source: 'runtime' | 'runtime-cache' | 'opencode-sdk' | 'opencode-cli' | 'fallback';
        fetchedAt: number;
        models: Array<{
            id: string;
            label: string;
            providerKind: 'openai-compatible' | 'anthropic' | 'universal';
            capabilities: {
                contextWindow?: number;
                maxOutput?: number;
                inputModalities?: Array<string>;
                outputModalities?: Array<string>;
                reasoning?: boolean;
                reasoningEfforts?: Array<'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra'>;
                toolCall?: boolean;
                temperature?: boolean;
                structuredOutput?: boolean;
                cost?: {
                    input?: number;
                    output?: number;
                    cacheRead?: number;
                    cacheWrite?: number;
                };
                family?: string;
                knowledgeCutoff?: string;
                releaseDate?: string;
                registryMatch?: 'exact' | 'fuzzy' | 'manual' | 'alias' | 'unmatched';
                registryModelId?: string;
                registryModelLabel?: string;
            };
            runtimeKind: string;
            source: 'runtime' | 'runtime-cache' | 'opencode-sdk' | 'opencode-cli' | 'fallback';
            nativeProviderId?: string;
        }>;
    };
};

export type GetChatRuntimesByRuntimeKindModelsResponse = GetChatRuntimesByRuntimeKindModelsResponses[keyof GetChatRuntimesByRuntimeKindModelsResponses];

export type GetChatDraftRuntimeCapabilitiesData = {
    body?: never;
    path?: never;
    query: {
        runtimeKind: string;
    };
    url: '/chat/draft-runtime-capabilities';
};

export type GetChatDraftRuntimeCapabilitiesResponses = {
    /**
     * Response for status 200
     */
    200: {
        runtimeKind: string;
        slashCommands: Array<{
            name: string;
            description: string;
            argumentHint: string;
            aliases?: Array<string>;
        }>;
        uiSlots: Array<{
            id: string;
            name: string;
            label: string;
            description: string;
            argumentHint: string;
            aliases?: Array<string>;
            iconKey?: 'alert' | 'approvals' | 'code-review' | 'compact' | 'config' | 'diff' | 'feedback' | 'filesystem' | 'goal' | 'crew' | 'ide-context' | 'mcp' | 'model' | 'personality' | 'plugin' | 'plan' | 'progress' | 'quick-question' | 'user-input' | 'reasoning' | 'search' | 'side-chat' | 'skills' | 'status' | 'terminal' | 'tool-activity' | 'usage';
            commandText?: string;
            commandAction?: {
                kind: 'insertText';
            } | {
                kind: 'submitText';
                requiresEmptyComposer?: boolean;
            } | {
                kind: 'uiAction';
                actionId: string;
            };
            requiresSession?: boolean;
            surfaces: Array<'slashCommand' | 'toolbarPicker' | 'composerState' | 'messageInline' | 'runtimePanel' | 'streamEvidence' | 'recordOnly'>;
        }>;
        skills: Array<string>;
    };
};

export type GetChatDraftRuntimeCapabilitiesResponse = GetChatDraftRuntimeCapabilitiesResponses[keyof GetChatDraftRuntimeCapabilitiesResponses];

export type GetChatSessionsBySessionIdCapabilitiesData = {
    body?: never;
    path: {
        sessionId: string;
    };
    query?: never;
    url: '/chat/sessions/{sessionId}/capabilities';
};

export type GetChatSessionsBySessionIdCapabilitiesResponses = {
    /**
     * Response for status 200
     */
    200: {
        runtimeKind: string;
        slashCommands: Array<{
            name: string;
            description: string;
            argumentHint: string;
            aliases?: Array<string>;
        }>;
        uiSlots: Array<{
            id: string;
            name: string;
            label: string;
            description: string;
            argumentHint: string;
            aliases?: Array<string>;
            iconKey?: 'alert' | 'approvals' | 'code-review' | 'compact' | 'config' | 'diff' | 'feedback' | 'filesystem' | 'goal' | 'crew' | 'ide-context' | 'mcp' | 'model' | 'personality' | 'plugin' | 'plan' | 'progress' | 'quick-question' | 'user-input' | 'reasoning' | 'search' | 'side-chat' | 'skills' | 'status' | 'terminal' | 'tool-activity' | 'usage';
            commandText?: string;
            commandAction?: {
                kind: 'insertText';
            } | {
                kind: 'submitText';
                requiresEmptyComposer?: boolean;
            } | {
                kind: 'uiAction';
                actionId: string;
            };
            requiresSession?: boolean;
            surfaces: Array<'slashCommand' | 'toolbarPicker' | 'composerState' | 'messageInline' | 'runtimePanel' | 'streamEvidence' | 'recordOnly'>;
        }>;
        skills: Array<string>;
    };
};

export type GetChatSessionsBySessionIdCapabilitiesResponse = GetChatSessionsBySessionIdCapabilitiesResponses[keyof GetChatSessionsBySessionIdCapabilitiesResponses];

export type GetChatSessionsBySessionIdUiSlotStatesData = {
    body?: never;
    path: {
        sessionId: string;
    };
    query?: never;
    url: '/chat/sessions/{sessionId}/ui-slot-states';
};

export type GetChatSessionsBySessionIdUiSlotStatesResponses = {
    /**
     * Response for status 200
     */
    200: {
        runtimeKind: string;
        states: Array<{
            kind: 'goal';
            slotId: string;
            threadId: string;
            objective: string;
            status: 'active' | 'paused' | 'blocked' | 'usageLimited' | 'budgetLimited' | 'complete';
            tokenBudget: number | null;
            tokensUsed: number;
            timeUsedSeconds: number;
            createdAt: number;
            updatedAt: number;
        } | {
            kind: 'compact';
            slotId: string;
            threadId: string;
            turnId: string | null;
            status: 'idle' | 'running' | 'nearLimit' | 'overLimit' | 'compacted';
            isCompactRelevant: boolean;
            total: {
                totalTokens: number;
                inputTokens: number;
                cachedInputTokens: number;
                cacheWriteInputTokens: number;
                outputTokens: number;
                reasoningOutputTokens: number;
            };
            last: {
                totalTokens: number;
                inputTokens: number;
                cachedInputTokens: number;
                cacheWriteInputTokens: number;
                outputTokens: number;
                reasoningOutputTokens: number;
            };
            modelContextWindow: number | null;
            autoCompactTokenLimit: number | null;
            usagePercent: number | null;
            autoCompactPercent: number | null;
            lastCompactedAt: number | null;
            compactionItemId: string | null;
            updatedAt: number;
        } | {
            kind: 'status';
            slotId: string;
            threadId: string;
            status: 'notLoaded' | 'idle' | 'systemError' | 'active';
            activeFlags: Array<string>;
            updatedAt: number;
        } | {
            kind: 'model';
            slotId: string;
            threadId: string;
            modelId: string | null;
            modelLabel: string | null;
            modelProvider: string | null;
            serviceTier: string | null;
            supportsImages: boolean | null;
            supportsWebSearch: boolean | null;
            supportsNamespaceTools: boolean | null;
            updatedAt: number;
        } | {
            kind: 'reasoning';
            slotId: string;
            threadId: string;
            effort: string | null;
            summary: string | null;
            supportedEfforts: Array<{
                id: string;
                description: string;
            }>;
            updatedAt: number;
        } | {
            kind: 'plan';
            slotId: string;
            threadId: string;
            turnId: string | null;
            explanation: string | null;
            content: string | null;
            steps: Array<{
                step: string;
                status: 'pending' | 'inProgress' | 'completed';
            }>;
            currentStep: string | null;
            pendingCount: number;
            inProgressCount: number;
            completedCount: number;
            updatedAt: number;
        } | {
            kind: 'progress';
            slotId: string;
            threadId: string;
            turnId: string | null;
            source: string;
            items: Array<{
                id: string | null;
                label: string;
                status: 'pending' | 'inProgress' | 'completed';
                sourceStatus: string | null;
            }>;
            currentItem: string | null;
            pendingCount: number;
            inProgressCount: number;
            completedCount: number;
            updatedAt: number;
        } | {
            kind: 'userInput';
            slotId: string;
            threadId: string | null;
            runId: string;
            requestId: string;
            providerMethod: string;
            toolCallId: string;
            questionCount: number;
            questions: Array<{
                id: string;
                header: string;
                question: string;
                isOther: boolean;
                isSecret: boolean;
                multiSelect: boolean;
                options: Array<{
                    label: string;
                    description: string;
                }> | null;
            }>;
            createdAt: number;
            updatedAt: number;
        } | {
            kind: 'toolActivity';
            slotId: string;
            threadId: string;
            turnId: string | null;
            activeCount: number;
            completedCount: number;
            failedCount: number;
            recentItems: Array<{
                id: string;
                type: string;
                label: string;
                status: 'running' | 'completed' | 'failed';
                startedAt: number | null;
                completedAt: number | null;
            }>;
            updatedAt: number;
        } | {
            kind: 'mcp';
            slotId: string;
            threadId: string;
            serverCount: number;
            readyCount: number;
            failedCount: number;
            needsLoginCount: number;
            recentProgress: string | null;
            servers: Array<{
                name: string;
                status: 'starting' | 'ready' | 'failed' | 'cancelled' | 'unknown';
                authStatus: 'unsupported' | 'notLoggedIn' | 'bearerToken' | 'oAuth' | 'unknown';
                toolCount: number;
                resourceCount: number;
                error: string | null;
            }>;
            updatedAt: number;
        } | {
            kind: 'diff';
            slotId: string;
            threadId: string;
            turnId: string | null;
            fileCount: number;
            addedLines: number;
            removedLines: number;
            hasDiff: boolean;
            updatedAt: number;
        } | {
            kind: 'terminal';
            slotId: string;
            threadId: string;
            turnId: string | null;
            activeCount: number;
            completedCount: number;
            failedCount: number;
            lastCommand: string | null;
            lastOutputPreview: string | null;
            backgroundTerminals: Array<{
                itemId: string;
                processId: string;
                command: string;
                cwd: string;
                osPid: number | null;
                cpuPercent: number | null;
                rssKb: number | null;
            }>;
            updatedAt: number;
        } | {
            kind: 'approvals';
            slotId: string;
            threadId: string;
            turnId: string | null;
            pendingCount: number;
            approvedCount: number;
            deniedCount: number;
            recentItems: Array<{
                id: string;
                targetItemId: string | null;
                status: 'pending' | 'approved' | 'denied' | 'timedOut' | 'aborted';
                label: string;
                riskLevel: string | null;
                rationale: string | null;
                startedAt: number | null;
                completedAt: number | null;
            }>;
            updatedAt: number;
        } | {
            kind: 'alert';
            slotId: string;
            threadId: string | null;
            warningCount: number;
            errorCount: number;
            recentItems: Array<{
                id: string;
                severity: 'info' | 'warning' | 'error';
                message: string;
                source: string;
                updatedAt: number;
            }>;
            updatedAt: number;
        } | {
            kind: 'filesystem';
            slotId: string;
            threadId: string;
            changedPathCount: number;
            recentPaths: Array<string>;
            updatedAt: number;
        } | {
            kind: 'skills';
            slotId: string;
            threadId: string;
            enabledCount: number;
            disabledCount: number;
            errorCount: number;
            roots: Array<string>;
            items?: Array<{
                name: string;
                enabled: boolean;
                displayName: string | null;
                iconUrl: string | null;
                brandColor: string | null;
            }>;
            updatedAt: number;
        } | {
            kind: 'plugin';
            slotId: string;
            threadId: string;
            installedCount: number;
            enabledCount: number;
            appCount: number;
            marketplaceCount: number;
            errorCount: number;
            updatedAt: number;
        } | {
            kind: 'search';
            slotId: string;
            threadId: string;
            recentResultCount: number;
            recentQuery: string | null;
            fuzzySessionActive: boolean;
            updatedAt: number;
        } | {
            kind: 'crew';
            slotId: string;
            threadId: string;
            activeCount: number;
            completedCount: number;
            failedCount: number;
            recentItems: Array<{
                id: string;
                type: string;
                label: string;
                status: 'running' | 'completed' | 'failed';
                startedAt: number | null;
                completedAt: number | null;
            }>;
            agents: Array<{
                threadId: string;
                status: string | null;
                message: string | null;
                name: string | null;
                preview: string | null;
                modelProvider: string | null;
                agentNickname: string | null;
                agentRole: string | null;
            }>;
            collaborationModeCount: number;
            collaborationModes: Array<{
                name: string;
                mode: string | null;
                model: string | null;
                reasoningEffort: string | null;
            }>;
            calls: Array<{
                id: string;
                tool: string;
                status: 'running' | 'completed' | 'failed';
                senderThreadId: string | null;
                receiverThreadIds: Array<string>;
                prompt: string | null;
                model: string | null;
                reasoningEffort: string | null;
                agents: Array<{
                    threadId: string;
                    status: string | null;
                    message: string | null;
                    name: string | null;
                    preview: string | null;
                    modelProvider: string | null;
                    agentNickname: string | null;
                    agentRole: string | null;
                }>;
                retry?: {
                    agentId: string;
                    attempt: number;
                    maxRetries: number;
                    retryDelayMs: number;
                    errorStatus: number | null;
                    errorCategory: string;
                } | null;
                startedAt: number | null;
                completedAt: number | null;
            }>;
            updatedAt: number;
        } | {
            kind: 'usage';
            slotId: string;
            threadId: string;
            limitName: string | null;
            usedPercent: number | null;
            primaryWindowDurationMins: number | null;
            primaryResetsAt: number | null;
            secondaryUsedPercent: number | null;
            secondaryWindowDurationMins: number | null;
            secondaryResetsAt: number | null;
            creditsBalance: string | null;
            hasCredits: boolean | null;
            rateLimitReachedType: string | null;
            planType: string | null;
            updatedAt: number;
        } | {
            kind: 'config';
            slotId: string;
            threadId: string;
            modelId: string | null;
            approvalPolicy: string | null;
            sandboxMode: string | null;
            allowedApprovalPolicyCount: number | null;
            allowedSandboxModeCount: number | null;
            featureRequirementCount: number | null;
            webSearchModeCount: number | null;
            updatedAt: number;
        }>;
    };
};

export type GetChatSessionsBySessionIdUiSlotStatesResponse = GetChatSessionsBySessionIdUiSlotStatesResponses[keyof GetChatSessionsBySessionIdUiSlotStatesResponses];

export type GetChatSessionsBySessionIdContextUsageData = {
    body?: never;
    path: {
        sessionId: string;
    };
    query?: never;
    url: '/chat/sessions/{sessionId}/context-usage';
};

export type GetChatSessionsBySessionIdContextUsageResponses = {
    /**
     * Response for status 200
     */
    200: {
        sessionId: string;
        runtimeKind: string;
        providerSessionId: string | null;
        usage: {
            runtimeKind: string;
            providerSessionId: string | null;
            source: string;
            model: string | null;
            totalTokens: number;
            maxTokens: number | null;
            rawMaxTokens: number | null;
            percentage: number | null;
            sections: Array<{
                kind: string;
                label: string;
                tokenCount: number;
                color: string | null;
                isDeferred: boolean;
                items: Array<{
                    kind: string;
                    label: string;
                    tokenCount: number;
                    metadata?: {
                        [key: string]: unknown;
                    };
                    raw?: unknown;
                }>;
                raw?: unknown;
            }>;
            messageBreakdown: {
                [key: string]: unknown;
            } | null;
            apiUsage: {
                [key: string]: unknown;
            } | null;
            raw: unknown;
            updatedAt: number;
        } | null;
    };
};

export type GetChatSessionsBySessionIdContextUsageResponse = GetChatSessionsBySessionIdContextUsageResponses[keyof GetChatSessionsBySessionIdContextUsageResponses];

export type GetChatSessionsBySessionIdBackgroundTerminalsData = {
    body?: never;
    path: {
        sessionId: string;
    };
    query?: {
        cursor?: string;
        limit?: number;
    };
    url: '/chat/sessions/{sessionId}/background-terminals';
};

export type GetChatSessionsBySessionIdBackgroundTerminalsResponses = {
    /**
     * Response for status 200
     */
    200: {
        runtimeKind: string;
        providerSessionId: string | null;
        terminals: Array<{
            itemId: string;
            processId: string;
            command: string;
            cwd: string;
            osPid: number | null;
            cpuPercent: number | null;
            rssKb: number | null;
        }>;
        nextCursor: string | null;
    };
};

export type GetChatSessionsBySessionIdBackgroundTerminalsResponse = GetChatSessionsBySessionIdBackgroundTerminalsResponses[keyof GetChatSessionsBySessionIdBackgroundTerminalsResponses];

export type PostChatSessionsBySessionIdBackgroundTerminalsByProcessIdTerminateData = {
    body?: never;
    path: {
        sessionId: string;
        processId: string;
    };
    query?: never;
    url: '/chat/sessions/{sessionId}/background-terminals/{processId}/terminate';
};

export type PostChatSessionsBySessionIdBackgroundTerminalsByProcessIdTerminateResponses = {
    /**
     * Response for status 200
     */
    200: {
        runtimeKind: string;
        providerSessionId: string | null;
        processId: string;
        terminated: boolean;
    };
};

export type PostChatSessionsBySessionIdBackgroundTerminalsByProcessIdTerminateResponse = PostChatSessionsBySessionIdBackgroundTerminalsByProcessIdTerminateResponses[keyof PostChatSessionsBySessionIdBackgroundTerminalsByProcessIdTerminateResponses];

export type GetChatSessionsBySessionIdProviderThreadsData = {
    body?: never;
    path: {
        sessionId: string;
    };
    query?: {
        cursor?: string;
        limit?: number;
        sortKey?: 'created_at' | 'updated_at';
        sortDirection?: 'asc' | 'desc';
        sourceKinds?: string;
        archived?: boolean;
        searchTerm?: string;
    };
    url: '/chat/sessions/{sessionId}/provider-threads';
};

export type GetChatSessionsBySessionIdProviderThreadsResponses = {
    /**
     * Response for status 200
     */
    200: {
        runtimeKind: string;
        providerSessionId: string | null;
        threads: Array<{
            id: string;
            providerSessionTreeId: string | null;
            forkedFromId: string | null;
            preview: string | null;
            ephemeral: boolean;
            modelProvider: string | null;
            createdAt: number | null;
            updatedAt: number | null;
            status: string;
            sourceKind: 'cli' | 'vscode' | 'exec' | 'appServer' | 'subAgent' | 'subAgentReview' | 'subAgentCompact' | 'subAgentThreadSpawn' | 'subAgentOther' | 'unknown';
            source: unknown;
            threadSource: unknown;
            agentNickname: string | null;
            agentRole: string | null;
            name: string | null;
            cwd: string | null;
        }>;
        nextCursor: string | null;
        backwardsCursor: string | null;
    };
};

export type GetChatSessionsBySessionIdProviderThreadsResponse = GetChatSessionsBySessionIdProviderThreadsResponses[keyof GetChatSessionsBySessionIdProviderThreadsResponses];

export type DeleteChatSessionsBySessionIdProviderThreadsByThreadIdData = {
    body?: never;
    path: {
        sessionId: string;
        threadId: string;
    };
    query?: never;
    url: '/chat/sessions/{sessionId}/provider-threads/{threadId}';
};

export type DeleteChatSessionsBySessionIdProviderThreadsByThreadIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        runtimeKind: string;
        providerSessionId: string | null;
        threadId: string;
        deleted: boolean;
    };
};

export type DeleteChatSessionsBySessionIdProviderThreadsByThreadIdResponse = DeleteChatSessionsBySessionIdProviderThreadsByThreadIdResponses[keyof DeleteChatSessionsBySessionIdProviderThreadsByThreadIdResponses];

export type GetChatSessionsBySessionIdProviderThreadsByThreadIdData = {
    body?: never;
    path: {
        sessionId: string;
        threadId: string;
    };
    query?: never;
    url: '/chat/sessions/{sessionId}/provider-threads/{threadId}';
};

export type GetChatSessionsBySessionIdProviderThreadsByThreadIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        runtimeKind: string;
        providerSessionId: string | null;
        thread: {
            id: string;
            providerSessionTreeId: string | null;
            forkedFromId: string | null;
            preview: string | null;
            ephemeral: boolean;
            modelProvider: string | null;
            createdAt: number | null;
            updatedAt: number | null;
            status: string;
            sourceKind: 'cli' | 'vscode' | 'exec' | 'appServer' | 'subAgent' | 'subAgentReview' | 'subAgentCompact' | 'subAgentThreadSpawn' | 'subAgentOther' | 'unknown';
            source: unknown;
            threadSource: unknown;
            agentNickname: string | null;
            agentRole: string | null;
            name: string | null;
            cwd: string | null;
        };
    };
};

export type GetChatSessionsBySessionIdProviderThreadsByThreadIdResponse = GetChatSessionsBySessionIdProviderThreadsByThreadIdResponses[keyof GetChatSessionsBySessionIdProviderThreadsByThreadIdResponses];

export type GetChatSessionsBySessionIdProviderThreadsByThreadIdTurnsData = {
    body?: never;
    path: {
        sessionId: string;
        threadId: string;
    };
    query?: {
        cursor?: string;
        limit?: number;
        sortDirection?: 'asc' | 'desc';
    };
    url: '/chat/sessions/{sessionId}/provider-threads/{threadId}/turns';
};

export type GetChatSessionsBySessionIdProviderThreadsByThreadIdTurnsResponses = {
    /**
     * Response for status 200
     */
    200: {
        runtimeKind: string;
        providerSessionId: string | null;
        threadId: string;
        turns: Array<{
            id: string;
            status: string;
            startedAt: number | null;
            completedAt: number | null;
            durationMs: number | null;
            itemsView: string;
            items: Array<unknown>;
        }>;
        messages: Array<{
            id: string;
            role: 'system' | 'user' | 'assistant';
            parts: Array<{
                type: string;
                [key: string]: unknown;
            }>;
            metadata?: unknown;
            [key: string]: unknown;
        }>;
        nextCursor: string | null;
        backwardsCursor: string | null;
    };
};

export type GetChatSessionsBySessionIdProviderThreadsByThreadIdTurnsResponse = GetChatSessionsBySessionIdProviderThreadsByThreadIdTurnsResponses[keyof GetChatSessionsBySessionIdProviderThreadsByThreadIdTurnsResponses];

export type GetChatSessionsBySessionIdProviderThreadsByThreadIdStreamData = {
    body?: never;
    path: {
        sessionId: string;
        threadId: string;
    };
    query?: never;
    url: '/chat/sessions/{sessionId}/provider-threads/{threadId}/stream';
};

export type GetChatSessionsBySessionIdProviderThreadsByThreadIdStreamResponses = {
    /**
     * AI SDK UIMessageChunk SSE stream for a provider-native thread such as a Codex subagent thread.
     */
    200: string;
};

export type GetChatSessionsBySessionIdProviderThreadsByThreadIdStreamResponse = GetChatSessionsBySessionIdProviderThreadsByThreadIdStreamResponses[keyof GetChatSessionsBySessionIdProviderThreadsByThreadIdStreamResponses];

export type GetChatSessionsBySessionIdWorkflowsByToolCallIdStreamData = {
    body?: never;
    path: {
        sessionId: string;
        toolCallId: string;
    };
    query?: never;
    url: '/chat/sessions/{sessionId}/workflows/{toolCallId}/stream';
};

export type GetChatSessionsBySessionIdWorkflowsByToolCallIdStreamResponses = {
    /**
     * Workflow runtime snapshots from provider-owned local artifacts.
     */
    200: string;
};

export type GetChatSessionsBySessionIdWorkflowsByToolCallIdStreamResponse = GetChatSessionsBySessionIdWorkflowsByToolCallIdStreamResponses[keyof GetChatSessionsBySessionIdWorkflowsByToolCallIdStreamResponses];

export type GetChatSessionsBySessionIdRuntimeStatusData = {
    body?: never;
    path: {
        sessionId: string;
    };
    query?: never;
    url: '/chat/sessions/{sessionId}/runtime-status';
};

export type GetChatSessionsBySessionIdRuntimeStatusResponses = {
    /**
     * Response for status 200
     */
    200: {
        sessionId: string;
        status: 'idle' | 'pending' | 'streaming' | 'waitingForUserInput' | 'waitingForToolApproval' | 'cancelling';
        runtimeKind: string;
        providerTargetId: string | null;
        providerSessionId: string | null;
        modelId: string | null;
        runtimeSettings: {
            [key: string]: string | number | boolean;
        };
        pendingQueueItemId: string | null;
        hasActiveGoal: boolean;
        supportsLastTurnRollback: boolean;
        activeRun: {
            runId: string;
            messageId: string | null;
            status: 'streaming' | 'complete' | 'aborted' | 'failed';
            startedAt: number;
            finishedAt: number | null;
            modelId: string | null;
            providerSessionId: string | null;
            queueItemId: string | null;
            runtimeSettings: {
                [key: string]: string | number | boolean;
            };
        } | null;
        latestRun: {
            runId: string;
            messageId: string | null;
            status: 'streaming' | 'complete' | 'aborted' | 'failed';
            startedAt: number;
            finishedAt: number | null;
            modelId: string | null;
            providerSessionId: string | null;
            queueItemId: string | null;
            runtimeSettings: {
                [key: string]: string | number | boolean;
            };
        } | null;
        queue: {
            pending: number;
            running: number;
        };
    };
};

export type GetChatSessionsBySessionIdRuntimeStatusResponse = GetChatSessionsBySessionIdRuntimeStatusResponses[keyof GetChatSessionsBySessionIdRuntimeStatusResponses];

export type GetChatSessionsBySessionIdCodexAppServerCapabilitiesData = {
    body?: never;
    path: {
        sessionId: string;
    };
    query?: never;
    url: '/chat/sessions/{sessionId}/codex/app-server/capabilities';
};

export type GetChatSessionsBySessionIdCodexAppServerCapabilitiesResponses = {
    /**
     * Response for status 200
     */
    200: {
        protocol: string;
        generatorVersion: string;
        generatedDate: string;
        clientMethods: Array<{
            method: string;
            paramsType: string | null;
            category: string;
            operation: string;
            interaction: 'request' | 'stream';
        }>;
        serverRequests: Array<{
            method: string;
            paramsType: string;
            category: string;
        }>;
        serverNotifications: Array<{
            method: string;
            paramsType: string;
            category: string;
        }>;
    };
};

export type GetChatSessionsBySessionIdCodexAppServerCapabilitiesResponse = GetChatSessionsBySessionIdCodexAppServerCapabilitiesResponses[keyof GetChatSessionsBySessionIdCodexAppServerCapabilitiesResponses];

export type PostChatSessionsBySessionIdCodexAppServerInvokeData = {
    body: {
        method: string;
        params?: unknown;
        providerTargetId?: string;
        modelId?: string;
    };
    path: {
        sessionId: string;
    };
    query?: never;
    url: '/chat/sessions/{sessionId}/codex/app-server/invoke';
};

export type PostChatSessionsBySessionIdCodexAppServerInvokeResponses = {
    /**
     * Response for status 200
     */
    200: {
        method: string;
        capability: {
            method: string;
            paramsType: string | null;
            category: string;
            operation: string;
            interaction: 'request' | 'stream';
        };
        result: unknown;
    };
};

export type PostChatSessionsBySessionIdCodexAppServerInvokeResponse = PostChatSessionsBySessionIdCodexAppServerInvokeResponses[keyof PostChatSessionsBySessionIdCodexAppServerInvokeResponses];

export type PostChatSessionsBySessionIdCodexAppServerStreamData = {
    body: {
        method: string;
        params?: unknown;
        providerTargetId?: string;
        modelId?: string;
        closeOnMethods?: Array<string>;
    };
    path: {
        sessionId: string;
    };
    query?: never;
    url: '/chat/sessions/{sessionId}/codex/app-server/stream';
};

export type PostChatSessionsBySessionIdCodexAppServerStreamResponses = {
    /**
     * Server-sent events with `request_started`, `notification`, `server_request`, `result`, `error`, and `done` events.
     */
    200: string;
};

export type PostChatSessionsBySessionIdCodexAppServerStreamResponse = PostChatSessionsBySessionIdCodexAppServerStreamResponses[keyof PostChatSessionsBySessionIdCodexAppServerStreamResponses];

export type PostChatSessionsBySessionIdRollbackLastTurnData = {
    body?: never;
    path: {
        sessionId: string;
    };
    query?: never;
    url: '/chat/sessions/{sessionId}/rollback-last-turn';
};

export type PostChatSessionsBySessionIdRollbackLastTurnResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
        sessionId: string;
        messageIds: Array<string>;
        providerRuntimeKind: string;
        providerSessionId: string | null;
        providerRolledBackTurns: number;
        fileChangesReverted: boolean;
    };
};

export type PostChatSessionsBySessionIdRollbackLastTurnResponse = PostChatSessionsBySessionIdRollbackLastTurnResponses[keyof PostChatSessionsBySessionIdRollbackLastTurnResponses];

export type GetChatSessionsBySessionIdQueueData = {
    body?: never;
    path: {
        sessionId: string;
    };
    query?: never;
    url: '/chat/sessions/{sessionId}/queue';
};

export type GetChatSessionsBySessionIdQueueResponses = {
    /**
     * Response for status 200
     */
    200: {
        items: Array<{
            id: string;
            sessionId: string;
            mode: 'queue' | 'steer';
            status: 'pending' | 'running' | 'cancelled' | 'completed' | 'failed';
            text: string;
            files: Array<{
                type: 'file';
                mediaType: string;
                filename?: string;
                url: string;
                providerMetadata?: unknown;
                [key: string]: unknown;
            }>;
            contextParts: Array<{
                type: 'data-cradle-skill';
                name: string;
                path: string;
                scope: 'builtin' | 'legacy' | 'global' | 'repository' | 'workspace' | 'agent';
                description: string | null;
                position?: number;
            } | {
                type: 'data-cradle-plugin';
                provider?: 'cradle' | 'codex';
                pluginName: string;
                displayName: string;
                description: string | null;
                iconUrl?: string | null;
                routeSegment: string;
                capabilities: Array<{
                    id: string;
                    type: string;
                    layer: 'server' | 'web' | 'desktop';
                    label: string | null;
                }>;
                mcpServers: Array<string>;
                nativeMention?: {
                    name: string;
                    path: string;
                } | null;
                position?: number;
            } | {
                type: 'data-cradle-file-line-comment';
                workspaceId: string;
                path: string;
                lineStart: number;
                lineEnd: number;
                comment: string;
                position?: number;
            } | {
                type: 'data-cradle-intent';
                intentId: 'review' | 'commit' | 'push';
                name: string;
                label: string;
                prompt: string;
                position?: number;
            }>;
            providerTargetId: string | null;
            modelId: string | null;
            thinkingEffort: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra' | null;
            runtimeSettings: {
                [key: string]: string | number | boolean;
            };
            position: number;
            sourceRunId: string | null;
            startedRunId: string | null;
            errorText: string | null;
            createdAt: number;
            updatedAt: number;
        }>;
    };
};

export type GetChatSessionsBySessionIdQueueResponse = GetChatSessionsBySessionIdQueueResponses[keyof GetChatSessionsBySessionIdQueueResponses];

export type PostChatSessionsBySessionIdQueueData = {
    body: {
        text?: string;
        files?: Array<{
            type: 'file';
            mediaType: string;
            filename?: string;
            url: string;
            providerMetadata?: unknown;
            [key: string]: unknown;
        }>;
        contextParts?: Array<{
            type: 'data-cradle-skill';
            name: string;
            path: string;
            scope: 'builtin' | 'legacy' | 'global' | 'repository' | 'workspace' | 'agent';
            description: string | null;
            position?: number;
        } | {
            type: 'data-cradle-plugin';
            provider?: 'cradle' | 'codex';
            pluginName: string;
            displayName: string;
            description: string | null;
            iconUrl?: string | null;
            routeSegment: string;
            capabilities: Array<{
                id: string;
                type: string;
                layer: 'server' | 'web' | 'desktop';
                label: string | null;
            }>;
            mcpServers: Array<string>;
            nativeMention?: {
                name: string;
                path: string;
            } | null;
            position?: number;
        } | {
            type: 'data-cradle-file-line-comment';
            workspaceId: string;
            path: string;
            lineStart: number;
            lineEnd: number;
            comment: string;
            position?: number;
        } | {
            type: 'data-cradle-intent';
            intentId: 'review' | 'commit' | 'push';
            name: string;
            label: string;
            prompt: string;
            position?: number;
        }>;
        providerTargetId?: string;
        modelId?: string | null;
        thinkingEffort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra';
        runtimeSettings?: {
            [key: string]: string | number | boolean | null;
        };
    };
    path: {
        sessionId: string;
    };
    query?: never;
    url: '/chat/sessions/{sessionId}/queue';
};

export type PostChatSessionsBySessionIdQueueResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        sessionId: string;
        mode: 'queue' | 'steer';
        status: 'pending' | 'running' | 'cancelled' | 'completed' | 'failed';
        text: string;
        files: Array<{
            type: 'file';
            mediaType: string;
            filename?: string;
            url: string;
            providerMetadata?: unknown;
            [key: string]: unknown;
        }>;
        contextParts: Array<{
            type: 'data-cradle-skill';
            name: string;
            path: string;
            scope: 'builtin' | 'legacy' | 'global' | 'repository' | 'workspace' | 'agent';
            description: string | null;
            position?: number;
        } | {
            type: 'data-cradle-plugin';
            provider?: 'cradle' | 'codex';
            pluginName: string;
            displayName: string;
            description: string | null;
            iconUrl?: string | null;
            routeSegment: string;
            capabilities: Array<{
                id: string;
                type: string;
                layer: 'server' | 'web' | 'desktop';
                label: string | null;
            }>;
            mcpServers: Array<string>;
            nativeMention?: {
                name: string;
                path: string;
            } | null;
            position?: number;
        } | {
            type: 'data-cradle-file-line-comment';
            workspaceId: string;
            path: string;
            lineStart: number;
            lineEnd: number;
            comment: string;
            position?: number;
        } | {
            type: 'data-cradle-intent';
            intentId: 'review' | 'commit' | 'push';
            name: string;
            label: string;
            prompt: string;
            position?: number;
        }>;
        providerTargetId: string | null;
        modelId: string | null;
        thinkingEffort: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra' | null;
        runtimeSettings: {
            [key: string]: string | number | boolean;
        };
        position: number;
        sourceRunId: string | null;
        startedRunId: string | null;
        errorText: string | null;
        createdAt: number;
        updatedAt: number;
    };
};

export type PostChatSessionsBySessionIdQueueResponse = PostChatSessionsBySessionIdQueueResponses[keyof PostChatSessionsBySessionIdQueueResponses];

export type PostChatSessionsBySessionIdSteerData = {
    body: {
        text?: string;
        files?: Array<{
            type: 'file';
            mediaType: string;
            filename?: string;
            url: string;
            providerMetadata?: unknown;
            [key: string]: unknown;
        }>;
        contextParts?: Array<{
            type: 'data-cradle-skill';
            name: string;
            path: string;
            scope: 'builtin' | 'legacy' | 'global' | 'repository' | 'workspace' | 'agent';
            description: string | null;
            position?: number;
        } | {
            type: 'data-cradle-plugin';
            provider?: 'cradle' | 'codex';
            pluginName: string;
            displayName: string;
            description: string | null;
            iconUrl?: string | null;
            routeSegment: string;
            capabilities: Array<{
                id: string;
                type: string;
                layer: 'server' | 'web' | 'desktop';
                label: string | null;
            }>;
            mcpServers: Array<string>;
            nativeMention?: {
                name: string;
                path: string;
            } | null;
            position?: number;
        } | {
            type: 'data-cradle-file-line-comment';
            workspaceId: string;
            path: string;
            lineStart: number;
            lineEnd: number;
            comment: string;
            position?: number;
        } | {
            type: 'data-cradle-intent';
            intentId: 'review' | 'commit' | 'push';
            name: string;
            label: string;
            prompt: string;
            position?: number;
        }>;
        providerTargetId?: string;
    };
    path: {
        sessionId: string;
    };
    query?: never;
    url: '/chat/sessions/{sessionId}/steer';
};

export type PostChatSessionsBySessionIdSteerResponses = {
    /**
     * Response for status 200
     */
    200: {
        mode: 'steered';
        ok: boolean;
        sessionId: string;
        runId: string;
        sourceMessageId: string;
        message: {
            id: string;
            role: 'system' | 'user' | 'assistant';
            parts: Array<{
                type: string;
                [key: string]: unknown;
            }>;
            metadata?: unknown;
            [key: string]: unknown;
        };
    } | {
        mode: 'queued';
        ok: boolean;
        sessionId: string;
        queueItem: {
            id: string;
            sessionId: string;
            mode: 'queue' | 'steer';
            status: 'pending' | 'running' | 'cancelled' | 'completed' | 'failed';
            text: string;
            files: Array<{
                type: 'file';
                mediaType: string;
                filename?: string;
                url: string;
                providerMetadata?: unknown;
                [key: string]: unknown;
            }>;
            contextParts: Array<{
                type: 'data-cradle-skill';
                name: string;
                path: string;
                scope: 'builtin' | 'legacy' | 'global' | 'repository' | 'workspace' | 'agent';
                description: string | null;
                position?: number;
            } | {
                type: 'data-cradle-plugin';
                provider?: 'cradle' | 'codex';
                pluginName: string;
                displayName: string;
                description: string | null;
                iconUrl?: string | null;
                routeSegment: string;
                capabilities: Array<{
                    id: string;
                    type: string;
                    layer: 'server' | 'web' | 'desktop';
                    label: string | null;
                }>;
                mcpServers: Array<string>;
                nativeMention?: {
                    name: string;
                    path: string;
                } | null;
                position?: number;
            } | {
                type: 'data-cradle-file-line-comment';
                workspaceId: string;
                path: string;
                lineStart: number;
                lineEnd: number;
                comment: string;
                position?: number;
            } | {
                type: 'data-cradle-intent';
                intentId: 'review' | 'commit' | 'push';
                name: string;
                label: string;
                prompt: string;
                position?: number;
            }>;
            providerTargetId: string | null;
            modelId: string | null;
            thinkingEffort: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra' | null;
            runtimeSettings: {
                [key: string]: string | number | boolean;
            };
            position: number;
            sourceRunId: string | null;
            startedRunId: string | null;
            errorText: string | null;
            createdAt: number;
            updatedAt: number;
        };
    };
};

export type PostChatSessionsBySessionIdSteerResponse = PostChatSessionsBySessionIdSteerResponses[keyof PostChatSessionsBySessionIdSteerResponses];

export type PostChatSessionsBySessionIdQueueReorderData = {
    body: {
        queueItemIds: Array<string>;
    };
    path: {
        sessionId: string;
    };
    query?: never;
    url: '/chat/sessions/{sessionId}/queue/reorder';
};

export type PostChatSessionsBySessionIdQueueReorderResponses = {
    /**
     * Response for status 200
     */
    200: {
        items: Array<{
            id: string;
            sessionId: string;
            mode: 'queue' | 'steer';
            status: 'pending' | 'running' | 'cancelled' | 'completed' | 'failed';
            text: string;
            files: Array<{
                type: 'file';
                mediaType: string;
                filename?: string;
                url: string;
                providerMetadata?: unknown;
                [key: string]: unknown;
            }>;
            contextParts: Array<{
                type: 'data-cradle-skill';
                name: string;
                path: string;
                scope: 'builtin' | 'legacy' | 'global' | 'repository' | 'workspace' | 'agent';
                description: string | null;
                position?: number;
            } | {
                type: 'data-cradle-plugin';
                provider?: 'cradle' | 'codex';
                pluginName: string;
                displayName: string;
                description: string | null;
                iconUrl?: string | null;
                routeSegment: string;
                capabilities: Array<{
                    id: string;
                    type: string;
                    layer: 'server' | 'web' | 'desktop';
                    label: string | null;
                }>;
                mcpServers: Array<string>;
                nativeMention?: {
                    name: string;
                    path: string;
                } | null;
                position?: number;
            } | {
                type: 'data-cradle-file-line-comment';
                workspaceId: string;
                path: string;
                lineStart: number;
                lineEnd: number;
                comment: string;
                position?: number;
            } | {
                type: 'data-cradle-intent';
                intentId: 'review' | 'commit' | 'push';
                name: string;
                label: string;
                prompt: string;
                position?: number;
            }>;
            providerTargetId: string | null;
            modelId: string | null;
            thinkingEffort: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra' | null;
            runtimeSettings: {
                [key: string]: string | number | boolean;
            };
            position: number;
            sourceRunId: string | null;
            startedRunId: string | null;
            errorText: string | null;
            createdAt: number;
            updatedAt: number;
        }>;
    };
};

export type PostChatSessionsBySessionIdQueueReorderResponse = PostChatSessionsBySessionIdQueueReorderResponses[keyof PostChatSessionsBySessionIdQueueReorderResponses];

export type DeleteChatSessionsBySessionIdQueueByQueueItemIdData = {
    body?: never;
    path: {
        sessionId: string;
        queueItemId: string;
    };
    query?: never;
    url: '/chat/sessions/{sessionId}/queue/{queueItemId}';
};

export type DeleteChatSessionsBySessionIdQueueByQueueItemIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        sessionId: string;
        mode: 'queue' | 'steer';
        status: 'pending' | 'running' | 'cancelled' | 'completed' | 'failed';
        text: string;
        files: Array<{
            type: 'file';
            mediaType: string;
            filename?: string;
            url: string;
            providerMetadata?: unknown;
            [key: string]: unknown;
        }>;
        contextParts: Array<{
            type: 'data-cradle-skill';
            name: string;
            path: string;
            scope: 'builtin' | 'legacy' | 'global' | 'repository' | 'workspace' | 'agent';
            description: string | null;
            position?: number;
        } | {
            type: 'data-cradle-plugin';
            provider?: 'cradle' | 'codex';
            pluginName: string;
            displayName: string;
            description: string | null;
            iconUrl?: string | null;
            routeSegment: string;
            capabilities: Array<{
                id: string;
                type: string;
                layer: 'server' | 'web' | 'desktop';
                label: string | null;
            }>;
            mcpServers: Array<string>;
            nativeMention?: {
                name: string;
                path: string;
            } | null;
            position?: number;
        } | {
            type: 'data-cradle-file-line-comment';
            workspaceId: string;
            path: string;
            lineStart: number;
            lineEnd: number;
            comment: string;
            position?: number;
        } | {
            type: 'data-cradle-intent';
            intentId: 'review' | 'commit' | 'push';
            name: string;
            label: string;
            prompt: string;
            position?: number;
        }>;
        providerTargetId: string | null;
        modelId: string | null;
        thinkingEffort: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra' | null;
        runtimeSettings: {
            [key: string]: string | number | boolean;
        };
        position: number;
        sourceRunId: string | null;
        startedRunId: string | null;
        errorText: string | null;
        createdAt: number;
        updatedAt: number;
    };
};

export type DeleteChatSessionsBySessionIdQueueByQueueItemIdResponse = DeleteChatSessionsBySessionIdQueueByQueueItemIdResponses[keyof DeleteChatSessionsBySessionIdQueueByQueueItemIdResponses];

export type PatchChatSessionsBySessionIdQueueByQueueItemIdData = {
    body: {
        text?: string;
        files?: Array<{
            type: 'file';
            mediaType: string;
            filename?: string;
            url: string;
            providerMetadata?: unknown;
            [key: string]: unknown;
        }>;
        contextParts?: Array<{
            type: 'data-cradle-skill';
            name: string;
            path: string;
            scope: 'builtin' | 'legacy' | 'global' | 'repository' | 'workspace' | 'agent';
            description: string | null;
            position?: number;
        } | {
            type: 'data-cradle-plugin';
            provider?: 'cradle' | 'codex';
            pluginName: string;
            displayName: string;
            description: string | null;
            iconUrl?: string | null;
            routeSegment: string;
            capabilities: Array<{
                id: string;
                type: string;
                layer: 'server' | 'web' | 'desktop';
                label: string | null;
            }>;
            mcpServers: Array<string>;
            nativeMention?: {
                name: string;
                path: string;
            } | null;
            position?: number;
        } | {
            type: 'data-cradle-file-line-comment';
            workspaceId: string;
            path: string;
            lineStart: number;
            lineEnd: number;
            comment: string;
            position?: number;
        } | {
            type: 'data-cradle-intent';
            intentId: 'review' | 'commit' | 'push';
            name: string;
            label: string;
            prompt: string;
            position?: number;
        }>;
        providerTargetId?: string;
        modelId?: string | null;
        thinkingEffort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra';
        runtimeSettings?: {
            [key: string]: string | number | boolean | null;
        };
    };
    path: {
        sessionId: string;
        queueItemId: string;
    };
    query?: never;
    url: '/chat/sessions/{sessionId}/queue/{queueItemId}';
};

export type PatchChatSessionsBySessionIdQueueByQueueItemIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        sessionId: string;
        mode: 'queue' | 'steer';
        status: 'pending' | 'running' | 'cancelled' | 'completed' | 'failed';
        text: string;
        files: Array<{
            type: 'file';
            mediaType: string;
            filename?: string;
            url: string;
            providerMetadata?: unknown;
            [key: string]: unknown;
        }>;
        contextParts: Array<{
            type: 'data-cradle-skill';
            name: string;
            path: string;
            scope: 'builtin' | 'legacy' | 'global' | 'repository' | 'workspace' | 'agent';
            description: string | null;
            position?: number;
        } | {
            type: 'data-cradle-plugin';
            provider?: 'cradle' | 'codex';
            pluginName: string;
            displayName: string;
            description: string | null;
            iconUrl?: string | null;
            routeSegment: string;
            capabilities: Array<{
                id: string;
                type: string;
                layer: 'server' | 'web' | 'desktop';
                label: string | null;
            }>;
            mcpServers: Array<string>;
            nativeMention?: {
                name: string;
                path: string;
            } | null;
            position?: number;
        } | {
            type: 'data-cradle-file-line-comment';
            workspaceId: string;
            path: string;
            lineStart: number;
            lineEnd: number;
            comment: string;
            position?: number;
        } | {
            type: 'data-cradle-intent';
            intentId: 'review' | 'commit' | 'push';
            name: string;
            label: string;
            prompt: string;
            position?: number;
        }>;
        providerTargetId: string | null;
        modelId: string | null;
        thinkingEffort: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra' | null;
        runtimeSettings: {
            [key: string]: string | number | boolean;
        };
        position: number;
        sourceRunId: string | null;
        startedRunId: string | null;
        errorText: string | null;
        createdAt: number;
        updatedAt: number;
    };
};

export type PatchChatSessionsBySessionIdQueueByQueueItemIdResponse = PatchChatSessionsBySessionIdQueueByQueueItemIdResponses[keyof PatchChatSessionsBySessionIdQueueByQueueItemIdResponses];

export type PostChatSessionsBySessionIdCancelData = {
    body?: never;
    path: {
        sessionId: string;
    };
    query?: never;
    url: '/chat/sessions/{sessionId}/cancel';
};

export type PostChatSessionsBySessionIdCancelResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type PostChatSessionsBySessionIdCancelResponse = PostChatSessionsBySessionIdCancelResponses[keyof PostChatSessionsBySessionIdCancelResponses];

export type PostChatSessionsBySessionIdTitleRegenerateData = {
    body?: never;
    path: {
        sessionId: string;
    };
    query?: never;
    url: '/chat/sessions/{sessionId}/title/regenerate';
};

export type PostChatSessionsBySessionIdTitleRegenerateResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        execution: {
            kind: 'local';
        } | {
            kind: 'remote-host';
            hostId: string;
            remoteSessionId: string;
        };
        parentSessionId: string | null;
        sideContextSource: 'provider-native' | 'cradle-context' | null;
        workspaceId: string | null;
        title: string | null;
        origin: string;
        providerTargetId: string | null;
        agentId: string | null;
        modelId: string | null;
        thinkingEffort: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra' | null;
        linkedIssueId: string | null;
        sessionGroupId: string | null;
        runtimeKind: string;
        status: 'idle' | 'streaming' | 'error';
        pinned: number;
        archivedAt: number | null;
        lastReadAt: number | null;
        createdAt: number;
        updatedAt: number;
        latestUserMessageAt: number | null;
        latestAssistantMessageAt: number | null;
        unread: boolean;
        isIsolated: boolean;
        worktreeId: string | null;
        worktreeBranch: string | null;
        worktreePath: string | null;
        worktreeHealth: 'ok' | 'missing' | 'stale' | null;
        pendingWorktreeId: string | null;
        isolationBoundaryRequired: boolean;
    };
};

export type PostChatSessionsBySessionIdTitleRegenerateResponse = PostChatSessionsBySessionIdTitleRegenerateResponses[keyof PostChatSessionsBySessionIdTitleRegenerateResponses];

export type GetChatSessionsBySessionIdRuntimeSettingsData = {
    body?: never;
    path: {
        sessionId: string;
    };
    query?: never;
    url: '/chat/sessions/{sessionId}/runtime-settings';
};

export type GetChatSessionsBySessionIdRuntimeSettingsResponses = {
    /**
     * Response for status 200
     */
    200: {
        sessionId: string;
        runtimeKind: string;
        runtimeSettings: {
            [key: string]: string | number | boolean;
        };
        claudeAgent: {
            modelAliases: {
                haiku: string;
                sonnet: string;
                opus: string;
            };
        } | null;
        applied: boolean;
    };
};

export type GetChatSessionsBySessionIdRuntimeSettingsResponse = GetChatSessionsBySessionIdRuntimeSettingsResponses[keyof GetChatSessionsBySessionIdRuntimeSettingsResponses];

export type PatchChatSessionsBySessionIdRuntimeSettingsData = {
    body: {
        permissionMode?: 'default' | 'acceptEdits' | 'bypassPermissions' | 'plan' | null;
        accessMode?: 'approval-required' | 'full-access' | null;
        interactionMode?: 'default' | 'plan' | null;
        claudeAgent?: {
            modelAliases?: {
                haiku?: string;
                sonnet?: string;
                opus?: string;
            };
        } | null;
        [key: string]: string | number | boolean | null | 'default' | 'acceptEdits' | 'bypassPermissions' | 'plan' | null | 'approval-required' | 'full-access' | null | 'default' | 'plan' | null | {
            modelAliases?: {
                haiku?: string;
                sonnet?: string;
                opus?: string;
            };
        } | null | undefined;
    };
    path: {
        sessionId: string;
    };
    query?: never;
    url: '/chat/sessions/{sessionId}/runtime-settings';
};

export type PatchChatSessionsBySessionIdRuntimeSettingsResponses = {
    /**
     * Response for status 200
     */
    200: {
        sessionId: string;
        runtimeKind: string;
        runtimeSettings: {
            [key: string]: string | number | boolean;
        };
        claudeAgent: {
            modelAliases: {
                haiku: string;
                sonnet: string;
                opus: string;
            };
        } | null;
        applied: boolean;
    };
};

export type PatchChatSessionsBySessionIdRuntimeSettingsResponse = PatchChatSessionsBySessionIdRuntimeSettingsResponses[keyof PatchChatSessionsBySessionIdRuntimeSettingsResponses];

export type PostChatSessionsBySessionIdResponseData = {
    body: {
        text?: string;
        files?: Array<{
            type: 'file';
            mediaType: string;
            filename?: string;
            url: string;
            providerMetadata?: unknown;
            [key: string]: unknown;
        }>;
        contextParts?: Array<{
            type: 'data-cradle-skill';
            name: string;
            path: string;
            scope: 'builtin' | 'legacy' | 'global' | 'repository' | 'workspace' | 'agent';
            description: string | null;
            position?: number;
        } | {
            type: 'data-cradle-plugin';
            provider?: 'cradle' | 'codex';
            pluginName: string;
            displayName: string;
            description: string | null;
            iconUrl?: string | null;
            routeSegment: string;
            capabilities: Array<{
                id: string;
                type: string;
                layer: 'server' | 'web' | 'desktop';
                label: string | null;
            }>;
            mcpServers: Array<string>;
            nativeMention?: {
                name: string;
                path: string;
            } | null;
            position?: number;
        } | {
            type: 'data-cradle-file-line-comment';
            workspaceId: string;
            path: string;
            lineStart: number;
            lineEnd: number;
            comment: string;
            position?: number;
        } | {
            type: 'data-cradle-intent';
            intentId: 'review' | 'commit' | 'push';
            name: string;
            label: string;
            prompt: string;
            position?: number;
        }>;
        messages?: Array<{
            id: string;
            role: 'system' | 'user' | 'assistant';
            parts: Array<{
                type: string;
                [key: string]: unknown;
            }>;
            metadata?: unknown;
            [key: string]: unknown;
        }>;
        providerTargetId?: string;
        modelId?: string | null;
        thinkingEffort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra';
        runtimeSettings?: {
            [key: string]: string | number | boolean | null;
        };
        reviewTarget?: {
            type: 'uncommittedChanges';
        } | {
            type: 'baseBranch';
            branch: string;
        };
    };
    path: {
        sessionId: string;
    };
    query?: never;
    url: '/chat/sessions/{sessionId}/response';
};

export type PostChatSessionsBySessionIdResponseResponses = {
    /**
     * Server-sent event stream encoded as AI SDK UIMessageChunk JSON frames. The stream emits chunks such as `start`, `text-start`, `text-delta`, `tool-input-available`, `tool-approval-request`, `tool-output-available`, `finish`, `abort`, and `error`.
     */
    200: string;
};

export type PostChatSessionsBySessionIdResponseResponse = PostChatSessionsBySessionIdResponseResponses[keyof PostChatSessionsBySessionIdResponseResponses];

export type PostChatSideConversationsBySideConversationIdResponseData = {
    body: {
        text?: string;
        files?: Array<{
            type: 'file';
            mediaType: string;
            filename?: string;
            url: string;
            providerMetadata?: unknown;
            [key: string]: unknown;
        }>;
        contextParts?: Array<{
            type: 'data-cradle-skill';
            name: string;
            path: string;
            scope: 'builtin' | 'legacy' | 'global' | 'repository' | 'workspace' | 'agent';
            description: string | null;
            position?: number;
        } | {
            type: 'data-cradle-plugin';
            provider?: 'cradle' | 'codex';
            pluginName: string;
            displayName: string;
            description: string | null;
            iconUrl?: string | null;
            routeSegment: string;
            capabilities: Array<{
                id: string;
                type: string;
                layer: 'server' | 'web' | 'desktop';
                label: string | null;
            }>;
            mcpServers: Array<string>;
            nativeMention?: {
                name: string;
                path: string;
            } | null;
            position?: number;
        } | {
            type: 'data-cradle-file-line-comment';
            workspaceId: string;
            path: string;
            lineStart: number;
            lineEnd: number;
            comment: string;
            position?: number;
        } | {
            type: 'data-cradle-intent';
            intentId: 'review' | 'commit' | 'push';
            name: string;
            label: string;
            prompt: string;
            position?: number;
        }>;
        messages?: Array<{
            id: string;
            role: 'system' | 'user' | 'assistant';
            parts: Array<{
                type: string;
                [key: string]: unknown;
            }>;
            metadata?: unknown;
            [key: string]: unknown;
        }>;
        providerTargetId?: string;
        modelId?: string | null;
        thinkingEffort?: 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'ultra';
        runtimeSettings?: {
            [key: string]: string | number | boolean | null;
        };
        reviewTarget?: {
            type: 'uncommittedChanges';
        } | {
            type: 'baseBranch';
            branch: string;
        };
    };
    path: {
        sideConversationId: string;
    };
    query?: never;
    url: '/chat/side-conversations/{sideConversationId}/response';
};

export type PostChatSessionsBySessionIdBangCommandData = {
    body: {
        command: string;
    };
    path: {
        sessionId: string;
    };
    query?: never;
    url: '/chat/sessions/{sessionId}/bang-command';
};

export type PostChatSessionsBySessionIdBangCommandResponses = {
    /**
     * Response for status 200
     */
    200: {
        command: string;
        stdout: string;
        stderr: string;
        exitCode: number | null;
        durationMs: number;
        timedOut: boolean;
        truncated: boolean;
        userMessageId: string;
        resultMessageId: string;
        userMessage: {
            id: string;
            role: 'system' | 'user' | 'assistant';
            parts: Array<{
                type: string;
                [key: string]: unknown;
            }>;
            metadata?: unknown;
            [key: string]: unknown;
        };
        resultMessage: {
            id: string;
            role: 'system' | 'user' | 'assistant';
            parts: Array<{
                type: string;
                [key: string]: unknown;
            }>;
            metadata?: unknown;
            [key: string]: unknown;
        };
    };
};

export type PostChatSessionsBySessionIdBangCommandResponse = PostChatSessionsBySessionIdBangCommandResponses[keyof PostChatSessionsBySessionIdBangCommandResponses];

export type PostChatSessionsBySessionIdBangTranscriptData = {
    body: {
        transcript: string;
        command?: string;
        durationMs?: number;
        exitCode?: number | null;
    };
    path: {
        sessionId: string;
    };
    query?: never;
    url: '/chat/sessions/{sessionId}/bang-transcript';
};

export type PostChatSessionsBySessionIdBangTranscriptResponses = {
    /**
     * Response for status 200
     */
    200: {
        command: string;
        stdout: string;
        stderr: string;
        exitCode: number | null;
        durationMs: number;
        timedOut: boolean;
        truncated: boolean;
        userMessageId: string;
        resultMessageId: string;
        userMessage: {
            id: string;
            role: 'system' | 'user' | 'assistant';
            parts: Array<{
                type: string;
                [key: string]: unknown;
            }>;
            metadata?: unknown;
            [key: string]: unknown;
        };
        resultMessage: {
            id: string;
            role: 'system' | 'user' | 'assistant';
            parts: Array<{
                type: string;
                [key: string]: unknown;
            }>;
            metadata?: unknown;
            [key: string]: unknown;
        };
    };
};

export type PostChatSessionsBySessionIdBangTranscriptResponse = PostChatSessionsBySessionIdBangTranscriptResponses[keyof PostChatSessionsBySessionIdBangTranscriptResponses];

export type PostChatSessionsBySessionIdObservationsData = {
    body: {
        text: string;
        entity?: string;
        entityType?: string;
        durationMs?: number;
        endReason?: string;
    };
    path: {
        sessionId: string;
    };
    query?: never;
    url: '/chat/sessions/{sessionId}/observations';
};

export type PostChatSessionsBySessionIdObservationsResponses = {
    /**
     * Response for status 200
     */
    200: {
        messageId: string;
    };
};

export type PostChatSessionsBySessionIdObservationsResponse = PostChatSessionsBySessionIdObservationsResponses[keyof PostChatSessionsBySessionIdObservationsResponses];

export type PostChatSessionsBySessionIdSideChatData = {
    body: {
        providerTargetId?: string;
        modelId?: string | null;
    };
    path: {
        sessionId: string;
    };
    query?: never;
    url: '/chat/sessions/{sessionId}/side-chat';
};

export type PostChatSessionsBySessionIdSideChatResponses = {
    /**
     * Response for status 200
     */
    200: {
        sideConversationId: string;
        parentSessionId: string;
        runtimeKind: string;
        providerTargetId: string | null;
        providerSessionId: string | null;
        title: string;
    };
};

export type PostChatSessionsBySessionIdSideChatResponse = PostChatSessionsBySessionIdSideChatResponses[keyof PostChatSessionsBySessionIdSideChatResponses];

export type PostChatSessionsBySessionIdQuickQuestionData = {
    body: {
        question: string;
    };
    path: {
        sessionId: string;
    };
    query?: never;
    url: '/chat/sessions/{sessionId}/quick-question';
};

export type PostChatSessionsBySessionIdQuickQuestionResponses = {
    /**
     * Server-sent event stream with AI SDK UIMessageChunk JSON frames
     */
    200: string;
};

export type PostChatSessionsBySessionIdQuickQuestionResponse = PostChatSessionsBySessionIdQuickQuestionResponses[keyof PostChatSessionsBySessionIdQuickQuestionResponses];

export type PostChatSessionsBySessionIdUserInputByRequestIdData = {
    body: {
        answers: {
            [key: string]: unknown;
        };
    };
    path: {
        sessionId: string;
        requestId: string;
    };
    query?: never;
    url: '/chat/sessions/{sessionId}/user-input/{requestId}';
};

export type PostChatSessionsBySessionIdUserInputByRequestIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        requestId: string;
        answers: {
            [key: string]: unknown;
        };
    };
};

export type PostChatSessionsBySessionIdUserInputByRequestIdResponse = PostChatSessionsBySessionIdUserInputByRequestIdResponses[keyof PostChatSessionsBySessionIdUserInputByRequestIdResponses];

export type PostChatSessionsBySessionIdToolApprovalByRequestIdData = {
    body: {
        approved: boolean;
        reason?: string;
    };
    path: {
        sessionId: string;
        requestId: string;
    };
    query?: never;
    url: '/chat/sessions/{sessionId}/tool-approval/{requestId}';
};

export type PostChatSessionsBySessionIdToolApprovalByRequestIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        requestId: string;
        approved: boolean;
        reason?: string;
    };
};

export type PostChatSessionsBySessionIdToolApprovalByRequestIdResponse = PostChatSessionsBySessionIdToolApprovalByRequestIdResponses[keyof PostChatSessionsBySessionIdToolApprovalByRequestIdResponses];

export type DeleteChatSideConversationsBySideConversationIdData = {
    body?: never;
    path: {
        sideConversationId: string;
    };
    query?: never;
    url: '/chat/side-conversations/{sideConversationId}';
};

export type DeleteChatSideConversationsBySideConversationIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type DeleteChatSideConversationsBySideConversationIdResponse = DeleteChatSideConversationsBySideConversationIdResponses[keyof DeleteChatSideConversationsBySideConversationIdResponses];

export type PostChatSessionsBySessionIdMessagesByMessageIdPlanImplementationApprovalData = {
    body: {
        approvalId: string;
        approved: boolean;
    };
    path: {
        sessionId: string;
        messageId: string;
    };
    query?: never;
    url: '/chat/sessions/{sessionId}/messages/{messageId}/plan-implementation-approval';
};

export type PostChatSessionsBySessionIdMessagesByMessageIdPlanImplementationApprovalResponses = {
    /**
     * Response for status 200
     */
    200: {
        message: {
            id: string;
            role: 'system' | 'user' | 'assistant';
            parts: Array<{
                type: string;
                [key: string]: unknown;
            }>;
            metadata?: unknown;
            [key: string]: unknown;
        };
    };
};

export type PostChatSessionsBySessionIdMessagesByMessageIdPlanImplementationApprovalResponse = PostChatSessionsBySessionIdMessagesByMessageIdPlanImplementationApprovalResponses[keyof PostChatSessionsBySessionIdMessagesByMessageIdPlanImplementationApprovalResponses];

export type GetChatSessionsBySessionIdStreamData = {
    body?: never;
    path: {
        sessionId: string;
    };
    query?: never;
    url: '/chat/sessions/{sessionId}/stream';
};

export type GetChatSessionsBySessionIdStreamResponses = {
    /**
     * AI SDK UIMessageChunk SSE stream for the currently active chat run. The stream sends one transient current-state snapshot before forwarding live chunks, so late subscribers can rebuild the active assistant message without retained chunk history.
     */
    200: string;
};

export type GetChatSessionsBySessionIdStreamResponse = GetChatSessionsBySessionIdStreamResponses[keyof GetChatSessionsBySessionIdStreamResponses];

export type GetChatSessionsBySessionIdMessagesData = {
    body?: never;
    path: {
        sessionId: string;
    };
    query?: {
        cursor?: string;
        limit?: number;
    };
    url: '/chat/sessions/{sessionId}/messages';
};

export type GetChatSessionsBySessionIdMessagesResponses = {
    /**
     * Response for status 200
     */
    200: {
        revision: number;
        rows: Array<{
            messageId: string;
            role: 'user' | 'assistant';
            status: 'streaming' | 'complete' | 'aborted' | 'failed';
            errorText?: string;
            preview: string;
            previewTruncated: boolean;
            parentMessageId: string | null;
            parentToolCallId: string | null;
            taskId: string | null;
            depth: number;
            message: {
                id: string;
                role: 'system' | 'user' | 'assistant';
                parts: Array<{
                    type: string;
                    [key: string]: unknown;
                }>;
                metadata?: unknown;
                [key: string]: unknown;
            };
        }>;
        nextCursor: string | null;
    };
};

export type GetChatSessionsBySessionIdMessagesResponse = GetChatSessionsBySessionIdMessagesResponses[keyof GetChatSessionsBySessionIdMessagesResponses];

export type GetChatSessionsBySessionIdMessagePreviewsData = {
    body?: never;
    path: {
        sessionId: string;
    };
    query?: {
        cursor?: string;
        limit?: number;
    };
    url: '/chat/sessions/{sessionId}/message-previews';
};

export type GetChatSessionsBySessionIdMessagePreviewsResponses = {
    /**
     * Response for status 200
     */
    200: {
        revision: number;
        rows: Array<{
            messageId: string;
            role: 'user' | 'assistant';
            status: 'streaming' | 'complete' | 'aborted' | 'failed';
            errorText?: string;
            preview: string;
            previewTruncated: boolean;
            parentMessageId: string | null;
            parentToolCallId: string | null;
            taskId: string | null;
            depth: number;
            message: {
                id: string;
                role: 'system' | 'user' | 'assistant';
                parts: Array<{
                    type: string;
                    [key: string]: unknown;
                }>;
                metadata?: unknown;
                [key: string]: unknown;
            };
        }>;
        nextCursor: string | null;
    };
};

export type GetChatSessionsBySessionIdMessagePreviewsResponse = GetChatSessionsBySessionIdMessagePreviewsResponses[keyof GetChatSessionsBySessionIdMessagePreviewsResponses];

export type GetChatSessionsBySessionIdMessagesByMessageIdData = {
    body?: never;
    path: {
        sessionId: string;
        messageId: string;
    };
    query?: never;
    url: '/chat/sessions/{sessionId}/messages/{messageId}';
};

export type GetChatSessionsBySessionIdMessagesByMessageIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        message: {
            id: string;
            role: 'system' | 'user' | 'assistant';
            parts: Array<{
                type: string;
                [key: string]: unknown;
            }>;
            metadata?: unknown;
            [key: string]: unknown;
        };
    };
};

export type GetChatSessionsBySessionIdMessagesByMessageIdResponse = GetChatSessionsBySessionIdMessagesByMessageIdResponses[keyof GetChatSessionsBySessionIdMessagesByMessageIdResponses];

export type GetChatRunsCompletedData = {
    body?: never;
    path?: never;
    query?: {
        since?: number;
        limit?: number;
    };
    url: '/chat/runs/completed';
};

export type GetChatRunsCompletedResponses = {
    /**
     * Response for status 200
     */
    200: {
        runs: Array<{
            runId: string;
            sessionId: string;
            sessionTitle: string;
            messageId: string | null;
            responseBody: string | null;
            messagePreview: string | null;
            startedAt: number;
            finishedAt: number;
        }>;
    };
};

export type GetChatRunsCompletedResponse = GetChatRunsCompletedResponses[keyof GetChatRunsCompletedResponses];

export type GetChatRunsByRunIdTraceData = {
    body?: never;
    path: {
        runId: string;
    };
    query?: never;
    url: '/chat/runs/{runId}/trace';
};

export type GetChatRunsByRunIdTraceResponses = {
    /**
     * Response for status 200
     */
    200: {
        runId: string;
        sessionId: string;
        messageId: string | null;
        status: 'streaming' | 'complete' | 'aborted' | 'failed';
        startedAt: number;
        finishedAt: number | null;
        path: string;
        recordCount: number;
        records: Array<{
            schema: 'cradle.chat-stream-trace.v1';
            seq: number;
            phase: 'run_started' | 'provider_raw' | 'mapper_output' | 'runtime_chunk' | 'sse_emit' | 'run_completed' | 'run_failed' | 'run_aborted';
            timestamp: number;
            chatSessionId: string;
            runId: string;
            messageId: string;
            runtimeKind: string;
            providerSessionId: string | null;
            toolCallId: string | null;
            payload: unknown;
        }>;
    };
};

export type GetChatRunsByRunIdTraceResponse = GetChatRunsByRunIdTraceResponses[keyof GetChatRunsByRunIdTraceResponses];

export type GetChatRunsByRunIdSnapshotData = {
    body?: never;
    path: {
        runId: string;
    };
    query?: never;
    url: '/chat/runs/{runId}/snapshot';
};

export type GetChatRunsByRunIdSnapshotResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        schemaVersion: number;
        traceId: string;
        chatSessionId: string | null;
        runId: string | null;
        messageId?: string;
        providerTargetId?: string;
        runtimeKind: string;
        providerSessionId?: string;
        modelId?: string;
        agentId?: string;
        workspaceId?: string;
        status: 'running' | 'complete' | 'aborted' | 'failed';
        startedAt: number;
        completedAt: number | null;
        completionReason?: string;
        errorText?: string;
        summary: {
            [key: string]: unknown;
        };
        events: Array<{
            id: string;
            snapshotId: string;
            chatSessionId: string | null;
            runId: string | null;
            seq: number;
            phase: string;
            chunkType?: string;
            toolCallId?: string;
            toolName?: string;
            modelId?: string;
            promptTokens?: number;
            completionTokens?: number;
            totalTokens?: number;
            estimatedCostUsd?: number;
            occurredAt: number;
            durationMs?: number;
            payload: {
                [key: string]: unknown;
            };
        }>;
        eventCount: number;
        eventsTruncated: boolean;
    };
};

export type GetChatRunsByRunIdSnapshotResponse = GetChatRunsByRunIdSnapshotResponses[keyof GetChatRunsByRunIdSnapshotResponses];

export type GetChatSessionsBySessionIdTracesData = {
    body?: never;
    path: {
        sessionId: string;
    };
    query?: never;
    url: '/chat/sessions/{sessionId}/traces';
};

export type GetChatSessionsBySessionIdTracesResponses = {
    /**
     * Response for status 200
     */
    200: {
        sessionId: string;
        traces: Array<{
            runId: string;
            sessionId: string;
            messageId: string | null;
            status: 'streaming' | 'complete' | 'aborted' | 'failed';
            startedAt: number;
            finishedAt: number | null;
            path: string;
            recordCount: number;
            records: Array<{
                schema: 'cradle.chat-stream-trace.v1';
                seq: number;
                phase: 'run_started' | 'provider_raw' | 'mapper_output' | 'runtime_chunk' | 'sse_emit' | 'run_completed' | 'run_failed' | 'run_aborted';
                timestamp: number;
                chatSessionId: string;
                runId: string;
                messageId: string;
                runtimeKind: string;
                providerSessionId: string | null;
                toolCallId: string | null;
                payload: unknown;
            }>;
        }>;
    };
};

export type GetChatSessionsBySessionIdTracesResponse = GetChatSessionsBySessionIdTracesResponses[keyof GetChatSessionsBySessionIdTracesResponses];

export type GetChatSessionsBySessionIdRunSnapshotsData = {
    body?: never;
    path: {
        sessionId: string;
    };
    query?: never;
    url: '/chat/sessions/{sessionId}/run-snapshots';
};

export type GetChatSessionsBySessionIdRunSnapshotsResponses = {
    /**
     * Response for status 200
     */
    200: {
        sessionId: string;
        snapshots: Array<{
            id: string;
            schemaVersion: number;
            traceId: string;
            chatSessionId: string | null;
            runId: string | null;
            messageId?: string;
            providerTargetId?: string;
            runtimeKind: string;
            providerSessionId?: string;
            modelId?: string;
            agentId?: string;
            workspaceId?: string;
            status: 'running' | 'complete' | 'aborted' | 'failed';
            startedAt: number;
            completedAt: number | null;
            completionReason?: string;
            errorText?: string;
            summary: {
                [key: string]: unknown;
            };
            events: Array<{
                id: string;
                snapshotId: string;
                chatSessionId: string | null;
                runId: string | null;
                seq: number;
                phase: string;
                chunkType?: string;
                toolCallId?: string;
                toolName?: string;
                modelId?: string;
                promptTokens?: number;
                completionTokens?: number;
                totalTokens?: number;
                estimatedCostUsd?: number;
                occurredAt: number;
                durationMs?: number;
                payload: {
                    [key: string]: unknown;
                };
            }>;
            eventCount: number;
            eventsTruncated: boolean;
        }>;
    };
};

export type GetChatSessionsBySessionIdRunSnapshotsResponse = GetChatSessionsBySessionIdRunSnapshotsResponses[keyof GetChatSessionsBySessionIdRunSnapshotsResponses];

export type GetConversationBridgeAdaptersData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/conversation-bridge/adapters';
};

export type GetConversationBridgeAdaptersResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        key: string;
        owner: string;
        id: string;
        platform: string;
        label: string;
        description: string | null;
        capabilities: {
            [key: string]: unknown;
        };
        registeredAt: number;
    }>;
};

export type GetConversationBridgeAdaptersResponse = GetConversationBridgeAdaptersResponses[keyof GetConversationBridgeAdaptersResponses];

export type GetConversationBridgeConnectionsData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/conversation-bridge/connections';
};

export type GetConversationBridgeConnectionsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        platform: string;
        adapterOwner: string;
        adapterId: string;
        displayName: string;
        enabled: boolean;
        secretRefs: {
            [key: string]: unknown;
        };
        config: {
            [key: string]: unknown;
        };
        healthStatus: 'unknown' | 'starting' | 'running' | 'stopped' | 'error';
        healthMessage: string | null;
        lastStartedAt: number | null;
        lastStoppedAt: number | null;
        lastErrorAt: number | null;
        createdAt: number;
        updatedAt: number;
    }>;
};

export type GetConversationBridgeConnectionsResponse = GetConversationBridgeConnectionsResponses[keyof GetConversationBridgeConnectionsResponses];

export type PostConversationBridgeConnectionsData = {
    body: {
        platform: string;
        adapterOwner: string;
        adapterId: string;
        displayName: string;
        enabled?: boolean;
        secretRefs?: {
            [key: string]: unknown;
        };
        config?: {
            [key: string]: unknown;
        };
    };
    path?: never;
    query?: never;
    url: '/conversation-bridge/connections';
};

export type PostConversationBridgeConnectionsResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        platform: string;
        adapterOwner: string;
        adapterId: string;
        displayName: string;
        enabled: boolean;
        secretRefs: {
            [key: string]: unknown;
        };
        config: {
            [key: string]: unknown;
        };
        healthStatus: 'unknown' | 'starting' | 'running' | 'stopped' | 'error';
        healthMessage: string | null;
        lastStartedAt: number | null;
        lastStoppedAt: number | null;
        lastErrorAt: number | null;
        createdAt: number;
        updatedAt: number;
    };
};

export type PostConversationBridgeConnectionsResponse = PostConversationBridgeConnectionsResponses[keyof PostConversationBridgeConnectionsResponses];

export type DeleteConversationBridgeConnectionsByIdData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/conversation-bridge/connections/{id}';
};

export type DeleteConversationBridgeConnectionsByIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type DeleteConversationBridgeConnectionsByIdResponse = DeleteConversationBridgeConnectionsByIdResponses[keyof DeleteConversationBridgeConnectionsByIdResponses];

export type GetConversationBridgeConnectionsByIdData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/conversation-bridge/connections/{id}';
};

export type GetConversationBridgeConnectionsByIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        platform: string;
        adapterOwner: string;
        adapterId: string;
        displayName: string;
        enabled: boolean;
        secretRefs: {
            [key: string]: unknown;
        };
        config: {
            [key: string]: unknown;
        };
        healthStatus: 'unknown' | 'starting' | 'running' | 'stopped' | 'error';
        healthMessage: string | null;
        lastStartedAt: number | null;
        lastStoppedAt: number | null;
        lastErrorAt: number | null;
        createdAt: number;
        updatedAt: number;
    };
};

export type GetConversationBridgeConnectionsByIdResponse = GetConversationBridgeConnectionsByIdResponses[keyof GetConversationBridgeConnectionsByIdResponses];

export type PatchConversationBridgeConnectionsByIdData = {
    body: {
        displayName?: string;
        enabled?: boolean;
        secretRefs?: {
            [key: string]: unknown;
        };
        config?: {
            [key: string]: unknown;
        };
    };
    path: {
        id: string;
    };
    query?: never;
    url: '/conversation-bridge/connections/{id}';
};

export type PatchConversationBridgeConnectionsByIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        platform: string;
        adapterOwner: string;
        adapterId: string;
        displayName: string;
        enabled: boolean;
        secretRefs: {
            [key: string]: unknown;
        };
        config: {
            [key: string]: unknown;
        };
        healthStatus: 'unknown' | 'starting' | 'running' | 'stopped' | 'error';
        healthMessage: string | null;
        lastStartedAt: number | null;
        lastStoppedAt: number | null;
        lastErrorAt: number | null;
        createdAt: number;
        updatedAt: number;
    };
};

export type PatchConversationBridgeConnectionsByIdResponse = PatchConversationBridgeConnectionsByIdResponses[keyof PatchConversationBridgeConnectionsByIdResponses];

export type PostConversationBridgeConnectionsByIdStartData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/conversation-bridge/connections/{id}/start';
};

export type PostConversationBridgeConnectionsByIdStartResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        platform: string;
        adapterOwner: string;
        adapterId: string;
        displayName: string;
        enabled: boolean;
        secretRefs: {
            [key: string]: unknown;
        };
        config: {
            [key: string]: unknown;
        };
        healthStatus: 'unknown' | 'starting' | 'running' | 'stopped' | 'error';
        healthMessage: string | null;
        lastStartedAt: number | null;
        lastStoppedAt: number | null;
        lastErrorAt: number | null;
        createdAt: number;
        updatedAt: number;
    };
};

export type PostConversationBridgeConnectionsByIdStartResponse = PostConversationBridgeConnectionsByIdStartResponses[keyof PostConversationBridgeConnectionsByIdStartResponses];

export type PostConversationBridgeConnectionsByIdStopData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/conversation-bridge/connections/{id}/stop';
};

export type PostConversationBridgeConnectionsByIdStopResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        platform: string;
        adapterOwner: string;
        adapterId: string;
        displayName: string;
        enabled: boolean;
        secretRefs: {
            [key: string]: unknown;
        };
        config: {
            [key: string]: unknown;
        };
        healthStatus: 'unknown' | 'starting' | 'running' | 'stopped' | 'error';
        healthMessage: string | null;
        lastStartedAt: number | null;
        lastStoppedAt: number | null;
        lastErrorAt: number | null;
        createdAt: number;
        updatedAt: number;
    };
};

export type PostConversationBridgeConnectionsByIdStopResponse = PostConversationBridgeConnectionsByIdStopResponses[keyof PostConversationBridgeConnectionsByIdStopResponses];

export type GetConversationBridgeConnectionsByIdChannelBindingsData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/conversation-bridge/connections/{id}/channel-bindings';
};

export type GetConversationBridgeConnectionsByIdChannelBindingsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        connectionId: string;
        externalWorkspaceId: string;
        externalChannelId: string;
        cradleWorkspaceId: string;
        sessionAgentId: string | null;
        sessionProviderTargetId: string | null;
        sessionRuntimeKind: string | null;
        sessionModelId: string | null;
        boundByExternalActorId: string | null;
        metadata: {
            [key: string]: unknown;
        };
        createdAt: number;
        updatedAt: number;
    }>;
};

export type GetConversationBridgeConnectionsByIdChannelBindingsResponse = GetConversationBridgeConnectionsByIdChannelBindingsResponses[keyof GetConversationBridgeConnectionsByIdChannelBindingsResponses];

export type DeleteConversationBridgeConnectionsByIdWorkspacesByExternalWorkspaceIdChannelsByExternalChannelIdBindingData = {
    body?: never;
    path: {
        id: string;
        externalWorkspaceId: string;
        externalChannelId: string;
    };
    query?: never;
    url: '/conversation-bridge/connections/{id}/workspaces/{externalWorkspaceId}/channels/{externalChannelId}/binding';
};

export type DeleteConversationBridgeConnectionsByIdWorkspacesByExternalWorkspaceIdChannelsByExternalChannelIdBindingResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type DeleteConversationBridgeConnectionsByIdWorkspacesByExternalWorkspaceIdChannelsByExternalChannelIdBindingResponse = DeleteConversationBridgeConnectionsByIdWorkspacesByExternalWorkspaceIdChannelsByExternalChannelIdBindingResponses[keyof DeleteConversationBridgeConnectionsByIdWorkspacesByExternalWorkspaceIdChannelsByExternalChannelIdBindingResponses];

export type PutConversationBridgeConnectionsByIdWorkspacesByExternalWorkspaceIdChannelsByExternalChannelIdBindingData = {
    body: {
        cradleWorkspaceId: string;
        sessionAgentId?: string | null;
        sessionProviderTargetId?: string | null;
        sessionRuntimeKind?: string | null;
        sessionModelId?: string | null;
        boundByExternalActorId?: string | null;
        metadata?: {
            [key: string]: unknown;
        };
    };
    path: {
        id: string;
        externalWorkspaceId: string;
        externalChannelId: string;
    };
    query?: never;
    url: '/conversation-bridge/connections/{id}/workspaces/{externalWorkspaceId}/channels/{externalChannelId}/binding';
};

export type PutConversationBridgeConnectionsByIdWorkspacesByExternalWorkspaceIdChannelsByExternalChannelIdBindingResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        connectionId: string;
        externalWorkspaceId: string;
        externalChannelId: string;
        cradleWorkspaceId: string;
        sessionAgentId: string | null;
        sessionProviderTargetId: string | null;
        sessionRuntimeKind: string | null;
        sessionModelId: string | null;
        boundByExternalActorId: string | null;
        metadata: {
            [key: string]: unknown;
        };
        createdAt: number;
        updatedAt: number;
    };
};

export type PutConversationBridgeConnectionsByIdWorkspacesByExternalWorkspaceIdChannelsByExternalChannelIdBindingResponse = PutConversationBridgeConnectionsByIdWorkspacesByExternalWorkspaceIdChannelsByExternalChannelIdBindingResponses[keyof PutConversationBridgeConnectionsByIdWorkspacesByExternalWorkspaceIdChannelsByExternalChannelIdBindingResponses];

export type GetConversationBridgeConnectionsByIdThreadsData = {
    body?: never;
    path: {
        id: string;
    };
    query?: {
        limit?: number;
    };
    url: '/conversation-bridge/connections/{id}/threads';
};

export type GetConversationBridgeConnectionsByIdThreadsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        connectionId: string;
        externalWorkspaceId: string;
        externalChannelId: string;
        externalThreadId: string;
        sessionId: string;
        cradleWorkspaceId: string | null;
        createdByExternalActorId: string | null;
        metadata: {
            [key: string]: unknown;
        };
        createdAt: number;
        updatedAt: number;
    }>;
};

export type GetConversationBridgeConnectionsByIdThreadsResponse = GetConversationBridgeConnectionsByIdThreadsResponses[keyof GetConversationBridgeConnectionsByIdThreadsResponses];

export type GetConversationBridgeDeliveryAttemptsRetryableData = {
    body?: never;
    path?: never;
    query?: {
        limit?: number;
    };
    url: '/conversation-bridge/delivery-attempts/retryable';
};

export type GetConversationBridgeDeliveryAttemptsRetryableResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        connectionId: string;
        externalWorkspaceId: string;
        externalChannelId: string;
        externalThreadId: string;
        sessionId: string;
        cradleMessageId: string | null;
        runId: string | null;
        payload: {
            [key: string]: unknown;
        };
        status: 'pending' | 'delivered' | 'failed';
        attemptCount: number;
        externalMessageId: string | null;
        errorText: string | null;
        createdAt: number;
        updatedAt: number;
    }>;
};

export type GetConversationBridgeDeliveryAttemptsRetryableResponse = GetConversationBridgeDeliveryAttemptsRetryableResponses[keyof GetConversationBridgeDeliveryAttemptsRetryableResponses];

export type PostConversationBridgeDeliveryAttemptsRetryData = {
    body?: never;
    path?: never;
    query?: {
        limit?: number;
    };
    url: '/conversation-bridge/delivery-attempts/retry';
};

export type PostConversationBridgeDeliveryAttemptsRetryResponses = {
    /**
     * Response for status 200
     */
    200: {
        attempted: number;
        delivered: number;
        failed: number;
    };
};

export type PostConversationBridgeDeliveryAttemptsRetryResponse = PostConversationBridgeDeliveryAttemptsRetryResponses[keyof PostConversationBridgeDeliveryAttemptsRetryResponses];

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

export type GetChronicleConfigResponses = {
    /**
     * Response for status 200
     */
    200: {
        profileId: string;
        modelId: string;
        workspaceId: string;
        enabled: boolean;
        activityPipelineEnabled: boolean;
        activityPipelineIntervalMs: number;
        activityPipelineBatchSize: number;
        dreamSchedulerEnabled?: boolean;
        dreamSchedulerIntervalMs?: number;
        dreamSchedulerApplyMerge?: boolean;
        audioCaptureEnabled: boolean;
        audioSource?: 'microphone' | 'system' | 'mixed';
        audioSegmentMs: number;
        audioSegmentIntervalMs: number;
        audioRmsThreshold: number;
        storageRoot: string;
        privacySensitiveAppBundleIds?: Array<string>;
        privacySensitiveTitlePatterns?: Array<string>;
        privacySensitiveUrlPatterns?: Array<string>;
        closedEyesDiscardEnabled?: boolean;
        closedEyesMode?: 'auto' | 'always-record' | 'always-pause';
    };
};

export type GetChronicleConfigResponse = GetChronicleConfigResponses[keyof GetChronicleConfigResponses];

export type PutChronicleConfigData = {
    body: {
        profileId: string;
        modelId: string;
        workspaceId: string;
        enabled: boolean;
        activityPipelineEnabled: boolean;
        activityPipelineIntervalMs: number;
        activityPipelineBatchSize: number;
        dreamSchedulerEnabled?: boolean;
        dreamSchedulerIntervalMs?: number;
        dreamSchedulerApplyMerge?: boolean;
        audioCaptureEnabled: boolean;
        audioSource?: 'microphone' | 'system' | 'mixed';
        audioSegmentMs: number;
        audioSegmentIntervalMs: number;
        audioRmsThreshold: number;
        storageRoot: string;
        privacySensitiveAppBundleIds?: Array<string>;
        privacySensitiveTitlePatterns?: Array<string>;
        privacySensitiveUrlPatterns?: Array<string>;
        closedEyesDiscardEnabled?: boolean;
        closedEyesMode?: 'auto' | 'always-record' | 'always-pause';
    };
    path?: never;
    query?: never;
    url: '/chronicle/config';
};

export type PutChronicleConfigResponses = {
    /**
     * Response for status 200
     */
    200: {
        profileId: string;
        modelId: string;
        workspaceId: string;
        enabled: boolean;
        activityPipelineEnabled: boolean;
        activityPipelineIntervalMs: number;
        activityPipelineBatchSize: number;
        dreamSchedulerEnabled?: boolean;
        dreamSchedulerIntervalMs?: number;
        dreamSchedulerApplyMerge?: boolean;
        audioCaptureEnabled: boolean;
        audioSource?: 'microphone' | 'system' | 'mixed';
        audioSegmentMs: number;
        audioSegmentIntervalMs: number;
        audioRmsThreshold: number;
        storageRoot: string;
        privacySensitiveAppBundleIds?: Array<string>;
        privacySensitiveTitlePatterns?: Array<string>;
        privacySensitiveUrlPatterns?: Array<string>;
        closedEyesDiscardEnabled?: boolean;
        closedEyesMode?: 'auto' | 'always-record' | 'always-pause';
    };
};

export type PutChronicleConfigResponse = PutChronicleConfigResponses[keyof PutChronicleConfigResponses];

export type PostChronicleSummarizeData = {
    body: {
        prompt: string;
        windowType: '10min' | '6h';
        sourceSnapshotIds?: Array<string>;
        sourceArtifactPaths?: Array<string>;
    };
    path?: never;
    query?: never;
    url: '/chronicle/summarize';
};

export type PostChronicleSummarizeResponses = {
    /**
     * Response for status 200
     */
    200: {
        summary: string;
        memoryId: string | null;
        status: 'success' | 'error';
    };
};

export type PostChronicleSummarizeResponse = PostChronicleSummarizeResponses[keyof PostChronicleSummarizeResponses];

export type PostChronicleSnapshotsData = {
    body: {
        sourceId: string;
        displayId: number;
        frameIndex?: number;
        capturedAt: string;
        segmentDir: string;
        framePath: string;
        capturePath?: string;
        ocrPath?: string;
        snapshotPath?: string;
        ocrText?: string;
        appBundleId?: string;
        windowTitle?: string;
        closedEyes?: {
            status?: 'open' | 'closed' | 'absent' | 'unknown';
            confidence?: number | null;
            detector?: string | null;
            discard?: boolean;
            reason?: string | null;
            metadata?: {
                [key: string]: unknown;
            };
        };
        accessibility?: {
            sourceId: string;
            status?: 'ready' | 'permission-denied' | 'unavailable' | 'error';
            provider?: string;
            accessibilityPath?: string | null;
            text?: string | null;
            elementCount?: number;
            appBundleId?: string | null;
            windowTitle?: string | null;
            tree?: Array<unknown>;
            metadata?: {
                [key: string]: unknown;
            };
        };
        metadata?: {
            [key: string]: unknown;
        };
    };
    path?: never;
    query?: never;
    url: '/chronicle/snapshots';
};

export type PostChronicleSnapshotsResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        sourceId: string;
        workspaceId: string | null;
        capturedAt: number;
        displayId: number;
        segmentDir: string;
        framePath: string;
        artifactPath: string | null;
        ocrText: string | null;
        appBundleId: string | null;
        windowTitle: string | null;
        metadataJson: string;
        createdAt: number;
        updatedAt: number;
    } | {
        status: 'ignored';
        reason: string;
        sourceId: string;
        capturedAt: string;
        capturedAtUnix: number;
    };
};

export type PostChronicleSnapshotsResponse = PostChronicleSnapshotsResponses[keyof PostChronicleSnapshotsResponses];

export type GetChronicleMemoriesData = {
    body?: never;
    path?: never;
    query?: {
        limit?: number;
    };
    url: '/chronicle/memories';
};

export type GetChronicleMemoriesResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        type: '10min' | '6h';
        source: 'llm' | 'local' | 'imported';
        createdAt: string;
        createdAtUnix: number;
        content: string;
        modelId: string | null;
        matchKind: 'keyword' | 'semantic' | 'hybrid' | null;
        keywordScore: number | null;
        semanticScore: number | null;
    }>;
};

export type GetChronicleMemoriesResponse = GetChronicleMemoriesResponses[keyof GetChronicleMemoriesResponses];

export type PostChronicleMemoriesData = {
    body: {
        sourceId: string;
        windowType: '10min' | '6h';
        createdAt: string;
        memoryPath?: string;
        content: string;
        summaryKind: 'llm' | 'local' | 'imported';
        sourceSnapshotPaths?: Array<string>;
        sourceFramePaths?: Array<string>;
        metadata?: {
            [key: string]: unknown;
        };
    };
    path?: never;
    query?: never;
    url: '/chronicle/memories';
};

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

export type GetChronicleStatusResponses = {
    /**
     * Response for status 200
     */
    200: {
        available: boolean;
        running: boolean;
        pid: number | null;
        lastCaptureAt: number | null;
        lastSummaryAt: number | null;
        lastErrorAt: number | null;
        lastError: string | null;
        lastExitCode: number | null;
        lastExitAt: number | null;
        totalSnapshots: number;
        totalSummaries: number;
        totalMessages: number;
        lastMessageAt: number | null;
        totalAccessibilitySnapshots: number;
        lastAccessibilitySnapshotAt: number | null;
        totalAccessibilityEvents: number;
        lastAccessibilityEventAt: number | null;
        totalAudioTranscripts: number;
        lastAudioTranscriptAt: number | null;
        totalAudioRawSegments: number;
        lastAudioRawSegmentAt: number | null;
        totalActivitySegments: number;
        lastActivitySegmentAt: number | null;
        totalPipelineRuns: number;
        lastPipelineRunAt: number | null;
        totalKnowledgeCards: number;
        lastKnowledgeCardAt: number | null;
        totalDreamRuns: number;
        lastDreamRunAt: number | null;
        dreamSchedulerEnabled: boolean;
        dreamSchedulerRunning: boolean;
        dreamSchedulerIntervalMs: number;
        dreamSchedulerApplyMerge: boolean;
        activityPipelineEnabled: boolean;
        activityPipelineRunning: boolean;
        activityPipelineIntervalMs: number;
        activityPipelineBatchSize: number;
        audioCaptureEnabled: boolean;
        audioRuntimeStatus: 'disabled' | 'armed' | 'unavailable';
        closedEyesDiscardEnabled: boolean;
        closedEyesMode: 'auto' | 'always-record' | 'always-pause';
        audioSource: 'microphone' | 'system' | 'mixed';
        configuredModel: string | null;
    };
};

export type GetChronicleStatusResponse = GetChronicleStatusResponses[keyof GetChronicleStatusResponses];

export type GetChronicleDaemonResourcesData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/chronicle/daemon/resources';
};

export type GetChronicleDaemonResourcesResponses = {
    /**
     * Response for status 200
     */
    200: {
        running: boolean;
        pid: number | null;
        rssMB: number | null;
        cpuPercent: number | null;
    };
};

export type GetChronicleDaemonResourcesResponse = GetChronicleDaemonResourcesResponses[keyof GetChronicleDaemonResourcesResponses];

export type GetChronicleModelResourcesData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/chronicle/model-resources';
};

export type GetChronicleModelResourcesResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        category: 'ocr' | 'audio-vad' | 'audio-asr' | 'speaker' | 'embedding' | 'pii';
        status: 'available' | 'missing' | 'installing' | 'installed' | 'error';
        displayName: string;
        path: string | null;
        version: string | null;
        message: string | null;
        sizeBytes: number | null;
        metadata: {
            [key: string]: unknown;
        };
        updatedAt: number;
    }>;
};

export type GetChronicleModelResourcesResponse = GetChronicleModelResourcesResponses[keyof GetChronicleModelResourcesResponses];

export type PostChronicleModelResourcesReconcileData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/chronicle/model-resources/reconcile';
};

export type PostChronicleModelResourcesReconcileResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        category: 'ocr' | 'audio-vad' | 'audio-asr' | 'speaker' | 'embedding' | 'pii';
        status: 'available' | 'missing' | 'installing' | 'installed' | 'error';
        displayName: string;
        path: string | null;
        version: string | null;
        message: string | null;
        sizeBytes: number | null;
        metadata: {
            [key: string]: unknown;
        };
        updatedAt: number;
    }>;
};

export type PostChronicleModelResourcesReconcileResponse = PostChronicleModelResourcesReconcileResponses[keyof PostChronicleModelResourcesReconcileResponses];

export type PostChronicleModelResourcesInstallAllData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/chronicle/model-resources/install-all';
};

export type PostChronicleModelResourcesInstallAllResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        category: 'ocr' | 'audio-vad' | 'audio-asr' | 'speaker' | 'embedding' | 'pii';
        status: 'available' | 'missing' | 'installing' | 'installed' | 'error';
        displayName: string;
        path: string | null;
        version: string | null;
        message: string | null;
        sizeBytes: number | null;
        metadata: {
            [key: string]: unknown;
        };
        updatedAt: number;
    }>;
};

export type PostChronicleModelResourcesInstallAllResponse = PostChronicleModelResourcesInstallAllResponses[keyof PostChronicleModelResourcesInstallAllResponses];

export type PostChronicleModelResourcesByCategoryVerifyData = {
    body?: never;
    path: {
        category: 'ocr' | 'audio-vad' | 'audio-asr' | 'speaker' | 'embedding' | 'pii';
    };
    query?: never;
    url: '/chronicle/model-resources/{category}/verify';
};

export type PostChronicleModelResourcesByCategoryVerifyResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        category: 'ocr' | 'audio-vad' | 'audio-asr' | 'speaker' | 'embedding' | 'pii';
        status: 'available' | 'missing' | 'installing' | 'installed' | 'error';
        displayName: string;
        path: string | null;
        version: string | null;
        message: string | null;
        sizeBytes: number | null;
        metadata: {
            [key: string]: unknown;
        };
        updatedAt: number;
    };
};

export type PostChronicleModelResourcesByCategoryVerifyResponse = PostChronicleModelResourcesByCategoryVerifyResponses[keyof PostChronicleModelResourcesByCategoryVerifyResponses];

export type PostChronicleModelResourcesByCategoryInstallData = {
    body: {
        source?: 'manifest' | 'local-files';
        sourceRoot?: string | null;
        files?: Array<{
            relativePath: string;
            sourcePath: string;
        }>;
    };
    path: {
        category: 'ocr' | 'audio-vad' | 'audio-asr' | 'speaker' | 'embedding' | 'pii';
    };
    query?: never;
    url: '/chronicle/model-resources/{category}/install';
};

export type PostChronicleModelResourcesByCategoryInstallResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        category: 'ocr' | 'audio-vad' | 'audio-asr' | 'speaker' | 'embedding' | 'pii';
        status: 'available' | 'missing' | 'installing' | 'installed' | 'error';
        displayName: string;
        path: string | null;
        version: string | null;
        message: string | null;
        sizeBytes: number | null;
        metadata: {
            [key: string]: unknown;
        };
        updatedAt: number;
    };
};

export type PostChronicleModelResourcesByCategoryInstallResponse = PostChronicleModelResourcesByCategoryInstallResponses[keyof PostChronicleModelResourcesByCategoryInstallResponses];

export type DeleteChronicleModelResourcesByCategoryData = {
    body?: never;
    path: {
        category: 'ocr' | 'audio-vad' | 'audio-asr' | 'speaker' | 'embedding' | 'pii';
    };
    query?: never;
    url: '/chronicle/model-resources/{category}';
};

export type DeleteChronicleModelResourcesByCategoryResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        category: 'ocr' | 'audio-vad' | 'audio-asr' | 'speaker' | 'embedding' | 'pii';
        status: 'available' | 'missing' | 'installing' | 'installed' | 'error';
        displayName: string;
        path: string | null;
        version: string | null;
        message: string | null;
        sizeBytes: number | null;
        metadata: {
            [key: string]: unknown;
        };
        updatedAt: number;
    };
};

export type DeleteChronicleModelResourcesByCategoryResponse = DeleteChronicleModelResourcesByCategoryResponses[keyof DeleteChronicleModelResourcesByCategoryResponses];

export type GetChronicleMessageSourcesData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/chronicle/message-sources';
};

export type GetChronicleMessageSourcesResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        platform: 'slack';
        label: string;
        enabled: boolean;
        workspaceId: string | null;
        teamId: string | null;
        botTokenRef: string | null;
        channelIds: Array<string>;
        realtimeMode: 'polling' | 'events-api' | 'socket-mode';
        signingSecretRef: string | null;
        status: 'idle' | 'syncing' | 'ready' | 'error' | 'disabled';
        lastSyncAt: number | null;
        lastMessageAt: number | null;
        lastError: string | null;
        createdAt: number;
        updatedAt: number;
    }>;
};

export type GetChronicleMessageSourcesResponse = GetChronicleMessageSourcesResponses[keyof GetChronicleMessageSourcesResponses];

export type PostChronicleMessageSourcesData = {
    body: {
        platform: 'slack';
        label: string;
        enabled: boolean;
        workspaceId?: string | null;
        teamId?: string | null;
        botTokenRef?: string | null;
        channelIds: Array<string>;
        realtimeMode?: 'polling' | 'events-api';
        signingSecretRef?: string | null;
    };
    path?: never;
    query?: never;
    url: '/chronicle/message-sources';
};

export type PostChronicleMessageSourcesResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        platform: 'slack';
        label: string;
        enabled: boolean;
        workspaceId: string | null;
        teamId: string | null;
        botTokenRef: string | null;
        channelIds: Array<string>;
        realtimeMode: 'polling' | 'events-api' | 'socket-mode';
        signingSecretRef: string | null;
        status: 'idle' | 'syncing' | 'ready' | 'error' | 'disabled';
        lastSyncAt: number | null;
        lastMessageAt: number | null;
        lastError: string | null;
        createdAt: number;
        updatedAt: number;
    };
};

export type PostChronicleMessageSourcesResponse = PostChronicleMessageSourcesResponses[keyof PostChronicleMessageSourcesResponses];

export type DeleteChronicleMessageSourcesBySourceIdData = {
    body?: never;
    path: {
        sourceId: string;
    };
    query?: never;
    url: '/chronicle/message-sources/{sourceId}';
};

export type DeleteChronicleMessageSourcesBySourceIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type DeleteChronicleMessageSourcesBySourceIdResponse = DeleteChronicleMessageSourcesBySourceIdResponses[keyof DeleteChronicleMessageSourcesBySourceIdResponses];

export type PatchChronicleMessageSourcesBySourceIdData = {
    body: {
        label?: string;
        enabled?: boolean;
        workspaceId?: string | null;
        teamId?: string | null;
        botTokenRef?: string | null;
        channelIds?: Array<string>;
        realtimeMode?: 'polling' | 'events-api';
        signingSecretRef?: string | null;
    };
    path: {
        sourceId: string;
    };
    query?: never;
    url: '/chronicle/message-sources/{sourceId}';
};

export type PatchChronicleMessageSourcesBySourceIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        platform: 'slack';
        label: string;
        enabled: boolean;
        workspaceId: string | null;
        teamId: string | null;
        botTokenRef: string | null;
        channelIds: Array<string>;
        realtimeMode: 'polling' | 'events-api' | 'socket-mode';
        signingSecretRef: string | null;
        status: 'idle' | 'syncing' | 'ready' | 'error' | 'disabled';
        lastSyncAt: number | null;
        lastMessageAt: number | null;
        lastError: string | null;
        createdAt: number;
        updatedAt: number;
    };
};

export type PatchChronicleMessageSourcesBySourceIdResponse = PatchChronicleMessageSourcesBySourceIdResponses[keyof PatchChronicleMessageSourcesBySourceIdResponses];

export type PostChronicleMessageSourcesBySourceIdSyncData = {
    body?: never;
    path: {
        sourceId: string;
    };
    query?: never;
    url: '/chronicle/message-sources/{sourceId}/sync';
};

export type PostChronicleMessageSourcesBySourceIdSyncResponses = {
    /**
     * Response for status 200
     */
    200: {
        sourceId: string;
        status: 'success' | 'error';
        ingested: number;
        message: string;
    };
};

export type PostChronicleMessageSourcesBySourceIdSyncResponse = PostChronicleMessageSourcesBySourceIdSyncResponses[keyof PostChronicleMessageSourcesBySourceIdSyncResponses];

export type PostChronicleMessageSourcesBySourceIdSlackEventsData = {
    body?: never;
    path: {
        sourceId: string;
    };
    query?: never;
    url: '/chronicle/message-sources/{sourceId}/slack/events';
};

export type GetChronicleMessagesData = {
    body?: never;
    path?: never;
    query?: {
        limit?: number;
    };
    url: '/chronicle/messages';
};

export type GetChronicleMessagesResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        sourceId: string;
        platform: 'slack';
        channelId: string;
        channelName: string | null;
        userName: string | null;
        text: string;
        messageTs: string;
        messageAt: string;
        messageAtUnix: number;
        permalink: string | null;
    }>;
};

export type GetChronicleMessagesResponse = GetChronicleMessagesResponses[keyof GetChronicleMessagesResponses];

export type GetChronicleAudioTranscriptsData = {
    body?: never;
    path?: never;
    query?: {
        limit?: number;
    };
    url: '/chronicle/audio-transcripts';
};

export type GetChronicleAudioTranscriptsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        sourceId: string;
        memoryId: string | null;
        title: string | null;
        source: 'asr' | 'manual' | 'imported';
        status: 'recording' | 'completed' | 'imported' | 'error';
        startedAt: string;
        startedAtUnix: number;
        endedAt: string | null;
        endedAtUnix: number | null;
        language: string | null;
        appBundleId: string | null;
        windowTitle: string | null;
        segmentCount: number;
        previewText: string;
        segments: Array<{
            id: string;
            segmentIndex: number;
            startMs: number;
            endMs: number | null;
            speakerLabel: string | null;
            text: string;
            confidence: number | null;
            language: string | null;
        }>;
    }>;
};

export type GetChronicleAudioTranscriptsResponse = GetChronicleAudioTranscriptsResponses[keyof GetChronicleAudioTranscriptsResponses];

export type PostChronicleAudioTranscriptsData = {
    body: {
        sourceId: string;
        title?: string | null;
        source?: 'asr' | 'manual' | 'imported';
        status?: 'recording' | 'completed' | 'imported' | 'error';
        startedAt: string;
        endedAt?: string | null;
        language?: string | null;
        appBundleId?: string | null;
        windowTitle?: string | null;
        audioPath?: string | null;
        transcriptPath?: string | null;
        segments: Array<{
            startMs: number;
            endMs?: number | null;
            speakerLabel?: string | null;
            text: string;
            confidence?: number | null;
            language?: string | null;
            metadata?: {
                [key: string]: unknown;
            };
        }>;
        metadata?: {
            [key: string]: unknown;
        };
    };
    path?: never;
    query?: never;
    url: '/chronicle/audio-transcripts';
};

export type PostChronicleAudioTranscriptsResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        sourceId: string;
        memoryId: string | null;
        title: string | null;
        source: 'asr' | 'manual' | 'imported';
        status: 'recording' | 'completed' | 'imported' | 'error';
        startedAt: string;
        startedAtUnix: number;
        endedAt: string | null;
        endedAtUnix: number | null;
        language: string | null;
        appBundleId: string | null;
        windowTitle: string | null;
        segmentCount: number;
        previewText: string;
        segments: Array<{
            id: string;
            segmentIndex: number;
            startMs: number;
            endMs: number | null;
            speakerLabel: string | null;
            text: string;
            confidence: number | null;
            language: string | null;
        }>;
    };
};

export type PostChronicleAudioTranscriptsResponse = PostChronicleAudioTranscriptsResponses[keyof PostChronicleAudioTranscriptsResponses];

export type GetChronicleSpeakerProfilesData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/chronicle/speaker-profiles';
};

export type GetChronicleSpeakerProfilesResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        workspaceId: string | null;
        displayName: string;
        normalizedLabel: string;
        aliases: Array<string>;
        embedding: Array<number> | null;
        embeddingDimensions: number | null;
        embeddingModelId: string | null;
        sampleCount: number;
        lastSeenAt: string | null;
        lastSeenAtUnix: number | null;
        sourceTranscriptId: string | null;
        sourceSegmentId: string | null;
        metadata: {
            [key: string]: unknown;
        };
        createdAt: string;
        createdAtUnix: number;
        updatedAt: string;
        updatedAtUnix: number;
    }>;
};

export type GetChronicleSpeakerProfilesResponse = GetChronicleSpeakerProfilesResponses[keyof GetChronicleSpeakerProfilesResponses];

export type PostChronicleSpeakerProfilesData = {
    body: {
        displayName: string;
        aliases?: Array<string>;
        embedding?: Array<number> | null;
        embeddingModelId?: string | null;
        sampleCount?: number;
        lastSeenAt?: string | null;
        metadata?: {
            [key: string]: unknown;
        };
    };
    path?: never;
    query?: never;
    url: '/chronicle/speaker-profiles';
};

export type PostChronicleSpeakerProfilesResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string | null;
        displayName: string;
        normalizedLabel: string;
        aliases: Array<string>;
        embedding: Array<number> | null;
        embeddingDimensions: number | null;
        embeddingModelId: string | null;
        sampleCount: number;
        lastSeenAt: string | null;
        lastSeenAtUnix: number | null;
        sourceTranscriptId: string | null;
        sourceSegmentId: string | null;
        metadata: {
            [key: string]: unknown;
        };
        createdAt: string;
        createdAtUnix: number;
        updatedAt: string;
        updatedAtUnix: number;
    };
};

export type PostChronicleSpeakerProfilesResponse = PostChronicleSpeakerProfilesResponses[keyof PostChronicleSpeakerProfilesResponses];

export type GetChronicleAudioRawSegmentsData = {
    body?: never;
    path?: never;
    query?: {
        limit?: number;
    };
    url: '/chronicle/audio-raw-segments';
};

export type GetChronicleAudioRawSegmentsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        sourceId: string;
        recordedAt: string;
        recordedAtUnix: number;
        source: 'microphone' | 'system' | 'mixed';
        status: 'captured' | 'queued' | 'processed' | 'ignored' | 'error';
        audioPath: string;
        metadataPath: string;
        sampleRate: number;
        channels: number;
        sampleCount: number;
        droppedSamples: number;
        durationMs: number;
        rms: number;
        peak: number;
        active: boolean;
        vadStatus: 'not-implemented' | 'pending' | 'ready' | 'error';
        asrStatus: 'not-implemented' | 'pending' | 'ready' | 'error';
        speakerStatus: 'not-implemented' | 'pending' | 'ready' | 'error';
        metadata: {
            [key: string]: unknown;
        };
    }>;
};

export type GetChronicleAudioRawSegmentsResponse = GetChronicleAudioRawSegmentsResponses[keyof GetChronicleAudioRawSegmentsResponses];

export type PostChronicleAudioRawSegmentsData = {
    body: {
        sourceId: string;
        recordedAt: string;
        source?: 'microphone' | 'system' | 'mixed';
        status?: 'captured' | 'queued' | 'processed' | 'ignored' | 'error';
        audioPath: string;
        metadataPath: string;
        sampleRate: number;
        channels: number;
        sampleCount: number;
        droppedSamples?: number;
        durationMs?: number;
        rms: number;
        peak: number;
        active: boolean;
        vadImplemented?: boolean;
        asrImplemented?: boolean;
        speakerLabelingImplemented?: boolean;
        metadata?: {
            [key: string]: unknown;
        };
    };
    path?: never;
    query?: never;
    url: '/chronicle/audio-raw-segments';
};

export type PostChronicleAudioRawSegmentsResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        sourceId: string;
        recordedAt: string;
        recordedAtUnix: number;
        source: 'microphone' | 'system' | 'mixed';
        status: 'captured' | 'queued' | 'processed' | 'ignored' | 'error';
        audioPath: string;
        metadataPath: string;
        sampleRate: number;
        channels: number;
        sampleCount: number;
        droppedSamples: number;
        durationMs: number;
        rms: number;
        peak: number;
        active: boolean;
        vadStatus: 'not-implemented' | 'pending' | 'ready' | 'error';
        asrStatus: 'not-implemented' | 'pending' | 'ready' | 'error';
        speakerStatus: 'not-implemented' | 'pending' | 'ready' | 'error';
        metadata: {
            [key: string]: unknown;
        };
    };
};

export type PostChronicleAudioRawSegmentsResponse = PostChronicleAudioRawSegmentsResponses[keyof PostChronicleAudioRawSegmentsResponses];

export type PostChronicleAudioRawSegmentsBySourceIdProcessingResultData = {
    body: {
        status?: 'captured' | 'queued' | 'processed' | 'ignored' | 'error';
        vadStatus?: 'not-implemented' | 'pending' | 'ready' | 'error';
        asrStatus?: 'not-implemented' | 'pending' | 'ready' | 'error';
        speakerStatus?: 'not-implemented' | 'pending' | 'ready' | 'error';
        transcriptSourceId?: string | null;
        speakerProfileIds?: Array<string>;
        errorMessage?: string | null;
        metadata?: {
            [key: string]: unknown;
        };
    };
    path: {
        sourceId: string;
    };
    query?: never;
    url: '/chronicle/audio-raw-segments/{sourceId}/processing-result';
};

export type PostChronicleAudioRawSegmentsBySourceIdProcessingResultResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        sourceId: string;
        recordedAt: string;
        recordedAtUnix: number;
        source: 'microphone' | 'system' | 'mixed';
        status: 'captured' | 'queued' | 'processed' | 'ignored' | 'error';
        audioPath: string;
        metadataPath: string;
        sampleRate: number;
        channels: number;
        sampleCount: number;
        droppedSamples: number;
        durationMs: number;
        rms: number;
        peak: number;
        active: boolean;
        vadStatus: 'not-implemented' | 'pending' | 'ready' | 'error';
        asrStatus: 'not-implemented' | 'pending' | 'ready' | 'error';
        speakerStatus: 'not-implemented' | 'pending' | 'ready' | 'error';
        metadata: {
            [key: string]: unknown;
        };
    };
};

export type PostChronicleAudioRawSegmentsBySourceIdProcessingResultResponse = PostChronicleAudioRawSegmentsBySourceIdProcessingResultResponses[keyof PostChronicleAudioRawSegmentsBySourceIdProcessingResultResponses];

export type GetChronicleAccessibilitySnapshotsData = {
    body?: never;
    path?: never;
    query?: {
        limit?: number;
    };
    url: '/chronicle/accessibility-snapshots';
};

export type GetChronicleAccessibilitySnapshotsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        sourceId: string;
        snapshotId: string | null;
        capturedAt: string;
        capturedAtUnix: number;
        status: 'ready' | 'permission-denied' | 'unavailable' | 'error';
        provider: string;
        appBundleId: string | null;
        windowTitle: string | null;
        elementCount: number;
        text: string | null;
        tree: Array<unknown>;
        metadata: {
            [key: string]: unknown;
        };
    }>;
};

export type GetChronicleAccessibilitySnapshotsResponse = GetChronicleAccessibilitySnapshotsResponses[keyof GetChronicleAccessibilitySnapshotsResponses];

export type GetChronicleAccessibilityEventsData = {
    body?: never;
    path?: never;
    query?: {
        limit?: number;
    };
    url: '/chronicle/accessibility-events';
};

export type GetChronicleAccessibilityEventsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        sourceId: string;
        snapshotId: string | null;
        accessibilitySnapshotId: string | null;
        capturedAt: string;
        capturedAtUnix: number;
        provider: string;
        appBundleId: string | null;
        pid: number | null;
        notification: string;
        droppedBefore: number;
        metadata: {
            [key: string]: unknown;
        };
    }>;
};

export type GetChronicleAccessibilityEventsResponse = GetChronicleAccessibilityEventsResponses[keyof GetChronicleAccessibilityEventsResponses];

export type PostChronicleAccessibilityEventsData = {
    body: {
        sourceId: string;
        capturedAt: string;
        provider?: string;
        appBundleId?: string | null;
        pid?: number | null;
        notification: string;
        droppedBefore?: number;
        snapshotId?: string | null;
        accessibilitySnapshotId?: string | null;
        metadata?: {
            [key: string]: unknown;
        };
    };
    path?: never;
    query?: never;
    url: '/chronicle/accessibility-events';
};

export type PostChronicleAccessibilityEventsResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        sourceId: string;
        snapshotId: string | null;
        accessibilitySnapshotId: string | null;
        capturedAt: string;
        capturedAtUnix: number;
        provider: string;
        appBundleId: string | null;
        pid: number | null;
        notification: string;
        droppedBefore: number;
        metadata: {
            [key: string]: unknown;
        };
    };
};

export type PostChronicleAccessibilityEventsResponse = PostChronicleAccessibilityEventsResponses[keyof PostChronicleAccessibilityEventsResponses];

export type GetChronicleActivitySegmentsData = {
    body?: never;
    path?: never;
    query?: {
        limit?: number;
    };
    url: '/chronicle/activity-segments';
};

export type GetChronicleActivitySegmentsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        sessionId: string;
        startedAt: string;
        startedAtUnix: number;
        endedAt: string;
        endedAtUnix: number;
        durationSeconds: number;
        segmentType: 'work' | 'meeting' | 'browsing' | 'chat' | 'audio' | 'idle' | 'unknown';
        frontApp: string | null;
        title: string | null;
        summary: string | null;
        sourceCounts: {
            [key: string]: unknown;
        };
        sourceRefs: {
            [key: string]: unknown;
        };
        pipelineStatus: 'collecting' | 'triaged' | 'summarized' | 'crystallized' | 'error';
        isCrystallized: boolean;
        metadata: {
            [key: string]: unknown;
        };
    }>;
};

export type GetChronicleActivitySegmentsResponse = GetChronicleActivitySegmentsResponses[keyof GetChronicleActivitySegmentsResponses];

export type GetChronicleActivitySessionsData = {
    body?: never;
    path?: never;
    query?: {
        limit?: number;
    };
    url: '/chronicle/activity-sessions';
};

export type GetChronicleActivitySessionsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        workspaceId: string | null;
        startedAt: string;
        startedAtUnix: number;
        endedAt: string | null;
        endedAtUnix: number | null;
        durationSeconds: number | null;
        frontApp: string | null;
        title: string | null;
        segmentCount: number;
        snapshotCount: number;
        messageCount: number;
        audioTranscriptCount: number;
        audioRawSegmentCount: number;
        accessibilitySnapshotCount: number;
        isMeeting: boolean;
        meetingTitle: string | null;
        metadata: {
            [key: string]: unknown;
        };
    }>;
};

export type GetChronicleActivitySessionsResponse = GetChronicleActivitySessionsResponses[keyof GetChronicleActivitySessionsResponses];

export type GetChronicleActivitySessionsBySessionIdData = {
    body?: never;
    path: {
        sessionId: string;
    };
    query?: never;
    url: '/chronicle/activity-sessions/{sessionId}';
};

export type GetChronicleActivitySessionsBySessionIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string | null;
        startedAt: string;
        startedAtUnix: number;
        endedAt: string | null;
        endedAtUnix: number | null;
        durationSeconds: number | null;
        frontApp: string | null;
        title: string | null;
        segmentCount: number;
        snapshotCount: number;
        messageCount: number;
        audioTranscriptCount: number;
        audioRawSegmentCount: number;
        accessibilitySnapshotCount: number;
        isMeeting: boolean;
        meetingTitle: string | null;
        metadata: {
            [key: string]: unknown;
        };
        segments: Array<{
            id: string;
            sessionId: string;
            startedAt: string;
            startedAtUnix: number;
            endedAt: string;
            endedAtUnix: number;
            durationSeconds: number;
            segmentType: 'work' | 'meeting' | 'browsing' | 'chat' | 'audio' | 'idle' | 'unknown';
            frontApp: string | null;
            title: string | null;
            summary: string | null;
            sourceCounts: {
                [key: string]: unknown;
            };
            sourceRefs: {
                [key: string]: unknown;
            };
            pipelineStatus: 'collecting' | 'triaged' | 'summarized' | 'crystallized' | 'error';
            isCrystallized: boolean;
            metadata: {
                [key: string]: unknown;
            };
        }>;
    };
};

export type GetChronicleActivitySessionsBySessionIdResponse = GetChronicleActivitySessionsBySessionIdResponses[keyof GetChronicleActivitySessionsBySessionIdResponses];

export type GetChronicleActivitySessionsBySessionIdSnapshotsData = {
    body?: never;
    path: {
        sessionId: string;
    };
    query?: never;
    url: '/chronicle/activity-sessions/{sessionId}/snapshots';
};

export type GetChronicleActivitySessionsBySessionIdSnapshotsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        sourceId: string;
        workspaceId: string | null;
        capturedAt: string;
        capturedAtUnix: number;
        displayId: number;
        segmentDir: string;
        framePath: string;
        artifactPath: string | null;
        ocrText: string | null;
        appBundleId: string | null;
        windowTitle: string | null;
        metadata: {
            [key: string]: unknown;
        };
        createdAt: string;
        createdAtUnix: number;
        updatedAt: string;
        updatedAtUnix: number;
    }>;
};

export type GetChronicleActivitySessionsBySessionIdSnapshotsResponse = GetChronicleActivitySessionsBySessionIdSnapshotsResponses[keyof GetChronicleActivitySessionsBySessionIdSnapshotsResponses];

export type GetChronicleActivitySnapshotsBySnapshotIdData = {
    body?: never;
    path: {
        snapshotId: string;
    };
    query?: never;
    url: '/chronicle/activity-snapshots/{snapshotId}';
};

export type GetChronicleActivitySnapshotsBySnapshotIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        sourceId: string;
        workspaceId: string | null;
        capturedAt: string;
        capturedAtUnix: number;
        displayId: number;
        segmentDir: string;
        framePath: string;
        artifactPath: string | null;
        ocrText: string | null;
        appBundleId: string | null;
        windowTitle: string | null;
        metadata: {
            [key: string]: unknown;
        };
        createdAt: string;
        createdAtUnix: number;
        updatedAt: string;
        updatedAtUnix: number;
    };
};

export type GetChronicleActivitySnapshotsBySnapshotIdResponse = GetChronicleActivitySnapshotsBySnapshotIdResponses[keyof GetChronicleActivitySnapshotsBySnapshotIdResponses];

export type GetChronicleActivitySnapshotsBySnapshotIdOcrData = {
    body?: never;
    path: {
        snapshotId: string;
    };
    query?: never;
    url: '/chronicle/activity-snapshots/{snapshotId}/ocr';
};

export type GetChronicleActivitySnapshotsBySnapshotIdOcrResponses = {
    /**
     * Response for status 200
     */
    200: {
        snapshotId: string;
        sourceId: string;
        ocrText: string | null;
        ocrPath: string | null;
        capturedAt: string;
        capturedAtUnix: number;
    };
};

export type GetChronicleActivitySnapshotsBySnapshotIdOcrResponse = GetChronicleActivitySnapshotsBySnapshotIdOcrResponses[keyof GetChronicleActivitySnapshotsBySnapshotIdOcrResponses];

export type GetChronicleActivitySegmentsBySegmentIdData = {
    body?: never;
    path: {
        segmentId: string;
    };
    query?: never;
    url: '/chronicle/activity-segments/{segmentId}';
};

export type GetChronicleActivitySegmentsBySegmentIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        sessionId: string;
        startedAt: string;
        startedAtUnix: number;
        endedAt: string;
        endedAtUnix: number;
        durationSeconds: number;
        segmentType: 'work' | 'meeting' | 'browsing' | 'chat' | 'audio' | 'idle' | 'unknown';
        frontApp: string | null;
        title: string | null;
        summary: string | null;
        sourceCounts: {
            [key: string]: unknown;
        };
        sourceRefs: {
            [key: string]: unknown;
        };
        pipelineStatus: 'collecting' | 'triaged' | 'summarized' | 'crystallized' | 'error';
        isCrystallized: boolean;
        metadata: {
            [key: string]: unknown;
        };
    };
};

export type GetChronicleActivitySegmentsBySegmentIdResponse = GetChronicleActivitySegmentsBySegmentIdResponses[keyof GetChronicleActivitySegmentsBySegmentIdResponses];

export type PostChronicleActivitySegmentsBySegmentIdTriageData = {
    body?: never;
    path: {
        segmentId: string;
    };
    query?: never;
    url: '/chronicle/activity-segments/{segmentId}/triage';
};

export type PostChronicleActivitySegmentsBySegmentIdTriageResponses = {
    /**
     * Response for status 200
     */
    200: {
        segment: {
            id: string;
            sessionId: string;
            startedAt: string;
            startedAtUnix: number;
            endedAt: string;
            endedAtUnix: number;
            durationSeconds: number;
            segmentType: 'work' | 'meeting' | 'browsing' | 'chat' | 'audio' | 'idle' | 'unknown';
            frontApp: string | null;
            title: string | null;
            summary: string | null;
            sourceCounts: {
                [key: string]: unknown;
            };
            sourceRefs: {
                [key: string]: unknown;
            };
            pipelineStatus: 'collecting' | 'triaged' | 'summarized' | 'crystallized' | 'error';
            isCrystallized: boolean;
            metadata: {
                [key: string]: unknown;
            };
        };
        run: {
            id: string;
            sessionId: string | null;
            segmentId: string | null;
            trigger: 'snapshot' | 'message' | 'audio-raw' | 'audio-transcript' | 'memory' | 'manual' | 'summarize';
            stage: 'collection' | 'segmentation' | 'triage' | 'summarization' | 'crystallization';
            status: 'queued' | 'running' | 'success' | 'error' | 'skipped';
            startedAt: string;
            startedAtUnix: number;
            endedAt: string | null;
            endedAtUnix: number | null;
            errorMessage: string | null;
            snapshotsCount: number;
            messagesCount: number;
            audioTranscriptsCount: number;
            audioRawSegmentsCount: number;
            memoriesCount: number;
            segmentsCount: number;
            segmentIds: Array<string>;
            metadata: {
                [key: string]: unknown;
            };
        };
        memoryId: string | null;
        knowledgeCards?: Array<{
            id: string;
            title: string;
            content: string;
            cardType: 'fact' | 'insight' | 'decision' | 'task' | 'pattern';
            dimension: 'technical' | 'business' | 'personal' | 'project' | 'general';
            confidence: number;
            sourceMemoryIds: Array<string>;
            sourceSegmentIds: Array<string>;
            sourceChunkIds: Array<string>;
            tags: Array<string>;
            contentHash: string;
            version: number;
            status: 'active' | 'merged' | 'archived' | 'deleted';
            mergedIntoId: string | null;
            pinned: boolean;
            metadata: {
                [key: string]: unknown;
            };
            createdAt: string;
            createdAtUnix: number;
            updatedAt: string;
            updatedAtUnix: number;
        }>;
        status: 'success' | 'error' | 'skipped';
        message: string;
    };
};

export type PostChronicleActivitySegmentsBySegmentIdTriageResponse = PostChronicleActivitySegmentsBySegmentIdTriageResponses[keyof PostChronicleActivitySegmentsBySegmentIdTriageResponses];

export type PostChronicleActivitySegmentsBySegmentIdSummarizeData = {
    body?: never;
    path: {
        segmentId: string;
    };
    query?: never;
    url: '/chronicle/activity-segments/{segmentId}/summarize';
};

export type PostChronicleActivitySegmentsBySegmentIdSummarizeResponses = {
    /**
     * Response for status 200
     */
    200: {
        segment: {
            id: string;
            sessionId: string;
            startedAt: string;
            startedAtUnix: number;
            endedAt: string;
            endedAtUnix: number;
            durationSeconds: number;
            segmentType: 'work' | 'meeting' | 'browsing' | 'chat' | 'audio' | 'idle' | 'unknown';
            frontApp: string | null;
            title: string | null;
            summary: string | null;
            sourceCounts: {
                [key: string]: unknown;
            };
            sourceRefs: {
                [key: string]: unknown;
            };
            pipelineStatus: 'collecting' | 'triaged' | 'summarized' | 'crystallized' | 'error';
            isCrystallized: boolean;
            metadata: {
                [key: string]: unknown;
            };
        };
        run: {
            id: string;
            sessionId: string | null;
            segmentId: string | null;
            trigger: 'snapshot' | 'message' | 'audio-raw' | 'audio-transcript' | 'memory' | 'manual' | 'summarize';
            stage: 'collection' | 'segmentation' | 'triage' | 'summarization' | 'crystallization';
            status: 'queued' | 'running' | 'success' | 'error' | 'skipped';
            startedAt: string;
            startedAtUnix: number;
            endedAt: string | null;
            endedAtUnix: number | null;
            errorMessage: string | null;
            snapshotsCount: number;
            messagesCount: number;
            audioTranscriptsCount: number;
            audioRawSegmentsCount: number;
            memoriesCount: number;
            segmentsCount: number;
            segmentIds: Array<string>;
            metadata: {
                [key: string]: unknown;
            };
        };
        memoryId: string | null;
        knowledgeCards?: Array<{
            id: string;
            title: string;
            content: string;
            cardType: 'fact' | 'insight' | 'decision' | 'task' | 'pattern';
            dimension: 'technical' | 'business' | 'personal' | 'project' | 'general';
            confidence: number;
            sourceMemoryIds: Array<string>;
            sourceSegmentIds: Array<string>;
            sourceChunkIds: Array<string>;
            tags: Array<string>;
            contentHash: string;
            version: number;
            status: 'active' | 'merged' | 'archived' | 'deleted';
            mergedIntoId: string | null;
            pinned: boolean;
            metadata: {
                [key: string]: unknown;
            };
            createdAt: string;
            createdAtUnix: number;
            updatedAt: string;
            updatedAtUnix: number;
        }>;
        status: 'success' | 'error' | 'skipped';
        message: string;
    };
};

export type PostChronicleActivitySegmentsBySegmentIdSummarizeResponse = PostChronicleActivitySegmentsBySegmentIdSummarizeResponses[keyof PostChronicleActivitySegmentsBySegmentIdSummarizeResponses];

export type PostChronicleActivitySegmentsBySegmentIdCrystallizeData = {
    body?: never;
    path: {
        segmentId: string;
    };
    query?: never;
    url: '/chronicle/activity-segments/{segmentId}/crystallize';
};

export type PostChronicleActivitySegmentsBySegmentIdCrystallizeResponses = {
    /**
     * Response for status 200
     */
    200: {
        segment: {
            id: string;
            sessionId: string;
            startedAt: string;
            startedAtUnix: number;
            endedAt: string;
            endedAtUnix: number;
            durationSeconds: number;
            segmentType: 'work' | 'meeting' | 'browsing' | 'chat' | 'audio' | 'idle' | 'unknown';
            frontApp: string | null;
            title: string | null;
            summary: string | null;
            sourceCounts: {
                [key: string]: unknown;
            };
            sourceRefs: {
                [key: string]: unknown;
            };
            pipelineStatus: 'collecting' | 'triaged' | 'summarized' | 'crystallized' | 'error';
            isCrystallized: boolean;
            metadata: {
                [key: string]: unknown;
            };
        };
        run: {
            id: string;
            sessionId: string | null;
            segmentId: string | null;
            trigger: 'snapshot' | 'message' | 'audio-raw' | 'audio-transcript' | 'memory' | 'manual' | 'summarize';
            stage: 'collection' | 'segmentation' | 'triage' | 'summarization' | 'crystallization';
            status: 'queued' | 'running' | 'success' | 'error' | 'skipped';
            startedAt: string;
            startedAtUnix: number;
            endedAt: string | null;
            endedAtUnix: number | null;
            errorMessage: string | null;
            snapshotsCount: number;
            messagesCount: number;
            audioTranscriptsCount: number;
            audioRawSegmentsCount: number;
            memoriesCount: number;
            segmentsCount: number;
            segmentIds: Array<string>;
            metadata: {
                [key: string]: unknown;
            };
        };
        memoryId: string | null;
        knowledgeCards?: Array<{
            id: string;
            title: string;
            content: string;
            cardType: 'fact' | 'insight' | 'decision' | 'task' | 'pattern';
            dimension: 'technical' | 'business' | 'personal' | 'project' | 'general';
            confidence: number;
            sourceMemoryIds: Array<string>;
            sourceSegmentIds: Array<string>;
            sourceChunkIds: Array<string>;
            tags: Array<string>;
            contentHash: string;
            version: number;
            status: 'active' | 'merged' | 'archived' | 'deleted';
            mergedIntoId: string | null;
            pinned: boolean;
            metadata: {
                [key: string]: unknown;
            };
            createdAt: string;
            createdAtUnix: number;
            updatedAt: string;
            updatedAtUnix: number;
        }>;
        status: 'success' | 'error' | 'skipped';
        message: string;
    };
};

export type PostChronicleActivitySegmentsBySegmentIdCrystallizeResponse = PostChronicleActivitySegmentsBySegmentIdCrystallizeResponses[keyof PostChronicleActivitySegmentsBySegmentIdCrystallizeResponses];

export type PostChronicleActivityPipelineTickData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/chronicle/activity-pipeline/tick';
};

export type PostChronicleActivityPipelineTickResponses = {
    /**
     * Response for status 200
     */
    200: {
        checked: number;
        triaged: number;
        summarized: number;
        crystallized: number;
        skipped: number;
        errors: number;
    };
};

export type PostChronicleActivityPipelineTickResponse = PostChronicleActivityPipelineTickResponses[keyof PostChronicleActivityPipelineTickResponses];

export type GetChronicleActivityMonitorStatusData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/chronicle/activity-monitor/status';
};

export type GetChronicleActivityMonitorStatusResponses = {
    /**
     * Response for status 200
     */
    200: {
        enabled: boolean;
        available: boolean;
        running: boolean;
        pid: number | null;
        monitorStatus: 'disabled' | 'running' | 'unavailable';
        captureStatus: 'idle' | 'capturing' | 'error';
        pipelineStatus: 'disabled' | 'running' | 'idle';
        audioStatus: 'disabled' | 'armed' | 'unavailable';
        lastCaptureAt: string | null;
        lastCaptureAtUnix: number | null;
        lastActivityAt: string | null;
        lastActivityAtUnix: number | null;
        lastPipelineRunAt: string | null;
        lastPipelineRunAtUnix: number | null;
        lastErrorAt: string | null;
        lastErrorAtUnix: number | null;
        lastError: string | null;
        totals: {
            snapshots: number;
            activitySessions: number;
            activitySegments: number;
            pipelineRuns: number;
            accessibilitySnapshots: number;
            accessibilityEvents: number;
            audioTranscripts: number;
            audioRawSegments: number;
            memories: number;
            messages: number;
        };
        config: {
            activityPipelineEnabled: boolean;
            activityPipelineIntervalMs: number;
            activityPipelineBatchSize: number;
            audioCaptureEnabled: boolean;
            audioSource: 'microphone' | 'system' | 'mixed';
            closedEyesDiscardEnabled: boolean;
            closedEyesMode: 'auto' | 'always-record' | 'always-pause';
        };
    };
};

export type GetChronicleActivityMonitorStatusResponse = GetChronicleActivityMonitorStatusResponses[keyof GetChronicleActivityMonitorStatusResponses];

export type GetChronicleActivityStorageStatsData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/chronicle/activity-storage/stats';
};

export type GetChronicleActivityStorageStatsResponses = {
    /**
     * Response for status 200
     */
    200: {
        storageRoot: string;
        modelsRoot: string;
        storage: {
            exists: boolean;
            fileCount: number;
            directoryCount: number;
            totalBytes: number;
        };
        models: {
            exists: boolean;
            fileCount: number;
            directoryCount: number;
            totalBytes: number;
        };
        database: {
            snapshots: number;
            activitySessions: number;
            activitySegments: number;
            memories: number;
            memoryChunks: number;
            knowledgeCards: number;
            pipelineRuns: number;
            dreamRuns: number;
            accessibilitySnapshots: number;
            accessibilityEvents: number;
            audioTranscripts: number;
            audioRawSegments: number;
            messages: number;
            modelResources: number;
        };
    };
};

export type GetChronicleActivityStorageStatsResponse = GetChronicleActivityStorageStatsResponses[keyof GetChronicleActivityStorageStatsResponses];

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

export type GetChronicleMemoryStatusResponses = {
    /**
     * Response for status 200
     */
    200: {
        available: boolean;
        totalMemories: number;
        totalChunks: number;
        totalKeywords: number;
        totalEmbeddings: number;
        totalKnowledgeCards: number;
        totalKnowledgeVersions: number;
        totalActivitySegments: number;
        pendingActivitySegments: number;
        crystallizedActivitySegments: number;
        totalPipelineRuns: number;
        lastMemoryAt: string | null;
        lastMemoryAtUnix: number | null;
        lastKnowledgeCardAt: string | null;
        lastKnowledgeCardAtUnix: number | null;
        lastPipelineRunAt: string | null;
        lastPipelineRunAtUnix: number | null;
        searchIndex: {
            chunkCount: number;
            keywordCount: number;
            embeddingCount: number;
            embeddingReadyCount: number;
            embeddingPendingCount: number;
            embeddingErrorCount: number;
        };
        pipeline: {
            activityPipelineEnabled: boolean;
            activityPipelineRunning: boolean;
            dreamSchedulerEnabled: boolean;
            dreamSchedulerRunning: boolean;
        };
    };
};

export type GetChronicleMemoryStatusResponse = GetChronicleMemoryStatusResponses[keyof GetChronicleMemoryStatusResponses];

export type GetChroniclePipelineRunsData = {
    body?: never;
    path?: never;
    query?: {
        limit?: number;
    };
    url: '/chronicle/pipeline-runs';
};

export type GetChroniclePipelineRunsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        sessionId: string | null;
        segmentId: string | null;
        trigger: 'snapshot' | 'message' | 'audio-raw' | 'audio-transcript' | 'memory' | 'manual' | 'summarize';
        stage: 'collection' | 'segmentation' | 'triage' | 'summarization' | 'crystallization';
        status: 'queued' | 'running' | 'success' | 'error' | 'skipped';
        startedAt: string;
        startedAtUnix: number;
        endedAt: string | null;
        endedAtUnix: number | null;
        errorMessage: string | null;
        snapshotsCount: number;
        messagesCount: number;
        audioTranscriptsCount: number;
        audioRawSegmentsCount: number;
        memoriesCount: number;
        segmentsCount: number;
        segmentIds: Array<string>;
        metadata: {
            [key: string]: unknown;
        };
    }>;
};

export type GetChroniclePipelineRunsResponse = GetChroniclePipelineRunsResponses[keyof GetChroniclePipelineRunsResponses];

export type GetChronicleKnowledgeCardsData = {
    body?: never;
    path?: never;
    query?: {
        limit?: number;
        dimension?: 'technical' | 'business' | 'personal' | 'project' | 'general';
        type?: 'fact' | 'insight' | 'decision' | 'task' | 'pattern';
        includeDeleted?: boolean;
    };
    url: '/chronicle/knowledge-cards';
};

export type GetChronicleKnowledgeCardsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        title: string;
        content: string;
        cardType: 'fact' | 'insight' | 'decision' | 'task' | 'pattern';
        dimension: 'technical' | 'business' | 'personal' | 'project' | 'general';
        confidence: number;
        sourceMemoryIds: Array<string>;
        sourceSegmentIds: Array<string>;
        sourceChunkIds: Array<string>;
        tags: Array<string>;
        contentHash: string;
        version: number;
        status: 'active' | 'merged' | 'archived' | 'deleted';
        mergedIntoId: string | null;
        pinned: boolean;
        metadata: {
            [key: string]: unknown;
        };
        createdAt: string;
        createdAtUnix: number;
        updatedAt: string;
        updatedAtUnix: number;
    }>;
};

export type GetChronicleKnowledgeCardsResponse = GetChronicleKnowledgeCardsResponses[keyof GetChronicleKnowledgeCardsResponses];

export type PostChronicleKnowledgeCardsData = {
    body: {
        title: string;
        content: string;
        cardType?: 'fact' | 'insight' | 'decision' | 'task' | 'pattern';
        dimension?: 'technical' | 'business' | 'personal' | 'project' | 'general';
        confidence?: number;
        sourceMemoryIds?: Array<string>;
        sourceSegmentIds?: Array<string>;
        sourceChunkIds?: Array<string>;
        tags?: Array<string>;
        stableKey?: string;
        pinned?: boolean;
        metadata?: {
            [key: string]: unknown;
        };
    };
    path?: never;
    query?: never;
    url: '/chronicle/knowledge-cards';
};

export type PostChronicleKnowledgeCardsResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        title: string;
        content: string;
        cardType: 'fact' | 'insight' | 'decision' | 'task' | 'pattern';
        dimension: 'technical' | 'business' | 'personal' | 'project' | 'general';
        confidence: number;
        sourceMemoryIds: Array<string>;
        sourceSegmentIds: Array<string>;
        sourceChunkIds: Array<string>;
        tags: Array<string>;
        contentHash: string;
        version: number;
        status: 'active' | 'merged' | 'archived' | 'deleted';
        mergedIntoId: string | null;
        pinned: boolean;
        metadata: {
            [key: string]: unknown;
        };
        createdAt: string;
        createdAtUnix: number;
        updatedAt: string;
        updatedAtUnix: number;
    };
};

export type PostChronicleKnowledgeCardsResponse = PostChronicleKnowledgeCardsResponses[keyof PostChronicleKnowledgeCardsResponses];

export type GetChronicleKnowledgeCardsByKnowledgeIdVersionsData = {
    body?: never;
    path: {
        knowledgeId: string;
    };
    query?: never;
    url: '/chronicle/knowledge-cards/{knowledgeId}/versions';
};

export type GetChronicleKnowledgeCardsByKnowledgeIdVersionsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        knowledgeId: string;
        version: number;
        title: string;
        content: string;
        cardType: 'fact' | 'insight' | 'decision' | 'task' | 'pattern';
        dimension: 'technical' | 'business' | 'personal' | 'project' | 'general';
        confidence: number;
        sourceMemoryIds: Array<string>;
        sourceSegmentIds: Array<string>;
        sourceChunkIds: Array<string>;
        tags: Array<string>;
        metadata: {
            [key: string]: unknown;
        };
        createdAt: string;
        createdAtUnix: number;
    }>;
};

export type GetChronicleKnowledgeCardsByKnowledgeIdVersionsResponse = GetChronicleKnowledgeCardsByKnowledgeIdVersionsResponses[keyof GetChronicleKnowledgeCardsByKnowledgeIdVersionsResponses];

export type GetChronicleKnowledgeCardsByKnowledgeIdFilesData = {
    body?: never;
    path: {
        knowledgeId: string;
    };
    query?: never;
    url: '/chronicle/knowledge-cards/{knowledgeId}/files';
};

export type GetChronicleKnowledgeCardsByKnowledgeIdFilesResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        knowledgeId: string;
        source: 'attached' | 'memory' | 'snapshot' | 'activity';
        filename: string;
        contentType: string | null;
        sizeBytes: number | null;
        filePath: string | null;
        embedded: boolean;
        evidenceType: string | null;
        evidenceId: string | null;
        metadata: {
            [key: string]: unknown;
        };
        createdAt: string | null;
        createdAtUnix: number | null;
        updatedAt: string | null;
        updatedAtUnix: number | null;
    }>;
};

export type GetChronicleKnowledgeCardsByKnowledgeIdFilesResponse = GetChronicleKnowledgeCardsByKnowledgeIdFilesResponses[keyof GetChronicleKnowledgeCardsByKnowledgeIdFilesResponses];

export type PostChronicleKnowledgeCardsByKnowledgeIdVersionsRestoreData = {
    body: {
        version: number;
    };
    path: {
        knowledgeId: string;
    };
    query?: never;
    url: '/chronicle/knowledge-cards/{knowledgeId}/versions/restore';
};

export type PostChronicleKnowledgeCardsByKnowledgeIdVersionsRestoreResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        title: string;
        content: string;
        cardType: 'fact' | 'insight' | 'decision' | 'task' | 'pattern';
        dimension: 'technical' | 'business' | 'personal' | 'project' | 'general';
        confidence: number;
        sourceMemoryIds: Array<string>;
        sourceSegmentIds: Array<string>;
        sourceChunkIds: Array<string>;
        tags: Array<string>;
        contentHash: string;
        version: number;
        status: 'active' | 'merged' | 'archived' | 'deleted';
        mergedIntoId: string | null;
        pinned: boolean;
        metadata: {
            [key: string]: unknown;
        };
        createdAt: string;
        createdAtUnix: number;
        updatedAt: string;
        updatedAtUnix: number;
    };
};

export type PostChronicleKnowledgeCardsByKnowledgeIdVersionsRestoreResponse = PostChronicleKnowledgeCardsByKnowledgeIdVersionsRestoreResponses[keyof PostChronicleKnowledgeCardsByKnowledgeIdVersionsRestoreResponses];

export type DeleteChronicleKnowledgeCardsByKnowledgeIdData = {
    body?: never;
    path: {
        knowledgeId: string;
    };
    query?: never;
    url: '/chronicle/knowledge-cards/{knowledgeId}';
};

export type DeleteChronicleKnowledgeCardsByKnowledgeIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type DeleteChronicleKnowledgeCardsByKnowledgeIdResponse = DeleteChronicleKnowledgeCardsByKnowledgeIdResponses[keyof DeleteChronicleKnowledgeCardsByKnowledgeIdResponses];

export type GetChronicleKnowledgeCardsByKnowledgeIdData = {
    body?: never;
    path: {
        knowledgeId: string;
    };
    query?: never;
    url: '/chronicle/knowledge-cards/{knowledgeId}';
};

export type GetChronicleKnowledgeCardsByKnowledgeIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        title: string;
        content: string;
        cardType: 'fact' | 'insight' | 'decision' | 'task' | 'pattern';
        dimension: 'technical' | 'business' | 'personal' | 'project' | 'general';
        confidence: number;
        sourceMemoryIds: Array<string>;
        sourceSegmentIds: Array<string>;
        sourceChunkIds: Array<string>;
        tags: Array<string>;
        contentHash: string;
        version: number;
        status: 'active' | 'merged' | 'archived' | 'deleted';
        mergedIntoId: string | null;
        pinned: boolean;
        metadata: {
            [key: string]: unknown;
        };
        createdAt: string;
        createdAtUnix: number;
        updatedAt: string;
        updatedAtUnix: number;
    };
};

export type GetChronicleKnowledgeCardsByKnowledgeIdResponse = GetChronicleKnowledgeCardsByKnowledgeIdResponses[keyof GetChronicleKnowledgeCardsByKnowledgeIdResponses];

export type PatchChronicleKnowledgeCardsByKnowledgeIdData = {
    body: {
        title?: string;
        content?: string;
        cardType?: 'fact' | 'insight' | 'decision' | 'task' | 'pattern';
        dimension?: 'technical' | 'business' | 'personal' | 'project' | 'general';
        confidence?: number;
        sourceMemoryIds?: Array<string>;
        sourceSegmentIds?: Array<string>;
        sourceChunkIds?: Array<string>;
        tags?: Array<string>;
        pinned?: boolean;
        status?: 'active' | 'merged' | 'archived' | 'deleted';
        mergedIntoId?: string | null;
        metadata?: {
            [key: string]: unknown;
        };
    };
    path: {
        knowledgeId: string;
    };
    query?: never;
    url: '/chronicle/knowledge-cards/{knowledgeId}';
};

export type PatchChronicleKnowledgeCardsByKnowledgeIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        title: string;
        content: string;
        cardType: 'fact' | 'insight' | 'decision' | 'task' | 'pattern';
        dimension: 'technical' | 'business' | 'personal' | 'project' | 'general';
        confidence: number;
        sourceMemoryIds: Array<string>;
        sourceSegmentIds: Array<string>;
        sourceChunkIds: Array<string>;
        tags: Array<string>;
        contentHash: string;
        version: number;
        status: 'active' | 'merged' | 'archived' | 'deleted';
        mergedIntoId: string | null;
        pinned: boolean;
        metadata: {
            [key: string]: unknown;
        };
        createdAt: string;
        createdAtUnix: number;
        updatedAt: string;
        updatedAtUnix: number;
    };
};

export type PatchChronicleKnowledgeCardsByKnowledgeIdResponse = PatchChronicleKnowledgeCardsByKnowledgeIdResponses[keyof PatchChronicleKnowledgeCardsByKnowledgeIdResponses];

export type GetChronicleDreamRunsData = {
    body?: never;
    path?: never;
    query?: {
        limit?: number;
    };
    url: '/chronicle/dream-runs';
};

export type GetChronicleDreamRunsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        workspaceId: string | null;
        runType: 'archive' | 'merge' | 'prune' | 'restore' | 'dry-run';
        status: 'running' | 'completed' | 'failed';
        startedAt: string;
        startedAtUnix: number;
        endedAt: string | null;
        endedAtUnix: number | null;
        inputCount: number;
        outputCount: number;
        mergedCount: number;
        deletedCount: number;
        sourceKnowledgeIds: Array<string>;
        outputKnowledgeIds: Array<string>;
        config: {
            [key: string]: unknown;
        };
        result: {
            [key: string]: unknown;
        };
        errorMessage: string | null;
    }>;
};

export type GetChronicleDreamRunsResponse = GetChronicleDreamRunsResponses[keyof GetChronicleDreamRunsResponses];

export type PostChronicleDreamRunsData = {
    body: {
        runType?: 'archive' | 'merge' | 'prune' | 'restore' | 'dry-run';
        dryRun?: boolean;
        limit?: number;
        similarityThreshold?: number;
        applyMerge?: boolean;
        olderThanDays?: number;
        knowledgeIds?: Array<string>;
    };
    path?: never;
    query?: never;
    url: '/chronicle/dream-runs';
};

export type PostChronicleDreamRunsResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        workspaceId: string | null;
        runType: 'archive' | 'merge' | 'prune' | 'restore' | 'dry-run';
        status: 'running' | 'completed' | 'failed';
        startedAt: string;
        startedAtUnix: number;
        endedAt: string | null;
        endedAtUnix: number | null;
        inputCount: number;
        outputCount: number;
        mergedCount: number;
        deletedCount: number;
        sourceKnowledgeIds: Array<string>;
        outputKnowledgeIds: Array<string>;
        config: {
            [key: string]: unknown;
        };
        result: {
            [key: string]: unknown;
        };
        errorMessage: string | null;
    };
};

export type PostChronicleDreamRunsResponse = PostChronicleDreamRunsResponses[keyof PostChronicleDreamRunsResponses];

export type GetChronicleTimelineData = {
    body?: never;
    path?: never;
    query?: {
        limit?: number;
    };
    url: '/chronicle/timeline';
};

export type GetChronicleTimelineResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        sourceType?: 'snapshot' | 'message' | 'audio';
        capturedAt: string;
        capturedAtUnix: number;
        displayId: number;
        segmentDir: string;
        framePath: string;
        ocrText: string | null;
        appBundleId: string | null;
        windowTitle: string | null;
        platform?: string | null;
        channelId?: string | null;
        channelName?: string | null;
        userName?: string | null;
    }>;
};

export type GetChronicleTimelineResponse = GetChronicleTimelineResponses[keyof GetChronicleTimelineResponses];

export type GetChronicleEventsData = {
    body?: never;
    path?: never;
    query?: {
        limit?: number;
        after?: number;
    };
    url: '/chronicle/events';
};

export type GetChronicleEventsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        channel: 'activity' | 'cron' | 'meeting' | 'memory' | 'notification' | 'error' | 'message' | 'audio' | 'snapshot' | 'model';
        event: string;
        type: 'config' | 'daemon' | 'snapshot' | 'memory' | 'summarize' | 'model-resource' | 'message' | 'audio' | 'activity';
        status: 'info' | 'success' | 'warning' | 'error';
        message: string;
        snapshotId: string | null;
        memoryId: string | null;
        attrs: {
            [key: string]: unknown;
        };
        createdAt: string;
        createdAtUnix: number;
    }>;
};

export type GetChronicleEventsResponse = GetChronicleEventsResponses[keyof GetChronicleEventsResponses];

export type GetChronicleEventsStreamData = {
    body?: never;
    path?: never;
    query?: {
        limit?: number;
        after?: number;
        intervalMs?: number;
        once?: boolean;
    };
    url: '/chronicle/events/stream';
};

export type GetChronicleSnapshotsBySnapshotIdFrameData = {
    body?: never;
    path: {
        snapshotId: string;
    };
    query?: never;
    url: '/chronicle/snapshots/{snapshotId}/frame';
};

export type GetChronicleFrameByDisplayIdBySegmentByFrameData = {
    body?: never;
    path: {
        displayId: string;
        segment: string;
        frame: string;
    };
    query?: never;
    url: '/chronicle/frame/{displayId}/{segment}/{frame}';
};

export type GetChronicleMemoriesSearchData = {
    body?: never;
    path?: never;
    query: {
        q: string;
        limit?: number;
    };
    url: '/chronicle/memories/search';
};

export type GetChronicleMemoriesSearchResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        type: '10min' | '6h';
        source: 'llm' | 'local' | 'imported';
        createdAt: string;
        createdAtUnix: number;
        content: string;
        modelId: string | null;
        matchKind: 'keyword' | 'semantic' | 'hybrid' | null;
        keywordScore: number | null;
        semanticScore: number | null;
    }>;
};

export type GetChronicleMemoriesSearchResponse = GetChronicleMemoriesSearchResponses[keyof GetChronicleMemoriesSearchResponses];

export type DeleteChronicleMemoriesByMemoryIdData = {
    body?: never;
    path: {
        memoryId: string;
    };
    query?: never;
    url: '/chronicle/memories/{memoryId}';
};

export type DeleteChronicleMemoriesByMemoryIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type DeleteChronicleMemoriesByMemoryIdResponse = DeleteChronicleMemoriesByMemoryIdResponses[keyof DeleteChronicleMemoriesByMemoryIdResponses];

export type GetChronicleMemoriesByMemoryIdData = {
    body?: never;
    path: {
        memoryId: string;
    };
    query?: never;
    url: '/chronicle/memories/{memoryId}';
};

export type GetChronicleMemoriesByMemoryIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        type: '10min' | '6h';
        source: 'llm' | 'local' | 'imported';
        createdAt: string;
        createdAtUnix: number;
        content: string;
        modelId: string | null;
        matchKind: 'keyword' | 'semantic' | 'hybrid' | null;
        keywordScore: number | null;
        semanticScore: number | null;
    };
};

export type GetChronicleMemoriesByMemoryIdResponse = GetChronicleMemoriesByMemoryIdResponses[keyof GetChronicleMemoriesByMemoryIdResponses];

export type PatchChronicleMemoriesByMemoryIdData = {
    body: {
        content?: string;
        metadata?: {
            [key: string]: unknown;
        };
        sourceSnapshotPaths?: Array<string>;
        sourceFramePaths?: Array<string>;
    };
    path: {
        memoryId: string;
    };
    query?: never;
    url: '/chronicle/memories/{memoryId}';
};

export type PatchChronicleMemoriesByMemoryIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        type: '10min' | '6h';
        source: 'llm' | 'local' | 'imported';
        createdAt: string;
        createdAtUnix: number;
        content: string;
        modelId: string | null;
        matchKind: 'keyword' | 'semantic' | 'hybrid' | null;
        keywordScore: number | null;
        semanticScore: number | null;
    };
};

export type PatchChronicleMemoriesByMemoryIdResponse = PatchChronicleMemoriesByMemoryIdResponses[keyof PatchChronicleMemoriesByMemoryIdResponses];

export type PostChroniclePrivacyRedactData = {
    body: {
        text: string;
    };
    path?: never;
    query?: never;
    url: '/chronicle/privacy/redact';
};

export type PostChroniclePrivacyRedactResponses = {
    /**
     * Response for status 200
     */
    200: {
        text: string;
        redactedText: string;
        entityCount: number;
        entities: Array<{
            type: string;
            start: number;
            end: number;
            text: string;
        }>;
    };
};

export type PostChroniclePrivacyRedactResponse = PostChroniclePrivacyRedactResponses[keyof PostChroniclePrivacyRedactResponses];

export type PostChroniclePrivacyExportData = {
    body: {
        workspaceId?: string | null;
        limit?: number;
        includeMemories?: boolean;
        includeMessages?: boolean;
        includeAudioTranscripts?: boolean;
        includeSnapshots?: boolean;
        outputFormat?: 'markdown' | 'json';
    };
    path?: never;
    query?: never;
    url: '/chronicle/privacy/export';
};

export type PostChroniclePrivacyExportResponses = {
    /**
     * Response for status 200
     */
    200: {
        format: 'markdown' | 'json';
        content: string;
        entityCount: number;
        sources: Array<{
            type: string;
            id: string;
            title: string;
            redactedEntityCount: number;
        }>;
    };
};

export type PostChroniclePrivacyExportResponse = PostChroniclePrivacyExportResponses[keyof PostChroniclePrivacyExportResponses];

export type PostChroniclePrivacySnapshotsBySnapshotIdFrameMaskData = {
    body: {
        mode?: 'blur';
        fullFrame?: boolean;
        blurSigma?: number;
        regions?: Array<{
            x: number;
            y: number;
            width: number;
            height: number;
        }>;
    };
    path: {
        snapshotId: string;
    };
    query?: never;
    url: '/chronicle/privacy/snapshots/{snapshotId}/frame-mask';
};

export type GetChroniclePrivacyBreadcrumbsData = {
    body?: never;
    path?: never;
    query?: {
        limit?: number;
    };
    url: '/chronicle/privacy/breadcrumbs';
};

export type GetChroniclePrivacyBreadcrumbsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        kind: string;
        status: 'info' | 'success' | 'warning' | 'error';
        message: string;
        snapshotId: string | null;
        memoryId: string | null;
        attrs: {
            [key: string]: unknown;
        };
        createdAt: string;
        createdAtUnix: number;
    }>;
};

export type GetChroniclePrivacyBreadcrumbsResponse = GetChroniclePrivacyBreadcrumbsResponses[keyof GetChroniclePrivacyBreadcrumbsResponses];

export type PostChronicleEmbeddingsData = {
    body: {
        texts: Array<string>;
    };
    path?: never;
    query?: never;
    url: '/chronicle/embeddings';
};

export type PostChronicleEmbeddingsResponses = {
    /**
     * Response for status 200
     */
    200: {
        modelId: string;
        modelVersion: string;
        dimensions: number;
        embeddings: Array<Array<number>>;
    };
};

export type PostChronicleEmbeddingsResponse = PostChronicleEmbeddingsResponses[keyof PostChronicleEmbeddingsResponses];

export type GetManagedResourcesData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/managed-resources';
};

export type GetManagedResourcesResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        key: {
            namespace: string;
            resourceType: string;
            resourceId: string;
        };
        displayName: string;
        description: string | null;
        kind: string;
        required: boolean;
        state: 'not-installed' | 'installing' | 'installed' | 'update-available' | 'error' | 'unavailable';
        installationSource: 'built-in' | 'managed' | 'external' | null;
        installedVersion: string | null;
        availableVersion: string | null;
        installedSizeBytes: number | null;
        downloadSizeBytes: number | null;
        actions: {
            install: {
                available: boolean;
                reasonCode: string | null;
            };
            update: {
                available: boolean;
                reasonCode: string | null;
            };
            uninstall: {
                available: boolean;
                reasonCode: string | null;
            };
        };
    }>;
};

export type GetManagedResourcesResponse = GetManagedResourcesResponses[keyof GetManagedResourcesResponses];

export type DeleteManagedResourcesByNamespaceByResourceTypeByResourceIdData = {
    body?: never;
    path: {
        namespace: string;
        resourceType: string;
        resourceId: string;
    };
    query?: never;
    url: '/managed-resources/{namespace}/{resourceType}/{resourceId}';
};

export type DeleteManagedResourcesByNamespaceByResourceTypeByResourceIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        key: {
            namespace: string;
            resourceType: string;
            resourceId: string;
        };
        displayName: string;
        description: string | null;
        kind: string;
        required: boolean;
        state: 'not-installed' | 'installing' | 'installed' | 'update-available' | 'error' | 'unavailable';
        installationSource: 'built-in' | 'managed' | 'external' | null;
        installedVersion: string | null;
        availableVersion: string | null;
        installedSizeBytes: number | null;
        downloadSizeBytes: number | null;
        actions: {
            install: {
                available: boolean;
                reasonCode: string | null;
            };
            update: {
                available: boolean;
                reasonCode: string | null;
            };
            uninstall: {
                available: boolean;
                reasonCode: string | null;
            };
        };
    };
};

export type DeleteManagedResourcesByNamespaceByResourceTypeByResourceIdResponse = DeleteManagedResourcesByNamespaceByResourceTypeByResourceIdResponses[keyof DeleteManagedResourcesByNamespaceByResourceTypeByResourceIdResponses];

export type GetManagedResourcesByNamespaceByResourceTypeByResourceIdData = {
    body?: never;
    path: {
        namespace: string;
        resourceType: string;
        resourceId: string;
    };
    query?: never;
    url: '/managed-resources/{namespace}/{resourceType}/{resourceId}';
};

export type GetManagedResourcesByNamespaceByResourceTypeByResourceIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        key: {
            namespace: string;
            resourceType: string;
            resourceId: string;
        };
        displayName: string;
        description: string | null;
        kind: string;
        required: boolean;
        state: 'not-installed' | 'installing' | 'installed' | 'update-available' | 'error' | 'unavailable';
        installationSource: 'built-in' | 'managed' | 'external' | null;
        installedVersion: string | null;
        availableVersion: string | null;
        installedSizeBytes: number | null;
        downloadSizeBytes: number | null;
        actions: {
            install: {
                available: boolean;
                reasonCode: string | null;
            };
            update: {
                available: boolean;
                reasonCode: string | null;
            };
            uninstall: {
                available: boolean;
                reasonCode: string | null;
            };
        };
    };
};

export type GetManagedResourcesByNamespaceByResourceTypeByResourceIdResponse = GetManagedResourcesByNamespaceByResourceTypeByResourceIdResponses[keyof GetManagedResourcesByNamespaceByResourceTypeByResourceIdResponses];

export type PostManagedResourcesByNamespaceByResourceTypeByResourceIdInstallData = {
    body?: never;
    path: {
        namespace: string;
        resourceType: string;
        resourceId: string;
    };
    query?: never;
    url: '/managed-resources/{namespace}/{resourceType}/{resourceId}/install';
};

export type PostManagedResourcesByNamespaceByResourceTypeByResourceIdInstallResponses = {
    /**
     * Response for status 200
     */
    200: {
        key: {
            namespace: string;
            resourceType: string;
            resourceId: string;
        };
        displayName: string;
        description: string | null;
        kind: string;
        required: boolean;
        state: 'not-installed' | 'installing' | 'installed' | 'update-available' | 'error' | 'unavailable';
        installationSource: 'built-in' | 'managed' | 'external' | null;
        installedVersion: string | null;
        availableVersion: string | null;
        installedSizeBytes: number | null;
        downloadSizeBytes: number | null;
        actions: {
            install: {
                available: boolean;
                reasonCode: string | null;
            };
            update: {
                available: boolean;
                reasonCode: string | null;
            };
            uninstall: {
                available: boolean;
                reasonCode: string | null;
            };
        };
    };
};

export type PostManagedResourcesByNamespaceByResourceTypeByResourceIdInstallResponse = PostManagedResourcesByNamespaceByResourceTypeByResourceIdInstallResponses[keyof PostManagedResourcesByNamespaceByResourceTypeByResourceIdInstallResponses];

export type PostManagedResourcesByNamespaceByResourceTypeByResourceIdUpdateData = {
    body?: never;
    path: {
        namespace: string;
        resourceType: string;
        resourceId: string;
    };
    query?: never;
    url: '/managed-resources/{namespace}/{resourceType}/{resourceId}/update';
};

export type PostManagedResourcesByNamespaceByResourceTypeByResourceIdUpdateResponses = {
    /**
     * Response for status 200
     */
    200: {
        key: {
            namespace: string;
            resourceType: string;
            resourceId: string;
        };
        displayName: string;
        description: string | null;
        kind: string;
        required: boolean;
        state: 'not-installed' | 'installing' | 'installed' | 'update-available' | 'error' | 'unavailable';
        installationSource: 'built-in' | 'managed' | 'external' | null;
        installedVersion: string | null;
        availableVersion: string | null;
        installedSizeBytes: number | null;
        downloadSizeBytes: number | null;
        actions: {
            install: {
                available: boolean;
                reasonCode: string | null;
            };
            update: {
                available: boolean;
                reasonCode: string | null;
            };
            uninstall: {
                available: boolean;
                reasonCode: string | null;
            };
        };
    };
};

export type PostManagedResourcesByNamespaceByResourceTypeByResourceIdUpdateResponse = PostManagedResourcesByNamespaceByResourceTypeByResourceIdUpdateResponses[keyof PostManagedResourcesByNamespaceByResourceTypeByResourceIdUpdateResponses];

export type GetOpencodeServerResourcesData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/opencode/server/resources';
};

export type GetOpencodeServerResourcesResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        hostId: string;
        running: boolean;
        pid: number | null;
        url: string | null;
        startedAt: number | null;
        uptimeSeconds: number | null;
        rssMB: number | null;
        cpuPercent: number | null;
    }>;
};

export type GetOpencodeServerResourcesResponse = GetOpencodeServerResourcesResponses[keyof GetOpencodeServerResourcesResponses];

export type GetKimiServerResourcesData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/kimi/server/resources';
};

export type GetKimiServerResourcesResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        hostId: string;
        providerTargetId: string;
        scopeId: string;
        running: boolean;
        pid: number | null;
        rssMB: number | null;
        cpuPercent: number | null;
        url: string | null;
    }>;
};

export type GetKimiServerResourcesResponse = GetKimiServerResourcesResponses[keyof GetKimiServerResourcesResponses];

export type GetCodexAppServerResourcesData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/codex/app-server/resources';
};

export type GetCodexAppServerResourcesResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        hostId: string;
        providerTargetId: string;
        scopeId: string;
        running: boolean;
        pid: number | null;
        rssMB: number | null;
        cpuPercent: number | null;
    }>;
};

export type GetCodexAppServerResourcesResponse = GetCodexAppServerResourcesResponses[keyof GetCodexAppServerResourcesResponses];

export type GetAgentSessionsByAgentSessionIdData = {
    body?: never;
    path: {
        agentSessionId: string;
    };
    query?: never;
    url: '/agent-sessions/{agentSessionId}';
};

export type GetAgentSessionsByAgentSessionIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        issueId: string;
        providerTargetId: string;
        agentId: string | null;
        chatSessionId: string | null;
        status: 'created' | 'active' | 'completed' | 'stopped' | 'failed';
        createdAt: number;
        updatedAt: number;
    };
};

export type GetAgentSessionsByAgentSessionIdResponse = GetAgentSessionsByAgentSessionIdResponses[keyof GetAgentSessionsByAgentSessionIdResponses];

export type GetAgentSessionsByAgentSessionIdActivitiesData = {
    body?: never;
    path: {
        agentSessionId: string;
    };
    query?: never;
    url: '/agent-sessions/{agentSessionId}/activities';
};

export type GetAgentSessionsByAgentSessionIdActivitiesResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        agentSessionId: string;
        type: 'thought' | 'action' | 'response' | 'elicitation' | 'error' | 'prompt';
        content: string;
        signal: string | null;
        signalMetadata: string | null;
        createdAt: number;
    }>;
};

export type GetAgentSessionsByAgentSessionIdActivitiesResponse = GetAgentSessionsByAgentSessionIdActivitiesResponses[keyof GetAgentSessionsByAgentSessionIdActivitiesResponses];

export type GetDesktopSummaryData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/desktop/summary';
};

export type GetDesktopSummaryResponses = {
    /**
     * Response for status 200
     */
    200: {
        generatedAt: number;
        running: number;
        recentSessions: number;
        pinnedSessions: number;
        pendingAwaits: number;
        enabledAutomations: number;
        runningAutomations: number;
        workspaces: number;
        enabledProviders: number;
        totalProviders: number;
    };
};

export type GetDesktopSummaryResponse = GetDesktopSummaryResponses[keyof GetDesktopSummaryResponses];

export type GetDesktopRecentSessionsData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/desktop/recent-sessions';
};

export type GetDesktopRecentSessionsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        sessionId: string;
        title: string;
        workspaceId: string | null;
        workspaceName: string;
        runtimeKind: string;
        modelId: string | null;
        updatedAt: number;
        state: 'running' | 'awaiting' | 'pinned' | 'recent';
        detail: string;
    }>;
};

export type GetDesktopRecentSessionsResponse = GetDesktopRecentSessionsResponses[keyof GetDesktopRecentSessionsResponses];

export type GetDesktopHealthData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/desktop/health';
};

export type GetDesktopHealthResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        label: string;
        value: string;
        status: 'ok' | 'active' | 'warning' | 'danger' | 'unknown';
        detail: string | null;
    }>;
};

export type GetDesktopHealthResponse = GetDesktopHealthResponses[keyof GetDesktopHealthResponses];

export type GetDesktopAwaitsData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/desktop/awaits';
};

export type GetDesktopAwaitsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        sessionId: string;
        title: string;
        workspaceId: string | null;
        workspaceName: string;
        source: string;
        reason: string | null;
        createdAt: number;
    }>;
};

export type GetDesktopAwaitsResponse = GetDesktopAwaitsResponses[keyof GetDesktopAwaitsResponses];

export type GetDesktopUserInputRequestsData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/desktop/user-input-requests';
};

export type GetDesktopUserInputRequestsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        sessionId: string;
        runId: string;
        requestId: string;
        title: string;
        workspaceId: string | null;
        workspaceName: string;
        providerMethod: string;
        questionCount: number;
        firstQuestion: string | null;
        createdAt: number;
    }>;
};

export type GetDesktopUserInputRequestsResponse = GetDesktopUserInputRequestsResponses[keyof GetDesktopUserInputRequestsResponses];

export type GetDownloadCenterTasksData = {
    body?: never;
    path?: never;
    query?: {
        status?: 'queued' | 'downloading' | 'verifying' | 'completed' | 'failed' | 'cancelled';
        ownerNamespace?: string;
        ownerResourceType?: string;
        ownerResourceId?: string;
        limit?: string | number;
    };
    url: '/download-center/tasks';
};

export type GetDownloadCenterTasksResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        taskId: string;
        scope: 'server';
        owner: {
            namespace: string;
            resourceType: string;
            resourceId: string;
            displayName: string;
        };
        fileName: string;
        sourceId: string | null;
        status: 'queued' | 'downloading' | 'verifying' | 'completed' | 'failed' | 'cancelled';
        transferredBytes: number;
        totalBytes: number | null;
        attempts: number;
        maxAttempts: number;
        error: {
            code: string;
            message: string;
            retryable: boolean;
        } | null;
        result: {
            taskId: string;
            bytes: number;
            checksum: {
                algorithm: 'sha256' | 'sha512';
                expected: string | null;
                actual: string;
                matched: boolean | null;
            };
        } | null;
        createdAt: string;
        updatedAt: string;
        startedAt: string | null;
        finishedAt: string | null;
    }>;
};

export type GetDownloadCenterTasksResponse = GetDownloadCenterTasksResponses[keyof GetDownloadCenterTasksResponses];

export type GetDownloadCenterTasksByIdData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/download-center/tasks/{id}';
};

export type GetDownloadCenterTasksByIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        taskId: string;
        scope: 'server';
        owner: {
            namespace: string;
            resourceType: string;
            resourceId: string;
            displayName: string;
        };
        fileName: string;
        sourceId: string | null;
        status: 'queued' | 'downloading' | 'verifying' | 'completed' | 'failed' | 'cancelled';
        transferredBytes: number;
        totalBytes: number | null;
        attempts: number;
        maxAttempts: number;
        error: {
            code: string;
            message: string;
            retryable: boolean;
        } | null;
        result: {
            taskId: string;
            bytes: number;
            checksum: {
                algorithm: 'sha256' | 'sha512';
                expected: string | null;
                actual: string;
                matched: boolean | null;
            };
        } | null;
        createdAt: string;
        updatedAt: string;
        startedAt: string | null;
        finishedAt: string | null;
    };
};

export type GetDownloadCenterTasksByIdResponse = GetDownloadCenterTasksByIdResponses[keyof GetDownloadCenterTasksByIdResponses];

export type PostDownloadCenterTasksByIdCancelData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/download-center/tasks/{id}/cancel';
};

export type PostDownloadCenterTasksByIdCancelResponses = {
    /**
     * Response for status 200
     */
    200: {
        taskId: string;
        scope: 'server';
        owner: {
            namespace: string;
            resourceType: string;
            resourceId: string;
            displayName: string;
        };
        fileName: string;
        sourceId: string | null;
        status: 'queued' | 'downloading' | 'verifying' | 'completed' | 'failed' | 'cancelled';
        transferredBytes: number;
        totalBytes: number | null;
        attempts: number;
        maxAttempts: number;
        error: {
            code: string;
            message: string;
            retryable: boolean;
        } | null;
        result: {
            taskId: string;
            bytes: number;
            checksum: {
                algorithm: 'sha256' | 'sha512';
                expected: string | null;
                actual: string;
                matched: boolean | null;
            };
        } | null;
        createdAt: string;
        updatedAt: string;
        startedAt: string | null;
        finishedAt: string | null;
    };
};

export type PostDownloadCenterTasksByIdCancelResponse = PostDownloadCenterTasksByIdCancelResponses[keyof PostDownloadCenterTasksByIdCancelResponses];

export type GetDownloadCenterEventsData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/download-center/events';
};

export type GetDownloadCenterEventsResponses = {
    /**
     * Task changes only; fetch /download-center/tasks for the initial snapshot.
     */
    200: {
        taskId: string;
        scope: 'server';
        owner: {
            namespace: string;
            resourceType: string;
            resourceId: string;
            displayName: string;
        };
        fileName: string;
        sourceId: string | null;
        status: 'queued' | 'downloading' | 'verifying' | 'completed' | 'failed' | 'cancelled';
        transferredBytes: number;
        totalBytes: number | null;
        attempts: number;
        maxAttempts: number;
        error: {
            code: string;
            message: string;
            retryable: boolean;
        } | null;
        result: {
            taskId: string;
            bytes: number;
            checksum: {
                algorithm: 'sha256' | 'sha512';
                expected: string | null;
                actual: string;
                matched: boolean | null;
            };
        } | null;
        createdAt: string;
        updatedAt: string;
        startedAt: string | null;
        finishedAt: string | null;
    };
};

export type GetDownloadCenterEventsResponse = GetDownloadCenterEventsResponses[keyof GetDownloadCenterEventsResponses];

export type GetTerminalSessionsResourcesData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/terminal-sessions/resources';
};

export type GetTerminalSessionsResourcesResponses = {
    /**
     * Response for status 200
     */
    200: {
        terminals: Array<{
            id: string;
            role: 'cli-tui' | 'bottom-panel';
            pid: number;
            executable: string;
            cwd: string;
            running: boolean;
            startedAt: number;
            cols: number;
            rows: number;
            rssMB: number | null;
            cpuPercent: number | null;
            descendantCount: number | null;
        }>;
        totals: {
            cliTuiRssMB: number;
            bottomPanelRssMB: number;
            cliTuiCpuPercent: number;
            bottomPanelCpuPercent: number;
        };
        timestamp: number;
    };
};

export type GetTerminalSessionsResourcesResponse = GetTerminalSessionsResourcesResponses[keyof GetTerminalSessionsResourcesResponses];

export type PostTerminalSessionsBySessionIdStartOrAttachData = {
    body: {
        cols: string | number;
        rows: string | number;
    };
    path: {
        sessionId: string;
    };
    query?: never;
    url: '/terminal-sessions/{sessionId}/start-or-attach';
};

export type PostTerminalSessionsBySessionIdStartOrAttachResponses = {
    /**
     * Response for status 200
     */
    200: {
        sessionId: string;
        running: boolean;
        mode: 'live-attach' | 'resume' | 'fresh' | 'history';
        agent?: string;
        restore?: {
            mode: 'live-attach' | 'resume' | 'fresh' | 'history';
            agent?: string;
            reason?: string;
        };
    };
};

export type PostTerminalSessionsBySessionIdStartOrAttachResponse = PostTerminalSessionsBySessionIdStartOrAttachResponses[keyof PostTerminalSessionsBySessionIdStartOrAttachResponses];

export type DeleteTerminalSessionsBySessionIdData = {
    body?: never;
    path: {
        sessionId: string;
    };
    query?: never;
    url: '/terminal-sessions/{sessionId}';
};

export type DeleteTerminalSessionsBySessionIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type DeleteTerminalSessionsBySessionIdResponse = DeleteTerminalSessionsBySessionIdResponses[keyof DeleteTerminalSessionsBySessionIdResponses];

export type GetTerminalSessionsBySessionIdHostData = {
    body?: never;
    path: {
        sessionId: string;
    };
    query?: never;
    url: '/terminal-sessions/{sessionId}/host';
};

export type GetTerminalSessionsBySessionIdHostResponses = {
    /**
     * Response for status 200
     */
    200: {
        sessionId: string;
        role: 'cli-tui';
        running: boolean;
        phase: 'absent' | 'running' | 'exited';
        mode: 'live-attach' | 'resume' | 'fresh' | 'history' | null;
        agent: string | null;
        workspacePath: string;
        ptyStartedAt: number | null;
        providerSession: {
            source: string;
            agent: string;
            kind: 'id' | 'path';
            value: string;
            workspacePath: string;
            capturedAt: number;
            startedAt: number;
            sourcePath?: string;
            confidence: 'exact' | 'heuristic';
        } | null;
        historyEnabled: boolean;
        hasHistory: boolean;
    };
};

export type GetTerminalSessionsBySessionIdHostResponse = GetTerminalSessionsBySessionIdHostResponses[keyof GetTerminalSessionsBySessionIdHostResponses];

export type DeleteTerminalSessionsBySessionIdProviderSessionData = {
    body?: never;
    path: {
        sessionId: string;
    };
    query?: never;
    url: '/terminal-sessions/{sessionId}/provider-session';
};

export type DeleteTerminalSessionsBySessionIdProviderSessionResponses = {
    /**
     * Response for status 200
     */
    200: {
        sessionId: string;
        providerSession: {
            source: string;
            agent: string;
            kind: 'id' | 'path';
            value: string;
            workspacePath: string;
            capturedAt: number;
            startedAt: number;
            sourcePath?: string;
            confidence: 'exact' | 'heuristic';
        } | null;
    };
};

export type DeleteTerminalSessionsBySessionIdProviderSessionResponse = DeleteTerminalSessionsBySessionIdProviderSessionResponses[keyof DeleteTerminalSessionsBySessionIdProviderSessionResponses];

export type GetTerminalSessionsBySessionIdProviderSessionData = {
    body?: never;
    path: {
        sessionId: string;
    };
    query?: never;
    url: '/terminal-sessions/{sessionId}/provider-session';
};

export type GetTerminalSessionsBySessionIdProviderSessionResponses = {
    /**
     * Response for status 200
     */
    200: {
        sessionId: string;
        providerSession: {
            source: string;
            agent: string;
            kind: 'id' | 'path';
            value: string;
            workspacePath: string;
            capturedAt: number;
            startedAt: number;
            sourcePath?: string;
            confidence: 'exact' | 'heuristic';
        } | null;
    };
};

export type GetTerminalSessionsBySessionIdProviderSessionResponse = GetTerminalSessionsBySessionIdProviderSessionResponses[keyof GetTerminalSessionsBySessionIdProviderSessionResponses];

export type PostTerminalSessionsBySessionIdProviderSessionData = {
    body: {
        source: string;
        agent: string;
        kind?: 'id' | 'path';
        value: string;
        sourcePath?: string;
        confidence?: 'exact' | 'heuristic';
    };
    path: {
        sessionId: string;
    };
    query?: never;
    url: '/terminal-sessions/{sessionId}/provider-session';
};

export type PostTerminalSessionsBySessionIdProviderSessionResponses = {
    /**
     * Response for status 200
     */
    200: {
        sessionId: string;
        providerSession: {
            source: string;
            agent: string;
            kind: 'id' | 'path';
            value: string;
            workspacePath: string;
            capturedAt: number;
            startedAt: number;
            sourcePath?: string;
            confidence: 'exact' | 'heuristic';
        } | null;
    };
};

export type PostTerminalSessionsBySessionIdProviderSessionResponse = PostTerminalSessionsBySessionIdProviderSessionResponses[keyof PostTerminalSessionsBySessionIdProviderSessionResponses];

export type PostTerminalSessionsShellStartData = {
    body: {
        ptyId: string;
        cwd: string;
        cols: string | number;
        rows: string | number;
    };
    path?: never;
    query?: never;
    url: '/terminal-sessions/shell/start';
};

export type PostTerminalSessionsShellStartResponses = {
    /**
     * Response for status 200
     */
    200: {
        ptyId: string;
        running: boolean;
    };
};

export type PostTerminalSessionsShellStartResponse = PostTerminalSessionsShellStartResponses[keyof PostTerminalSessionsShellStartResponses];

export type DeleteTerminalSessionsShellByPtyIdData = {
    body?: never;
    path: {
        ptyId: string;
    };
    query?: never;
    url: '/terminal-sessions/shell/{ptyId}';
};

export type DeleteTerminalSessionsShellByPtyIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type DeleteTerminalSessionsShellByPtyIdResponse = DeleteTerminalSessionsShellByPtyIdResponses[keyof DeleteTerminalSessionsShellByPtyIdResponses];

export type GetObservabilityEventsData = {
    body?: never;
    path?: never;
    query?: {
        chatSessionId?: string;
        runId?: string;
        code?: string;
        severity?: string;
        since?: string;
        until?: string;
        limit?: string;
    };
    url: '/observability/events';
};

export type GetObservabilityEventsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        schemaVersion: number;
        source: string;
        code: string;
        severity: string;
        category: string;
        message: string;
        attrs?: {
            [key: string]: unknown;
        };
        chatSessionId?: string;
        runId?: string;
        messageId?: string;
        traceId?: string;
        dedupeKey?: string;
        parentEventId?: string;
        occurredAt: number;
        recordedAt: number;
    }>;
};

export type GetObservabilityEventsResponse = GetObservabilityEventsResponses[keyof GetObservabilityEventsResponses];

export type PostObservabilityEventsData = {
    body: {
        source: string;
        code: string;
        severity: string;
        category: string;
        message: string;
        attrs?: {
            [key: string]: unknown;
        };
        chatSessionId?: string;
        runId?: string;
        messageId?: string;
        traceId?: string;
        dedupeKey?: string;
        parentEventId?: string;
        occurredAt?: number;
        recordedAt?: number;
    };
    path?: never;
    query?: never;
    url: '/observability/events';
};

export type PostObservabilityEventsResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type PostObservabilityEventsResponse = PostObservabilityEventsResponses[keyof PostObservabilityEventsResponses];

export type PostObservabilityRuntimeSamplesData = {
    body: {
        source: 'desktop-main';
        sampledAt: number;
        main: {
            [key: string]: unknown;
        };
        appMetrics: Array<{
            [key: string]: unknown;
        }>;
        windows: Array<{
            [key: string]: unknown;
        }>;
        diagnostics?: {
            [key: string]: unknown;
        };
    };
    path?: never;
    query?: never;
    url: '/observability/runtime-samples';
};

export type PostObservabilityRuntimeSamplesResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type PostObservabilityRuntimeSamplesResponse = PostObservabilityRuntimeSamplesResponses[keyof PostObservabilityRuntimeSamplesResponses];

export type GetObservabilityIncidentsData = {
    body?: never;
    path?: never;
    query?: {
        dedupeKey?: string;
        chatSessionId?: string;
        runId?: string;
        code?: string;
        status?: 'open' | 'resolved';
        limit?: string;
    };
    url: '/observability/incidents';
};

export type GetObservabilityIncidentsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        dedupeKey: string;
        code: string;
        severity: string;
        status: 'open' | 'resolved';
        source: string;
        message: string;
        chatSessionId?: string;
        runId?: string;
        messageId?: string;
        firstOccurredAt: number;
        lastOccurredAt: number;
        lastRecordedAt: number;
        count: number;
        lastEventId?: string;
        attrs?: {
            [key: string]: unknown;
        };
    }>;
};

export type GetObservabilityIncidentsResponse = GetObservabilityIncidentsResponses[keyof GetObservabilityIncidentsResponses];

export type GetObservabilityErrorPatternsData = {
    body?: never;
    path?: never;
    query?: {
        chatSessionId?: string;
        runId?: string;
        code?: string;
        runtimeKind?: string;
        providerTargetId?: string;
        sinceUnix?: string;
        limit?: string;
    };
    url: '/observability/error-patterns';
};

export type GetObservabilityErrorPatternsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        patternId: string;
        source: string;
        code: string;
        category: string;
        severity: string;
        runtimeKind?: string;
        providerTargetId?: string;
        modelId?: string;
        messageFingerprint: string;
        messagePreview: string;
        count: number;
        firstSeenAt: number;
        lastSeenAt: number;
        sampleRunIds: Array<string>;
        sampleTraceIds: Array<string>;
        sampleMessages: Array<string>;
    }>;
};

export type GetObservabilityErrorPatternsResponse = GetObservabilityErrorPatternsResponses[keyof GetObservabilityErrorPatternsResponses];

export type PostObservabilityFlushData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/observability/flush';
};

export type PostObservabilityFlushResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type PostObservabilityFlushResponse = PostObservabilityFlushResponses[keyof PostObservabilityFlushResponses];

export type GetObservabilityRuntimeSnapshotData = {
    body?: never;
    path?: never;
    query?: never;
    url: '/observability/runtime-snapshot';
};

export type GetObservabilityRuntimeSnapshotResponses = {
    /**
     * Response for status 200
     */
    200: {
        timestamp: number;
        server: {
            pid: number;
            uptimeSeconds: number;
            memory: {
                rssMB: number;
                heapUsedMB: number;
                heapTotalMB: number;
                externalMB: number;
                arrayBuffersMB: number;
            };
            cpu: {
                percent: number | null;
                userMicros: number;
                systemMicros: number;
                sampleMs: number | null;
                usedMicros: number | null;
                windowReady: boolean;
            };
            node: {
                activeHandles: number;
                activeRequests: number;
            };
        };
        chatRuntime: {
            activeRuns: Array<{
                runId: string;
                sessionId: string;
                messageId: string;
                providerTargetKind: string | null;
                providerTargetId: string | null;
                modelId: string | null;
            }>;
            runStreams: Array<{
                runId: string;
                latestCursor: number;
                publishedChunkCount: number;
                textDeltaCount: number;
                reasoningDeltaCount: number;
                toolInputDeltaCount: number;
                toolOutputCount: number;
                maxDeltaChars: number;
            }>;
        };
        providerRuntime: {
            hosts: Array<{
                hostId: string;
                runtimeKind: string;
                providerTargetId: string;
                scopeId: string;
                refCount: number;
                pinnedCount: number;
                hasResource: boolean;
                expiresAt: number;
                updatedAt: number;
            }>;
        };
        pty: {
            terminals: Array<{
                id: string;
                role: 'cli-tui' | 'bottom-panel';
                pid: number;
                executable: string;
                cwd: string;
                running: boolean;
                startedAt: number;
                cols: number;
                rows: number;
                rssMB: number | null;
                cpuPercent: number | null;
                descendantCount: number | null;
            }>;
            totals: {
                cliTuiRssMB: number;
                bottomPanelRssMB: number;
                cliTuiCpuPercent: number;
                bottomPanelCpuPercent: number;
            };
            timestamp: number;
        };
        chronicle: {
            running: boolean;
            pid: number | null;
            rssMB: number | null;
            cpuPercent: number | null;
        };
        opencodeServer: {
            running: boolean;
            pid: number | null;
            url: string | null;
            startedAt: number | null;
            uptimeSeconds: number | null;
            rssMB: number | null;
            cpuPercent: number | null;
        };
        kimiServer: {
            running: boolean;
            pid: number | null;
            rssMB: number | null;
            cpuPercent: number | null;
            url: string | null;
        };
        codexAppServer: {
            running: boolean;
            pid: number | null;
            rssMB: number | null;
            cpuPercent: number | null;
        };
        desktop: {
            latestSamples: Array<{
                source: 'desktop-main';
                sampledAt: number;
                main: {
                    [key: string]: unknown;
                };
                appMetrics: Array<{
                    [key: string]: unknown;
                }>;
                windows: Array<{
                    [key: string]: unknown;
                }>;
                diagnostics?: {
                    [key: string]: unknown;
                };
            }>;
        };
        drilldowns: {
            renderer: {
                rendererWindows: Array<{
                    [key: string]: unknown;
                }>;
                topChatSessions: Array<{
                    [key: string]: unknown;
                }>;
                activeStreamingMessages: Array<{
                    [key: string]: unknown;
                }>;
                runDisplayMetaMessages: Array<{
                    [key: string]: unknown;
                }>;
            };
            browserPanel: {
                panel: {
                    [key: string]: unknown;
                } | null;
                limits: {
                    [key: string]: unknown;
                } | null;
                activeThreads: Array<{
                    [key: string]: unknown;
                }>;
                liveTabs: Array<{
                    [key: string]: unknown;
                }>;
                runtimes: Array<{
                    [key: string]: unknown;
                }>;
            };
            runStreams: {
                topRuns: Array<{
                    [key: string]: unknown;
                }>;
            };
            providerRuntime: {
                topHosts: Array<{
                    [key: string]: unknown;
                }>;
            };
        };
        observability: {
            queueDepth: number;
            recentEvents: number;
            droppedEvents: number;
            pendingFlush: boolean;
        };
    };
};

export type GetObservabilityRuntimeSnapshotResponse = GetObservabilityRuntimeSnapshotResponses[keyof GetObservabilityRuntimeSnapshotResponses];

export type PostObservabilityDiagnosticsHeapSnapshotData = {
    body: {
        token?: string;
    };
    path?: never;
    query?: never;
    url: '/observability/diagnostics/heap-snapshot';
};

export type PostObservabilityDiagnosticsHeapSnapshotResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
        path: string;
        pid: number;
        startedAt: number;
        completedAt: number;
        durationMs: number;
    };
};

export type PostObservabilityDiagnosticsHeapSnapshotResponse = PostObservabilityDiagnosticsHeapSnapshotResponses[keyof PostObservabilityDiagnosticsHeapSnapshotResponses];

export type GetObservabilityExportData = {
    body?: never;
    path?: never;
    query?: {
        chatSessionId?: string;
        runId?: string;
        sinceUnix?: string;
    };
    url: '/observability/export';
};

export type GetObservabilityExportResponses = {
    /**
     * Response for status 200
     */
    200: {
        schema: string;
        exportedAt: number;
        metadata: {
            [key: string]: unknown;
        };
        redaction: {
            [key: string]: unknown;
        };
        events: Array<{
            id: string;
            schemaVersion: number;
            source: string;
            code: string;
            severity: string;
            category: string;
            message: string;
            attrs?: {
                [key: string]: unknown;
            };
            chatSessionId?: string;
            runId?: string;
            messageId?: string;
            traceId?: string;
            dedupeKey?: string;
            parentEventId?: string;
            occurredAt: number;
            recordedAt: number;
        }>;
        incidents: Array<{
            id: string;
            dedupeKey: string;
            code: string;
            severity: string;
            status: 'open' | 'resolved';
            source: string;
            message: string;
            chatSessionId?: string;
            runId?: string;
            messageId?: string;
            firstOccurredAt: number;
            lastOccurredAt: number;
            lastRecordedAt: number;
            count: number;
            lastEventId?: string;
            attrs?: {
                [key: string]: unknown;
            };
        }>;
        errorPatterns: Array<{
            patternId: string;
            source: string;
            code: string;
            category: string;
            severity: string;
            runtimeKind?: string;
            providerTargetId?: string;
            modelId?: string;
            messageFingerprint: string;
            messagePreview: string;
            count: number;
            firstSeenAt: number;
            lastSeenAt: number;
            sampleRunIds: Array<string>;
            sampleTraceIds: Array<string>;
            sampleMessages: Array<string>;
        }>;
        timeline: Array<{
            [key: string]: unknown;
        }>;
        logs: {
            [key: string]: unknown;
        };
    };
};

export type GetObservabilityExportResponse = GetObservabilityExportResponses[keyof GetObservabilityExportResponses];

export type DeleteIssuesByIdDelegationData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/issues/{id}/delegation';
};

export type DeleteIssuesByIdDelegationResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type DeleteIssuesByIdDelegationResponse = DeleteIssuesByIdDelegationResponses[keyof DeleteIssuesByIdDelegationResponses];

export type GetIssuesByIdDelegationData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/issues/{id}/delegation';
};

export type GetIssuesByIdDelegationResponses = {
    /**
     * Response for status 200
     */
    200: {
        issueId: string;
        delegated: boolean;
        providerTargetId: string | null;
        agentId: string | null;
        agentSessionId: string | null;
        chatSessionId: string | null;
    };
};

export type GetIssuesByIdDelegationResponse = GetIssuesByIdDelegationResponses[keyof GetIssuesByIdDelegationResponses];

export type PostIssuesByIdDelegationData = {
    body: {
        agentId: string;
        providerTargetId?: string | null;
        runInIsolation?: boolean;
    };
    path: {
        id: string;
    };
    query?: never;
    url: '/issues/{id}/delegation';
};

export type PostIssuesByIdDelegationResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        issueId: string;
        providerTargetId: string;
        agentId: string | null;
        chatSessionId: string | null;
        status: 'created' | 'active' | 'completed' | 'stopped' | 'failed';
        isCurrentDelegation: boolean;
        createdAt: number;
        updatedAt: number;
    };
};

export type PostIssuesByIdDelegationResponse = PostIssuesByIdDelegationResponses[keyof PostIssuesByIdDelegationResponses];

export type GetIssuesByIdAgentSessionsData = {
    body?: never;
    path: {
        id: string;
    };
    query?: never;
    url: '/issues/{id}/agent-sessions';
};

export type GetIssuesByIdAgentSessionsResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        issueId: string;
        providerTargetId: string;
        agentId: string | null;
        chatSessionId: string | null;
        status: 'created' | 'active' | 'completed' | 'stopped' | 'failed';
        isCurrentDelegation: boolean;
        createdAt: number;
        updatedAt: number;
    }>;
};

export type GetIssuesByIdAgentSessionsResponse = GetIssuesByIdAgentSessionsResponses[keyof GetIssuesByIdAgentSessionsResponses];

export type GetIssueAgentSessionsByAgentSessionIdActivitiesData = {
    body?: never;
    path: {
        agentSessionId: string;
    };
    query?: never;
    url: '/issue-agent-sessions/{agentSessionId}/activities';
};

export type GetIssueAgentSessionsByAgentSessionIdActivitiesResponses = {
    /**
     * Response for status 200
     */
    200: Array<{
        id: string;
        agentSessionId: string;
        type: 'thought' | 'action' | 'response' | 'elicitation' | 'error' | 'prompt';
        content: string;
        signal: string | null;
        signalMetadata: string | null;
        createdAt: number;
    }>;
};

export type GetIssueAgentSessionsByAgentSessionIdActivitiesResponse = GetIssueAgentSessionsByAgentSessionIdActivitiesResponses[keyof GetIssueAgentSessionsByAgentSessionIdActivitiesResponses];

export type PostIssueAgentSessionsByAgentSessionIdContinuationData = {
    body: {
        mode: 'queue' | 'steer';
        text: string;
    };
    path: {
        agentSessionId: string;
    };
    query?: never;
    url: '/issue-agent-sessions/{agentSessionId}/continuation';
};

export type PostIssueAgentSessionsByAgentSessionIdContinuationResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
        chatSessionId: string;
        continuationId: string;
        mode: 'queue' | 'steer';
    };
};

export type PostIssueAgentSessionsByAgentSessionIdContinuationResponse = PostIssueAgentSessionsByAgentSessionIdContinuationResponses[keyof PostIssueAgentSessionsByAgentSessionIdContinuationResponses];

export type PostIssueAgentSessionsByAgentSessionIdRerunData = {
    body: {
        [key: string]: unknown;
    };
    path: {
        agentSessionId: string;
    };
    query?: never;
    url: '/issue-agent-sessions/{agentSessionId}/rerun';
};

export type PostIssueAgentSessionsByAgentSessionIdRerunResponses = {
    /**
     * Response for status 200
     */
    200: {
        id: string;
        issueId: string;
        providerTargetId: string;
        agentId: string | null;
        chatSessionId: string | null;
        status: 'created' | 'active' | 'completed' | 'stopped' | 'failed';
        isCurrentDelegation: boolean;
        createdAt: number;
        updatedAt: number;
    };
};

export type PostIssueAgentSessionsByAgentSessionIdRerunResponse = PostIssueAgentSessionsByAgentSessionIdRerunResponses[keyof PostIssueAgentSessionsByAgentSessionIdRerunResponses];

export type DeleteIssueAgentSessionsByAgentSessionIdData = {
    body?: never;
    path: {
        agentSessionId: string;
    };
    query?: never;
    url: '/issue-agent-sessions/{agentSessionId}';
};

export type DeleteIssueAgentSessionsByAgentSessionIdResponses = {
    /**
     * Response for status 200
     */
    200: {
        ok: boolean;
    };
};

export type DeleteIssueAgentSessionsByAgentSessionIdResponse = DeleteIssueAgentSessionsByAgentSessionIdResponses[keyof DeleteIssueAgentSessionsByAgentSessionIdResponses];
