/**
 * @fileoverview MCP Tools Service
 *
 * Service for managing MCP tool operations including synchronization
 * with real-time progress streaming via GraphQL subscriptions.
 */
import { OnDestroy } from '@angular/core';
import { Observable } from 'rxjs';
import * as i0 from "@angular/core";
/**
 * Result of an MCP tool sync operation
 */
export interface MCPSyncResult {
    Success: boolean;
    ErrorMessage?: string;
    Added: number;
    Updated: number;
    Deprecated: number;
    Total: number;
    ServerName?: string;
    ConnectionName?: string;
    /** Whether OAuth authorization is required before connecting */
    RequiresOAuth?: boolean;
    /** OAuth authorization URL if authorization is required */
    AuthorizationUrl?: string;
    /** OAuth state parameter for tracking the authorization flow */
    StateParameter?: string;
    /** Whether OAuth re-authorization is required */
    RequiresReauthorization?: boolean;
    /** Reason for re-authorization if required */
    ReauthorizationReason?: string;
}
/**
 * Progress message received during sync
 */
export interface MCPSyncProgress {
    resolver: string;
    type: string;
    status: 'ok' | 'error';
    connectionId: string;
    phase: 'connecting' | 'listing' | 'syncing' | 'complete' | 'error';
    message: string;
    progress?: {
        current?: number;
        total?: number;
        percentage?: number;
    };
    result?: {
        added: number;
        updated: number;
        deprecated: number;
        total: number;
    };
}
/**
 * Sync state for a connection
 */
export interface MCPSyncState {
    isSyncing: boolean;
    progress: MCPSyncProgress | null;
    lastResult: MCPSyncResult | null;
    error: string | null;
}
/**
 * Service for MCP tool synchronization operations
 */
export declare class MCPToolsService implements OnDestroy {
    private destroy$;
    /** Map of connection ID to sync state */
    private syncStates;
    /** Provider instance for GraphQL operations */
    private gqlProvider;
    constructor();
    ngOnDestroy(): void;
    /**
     * Gets the sync state observable for a connection
     */
    getSyncState(connectionId: string): Observable<MCPSyncState>;
    /**
     * Gets the current sync state value for a connection
     */
    getSyncStateValue(connectionId: string): MCPSyncState;
    /**
     * Checks if a connection is currently syncing
     */
    isSyncing(connectionId: string): boolean;
    /**
     * Syncs tools for a specific MCP connection
     *
     * @param connectionId - The ID of the MCP connection to sync
     * @param forceSync - Optional flag to force sync even if recently synced
     * @returns Promise resolving to the sync result
     */
    syncTools(connectionId: string, forceSync?: boolean): Promise<MCPSyncResult>;
    /**
     * Clears the sync state for a connection
     */
    clearSyncState(connectionId: string): void;
    /**
     * Gets or creates a sync state subject for a connection
     */
    private getOrCreateSyncState;
    /**
     * Sets up listener for progress updates via the GraphQL subscription
     * The statusUpdates subscription receives progress messages during sync
     */
    private setupProgressListener;
    /**
     * Handles a progress update from the server
     */
    private handleProgressUpdate;
    static ɵfac: i0.ɵɵFactoryDeclaration<MCPToolsService, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<MCPToolsService>;
}
//# sourceMappingURL=mcp-tools.service.d.ts.map