/**
 * Amazon Bedrock connector (`amazon-bedrock` dialect).
 *
 * Speaks the Bedrock Runtime **Converse** API. The streaming variant posts to
 *
 *   POST https://bedrock-runtime.{region}.amazonaws.com/model/{modelId}/converse-stream
 *
 * and receives an AWS binary `application/vnd.amazon.eventstream` body whose
 * frames carry JSON payloads such as `contentBlockDelta`, `messageStop`, and
 * `metadata`. This module owns the *neutral* half of that bridge: it builds the
 * Converse request body from a {@link Conversation}, maps each decoded
 * converse-stream event into a gateway {@link Emission}, and translates Bedrock
 * stop reasons into the {@link StopReason} union.
 *
 * Out of scope for this phase (and deliberately so): AWS SigV4 request signing
 * and the binary event-stream *framing* codec. Bedrock will reject any
 * unsigned request, so rather than ship a broken transport we fail fast — when
 * the AWS credential/region cannot be resolved, or signing is not yet wired up,
 * the call raises `gatewayError("unsupported", ...)`. Everything around that
 * gap (body shaping, model addressing, event mapping, types) is complete and
 * type-checked, so dropping in a SigV4 signer later is a localized change.
 *
 * No `aws-sdk` and no provider SDKs: only the request shape and the
 * converse-stream event shape, re-derived from the public Bedrock Runtime docs.
 */
import type { Connector, Conversation, CredentialResolver, Emission, ModelCard, StopReason, StreamOptions } from "../contract";
/** Dependencies injected into the connector factory. */
export interface BedrockConnectorDeps {
    /** Resolves the AWS credential signal for `provider` (bearer token / chain). */
    readonly resolveSecret: CredentialResolver["resolve"];
}
/** A single JSON-able wire object in the Converse schema. */
type WireObject = Record<string, unknown>;
/**
 * Build the full Converse request body for `conversation`. The `modelId` lives
 * in the URL path, so it is intentionally absent from the body. This is pure,
 * JSON-able data ready to hand to a signer + `JSON.stringify`.
 */
export declare function buildConverseBody(model: ModelCard, conversation: Conversation, options: StreamOptions): WireObject;
/**
 * One decoded converse-stream event. After the binary event-stream framing is
 * peeled away, each frame's payload is a JSON object discriminated by which key
 * is present. We model the union loosely (open records) because the framing
 * codec, not this mapper, owns precise typing of the byte layer.
 */
export interface ConverseStreamEvent {
    readonly messageStart?: {
        readonly role?: string;
    };
    readonly contentBlockStart?: {
        readonly contentBlockIndex?: number;
        readonly start?: {
            readonly toolUse?: {
                readonly toolUseId?: string;
                readonly name?: string;
            };
        };
    };
    readonly contentBlockDelta?: {
        readonly contentBlockIndex?: number;
        readonly delta?: {
            readonly text?: string;
            readonly reasoningContent?: {
                readonly text?: string;
            };
            readonly toolUse?: {
                readonly input?: string;
            };
        };
    };
    readonly contentBlockStop?: {
        readonly contentBlockIndex?: number;
    };
    readonly messageStop?: {
        readonly stopReason?: string;
    };
    readonly metadata?: {
        readonly usage?: {
            readonly inputTokens?: number;
            readonly outputTokens?: number;
            readonly cacheReadInputTokens?: number;
            readonly cacheWriteInputTokens?: number;
        };
    };
}
/**
 * Map a Bedrock Converse `stopReason` onto the neutral {@link StopReason}.
 * Unknown reasons collapse to `complete` — a benign default for an end-of-turn
 * signal we do not specifically recognize.
 */
export declare function mapBedrockStopReason(reason: string | undefined): StopReason;
/**
 * Translate one decoded converse-stream event into zero or more neutral
 * {@link Emission}s. Tool-call identity flows through `contentBlockIndex`: the
 * `start` frame carries the id + name, later `delta` frames carry only the JSON
 * argument fragment for that same index, so we key a synthetic call id off the
 * index when the event omits one.
 *
 * `done`/`error` are *not* produced here — those terminal envelopes are the
 * streamer's responsibility once the byte stream closes.
 */
export declare function mapConverseStreamEvent(event: ConverseStreamEvent, indexToCallId: Map<number, string>): Emission[];
/**
 * Build the Amazon Bedrock connector.
 *
 * The connector is fully assembled — request body, model addressing, and the
 * converse-stream event mapper are production-ready and exercised by the type
 * checker. The *transport* (SigV4 signing + binary framing) is the one piece
 * left for a follow-up, so every invocation currently terminates in an
 * `unsupported` gateway error at call time.
 */
export declare function createbedrockConnector(deps: BedrockConnectorDeps): Connector;
export {};
