/**
 * gRPC Client for Clawx Agent Communication
 *
 * Replaces WebSocket client and SSE streaming with gRPC bidirectional streaming
 */
import { EventEmitter } from 'events';
import type { Persona } from '../../types/persona.js';
import { GrpcAgentFrame } from './protocol.js';
export interface GrpcClientOptions {
    agentId: string;
    agentName: string;
    persona?: Persona;
    capabilities: string[];
    endpoint: string;
    serverAddress: string;
    reconnectDelay?: number;
    heartbeatInterval?: number;
    onFrame?: (frame: GrpcAgentFrame) => void;
    onRegistered?: (agentId: string) => void;
    onDisconnected?: () => void;
    onError?: (error: Error) => void;
}
export declare class GrpcClient extends EventEmitter {
    private options;
    private protoClient;
    private call;
    private connected;
    private registered;
    private heartbeatTimer;
    private reconnectTimer;
    private pendingFrames;
    constructor(options: GrpcClientOptions);
    private connect;
    private setupCallHandlers;
    private handleFrame;
    private handleRegistered;
    private register;
    private startHeartbeat;
    private sendHeartbeat;
    private handleError;
    private handleDisconnect;
    private scheduleReconnect;
    private stopHeartbeat;
    private flushPendingFrames;
    sendFrame(frame: GrpcAgentFrame): boolean;
    sendChat(toAgentId: string, message: string, conversationId?: string): boolean;
    sendAgentMessageStart(turnId: string, toAgentId: string, persona?: {
        name: string;
        role: string;
    }): boolean;
    sendAgentMessageDelta(turnId: string, toAgentId: string, delta: string): boolean;
    sendAgentMessageEnd(turnId: string, toAgentId: string, finalMessage: string): boolean;
    sendTaskStarted(taskId: string, toAgentId: string, tool: string, params: any): boolean;
    sendTaskProgress(taskId: string, toAgentId: string, progress: number, message?: string): boolean;
    sendToolStarted(taskId: string, toAgentId: string, toolName: string, params: any, parentOperationType?: 'task' | 'chat'): boolean;
    sendToolStdout(taskId: string, toAgentId: string, data: string, parentOperationType?: 'task' | 'chat'): boolean;
    sendToolStderr(taskId: string, toAgentId: string, data: string, parentOperationType?: 'task' | 'chat'): boolean;
    sendToolFinished(taskId: string, toAgentId: string, result: any, parentOperationType?: 'task' | 'chat'): boolean;
    sendTaskCompleted(taskId: string, toAgentId: string, result: any): boolean;
    sendTaskFailed(taskId: string, toAgentId: string, error: string): boolean;
    sendTaskCancelled(taskId: string, toAgentId: string, reason?: string): boolean;
    disconnect(): void;
    isConnected(): boolean;
    isRegistered(): boolean;
    getAgentId(): string;
    getAgentName(): string;
    getPersona(): Persona | undefined;
}
//# sourceMappingURL=grpc-client.d.ts.map