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