import type { Scenario, Result } from "../types/index.js";
/**
 * Extract data from a scenario's result that can be used as input
 * for chained scenarios. This captures URLs, text content, form values,
 * or any data the scenario produced.
 */
export interface ChainOutput {
    /** The scenario that produced this output */
    scenarioId: string;
    scenarioName: string;
    /** Extracted data key-value pairs */
    data: Record<string, string>;
    /** URL the scenario ended on */
    finalUrl?: string;
    /** Whether the scenario passed (only passed scenarios produce valid output) */
    passed: boolean;
}
/**
 * Chain configuration: links one scenario's output to another's input.
 */
export interface ChainLink {
    /** The source scenario ID whose output will be used */
    sourceId: string;
    /** The target scenario ID that will receive the input */
    targetId: string;
    /** Mapping: { targetParam: sourceDataKey } */
    mapping: Record<string, string>;
}
/**
 * Extract chainable output from a scenario result.
 * Uses reasoning text, final URL, and result data as output sources.
 */
export declare function extractChainOutput(result: Result, scenarioName: string): ChainOutput;
/**
 * Build a parameterized scenario by merging chain output into
 * the target scenario's steps and parameters.
 */
export declare function applyChainOutput(scenario: Scenario, chainData: Record<string, string>): Scenario;
/**
 * Resolve a chain of scenarios, applying outputs from each passed
 * scenario to its downstream dependents.
 * Returns the ordered list of scenarios with chain data applied.
 */
export declare function resolveChain(scenarios: Scenario[], results: Result[], links: ChainLink[]): {
    scenario: Scenario;
    sourceOutput?: ChainOutput;
}[];
/**
 * Check if a scenario has chain dependencies.
 */
export declare function hasChainDependency(scenario: Scenario): boolean;
//# sourceMappingURL=scenario-chain.d.ts.map