{"version":3,"file":"orchestrator-cancelled-error.mjs","names":[],"sources":["../../../../../../../ai/src/errors/orchestrator-cancelled-error.ts"],"sourcesContent":["import type { AIErrorOptions } from \"./ai-error\";\nimport type { ErrorCategory } from \"./error-category.type\";\nimport { OrchestratorFailedError } from \"./orchestrator-failed-error\";\n\nexport type OrchestratorCancelledErrorOptions = AIErrorOptions & {\n  /** ISO-8601 timestamp at which the abort was observed by the orchestrator. */\n  cancelledAt: string;\n  /** The session whose turn was cancelled. */\n  sessionId: string;\n  /** `controller.abort(reason)` payload when the caller supplied one. */\n  reason?: string;\n};\n\n/**\n * A turn was cancelled via `AbortSignal` before it could settle\n * (orchestrator.md §17 — \"mid-turn cancel\"). The orchestrator returns\n * normally with `report.status: \"cancelled\"` and the error placed on\n * `result.error` rather than thrown; session state reverts to the\n * pre-turn checkpoint (the orchestrator does not persist a fresh row\n * for a cancelled turn — Q10).\n *\n * Mirrors `SupervisorCancelledError`, orchestrator scope. When an\n * `iterate: true` turn is cancelled mid-iteration, the underlying\n * `SupervisorCancelledError` rides on `cause`.\n */\nexport class OrchestratorCancelledError extends OrchestratorFailedError {\n  public static readonly defaultCategory: ErrorCategory = \"cancelled\";\n\n  public readonly cancelledAt: string;\n  public readonly sessionId: string;\n  public readonly reason?: string;\n\n  public constructor(\n    message: string,\n    options: OrchestratorCancelledErrorOptions,\n  ) {\n    super(message, options, \"ORCHESTRATOR_CANCELLED\");\n    this.name = \"OrchestratorCancelledError\";\n    this.cancelledAt = options.cancelledAt;\n    this.sessionId = options.sessionId;\n    this.reason = options.reason;\n  }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAyBA,IAAa,6BAAb,cAAgD,wBAAwB;;yBACd;;CAMxD,AAAO,YACL,SACA,SACA;EACA,MAAM,SAAS,SAAS,wBAAwB;EAChD,KAAK,OAAO;EACZ,KAAK,cAAc,QAAQ;EAC3B,KAAK,YAAY,QAAQ;EACzB,KAAK,SAAS,QAAQ;CACxB;AACF"}