import { z } from '@botpress/sdk';
import type { StatusVerdict } from './types';
export declare namespace Errors {
    export enum ErrorLevel {
        Warning = "warning",
        Critical = "critical"
    }
    export enum ErrorType {
        Definition = "definition",
        Runtime = "runtime"
    }
    export enum ErrorCode {
        InvalidPrimitiveDefinition = "INVALID_PRIMITIVE_DEFINITION",
        IntegrationUnavailable = "INTEGRATION_UNAVAILABLE",
        PluginUnavailable = "PLUGIN_UNAVAILABLE"
    }
    export function toErrorString(e: unknown, includeStack?: boolean): string;
    abstract class AbstractError<Code extends ErrorCode> extends Error {
        static readonly code: ErrorCode;
        static readonly level: ErrorLevel;
        static readonly type: ErrorType;
        constructor(messageOrError?: string | z.ZodError, zodError?: z.ZodError);
        get code(): Code;
        get level(): ErrorLevel;
        get type(): ErrorType;
    }
    export class InvalidPrimitiveError extends AbstractError<ErrorCode.InvalidPrimitiveDefinition> {
        static readonly level = ErrorLevel.Critical;
        static readonly type = ErrorType.Definition;
        static readonly code = ErrorCode.InvalidPrimitiveDefinition;
        constructor(messageOrError?: string | z.ZodError, zodError?: z.ZodError);
    }
    /**
     * Thrown when bot code (or the autonomous tool layer) tries to call an
     * integration or plugin that is present for discovery but not `available`
     * (unconfigured / not installed / disabled / unresolved / errored).
     *
     * This is the typed, catchable replacement for the opaque SDK error that
     * previously crashed the turn. It is a `Runtime`/`Warning` error: a single
     * inert dependency must never be process-fatal. The structured fields let the
     * autonomous runner surface a useful tool-error and let callers branch on the
     * reason without string-matching.
     */
    export interface UnavailableDependencyInfo {
        /** The dependency alias (e.g. `slack`). */
        alias: string;
        /** The action being called, when known. */
        action?: string;
        /** The capability verdict that made it uncallable. */
        status: StatusVerdict;
        /** Override the auto-derived remediation hint. */
        remediation?: string;
    }
    export class IntegrationUnavailableError extends AbstractError<ErrorCode.IntegrationUnavailable> {
        static readonly level = ErrorLevel.Warning;
        static readonly type = ErrorType.Runtime;
        static readonly code = ErrorCode.IntegrationUnavailable;
        readonly alias: string;
        readonly action: string | undefined;
        readonly status: StatusVerdict;
        readonly missingFields: string[];
        readonly remediation: string;
        constructor(info: UnavailableDependencyInfo);
    }
    export class PluginUnavailableError extends AbstractError<ErrorCode.PluginUnavailable> {
        static readonly level = ErrorLevel.Warning;
        static readonly type = ErrorType.Runtime;
        static readonly code = ErrorCode.PluginUnavailable;
        readonly alias: string;
        readonly action: string | undefined;
        readonly status: StatusVerdict;
        readonly missingFields: string[];
        readonly remediation: string;
        constructor(info: UnavailableDependencyInfo);
    }
    export function isError<T extends new (...args: any[]) => AbstractError<any>>(error: unknown, errorClass: T): error is InstanceType<T>;
    export function isAdkError(error: unknown): error is AbstractError<ErrorCode>;
    export function isDefinitionError(error: unknown): error is AbstractError<ErrorCode>;
    export function isRuntimeError(error: unknown): error is AbstractError<ErrorCode>;
    export {};
}
//# sourceMappingURL=errors.d.ts.map