import type { ToolResult } from '../index.js';
export type ToolHandler = (args: Record<string, unknown>, extra?: unknown) => Promise<ToolResult>;
export interface NextAction {
    tool: string;
    args: Record<string, unknown>;
    rationale?: string;
}
export interface StructuredError {
    ok: false;
    what: string;
    why: string;
    nextAction: NextAction;
    errorCode?: string;
    citations?: string[];
}
export interface ErrorRecoveryRule {
    id: string;
    match: {
        code?: string;
        messagePattern?: string;
    };
    what: string;
    why?: string;
    nextAction: NextAction;
}
export interface WrapCtx {
    toolName: string;
    registry: RecoveryRegistryInstance;
}
export interface RecoveryRegistryInstance {
    load(): Promise<void>;
    match(err: unknown): ErrorRecoveryRule | null;
}
export interface RecoveryRegistryConfig {
    $schema?: string;
    schemaVersion: number;
    rules: ErrorRecoveryRule[];
}
//# sourceMappingURL=structured-error.d.ts.map