/**
 * world-state-hash — definitive loop detection via state-hash collisions.
 *
 * Distinct from `createCoherenceDetector` (heuristic, window-based): when
 * the SAME (tool_name, canonicalised_args, canonicalised_output) tuple
 * appears twice in one session, the agent is definitively cycling through
 * the same world state. Exit immediately with stopReason="loop_definitive".
 *
 * Hash is computed on a CANONICAL form of the output (not raw) so that
 * spurious noise (timestamps, random IDs, ANSI codes) does not produce a
 * false negative. Structurally identical operations produce the same hash.
 *
 * Reference: "Dynamics of Agentic Loops" (arXiv:2512.10350) — oscillatory
 * regime detection via discrete state-space transitions. O(1) lookup, no
 * model cost, no embedding required.
 */
export declare function isReadOnlyTool(toolName: string, args: unknown): boolean;
/**
 * Stateful tracker for world-state hashes within a single agent session.
 * Construct fresh per session; never share across sessions.
 *
 * A collision is only flagged as loop_definitive when the same (tool, args,
 * output) hash repeats within minRepeatDistance steps — preventing false
 * positives from legitimate "do lots of work, then re-read the same file"
 * exploration patterns. Genuine loops (same call 2–3 steps later) are still
 * caught immediately.
 */
export declare class WorldStateHashTracker {
    /** Map from hash → first observed step index. */
    private readonly seen;
    /** Optional reverse map for debug/telemetry (hash → {step, tool}). */
    private readonly history;
    /**
     * Record a tool call + result and return whether this exact world state
     * has been seen before in the current session.
     *
     * @param toolName name of the tool invoked
     * @param args canonical args (will be sorted-key JSON-stringified)
     * @param outputSummary first ~200 chars of the tool result (raw)
     * @param stepIndex current step in the loop (for telemetry)
     * @returns object describing whether collision occurred and the hash
     */
    observe(toolName: string, args: unknown, outputSummary: string, stepIndex: number): {
        isCollision: boolean;
        hash: string;
        previousStep?: number;
    };
    /** Number of distinct world states observed. */
    get size(): number;
    /** For telemetry: last N entries with their step/tool/hash. */
    recent(n?: number): ReadonlyArray<{
        step: number;
        tool: string;
        hash: string;
    }>;
}
/**
 * Compute a deterministic hash of (toolName, args, outputSummary).
 *
 * Args are JSON-stringified with sorted keys (stable across runs).
 * Output is normalized: trimmed, lowercased, stripped of ISO timestamps,
 * UUIDs, and ANSI escapes — these are noise that should not differentiate
 * structurally identical operations.
 *
 * Returns the first 32 hex chars of SHA-256 (128-bit; collision probability
 * negligible within a single session).
 */
export declare function canonicalStateHash(toolName: string, args: unknown, outputSummary: string): string;
//# sourceMappingURL=world-state-hash.d.ts.map