Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/extensions/copilot/src/extension/prompt/node/intentRegistry.ts
13399 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 { ChatLocation } from '../../../platform/chat/common/commonTypes';
7
import { SyncDescriptor } from '../../../util/vs/platform/instantiation/common/descriptors';
8
import { ContributedToolName } from '../../tools/common/toolNames';
9
import { IIntent } from './intents';
10
11
export interface CommandDetails {
12
commandId: string;
13
intent?: IIntent;
14
details: string;
15
locations: ChatLocation[];
16
readonly toolEquivalent?: ContributedToolName;
17
}
18
19
export const IntentRegistry = new class {
20
private _descriptors: SyncDescriptor<IIntent>[] = [];
21
22
public setIntents(intentDescriptors: SyncDescriptor<IIntent>[]) {
23
this._descriptors = this._descriptors.concat(intentDescriptors);
24
}
25
26
public getIntents(): readonly SyncDescriptor<IIntent>[] {
27
return this._descriptors;
28
}
29
}();
30
31