@struktoai/mirage-core
Version:
A Unified Virtual Filesystem For AI Agents
38 lines • 1.45 kB
TypeScript
import type { VFSStat } from './types.ts';
/**
* One path's stat as a POSIX kernel fills it, from a mount's row: what
* every runtime that answers a guest's stat (the host entry points,
* QuickJS) reads and spells in its own shape, so a link count, an owner,
* a block count or an inode is the same number whichever one is asked.
* `nlink` is 2 for a directory and 1 otherwise; the access time is the
* modification time when the row has none, and the change time always
* is. Mirrors Python's `runtime/stat.PosixStat`.
*/
export interface PosixStat {
readonly mode: number;
readonly ino: number;
readonly dev: number;
readonly nlink: number;
readonly uid: number;
readonly gid: number;
readonly rdev: number;
readonly size: number;
readonly atimeMs: number;
readonly mtimeMs: number;
readonly ctimeMs: number;
readonly blksize: number;
readonly blocks: number;
}
/**
* The POSIX stat a runtime reports for one mount row. `uid` and `gid`
* are what a row without an owner reports (a host process's own, 0 in a
* sandbox), and `unknownMs` what an unknown modification time reads as.
* `path` names the inode when the row names none of its own. Mirrors
* Python's `posix_stat`.
*/
export declare function posixStat(row: VFSStat, path: string, prefix: string, fallback?: {
uid?: number;
gid?: number;
unknownMs?: number;
}): PosixStat;
//# sourceMappingURL=stat.d.ts.map