@struktoai/mirage-core
Version:
A Unified Virtual Filesystem For AI Agents
32 lines • 1.48 kB
TypeScript
import { FileEvent, PathSpec } from '../types.ts';
import type { EventRegistry, EventRuntime } from './base.ts';
import type { QueueFactory } from './queue/base.ts';
export declare class EventHub implements EventRuntime {
private readonly registry;
private readonly queueFactory;
private readonly subscribers;
private closed;
constructor(registry: EventRegistry, queueFactory?: QueueFactory);
private frame;
private inScope;
private matches;
/**
* Invalidate a changed path before its event is delivered.
*
* An external change is often the only signal mirage gets, so its mount's
* cache takes it as a write is taken (`CacheManager.invalidate`): the kind
* decides how far down it reaches, UNKNOWN taking the subtree a push that
* names only a scope reports (IMAP IDLE says a mailbox changed, not which
* message), and every ancestor's entry goes too, since a nested create or
* delete implies levels appeared or vanished with it. The answers the
* mount's client keeps of its own go with them (`Accessor.forget`: a
* repository's tree, a site's ids, a database's names), since no path names
* them and nothing else tells the client its service changed.
*/
private evict;
private invalidate;
notify(change: FileEvent): Promise<void>;
events(path: PathSpec | readonly PathSpec[]): AsyncGenerator<FileEvent>;
close(): Promise<void>;
}
//# sourceMappingURL=hub.d.ts.map