export declare const DURABLE_LEARNING_MEMORY_POLICY_VERSION = "1"; export declare const DURABLE_LEARNING_STATE_MAX_HISTORY = 32; export declare const DURABLE_LEARNING_STATE_MAX_BYTES: number; export declare const DURABLE_LEARNING_CLAIM_LEASE_MS: number; export interface DurableLearningVersions { runtimeVersion: string; memoryPolicyVersion: string; } export type DurableLearningTransitionReason = "first-observation" | "runtime-change" | "memory-policy-change" | "runtime-and-policy-change" | "recovered-corrupt-state"; export interface DurableLearningReviewMetadata { reason: DurableLearningTransitionReason; previousRuntimeVersion: string | null; runtimeVersion: string; previousMemoryPolicyVersion: string | null; memoryPolicyVersion: string; } export interface DurableLearningClaimToken { transitionId: string; claimId: string; ownerId: string; runtimeVersion: string; memoryPolicyVersion: string; } export type DurableLearningCueAttachOutcome = "attached" | "coalesced" | "replaced-stale" | "disabled" | "failed"; export type DurableLearningStateWarningCode = "recovered-corrupt-state" | "unsupported-schema" | "unknown-keys" | "oversize-state" | "state-unavailable"; export type DurableLearningReconcileStatus = DurableLearningCueAttachOutcome | "busy" | "unchanged" | "unsupported" | "invalid-version" | "invalid-owner" | "unavailable"; export interface DurableLearningReconcileResult { status: DurableLearningReconcileStatus; warningCode?: DurableLearningStateWarningCode; } export interface DurableLearningStateSnapshot { schemaVersion: 1; revision: number; observedRuntimeVersion: string; observedMemoryPolicyVersion: string; currentTransitionId: string | null; currentClaimOwnerId: string | null; resolvedTransitions: number; } interface DurableLearningStateOptions { now?: () => Date; randomId?: () => string; leaseMs?: number; withLock?: (filePath: string, fn: () => T) => T; writeState?: (filePath: string, contents: string) => void; } export declare function isDurableLearningClaimToken(value: unknown): value is DurableLearningClaimToken; export declare function isDurableLearningReviewMetadata(value: unknown): value is DurableLearningReviewMetadata; export declare class DurableLearningState { private readonly filePath; private readonly now; private readonly randomId; private readonly leaseMs; private readonly withLock; private readonly writeState; constructor(filePath: string, options?: DurableLearningStateOptions); static forAgentDir(agentDir: string, options?: DurableLearningStateOptions): DurableLearningState; private currentDate; private nextId; private load; private save; private newClaim; private newTransition; private resolveCurrent; private initialState; private changedReason; reconcileClaimAndAttach(versions: DurableLearningVersions, ownerId: string, attachCue: (token: DurableLearningClaimToken, metadata: DurableLearningReviewMetadata) => DurableLearningCueAttachOutcome): DurableLearningReconcileResult; private mutateExactClaim; renewClaim(token: DurableLearningClaimToken): boolean; releaseClaim(token: DurableLearningClaimToken): boolean; completeReview(token: DurableLearningClaimToken): boolean; readSnapshot(): DurableLearningStateSnapshot | undefined; private validToken; } export {}; //# sourceMappingURL=durable-learning-state.d.ts.map