@struktoai/mirage-core
Version:
A Unified Virtual Filesystem For AI Agents
16 lines • 895 B
TypeScript
import type { Accessor } from '../../accessor/base.ts';
/**
* Cache one built value per accessor, for config-shaped route tables.
*
* Most backends have one tree shape, so their scope table and factories bind
* at module import. A backend whose tree is a function of mount config
* (lancedb's `groupBy` depth and leaf set, qdrant's likewise) builds them per
* mount instead: the accessor carries the config, so the accessor is the
* cache key, and the cache is weak so a dropped mount takes its routes with
* it. The build runs once per accessor; listers, guards and readers stay
* module-level functions that read `accessor.config` at call time, so tests
* keep patching client functions the same way they do for import-bound
* backends.
*/
export declare function perAccessor<A extends Accessor, T>(build: (accessor: A) => T): (accessor: A) => T;
//# sourceMappingURL=bind.d.ts.map