/**
 * PromiseProgressTracker — Goal-proximity signal for agent loops.
 *
 * Implements the Promise/Progress distinction from AgentPRM (arXiv:2511.08325):
 *   - Promise  = long-term proximity to goal (cosine similarity to goal embedding)
 *   - Progress = immediate step-over-step improvement (delta of promise values)
 *
 * The tracker embeds the goal text lazily (on first `observe` call) to keep
 * the constructor synchronous. Plateau detection flags runs that appear stuck
 * near the goal without converging.
 */
import type { EmbedFn } from "./semantic-coherence.js";
export type { EmbedFn };
export interface PromiseProgressConfig {
    /**
     * Plateau detection: if |delta| < this over `plateauWindow` consecutive steps,
     * the run is flagged as stalled.
     * Default: 0.02
     */
    plateauEpsilon?: number;
    /**
     * Number of steps to consider for plateau detection.
     * Default: 5
     */
    plateauWindow?: number;
}
export interface PromiseProgressSnapshot {
    /** Latest observed similarity to goal (0–1). */
    promise: number;
    /** Step-over-step delta. Positive = moving toward goal. */
    progress: number;
    /**
     * True when the last `plateauWindow` deltas are all in [-epsilon, +epsilon].
     * Requires at least `plateauWindow` observations.
     */
    isPlateau: boolean;
    /** Number of observations recorded so far. */
    observations: number;
}
export declare class PromiseProgressTracker {
    private readonly embedFn;
    private readonly epsilon;
    private readonly windowSize;
    private goalText;
    /** Resolved lazily on first observe(). */
    private goalEmbedding;
    /** All observed promise values (cosine to goal). */
    private promiseHistory;
    /**
     * Sliding deque of the last `windowSize` progress deltas.
     * Oldest at index 0; newest appended at the end.
     */
    private deltaWindow;
    constructor(goal: string, embedFn: EmbedFn, config?: PromiseProgressConfig);
    /**
     * Embed `output`, compute cosine similarity to the goal, update internal
     * state, and return a snapshot.
     *
     * First call triggers lazy embedding of the goal text.
     */
    observe(output: string): Promise<PromiseProgressSnapshot>;
    /** Return the latest snapshot without recording a new observation. */
    snapshot(): PromiseProgressSnapshot;
    /**
     * Re-baseline the tracker with a new goal (e.g. after a re-plan).
     * If `newGoal` is omitted the existing goal text is re-embedded (rare, but
     * useful after the embedding model changes).
     */
    reset(newGoal?: string): Promise<void>;
    private _buildSnapshot;
    /**
     * Plateau = last `windowSize` deltas all satisfy |delta| < epsilon.
     * Requires a full window before declaring stall.
     */
    private _detectPlateau;
}
//# sourceMappingURL=promise-progress.d.ts.map