import type { BusEvent } from './types.js'; type Listener = (e: BusEvent) => void; /** * Ground-truth event log for one org run. Append-only JSONL + in-process fanout. * Every message, tool decision, asset, and usage record flows through here. */ export declare class OrgBus { readonly org: string; readonly run: string; readonly dir: string; private listeners; private seq; private pending; private dirReady; private sealed; readonly file: string; constructor(org: string, run: string, dir: string); subscribe(fn: Listener): () => void; emit(partial: Omit): BusEvent; /** Await all queued disk writes (tests, shutdown). Listeners registered via subscribe() run * synchronously inside emit() — flush() has no visibility into any async work they schedule * off of that (e.g. the forwarder's HTTP POSTs). A caller that needs an async subscriber's * work to have settled too must await that subscriber's own completion signal separately * (see daemon.ts stopOrg(), which awaits forwarder.settle() alongside bus.flush()). */ flush(): Promise; /** Await the final queued disk write, then permanently stop scheduling new * ones — emit() keeps fanning out to in-memory listeners after this, it * just never touches disk again. For a caller that's about to delete the * run directory (a test's afterEach, or a real stop/cleanup path): a late * emit() from work that outlived flush()'s snapshot (per flush()'s own * doc comment) would otherwise recreate bus.jsonl mid-delete. Idempotent. */ seal(): Promise; static readHistory(dir: string): BusEvent[]; } export {}; //# sourceMappingURL=bus.d.ts.map