1
>
/*---------------------------------------------------------------------------------------------
promptsServiceUtils.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 { URI } from '../../../../../../base/common/uri.js';
7
>
import { ExtensionIdentifier } from '../../../../../../platform/extensions/common/extensions.js';
8
>
import { IProductService } from '../../../../../../platform/product/common/productService.js';
9
>
import { IAgentSource, PromptsStorage } from '../service/promptsService.js';
10
>
11
>
/**
12
>
* Checks if a prompt file is organization-provided.
13
>
* Organization-provided prompt files come from the built-in chat extension
14
>
* and are located under a `/github/` path.
15
>
*
16
>
* @param uri The URI of the prompt file
17
>
* @param extensionId The extension identifier that provides the prompt file
18
>
* @param productService The product service to get the built-in chat extension ID
19
>
* @returns `true` if the prompt file is organization-provided, `false` otherwise
20
>
*/
21
>
export function isOrganizationPromptFile(uri: URI, extensionId: ExtensionIdentifier, productService: IProductService): boolean {
22
const chatExtensionId = productService.defaultChatAgent?.chatExtensionId;
23
if (!chatExtensionId) {