export type CustomInterfaceSource = "runtime" | "official-module" | "custom-interface";
export type CustomInterfaceBoundary = "input" | "contract" | "governance" | "scope";
export type CustomInterfaceErrorCode = "MISSING_INTERFACE_ID" | "MISSING_ENTRYPOINT" | "MISSING_CAPABILITY" | "INVALID_CAPABILITY" | "CONTRACT_REJECTED" | "GOVERNANCE_REJECTED" | "SCOPE_DENIED";
export type CustomInterfaceGate = {
    accepted: boolean;
    reason?: string;
};
export type CustomInterfaceError = {
    code: CustomInterfaceErrorCode;
    message: string;
    boundary: CustomInterfaceBoundary;
};
export type CustomInterfaceCapabilityInput = {
    name?: string;
    operations?: readonly string[];
    scopes?: readonly string[];
};
export type CustomInterfaceCapability = {
    name: string;
    operations: readonly string[];
    scopes: readonly string[];
};
export type CustomInterfaceDefinitionRequest = {
    interfaceId?: string;
    entrypoint?: string;
    source?: CustomInterfaceSource;
    owner?: string;
    capabilities?: readonly CustomInterfaceCapabilityInput[];
    requestedScopes?: readonly string[];
    allowedScopes?: readonly string[];
    contract?: CustomInterfaceGate;
    governance?: CustomInterfaceGate;
    metadata?: Readonly<Record<string, unknown>>;
};
export type CustomInterfaceDefinition = {
    interfaceId: string;
    entrypoint: string;
    source: CustomInterfaceSource;
    owner?: string;
    capabilities: readonly CustomInterfaceCapability[];
    scopes: readonly string[];
    lifecycle: "defined";
    runtimeGoverned: true;
    dispatch: "dry-run";
    metadata: Readonly<Record<string, unknown>>;
};
export type CustomInterfaceDefinitionResult = {
    ok: true;
    definition: CustomInterfaceDefinition;
    events: readonly string[];
} | {
    ok: false;
    error: CustomInterfaceError;
    events: readonly string[];
};
export declare function hasCustomInterfaceScopeAccess(requestedScopes: readonly string[] | undefined, allowedScopes: readonly string[] | undefined): boolean;
export declare function createCustomInterfaceError(code: CustomInterfaceErrorCode, message: string, boundary: CustomInterfaceBoundary): CustomInterfaceError;
export declare function defineCustomInterface(request?: CustomInterfaceDefinitionRequest): CustomInterfaceDefinitionResult;
