import type { RuntimeAuthorityCallerKind, RuntimeAuthorityContext } from "./runtimeAuthorityResolver.js";
export type GovernanceDecisionStatus = "allow" | "deny" | "requires-approval" | "degrade";
export type GovernanceRuleBoundary = "input" | "contract" | "governance" | "runtime-state" | "scope";
export type GovernanceRuleEvaluationErrorCode = "MISSING_RUNTIME_ID" | "MISSING_ACTION" | "MISSING_AUTHORITY" | "RUNTIME_NOT_READY" | "CONTRACT_REJECTED";
export type GovernanceRuleGate = {
    accepted: boolean;
    reason?: string;
};
export type GovernanceRuleMatch = {
    actions?: readonly string[];
    callerKinds?: readonly RuntimeAuthorityCallerKind[];
    requiredScopes?: readonly string[];
    runtimeIds?: readonly string[];
};
export type GovernanceRule = {
    id: string;
    decision: GovernanceDecisionStatus;
    reason?: string;
    priority?: number;
    match?: GovernanceRuleMatch;
    approvalToken?: string;
    degradationTarget?: string;
};
export type GovernanceRuleEvaluationRequest = {
    runtimeId?: string;
    action?: string;
    authority?: RuntimeAuthorityContext;
    requestedScopes?: readonly string[];
    rules?: readonly GovernanceRule[];
    runtimeReady?: boolean;
    contract?: GovernanceRuleGate;
};
export type GovernanceDecision = {
    status: GovernanceDecisionStatus;
    runtimeId: string;
    action: string;
    callerId: string;
    matchedRuleIds: readonly string[];
    requestedScopes: readonly string[];
    reason: string;
    approvalRequired: boolean;
    degradationTarget?: string;
    unsafeSideEffects: false;
};
export type GovernanceRuleEvaluationError = {
    code: GovernanceRuleEvaluationErrorCode;
    message: string;
    boundary: GovernanceRuleBoundary;
    publicSafe: true;
};
export type GovernanceRuleEvaluationResult = {
    ok: true;
    decision: GovernanceDecision;
    events: readonly string[];
} | {
    ok: false;
    error: GovernanceRuleEvaluationError;
    events: readonly string[];
};
export declare function evaluateGovernanceRule(request?: GovernanceRuleEvaluationRequest): GovernanceRuleEvaluationResult;
