import { ErrorCategory } from "../errors/error-category.type.mjs"; import { AIError, AIErrorOptions } from "../errors/ai-error.mjs"; //#region ../ai/src/prompt/errors.d.ts /** * A prompt name was looked up in the registry but is not registered. * * Thrown by `resolve(name, …)` and `versions(name)` on an unknown name — * closing the silent first-match / empty-result gap a bare `Map.get` would * leave. The missing name is carried in `context.name` for logging. * * Reuses the `"validation"` category (an authoring-time lookup mistake, not a * provider failure) and the shared `PROVIDER_INVALID_REQUEST` code, since the * prompt registry is a local primitive with no dedicated error code. * * @example * try { * prompts.resolve("unknown-agent"); * } catch (error) { * if (error instanceof PromptNotFoundError) { * console.error(error.context?.name); * } * } */ declare class PromptNotFoundError extends AIError { static readonly defaultCategory: ErrorCategory; constructor(name: string, options?: AIErrorOptions); } /** * A prompt-registry authoring or resolution invariant was violated: * * - `add(name, version)` / `register(entry)` with a duplicate version label * (no silent overwrite). * - `resolve(name, …)` where the picked version declares `required` keys that * are missing from the merged placeholders (the missing keys are listed in * the message and carried on `context.missing`). * * Reuses the `"validation"` category and the shared `SCHEMA_VALIDATION_FAILED` * code — it is the same class of "you supplied something the registry can't * use" failure as a schema-validation miss. * * @example * try { * prompts.resolve("support-agent", { placeholders: {} }); * } catch (error) { * if (error instanceof PromptValidationError) { * console.error(error.context?.missing); // ["product"] * } * } */ declare class PromptValidationError extends AIError { static readonly defaultCategory: ErrorCategory; constructor(message: string, options?: AIErrorOptions); } //#endregion export { PromptNotFoundError, PromptValidationError }; //# sourceMappingURL=errors.d.mts.map