import type { Readable } from 'node:stream'; import { type SFTPWrapper } from 'ssh2'; export declare const WORKSPACE_READ_MAX: number; export declare class WorkspaceBrowseError extends Error { readonly status: number; readonly code: string; constructor(status: number, code: string, message: string); } export interface FileInfo { kind: 'file' | 'directory' | 'link' | 'other'; size: number; modifiedAt: number; } export interface DirectoryEntry extends FileInfo { name: string; path: string; readable: boolean; reason?: string; } export interface WorkspaceListing { path: string; entries: DirectoryEntry[]; total: number; hasMore: boolean; nextOffset: number | null; } export interface BrowseFileSystem { realpath(path: string): Promise; stat(path: string): Promise; entries(path: string): Promise>; read(path: string, signal?: AbortSignal): Promise; join(root: string, path: string): string; within(root: string, path: string): boolean; } export declare function normalizeBrowsePath(value: string): string; export declare function protectedBrowsePath(path: string, original?: boolean): boolean; export declare function collectRead(stream: Readable, signal?: AbortSignal): Promise; export declare const localBrowseFs: BrowseFileSystem; export declare function sftpBrowseFs(sftp: SFTPWrapper): BrowseFileSystem; export declare function knownHostKeys(host: string, port: number, file?: string): Promise; export declare function withReadonlySftp(config: { host: string; port: number; user: string; privateKey: string | Buffer; hostKeys: string[]; }, action: (fs: BrowseFileSystem) => Promise, signal?: AbortSignal): Promise; export declare function listWorkspaceRoot(fs: BrowseFileSystem, rootPath: string, pathValue: string, original: boolean, offset?: number, limit?: number): Promise; export declare function readWorkspaceRoot(fs: BrowseFileSystem, rootPath: string, pathValue: string, original: boolean, signal?: AbortSignal): Promise<{ path: string; name: string; bytes: Buffer; mime: string; }>; //# sourceMappingURL=workspace-browser.d.ts.map