{"version":3,"file":"planner-cancelled-error.mjs","names":[],"sources":["../../../../../../../ai/src/errors/planner-cancelled-error.ts"],"sourcesContent":["import type { AIErrorOptions } from \"./ai-error\";\nimport type { ErrorCategory } from \"./error-category.type\";\nimport { PlannerFailedError } from \"./planner-failed-error\";\n\n/**\n * Options for {@link PlannerCancelledError}. Carries the observation\n * timestamp and the optional `controller.abort(reason)` payload.\n */\nexport type PlannerCancelledErrorOptions = AIErrorOptions & {\n  /** ISO-8601 timestamp at which the abort was observed by the planner. */\n  cancelledAt: string;\n  /** `controller.abort(reason)` payload when the caller supplied one. */\n  reason?: string;\n};\n\n/**\n * Planner run was cancelled via `AbortSignal` before it could finish.\n * Between-step cancellation is guaranteed; mid-step cancellation is\n * best-effort (the signal is threaded into every in-flight capability\n * `execute()` call, but effectiveness depends on the child primitive\n * respecting it).\n *\n * On cancellation the planner returns normally with\n * `report.status === \"cancelled\"` and the partial step snapshots — the\n * error is placed on `result.error` rather than thrown.\n */\nexport class PlannerCancelledError extends PlannerFailedError {\n  public static readonly defaultCategory: ErrorCategory = \"cancelled\";\n\n  public readonly cancelledAt: string;\n  public readonly reason?: string;\n\n  public constructor(message: string, options: PlannerCancelledErrorOptions) {\n    super(message, options, \"PLANNER_CANCELLED\");\n    this.name = \"PlannerCancelledError\";\n    this.cancelledAt = options.cancelledAt;\n    this.reason = options.reason;\n  }\n}\n"],"mappings":";;;;;;;;;;;;;;AA0BA,IAAa,wBAAb,cAA2C,mBAAmB;;yBACJ;;CAKxD,AAAO,YAAY,SAAiB,SAAuC;EACzE,MAAM,SAAS,SAAS,mBAAmB;EAC3C,KAAK,OAAO;EACZ,KAAK,cAAc,QAAQ;EAC3B,KAAK,SAAS,QAAQ;CACxB;AACF"}