Path: blob/main/src/vs/platform/agentHost/common/agentPluginManager.ts
13394 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import { URI } from '../../../base/common/uri.js';6import { createDecorator } from '../../instantiation/common/instantiation.js';7import type { CustomizationRef, SessionCustomization } from './state/sessionState.js';89export const IAgentPluginManager = createDecorator<IAgentPluginManager>('agentPluginManager');1011/**12* A synced customization with its local plugin directory (when available).13*/14export interface ISyncedCustomization {15/** The session customization with loading/error status. */16readonly customization: SessionCustomization;17/** Local plugin directory URI, defined when the sync was successful. */18readonly pluginDir?: URI;19}2021/**22* Manages Open Plugin directories for agent backends.23*24* Shared across agents and sessions. Syncs client-provided customization25* references to local disk, tracking nonces to avoid redundant copies.26* Concurrent syncs of the same plugin URI are serialized internally.27*/28export interface IAgentPluginManager {29readonly _serviceBrand: undefined;3031/**32* Syncs a set of client-provided customization refs to local storage.33*34* Each ref is copied to a local directory, respecting nonce-based35* caching. The optional {@link progress} callback fires as individual36* customizations complete or fail, allowing callers to publish37* incremental status updates.38*39* Concurrent calls for the same plugin URI are serialized so that40* overlapping syncs do not clobber each other.41*42* @returns Final status for every customization, with `pluginDir`43* defined when the sync was successful.44*/45syncCustomizations(clientId: string, customizations: CustomizationRef[], progress?: (status: SessionCustomization[]) => void): Promise<ISyncedCustomization[]>;46}474849