import type { SessionManager } from "@caupulican/pi-agent-core/node"; import { type SessionSnapshotPayload } from "../session-snapshot.ts"; import { type GoalState } from "./goal-state.ts"; export declare const GOAL_STATE_CUSTOM_TYPE = "goal_state"; export type GoalStateSnapshotPayload = SessionSnapshotPayload<"state", GoalState>; /** * Persist one state transition. Canonical reducer transitions are journaled as a bounded event * batch; starts, replacements, and non-canonical imports use one checkpoint. This removes the old * recursive full-state-on-every-mutation growth while keeping compound owner transitions atomic. */ export declare function appendGoalStateSnapshot(sessionManager: Pick, state: GoalState, previous?: GoalState): string; export declare function appendGoalClearedSnapshot(sessionManager: Pick, state: GoalState, clearedAt: string): string; /** Legacy payload decode retained for imports and focused codec tests. */ export declare function decodeGoalStateSnapshotPayload(data: unknown): GoalState | undefined; interface GoalStateSource { getLatestCustomEntryOnBranch: SessionManager["getLatestCustomEntryOnBranch"]; } /** * Reconstruct the latest goal from one checkpoint plus linear event batches. Any malformed newest * goal journal fails closed instead of skipping backward to an older active state and resurrecting * work after corruption. */ export declare function getLatestGoalStateSnapshot(sessionManager: GoalStateSource): GoalState | undefined; /** Explicit legacy writer for migration tests only. */ export declare function appendLegacyGoalStateSnapshot(sessionManager: Pick, state: GoalState): string; export {}; //# sourceMappingURL=session-goal-state.d.ts.map