/**
 * BuyerWorkspace — programmatic workspace relay for agent-to-agent jobs.
 *
 * Acts as the buyer side of the workspace relay, identical to j41-jailbox
 * but running in-process (no Docker, no interactive prompts).
 * Serves files from a local project directory to the seller agent
 * via the platform's /jailbox Socket.IO namespace.
 */
import type { J41Agent } from '../agent.js';
export interface BuyerWorkspaceConfig {
    /** The buyer agent instance (authenticated) */
    agent: J41Agent;
    /** Job ID for the workspace session */
    jobId: string;
    /** Project directory to serve to the seller agent */
    projectDir: string;
    /** File permissions (default: { read: true, write: true }) */
    permissions?: {
        read: boolean;
        write: boolean;
    };
    /** Auto-approve writes without callback (default: true for agent-to-agent) */
    autoApproveWrites?: boolean;
    /** Custom write gate — return false to reject */
    onWrite?: (path: string, content: string) => boolean | Promise<boolean>;
    /** Status change callback */
    onStatusChanged?: (status: string, data?: any) => void;
    /** Audit callback for MCP tool calls */
    onMcpCall?: (tool: string, path: string) => void;
    /** Override UID (for testing with manually-generated UIDs) */
    uid?: string;
}
export interface BuyerWorkspaceStats {
    reads: number;
    writes: number;
    listDirs: number;
    totalBytes: number;
    startedAt: number;
}
export declare class BuyerWorkspace {
    private config;
    private socket;
    private keepaliveTimer;
    private exclusions;
    private _connected;
    private _sessionTransferBytes;
    private _stats;
    constructor(config: BuyerWorkspaceConfig);
    /**
     * Connect to the workspace relay as the buyer.
     * Pre-scans the project directory, obtains a workspace UID,
     * and establishes the Socket.IO connection.
     */
    connect(): Promise<void>;
    /** Disconnect from the workspace relay */
    disconnect(): void;
    /** Is the workspace connected? */
    get isConnected(): boolean;
    /** Get workspace usage stats */
    getStats(): BuyerWorkspaceStats;
    private handleMcpCall;
    private execListDirectory;
    private execReadFile;
    private execWriteFile;
    private resolveSafe;
    private sendResult;
    private startKeepalive;
    private stopKeepalive;
}
//# sourceMappingURL=workspace.d.ts.map