import { MountBackend } from '@struktoai/mirage-core/types'; import type { Session } from '@struktoai/mirage-core/workspace/session/session'; import type { Workspace } from '@struktoai/mirage-core/workspace/workspace/workspace'; export interface FuseHandle { mountpoint: string; /** Whether Mirage created this mountpoint directory and may remove it later. */ ownsMountpoint: boolean; unmount: () => Promise; } export interface MountOptions { /** Caller/deployment-owned mountpoint. Mirage mounts here but does not delete it. */ mountpoint?: string; /** Scope the mount to a single workspace mount prefix (subtree exposure). */ rootPrefix?: string; /** Run every op under this session's mount grants (session-bound mountpoint). */ session?: Session; /** * When true, `@zkochan/fuse-native`'s `autoUnmount` flag is set so the * kernel releases the mount if the process exits abnormally. Defaults to * `true` on Linux, `false` on darwin — macFUSE rejects the option with * "unknown option `auto_unmount'". On darwin the SIGINT cleanup in * FuseManager runs `diskutil unmount force` instead. */ autoUnmount?: boolean; /** * Extra options forwarded verbatim to `@zkochan/fuse-native`. * `directIO: false` additionally skips the `direct_io` mount option that * Mirage appends by default (see appendDirectIO). */ fuseOptions?: Record; /** * Which kernel interface serves the mount: 'fuse' (default) or 'fskit'. * 'fskit' routes through macFUSE 5.x's FSKit backend (no kernel * extension); macOS-only, mounts under /Volumes, and every mounted * resource must report exact sizes. See backend.ts for the guards. */ backend?: MountBackend; } interface FuseInstance { mount: (cb: (err: Error | null) => void) => void; unmount: (cb: (err: Error | null) => void) => void; _fuseOptions?: () => string; } /** * Append raw libfuse options to the mount option string. * `@zkochan/fuse-native` serializes a fixed allowlist of options in * `_fuseOptions()`, so anything outside it (`direct_io`, `backend`, * `volname`) is appended by wrapping the serializer at runtime — this * ships to consumers, unlike a pnpm patch, which would only apply inside * this repository. */ export declare function appendMountOptions(fuse: FuseInstance, extras: string[]): void; /** * Append libfuse's `direct_io`. Load-bearing for size-unknown API files: * getattr reports 0 pre-open and the kernel must read to EOF regardless * (verified on the macOS kext: without it, `cat` reads 0 bytes; see the * CLAUDE.md FUSE section). */ export declare function appendDirectIO(fuse: FuseInstance): void; /** * What to install when the binding will not load, for the platform it did * not load on. Only macOS and Linux have an answer: fuse-native's legacy * Windows path builds against the unmaintained Dokany-based * `fuse-shared-library-win32` rather than WinFsp, so naming a Windows * driver would send the reader after something that cannot fix it. Python * is the one that mounts FUSE on Windows. */ export declare function driverHint(platform?: string): string; /** Fallback unmount via platform tools — mirrors Python's SIGINT handler. */ export declare function forceUnmount(mountpoint: string): void; export declare function mount(ws: Workspace, options?: MountOptions): Promise; export declare function mountBackground(ws: Workspace, options?: MountOptions): Promise; export {}; //# sourceMappingURL=mount.d.ts.map