export interface BrokerEntry { url: string; pid: number; updatedAt: number; credential?: string; } /** Normalize credential: trim whitespace, reject empty/oversized values. */ export declare function normalizeCredential(cred: string | undefined): string | undefined; export declare function defaultRegistryDir(): string; /** Publish that this process hosts org `name`, reachable via `url`. Call again periodically (heartbeat) — see BrokerLease. * Writes via tmp+rename (same-directory rename is atomic on POSIX/NTFS) so a concurrent lookupOrg() never observes a * partially-written entry — this file is rewritten every heartbeat (default 20s) while other processes may read it. */ export declare function registerOrg(name: string, url: string, dir?: string, credential?: string): void; /** Remove this process's registration for `name` (best effort). */ export declare function unregisterOrg(name: string, dir?: string): void; /** Find which process (if any) currently hosts org `name`. Null if never registered or the registration is stale (owner crashed without cleanup). */ export declare function lookupOrg(name: string, dir?: string, staleMs?: number): BrokerEntry | null; /** Keeps a broker registration alive with periodic heartbeats until stop() is called. */ export declare class BrokerLease { private name; private url; private dir; private intervalMs; private credential?; private timer; constructor(name: string, url: string, dir?: string, intervalMs?: number, credential?: string | undefined); start(): void; stop(): void; } //# sourceMappingURL=broker.d.ts.map