/** * kosha-discovery — AWS Bedrock model discoverer. * * Resolution strategy (in order): * 1. AWS SDK (`@aws-sdk/client-bedrock`) — if installed in the host project. * 2. AWS CLI fallback (`aws bedrock list-foundation-models --output json`). * 3. Static fallback list of well-known Bedrock foundation models (Feb 2026). * * Credentials use the standard AWS credential chain: * environment variables (`AWS_ACCESS_KEY_ID` / `AWS_SECRET_ACCESS_KEY`), * `~/.aws/credentials`, EC2 / ECS instance-metadata IAM roles, etc. * No explicit credential is required by this discoverer — the SDK and CLI * both pick up the ambient credential automatically. * * @module */ import type { CredentialResult, ModelCard } from "../types.js"; import { BaseDiscoverer } from "./base.js"; /** * Discovers models available through AWS Bedrock. * * Tries three resolution strategies in order: * 1. `@aws-sdk/client-bedrock` (if installed in the host project). * 2. AWS CLI (`aws bedrock list-foundation-models`). * 3. Static fallback catalogue. * * The `credential` argument is optional in the sense that the AWS SDK and CLI * both rely on the ambient credential chain. However, the `credential.metadata` * bag may carry an explicit `{ region }` override. */ export declare class BedrockDiscoverer extends BaseDiscoverer { readonly providerId = "bedrock"; readonly providerName = "AWS Bedrock"; readonly baseUrl = "https://bedrock.us-east-1.amazonaws.com"; /** * Discover all foundation models available on AWS Bedrock. * * Resolution order: SDK → CLI → static fallback. * * @param credential - Optional credential; `metadata.region` overrides the * `AWS_DEFAULT_REGION` environment variable. * @param options - Optional timeout in milliseconds (used for CLI exec). */ discover(credential: CredentialResult, options?: { timeout?: number; }): Promise; /** * Use `@aws-sdk/client-bedrock` to list foundation models. * * Dynamic import prevents a hard dependency: the SDK is optional and must * be installed separately by the host project. If the import fails we * throw so the caller can fall through to the next strategy. * * @throws When `@aws-sdk/client-bedrock` is not installed, or the API call fails. */ private discoverViaSdk; /** * Use the `aws` CLI to list foundation models. * * Runs `aws bedrock list-foundation-models --region {region} --output json` * synchronously. Wrapped in try/catch so failures are surfaced to the caller * as thrown errors, letting `discover()` fall through gracefully. * * @throws When the `aws` CLI is not installed or returns a non-zero exit code. */ private discoverViaCli; /** * Return a hardcoded catalogue of well-known Bedrock foundation models. * * Used when neither the SDK nor the CLI is available. All entries have * `source: "manual"` and zero context/output token limits — the litellm * enrichment pass is expected to populate those fields later. */ private staticFallback; /** * Convert a raw Bedrock foundation model summary into a {@link ModelCard}. * * @param model - Raw model summary from SDK or CLI. * @param source - Whether the data came from a live API call or static data. * @param credential - Used to attach the resolved AWS region. */ private toModelCard; /** * Infer the primary {@link ModelMode} from Bedrock output modalities. * * Bedrock reports modalities as uppercase strings: "TEXT", "IMAGE", "EMBEDDING". * We pick the most specific non-TEXT modality first; TEXT-only → "chat". */ private inferMode; /** * Infer capability flags from Bedrock input/output modalities and inference types. * * - "embedding" models → ["embedding"] * - "image" output-only models → ["image"] * - All chat models get ["chat"] plus optional vision/code/function_calling */ private inferCapabilities; /** * Resolve the AWS region to use for API calls. * * Priority: `credential.metadata.region` > `AWS_DEFAULT_REGION` env var > `"us-east-1"`. */ private resolveRegion; } /** * Extract the origin provider from a Bedrock model ID. * * Bedrock model IDs follow the pattern `{vendor}.{model-name}-v{n}:{variant}`, * e.g. `anthropic.claude-opus-4-6-v1:0` → `"anthropic"`. * * Falls back to `"unknown"` for unrecognised vendor prefixes. * * @param modelId - A Bedrock foundation model ID. * @returns The canonical origin provider string. * * @example * inferOriginFromBedrockId("anthropic.claude-sonnet-4-6-v1:0") // "anthropic" * inferOriginFromBedrockId("meta.llama3-3-70b-instruct-v1:0") // "meta" * inferOriginFromBedrockId("amazon.titan-text-premier-v2:0") // "amazon" */ export declare function inferOriginFromBedrockId(modelId: string): string; //# sourceMappingURL=bedrock.d.ts.map