/** * Message sender identity (security model): a structured, server-stamped * record of who sent a message into a session. Attached to the durable * message queue payload and the `user.message` CMS event; surfaced to the * agent only in multi-writer sessions. * * Identity fields (`provider`, `subject`, `display`, `relation`) are stamped * at the API edge from the validated auth context — never trusted from the * client body. `origin` is client-declared display metadata only. * * This is attribution and prioritization metadata, NOT an authorization * mechanism — a message only reaches the queue because the dispatcher * already authorized it. */ export interface MessageSender { kind: "user" | "agent" | "system"; /** Identity key of a user sender ((provider, subject) from the users catalog). */ provider?: string; subject?: string; /** Human-readable name for rendering and prompt attribution. */ display?: string; /** Relation to the session's tree at send time. */ relation?: "owner" | "collaborator" | "admin"; /** kind=agent: the sending session id. */ sessionId?: string; /** Which surface sent it (display metadata, client-declared). */ origin?: "portal" | "tui" | "mcp" | "api"; } /** * Validate and normalize a sender record. Returns undefined for anything * that isn't a well-formed sender, so junk never rides the durable payload. */ export declare function normalizeMessageSender(sender: unknown): MessageSender | undefined; /** Stable identity key for distinct-writer tracking. */ export declare function messageSenderKey(sender: MessageSender | null | undefined): string | null; /** The `[FROM: …]` attribution line shown to the agent in multi-writer sessions. */ export declare function formatSenderAttribution(sender: MessageSender): string; //# sourceMappingURL=message-sender.d.ts.map