import { type AppId } from "@vendoai/core"; import { type AppDocument } from "../../contract/index.js"; import type { EngineOps } from "./engine.js"; import type { VersionEntry } from "../runtime/runtime.js"; export interface AppHistoryAccess { /** Returns the appended version's id, so a caller whose write then fails can * `discard` it โ€” a version recording a state that never became the past is a * lie in the trail. */ append(appId: AppId, doc: AppDocument, entry: VersionEntry): Promise; documents(appId: AppId): Promise; discard(appId: AppId, versionId: string): Promise; /** * Trims the version log to the cap. Called by a caller whose write has * LANDED โ€” never by `append` itself: an append whose write is then refused * `discard`s its own version, and a prune inside the append would already * have deleted the oldest REAL version to make room for it. Fifty refused * saves would have erased the whole recorded history of an app that never * changed once. */ prune(appId: AppId): Promise; clear(appId: AppId): Promise; surface(appId: AppId): { list(): Promise; }; } /** 06-apps ยง1 โ€” persisted capped history, kept outside the app artifact. */ export declare const createAppHistory: (engine: EngineOps) => AppHistoryAccess; //# sourceMappingURL=history.d.ts.map