{"version":3,"file":"supervisor-cancelled-error.mjs","names":[],"sources":["../../../../../../../ai/src/errors/supervisor-cancelled-error.ts"],"sourcesContent":["import type { AIErrorOptions } from \"./ai-error\";\nimport type { ErrorCategory } from \"./error-category.type\";\nimport { SupervisorFailedError } from \"./supervisor-failed-error\";\n\nexport type SupervisorCancelledErrorOptions = AIErrorOptions & {\n  /** ISO-8601 timestamp at which the abort was observed by the supervisor. */\n  cancelledAt: string;\n  /** `controller.abort(reason)` payload when the caller supplied one. */\n  reason?: string;\n};\n\n/**\n * Supervisor run was cancelled via `AbortSignal` before it could\n * finish. Between-iteration cancellation is guaranteed; mid-iteration\n * cancellation is best-effort (the signal is also threaded into every\n * in-flight child `execute()` call, but effectiveness depends on the\n * child primitive respecting it).\n *\n * On cancellation the supervisor returns normally with `status:\n * \"cancelled\"` and partial `report.snapshots` — the error is placed\n * on `result.error` rather than thrown.\n */\nexport class SupervisorCancelledError extends SupervisorFailedError {\n  public static readonly defaultCategory: ErrorCategory = \"cancelled\";\n\n  public readonly cancelledAt: string;\n  public readonly reason?: string;\n\n  public constructor(\n    message: string,\n    options: SupervisorCancelledErrorOptions,\n  ) {\n    super(message, options, \"SUPERVISOR_CANCELLED\");\n    this.name = \"SupervisorCancelledError\";\n    this.cancelledAt = options.cancelledAt;\n    this.reason = options.reason;\n  }\n}\n"],"mappings":";;;;;;;;;;;;;;AAsBA,IAAa,2BAAb,cAA8C,sBAAsB;;yBACV;;CAKxD,AAAO,YACL,SACA,SACA;EACA,MAAM,SAAS,SAAS,sBAAsB;EAC9C,KAAK,OAAO;EACZ,KAAK,cAAc,QAAQ;EAC3B,KAAK,SAAS,QAAQ;CACxB;AACF"}