/**
 * RandomPort — dual-API random number source for deterministic replay.
 *
 * CH4 DUAL API DESIGN:
 *   Two distinct APIs with different guarantees — never conflate them:
 *
 *   Deterministic (replay-safe, NON SECURITY-GRADE):
 *     next()   — float in [0, 1) via xorshift32 seeded PRNG
 *     uuid()   — deterministic v4-like UUID from xorshift32 (NOT crypto-strong)
 *
 *   Crypto-strong (NON REPLAY-SAFE by design — security trumps audit):
 *     crypto(bytes)  — random bytes via globalThis.crypto.getRandomValues
 *     cryptoUuid()   — crypto-strong UUID via globalThis.crypto.randomUUID
 *
 * Use next()/uuid() for application logic that needs to be replayable.
 * Use crypto()/cryptoUuid() for security-critical values (tokens, nonces, keys)
 * that MUST NOT be replayable.
 *
 * During replay, calling crypto()/cryptoUuid() on RecordedRandom in strict mode
 * throws CryptoRandomDuringReplayError to surface the violation at the boundary.
 *
 * @module replay/random
 */
/**
 * Abstract random source with a dual API:
 * - Deterministic arm (next/uuid): seedable, replay-safe, NON SECURITY-GRADE.
 * - Crypto arm (crypto/cryptoUuid): crypto-strong, NON REPLAY-SAFE by design.
 */
export interface RandomPort {
    /**
     * Returns a float in [0, 1) via the deterministic PRNG.
     * NON SECURITY-GRADE — use for application logic only.
     */
    next(): number;
    /**
     * Returns a deterministic v4-like UUID from the seeded PRNG.
     * Format: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx
     * NON SECURITY-GRADE — use for replayable correlation IDs only.
     */
    uuid(): string;
    /**
     * Returns `bytes` cryptographically random bytes via globalThis.crypto.
     * NON REPLAY-SAFE by design — security trumps audit.
     */
    crypto(bytes: number): Promise<Uint8Array>;
    /**
     * Returns a cryptographically strong UUID via globalThis.crypto.randomUUID.
     * NON REPLAY-SAFE by design.
     */
    cryptoUuid(): string;
}
/**
 * Thrown by RecordedRandom in 'strict' mode when crypto()/cryptoUuid() is called.
 * Signals that the agent called a non-replayable code path during replay —
 * a violation of the deterministic replay contract.
 */
export declare class CryptoRandomDuringReplayError extends Error {
    constructor();
}
/**
 * Production implementation:
 * - next()/uuid(): xorshift32 seeded PRNG (deterministic if seed is fixed).
 * - crypto()/cryptoUuid(): globalThis.crypto (non-deterministic, crypto-strong).
 *
 * Pass a fixed seed to make next()/uuid() deterministic across runs.
 * Default seed: Date.now() XOR a random 32-bit value (non-deterministic).
 */
export declare class RealRandom implements RandomPort {
    private readonly state;
    constructor(seed?: number);
    next(): number;
    uuid(): string;
    crypto(bytes: number): Promise<Uint8Array>;
    cryptoUuid(): string;
}
/**
 * Replay implementation: replays recorded next()/uuid() sequences.
 *
 * - next(): returns the next value from recordedNext (throws RangeError when exhausted).
 * - uuid(): returns the next value from recordedUuids (throws RangeError when exhausted).
 * - crypto(): throws CryptoRandomDuringReplayError in 'strict' mode;
 *             returns fresh crypto bytes in 'tolerant' mode.
 * - cryptoUuid(): throws CryptoRandomDuringReplayError in 'strict' mode;
 *                 returns fresh crypto UUID in 'tolerant' mode.
 */
export declare class RecordedRandom implements RandomPort {
    private readonly recordedNext;
    private readonly recordedUuids;
    private readonly mode;
    private nextCursor;
    private uuidCursor;
    constructor(recordedNext: readonly number[], recordedUuids: readonly string[], mode?: "strict" | "tolerant");
    next(): number;
    uuid(): string;
    crypto(bytes: number): Promise<Uint8Array>;
    cryptoUuid(): string;
    /**
     * Returns a new RecordedRandom that shares the same underlying recorded arrays
     * and starts at the CURRENT cursor positions (nextCursor + uuidCursor). Each
     * clone maintains its own independent cursors — arrays are shared (read-only).
     *
     * Use for cross-cycle propagation: child cycle picks up exactly where the
     * parent left off in both the next() and uuid() sequences.
     *
     * Clone invariant: clone.next() returns the same value as `this.next()` would
     * at the moment clone() is called.
     */
    clone(): RecordedRandom;
    /** Returns current nextCursor (number of next() values consumed). */
    getNextCursor(): number;
    /** Returns current uuidCursor (number of uuid() values consumed). */
    getUuidCursor(): number;
}
//# sourceMappingURL=random.d.ts.map