import type { MemoryEdge, MemoryEdgeId, MemoryId, MemoryRecord, MemoryScope, MemoryScopeKind, MemoryStatus, MemoryType } from "@oscharko-dev/keiko-contracts/memory";
import type { MemoryContentCipher } from "./cipher.js";
import type { MemoryAccessStat } from "./access.js";
export type { MemoryAccessStat } from "./access.js";
export type MemoryEmbeddingMetric = "cosine" | "euclidean" | "dot";
export interface MemoryEmbeddingInput {
    readonly provider: string;
    readonly modelId: string;
    readonly modelRevision?: string;
    readonly metric: MemoryEmbeddingMetric;
    readonly vector: Float32Array;
}
export interface MemoryEmbeddingRow {
    readonly memoryId: MemoryId;
    readonly provider: string;
    readonly modelId: string;
    readonly modelRevision?: string;
    readonly dimensions: number;
    readonly metric: MemoryEmbeddingMetric;
    readonly vector: Float32Array;
    readonly createdAt: number;
}
export interface MemoryTombstone {
    readonly id: string;
    readonly memoryId: MemoryId;
    readonly scopeKind: MemoryScopeKind;
    readonly scopeCoordinate: string;
    readonly type: MemoryType;
    readonly forgottenAt: number;
    readonly forgetterSurface: string;
    readonly reason?: string;
}
export type MemoryEvent = {
    readonly kind: "memory:inserted";
    readonly record: MemoryRecord;
} | {
    readonly kind: "memory:updated";
    readonly record: MemoryRecord;
} | {
    readonly kind: "memory:deleted";
    readonly memoryId: MemoryId;
    readonly scope: MemoryScope;
    readonly tombstoned: boolean;
} | {
    readonly kind: "memory:tombstoned";
    readonly tombstone: MemoryTombstone;
} | {
    readonly kind: "edge:inserted";
    readonly edge: MemoryEdge;
} | {
    readonly kind: "edge:deleted";
    readonly edgeId: MemoryEdgeId;
} | {
    readonly kind: "embedding:upserted";
    readonly memoryId: MemoryId;
    readonly provider: string;
    readonly modelId: string;
};
export type MemoryUpdatePatch = Partial<Omit<MemoryRecord, "id" | "schemaVersion" | "scope" | "createdAt">>;
export interface ListMemoriesOptions {
    readonly type?: readonly MemoryType[];
    readonly status?: readonly MemoryStatus[];
    readonly pinned?: boolean;
    readonly includeExpired?: boolean;
    readonly limit?: number;
    readonly offset?: number;
    readonly orderBy?: "createdAt" | "updatedAt" | "validFrom";
    readonly orderDir?: "asc" | "desc";
    readonly nowMs?: number;
}
export interface DeleteMemoryOptions {
    readonly tombstone: boolean;
    readonly forgetterSurface: string;
    readonly reason?: string;
    readonly nowMs: number;
}
export interface MemoryVaultStore {
    readonly insertMemory: (record: MemoryRecord) => MemoryRecord;
    readonly updateMemory: (id: MemoryId, patch: MemoryUpdatePatch, nowMs: number) => MemoryRecord;
    readonly getMemory: (id: MemoryId) => MemoryRecord | undefined;
    readonly deleteMemory: (id: MemoryId, options: DeleteMemoryOptions) => void;
    readonly listMemories: (options?: ListMemoriesOptions) => readonly MemoryRecord[];
    readonly listMemoriesByScope: (scope: MemoryScope, options?: ListMemoriesOptions) => readonly MemoryRecord[];
    readonly insertEdge: (edge: MemoryEdge) => MemoryEdge;
    readonly listOutgoingEdges: (memoryId: MemoryId) => readonly MemoryEdge[];
    readonly listIncomingEdges: (memoryId: MemoryId) => readonly MemoryEdge[];
    readonly deleteEdge: (edgeId: MemoryEdgeId) => void;
    readonly upsertEmbedding: (memoryId: MemoryId, embedding: MemoryEmbeddingInput) => void;
    readonly getEmbedding: (memoryId: MemoryId) => MemoryEmbeddingRow | undefined;
    readonly listTombstonesByScope: (scope: MemoryScope) => readonly MemoryTombstone[];
    readonly recordAccess: (ids: readonly MemoryId[], nowMs: number) => void;
    readonly getAccessStats: (ids?: readonly MemoryId[]) => ReadonlyMap<MemoryId, MemoryAccessStat>;
    readonly close: () => void;
}
export interface MemoryVaultFactoryOptions {
    readonly memoryDir?: string;
    readonly env?: Readonly<Record<string, string | undefined>>;
    readonly now?: () => number;
    readonly newTombstoneId?: () => string;
    readonly redactString?: (input: string) => string;
    readonly onMemoryEvent?: (event: MemoryEvent) => void;
    readonly cipher?: MemoryContentCipher;
    readonly vaultKey?: Buffer;
}
//# sourceMappingURL=types.d.ts.map