import { ServerError } from '../../utility/errors/hdbError.ts';
import type { BackendOpts, EmbedOpts, GenerateChunk, GenerateInput, GenerateOpts, GenerateResult, ModelBackend, ModelCallResult, ModelCapabilities } from '../../resources/models/types.ts';
export type BedrockBackendKind = 'embedding' | 'generative';
export interface BedrockBackendConfig {
    /** AWS region (e.g. `us-east-1`). Required — Bedrock is regional. */
    region?: string;
    /**
     * Model ID per Bedrock conventions, e.g. `anthropic.claude-opus-4-v1:0`
     * for Claude, `meta.llama3-70b-instruct-v1:0` for Llama,
     * `amazon.titan-embed-text-v2:0` for Titan embed. The leading vendor
     * prefix is how the backend dispatches to the right per-family shape.
     */
    model?: string;
    requestTimeoutMs?: number;
}
/**
 * SDK type-erased shape we use. We don't import `@aws-sdk/client-bedrock-runtime`
 * at module init (it's an optional peerDep); types are kept loose so the
 * compile doesn't depend on the SDK either.
 */
type SdkLike = {
    BedrockRuntimeClient: new (config: {
        region?: string;
    }) => {
        send: (cmd: object) => Promise<unknown>;
    };
    InvokeModelCommand: new (input: {
        modelId: string;
        body: string;
        contentType?: string;
        accept?: string;
    }) => object;
    InvokeModelWithResponseStreamCommand: new (input: {
        modelId: string;
        body: string;
        contentType?: string;
        accept?: string;
    }) => object;
};
/** Test-only hook to reset the memoized SDK promise between cases. */
export declare function _resetSdkCacheForTests(): void;
/** Test-only hook to inject a fake SDK. */
export declare function _injectSdkForTests(sdk: SdkLike): void;
/**
 * `ModelBackend` for AWS Bedrock.
 *
 * - `embed` → `InvokeModel` against an embedding model (Titan, Cohere, etc.)
 * - `generate` → `InvokeModel` against a generative model, per-family body shape
 * - `generateStream` → `InvokeModelWithResponseStream`, per-family event parsing
 *
 * Tool support varies per model family — `capabilities()` advertises
 * `tools: true` at the capability level; calls against models that don't
 * support tools (or that haven't been wired into the per-family dispatcher
 * yet) raise structured errors.
 */
export declare class BedrockBackend implements ModelBackend {
    #private;
    readonly name = "bedrock";
    constructor(config?: BedrockBackendConfig);
    capabilities(): ModelCapabilities;
    embed(input: string | string[], opts: BackendOpts<EmbedOpts>): Promise<ModelCallResult<Float32Array[]>>;
    generate(input: GenerateInput, opts: BackendOpts<GenerateOpts>): Promise<ModelCallResult<GenerateResult>>;
    generateStream(input: GenerateInput, opts: BackendOpts<GenerateOpts>): AsyncIterable<GenerateChunk>;
}
/**
 * Boot-bridge helper. Called from `resources/models/bootstrap.ts` for each
 * `models.embedding.<name>` / `models.generative.<name>` entry whose
 * `backend: bedrock`. Construction is cheap (no SDK load) — the SDK loads
 * lazily on first call.
 */
export declare function registerBedrockBackend(args: {
    logicalName: string;
    kind: BedrockBackendKind;
    config: BedrockBackendConfig;
}): void;
export declare class BedrockBackendError extends ServerError {
    constructor(message: string);
}
export {};
