/**
 * vibe-plugin-cursor
 *
 * Cursor AI agent provider for VibeControls Agent.
 * Implements the AIAgentProvider interface with dual-mode support:
 * - SDK mode: Uses @cursor/sdk (TypeScript SDK for Cursor agents) for direct API access
 * - CLI mode: Uses the `cursor-agent` CLI binary
 *
 * Mode auto-detection: SDK if CURSOR_API_KEY is set, CLI if `cursor-agent`
 * binary is found, error if neither is available.
 */
import type { VibePlugin, ProfileContext } from "@vibecontrols/plugin-sdk";
type ProviderMode = "sdk" | "cli";
interface AIModelInfo {
    id: string;
    name: string;
    provider: string;
    contextWindow: number;
    maxOutputTokens: number;
    supportsVision: boolean;
    supportsStreaming: boolean;
    inputPricePerMToken: number;
    outputPricePerMToken: number;
}
interface AIProviderCapabilities {
    streaming: boolean;
    vision: boolean;
    fileAttachments: boolean;
    toolUse: boolean;
    mcpSupport: boolean;
    voiceMode: boolean;
    cancelSupport: boolean;
    modelListing: boolean;
}
interface AIFileAttachment {
    filename: string;
    mimeType: string;
    content: Buffer | string;
    size: number;
}
type AISessionStatus = "active" | "idle" | "processing" | "error" | "terminated";
type AILogType = "input" | "output" | "thinking" | "event" | "error" | "metadata";
interface AISessionConfig {
    name: string;
    agentType: string;
    model?: string;
    maxTokens?: number;
    temperature?: number;
    systemPrompt?: string;
    workingDirectory?: string;
    providerConfig?: Record<string, unknown>;
}
interface AISession {
    id: string;
    name: string;
    status: AISessionStatus;
    agentType: string;
    provider: string;
    config: AISessionConfig;
    stats: AIUsageStats;
    createdAt: string;
    updatedAt: string;
}
interface AIContext {
    id: string;
    type: string;
    content: string;
    metadata?: Record<string, unknown>;
}
interface AIResponse {
    content: string;
    model: string;
    inputTokens: number;
    outputTokens: number;
    thinkingSteps?: string[];
    durationMs: number;
    metadata?: Record<string, unknown>;
}
interface AIStreamChunk {
    type: "text" | "thinking" | "error" | "done";
    content: string;
    tokensUsed?: number;
}
interface AILog {
    id: string;
    sessionId: string;
    type: AILogType;
    content: string;
    tokenCount?: number;
    model?: string;
    durationMs?: number;
    agentMetadata?: Record<string, unknown>;
    createdAt: string;
}
interface AILogFilter {
    types?: AILogType[];
    startDate?: string;
    endDate?: string;
    search?: string;
    limit?: number;
    offset?: number;
}
interface AIUsageStats {
    inputTokens: number;
    outputTokens: number;
    requestCount: number;
    estimatedCostUsd: number;
    modelBreakdown?: Record<string, {
        inputTokens: number;
        outputTokens: number;
        requestCount: number;
    }>;
}
interface AIAgentProvider {
    readonly name: string;
    createSession(config: AISessionConfig): Promise<AISession>;
    sendPrompt(sessionId: string, prompt: string, context?: AIContext[]): Promise<AIResponse>;
    streamPrompt?(sessionId: string, prompt: string, context?: AIContext[], onChunk?: (chunk: AIStreamChunk) => void): Promise<AIResponse>;
    getSessionLogs(sessionId: string, filter?: AILogFilter): Promise<AILog[]>;
    getUsageStats(sessionId: string): Promise<AIUsageStats>;
    configureSession(sessionId: string, config: Partial<AISessionConfig>): Promise<void>;
    destroySession(sessionId: string): Promise<void>;
    listSessions(): Promise<AISession[]>;
    getSessionStatus(sessionId: string): Promise<AISessionStatus>;
    healthCheck(): Promise<{
        ok: boolean;
        message?: string;
    }>;
    listModels?(): Promise<AIModelInfo[]>;
    cancelRequest?(sessionId: string): Promise<void>;
    getCapabilities?(): AIProviderCapabilities;
    attachFiles?(sessionId: string, files: AIFileAttachment[]): Promise<void>;
    getMode?(): ProviderMode;
    setMode?(mode: ProviderMode): void;
    getCliLaunchSpec(): {
        binary: string;
        baseArgs?: string[];
        env?: Record<string, string>;
    } | null;
    sdkOneShot(opts: {
        prompt: string;
        model?: string;
        maxTokens?: number;
        extras?: Record<string, unknown>;
    }): Promise<{
        text: string;
        usage?: unknown;
    }>;
}
type CursorVibePlugin = VibePlugin & {
    providers?: {
        ai?: AIAgentProvider;
    };
};
export declare const createPlugin: (_ctx: ProfileContext) => CursorVibePlugin;
export {};
