/**
 * Client Callback Manager
 *
 * Handles callbacks to clients for LLM, approval, and embedding requests
 */
import type { ClientServices } from '@mondaydotcomorg/atp-protocol';
/**
 * Callback request types
 */
export type CallbackType = 'llm' | 'approval' | 'embedding' | 'tool';
/**
 * Callback request payload
 */
export interface CallbackRequest {
    type: CallbackType;
    operation: string;
    payload: Record<string, unknown>;
}
/**
 * Registered client information
 */
interface ClientInfo {
    clientId: string;
    services: ClientServices;
    callbackUrl?: string;
    lastSeen: Date;
}
/**
 * Callback handler function
 */
export type CallbackHandler = (clientId: string, request: CallbackRequest) => Promise<unknown>;
/**
 * Manages client callbacks for provided services
 */
export declare class ClientCallbackManager {
    private clients;
    private callbackHandler?;
    private cleanupInterval?;
    /**
     * Registers a callback handler for client requests
     * @param handler - Function to handle callbacks
     */
    setCallbackHandler(handler: CallbackHandler): void;
    /**
     * Registers a client with their provided services
     * @param clientId - Unique client identifier
     * @param services - Services provided by client
     * @param callbackUrl - Optional webhook URL for callbacks
     */
    registerClient(clientId: string, services: ClientServices, callbackUrl?: string): void;
    /**
     * Updates client's last seen timestamp
     * @param clientId - Client identifier
     */
    updateClientActivity(clientId: string): void;
    /**
     * Checks if client has a specific service
     * @param clientId - Client identifier
     * @param serviceType - Type of service
     * @returns Whether client provides this service
     */
    hasClientService(clientId: string, serviceType: CallbackType): boolean;
    /**
     * Gets client information
     * @param clientId - Client identifier
     * @returns Client info or undefined
     */
    getClient(clientId: string): ClientInfo | undefined;
    /**
     * Sends a callback request to a client
     * @param clientId - Client identifier
     * @param request - Callback request
     * @returns Response from client
     */
    sendCallback(clientId: string, request: CallbackRequest): Promise<unknown>;
    /**
     * Cleans up stale clients (not seen in specified duration)
     * @param maxAge - Maximum age in milliseconds (default: 5 minutes)
     */
    cleanupStaleClients(maxAge?: number): number;
    /**
     * Gets all registered clients
     * @returns Array of client information
     */
    getAllClients(): ClientInfo[];
    /**
     * Removes a client
     * @param clientId - Client identifier
     */
    unregisterClient(clientId: string): void;
    /**
     * Stops automatic cleanup and clears resources
     */
    destroy(): void;
}
export declare const clientCallbackManager: ClientCallbackManager;
export {};
//# sourceMappingURL=index.d.ts.map