/**
 * Wire projection — runtime session messages → a gateway {@link Conversation}.
 *
 * The runtime keeps history as a flat list of {@link Turn}s. Before a model is
 * invoked, that list plus the static {@link AgentConfig} must be assembled into
 * the provider-neutral request payload the gateway accepts: a `system`
 * preamble, the ordered turns, and the tool catalog.
 *
 * The assembly is table-driven. Each {@link Projector} owns exactly one turn
 * role and decides how that role's turns appear on the wire. A registry — a
 * `Map` keyed by role — dispatches each message to its projector. New roles are
 * added by registering a projector, never by extending a branch ladder.
 */
import type { Conversation, Turn } from "../../llmgateway/contract";
import type { AgentConfig } from "../contract";
/**
 * The ambient inputs a projector may consult beyond the turn itself.
 *
 * Projectors stay pure: they read from this context but never mutate it and
 * never perform I/O. The context is built once per assembly and shared across
 * every projector invocation.
 */
export interface ProjectionContext {
    /** The static run setup driving this assembly. */
    readonly config: AgentConfig;
}
/**
 * Projects a single source turn of one role into the turns it contributes to
 * the outgoing conversation.
 *
 * Returning a list (rather than a single turn) keeps the contract flexible: a
 * role may expand into several wire turns or collapse to none, without changing
 * the registry shape.
 */
export type Projector = (turn: Turn, ctx: ProjectionContext) => readonly Turn[];
/**
 * The projector registry: a role → projector table. This is the single
 * extension point for wire shaping. Lookup is total over the {@link Turn} union
 * because every role variant has an entry.
 */
export declare const PROJECTORS: ReadonlyMap<Turn["role"], Projector>;
/**
 * Assembles a provider-neutral {@link Conversation} from a runtime message list
 * and its {@link AgentConfig}.
 *
 * The function is pure: it allocates a fresh conversation and never touches its
 * inputs. Each message is dispatched through {@link PROJECTORS} by role and the
 * contributed turns are concatenated in order. The `system` preamble and tool
 * catalog are sourced from `cfg`. Optional fields are omitted entirely when
 * empty so the emitted payload matches the gateway's `exactOptionalProperty`
 * expectations.
 */
export declare function buildConversation(messages: readonly Turn[], cfg: AgentConfig): Conversation;
