import type { ExternalCommandEnvelope, ExternalControlBoundary, ExternalControlCaller } from "./externalCommandReceiver.js";
import type { ExternalControlGuardDecision, ExternalControlGuardError } from "./externalControlGuard.js";
export type ExternalControlAuditOutcome = "received" | "allowed" | "rejected" | "blocked";
export type ExternalControlAuditErrorCode = "MISSING_RUNTIME_ID" | "MISSING_ACTOR" | "MISSING_SUBJECT" | "RUNTIME_NOT_READY";
export type ExternalControlAuditActor = ExternalControlCaller;
export type ExternalControlAuditEntry = {
    auditId: string;
    runtimeId: string;
    actor: ExternalControlAuditActor;
    outcome: ExternalControlAuditOutcome;
    subject: string;
    commandId?: string;
    commandName?: string;
    targetSurface?: string;
    decisionStatus?: "allow";
    rejectionCode?: string;
    evidenceRefs: readonly string[];
    summary: string;
    occurredAt: string;
    replayable: true;
    safeForInspection: true;
    internalDetailExposed: false;
    unsafeSideEffects: false;
};
export type ExternalControlAuditRequest = {
    runtimeId?: string;
    actor?: ExternalControlAuditActor;
    outcome?: ExternalControlAuditOutcome;
    subject?: string;
    command?: ExternalCommandEnvelope;
    guardDecision?: ExternalControlGuardDecision;
    guardError?: ExternalControlGuardError;
    evidenceRefs?: readonly string[];
    previousEntries?: readonly ExternalControlAuditEntry[];
    occurredAt?: string;
    runtimeReady?: boolean;
    internalDetail?: unknown;
};
export type ExternalControlAuditError = {
    code: ExternalControlAuditErrorCode;
    message: string;
    boundary: ExternalControlBoundary;
    safeForInspection: true;
    internalDetailExposed: false;
};
export type ExternalControlAuditReplay = {
    cursor: string;
    entries: readonly ExternalControlAuditEntry[];
};
export type ExternalControlAuditResult = {
    ok: true;
    entry: ExternalControlAuditEntry;
    trail: readonly ExternalControlAuditEntry[];
    replay: ExternalControlAuditReplay;
    events: readonly string[];
} | {
    ok: false;
    error: ExternalControlAuditError;
    events: readonly string[];
};
export declare const externalControlAuditDescriptor: {
    readonly surface: "runtime.externalControl";
    readonly capability: "externalControlAudit";
    readonly purpose: "record replayable inspection-safe evidence for external runtime control";
    readonly mode: "dry-run";
    readonly unsafeSideEffects: false;
};
export declare function recordExternalControlAudit(request?: ExternalControlAuditRequest): ExternalControlAuditResult;
