export type StopConditionPrimitive = string | number | boolean | null; export interface StopWhenAppStatePathEquals { path: string; equals: StopConditionPrimitive; } export interface StopWhenRule { id?: string; urlIncludes?: string; urlPathEquals?: string; textIncludes?: string; appStatePathEquals?: StopWhenAppStatePathEquals; } export interface StopWhen { any: StopWhenRule[]; } /** * A declared observation window (#510): once `when` matches (or at the start, when `when` is * absent), the harness holds the page for `ms`, captures a frame every `everyMs`, takes no action * and requests no model turn, then hands control back to the participant (`then: continue`) or * ends the session (`then: stop`). Bounded by the session budget: a window that would outlast it * is cut to fit. The study is observing; the participant is not "waiting". */ export interface DwellWindow { when?: StopWhen; ms: number; everyMs: number; then: "continue" | "stop"; } export interface StopConditionObservation { url?: string; text?: string; appState?: Record; } export interface StopConditionMatch { id: string; ruleIndex: number; kinds: string[]; } export declare function evaluateStopWhen(stopWhen: StopWhen | undefined, observation: StopConditionObservation): StopConditionMatch | undefined;