@codingame/monaco-vscode-chat-service-override 11.1.2 → 12.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +2 -1
- package/index.js +64 -1
- package/package.json +32 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.d.ts +21 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +73 -60
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClearActions.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClearActions.js +73 -81
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +73 -112
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +253 -101
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +16 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatGettingStarted.d.ts +23 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatGettingStarted.js +30 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +22 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +23 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.d.ts +52 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +50 -47
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +124 -95
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.js +6 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEdinputInputContentProvider.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEdinputInputContentProvider.js +30 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingService.d.ts +69 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingService.js +203 -182
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.d.ts +103 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +458 -165
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.d.ts +42 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.js +14 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.d.ts +26 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/{chatParticipantContributions.js → chatParticipant.contribution.js} +101 -92
- package/vscode/src/vs/workbench/contrib/chat/browser/chatPasteProviders.d.ts +42 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatPasteProviders.js +164 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.d.ts +26 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.js +6 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.d.ts +30 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.js +10 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.js +941 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.d.ts +26 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.js +9 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.d.ts +54 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.js +32 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockContextProviderService.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockContextProviderService.js +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.js +8 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorHover.d.ts +26 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorHover.js +16 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputRelatedFilesContrib.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputRelatedFilesContrib.js +108 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/editorHoverWrapper.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/editorHoverWrapper.js +3 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/media/editorHoverWrapper.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.d.ts +31 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.js +70 -49
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatViewSetup.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/{chatViewsWelcomeContributions.js → chatViewsWelcomeHandler.js} +13 -13
- package/vscode/src/vs/workbench/contrib/chat/common/chatCodeMapperService.d.ts +44 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatCodeMapperService.js +3 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.d.ts +22 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.js +1 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.d.ts +80 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.js +152 -104
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceTelemetry.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceTelemetry.js +2 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.d.ts +41 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.js +2 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatWidgetHistoryService.d.ts +31 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatWidgetHistoryService.js +6 -4
- package/vscode/src/vs/workbench/contrib/chat/common/ignoredFiles.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/chat/common/ignoredFiles.js +1 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.d.ts +24 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +23 -21
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsParametersSchema.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsParametersSchema.js +1 -0
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.d.ts +39 -0
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +20 -19
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.service.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +30 -33
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibilityHelp.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibilityHelp.js +6 -4
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibleView.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibleView.js +9 -7
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.d.ts +44 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.js +247 -83
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.js +5 -4
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSavingServiceImpl.d.ts +29 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSavingServiceImpl.js +35 -35
- package/chat.js +0 -59
- package/vscode/src/vs/editor/common/diff/documentDiffProvider.js +0 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +0 -326
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelContentProviders.js +0 -76
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditorActions.js +0 -110
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditorController.js +0 -287
- package/vscode/src/vs/workbench/contrib/chat/common/languageModelStats.js +0 -130
- package/vscode/src/vs/workbench/contrib/chat/common/languageModels.js +0 -172
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
|
-
import { Emitter } from 'vscode/vscode/vs/base/common/event';
|
|
3
|
-
import { Iterable } from 'vscode/vscode/vs/base/common/iterator';
|
|
4
|
-
import { DisposableStore, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
5
|
-
import { isFalsyOrWhitespace } from 'vscode/vscode/vs/base/common/strings';
|
|
6
|
-
import { localize } from 'vscode/vscode/vs/nls';
|
|
7
|
-
import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
8
|
-
import { ExtensionIdentifier } from 'vscode/vscode/vs/platform/extensions/common/extensions';
|
|
9
|
-
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
|
|
10
|
-
import { isProposedApiEnabled } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions';
|
|
11
|
-
import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions.service';
|
|
12
|
-
import { ExtensionsRegistry } from 'vscode/vscode/vs/workbench/services/extensions/common/extensionsRegistry';
|
|
13
|
-
import { CONTEXT_LANGUAGE_MODELS_ARE_USER_SELECTABLE } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
|
|
14
|
-
|
|
15
|
-
const languageModelType = {
|
|
16
|
-
type: 'object',
|
|
17
|
-
properties: {
|
|
18
|
-
vendor: {
|
|
19
|
-
type: 'string',
|
|
20
|
-
description: ( localize(3182, "A globally unique vendor of language models."))
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
const languageModelExtensionPoint = ExtensionsRegistry.registerExtensionPoint({
|
|
25
|
-
extensionPoint: 'languageModels',
|
|
26
|
-
jsonSchema: {
|
|
27
|
-
description: ( localize(3183, "Contribute language models of a specific vendor.")),
|
|
28
|
-
oneOf: [
|
|
29
|
-
languageModelType,
|
|
30
|
-
{
|
|
31
|
-
type: 'array',
|
|
32
|
-
items: languageModelType
|
|
33
|
-
}
|
|
34
|
-
]
|
|
35
|
-
},
|
|
36
|
-
activationEventsGenerator: (contribs, result) => {
|
|
37
|
-
for (const contrib of contribs) {
|
|
38
|
-
result.push(`onLanguageModelChat:${contrib.vendor}`);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
let LanguageModelsService = class LanguageModelsService {
|
|
43
|
-
constructor(_extensionService, _logService, _contextKeyService) {
|
|
44
|
-
this._extensionService = _extensionService;
|
|
45
|
-
this._logService = _logService;
|
|
46
|
-
this._contextKeyService = _contextKeyService;
|
|
47
|
-
this._store = ( (new DisposableStore()));
|
|
48
|
-
this._providers = ( (new Map()));
|
|
49
|
-
this._vendors = ( (new Set()));
|
|
50
|
-
this._onDidChangeProviders = this._store.add(( (new Emitter())));
|
|
51
|
-
this.onDidChangeLanguageModels = this._onDidChangeProviders.event;
|
|
52
|
-
this._hasUserSelectableModels = CONTEXT_LANGUAGE_MODELS_ARE_USER_SELECTABLE.bindTo(this._contextKeyService);
|
|
53
|
-
this._store.add(languageModelExtensionPoint.setHandler((extensions) => {
|
|
54
|
-
this._vendors.clear();
|
|
55
|
-
for (const extension of extensions) {
|
|
56
|
-
if (!isProposedApiEnabled(extension.description, 'chatProvider')) {
|
|
57
|
-
extension.collector.error(( localize(3184, "This contribution point requires the 'chatProvider' proposal.")));
|
|
58
|
-
continue;
|
|
59
|
-
}
|
|
60
|
-
for (const item of Iterable.wrap(extension.value)) {
|
|
61
|
-
if (( (this._vendors.has(item.vendor)))) {
|
|
62
|
-
extension.collector.error(( localize(
|
|
63
|
-
3185,
|
|
64
|
-
"The vendor '{0}' is already registered and cannot be registered twice",
|
|
65
|
-
item.vendor
|
|
66
|
-
)));
|
|
67
|
-
continue;
|
|
68
|
-
}
|
|
69
|
-
if (isFalsyOrWhitespace(item.vendor)) {
|
|
70
|
-
extension.collector.error(( localize(3186, "The vendor field cannot be empty.")));
|
|
71
|
-
continue;
|
|
72
|
-
}
|
|
73
|
-
if (item.vendor.trim() !== item.vendor) {
|
|
74
|
-
extension.collector.error(( localize(3187, "The vendor field cannot start or end with whitespace.")));
|
|
75
|
-
continue;
|
|
76
|
-
}
|
|
77
|
-
this._vendors.add(item.vendor);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
const removed = [];
|
|
81
|
-
for (const [identifier, value] of this._providers) {
|
|
82
|
-
if (!( (this._vendors.has(value.metadata.vendor)))) {
|
|
83
|
-
this._providers.delete(identifier);
|
|
84
|
-
removed.push(identifier);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
if (removed.length > 0) {
|
|
88
|
-
this._onDidChangeProviders.fire({ removed });
|
|
89
|
-
}
|
|
90
|
-
}));
|
|
91
|
-
}
|
|
92
|
-
dispose() {
|
|
93
|
-
this._store.dispose();
|
|
94
|
-
this._providers.clear();
|
|
95
|
-
}
|
|
96
|
-
getLanguageModelIds() {
|
|
97
|
-
return Array.from(( (this._providers.keys())));
|
|
98
|
-
}
|
|
99
|
-
lookupLanguageModel(identifier) {
|
|
100
|
-
return this._providers.get(identifier)?.metadata;
|
|
101
|
-
}
|
|
102
|
-
async selectLanguageModels(selector) {
|
|
103
|
-
if (selector.vendor) {
|
|
104
|
-
await this._extensionService.activateByEvent(`onLanguageModelChat:${selector.vendor}}`);
|
|
105
|
-
}
|
|
106
|
-
else {
|
|
107
|
-
const all = ( (Array.from(this._vendors).map(
|
|
108
|
-
vendor => this._extensionService.activateByEvent(`onLanguageModelChat:${vendor}`)
|
|
109
|
-
)));
|
|
110
|
-
await Promise.all(all);
|
|
111
|
-
}
|
|
112
|
-
const result = [];
|
|
113
|
-
for (const [identifier, model] of this._providers) {
|
|
114
|
-
if ((selector.vendor === undefined || model.metadata.vendor === selector.vendor)
|
|
115
|
-
&& (selector.family === undefined || model.metadata.family === selector.family)
|
|
116
|
-
&& (selector.version === undefined || model.metadata.version === selector.version)
|
|
117
|
-
&& (selector.identifier === undefined || model.metadata.id === selector.identifier)
|
|
118
|
-
&& (!model.metadata.targetExtensions || ( (model.metadata.targetExtensions.some(candidate => ExtensionIdentifier.equals(candidate, selector.extension)))))) {
|
|
119
|
-
result.push(identifier);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
this._logService.trace('[LM] selected language models', selector, result);
|
|
123
|
-
return result;
|
|
124
|
-
}
|
|
125
|
-
registerLanguageModelChat(identifier, provider) {
|
|
126
|
-
this._logService.trace('[LM] registering language model chat', identifier, provider.metadata);
|
|
127
|
-
if (!( (this._vendors.has(provider.metadata.vendor)))) {
|
|
128
|
-
throw ( (new Error(`Chat response provider uses UNKNOWN vendor ${provider.metadata.vendor}.`)));
|
|
129
|
-
}
|
|
130
|
-
if (( (this._providers.has(identifier)))) {
|
|
131
|
-
throw ( (new Error(
|
|
132
|
-
`Chat response provider with identifier ${identifier} is already registered.`
|
|
133
|
-
)));
|
|
134
|
-
}
|
|
135
|
-
this._providers.set(identifier, provider);
|
|
136
|
-
this._onDidChangeProviders.fire({ added: [{ identifier, metadata: provider.metadata }] });
|
|
137
|
-
this.updateUserSelectableModelsContext();
|
|
138
|
-
return toDisposable(() => {
|
|
139
|
-
this.updateUserSelectableModelsContext();
|
|
140
|
-
if (this._providers.delete(identifier)) {
|
|
141
|
-
this._onDidChangeProviders.fire({ removed: [identifier] });
|
|
142
|
-
this._logService.trace('[LM] UNregistered language model chat', identifier, provider.metadata);
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
updateUserSelectableModelsContext() {
|
|
147
|
-
const hasUserSelectableModels = ( (Array.from(( (this._providers.values()))).some(p => p.metadata.isUserSelectable && !p.metadata.isDefault)));
|
|
148
|
-
const hasDefaultModel = ( (Array.from(( (this._providers.values()))).some(p => p.metadata.isDefault)));
|
|
149
|
-
this._hasUserSelectableModels.set(hasUserSelectableModels && hasDefaultModel);
|
|
150
|
-
}
|
|
151
|
-
async sendChatRequest(identifier, from, messages, options, token) {
|
|
152
|
-
const provider = this._providers.get(identifier);
|
|
153
|
-
if (!provider) {
|
|
154
|
-
throw ( (new Error(`Chat response provider with identifier ${identifier} is not registered.`)));
|
|
155
|
-
}
|
|
156
|
-
return provider.sendChatRequest(messages, from, options, token);
|
|
157
|
-
}
|
|
158
|
-
computeTokenLength(identifier, message, token) {
|
|
159
|
-
const provider = this._providers.get(identifier);
|
|
160
|
-
if (!provider) {
|
|
161
|
-
throw ( (new Error(`Chat response provider with identifier ${identifier} is not registered.`)));
|
|
162
|
-
}
|
|
163
|
-
return provider.provideTokenCount(message, token);
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
LanguageModelsService = ( (__decorate([
|
|
167
|
-
( (__param(0, IExtensionService))),
|
|
168
|
-
( (__param(1, ILogService))),
|
|
169
|
-
( (__param(2, IContextKeyService)))
|
|
170
|
-
], LanguageModelsService)));
|
|
171
|
-
|
|
172
|
-
export { LanguageModelsService, languageModelExtensionPoint };
|