@struktoai/mirage-core
Version:
A Unified Virtual Filesystem For AI Agents
47 lines • 2.12 kB
TypeScript
import { type ByteSource } from '../../io/types.ts';
import type { Evicted } from '../../cache/index/config.ts';
import { RAMIndexCacheStore } from '../../cache/index/ram.ts';
import { RAMAccessor } from '../../accessor/ram.ts';
import type { Handed } from '../types.ts';
import { FileStat, type PathSpec } from '../../types.ts';
import { RAMVFS } from '../ram/ram.ts';
import type { RAMStore } from '../ram/store.ts';
import type { DevicePipe } from '../../core/dev/pipe.ts';
import { DevStore } from './store.ts';
/**
* The index every DevVFS runs under: it never keeps an entry,
* because a path-only index would publish one session's descriptors to
* another. Mirrors the `NULL_INDEX` Python's registry uses for DevVFS.
*/
export declare class DevIndex extends RAMIndexCacheStore {
seed(): void;
put(): Promise<void>;
setDir(): Promise<Evicted[]>;
refillDir(): Promise<Evicted[]>;
setPartialDir(): Promise<void>;
addEntry(): Promise<void>;
}
export declare class DevVFS extends RAMVFS {
private readonly devices;
readonly store: RAMStore;
readonly accessor: RAMAccessor;
constructor(devices?: DevStore);
forSession(owner: string): DevVFS;
allocateInput(pipe: DevicePipe): readonly [string, number];
releaseInput(path: string, allocation: number): void;
/**
* The RAM listing, each child as `stat` answers it, so a device or a live
* descriptor lists as one. Mirrors Python's `readdir`.
*/
readdir(path: PathSpec): Promise<FileStat[]>;
/** Null: a walk of /dev is one readdir. Mirrors Python's `read_tree`. */
readTree(_path: PathSpec): Promise<Map<string, FileStat> | null>;
/**
* A whole read of a pipe answers its stream. The stream is finite: a
* command that consumes a whole input reads the refusing read, and only
* the two bounded streaming commands opt into the endless source
* (`commands/builtin/dev`).
*/
read(path: PathSpec, handed?: Handed, offset?: number, size?: number | null, signal?: AbortSignal): Promise<ByteSource> | AsyncIterable<Uint8Array>;
}
//# sourceMappingURL=dev.d.ts.map