{"version":3,"file":"errors.mjs","names":[],"sources":["../../../../../../../ai/src/vcr/errors.ts"],"sourcesContent":["import { AIError } from \"../errors/ai-error\";\nimport type { AIErrorOptions } from \"../errors/ai-error\";\n\n/**\n * Payload for {@link VcrCassetteMissError}. Carries the looked-up request\n * hash and the cassette path so a failing CI run names exactly which call\n * was not recorded.\n */\nexport type VcrCassetteMissErrorOptions = AIErrorOptions & {\n  /** The normalized request hash that found no matching cassette entry. */\n  requestHash?: string;\n  /** Cassette file path the lookup ran against. */\n  path?: string;\n};\n\n/**\n * Thrown when a `vcr(model, { mode: \"replay\" })` call finds no cassette\n * entry matching the request hash.\n *\n * **The whole point of deterministic tests.** VCR in `replay` mode never\n * falls back to a live provider call on a miss — that would silently\n * re-introduce network/non-determinism into a test that asked for the\n * opposite. Instead it throws this error so the run fails loud, telling\n * the developer to re-record the cassette (run once in `record`/`auto`).\n *\n * Extends {@link AIError} directly (not `ProviderError`) — a cassette miss\n * is a harness/config failure, not a provider failure.\n *\n * @example\n * try {\n *   await vcrModel.complete(messages);\n * } catch (error) {\n *   if (error instanceof VcrCassetteMissError) {\n *     console.error(\"Re-record the cassette:\", error.path);\n *   }\n * }\n */\nexport class VcrCassetteMissError extends AIError {\n  public readonly requestHash?: string;\n  public readonly path?: string;\n\n  public constructor(message: string, options?: VcrCassetteMissErrorOptions) {\n    super(\"VCR_CASSETTE_MISS\", message, options);\n    this.name = \"VcrCassetteMissError\";\n    this.requestHash = options?.requestHash;\n    this.path = options?.path;\n  }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAqCA,IAAa,uBAAb,cAA0C,QAAQ;CAIhD,AAAO,YAAY,SAAiB,SAAuC;EACzE,MAAM,qBAAqB,SAAS,OAAO;EAC3C,KAAK,OAAO;EACZ,KAAK,cAAc,SAAS;EAC5B,KAAK,OAAO,SAAS;CACvB;AACF"}