/** * Built-in goals. Each one is a persona × objective × success-check * trio you can hand to the AI driver without writing the boilerplate. * * Custom goals are just plain `Goal` literals — the factories below * exist for the common cases. */ import type { Goal, GoalContext } from "./types.js"; export interface CompletionGoalOptions { /** Free-form task description, fed to the AI as `objective`. */ task: string; /** * Returns true when the task is done. Polled between steps. * If you only have a URL signal, pass `successCheck: completionByUrl("/thanks")`. */ successCheck: (ctx: GoalContext) => Promise; budget?: Goal["budget"]; /** Override the default persona ("typical user"). */ persona?: string; } /** * "I'm a normal user, here's what I want to accomplish." Use this for * happy-path / smoke flows where deviating from the user goal is * itself a failure mode. */ export declare function completionGoal(opts: CompletionGoalOptions): Goal; export interface BugHuntingGoalOptions { /** Optional hint for what kind of bugs we care about. */ focus?: string; budget?: Goal["budget"]; /** * Custom success check — by default the goal is "found at least one * page error since starting". Override when you have a stricter * definition (e.g. "found an invariant violation"). */ successCheck?: (ctx: GoalContext) => Promise; } /** * "I'm an adversarial tester trying to break this." Pairs naturally * with `payloadDriver` / chaos `faultInjection` — the AI explores, * the driver injects edge inputs, the goal succeeds the moment an * error fires. */ export declare function bugHuntingGoal(opts?: BugHuntingGoalOptions): Goal; export interface CoverageGoalOptions { /** Stop once this many *distinct* selectors have been interacted with. */ targetSelectors?: number; budget?: Goal["budget"]; } /** * "I'm trying to exercise every interactive element." Use this when * you have invariants you want to validate across the whole UI and * you need an explorer that won't get stuck in one corner. */ export declare function coverageGoal(opts?: CoverageGoalOptions): Goal; /** * Convenience success-check: goal achieved when the page URL contains * the given substring. The most common shape. */ export declare function completionByUrl(needle: string): (ctx: GoalContext) => Promise; /** * Convenience success-check: goal achieved when a selector is visible. */ export declare function completionBySelector(selector: string): (ctx: GoalContext) => Promise; /** * Captured failure handed to `investigateGoal`. The richer the * context, the better the AI can reason about reproduction — * `errorMessages` and `notes` are surfaced directly inside the * persona's prompt. */ export interface FailureContext { /** Where the failure was observed (used as a navigation start point). */ url: string; /** Short tag used to name the produced regression recipe. */ signature: string; /** Console / page errors observed at the time. */ errorMessages?: string[]; /** Steps leading up to the failure, if known. Surfaced as objective context. */ preceding?: import("./types.js").RecipeStep[]; /** Free-form additional notes — e.g. "happened under api-500 chaos". */ notes?: string; } export interface InvestigateGoalOptions { budget?: Goal["budget"]; /** * Custom check. Defaults to "page URL matches the failure's pathname * AND ≥ 1 console error was observed since starting" — i.e. "we're * back at the broken page with a fresh error". */ reproducedCheck?: (ctx: GoalContext) => Promise; } /** * "I'm a forensic investigator handed a failure — reproduce it with * the smallest action sequence." The Goal's `objective` carries the * captured error messages + notes so the AI driver gets enough * context to start from the failure URL and re-trigger the same bug. */ export declare function investigateGoal(failure: FailureContext, opts?: InvestigateGoalOptions): Goal; /** * Built-in goals as a flat namespace, for ergonomic imports. */ export declare const goals: { completion: typeof completionGoal; bugHunting: typeof bugHuntingGoal; coverage: typeof coverageGoal; investigate: typeof investigateGoal; byUrl: typeof completionByUrl; bySelector: typeof completionBySelector; }; //# sourceMappingURL=goals.d.ts.map