import type { AgenticHub, HubConnection } from "../channel/index.ts"; import type { BlackboardStore } from "./store.ts"; export interface BlackboardFamilyOptions { /** * Resolve the board `scope` for a connection. Default: the capability * credential presented at the handshake (`handshake.credential` or the * `?capability=` query param) — so each distinct capability is its own board, * exactly as nano-workforce's per-plan token is. Return `undefined` to reject * the frame (the connection is not scoped to any board). */ scopeOf?: (ctx: HubConnection) => string | undefined; /** * Notified of a fault this module handles while keeping the connection: a * malformed blackboard payload ({@link BlackboardPayloadError}), a missing * board scope, or a store error. Other exceptions propagate to {@link AgenticHub}. */ onError?: (err: unknown, connectionId?: string) => void; } /** Handle to the attached blackboard family. */ export interface BlackboardFamilyHandle { /** Detach is a no-op today; present for symmetry with the other family modules. */ stop(): void; } /** A malformed blackboard payload rejected before it touches the store. */ export declare class BlackboardPayloadError extends Error { constructor(detail: string); } /** Raised when a connection is not scoped to any board (no capability scope). */ export declare class BlackboardScopeError extends Error { constructor(); } /** * Attach the blackboard family (`blackboard`) to `hub`, backed by `store`. * Registers one handler via the S1 seam. Returns a handle for symmetry with the * other family modules. * * @throws DuplicateFamilyHandlerError if the `blackboard` family already has a * handler on this hub (one family, one owning module). */ export declare function attachBlackboardFamily(hub: AgenticHub, store: BlackboardStore, options?: BlackboardFamilyOptions): BlackboardFamilyHandle;