/**
 * Workspace Stream — Real-time bidirectional file sync between CLI and V3.
 *
 * Architecture:
 *   1. WorkspaceWatcher — chokidar-based file watcher that detects local changes
 *      and pushes them to V3 via WebSocket.
 *   2. MutationApplier — receives file_mutation events from V3's SSE stream
 *      and applies them to the local workspace IN REAL TIME (not at completion).
 *   3. WorkspaceWSClient — WebSocket client connected to V3's /ws/workspace
 *      for bidirectional file sync outside the SSE stream.
 *
 * Event types (V3 → CLI via SSE):
 *   {"type": "file_mutation", "path": "rel/path", "content": "...", "action": "write"|"edit", "tool": "write_file"|"edit_file"}
 *
 * Event types (CLI → V3 via /ws/workspace):
 *   {"type": "bind", "context_id": "...", "workspace_root": "..."}
 *   {"type": "file_sync", "path": "rel/path", "content": "...", "action": "write"|"delete"}
 *   {"type": "file_batch", "files": [{path, content}, ...]}
 */
/**
 * Apply a file_mutation event from V3's SSE stream to the local workspace.
 * Call this from the SSE event handler for real-time file application.
 */
export declare function applyFileMutation(event: {
    type: string;
    path: string;
    content: string;
    action: string;
}, workspaceRoot: string): boolean;
export interface WatcherOptions {
    workspaceRoot: string;
    onFileChange?: (relativePath: string, content: string | null, action: 'write' | 'delete') => void;
}
export declare class WorkspaceWatcher {
    private watcher;
    private workspaceRoot;
    private onFileChange;
    private _ready;
    constructor(options: WatcherOptions);
    start(): void;
    stop(): void;
    get isReady(): boolean;
    private _handleChange;
}
export interface WorkspaceWSOptions {
    serverUrl: string;
    token: string;
    contextId: string;
    workspaceRoot: string;
    onMutation?: (event: any) => void;
}
export declare class WorkspaceWSClient {
    private ws;
    private opts;
    private reconnectTimer;
    private _connected;
    private _queue;
    private _maxQueue;
    constructor(opts: WorkspaceWSOptions);
    connect(): void;
    disconnect(): void;
    /**
     * Push a local file change to V3's workspace.
     */
    syncFile(relativePath: string, content: string | null, action: 'write' | 'delete'): void;
    /**
     * Push multiple files at once.
     */
    syncBatch(files: Array<{
        path: string;
        content: string;
    }>): void;
    get isConnected(): boolean;
    private _send;
}
