{"version":3,"file":"invalid-request-error.mjs","names":[],"sources":["../../../../../../../ai/src/errors/invalid-request-error.ts"],"sourcesContent":["import type { AIErrorOptions } from \"./ai-error\";\nimport type { ErrorCategory } from \"./error-category.type\";\nimport { ProviderError } from \"./provider-error\";\n\n/**\n * Provider rejected the request as malformed — bad model name,\n * unsupported feature, missing required field, image attached to a\n * non-vision model, etc. The catch-all for 4xx responses that aren't\n * auth, rate-limit, context-length, or content-filter.\n *\n * Also thrown from the agent when user-side validation fails at the\n * boundary (e.g. vision gate, malformed attachment shape) — the\n * category is \"you sent something the provider / agent cannot use\".\n *\n * @example\n * if (result.error instanceof InvalidRequestError) {\n *   logger.error(\"bad agent input\", { context: result.error.context });\n * }\n */\nexport class InvalidRequestError extends ProviderError {\n  public static readonly defaultCategory: ErrorCategory = \"validation\";\n\n  public constructor(message: string, options?: AIErrorOptions) {\n    super(message, options, \"PROVIDER_INVALID_REQUEST\");\n    this.name = \"InvalidRequestError\";\n  }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAmBA,IAAa,sBAAb,cAAyC,cAAc;;yBACG;;CAExD,AAAO,YAAY,SAAiB,SAA0B;EAC5D,MAAM,SAAS,SAAS,0BAA0B;EAClD,KAAK,OAAO;CACd;AACF"}