{"version":3,"file":"planner-failed-error.mjs","names":[],"sources":["../../../../../../../ai/src/errors/planner-failed-error.ts"],"sourcesContent":["import { AIError, type AIErrorOptions } from \"./ai-error\";\nimport type { AIErrorCode } from \"./error-code.type\";\nimport type { ErrorCategory } from \"./error-category.type\";\n\n/**\n * Base class for every planner-specific failure surfaced from\n * `planner.execute()` or thrown at authoring-time by `ai.planner()`\n * validation.\n *\n * **Role.** Anchor for the `PLANNER_*` code family. Subclasses carry\n * precise codes (`PLANNER_PLAN_INVALID`, `PLANNER_CANCELLED`); this base\n * catches everything a planning run can produce that isn't already an\n * agent / tool / workflow / supervisor error bubbling up from a\n * dispatched capability.\n *\n * Child-execution errors (agent, tool, provider, workflow) flow through\n * the planner unchanged — they are captured on the relevant step\n * snapshot and surfaced on `result.error` directly, never re-wrapped.\n *\n * @example\n * const result = await planner.execute(\"Research and summarize X\");\n * if (result.error instanceof PlannerFailedError) {\n *   console.error(result.error.code, result.error.message);\n * }\n */\nexport class PlannerFailedError extends AIError {\n  /**\n   * Generic planner failures (authoring-time config violations, the\n   * `toAIError` catch-all for unexpected runtime crashes during a run)\n   * are orchestration-level provider failures. Subclasses with a more\n   * precise meaning redeclare their own — `PlannerPlanInvalidError` is\n   * `\"schema\"`, `PlannerCancelledError` is `\"cancelled\"`.\n   */\n  public static readonly defaultCategory: ErrorCategory = \"provider\";\n\n  public constructor(\n    message: string,\n    options?: AIErrorOptions,\n    code: AIErrorCode = \"PLANNER_FAILED\",\n  ) {\n    super(code, message, options);\n    this.name = \"PlannerFailedError\";\n  }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAyBA,IAAa,qBAAb,cAAwC,QAAQ;;yBAQU;;CAExD,AAAO,YACL,SACA,SACA,OAAoB,kBACpB;EACA,MAAM,MAAM,SAAS,OAAO;EAC5B,KAAK,OAAO;CACd;AACF"}