import { type ElicitRequestFormParams, type ElicitRequestParams, type ElicitRequestURLParams, type ElicitResult } from "@modelcontextprotocol/client"; export type FormValue = string | number | boolean | string[]; /** Host dialogs. `select` must close when its signal aborts. */ export interface ElicitationUI { select(title: string, choices: string[], signal: AbortSignal): Promise; editor(title: string, value: string): Promise; notify(message: string, type: "info" | "warning" | "error"): void; open(url: string): Promise; } interface Choice { value: string; label: string; } interface FieldBase { name: string; label: string; description: string; required: boolean; } export type Field = FieldBase & ({ type: "string"; minLength?: number; maxLength?: number; format?: string; default?: string; } | { type: "number" | "integer"; minimum?: number; maximum?: number; default?: number; } | { type: "boolean"; default?: boolean; } | { type: "choice"; options: Choice[]; default?: string; } | { type: "multi"; options: Choice[]; minItems?: number; maxItems?: number; default?: string[]; }); export declare const MAX_REQUIRED = 3; /** The SDK has validated the restricted schema; this maps it to editable fields. */ export declare function formFields(schema: ElicitRequestFormParams["requestedSchema"]): Field[]; /** Validate a value against its field; returns a user-facing problem or undefined. */ export declare function problem(field: Field, value: FormValue): string | undefined; /** HTTPS, or HTTP on loopback, without embedded credentials. The opened URL is the displayed URL. */ export declare function safeUrl(value: string): { href: string; host: string; notes: string[]; } | undefined; /** Present one server request. Returned results never include unrequested fields. */ export declare function elicit(ui: ElicitationUI, server: string, params: ElicitRequestParams, signal: AbortSignal): Promise; /** Manual controls for a required browser step; closes early on the server's completion notice. */ export declare function awaitCompletion(ui: ElicitationUI, server: string, completed: AbortSignal, signal: AbortSignal): Promise; /** Validated URL elicitations from a -32042 error, or undefined for other errors or unusable data. */ export declare function requiredElicitations(error: unknown): ElicitRequestURLParams[] | undefined; export {};