import type { VMConfig, VMInfo, VMPortForwardOptions, VMSCPOptions, VMSSHOptions, VMSyncOptions, VMTunnelOptions, VMWaitOptions } from "../../types/vm"; import { VMTunnel } from "./vm-tunnel"; export interface VMPortForward { readonly host: string; readonly port: number; readonly url: string; close(): Promise; } export interface VMSyncHandle { close(): Promise; readonly done: Promise; } /** Native SSH/SCP/rsync helpers and private TCP access. close() releases local resources only. */ export declare abstract class VMAccess { abstract readonly config: VMConfig; abstract readonly info: VMInfo; abstract readonly id: string; abstract readonly name: string; abstract runtime(): Promise; abstract wait(opts?: VMWaitOptions): Promise; abstract bind(port: number): Promise; abstract keepAlive(callback: (vm: this) => Promise): Promise; private local; private keyPreparation?; protected publicKey(): Promise; private identity; private prepareIdentity; /** A Node Duplex stream to a private guest TCP port. No public URL is created. */ tunnel(port: number, opts?: VMTunnelOptions): Promise; /** Forward a guest TCP port to loopback, returning the chosen local port and a close handle. */ portForward(port: number, opts?: VMPortForwardOptions): Promise; private sshConnection; /** Interactive OpenSSH, or execute literal argv remotely. Requires local OpenSSH. */ ssh(command?: string | string[], opts?: VMSSHOptions): Promise; /** Copy one local and one remote path. Prefix the remote path with vm:, the VM name, or its ID. */ scp(source: string, destination: string, opts?: VMSCPOptions): Promise; /** Sync a directory with rsync over the private SSH tunnel, optionally watching for edits. */ sync(directory?: string, opts?: VMSyncOptions): Promise; /** Release local tunnels and watchers. The persistent VM keeps its current lifecycle state. */ close(): Promise; }