/**
 * Webhook Integration
 *
 * Support for external webhooks:
 * - Event notifications
 * - Custom endpoints
 * - Retry logic
 * - Payload signing
 */
export type WebhookEvent = 'session.start' | 'session.end' | 'message.user' | 'message.assistant' | 'tool.start' | 'tool.complete' | 'tool.error' | 'file.create' | 'file.modify' | 'file.delete' | 'error' | 'cost.threshold';
export interface WebhookConfig {
    id: string;
    name: string;
    url: string;
    events: WebhookEvent[];
    secret?: string;
    enabled: boolean;
    headers?: Record<string, string>;
    retryCount?: number;
    retryDelay?: number;
    timeout?: number;
}
export interface WebhookPayload {
    event: WebhookEvent;
    timestamp: string;
    data: Record<string, unknown>;
    sessionId?: string;
}
export interface WebhookDelivery {
    id: string;
    webhookId: string;
    event: WebhookEvent;
    payload: WebhookPayload;
    status: 'pending' | 'success' | 'failed';
    attempts: number;
    lastAttempt?: Date;
    response?: {
        statusCode: number;
        body?: string;
    };
    error?: string;
}
/**
 * Webhook Manager
 */
export declare class WebhookManager {
    private webhooks;
    private deliveryHistory;
    private configPath;
    private maxHistorySize;
    constructor(configPath?: string);
    /**
     * Register a webhook
     */
    register(config: Omit<WebhookConfig, 'id'>): string;
    /**
     * Update a webhook
     */
    update(id: string, updates: Partial<WebhookConfig>): boolean;
    /**
     * Remove a webhook
     */
    remove(id: string): boolean;
    /**
     * Get webhook by ID
     */
    get(id: string): WebhookConfig | undefined;
    /**
     * Get all webhooks
     */
    getAll(): WebhookConfig[];
    /**
     * Get webhooks for an event
     */
    getForEvent(event: WebhookEvent): WebhookConfig[];
    /**
     * Emit an event to all registered webhooks
     */
    emit(event: WebhookEvent, data: Record<string, unknown>, sessionId?: string): Promise<WebhookDelivery[]>;
    /**
     * Deliver payload to a webhook
     */
    private deliver;
    /**
     * Send HTTP request
     */
    private sendRequest;
    /**
     * Sign payload with secret
     */
    private signPayload;
    /**
     * Verify webhook signature
     */
    static verifySignature(payload: string, signature: string, secret: string): boolean;
    /**
     * Get delivery history
     */
    getHistory(webhookId?: string): WebhookDelivery[];
    /**
     * Get failed deliveries
     */
    getFailedDeliveries(): WebhookDelivery[];
    /**
     * Retry a failed delivery
     */
    retry(deliveryId: string): Promise<WebhookDelivery | null>;
    /**
     * Clear history
     */
    clearHistory(): void;
    /**
     * Test a webhook
     */
    test(id: string): Promise<WebhookDelivery | null>;
    /**
     * Format webhook list for display
     */
    formatWebhooks(): string;
    /**
     * Add to history
     */
    private addToHistory;
    /**
     * Delay helper
     */
    private delay;
    /**
     * Load config from file
     */
    private loadConfig;
    /**
     * Save config to file
     */
    private saveConfig;
}
/**
 * Get or create webhook manager
 */
export declare function getWebhookManager(): WebhookManager;
/**
 * Emit a webhook event
 */
export declare function emitWebhook(event: WebhookEvent, data: Record<string, unknown>, sessionId?: string): Promise<void>;
export default WebhookManager;
