/**
 * Typed port errors (Sprint-459).
 *
 * Agent handlers can pattern-match on concrete classes to implement
 * intelligent retry, HITL escalation, or graceful degradation:
 *
 *   try {
 *     await deps.brain.archiveKnowledge(entry);
 *   } catch (err) {
 *     if (err instanceof BrainRateLimit) {
 *       await sleep(err.retryAfterMs);
 *       return retry();
 *     }
 *     if (err instanceof BrainUnavailable) {
 *       return { skipped: true, reason: "brain down" };
 *     }
 *     throw err;
 *   }
 *
 * All port-error classes extend `PortError` for a single instanceof check
 * when agents want to distinguish port failures from tool / LLM failures.
 *
 * Errors carry a `cause` field (native Error cause) so the underlying
 * exception remains debuggable; and a `retryable` boolean so orchestrators
 * can apply generic retry policies without class-specific knowledge.
 */
/** Base class for every port-layer error thrown by an SDK-injected port. */
export declare abstract class PortError extends Error {
    /** Port identifier that raised the error (e.g. "brain", "db"). */
    abstract readonly port: string;
    /** True if the caller MAY retry after some backoff. */
    readonly retryable: boolean;
    constructor(message: string, options?: {
        cause?: unknown;
        retryable?: boolean;
    });
}
export declare class BrainUnavailable extends PortError {
    readonly port = "brain";
    constructor(message?: string, cause?: unknown);
}
export declare class BrainRateLimit extends PortError {
    readonly port = "brain";
    /** Server-advised wait before retry. Missing if unknown. */
    readonly retryAfterMs?: number;
    constructor(opts?: {
        message?: string;
        retryAfterMs?: number;
        cause?: unknown;
    });
}
export declare class BrainValidationError extends PortError {
    readonly port = "brain";
    constructor(message: string, cause?: unknown);
}
export declare class BrainAuthError extends PortError {
    readonly port = "brain";
    constructor(message?: string, cause?: unknown);
}
export declare class DbConnectionLost extends PortError {
    readonly port = "db";
    constructor(message?: string, cause?: unknown);
}
export declare class DbQueryError extends PortError {
    readonly port = "db";
    /** The SQL fragment that failed (first 200 chars). */
    readonly sqlPreview?: string;
    constructor(opts: {
        message: string;
        cause?: unknown;
        sqlPreview?: string;
    });
}
export declare class OutcomeAttributionFailed extends PortError {
    readonly port = "outcome";
    /** agent_run.id that failed to attribute. */
    readonly runId: string;
    constructor(runId: string, message: string, cause?: unknown);
}
/**
 * Thrown by `triggerCycle()` when `opts.dryRun` is not explicitly set.
 *
 * Audit-ready agents must declare execution intent at every call site.
 * Passing `{dryRun: true}` for non-destructive runs, `{dryRun: false}` for
 * live execution, prevents accidental side-effect execution.
 *
 * @public
 */
export declare class MissingDryRunFlagError extends Error {
    constructor();
}
/**
 * True if the error is a PortError produced by the named port.
 * Convenience for narrow error handling without leaking class imports.
 */
export declare function isPortError(err: unknown, port?: string): err is PortError;
/**
 * True if the error is a PortError and the originating port marked it
 * retryable. Returns false for unknown errors — caller should rethrow.
 */
export declare function isRetryablePortError(err: unknown): err is PortError;
//# sourceMappingURL=errors.d.ts.map