import { type DebugSnapshot, type DebugSnapshotSectionInput } from "./debugSnapshotCollector.js";
import { type DebugStateDiff } from "./debugStateDiff.js";
import { type DebugTraceEventInput, type DebugTraceSnapshot } from "./debugTraceRecorder.js";
export type DebugRuntimeBoundary = "input" | "contract" | "governance" | "runtime-state" | "scope" | "debug";
export type DebugRuntimeCallerKind = "application" | "official-module" | "runtime-surface" | "inspection" | "test";
export type DebugRuntimeCaller = {
    kind: DebugRuntimeCallerKind;
    id: string;
    moduleId?: string;
    sessionId?: string;
};
export type DebugRuntimeGate = {
    accepted: boolean;
    reason?: string;
};
export type DebugRuntimeCapability = "trace" | "snapshot" | "state-diff" | "replay-hook" | "probe" | (string & {});
export type DebugRuntimeAttachment = {
    trace?: DebugTraceSnapshot;
    snapshot?: DebugSnapshot;
    stateDiff?: DebugStateDiff;
};
export type DebugRuntimeSession = {
    runtimeId: string;
    debugSessionId: string;
    caller: DebugRuntimeCaller;
    route: "runtime.debug.debugRuntime";
    capabilities: readonly DebugRuntimeCapability[];
    attachments: DebugRuntimeAttachment;
    attachmentStatus: {
        traceRecorded: boolean;
        snapshotCollected: boolean;
        stateDiffComputed: boolean;
    };
    audit: {
        dryRun: true;
        unsafeSideEffects: false;
        governanceRequired: true;
        contractSurface: "runtime.contractSurface";
    };
};
export type DebugRuntimeRequest = {
    runtimeId?: string;
    debugSessionId?: string;
    caller?: DebugRuntimeCaller;
    requestedCapabilities?: readonly DebugRuntimeCapability[];
    allowedCapabilities?: readonly string[];
    traceEvents?: readonly DebugTraceEventInput[];
    snapshotSections?: readonly DebugSnapshotSectionInput[];
    beforeState?: Readonly<Record<string, unknown>>;
    afterState?: Readonly<Record<string, unknown>>;
    runtimeReady?: boolean;
    contract?: DebugRuntimeGate;
    governance?: DebugRuntimeGate;
};
export type DebugRuntimeErrorCode = "MISSING_RUNTIME_ID" | "MISSING_CALLER" | "MISSING_DEBUG_CAPABILITIES" | "CAPABILITY_SCOPE_DENIED" | "TRACE_ATTACHMENT_FAILED" | "SNAPSHOT_ATTACHMENT_FAILED" | "STATE_DIFF_ATTACHMENT_FAILED" | "RUNTIME_NOT_READY" | "CONTRACT_REJECTED" | "GOVERNANCE_REJECTED";
export type DebugRuntimeError = {
    code: DebugRuntimeErrorCode;
    message: string;
    boundary: DebugRuntimeBoundary;
    safeForRuntimeInspection: true;
    internalDetailExposed: false;
};
export type DebugRuntimeResult = {
    ok: true;
    session: DebugRuntimeSession;
    events: readonly string[];
} | {
    ok: false;
    error: DebugRuntimeError;
    events: readonly string[];
};
export declare const debugRuntimeDescriptor: {
    readonly surface: "runtime.debug";
    readonly capability: "debugRuntime";
    readonly purpose: "open a governed dry-run debug runtime surface for trace, snapshot, and state diff attachments";
    readonly unsafeSideEffects: false;
};
export declare function createDebugRuntime(request?: DebugRuntimeRequest): DebugRuntimeResult;
