import type { InvocationMethodKind, InvocationMethodRegistry } from "./invocationMethodRegistry.js";
export type InvocationRouteBoundary = "input" | "contract" | "governance" | "runtime" | "registry";
export type InvocationRouteErrorCode = "MISSING_ENVELOPE" | "MISSING_REGISTRY" | "MISSING_INVOCATION_ID" | "MISSING_METHOD" | "MISSING_TARGET" | "RUNTIME_NOT_READY" | "CONTRACT_REJECTED" | "GOVERNANCE_REJECTED" | "METHOD_NOT_REGISTERED" | "METHOD_DISABLED" | "UNKNOWN_METHOD";
export type InvocationRouteError = {
    code: InvocationRouteErrorCode;
    message: string;
    boundary: InvocationRouteBoundary;
};
export type InvocationRouteGate = {
    accepted: boolean;
    reason?: string;
};
export type InvocationRouteEnvelope = {
    invocationId?: string;
    method?: InvocationMethodKind | string;
    target?: string;
    payload?: unknown;
    source?: "application" | "official-module" | "runtime" | "test";
};
export type InvocationRoute = {
    routeId: string;
    invocationId: string;
    method: InvocationMethodKind;
    surfaceId: string;
    target: string;
    source: "application" | "official-module" | "runtime" | "test";
    payload?: unknown;
    dryRun: true;
    governanceChecked: true;
    contractChecked: true;
};
export type InvocationRouterRequest = {
    envelope?: InvocationRouteEnvelope;
    registry?: InvocationMethodRegistry;
    runtimeReady?: boolean;
    contract?: InvocationRouteGate;
    governance?: InvocationRouteGate;
};
export type InvocationRouterResult = {
    ok: true;
    route: InvocationRoute;
    events: readonly string[];
} | {
    ok: false;
    error: InvocationRouteError;
    events: readonly string[];
};
export declare function routeInvocation(request: InvocationRouterRequest): InvocationRouterResult;
