import type { MainLoopStepRecord } from "../agent_executionEngine/coreLogic/mainLoop.js";
export type RuntimeSessionRecord = {
    sessionId: string;
    runtimeId: string;
    agentId: string;
    manifestHash: string;
    createdAt: string;
    status: "running" | "completed" | "failed" | "waitingApproval" | "interrupted";
    metadata: Readonly<Record<string, unknown>>;
};
export type RuntimeStateRecord = {
    sessionId: string;
    stateId: string;
    phase: string;
    createdAt: string;
    metadata: Readonly<Record<string, unknown>>;
};
export type RuntimeEventRecord = {
    sessionId: string;
    eventId: string;
    type: string;
    createdAt: string;
    payload: Readonly<Record<string, unknown>>;
};
export type RuntimeInvocationRecord = {
    sessionId: string;
    invocationId: string;
    kind: "model" | "tool" | "agent" | "io" | "procedure" | "approval";
    target: string;
    ok: boolean;
    createdAt: string;
    summary: Readonly<Record<string, unknown>>;
};
export type RuntimeProcedureRecord = {
    sessionId: string;
    procedureId: string;
    status: "planned" | "running" | "completed" | "failed" | "waitingApproval";
    createdAt: string;
    updatedAt?: string;
    summary: Readonly<Record<string, unknown>>;
};
export type RuntimeApprovalRecord = {
    sessionId: string;
    approvalId: string;
    status: "pending" | "approved" | "denied" | "expired";
    reason: string;
    requestedScopes: readonly string[];
    riskLevel?: string;
    source: "model" | "baseTool" | "ephemeralProcedure" | "runtime";
    interfaceSurface: "application" | "test-harness" | "cli" | "tui" | "ui" | "raxos" | "remote-management";
    createdAt: string;
    resolvedAt?: string;
    resolution?: Readonly<Record<string, unknown>>;
    metadata: Readonly<Record<string, unknown>>;
};
export type RuntimePublicSafeErrorRecord = {
    sessionId: string;
    errorId: string;
    code: string;
    message: string;
    boundary: "compile" | "io" | "prompt" | "model" | "tool" | "procedure" | "approval" | "runtime-state";
    createdAt: string;
    metadata: Readonly<Record<string, unknown>>;
    publicSafe: true;
};
export type RuntimeSessionSnapshot = {
    session?: RuntimeSessionRecord;
    states: readonly RuntimeStateRecord[];
    events: readonly RuntimeEventRecord[];
    invocations: readonly RuntimeInvocationRecord[];
    mainLoopSteps: readonly MainLoopStepRecord[];
    procedures: readonly RuntimeProcedureRecord[];
    approvals: readonly RuntimeApprovalRecord[];
    errors: readonly RuntimePublicSafeErrorRecord[];
};
export type RuntimeSessionStateEventStore = {
    createSession(record: RuntimeSessionRecord): Promise<void>;
    updateSessionStatus(sessionId: string, status: RuntimeSessionRecord["status"]): Promise<void>;
    appendState(record: RuntimeStateRecord): Promise<void>;
    appendEvent(record: RuntimeEventRecord): Promise<void>;
    appendInvocation(record: RuntimeInvocationRecord): Promise<void>;
    appendMainLoopStep(record: MainLoopStepRecord): Promise<void>;
    appendProcedure(record: RuntimeProcedureRecord): Promise<void>;
    appendApproval(record: RuntimeApprovalRecord): Promise<void>;
    resolveApproval(sessionId: string, approvalId: string, resolution: Pick<RuntimeApprovalRecord, "status" | "resolvedAt" | "resolution">): Promise<void>;
    appendPublicSafeError(record: RuntimePublicSafeErrorRecord): Promise<void>;
    readPendingApprovals(sessionId: string): Promise<readonly RuntimeApprovalRecord[]>;
    readLatestState(sessionId: string): Promise<RuntimeStateRecord | undefined>;
    readSession(sessionId: string): Promise<RuntimeSessionSnapshot>;
    close?(): Promise<void>;
};
export declare function createInMemorySessionStateEventStore(): RuntimeSessionStateEventStore;
export declare function createSqliteSessionStateEventStore(databasePath?: string): Promise<RuntimeSessionStateEventStore>;
