UNPKG

@struktoai/mirage-core

Version:

A Unified Virtual Filesystem For AI Agents

36 lines • 2.02 kB
import type { GDriveAccessor } from '../../accessor/gdrive.ts'; import { DirListing, FileStat, type PathSpec } from '../../types.ts'; import { type DriveFile } from '../google/drive.ts'; export declare function resourceTypeFor(mime: string): string; export declare function uniqueSharedDriveName(name: string, existingNames: Set<string>): string; /** * The stat of one Drive file resource, as a listing, `files.get` or an * upload's reply returns it. * * Pure, so an upload's reply parses the same as a stat. A missing `mimeType` * reads as a plain file: natives are refused before any upload, so a reply * without one names bytes. `extra` carries what the functions handed the stat * act on: the file id, its shared drive, its MIME type, and the md5 and head * revision a read checks. Mirrors Python's `stat_from_item`. * * @param item a Drive file resource with `ITEM_FIELDS` */ export declare function statFromItem(item: DriveFile): FileStat; /** * What is at `path` now, for a change about to be made to it. * * A listed row names its item by id, and another client may have moved, * renamed or trashed the item since: a change made by that id would land on a * file at another path. One `files.get` confirms the item still has the name * and the folders the listing gave it; otherwise that folder is listed again, * and what it names at the path answers, null for nothing. A row that names * no folder (a Shared Drive) is taken as is. Mirrors Python's `live_row`. */ export declare function liveRow(accessor: GDriveAccessor, path: PathSpec, entry: FileStat | null | undefined): Promise<FileStat | null>; /** * A folder's children, each as `stat` answers it. The mount root lists the * scoped folder, or My Drive and the Shared Drives the account sees; any * other folder is listed by the id its parent's listing named. */ export declare function readdir(accessor: GDriveAccessor, path: PathSpec, entry?: FileStat | null): Promise<FileStat[] | DirListing>; //# sourceMappingURL=readdir.d.ts.map