import { CancellationToken } from "../../../../../../base/common/cancellation.js"; import { CustomizationEnablement, CustomizationEnablementKind } from "../../../../../../platform/agentHost/common/state/protocol/state.js"; import { AgentCustomization, Customization, PluginCustomization, ISessionFolderPickerDecision } from "../../../../../../platform/agentHost/common/state/sessionState.js"; import { IMcpServerConfiguration } from "../../../../../../platform/mcp/common/mcpPlatformTypes.js"; import { IAgentHostMcpServer } from "../../../../../../sessions/common/agentHostSessionsProvider.js"; import { Event, URI } from "../../../../../../sessions/sessions.web.main.internal.js"; import { IAgentFileToolInventoryEntry } from "../../../common/customizationHarnessService.js"; export declare const IAgentHostCustomizationService: import("../../../../../../platform/instantiation/common/instantiation.js").ServiceIdentifier; export interface IAgentHostCustomizationService { readonly _serviceBrand: undefined; readonly onDidChangeCustomAgents: Event; readonly onDidChangeCustomizations: Event; getAgentFileToolInventory?(sessionResource: URI): readonly IAgentFileToolInventoryEntry[] | undefined; getCustomAgents(sessionResource: URI): readonly AgentCustomization[]; getCustomizations(sessionResource: URI): readonly Customization[]; /** Returns this client's plugin source, never a foreign client's filesystem resource. */ getClientPluginUri(sessionResource: URI, plugin: Pick): URI | undefined; /** * Waits for {@link getCustomizations} to reflect the session's first state snapshot, or until the caller cancels or the subscription fails. * The readiness wait is shared per session; callers choose their own cancellation or timeout policy. * Returns whether a session-state snapshot is available. */ whenCustomizationsReady(sessionResource: URI, token?: CancellationToken): Promise; /** The host's Folder picker decision, with its primary root in client URI space. Changes fire {@link onDidChangeCustomizations}. */ getFolderPickerDecision(sessionResource: URI): ISessionFolderPickerDecision | undefined; /** The primary session root in host URI space. */ getWorkingDirectory(sessionResource: URI): string | undefined; /** Ordered session roots in host URI space for protocol values and comparisons. */ getWorkingDirectories(sessionResource: URI): readonly string[]; /** The ordered roots in the client's URI space for filesystem access. */ getClientWorkingDirectoryUris(sessionResource: URI): readonly URI[]; /** Returns the host-advertised chat URI for the selected client chat resource. */ getBackendChatResource?(sessionResource: URI): URI | undefined; /** * Returns the MCP servers exposed by an agent-host session. Each entry * carries the current status, a {@link IAgentHostMcpServer.setEnabled} * method that dispatches the protocol-level toggle on behalf of the * caller, and lifecycle actions. Per-server diagnostics are revealed via * {@link showMcpServerLog}. Returns an empty array for sessions not * backed by an agent host, or that don't expose any MCP servers. */ getMcpServers(sessionResource: URI): readonly IAgentHostMcpServer[]; /** * Adds (or replaces) an agent-host-level MCP server in the root config of * the agent host backing `sessionResource`. The write is routed to the * correct connection (local or remote) for that session. No-op for * sessions not backed by an agent host. */ addMcpServer(sessionResource: URI, name: string, config: IMcpServerConfiguration): void; /** * Runs interactive authentication for an auth-required MCP server in an * agent-host session. A Copilot Connector-owned server is authorized through * Copilot Connectors for the session account instead of an MCP token. * Returns true only once the server leaves the authentication-required * state; false when the session/server cannot be resolved, authentication * did not complete, or the server asks for the same authentication again. */ authenticateMcpServer(sessionResource: URI, serverId: string): Promise; /** Changes one scope while preserving all other explicit decisions. */ setCustomizationEnablement(sessionResource: URI, customizationId: string, currentEnablement: readonly CustomizationEnablement[] | undefined, kind: CustomizationEnablementKind, enabled: boolean): void; /** * Reveals the per-server MCP diagnostics Output channel for the server * `serverId` in the agent-host session `sessionResource`, making its hidden * logger visible first. The channel is an internal detail of this service -- * callers identify the server the same way they do for * {@link authenticateMcpServer}. No-op when the session/server cannot be * resolved. */ showMcpServerLog(sessionResource: URI, serverId: string, beforeShow?: () => Promise): Promise; }