import { Disposable } from "../../../../base/common/lifecycle.js"; import { IConfigurationService } from "../../../../platform/configuration/common/configuration.service.js"; import { RawContextKey } from "../../../../platform/contextkey/common/contextkey.js"; import { IContextKeyService } from "../../../../platform/contextkey/common/contextkey.service.js"; import { IContextViewService } from "../../../../platform/contextview/browser/contextView.service.js"; import { IKeybindingService } from "../../../../platform/keybinding/common/keybinding.service.js"; import { INotificationService } from "../../../../platform/notification/common/notification.service.js"; import { IEditableMcpServerConfiguration } from "../common/mcpTypes.js"; /** Whether focus is inside an {@link McpServerConfigurationForm}. */ export declare const McpServerConfigurationFormFocusContext: RawContextKey; /** The configuration form that contains the focused element, if any. */ export declare function getFocusedMcpServerConfigurationForm(): McpServerConfigurationForm | undefined; export interface IMcpServerConfigurationFormOptions { /** Opens the configuration file at the server's entry, to edit properties the form does not show. */ readonly openConfiguration: () => void; } /** * A server configuration shown in {@link McpServerConfigurationForm}, together with how to save it. */ export interface IMcpServerConfigurationFormInput extends IEditableMcpServerConfiguration { /** Identifies the server; unsaved edits are kept while the same server is shown. */ readonly id: string; /** Name of the server in its configuration file. */ readonly name: string; readonly label: string; } /** * Form for editing the configuration of an installed MCP server: its type, * launch command or URL, environment variables and headers. Saving writes the * configuration back to the file the server was loaded from. */ export declare class McpServerConfigurationForm extends Disposable { private readonly notificationService; private readonly contextViewService; private readonly configurationService; private readonly keybindingService; private readonly _onDidChangeContent; /** Fires when the form's height may have changed. */ readonly onDidChangeContent: import("../../../../base/common/event.js").Event; readonly element: HTMLElement; private readonly kindRadio; private readonly envHint; private readonly envFileField; private readonly cwdField; private readonly formatErrorEl; private readonly stdioSection; private readonly remoteSection; private readonly commandInput; private readonly argsInput; private readonly envList; private readonly envFileInput; private readonly cwdInput; private readonly urlInput; private readonly headersList; private readonly discardButton; private readonly saveButton; private input; private capabilities; private kinds; private baseline; private initialState; private state; private validation; private saving; constructor(parent: HTMLElement, options: IMcpServerConfigurationFormOptions, notificationService: INotificationService, contextViewService: IContextViewService, contextKeyService: IContextKeyService, configurationService: IConfigurationService, keybindingService: IKeybindingService); get isDirty(): boolean; /** * Shows the configuration of {@link input}. Unsaved edits to the same server * are kept when its configuration changes on disk. */ setInput(input: IMcpServerConfigurationFormInput): void; focus(): void; /** * Remembers where focus is in the form and returns a function that moves it back there, for * example when a dialog closes. A file change in the meantime can rebuild the focused row, in * which case focus returns to the same row, the nearest remaining row or the form. */ captureFocus(): () => void; private appendField; private appendHint; /** Offers only what the destination file can store; an unsupported kind already in the file stays selectable. */ private renderCapabilities; private appendInput; private registerKeyValueList; private renderState; private updateSections; private onDidChangeState; private updateButtons; private validate; /** * Moves unsaved edits onto {@link config}, the configuration now in the file: fields the user * edited keep their edits and all other fields show the file's values. Saving then writes only * the user's edits, so changes made to the file in the meantime are kept. */ private rebase; /** Shows {@link config}, the latest configuration from the file, without any edits. */ private reset; private discard; private updateAriaLabel; private save; }