1
>
/*---------------------------------------------------------------------------------------------
sessionPluginBundler.ts
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 { VSBuffer } from '../../../../base/common/buffer.js';
7
>
import { CancellationToken } from '../../../../base/common/cancellation.js';
8
>
import { hash } from '../../../../base/common/hash.js';
9
>
import { Disposable } from '../../../../base/common/lifecycle.js';
10
>
import { basename, dirname } from '../../../../base/common/resources.js';
11
>
import { URI } from '../../../../base/common/uri.js';
12
>
import { IFileService } from '../../../files/common/files.js';
13
>
import { IAgentPluginManager } from '../../common/agentPluginManager.js';
14
>
import { customizationId, type ClientPluginCustomization } from '../../common/state/sessionState.js';
15
>
import { CustomizationType, type URI as ProtocolURI } from '../../common/state/protocol/state.js';
16
>
import { DiscoveredType, type IDiscoveredDirectory } from '../copilot/sessionCustomizationDiscovery.js';
17
>
18
>
const DISPLAY_NAME = 'VS Code Synced Data';
19
>
const HOST_DISCOVERY_DIR = 'host-discovery';
20
>
21
>
const MANIFEST_CONTENT = JSON.stringify({
22
>
name: DISPLAY_NAME,
23
>
description: 'Customization data discovered from this workspace and your home directory',
24
>
}, null, '\t');
25
>
26
>
/**
27
>
* Maps a {@link DiscoveredType} to the plugin sub-directory under which that
28
>
* component type lives in the Open Plugin format.
29
>
*/
30
function pluginDirForType(type: DiscoveredType): string | undefined {
31
switch (type) {