{"version":3,"file":"agent-drift-error.mjs","names":[],"sources":["../../../../../../../ai/src/errors/agent-drift-error.ts"],"sourcesContent":["import type { AIErrorOptions } from \"./ai-error\";\nimport { AgentExecutionError } from \"./agent-execution-error\";\nimport type { ErrorCategory } from \"./error-category.type\";\n\nexport type AgentDriftErrorOptions = AIErrorOptions & {\n  /** Signature recorded on the snapshot being resumed. */\n  savedSignature: string;\n  /** Signature computed from the current agent definition. */\n  currentSignature: string;\n  runId: string;\n};\n\n/**\n * `agent.resume(runId)` loaded a durable snapshot whose structural\n * fingerprint does not match the current agent definition (model +\n * provider + sorted tool names + maxTrips + output presence + version).\n * The resume is refused — no trip runs — and the user decides how to\n * recover: discard the snapshot, migrate manually, or call\n * `resume(runId, { force: true })` to bypass the check.\n *\n * Mirrors `SupervisorDriftError` / `WorkflowDriftError` — same rationale,\n * different primitive. Thrown (not returned on `result.error`) because a\n * drifted resume never produces a valid run.\n */\nexport class AgentDriftError extends AgentExecutionError {\n  public static readonly defaultCategory: ErrorCategory = \"drift\";\n\n  public readonly savedSignature: string;\n  public readonly currentSignature: string;\n  public readonly runId: string;\n\n  public constructor(message: string, options: AgentDriftErrorOptions) {\n    super(message, options, \"AGENT_DRIFT\");\n    this.name = \"AgentDriftError\";\n    this.savedSignature = options.savedSignature;\n    this.currentSignature = options.currentSignature;\n    this.runId = options.runId;\n  }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAwBA,IAAa,kBAAb,cAAqC,oBAAoB;;yBACC;;CAMxD,AAAO,YAAY,SAAiB,SAAiC;EACnE,MAAM,SAAS,SAAS,aAAa;EACrC,KAAK,OAAO;EACZ,KAAK,iBAAiB,QAAQ;EAC9B,KAAK,mBAAmB,QAAQ;EAChC,KAAK,QAAQ,QAAQ;CACvB;AACF"}