/** * Structured configuration errors for the Effect Schema config pipeline * (Phase 61). A `ConfigError` carries the offending path, the decoder's * complaint, and — when known — provider-quality remediation guidance and a * docs link, so a bad config file reads like a helpful diagnostic instead of * an opaque stack trace. * * `ConfigError` is a `Schema.TaggedError` (rather than the `Data.TaggedError` * used elsewhere in core) because config diagnostics are surfaced across the * HTTP/OpenAPI boundary in later phases and must be schema-encodable. */ import { ParseResult, Schema } from 'effect'; declare const ConfigError_base: Schema.TaggedErrorClass; } & { /** Dotted path to the offending value, e.g. `agents[0].platform`. `(root)` for the top level. */ path: typeof Schema.String; /** What is wrong at this path, as reported by the schema decoder. */ issue: typeof Schema.String; /** Human-readable one-line message: `${path}: ${issue}`. */ message: typeof Schema.String; /** How to fix it, when the schema (or a resolver) knows. */ remediation: Schema.optional; /** Link to relevant documentation, when available. */ docsUrl: Schema.optional; }>; /** * A single configuration problem, addressed to one path in the config tree. * * Multiple `ConfigError`s can result from decoding one config file when the * decoder runs in `{ errors: 'all' }` mode — one per distinct issue. */ export declare class ConfigError extends ConfigError_base { /** Multi-line, CLI-friendly rendering with remediation and docs when present. */ toString(): string; } declare const ConfigValidationError_base: Schema.TaggedErrorClass; } & { message: typeof Schema.String; errors: Schema.Array$; }>; /** * Aggregate of every `ConfigError` found while loading one config file. * * Thrown by the validated-load path so a caller sees all structural and * semantic problems (with remediation) at once, rather than only the first. */ export declare class ConfigValidationError extends ConfigValidationError_base { /** Multi-line rendering: a header plus each problem's full diagnostic. */ toString(): string; } /** Build a `ConfigValidationError` from a list of issues, composing a summary message. */ export declare const configValidationError: (errors: ReadonlyArray) => ConfigValidationError; /** Shape of a single issue as produced by `ParseResult.ArrayFormatter`. */ export interface ConfigIssue { readonly path: ReadonlyArray; readonly message: string; } /** Optional enrichment resolved per-issue, keyed off its path/message. */ export interface ConfigIssueContext { /** * Given a raw decoder issue, optionally supply remediation guidance and a * docs link. Returning `undefined` (or omitting a field) leaves it unset. */ readonly resolve?: (issue: ConfigIssue) => { remediation?: string; docsUrl?: string; } | undefined; } /** * Convert a schema `ParseError` into a flat list of `ConfigError`s — one per * issue — via `ParseResult.ArrayFormatter`. Pass a `resolve` in `context` to * attach remediation/docs to specific paths. * * Decode with `{ errors: 'all' }` upstream to surface every problem at once * rather than only the first. */ export declare const formatConfigIssues: (error: ParseResult.ParseError, context?: ConfigIssueContext) => ConfigError[]; export {}; //# sourceMappingURL=errors.d.ts.map