import type { InteractionResult } from '@genesislcap/foundation-ai';
import type { InteractionContext } from './interaction-context';
/**
 * The two mutually-exclusive states an interaction widget is ever in (GENC-1390).
 * Modelling them as a discriminated union makes illegal combinations
 * unrepresentable — a resolved widget cannot carry a live `interactionContext` or
 * a `shouldAutoFocus`, and a pending widget cannot be read for a `result`.
 *
 * The host sets the widget's `interaction` on mount and REPLACES it (pending →
 * resolved) on completion.
 *
 * @beta
 */
export type AiChatInteraction<TData = unknown, TResult = unknown> = {
    status: 'pending';
    /** Immutable inputs for the interaction. */
    data: TData;
    /**
     * Grab focus on mount? Meaningful ONLY while pending — a resolved widget is a
     * history re-render and must never steal focus.
     */
    shouldAutoFocus: boolean;
    /**
     * Live, remount-surviving scratch for this interaction. Present ONLY while
     * pending — the host disposes it on resolve. See {@link InteractionContext}.
     */
    interactionContext: InteractionContext;
} | {
    status: 'resolved';
    /** Same inputs — the resolved view still reads them. */
    data: TData;
    /** The interaction outcome. */
    result: InteractionResult<TResult>;
};
/**
 * Interface that AI inline interaction components implement. The
 * `AiChatInteractionWrapper` sets `interactionId` and `interaction` on the
 * rendered element on every (re)mount, and replaces `interaction` (pending →
 * resolved) when the interaction completes.
 *
 * @remarks
 * GENC-1390 replaced the previous flat `data` / `resolved` / `shouldAutoFocus`
 * surface with the discriminated {@link AiChatInteraction}. This is a breaking
 * change on this `@beta` interface — widgets read `this.interaction` (narrowing on
 * `status`) instead of the removed flat fields.
 *
 * @beta
 */
export interface AiChatWidget<TData = unknown, TResult = unknown> {
    /** Stable per-interaction UUID; constant across remounts, present in both states. */
    interactionId: string;
    /** The current interaction state (pending or resolved). */
    interaction: AiChatInteraction<TData, TResult>;
}
//# sourceMappingURL=ai-chat-widget.d.ts.map