import type { AgentInfo, HelloFields, MeshMessage, MessageKind, WhoFilter } from './protocol.js'; /** Rows `list` returns when the caller gives no limit. */ export declare const DEFAULT_LIST_LIMIT = 200; export declare class StoreError extends Error { readonly code: 'ALIAS_TAKEN' | 'LIMIT' | 'INBOX_FULL'; constructor(code: 'ALIAS_TAKEN' | 'LIMIT' | 'INBOX_FULL', message: string); } /** Sole-writer presence store. Only the hub opens it. */ export declare class MeshStore { private readonly db; private constructor(); static open(file: string): Promise; upsertAgent(addr: string, h: HelloFields, now: number): void; /** Remembers who owns a live address. Only a hash is stored, never the key itself. */ setKeyHash(addr: string, hash: string, nonceHash?: string): void; /** Hash of the nonce the current owner registered with, if it sent one. */ nonceHashOf(addr: string): string | undefined; /** The owner's key hash, or undefined when the address is free (unknown, gone, or never keyed). */ keyHashOf(addr: string): string | undefined; /** False when the agent is unknown or already gone (the caller must re-register). */ heartbeat(addr: string, now: number, task?: string): boolean; bye(addr: string): void; sweep(now: number, staleMs: number, goneMs: number, isAlive: (pid: number) => boolean, pruneGoneMs?: number): { stale: string[]; gone: string[]; }; list(filter?: Partial, limit?: number): AgentInfo[]; /** The live address `to` names: a full address, or an alias in `project`. */ resolve(project: string, to: string): string | undefined; /** The project an address belongs to, or undefined when it is not registered. */ projectOf(addr: string): string | undefined; addMessage(from: string, to: string, kind: MessageKind, body: string, now: number, replyTo?: number): number; /** Oldest unread first; marks them read unless `peek`. */ takeInbox(addr: string, limit: number, peek: boolean): { messages: MeshMessage[]; more: number; }; liveCount(): number; close(): void; } //# sourceMappingURL=store.d.ts.map