export type ExternalControlBoundary = "input" | "contract" | "governance" | "runtime-state" | "scope";
export type ExternalControlCallerKind = "application" | "official-module" | "operator" | "runtime-surface";
export type ExternalCommandKind = "read" | "mutate" | "invoke" | "mode" | "management" | "diagnostic";
export type ExternalControlTargetSurface = "applicationSurface" | "officialModuleSurface" | "governancePlane" | "invocationMethod" | "managementPlane" | "inspection" | "debug" | "runtime.externalControl";
export type ExternalCommandEffect = "read-runtime" | "mutate-runtime" | "invoke-tool" | "invoke-model" | "switch-mode" | "manage-runtime" | "inspect-runtime";
export type ExternalCommandReceiverErrorCode = "MISSING_RUNTIME_ID" | "MISSING_CALLER" | "MISSING_COMMAND_NAME" | "MISSING_TARGET_SURFACE" | "INVALID_PAYLOAD" | "RUNTIME_NOT_READY" | "CONTRACT_REJECTED" | "GOVERNANCE_REJECTED";
export type ExternalControlGate = {
    accepted: boolean;
    reason?: string;
};
export type ExternalControlCaller = {
    kind: ExternalControlCallerKind;
    id: string;
    moduleId?: string;
    sessionId?: string;
};
export type ExternalControlTarget = {
    surface?: ExternalControlTargetSurface;
    operation?: string;
    resourceId?: string;
};
export type ExternalCommandTrace = {
    correlationId?: string;
    parentCommandId?: string;
    receivedAt?: string;
};
export type ExternalCommandReceiverRequest = {
    runtimeId?: string;
    commandId?: string;
    commandKind?: ExternalCommandKind;
    commandName?: string;
    caller?: ExternalControlCaller;
    target?: ExternalControlTarget;
    requestedEffects?: readonly ExternalCommandEffect[];
    payload?: Readonly<Record<string, unknown>>;
    metadata?: Readonly<Record<string, unknown>>;
    trace?: ExternalCommandTrace;
    runtimeReady?: boolean;
    contract?: ExternalControlGate;
    governance?: ExternalControlGate;
};
export type ExternalCommandEnvelope = {
    surface: "runtime.externalControl";
    mode: "dry-run";
    runtimeId: string;
    commandId: string;
    commandKind: ExternalCommandKind;
    commandName: string;
    caller: ExternalControlCaller;
    target: {
        surface: ExternalControlTargetSurface;
        operation?: string;
        resourceId?: string;
    };
    requestedEffects: readonly ExternalCommandEffect[];
    payload: Readonly<Record<string, unknown>>;
    payloadKeys: readonly string[];
    trace: ExternalCommandTrace;
    route: "agent_runtimeImplementation.runtime.externalControl.externalCommandReceiver";
    audit: {
        dryRun: true;
        acceptedByReceiver: true;
        unsafeSideEffects: false;
        governanceRequired: true;
        contractSurface: "runtime.contractSurface";
    };
    metadata: Readonly<Record<string, unknown>>;
};
export type ExternalCommandReceiverError = {
    code: ExternalCommandReceiverErrorCode;
    message: string;
    boundary: ExternalControlBoundary;
    safeForInspection: true;
    internalDetailExposed: false;
};
export type ExternalCommandReceiverResult = {
    ok: true;
    command: ExternalCommandEnvelope;
    events: readonly string[];
} | {
    ok: false;
    error: ExternalCommandReceiverError;
    events: readonly string[];
};
export declare const externalCommandReceiverDescriptor: {
    readonly surface: "runtime.externalControl";
    readonly capability: "externalCommandReceiver";
    readonly purpose: "normalize an external runtime control command into a governed dry-run envelope";
    readonly mode: "dry-run";
    readonly unsafeSideEffects: false;
};
export declare function receiveExternalCommand(request?: ExternalCommandReceiverRequest): ExternalCommandReceiverResult;
