export type AgentRuntimeHandleOperation = "invoke" | "subscribe" | "inspect" | "close";
export type AgentRuntimeHandleErrorCode = "MISSING_RUNTIME_ID" | "RUNTIME_NOT_READY" | "UNSUPPORTED_OPERATION" | "HANDLE_CLOSED" | "GOVERNANCE_REJECTED";
export type AgentRuntimeHandleError = {
    code: AgentRuntimeHandleErrorCode;
    message: string;
    boundary: "input" | "runtime-state" | "governance";
};
export type AgentRuntimeHandleGate = {
    accepted: boolean;
    reason?: string;
};
export type AgentRuntimeHandleRequest = {
    runtimeId: string;
    applicationId?: string;
    runtimeReady?: boolean;
    enabledOperations?: readonly AgentRuntimeHandleOperation[];
    visibleSessions?: readonly string[];
    visibleEventTypes?: readonly string[];
    governance?: AgentRuntimeHandleGate;
};
export type AgentRuntimeHandleStatus = {
    runtimeId: string;
    applicationId?: string;
    status: "ready" | "closed";
    enabledOperations: readonly AgentRuntimeHandleOperation[];
    visibleSessions: readonly string[];
    visibleEventTypes: readonly string[];
};
export type AgentRuntimeHandleCall = {
    operation: AgentRuntimeHandleOperation;
    payload?: unknown;
};
export type AgentRuntimeHandleCallResult = {
    ok: true;
    operation: AgentRuntimeHandleOperation;
    runtimeId: string;
    applicationId?: string;
    accepted: true;
    dryRun: true;
} | {
    ok: false;
    error: AgentRuntimeHandleError;
};
export type AgentRuntimeHandleCloseResult = {
    ok: true;
    runtimeId: string;
    status: "closed";
    events: readonly string[];
} | {
    ok: false;
    error: AgentRuntimeHandleError;
    events: readonly string[];
};
export type AgentRuntimeHandle = {
    runtimeId: string;
    applicationId?: string;
    enabledOperations: readonly AgentRuntimeHandleOperation[];
    visibleSessions: readonly string[];
    visibleEventTypes: readonly string[];
    call: (call: AgentRuntimeHandleCall) => AgentRuntimeHandleCallResult;
    getStatus: () => AgentRuntimeHandleStatus;
    close: () => AgentRuntimeHandleCloseResult;
};
export type AgentRuntimeHandleResult = {
    ok: true;
    handle: AgentRuntimeHandle;
    events: readonly string[];
} | {
    ok: false;
    error: AgentRuntimeHandleError;
    events: readonly string[];
};
export declare function createAgentRuntimeHandle(request: AgentRuntimeHandleRequest): AgentRuntimeHandleResult;
