import { type RuntimeFaultClassification, type RuntimeFaultSignal } from "./faultClassifier.js";
import { type RuntimeRepairActionDecision } from "./repairActionGate.js";
import { type RuntimeRepairEscalationCaller, type RuntimeRepairEscalationEnvelope } from "./repairEscalationPort.js";
import { type RuntimeRepairPlan, type RuntimeRepairPlanStepKind } from "./repairPlanBuilder.js";
export type SelfRepairRuntimeBoundary = "input" | "contract" | "governance" | "runtime-state" | "scope" | "fault-signal" | "approval" | "classification" | "repair-plan" | "action-gate" | "escalation";
export type SelfRepairRuntimeErrorCode = "MISSING_RUNTIME_ID" | "MISSING_FAULT_SIGNAL" | "RUNTIME_NOT_READY" | "CONTRACT_REJECTED" | "GOVERNANCE_REJECTED" | "FAULT_CLASSIFICATION_FAILED" | "REPAIR_PLAN_FAILED" | "REPAIR_ACTION_GATE_FAILED" | "REPAIR_ESCALATION_FAILED";
export type SelfRepairRuntimeStatus = "plan-ready" | "approval-required" | "escalated";
export type SelfRepairRuntimeGate = {
    accepted: boolean;
    reason?: string;
};
export type SelfRepairRuntimeRequest = {
    runtimeId?: string;
    signal?: RuntimeFaultSignal;
    runtimeReady?: boolean;
    observedAt?: string;
    allowedFaultKinds?: readonly string[];
    allowedStepKinds?: readonly RuntimeRepairPlanStepKind[];
    approvedStepIds?: readonly string[];
    allowHighRisk?: boolean;
    caller?: RuntimeRepairEscalationCaller;
    contract?: SelfRepairRuntimeGate;
    governance?: SelfRepairRuntimeGate;
};
export type SelfRepairRuntimeOutcome = {
    runtimeId: string;
    status: SelfRepairRuntimeStatus;
    classification: RuntimeFaultClassification;
    plan?: RuntimeRepairPlan;
    actionDecision?: RuntimeRepairActionDecision;
    escalation?: RuntimeRepairEscalationEnvelope;
    nextStep: "hold-for-approval" | "dry-run-plan-ready" | "manual-review";
    audit: {
        dryRun: true;
        unsafeSideEffects: false;
        runtime: "runtime.selfRepair.selfRepairRuntime";
        contractChecked: true;
        governanceChecked: true;
        stages: readonly SelfRepairRuntimeStage[];
    };
};
export type SelfRepairRuntimeStage = "fault-classified" | "repair-plan-built" | "action-gated" | "approval-held" | "escalation-created";
export type SelfRepairRuntimeError = {
    code: SelfRepairRuntimeErrorCode;
    message: string;
    boundary: SelfRepairRuntimeBoundary;
    safeForRuntimeInspection: true;
    internalDetailExposed: false;
};
export type SelfRepairRuntimeResult = {
    ok: true;
    outcome: SelfRepairRuntimeOutcome;
    events: readonly string[];
} | {
    ok: false;
    error: SelfRepairRuntimeError;
    events: readonly string[];
};
export declare const selfRepairRuntimeDescriptor: {
    readonly surface: "runtime.selfRepair";
    readonly capability: "selfRepairRuntime";
    readonly purpose: "coordinate governed dry-run runtime self-repair classification, planning, gating, and escalation";
    readonly unsafeSideEffects: false;
};
export declare function runSelfRepairRuntime(request?: SelfRepairRuntimeRequest): SelfRepairRuntimeResult;
