/** * Trace → candidate recipe. Takes a successful ActionTrace and packages * it as a candidate `ActionRecipe` for the store. * * Preconditions / postconditions are inferred conservatively: * - precondition is `urlPattern` matching the *start* URL (escaped) * - postcondition is `urlPattern` matching the *end* URL (escaped), * when start ≠ end. Same URL means "in-place action" and we don't * over-constrain. * * Callers can pass `extraPreconditions` / `extraPostconditions` to * tighten — useful when you know "this only applies on the cart page * if the cart has ≥ 1 item". */ import type { ActionRecipe, ActionTrace, RecipePrecondition } from "./types.js"; export interface ExtractCandidateOptions { name: string; description: string; origin?: ActionRecipe["origin"]; requires?: string[]; /** Tightening preconditions added to the auto-inferred URL precondition. */ extraPreconditions?: RecipePrecondition[]; extraPostconditions?: RecipePrecondition[]; /** * If true (default), the URL of the starting page is used as a * `urlPattern` precondition. Set false when you want the recipe to * be URL-agnostic (e.g. global navbar interactions). */ inferUrlPreconditions?: boolean; } export declare function extractCandidate(trace: ActionTrace, options: ExtractCandidateOptions): ActionRecipe; //# sourceMappingURL=capture.d.ts.map