import type { Api, Model } from "@bastani/pi-ai/compat"; import type { ThinkingLevel } from "@earendil-works/pi-agent-core"; export interface ModelReferenceRequest { /** Bare model id or `provider/id`, optionally followed by `:`. */ text: string; /** Only consider models from this provider. */ provider?: string; /** * A trailing `:` is only considered when the full text matches no model, since ids such as * OpenRouter's `qwen/qwen3-coder:exacto` contain colons. * - `none`: the suffix stays part of the id * - `strict`: a valid thinking level is parsed; any other suffix stays part of the id * - `lenient`: like `strict`, but an invalid suffix is dropped with a warning */ thinkingSuffix: "none" | "strict" | "lenient"; /** Match id and name substrings when no exact match exists. */ fuzzy: boolean; } export type ModelReferenceResult = { status: "resolved"; model: Model; thinkingLevel?: ThinkingLevel; warning?: string; } | { status: "ambiguous"; candidates: Model[]; usableCount: number; thinkingLevel?: ThinkingLevel; warning?: string; } | { status: "not-found"; /** Set when a provider is explicit or named by a `provider/` prefix, for building a custom model id. */ target?: ModelReferenceTarget; }; export interface ModelReferenceTarget { provider: string; providerModels: [Model, ...Model[]]; /** Text after the provider prefix as typed, including any `:`. */ modelText: string; /** `modelText` without a valid thinking suffix (unless `thinkingSuffix` is `none`). */ modelId: string; thinkingLevel?: ThinkingLevel; } /** * `usable` only breaks ties between providers, so a unique match resolves even without credentials * (`--api-key` first-time setup). */ export declare function resolveModelReference(request: ModelReferenceRequest, models: readonly Model[], usable: (provider: string) => boolean): ModelReferenceResult; /** Exact `provider/id` or bare id lookup without thinking suffixes or fuzzy matching. */ export declare function findExactModelReferenceMatch(modelReference: string, models: readonly Model[]): Model | undefined; export declare function buildFallbackModel(provider: string, modelId: string, availableModels: readonly Model[]): Model | undefined; //# sourceMappingURL=model-resolver-patterns.d.ts.map