@struktoai/mirage-core
Version:
A Unified Virtual Filesystem For AI Agents
35 lines • 1.36 kB
TypeScript
import type { StorageUsage } from '../capacity.ts';
export interface RAMAttrs {
mode?: number;
uid?: number | string;
gid?: number | string;
atime?: string;
}
/**
* A RAM store's file table, keeping `held` equal to the bytes it holds, and
* `usage.used` too when a capacity caps the store. Counting here, rather than
* at each op, means no change to the table can miss the count; the
* workspace's `max_memory` sums `held`. It refuses nothing: an op checks
* growth with `checkCapacity` before it stores, in the same synchronous step.
* Mirrors Python's `RAMFiles`.
*/
export declare class RAMFiles extends Map<string, Uint8Array> {
readonly usage: StorageUsage | null;
/** The bytes the table holds, which the workspace's `max_memory` sums. */
held: number;
constructor(usage?: StorageUsage | null);
private count;
set(key: string, value: Uint8Array): this;
delete(key: string): boolean;
clear(): void;
}
export declare class RAMStore {
readonly usage: StorageUsage | null;
readonly files: Map<string, Uint8Array>;
readonly dirs: Set<string>;
readonly modified: Map<string, string>;
readonly attrs: Map<string, RAMAttrs>;
/** `usage` is the store's capacity and counted bytes, null when uncapped. */
constructor(usage?: StorageUsage | null);
}
//# sourceMappingURL=store.d.ts.map