import type { Screen } from "./screen-ext.js";
import { StitchError } from "./spec/errors.js";
/**
 * Result container for generative operations (generate / edit /
 * variants / apply) [V1_PLAN §3.1, amended].
 *
 * Stitch returns MANY screens per generation (across multiple output
 * components). Projecting a single screen out of that response silently
 * dropped the rest — the original 1.0-blocking bug. A Generation always
 * carries ALL screens plus the raw response, so future response
 * enrichment (progress updates, feedback) is additive, not breaking.
 *
 * Polymorphic compatibility (0.4.0 Non-Breaking Bridge):
 * Generation extends Screen conceptually and proxies all Screen properties
 * to `this.first`. This ensures `Promise<Generation<Screen>>` is assignable
 * to `Promise<Screen>` for existing 0.x code, while exposing `.screens`
 * and iteration for multi-screen code.
 */
export interface Generation<TItem = Screen, TRaw = unknown> extends Screen, Iterable<TItem> {
}
export declare class Generation<TItem = Screen, TRaw = unknown> {
    /** Every screen produced by the operation, across all output components. */
    readonly screens: readonly TItem[];
    /** The full tool response (typed), incl. fields the SDK doesn't model. */
    readonly raw: TRaw;
    constructor(
    /** Every screen produced by the operation, across all output components. */
    screens: readonly TItem[], 
    /** The full tool response (typed), incl. fields the SDK doesn't model. */
    raw: TRaw);
    /**
     * The first screen of the response. Generated methods guarantee a
     * non-empty Generation (an empty response throws at the call site),
     * so this is always present.
     */
    get first(): TItem;
    /** Number of screens produced. */
    get length(): number;
    [Symbol.iterator](): Iterator<TItem>;
}
/**
 * The error a generated method throws when a generative tool returns no
 * screens, so that `Generation` stays non-empty.
 *
 * Stitch's agent can answer with a question instead of a design: the
 * response then carries `outputComponents[].text` (the question) and
 * `outputComponents[].suggestion` (proposed replies) but no
 * `design.screens`. That is a conversational turn, not a broken response,
 * so it surfaces as a recoverable `CLARIFICATION_REQUIRED` with the
 * question attached. A response with neither screens nor text is still an
 * incomplete response (`UNKNOWN_ERROR`).
 */
export declare function emptyGenerationError(toolName: string, raw: unknown): StitchError;
//# sourceMappingURL=generation.d.ts.map