/** Cursor Cloud Agents provider backed by the public v1 REST API. */
import type { CloudEvent, CloudProvider, CloudTask, CloudTaskStatus, DispatchOptions, ProviderCapabilities } from './types.js';
export declare const CURSOR_API_BASE_URL = "https://api.cursor.com/v1";
interface CursorAgent {
    id: string;
    name?: string;
    status: 'ACTIVE' | 'ARCHIVED';
    createdAt: string;
    updatedAt: string;
    latestRunId?: string;
    repos?: Array<{
        url: string;
        startingRef?: string;
        prUrl?: string;
    }>;
}
interface CursorRun {
    id: string;
    agentId: string;
    status: string;
    createdAt: string;
    updatedAt: string;
    result?: string;
    git?: {
        branches?: Array<{
            repoUrl: string;
            branch?: string;
            prUrl?: string;
        }>;
    };
}
export interface CursorCreateBody {
    prompt: {
        text: string;
        images?: Array<{
            data: string;
            mimeType: string;
        }>;
    };
    model?: {
        id: string;
    };
    repos?: Array<{
        url: string;
        startingRef?: string;
    }>;
    autoCreatePR?: boolean;
    envVars?: Record<string, string>;
}
/** Translate unified dispatch options into Cursor's documented v1 create shape. */
export declare function buildCursorCreateBody(options: DispatchOptions): CursorCreateBody;
/** Map one Cursor agent/run pair into the provider-neutral task shape. */
export declare function parseCursorTask(agent: CursorAgent, run: CursorRun, prompt?: string): CloudTask;
/** Parse one complete SSE frame into a shared cloud event. */
export declare function parseCursorSseFrame(frame: string): CloudEvent | undefined;
/** Turn Cursor's structured API errors into actionable provider errors. */
export declare function cursorApiError(action: string, status: number, text: string): Error;
export declare class CursorCloudProvider implements CloudProvider {
    id: "cursor";
    name: string;
    private secretsBundle?;
    constructor(config?: {
        secretsBundle?: string;
    });
    private hasKeySource;
    private resolveApiKey;
    capabilities(): ProviderCapabilities;
    private request;
    private latestRun;
    dispatch(options: DispatchOptions): Promise<CloudTask>;
    status(taskId: string): Promise<CloudTask>;
    list(filter?: {
        status?: CloudTaskStatus;
    }): Promise<CloudTask[]>;
    stream(taskId: string): AsyncIterable<CloudEvent>;
    cancel(taskId: string): Promise<void>;
    message(taskId: string, content: string): Promise<void>;
}
export {};
