/** * Assembles message-driven access contexts. The base context resolves requester, * world, and role together; the cross-world conversation variant additionally * intersects verified linked-identity rooms with the agent's memberships so * storage can authorize multi-platform recall before ranking or pagination. */ import type { AccessContext } from "./types/access-context.js"; import type { Memory } from "./types/memory.js"; import type { IAgentRuntime } from "./types/runtime.js"; /** * Build the {@link AccessContext} for a message-driven read: who is asking, in * which world, and with what role. * * `worldId`, `role`, and `isOwner` are resolved together from the SINGLE world * that {@link resolveWorldForMessage} picks for the message — the room's * `worldId`, else the connector-metadata fallback (e.g. a Discord server/channel * id). Deriving all three from one resolution is load-bearing: resolving the * role against one world while reading `worldId` off a different path can yield * `role: "OWNER"` with `worldId: undefined` — an elevated role with no tenant * scope. Outside a world (DMs, or a message with no resolvable world) all three * are left undefined, which callers must treat as "no elevated access" rather * than "unrestricted". */ export declare function buildAccessContext(runtime: IAgentRuntime, message: Memory): Promise; /** * Build the storage boundary for owner-private conversation continuity across * worlds. Authority still comes from the live delivery world, while the * readable room set is the intersection of the requester's verified identity * cluster and the agent's actual memberships. `worldId` is deliberately * omitted because that verified room set may span multiple platforms/worlds. */ export declare function buildCrossWorldConversationAccessContext(runtime: IAgentRuntime, message: Memory): Promise;