/**
 * Remote File System Surface
 *
 * Proxies all filesystem operations (read, write, list, stat, etc.)
 * to a remote node (e.g. Electron desktop app) via the WS control plane.
 * This allows the gateway to work with files on any connected device,
 * not just its own local filesystem.
 */
import type { Surface, SurfaceStartInput, SurfaceStopInput, SurfaceSnapshot, SurfaceState, SurfaceFactory } from "./contracts.js";
import type { WsControlPlane } from "../ws.js";
export declare class RemoteFileSystemSurface implements Surface {
    readonly id: string;
    private ws;
    readonly type: "remote-filesystem";
    private _state;
    private _sessionId;
    private _startedAt;
    private _projectRoot;
    private _nodeId;
    private _opCount;
    /**
     * Backup map: file path → original content.
     * We store remote backups in memory on the gateway side so undo works.
     */
    private _backups;
    onOutput?: (data: string) => void;
    onStateChange?: (state: SurfaceState) => void;
    constructor(id: string, ws: WsControlPlane);
    get state(): SurfaceState;
    get sessionId(): string | null;
    get nodeId(): string | null;
    start(input: SurfaceStartInput & {
        nodeId?: string;
    }): Promise<void>;
    stop(_input?: SurfaceStopInput): Promise<void>;
    snapshot(): SurfaceSnapshot;
    read(filePath: string): Promise<string>;
    write(filePath: string, content: string): Promise<void>;
    patch(filePath: string, search: string, replace: string): Promise<{
        matched: boolean;
    }>;
    exists(filePath: string): Promise<boolean>;
    list(dirPath: string): Promise<string[]>;
    statFile(filePath: string): Promise<{
        size: number;
        isDirectory: boolean;
        modified: string;
    }>;
    /** Check if a path is within project boundary (basic check for remote paths) */
    isPathAllowed(filePath: string): boolean;
    /**
     * Restore a file to its pre-modification state.
     */
    restore(filePath: string): Promise<boolean>;
    hasBackup(filePath: string): boolean;
    getBackup(filePath: string): string | null | undefined;
    clearBackup(filePath: string): void;
    saveExternalBackup(filePath: string): Promise<void>;
    private ensureRunning;
    private _setState;
}
export declare class RemoteFileSystemSurfaceFactory implements SurfaceFactory {
    private ws;
    readonly type: "remote-filesystem";
    constructor(ws: WsControlPlane);
    create(id: string): RemoteFileSystemSurface;
}
//# sourceMappingURL=remote-filesystem.d.ts.map