import { type AgentMessageSender, type AgentPrecedingMessage } from "@mono-agent/agent-contracts"; /** * Defuse the reserved tokens by swapping the leading `<` for the look-alike `‹`, * so nothing inside untrusted content can open or close a fence this module * owns. Applied to preceding bodies, rendered labels, and the PROMPT COPY of the * user's own text -- a group member must not be able to append a forged block * after their message. The persisted copy is deliberately left untouched. */ export declare function neutralizeSpeakerMarkup(value: string): string; /** * The single model-visible rendering of a sender, used for the prompt's speaker * line, the persisted `HistoryMessage.name`, and the memory capture label. * * Returns `undefined` -- NEVER an empty string -- when there is no usable * identity. An empty `name` would make `normalizeOptionalInlineString` throw * `invalid_history` on the NEXT turn's context build, long after this turn * succeeded. * * `sender.id` is deliberately absent: it is an actionable delivery target, and * the memory label in particular becomes durable model-visible content on every * future recall, so an id there would be a permanent leak rather than a * transient one. */ export declare function senderLabel(sender: AgentMessageSender | undefined): string | undefined; /** * Wraps the user's message with the current speaker and any messages that * arrived since the agent's last turn. * * Returns `userMessage` BY IDENTITY when there is neither -- that byte-identity * guarantee is the backwards-compatibility contract for DM, TUI, cron, and * webhook turns. */ export declare function composeUserMessageWithSpeakerContext(userMessage: string, sender: AgentMessageSender | undefined, preceding: readonly AgentPrecedingMessage[] | undefined): string; /** Counts and byte size for the `turn_context` event. Never the content itself. */ export declare function speakerTurnContextFields(sender: AgentMessageSender | undefined, preceding: readonly AgentPrecedingMessage[] | undefined): { readonly speaker?: string; readonly precedingCount?: number; readonly precedingRendered?: number; readonly precedingBytes?: number; }; /** * Collapses a user-controlled name to one safe inline token. Structural controls * become visible single-character glyphs rather than transcript lines, matching * how the interaction bridge renders untrusted answers. * * Exported because a surface name (a Slack channel name, a Telegram chat title) * is user-controlled in exactly the same way a display name is, and the Session * block must neutralize it identically rather than grow a second dialect. */ export declare function sanitizeLabelPart(value: string | undefined): string | undefined; //# sourceMappingURL=speaker-context.d.ts.map