/** * Elicitation Helper for User Input via MCP Dialogs * * Provides utilities to show UI dialogs (via MCP elicitation) to collect * sensitive information from users without exposing it in chat. */ export interface ElicitationServer { elicitInput(params: { message: string; requestedSchema: { type: 'object'; properties: Record; required?: string[]; }; }): Promise<{ action: 'accept' | 'decline' | 'cancel'; content?: Record; }>; } /** * Collect a single credential value from user via elicitation dialog * * Shows UI dialog asking user to copy value to clipboard, then reads it server-side. * Secrets never appear in chat! * * @param server MCP server instance with elicitInput capability * @param credentialName Human-readable name (e.g., "GitHub Token", "API Key") * @param envVarName Environment variable name (e.g., "GITHUB_TOKEN") * @param example Optional example value to show user * @returns The credential value from clipboard, or null if user cancelled */ export declare function collectCredential(server: ElicitationServer, credentialName: string, envVarName: string, example?: string): Promise; /** * Collect multiple credentials from user, one at a time * * For each credential, shows a dialog and collects the value from clipboard. * Returns a map of environment variable names to values. * * @param server MCP server instance * @param credentials Array of credentials to collect * @returns Map of env var names to values, or null if user cancelled */ export declare function collectCredentials(server: ElicitationServer, credentials: Array<{ envVarName: string; displayName: string; example?: string; required?: boolean; }>): Promise | null>; /** * Collect ALL credentials for multiple MCPs in ONE form * * Shows a single consolidated elicitation dialog with all credential fields. * Much better UX than separate dialogs for each credential. * * @param server MCP server instance * @param bulkCredentials Map of MCP names to their required credentials * @returns Map of credential keys (mcpName:envVar) to values, or null if cancelled */ export declare function collectBulkCredentials(server: ElicitationServer, bulkCredentials: Record>): Promise | null>; /** * Collect HTTP/SSE authentication credentials from user * * Currently supports bearer tokens. Returns auth config for HTTP/SSE servers. * * @param server MCP server instance * @param mcpName Name of the MCP * @param url URL of the HTTP/SSE server * @returns Auth configuration object, or null if user cancelled */ export declare function collectHTTPCredentials(server: ElicitationServer, mcpName: string, url: string): Promise<{ type: string; token?: string; } | null>; /** * Format environment variable name for display * Converts: "GITHUB_TOKEN" -> "GitHub Token" */ export declare function formatEnvVarName(envVar: string): string; /** * Detect required credentials for HTTP/SSE servers * * Returns bearer token requirements for known HTTP/SSE MCPs */ export declare function detectHTTPCredentials(mcpName: string, url?: string): Array<{ credentialType: 'bearer' | 'apiKey' | 'oauth' | 'basic'; displayName: string; example?: string; }>; /** * Elicit a selection from a list of options (enum) * * Shows a dialog with radio buttons/dropdown for structured selection. * Follows GitHub's MCP elicitation best practice: use schema-driven prompts. * * @param server MCP server instance * @param fieldName Name of the field being selected * @param options Array of {value, label} options to choose from * @param message Optional custom message * @returns Selected option value, or null if cancelled */ export declare function elicitSelect(server: ElicitationServer, fieldName: string, options: Array<{ value: string; label: string; }>, message?: string): Promise; /** * Elicit multiple selections from a list of options * * Shows a dialog with checkboxes for multi-select. * User can select multiple options. * * @param server MCP server instance * @param fieldName Name of the field being selected * @param options Array of {value, label} options to choose from * @param message Optional custom message * @returns Array of selected option values, empty array if cancelled */ export declare function elicitMultiSelect(server: ElicitationServer, fieldName: string, options: Array<{ value: string; label: string; }>, message?: string): Promise; /** * Detect required environment variables from MCP metadata * * This can be extended to parse from: * - Registry metadata * - Package.json * - README files * - Auto-detection from errors */ export declare function detectRequiredEnvVars(mcpName: string): Array<{ envVarName: string; displayName: string; example?: string; }>; //# sourceMappingURL=elicitation-helper.d.ts.map