@struktoai/mirage-core
Version:
A Unified Virtual Filesystem For AI Agents
24 lines • 1.67 kB
TypeScript
import type { OwnedScope } from './types.ts';
import type { DispatchFn } from '../../../../runtime/types.ts';
import { PathSpec, type FileStat } from '../../../../types.ts';
import type { Files } from '../../../../workspace/files.ts';
/** Lazily partition an operand into maximal scopes with one owner.
* Only directories containing mount boundaries are expanded. Listings
* come through the dispatcher so hidden and shadowed entries stay hidden. */
export declare function ownedScopes(path: PathSpec, dispatch: DispatchFn, vfs: Files | undefined, admit: (path: PathSpec, stat: FileStat) => boolean, walked?: boolean): AsyncIterable<OwnedScope>;
/**
* The operand, then each visible mount root below it, as start points.
*
* Each start is one mount's own part of the operand's tree: the operand's
* mount answers for everything but the mounts inside it, and every mount
* below answers from its root, spelled as the operand was typed. A hidden
* mount is never a start, though it still shadows the parent backend's keys.
*/
export declare function mountStarts(path: PathSpec, vfs: Files | undefined): PathSpec[];
/** Which start points a walk from their operand reaches.
* A walk that cannot read a directory never sees what lies inside it,
* mounts included. A start below a part whose run failed therefore counts
* only when every directory from that part down to it lists through the
* dispatcher; every other start counts as it is. */
export declare function reached(paths: readonly PathSpec[], starts: readonly (readonly [number, PathSpec])[], failed: readonly boolean[], dispatch: DispatchFn): Promise<boolean[]>;
//# sourceMappingURL=scopes.d.ts.map