import type { InferenceProviderId } from "./types"; export class ProviderModelMismatchError extends Error { readonly code = "provider_model_mismatch" as const; constructor(message = "provider_model_mismatch") { super(message); this.name = "ProviderModelMismatchError"; } } export class MissingApiKeyError extends Error { readonly code = "missing_api_key" as const; readonly provider: InferenceProviderId; constructor(provider: InferenceProviderId) { super(`missing_api_key:${provider}`); this.name = "MissingApiKeyError"; this.provider = provider; } } export class VertexNotConfiguredError extends Error { readonly code = "vertex_not_configured" as const; readonly missingEnvVars: string[]; constructor(missingEnvVars: string[]) { super( `Vertex AI provider not configured. Missing: ${missingEnvVars.join(", ")}`, ); this.name = "VertexNotConfiguredError"; this.missingEnvVars = missingEnvVars; } } export class InferenceManifestValidationError extends Error { readonly issues: string[]; constructor(issues: string[]) { super(`Invalid inference manifest:\n- ${issues.join("\n- ")}`); this.name = "InferenceManifestValidationError"; this.issues = issues; } }