import type { EnvVarInput } from "@stigmer/sdk";
/**
 * Describes a single environment variable the form should collect.
 *
 * Typically derived from a resource's `env` entries (Agent,
 * McpServer, or any resource that declares required environment
 * variables). The caller is responsible for filtering out variables
 * the user has already provided (i.e. only pass the *missing* ones).
 */
export interface EnvVarFormVariable {
    /** Environment variable key (e.g. `GITHUB_TOKEN`). Used as label. */
    readonly key: string;
    /** When true, the input renders as a password field with a visibility toggle. */
    readonly isSecret: boolean;
    /** Help text shown below the input. From the resource's env declaration description. */
    readonly description?: string;
    /**
     * When true, this variable is not required for the resource to function.
     * Callers can use this to filter optional vars out of forms or to show
     * them separately from required vars.
     */
    readonly optional?: boolean;
}
/** Options reported by the form alongside the collected values on submit. */
export interface EnvVarFormSubmitOptions {
    /** Whether the user chose to save these values for future runs. */
    readonly saveForFuture: boolean;
}
/** Props for {@link EnvVarForm}. */
export interface EnvVarFormProps {
    /**
     * Variables to collect. Each entry renders one input field, in order.
     * Must contain at least one variable.
     */
    readonly variables: EnvVarFormVariable[];
    /**
     * Called with the collected values and the save toggle state when
     * the user submits the form.
     */
    readonly onSubmit: (values: Record<string, EnvVarInput>, options: EnvVarFormSubmitOptions) => void;
    /** Called when the user clicks the cancel/back button. */
    readonly onCancel?: () => void;
    /** When true, the submit button shows a spinner and inputs are disabled. */
    readonly isSubmitting?: boolean;
    /** When `true`, all inputs and buttons are disabled. */
    readonly disabled?: boolean;
    /**
     * Optional heading rendered above the fields. When omitted, no
     * header section is rendered — useful when the form is embedded
     * inside a panel that provides its own header.
     */
    readonly title?: string;
    /**
     * Subtitle shown below the title. Only rendered when `title` is
     * also provided.
     */
    readonly description?: string;
    /**
     * Overrides the default submit button label. When omitted, the
     * button dynamically shows `"Save"` or `"Use once"` based on the
     * save-for-future toggle state.
     */
    readonly submitLabel?: string;
    /**
     * Overrides the default cancel button label (`"Back"`).
     */
    readonly cancelLabel?: string;
    /**
     * Initial state of the "Save for future runs" toggle.
     * Platform builders can override this to match their default
     * secret-persistence policy.
     * @default true
     */
    readonly defaultSaveForFuture?: boolean;
    /**
     * When `true`, the save toggle is hidden and the form always uses
     * `defaultSaveForFuture` as the submit value. Useful for platform
     * builders who want to enforce a single persistence policy.
     * @default false
     */
    readonly hideSaveToggle?: boolean;
    /**
     * Pre-fill values from the session env pool.
     *
     * When provided, fields whose keys are in this record are
     * pre-populated with the pool's value. A subtle indicator shows
     * that the value was provided by another source in the session.
     *
     * Platform builders who use `useSessionEnvPool` can pass
     * `pool.getAvailableValue` to look up pre-fill values.
     */
    readonly poolValues?: (key: string) => EnvVarInput | undefined;
    /** Additional CSS class names for the root container. */
    readonly className?: string;
    /**
     * Overrides the `aria-label` on the `<form>` element. When omitted,
     * falls back to `"Configure {title}"` if a title is provided, or
     * `"Configure environment variables"` as a generic fallback.
     */
    readonly ariaLabel?: string;
}
/**
 * Compact form that collects environment variable values for any
 * resource that declares `env` variables (Agents, MCP servers, etc.).
 *
 * Renders one labeled input per variable. Secret variables use a
 * password field with a visibility toggle. The form validates that
 * all fields are non-empty before allowing submission.
 *
 * A "Save for future runs" toggle (on by default) lets the user
 * choose between persisting secrets to their personal environment
 * or using them for a single execution only. The toggle state is
 * reported via `onSubmit` so the caller can route to the
 * appropriate codepath.
 *
 * This is a **pure presentational component** with no knowledge of
 * personal environments, resource instances, or orchestration. It
 * can be used standalone by platform builders for their own env
 * setup UIs, or composed by higher-level hooks like
 * {@link useAgentSetup} or `useMcpServerSetup` within the
 * {@link SessionComposer}.
 *
 * All visual properties flow through `--stgm-*` design tokens.
 *
 * @example
 * ```tsx
 * <EnvVarForm
 *   title="GitHub MCP Server"
 *   description="Enter required credentials."
 *   variables={[
 *     { key: "GITHUB_TOKEN", isSecret: true, description: "Personal access token" },
 *     { key: "REPO_OWNER", isSecret: false },
 *   ]}
 *   onSubmit={(values, { saveForFuture }) => {
 *     if (saveForFuture) saveToEnvironment(values);
 *     else useAsRuntimeEnv(values);
 *   }}
 *   onCancel={() => console.log("cancelled")}
 * />
 * ```
 */
export declare function EnvVarForm({ variables, onSubmit, onCancel, isSubmitting, disabled, title, description, submitLabel, cancelLabel, defaultSaveForFuture, hideSaveToggle, poolValues, className, ariaLabel, }: EnvVarFormProps): import("react/jsx-runtime").JSX.Element;
//# sourceMappingURL=EnvVarForm.d.ts.map