type UnhandledRejectionHandler = (reason: unknown) => boolean;
/**
 * Checks if an error is an AbortError.
 * These are typically intentional cancellations (e.g., during shutdown) and shouldn't crash.
 */
export declare function isAbortError(err: unknown): boolean;
/**
 * Application-level errors from a koi's own tool calls or its code-mode sandbox.
 * The `node:vm` sandbox can leak un-awaited rejections from model-authored code
 * (e.g. a `tools.exec(...)` that fails) onto the process — these must NEVER crash
 * the gateway, which serves every session. Identify them by the tool-error
 * message shape or a `<code-mode>` stack frame, and treat them as non-fatal.
 */
export declare function isKoiSandboxError(err: unknown): boolean;
/**
 * Checks if an error is a transient network error that shouldn't crash the gateway.
 * These are typically temporary connectivity issues that will resolve on their own.
 */
export declare function isTransientNetworkError(err: unknown): boolean;
export declare function registerUnhandledRejectionHandler(handler: UnhandledRejectionHandler): () => void;
export declare function isUnhandledRejectionHandled(reason: unknown): boolean;
export declare function installUnhandledRejectionHandler(): void;
export {};
