import type { MemoryHistorySnapshot } from "./memory.js"; import { computeMemorySnapshotDiff } from "./memory-diff.js"; import { type SnapshotResolution } from "./snapshot-selector-resolver.js"; export interface StructuredMemorySnapshot { entryId: string; shortId: string; parentId: string | null; recordedAt: string; items: MemoryHistorySnapshot["items"]; itemCount: number; isCurrent: boolean; } export interface StructuredResolvedSnapshotSelector { input: string; matchedInput: string; resolvedId: string; } export interface StructuredSnapshotSelectorCandidate { entryId: string; shortId: string; } export interface StructuredSnapshotSelectorIssue { label: "baseline" | "target"; input: string; matchedInput: string; error: NonNullable; candidates: StructuredSnapshotSelectorCandidate[]; } export interface StructuredMemoryHistoryData { branchScope: "current"; historyModel: "snapshot"; snapshots: StructuredMemorySnapshot[]; } export interface StructuredMemoryCompareEmptyHistoryData { branchScope: "current"; historyModel: "snapshot"; status: "empty_history"; snapshotCount: 0; } export interface StructuredMemoryCompareInitialSnapshotData { branchScope: "current"; historyModel: "snapshot"; status: "initial_snapshot"; compareMode: "adjacent"; target: StructuredMemorySnapshot; diff: ReturnType; } export interface StructuredMemoryCompareSelectorResolutionFailedData { branchScope: "current"; historyModel: "snapshot"; status: "selector_resolution_failed"; compareMode: "explicit"; snapshotCount: number; issues: StructuredSnapshotSelectorIssue[]; } export interface StructuredMemoryCompareOkData { branchScope: "current"; historyModel: "snapshot"; status: "ok"; compareMode: "adjacent" | "explicit"; baseline: StructuredMemorySnapshot; target: StructuredMemorySnapshot; diff: ReturnType; sameSnapshot: boolean; selectors?: { baseline: StructuredResolvedSnapshotSelector; target: StructuredResolvedSnapshotSelector; }; } export type StructuredMemoryCompareData = StructuredMemoryCompareEmptyHistoryData | StructuredMemoryCompareInitialSnapshotData | StructuredMemoryCompareSelectorResolutionFailedData | StructuredMemoryCompareOkData; export interface MemorySnapshotContractContext { getMemoryHistory(): readonly MemoryHistorySnapshot[]; resolveMemorySnapshotSelector(input: string): SnapshotResolution; } export declare function buildStructuredMemoryHistoryData(context: Pick): StructuredMemoryHistoryData; export declare function buildStructuredMemoryCompareData(context: MemorySnapshotContractContext, selectors?: { baseline: string; target: string; }): StructuredMemoryCompareData; //# sourceMappingURL=memory-snapshot-contract.d.ts.map