/** * Errors thrown by the dispatch pipeline. * * Each implements `KernelErrorClassifiable` so `kernel-api/dispatch` can * convert them into typed `KernelErrorPayload` values automatically. */ import type { KernelErrorPayload, KernelErrorClassifiable } from '@astrale-os/kernel-api'; /** A single Zod issue, normalized to the path/message the payload carries. */ type ValidationIssue = { path: (string | number)[]; message: string; }; export declare class MethodNotFoundError extends Error implements KernelErrorClassifiable { constructor(method: string); toKernelErrorPayload(): KernelErrorPayload; } export declare class SdkValidationError extends Error implements KernelErrorClassifiable { readonly issues: ValidationIssue[]; constructor(issues: ValidationIssue[], message?: string); toKernelErrorPayload(): KernelErrorPayload; } /** * Thrown when a handler's return value (or a stream chunk) fails validation * against its `outputSchema`. This is a server/handler fault — the author's * code produced data that violates its own declared contract — so it maps to * `INTERNAL_ERROR` (→ HTTP 500), NOT the `VALIDATION_ERROR` (422) used for * bad caller input. Mirrors the kernel's `ResultValidationError`. */ export declare class SdkResultValidationError extends Error implements KernelErrorClassifiable { readonly issues: ValidationIssue[]; readonly ref?: string | undefined; constructor(issues: ValidationIssue[], ref?: string | undefined); toKernelErrorPayload(): KernelErrorPayload; } /** * Thrown by a `RemoteHandler.authorize` hook to deny a call. * * Wraps any error the hook throws — handlers can throw a plain `Error` and * the dispatcher converts it. Already-typed `AuthorizationDeniedError` * instances are passed through unchanged so callers can attach hints. */ export declare class AuthorizationDeniedError extends Error implements KernelErrorClassifiable { constructor(message: string, cause?: unknown); toKernelErrorPayload(): KernelErrorPayload; } export {}; //# sourceMappingURL=errors.d.ts.map