UNPKG

@mastra/core

Version:

Mastra is a framework for building AI-powered applications and agents with a modern TypeScript stack.

26 lines 1.13 kB
import type { ModelCandidate } from './normalize-candidate.js'; import type { ProviderModelEntry } from './types.js'; export declare const MODEL_NOT_ALLOWED_CODE: "MODEL_NOT_ALLOWED"; /** * Thrown by `enforceModelAllowlist` call sites when a write attempts to persist * a model that the active builder allowlist does not permit. * * Lives in `@mastra/core` so editor and server layers can both throw it * without crossing package boundaries. The server adapter * (`packages/server/src/server/handlers/error.ts`) maps this to HTTP 422 with * a structured JSON body of the same shape. */ export declare class ModelNotAllowedError extends Error { readonly code: "MODEL_NOT_ALLOWED"; readonly allowed: ProviderModelEntry[] | undefined; readonly attempted: ModelCandidate; readonly offendingLabel: string; constructor(args: { allowed: ProviderModelEntry[] | undefined; attempted: ModelCandidate; offendingLabel: string; message?: string; }); } export declare function isModelNotAllowedError(error: unknown): error is ModelNotAllowedError; //# sourceMappingURL=errors.d.ts.map