import type { CompletionRequest } from '../types/messages.js'; import type { CapabilityPolicy, CapabilityWarning } from '../types/capabilities.js'; import type { ModelCapabilities } from '../types/providers.js'; /** * Thrown under the `strict` capability policy when a request asks for something the target model * does not declare support for. */ export declare class NexusCapabilityError extends Error { /** The feature requested, such as `reasoning` or `promptCaching`. */ readonly feature: string; /** The model it was requested for. */ readonly model: string; /** The provider, when known. */ readonly provider?: string; /** The value requested. */ readonly requested?: unknown; constructor(options: { feature: string; model: string; provider?: string; requested?: unknown; reason: string; }); } /** A request after negotiation, with what was changed. */ export interface NegotiationResult { /** The request, adjusted to what the model supports. */ value: T; /** What was dropped or changed, and why. */ warnings: CapabilityWarning[]; } /** Options for capability negotiation. */ export interface NegotiateOptions { /** Defaults to `warn`. */ policy?: CapabilityPolicy; /** The provider, named in warnings and errors. */ provider?: string; } /** * Reconciles a completion request against the target model's declared capabilities. * * Nothing is checked unless the request actually sets the corresponding option, and the request * object is only copied when something has to change, so an ordinary call pays no allocation and * no traversal. An option the model does not mention is passed through untouched: absence of a * declaration means the registry does not know, not that the provider refuses. */ export declare function negotiateCompletionRequest(request: CompletionRequest, capabilities: ModelCapabilities | undefined, options?: NegotiateOptions): NegotiationResult;