import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle"; import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri"; import { IFileService } from "@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service"; import { IMcpServerConfiguration } from "@codingame/monaco-vscode-api/vscode/vs/platform/mcp/common/mcpPlatformTypes"; import { PromptsType } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/promptTypes"; import { type ClientPluginCustomization } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/sessionState"; import { SYNCED_CUSTOMIZATION_SCHEME } from "../../../../../services/agentHost/common/agentHostFileSystemService.js"; import { IAgentHostFileSystemService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/agentHost/common/agentHostFileSystemService.service"; export { SYNCED_CUSTOMIZATION_SCHEME }; interface ISyncableFile { readonly uri: URI; readonly type: PromptsType; } /** * An MCP server configured directly in VS Code (i.e. not contributed by an * agent plugin) that should be bundled into the synthetic plugin so the * agent host can launch it. */ export interface ISyncableMcpServer { readonly name: string; readonly configuration: IMcpServerConfiguration; } interface IBundleResult { readonly ref: ClientPluginCustomization; } /** * Bundles individual customization files into a synthetic Open Plugin * backed by an in-memory filesystem. * * Each bundler instance is namespaced by its authority string so that * multiple agents can coexist under the same scheme without conflicts. * The plugin is mounted at `vscode-synced-customization:///{authority}/` * and structured as: * * ``` * .plugin/plugin.json * .mcp.json ← MCP servers configured in VS Code * rules/ ← instruction files * commands/ ← prompt files * agents/ ← agent files * skills/ ← skill files * ``` * * The bundler computes a content-based nonce so the agent host can * skip re-loading when nothing has changed. */ export declare class SyncedCustomizationBundler extends Disposable { private readonly _fileService; private readonly _authority; private _lastNonce; private _lastRef; constructor(authority: string, _fileService: IFileService, agentHostFileSystemService: IAgentHostFileSystemService); /** * Root URI of the virtual plugin directory for this bundler. * The authority is encoded into the path (not the URI authority) because * {@link InMemoryFileSystemProvider} only routes by path. */ private get _rootUri(); /** * Bundles the given files and MCP servers into the in-memory plugin * filesystem. * * Overwrites any previous bundle content. Returns a {@link ClientPluginCustomization} * pointing at the virtual plugin directory with a content-based nonce. * * @returns The bundle result, or `undefined` if there is nothing to sync. */ bundle(files: readonly ISyncableFile[], mcpServers?: readonly ISyncableMcpServer[]): Promise; /** * Returns the last computed nonce, or `undefined` if no bundle has been created. */ get lastNonce(): string | undefined; }