import type { ChatAclCheck } from '@origintrail-official/dkg-agent'; import type { DashboardDB } from '@origintrail-official/dkg-node-ui'; import type { ChatAclConfig } from '../config.js'; export interface BuildChatAclOpts { /** From `DkgConfig.chat.acl`. Missing means "no policy" => null callback. */ config?: ChatAclConfig; /** Node UI / dashboard DB the daemon owns. Membership rows live here. */ dashDb: DashboardDB; /** * Resolved at call-time so the closure is happy to be installed * before `agent.start()` (when `agent.peerId` is not yet available). * Throws if called before the agent has its peer id. */ getLocalPeerId: () => string; /** Optional logger for ACL transitions and rejected messages. */ log?: (msg: string) => void; } /** * Build the authorisation callback for inbound chats. Returns `null` * when no policy is configured (legacy "accept all authenticated peers" * behaviour). * * Failure modes are surfaced via the returned `reason` string and end * up as `{ delivered: false, error: }` on the sender, so the * operator on the other side sees a useful explanation rather than a * silent drop. */ export declare function buildChatAcl(opts: BuildChatAclOpts): ChatAclCheck | null; //# sourceMappingURL=chat-acl.d.ts.map