@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.
Files changed (110) hide show
  1. package/index.d.ts +2 -1
  2. package/index.js +64 -1
  3. package/package.json +32 -13
  4. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.d.ts +21 -0
  5. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +73 -60
  6. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClearActions.d.ts +3 -0
  7. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClearActions.js +73 -81
  8. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.d.ts +9 -0
  9. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +73 -112
  10. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.d.ts +12 -0
  11. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +253 -101
  12. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.d.ts +1 -0
  13. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +8 -8
  14. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.d.ts +1 -0
  15. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +2 -1
  16. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.d.ts +1 -0
  17. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +16 -14
  18. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatGettingStarted.d.ts +23 -0
  19. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatGettingStarted.js +30 -11
  20. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.d.ts +1 -0
  21. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +12 -12
  22. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.d.ts +1 -0
  23. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +22 -20
  24. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.d.ts +2 -0
  25. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +23 -20
  26. package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.d.ts +52 -0
  27. package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +50 -47
  28. package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.d.ts +1 -0
  29. package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +124 -95
  30. package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.d.ts +17 -0
  31. package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.js +6 -3
  32. package/vscode/src/vs/workbench/contrib/chat/browser/chatEdinputInputContentProvider.d.ts +12 -0
  33. package/vscode/src/vs/workbench/contrib/chat/browser/chatEdinputInputContentProvider.js +30 -0
  34. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingService.d.ts +69 -0
  35. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingService.js +203 -182
  36. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.d.ts +103 -0
  37. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +458 -165
  38. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.d.ts +42 -0
  39. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.js +14 -10
  40. package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.d.ts +26 -0
  41. package/vscode/src/vs/workbench/contrib/chat/browser/{chatParticipantContributions.js → chatParticipant.contribution.js} +101 -92
  42. package/vscode/src/vs/workbench/contrib/chat/browser/chatPasteProviders.d.ts +42 -0
  43. package/vscode/src/vs/workbench/contrib/chat/browser/chatPasteProviders.js +164 -25
  44. package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.d.ts +26 -0
  45. package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.js +6 -5
  46. package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.d.ts +30 -0
  47. package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.js +10 -7
  48. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.d.ts +17 -0
  49. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.js +941 -0
  50. package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.d.ts +26 -0
  51. package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.js +9 -6
  52. package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.d.ts +54 -0
  53. package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.js +32 -15
  54. package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockContextProviderService.d.ts +9 -0
  55. package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockContextProviderService.js +1 -0
  56. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.d.ts +1 -0
  57. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.js +8 -6
  58. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorHover.d.ts +26 -0
  59. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorHover.js +16 -19
  60. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputRelatedFilesContrib.d.ts +15 -0
  61. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputRelatedFilesContrib.js +108 -0
  62. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/editorHoverWrapper.d.ts +7 -0
  63. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/editorHoverWrapper.js +3 -8
  64. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/media/editorHoverWrapper.css.js +1 -1
  65. package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.d.ts +31 -0
  66. package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.js +70 -49
  67. package/vscode/src/vs/workbench/contrib/chat/browser/media/chatViewSetup.css.js +6 -0
  68. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.d.ts +7 -0
  69. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/{chatViewsWelcomeContributions.js → chatViewsWelcomeHandler.js} +13 -13
  70. package/vscode/src/vs/workbench/contrib/chat/common/chatCodeMapperService.d.ts +44 -0
  71. package/vscode/src/vs/workbench/contrib/chat/common/chatCodeMapperService.js +3 -1
  72. package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.d.ts +22 -0
  73. package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.js +1 -0
  74. package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.d.ts +80 -0
  75. package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.js +152 -104
  76. package/vscode/src/vs/workbench/contrib/chat/common/chatServiceTelemetry.d.ts +8 -0
  77. package/vscode/src/vs/workbench/contrib/chat/common/chatServiceTelemetry.js +2 -1
  78. package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.d.ts +41 -0
  79. package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.js +2 -1
  80. package/vscode/src/vs/workbench/contrib/chat/common/chatWidgetHistoryService.d.ts +31 -0
  81. package/vscode/src/vs/workbench/contrib/chat/common/chatWidgetHistoryService.js +6 -4
  82. package/vscode/src/vs/workbench/contrib/chat/common/ignoredFiles.d.ts +13 -0
  83. package/vscode/src/vs/workbench/contrib/chat/common/ignoredFiles.js +1 -0
  84. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.d.ts +24 -0
  85. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +23 -21
  86. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsParametersSchema.d.ts +1 -0
  87. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsParametersSchema.js +1 -0
  88. package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.d.ts +39 -0
  89. package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +20 -19
  90. package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.service.d.ts +7 -0
  91. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.d.ts +1 -0
  92. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +30 -33
  93. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibilityHelp.d.ts +10 -0
  94. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibilityHelp.js +6 -4
  95. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibleView.d.ts +10 -0
  96. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibleView.js +9 -7
  97. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.d.ts +44 -0
  98. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.js +247 -83
  99. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.d.ts +8 -0
  100. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.js +5 -4
  101. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSavingServiceImpl.d.ts +29 -0
  102. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSavingServiceImpl.js +35 -35
  103. package/chat.js +0 -59
  104. package/vscode/src/vs/editor/common/diff/documentDiffProvider.js +0 -8
  105. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +0 -326
  106. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelContentProviders.js +0 -76
  107. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditorActions.js +0 -110
  108. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditorController.js +0 -287
  109. package/vscode/src/vs/workbench/contrib/chat/common/languageModelStats.js +0 -130
  110. 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 };