/**
 * WorkspaceClient — agent-side workspace relay connection
 *
 * Connects to the platform's /jailbox Socket.IO namespace.
 * Sends MCP tool calls (read_file, write_file, list_directory)
 * and receives results from the buyer's CLI.
 */
export interface WorkspaceClientConfig {
    apiUrl: string;
    getSessionToken: () => string | null;
}
export interface WorkspaceStatus {
    /** Workspace session UUID */
    id: string;
    jobId: string;
    status: 'pending' | 'active' | 'paused' | 'disconnected' | 'completed' | 'aborted';
    agentConnected: boolean;
    buyerConnected: boolean;
    mode: 'supervised' | 'standard';
    permissions: {
        read: boolean;
        write: boolean;
    };
    createdAt: string;
    updatedAt: string;
    connectedAt?: string;
    disconnectedAt?: string;
    completedAt?: string;
    /** Operation counts */
    counts?: {
        reads: number;
        writes: number;
        list_dirs: number;
        blocked: number;
    };
    /** Pending write approvals (supervised mode) */
    pendingApprovals?: Array<{
        id: string;
        path: string;
        sizeBytes: number;
    }>;
    /** Recently blocked operations */
    recentBlocked?: Array<{
        path: string;
        reason: string;
        timestamp: string;
    }>;
    /** Connect command for buyer CLI (when status is pending) */
    connectCommand?: string;
    /** Reconnect token (when status is disconnected) */
    reconnectToken?: string;
    /** Deletion attestation (when status is completed) */
    attestation?: Record<string, any>;
    /** @deprecated Use counts instead */
    stats?: {
        filesRead: number;
        filesWritten: number;
        listDirectoryCalls: number;
    };
}
export interface WorkspaceTokenResponse {
    sessionId: string;
    workspaceUid: string;
    command: string;
    installCommand: string;
    mode: 'supervised' | 'standard';
    permissions: {
        read: boolean;
        write: boolean;
    };
}
export interface WorkspaceToolDef {
    type: 'function';
    function: {
        name: string;
        description: string;
        parameters: Record<string, any>;
    };
}
export interface WorkspaceStats {
    filesRead: number;
    filesWritten: number;
    listDirectoryCalls: number;
    duration: number;
}
export declare class WorkspaceClient {
    private config;
    private socket;
    private pendingRequests;
    private statusHandler;
    private disconnectHandler;
    private _connected;
    private _jobId;
    private _excludedFiles;
    private _reconnectCycles;
    private _stats;
    constructor(config: WorkspaceClientConfig);
    /**
     * Connect to the workspace relay for a specific job.
     * Gets a one-time connect token via REST, then connects Socket.IO.
     * Resolves when the buyer's CLI is connected (status: active).
     */
    connect(jobId: string): Promise<void>;
    /**
     * Low-level: send an MCP tool call and wait for result.
     * The tool name should NOT have workspace_ prefix — use the raw MCP tool name
     * (read_file, write_file, list_directory).
     */
    sendToolCall(tool: string, params: Record<string, any>): Promise<any>;
    listDirectory(path?: string): Promise<any[]>;
    readFile(path: string): Promise<string>;
    writeFile(path: string, content: string): Promise<string>;
    /** Signal to the buyer that the agent's work is complete */
    signalDone(): void;
    /** Get workspace usage stats for attestation */
    getStats(): WorkspaceStats;
    onStatusChanged(handler: (status: string, data?: any) => void): void;
    onDisconnected(handler: (reason: string) => void): void;
    getAvailableTools(): WorkspaceToolDef[];
    get isConnected(): boolean;
    get jobId(): string | null;
    /** Files excluded by buyer's SovGuard (sent by relay on connect) */
    get excludedFiles(): string[];
    /** Send keepalive ping to prevent relay idle timeout */
    ping(): void;
    disconnect(): void;
}
//# sourceMappingURL=client.d.ts.map