import { XPEvent } from '../events'; import { Condition, FlagValue, Scenario } from './types'; /** World state a condition is evaluated against. */ export interface EvalContext { /** Current scenario flags. */ flags: Record; /** The event that triggered this evaluation (for `event` payload matching). */ event?: XPEvent; /** Bounded, persisted event history (for `happened` / `count`). */ journal: XPEvent[]; /** Filesystem predicates. */ fs: { exists: (path: string[]) => boolean; unlocked: (path: string[]) => boolean; content: (path: string[]) => string | null; }; /** App-settings reader (#142). Returns undefined when no store exists. */ appSettings?: { get: (appId: string, key: string) => string | number | boolean | undefined; }; } /** Whether a trigger's `on` (a type or list of types) includes `eventType`. */ export declare const matchOn: (on: string | string[], eventType: string) => boolean; /** Evaluate a condition tree against the world state. Absent condition = true. */ export declare const evaluateCondition: (condition: Condition | undefined, ctx: EvalContext) => boolean; /** * Collect every filesystem path a scenario reads via a `contentContains` * predicate (#241). The runtime uses this to eagerly resolve those files' * `contentRef` bodies up front, so `contentContains` can match referenced * content while the condition evaluator stays synchronous. */ export declare const collectContentContainsPaths: (scenario: Scenario) => string[][]; /** Whether any `search:query` in the journal contains `term` (case-insensitive substring). */ export declare const wasSearched: (journal: XPEvent[], term: string) => boolean; /** Whether any `search:query` surfaced the result `resultId` (present in its `resultIds`). */ export declare const wasFound: (journal: XPEvent[], resultId: string) => boolean; /** Board state is derived from the journal: an item is pinned when its `evidence:pin`s outnumber its `evidence:unpin`s. */ export declare const isPinned: (journal: XPEvent[], itemId: string) => boolean; /** Whether an `evidence:link` between `a` and `b` (either direction) is in the journal. */ export declare const hasLink: (journal: XPEvent[], a: string, b: string) => boolean; /** Append an event to a bounded journal (newest last), capping total length. */ export declare const appendJournal: (journal: XPEvent[], event: XPEvent, cap?: number) => XPEvent[];