import type { HybridTimestamp, TemporalBound, TemporalRights, TemporalOrdering, TemporalValidation, SessionBoundary } from '../types/time.js'; /** Default NTP drift bound in milliseconds. Conservative estimate. */ export declare const DEFAULT_NTP_DRIFT_MS = 50; /** Default wall-clock gap threshold for session boundary extraction. * Five minutes. Reference: Nanook PDR v2.19 §7.6.3 attributes * "HLC gap as session boundary" to APS as a deployable pattern; * five minutes is the round number that survives both natural * conversation pauses and brief network glitches without * fragmenting a single session. Override per deployment for * shorter (high-frequency probing) or longer (batch jobs) cadences. */ export declare const DEFAULT_SESSION_GAP_MS = 300000; /** Create a hybrid timestamp. Gateway-issued — captures both * causal ordering and wall-clock uncertainty. * * When `logicalTime` is provided the call is fully pure. When omitted, * the SDK module counter is incremented for backward compatibility. */ export declare function createHybridTimestamp(gatewayId: string, driftMs?: number, logicalTime?: number): HybridTimestamp; /** Pure stateless variant. Caller supplies the logical time explicitly, * letting it manage its own counter (per-gateway, per-process, or * per-tenant). The SDK module counter is not touched. */ export declare function createHybridTimestampAt(gatewayId: string, logicalTime: number, driftMs?: number): HybridTimestamp; /** Create a temporal bound: hybrid timestamp + hard TTL. */ export declare function createTemporalBound(gatewayId: string, ttlMs: number, driftMs?: number): TemporalBound; /** Compare two hybrid timestamps. Returns the ordering relationship. * Conservative: uses wall clock bounds for definite ordering, * falls back to logical time for same-gateway concurrent events. */ export declare function compareTimestamps(a: HybridTimestamp, b: HybridTimestamp): TemporalOrdering; /** Check if a temporal bound has expired (conservative: earliest > expiresAt). */ export declare function isTemporalBoundExpired(bound: TemporalBound, nowEarliest?: number): boolean; /** Validate a TemporalRights object against the current time. * Returns a full validation result with status for each temporal aspect. */ export declare function validateTemporalRights(rights: TemporalRights, now?: Date): TemporalValidation; /** Reset the logical counter (for testing only). */ export declare function resetLogicalCounter(): void; /** Extract session boundaries from a time-ordered sequence of hybrid * timestamps by detecting wall-clock gaps that exceed a threshold. * * The input array MUST be in chronological order. The function does not * sort it because sorting HLC stamps across gateways is ambiguous; the * caller is the one with enough context to order them. * * Gap semantics: the wall-clock gap between two consecutive stamps is * computed conservatively as * gap = next.wallClockEarliest - current.wallClockLatest * which means stamps with overlapping wall-clock ranges produce a * negative gap and are never treated as a session boundary, even when * their logical-time ordering differs. A boundary fires when * gap > opts.gapThresholdMs * strictly. A gap exactly equal to the threshold keeps both stamps in * the same session. * * Edge cases: * - Empty input: returns an empty array. * - Single stamp: returns one session with start === end === that stamp, * eventCount = 1, gapFromPreviousMs = 0. * - All stamps within threshold: one session covering the full range. * - All stamps spaced beyond threshold: N sessions, eventCount = 1 each. * * Reference: Nanook PDR v2.19 §7.6.3, gap audit §3 row 14 / row 29 / §5 rank 5. * * @param stamps Chronologically ordered HybridTimestamp sequence. * @param opts.gapThresholdMs Threshold in ms (default DEFAULT_SESSION_GAP_MS). * @returns Array of SessionBoundary in input order, one per detected session. */ export declare function extractSessions(stamps: HybridTimestamp[], opts?: { gapThresholdMs?: number; }): SessionBoundary[]; //# sourceMappingURL=time.d.ts.map