/** * Types for browsing read-only server mounts. * * These mirror the `mint_sdk.filesystem` wire models. MINT records the path of * data that already sits on a mount; it never copies it. */ /** What a listing row is. */ export type FileEntryKind = 'file' | 'directory'; /** Field a listing is ordered by, after directories are grouped first. */ export type FileBrowserSortKey = 'name' | 'size' | 'modified'; /** One read-only directory tree exposed by the server. */ export interface ServerMount { id: string; label: string; read_only?: boolean; /** False when the mount is configured but currently unreachable. */ available?: boolean; /** Child mounts, used to render the sidebar tree. */ children?: ServerMount[]; /** Item count shown beside the mount; free-form so callers can send "1.2k". */ count?: string | number; } /** One step of the trail from a mount root to the current directory. */ export interface FilePathCrumb { label: string; path: string; } /** A single file or directory inside a mount. */ export interface FileEntry { name: string; /** Mount-relative POSIX path. */ path: string; kind: FileEntryKind; /** Null for directories. */ size_bytes?: number | null; modified_at?: string | null; extension?: string; /** * False when the entry fails the active type rules. Non-matching entries are * still listed — they dim rather than vanish. */ matches_type_rules?: boolean; /** Directories only. */ child_count?: number | null; } /** The contents of one directory inside a mount. */ export interface FileDirectoryListing { mount_id: string; path: string; /** Null at the mount root. */ parent?: string | null; breadcrumbs?: FilePathCrumb[]; entries?: FileEntry[]; /** Directory size before any search filter. */ total_count?: number; /** How many entries satisfy the type rules. */ match_count?: number; /** How many entries this response carries, after search and any cap. */ shown_count?: number; /** True when the directory held more entries than the server will return. */ truncated?: boolean; } /** One item the user has picked. */ export interface FileSelection { mount_id: string; path: string; name: string; kind: FileEntryKind; /** For a directory pick, how many files it contains. */ child_count?: number | null; size_bytes?: number | null; } /** Where the user is standing in the browser. */ export interface FileBrowserLocation { mount_id: string; path: string; } /** Several directory levels in one response, parents before children. */ export interface FileDirectoryTree { listings?: FileDirectoryListing[]; /** True when the server's entry budget stopped before the requested depth. */ truncated?: boolean; } /** Entries whose name contains a query, below one directory. */ export interface FileSearchResult { entries?: FileEntry[]; searched_directories?: number; /** True when a directory, result or time budget ended the search early. */ truncated?: boolean; }