@codingame/monaco-vscode-chat-service-override 9.0.2 → 10.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 (41) hide show
  1. package/chat.js +8 -2
  2. package/package.json +2 -2
  3. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +24 -25
  4. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClearActions.js +5 -7
  5. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +100 -293
  6. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +115 -26
  7. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +2 -2
  8. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +1 -1
  9. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +6 -8
  10. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +3 -3
  11. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +9 -7
  12. package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +448 -0
  13. package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +58 -43
  14. package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.js +2 -4
  15. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.js +7 -2
  16. package/vscode/src/vs/workbench/contrib/chat/browser/chatGettingStarted.js +131 -0
  17. package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipantContributions.js +88 -88
  18. package/vscode/src/vs/workbench/contrib/chat/browser/chatPasteProviders.js +26 -0
  19. package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.js +4 -2
  20. package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.js +6 -22
  21. package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.js +11 -17
  22. package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.js +21 -14
  23. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorHover.js +3 -3
  24. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/editorHoverWrapper.js +7 -1
  25. package/vscode/src/vs/workbench/contrib/chat/common/chatCodeMapperService.js +27 -0
  26. package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.js +52 -0
  27. package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.js +25 -29
  28. package/vscode/src/vs/workbench/contrib/chat/common/chatServiceTelemetry.js +8 -1
  29. package/vscode/src/vs/workbench/contrib/chat/common/chatWidgetHistoryService.js +1 -2
  30. package/vscode/src/vs/workbench/contrib/chat/common/languageModelStats.js +7 -8
  31. package/vscode/src/vs/workbench/contrib/chat/common/languageModelToolsService.js +70 -20
  32. package/vscode/src/vs/workbench/contrib/chat/common/languageModels.js +172 -0
  33. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +30 -12
  34. package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +1 -1
  35. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +11 -15
  36. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibilityHelp.js +1 -2
  37. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibleView.js +5 -6
  38. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.js +5 -6
  39. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSavingServiceImpl.js +5 -8
  40. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatContextAttachments.js +0 -58
  41. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputCompletions.js +0 -412
@@ -8,8 +8,6 @@ import { AccessibilityProgressSignalScheduler } from 'vscode/vscode/vs/platform/
8
8
  import { renderStringAsPlaintext } from 'vscode/vscode/vs/base/browser/markdownRenderer';
9
9
  import { MarkdownString } from 'vscode/vscode/vs/base/common/htmlContent';
10
10
  import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
11
- import 'vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration';
12
- import { AccessibilityVoiceSettingId } from 'vscode/vscode/vs/workbench/contrib/speech/common/speechService';
13
11
 
14
12
  const CHAT_RESPONSE_PENDING_ALLOWANCE_MS = 4000;
15
13
  let ChatAccessibilityService = class ChatAccessibilityService extends Disposable {
@@ -27,7 +25,7 @@ let ChatAccessibilityService = class ChatAccessibilityService extends Disposable
27
25
  this._pendingSignalMap.set(this._requestId, this._instantiationService.createInstance(AccessibilityProgressSignalScheduler, CHAT_RESPONSE_PENDING_ALLOWANCE_MS, undefined));
28
26
  return this._requestId;
29
27
  }
30
- acceptResponse(response, requestId) {
28
+ acceptResponse(response, requestId, isVoiceInput) {
31
29
  this._pendingSignalMap.deleteAndDispose(requestId);
32
30
  const isPanelChat = typeof response !== 'string';
33
31
  const responseContent = typeof response === 'string' ? response : response?.response.toString();
@@ -37,7 +35,7 @@ let ChatAccessibilityService = class ChatAccessibilityService extends Disposable
37
35
  }
38
36
  const errorDetails = isPanelChat && response.errorDetails ? ` ${response.errorDetails.message}` : '';
39
37
  const plainTextResponse = renderStringAsPlaintext(( new MarkdownString(responseContent)));
40
- if (this._configurationService.getValue(AccessibilityVoiceSettingId.AutoSynthesize) !== 'on') {
38
+ if (!isVoiceInput || this._configurationService.getValue("accessibility.voice.autoSynthesize" ) !== 'on') {
41
39
  status(plainTextResponse + errorDetails);
42
40
  }
43
41
  }
@@ -2,7 +2,6 @@ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
2
2
  import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
3
3
  import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
4
4
  import { ServiceCollection } from 'vscode/vscode/vs/platform/instantiation/common/serviceCollection';
5
- import { StorageScope, StorageTarget } from 'vscode/vscode/vs/platform/storage/common/storage';
6
5
  import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
7
6
  import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service';
8
7
  import 'vscode/vscode/vs/platform/theme/common/colorUtils';
@@ -24,6 +23,7 @@ import { ChatEditorInput } from 'vscode/vscode/vs/workbench/contrib/chat/browser
24
23
  import { ChatWidget } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chatWidget';
25
24
  import { ChatAgentLocation } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatAgents';
26
25
  import { CHAT_PROVIDER_ID } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatParticipantContribTypes';
26
+ import { EDITOR_DRAG_AND_DROP_BACKGROUND } from 'vscode/vscode/vs/workbench/common/theme';
27
27
 
28
28
  let ChatEditor = class ChatEditor extends EditorPane {
29
29
  get scopedContextKeyService() {
@@ -46,6 +46,7 @@ let ChatEditor = class ChatEditor extends EditorPane {
46
46
  this.widget = this._register(scopedInstantiationService.createInstance(ChatWidget, ChatAgentLocation.Panel, undefined, { supportsFileReferences: true }, {
47
47
  listForeground: editorForeground,
48
48
  listBackground: editorBackground,
49
+ overlayBackground: EDITOR_DRAG_AND_DROP_BACKGROUND,
49
50
  inputEditorBackground: inputBackground,
50
51
  resultEditorBackground: editorBackground
51
52
  }));
@@ -78,7 +79,7 @@ let ChatEditor = class ChatEditor extends EditorPane {
78
79
  }
79
80
  updateModel(model, viewState) {
80
81
  this._memento = ( new Memento('interactive-session-editor-' + CHAT_PROVIDER_ID, this.storageService));
81
- this._viewState = viewState ?? this._memento.getMemento(StorageScope.WORKSPACE, StorageTarget.MACHINE);
82
+ this._viewState = viewState ?? this._memento.getMemento(1 , 1 );
82
83
  this.widget.setModel(model, { ...this._viewState });
83
84
  }
84
85
  saveState() {
@@ -86,9 +87,13 @@ let ChatEditor = class ChatEditor extends EditorPane {
86
87
  if (this._memento && this._viewState) {
87
88
  const widgetViewState = this.widget.getViewState();
88
89
  this._viewState.inputValue = widgetViewState.inputValue;
90
+ this._viewState.selectedLanguageModelId = widgetViewState.selectedLanguageModelId;
89
91
  this._memento.saveMemento();
90
92
  }
91
93
  }
94
+ getViewState() {
95
+ return { ...this._viewState };
96
+ }
92
97
  layout(dimension, position) {
93
98
  if (this.widget) {
94
99
  this.widget.layout(dimension.height, dimension.width);
@@ -0,0 +1,131 @@
1
+ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
2
+ import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
3
+ import { Disposable, MutableDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
4
+ import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
5
+ import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
6
+ import { NumberBadge } from 'vscode/vscode/vs/workbench/services/activity/common/activity';
7
+ import { IActivityService } from 'vscode/vscode/vs/workbench/services/activity/common/activity.service';
8
+ import { IProductService } from 'vscode/vscode/vs/platform/product/common/productService.service';
9
+ import { ExtensionIdentifier } from 'vscode/vscode/vs/platform/extensions/common/extensions';
10
+ import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
11
+ import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions.service';
12
+ import { Extensions } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
13
+ import { applicationConfigurationNodeBase } from 'vscode/vscode/vs/workbench/common/configuration';
14
+ import { localize } from 'vscode/vscode/vs/nls';
15
+ import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
16
+ import { CHAT_VIEW_ID } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chat';
17
+ import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands.service';
18
+ import { IExtensionManagementService } from 'vscode/vscode/vs/platform/extensionManagement/common/extensionManagement.service';
19
+
20
+ const showChatGettingStartedConfigKey = 'workbench.panel.chat.view.experimental.showGettingStarted';
21
+ let ChatGettingStartedContribution = class ChatGettingStartedContribution extends Disposable {
22
+ static { this.ID = 'workbench.contrib.chatGettingStarted'; }
23
+ constructor(contextService, productService, storageService, activityService, extensionService, commandService, configurationService, extensionManagementService) {
24
+ super();
25
+ this.contextService = contextService;
26
+ this.productService = productService;
27
+ this.storageService = storageService;
28
+ this.activityService = activityService;
29
+ this.extensionService = extensionService;
30
+ this.commandService = commandService;
31
+ this.configurationService = configurationService;
32
+ this.extensionManagementService = extensionManagementService;
33
+ this.showChatGettingStartedDisposable = this._register(( (new MutableDisposable())));
34
+ if (!this.productService.gitHubEntitlement) {
35
+ return;
36
+ }
37
+ if (this.storageService.get(showChatGettingStartedConfigKey, -1 ) !== undefined) {
38
+ return;
39
+ }
40
+ this.extensionManagementService.getInstalled().then(async (exts) => {
41
+ const installed = exts.find(value => ExtensionIdentifier.equals(value.identifier.id, this.productService.gitHubEntitlement.extensionId));
42
+ if (!installed) {
43
+ this.registerListeners();
44
+ return;
45
+ }
46
+ this.storageService.store(showChatGettingStartedConfigKey, 'installed', -1 , 1 );
47
+ });
48
+ }
49
+ registerListeners() {
50
+ this._register(this.extensionService.onDidChangeExtensions(async (result) => {
51
+ if (this.storageService.get(showChatGettingStartedConfigKey, -1 ) !== undefined) {
52
+ return;
53
+ }
54
+ for (const ext of result.added) {
55
+ if (ExtensionIdentifier.equals(this.productService.gitHubEntitlement.extensionId, ext.identifier)) {
56
+ this.displayBadge();
57
+ return;
58
+ }
59
+ }
60
+ }));
61
+ this.extensionService.onDidChangeExtensionsStatus(async (event) => {
62
+ if (this.storageService.get(showChatGettingStartedConfigKey, -1 ) !== undefined) {
63
+ return;
64
+ }
65
+ for (const ext of event) {
66
+ if (ExtensionIdentifier.equals(this.productService.gitHubEntitlement.extensionId, ext.value)) {
67
+ const extensionStatus = this.extensionService.getExtensionsStatus();
68
+ if (extensionStatus[ext.value].activationTimes) {
69
+ this.displayChatPanel();
70
+ return;
71
+ }
72
+ }
73
+ }
74
+ });
75
+ this._register(this.contextService.onDidChangeContext(event => {
76
+ if (this.storageService.get(showChatGettingStartedConfigKey, -1 ) === undefined) {
77
+ return;
78
+ }
79
+ if (event.affectsSome(( (new Set([`view.${CHAT_VIEW_ID}.visible`]))))) {
80
+ if (this.contextService.contextMatchesRules(ContextKeyExpr.deserialize(`${CHAT_VIEW_ID}.visible`))) {
81
+ this.showChatGettingStartedDisposable.clear();
82
+ }
83
+ }
84
+ }));
85
+ }
86
+ async displayBadge() {
87
+ const showGettingStartedExp = this.configurationService.inspect(showChatGettingStartedConfigKey).value ?? '';
88
+ if (!showGettingStartedExp || showGettingStartedExp !== 'showBadge') {
89
+ return;
90
+ }
91
+ const badge = ( (new NumberBadge(1, () => ( localize(7348, 'Open Chat Panel')))));
92
+ this.showChatGettingStartedDisposable.value = this.activityService.showViewActivity(CHAT_VIEW_ID, { badge });
93
+ this.storageService.store(showChatGettingStartedConfigKey, showGettingStartedExp, -1 , 1 );
94
+ }
95
+ async displayChatPanel() {
96
+ const showGettingStartedExp = this.configurationService.inspect(showChatGettingStartedConfigKey).value ?? '';
97
+ if (!showGettingStartedExp || showGettingStartedExp !== 'showChatPanel') {
98
+ return;
99
+ }
100
+ this.commandService.executeCommand(`${CHAT_VIEW_ID}.focus`);
101
+ this.storageService.store(showChatGettingStartedConfigKey, showGettingStartedExp, -1 , 1 );
102
+ }
103
+ };
104
+ ChatGettingStartedContribution = ( (__decorate([
105
+ ( (__param(0, IContextKeyService))),
106
+ ( (__param(1, IProductService))),
107
+ ( (__param(2, IStorageService))),
108
+ ( (__param(3, IActivityService))),
109
+ ( (__param(4, IExtensionService))),
110
+ ( (__param(5, ICommandService))),
111
+ ( (__param(6, IConfigurationService))),
112
+ ( (__param(7, IExtensionManagementService)))
113
+ ], ChatGettingStartedContribution)));
114
+ const configurationRegistry = ( (Registry.as(Extensions.Configuration)));
115
+ configurationRegistry.registerConfiguration({
116
+ ...applicationConfigurationNodeBase,
117
+ properties: {
118
+ 'workbench.panel.chat.view.experimental.showGettingStarted': {
119
+ scope: 2 ,
120
+ type: 'string',
121
+ default: '',
122
+ tags: ['experimental'],
123
+ description: ( localize(
124
+ 7349,
125
+ "When enabled, shows a getting started experiments in the chat panel."
126
+ ))
127
+ }
128
+ }
129
+ });
130
+
131
+ export { ChatGettingStartedContribution };
@@ -1,33 +1,32 @@
1
1
  import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
2
2
  import { isNonEmptyArray, coalesce } from 'vscode/vscode/vs/base/common/arrays';
3
3
  import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
4
- import { DisposableMap, DisposableStore, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
4
+ import { Event } from 'vscode/vscode/vs/base/common/event';
5
+ import { DisposableMap, DisposableStore, toDisposable, Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
5
6
  import { AmbiguousCharacters, InvisibleCharacters } from 'vscode/vscode/vs/base/common/strings';
6
7
  import { localize, localize2 } from 'vscode/vscode/vs/nls';
7
8
  import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
8
9
  import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
9
10
  import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
10
11
  import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
11
- import 'vscode/vscode/vs/platform/notification/common/notification';
12
12
  import { IProductService } from 'vscode/vscode/vs/platform/product/common/productService.service';
13
13
  import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
14
14
  import { ViewPaneContainer } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPaneContainer';
15
- import { Extensions, ViewContainerLocation } from 'vscode/vscode/vs/workbench/common/views';
16
- import { CHAT_VIEW_ID } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chat';
17
- import { CHAT_SIDEBAR_PANEL_ID, ChatViewPane } from './chatViewPane.js';
15
+ import { Extensions } from 'vscode/vscode/vs/workbench/common/views';
16
+ import { isProposedApiEnabled } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions';
17
+ import { ExtensionsRegistry } from 'vscode/vscode/vs/workbench/services/extensions/common/extensionsRegistry';
18
+ import { showExtensionsWithIdsCommandId } from 'vscode/vscode/vs/workbench/contrib/extensions/browser/extensionsActions';
19
+ import { IExtensionsWorkbenchService } from 'vscode/vscode/vs/workbench/contrib/extensions/common/extensions.service';
18
20
  import { ChatAgentLocation } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatAgents';
19
21
  import { IChatAgentService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatAgents.service';
20
22
  import { CONTEXT_CHAT_PANEL_PARTICIPANT_REGISTERED, CONTEXT_CHAT_EXTENSION_INVALID } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
21
- import { showExtensionsWithIdsCommandId } from 'vscode/vscode/vs/workbench/contrib/extensions/browser/extensionsActions';
22
- import { IExtensionsWorkbenchService } from 'vscode/vscode/vs/workbench/contrib/extensions/common/extensions.service';
23
- import { isProposedApiEnabled } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions';
24
- import { ExtensionsRegistry } from 'vscode/vscode/vs/workbench/services/extensions/common/extensionsRegistry';
25
- import Severity$1 from 'vscode/vscode/vs/base/common/severity';
23
+ import { CHAT_VIEW_ID } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chat';
24
+ import { CHAT_SIDEBAR_PANEL_ID, ChatViewPane } from './chatViewPane.js';
26
25
 
27
26
  const chatParticipantExtensionPoint = ExtensionsRegistry.registerExtensionPoint({
28
27
  extensionPoint: 'chatParticipants',
29
28
  jsonSchema: {
30
- description: ( localize(7136, 'Contributes a chat participant')),
29
+ description: ( localize(7350, 'Contributes a chat participant')),
31
30
  type: 'array',
32
31
  items: {
33
32
  additionalProperties: false,
@@ -36,12 +35,12 @@ const chatParticipantExtensionPoint = ExtensionsRegistry.registerExtensionPoint(
36
35
  required: ['name', 'id'],
37
36
  properties: {
38
37
  id: {
39
- description: ( localize(7137, "A unique id for this chat participant.")),
38
+ description: ( localize(7351, "A unique id for this chat participant.")),
40
39
  type: 'string'
41
40
  },
42
41
  name: {
43
42
  description: ( localize(
44
- 7138,
43
+ 7352,
45
44
  "User-facing name for this chat participant. The user will use '@' with this name to invoke the participant. Name must not contain whitespace."
46
45
  )),
47
46
  type: 'string',
@@ -49,63 +48,63 @@ const chatParticipantExtensionPoint = ExtensionsRegistry.registerExtensionPoint(
49
48
  },
50
49
  fullName: {
51
50
  markdownDescription: ( localize(
52
- 7139,
51
+ 7353,
53
52
  "The full name of this chat participant, which is shown as the label for responses coming from this participant. If not provided, {0} is used.",
54
53
  '`name`'
55
54
  )),
56
55
  type: 'string'
57
56
  },
58
57
  description: {
59
- description: ( localize(7140, "A description of this chat participant, shown in the UI.")),
58
+ description: ( localize(7354, "A description of this chat participant, shown in the UI.")),
60
59
  type: 'string'
61
60
  },
62
61
  isSticky: {
63
62
  description: ( localize(
64
- 7141,
63
+ 7355,
65
64
  "Whether invoking the command puts the chat into a persistent mode, where the command is automatically added to the chat input for the next message."
66
65
  )),
67
66
  type: 'boolean'
68
67
  },
69
68
  sampleRequest: {
70
69
  description: ( localize(
71
- 7142,
70
+ 7356,
72
71
  "When the user clicks this participant in `/help`, this text will be submitted to the participant."
73
72
  )),
74
73
  type: 'string'
75
74
  },
76
75
  when: {
77
- description: ( localize(7143, "A condition which must be true to enable this participant.")),
76
+ description: ( localize(7357, "A condition which must be true to enable this participant.")),
78
77
  type: 'string'
79
78
  },
80
79
  disambiguation: {
81
80
  description: ( localize(
82
- 7144,
83
- "Metadata to help with automatically routing user questions to this chat participant. You must add `contribChatParticipantDetection` to `enabledApiProposals` to use this API."
81
+ 7358,
82
+ "Metadata to help with automatically routing user questions to this chat participant."
84
83
  )),
85
84
  type: 'array',
86
85
  items: {
87
86
  additionalProperties: false,
88
87
  type: 'object',
89
- defaultSnippets: [{ body: { categoryName: '', description: '', examples: [] } }],
90
- required: ['categoryName', 'description', 'examples'],
88
+ defaultSnippets: [{ body: { category: '', description: '', examples: [] } }],
89
+ required: ['category', 'description', 'examples'],
91
90
  properties: {
92
- categoryName: {
91
+ category: {
93
92
  markdownDescription: ( localize(
94
- 7145,
93
+ 7359,
95
94
  "A detailed name for this category, e.g. `workspace_questions` or `web_questions`."
96
95
  )),
97
96
  type: 'string'
98
97
  },
99
98
  description: {
100
99
  description: ( localize(
101
- 7146,
100
+ 7360,
102
101
  "A detailed description of the kinds of questions that are suitable for this chat participant."
103
102
  )),
104
103
  type: 'string'
105
104
  },
106
105
  examples: {
107
106
  description: ( localize(
108
- 7147,
107
+ 7361,
109
108
  "A list of representative example questions that are suitable for this chat participant."
110
109
  )),
111
110
  type: 'array'
@@ -115,7 +114,7 @@ const chatParticipantExtensionPoint = ExtensionsRegistry.registerExtensionPoint(
115
114
  },
116
115
  commands: {
117
116
  markdownDescription: ( localize(
118
- 7148,
117
+ 7362,
119
118
  "Commands available for this chat participant, which the user can invoke with a `/`."
120
119
  )),
121
120
  type: 'array',
@@ -127,62 +126,62 @@ const chatParticipantExtensionPoint = ExtensionsRegistry.registerExtensionPoint(
127
126
  properties: {
128
127
  name: {
129
128
  description: ( localize(
130
- 7149,
129
+ 7363,
131
130
  "A short name by which this command is referred to in the UI, e.g. `fix` or * `explain` for commands that fix an issue or explain code. The name should be unique among the commands provided by this participant."
132
131
  )),
133
132
  type: 'string'
134
133
  },
135
134
  description: {
136
- description: ( localize(7150, "A description of this command.")),
135
+ description: ( localize(7364, "A description of this command.")),
137
136
  type: 'string'
138
137
  },
139
138
  when: {
140
- description: ( localize(7151, "A condition which must be true to enable this command.")),
139
+ description: ( localize(7365, "A condition which must be true to enable this command.")),
141
140
  type: 'string'
142
141
  },
143
142
  sampleRequest: {
144
143
  description: ( localize(
145
- 7152,
144
+ 7366,
146
145
  "When the user clicks this command in `/help`, this text will be submitted to the participant."
147
146
  )),
148
147
  type: 'string'
149
148
  },
150
149
  isSticky: {
151
150
  description: ( localize(
152
- 7141,
151
+ 7355,
153
152
  "Whether invoking the command puts the chat into a persistent mode, where the command is automatically added to the chat input for the next message."
154
153
  )),
155
154
  type: 'boolean'
156
155
  },
157
156
  disambiguation: {
158
157
  description: ( localize(
159
- 7153,
160
- "Metadata to help with automatically routing user questions to this chat command. You must add `contribChatParticipantDetection` to `enabledApiProposals` to use this API."
158
+ 7367,
159
+ "Metadata to help with automatically routing user questions to this chat command."
161
160
  )),
162
161
  type: 'array',
163
162
  items: {
164
163
  additionalProperties: false,
165
164
  type: 'object',
166
- defaultSnippets: [{ body: { categoryName: '', description: '', examples: [] } }],
167
- required: ['categoryName', 'description', 'examples'],
165
+ defaultSnippets: [{ body: { category: '', description: '', examples: [] } }],
166
+ required: ['category', 'description', 'examples'],
168
167
  properties: {
169
- categoryName: {
168
+ category: {
170
169
  markdownDescription: ( localize(
171
- 7154,
170
+ 7368,
172
171
  "A detailed name for this category, e.g. `workspace_questions` or `web_questions`."
173
172
  )),
174
173
  type: 'string'
175
174
  },
176
175
  description: {
177
176
  description: ( localize(
178
- 7155,
177
+ 7369,
179
178
  "A detailed description of the kinds of questions that are suitable for this chat command."
180
179
  )),
181
180
  type: 'string'
182
181
  },
183
182
  examples: {
184
183
  description: ( localize(
185
- 7156,
184
+ 7370,
186
185
  "A list of representative example questions that are suitable for this chat command."
187
186
  )),
188
187
  type: 'array'
@@ -195,7 +194,7 @@ const chatParticipantExtensionPoint = ExtensionsRegistry.registerExtensionPoint(
195
194
  },
196
195
  supportsToolReferences: {
197
196
  description: ( localize(
198
- 7157,
197
+ 7371,
199
198
  "Whether this participant supports {0}.",
200
199
  'ChatRequest#toolReferences'
201
200
  )),
@@ -240,7 +239,7 @@ let ChatExtensionPointHandler = class ChatExtensionPointHandler {
240
239
  this.logService.error(`Extension '${extension.description.identifier.value}' CANNOT use API proposal: defaultChatParticipant.`);
241
240
  continue;
242
241
  }
243
- if ((providerDescriptor.defaultImplicitVariables || providerDescriptor.locations) && !isProposedApiEnabled(extension.description, 'chatParticipantAdditions')) {
242
+ if ((providerDescriptor.defaultImplicitVariables || providerDescriptor.locations || providerDescriptor.supportsModelPicker) && !isProposedApiEnabled(extension.description, 'chatParticipantAdditions')) {
244
243
  this.logService.error(`Extension '${extension.description.identifier.value}' CANNOT use API proposal: chatParticipantAdditions.`);
245
244
  continue;
246
245
  }
@@ -249,25 +248,18 @@ let ChatExtensionPointHandler = class ChatExtensionPointHandler {
249
248
  continue;
250
249
  }
251
250
  const participantsAndCommandsDisambiguation = [];
252
- let hasLoggedParticipantDetectionApiWarning = false;
253
- if (providerDescriptor.disambiguation?.length) {
254
- if (isProposedApiEnabled(extension.description, 'contribChatParticipantDetection')) {
255
- participantsAndCommandsDisambiguation.push(...providerDescriptor.disambiguation);
256
- }
257
- else if (!hasLoggedParticipantDetectionApiWarning) {
258
- this.logService.warn(`'${extension.description.identifier.value}' must add API proposal: 'contribChatParticipantDetection' to 'enabledApiProposals' to contribute disambiguation metadata.`);
259
- hasLoggedParticipantDetectionApiWarning = true;
251
+ if (isProposedApiEnabled(extension.description, 'contribChatParticipantDetection')) {
252
+ if (providerDescriptor.disambiguation?.length) {
253
+ participantsAndCommandsDisambiguation.push(...( (providerDescriptor.disambiguation.map((d) => ({
254
+ ...d, category: d.category ?? d.categoryName
255
+ })))));
260
256
  }
261
- }
262
- if (providerDescriptor.commands) {
263
- for (const command of providerDescriptor.commands) {
264
- if (command.disambiguation?.length) {
265
- if (isProposedApiEnabled(extension.description, 'contribChatParticipantDetection')) {
266
- participantsAndCommandsDisambiguation.push(...command.disambiguation);
267
- }
268
- else if (!hasLoggedParticipantDetectionApiWarning) {
269
- this.logService.warn(`'${extension.description.identifier.value}' must add API proposal: 'contribChatParticipantDetection' to 'enabledApiProposals' to contribute disambiguation metadata.`);
270
- hasLoggedParticipantDetectionApiWarning = true;
257
+ if (providerDescriptor.commands) {
258
+ for (const command of providerDescriptor.commands) {
259
+ if (command.disambiguation?.length) {
260
+ participantsAndCommandsDisambiguation.push(...( (command.disambiguation.map((d) => ({
261
+ ...d, category: d.category ?? d.categoryName
262
+ })))));
271
263
  }
272
264
  }
273
265
  }
@@ -280,6 +272,7 @@ let ChatExtensionPointHandler = class ChatExtensionPointHandler {
280
272
  extensionDisplayName: extension.description.displayName ?? extension.description.name,
281
273
  id: providerDescriptor.id,
282
274
  description: providerDescriptor.description,
275
+ supportsModelPicker: providerDescriptor.supportsModelPicker,
283
276
  when: providerDescriptor.when,
284
277
  metadata: {
285
278
  isSticky: providerDescriptor.isSticky,
@@ -306,7 +299,7 @@ let ChatExtensionPointHandler = class ChatExtensionPointHandler {
306
299
  });
307
300
  }
308
301
  registerViewContainer() {
309
- const title = ( localize2(7158, "Chat"));
302
+ const title = ( localize2(7372, "Chat"));
310
303
  const icon = Codicon.commentDiscussion;
311
304
  const viewContainerId = CHAT_SIDEBAR_PANEL_ID;
312
305
  const viewContainer = ( (Registry.as(Extensions.ViewContainersRegistry))).registerViewContainer({
@@ -320,7 +313,7 @@ let ChatExtensionPointHandler = class ChatExtensionPointHandler {
320
313
  storageId: viewContainerId,
321
314
  hideIfEmpty: true,
322
315
  order: 100,
323
- }, ViewContainerLocation.Sidebar);
316
+ }, 0 );
324
317
  return viewContainer;
325
318
  }
326
319
  registerDefaultParticipantView() {
@@ -349,43 +342,50 @@ ChatExtensionPointHandler = ( (__decorate([
349
342
  function getParticipantKey(extensionId, participantName) {
350
343
  return `${extensionId.value}_${participantName}`;
351
344
  }
352
- let ChatCompatibilityNotifier = class ChatCompatibilityNotifier {
345
+ let ChatCompatibilityNotifier = class ChatCompatibilityNotifier extends Disposable {
353
346
  static { this.ID = 'workbench.contrib.chatCompatNotifier'; }
354
- constructor(extensionsWorkbenchService, contextKeyService, chatAgentService, productService) {
347
+ constructor(extensionsWorkbenchService, contextKeyService, productService) {
348
+ super();
349
+ this.productService = productService;
350
+ this.registeredWelcomeView = false;
355
351
  const isInvalid = CONTEXT_CHAT_EXTENSION_INVALID.bindTo(contextKeyService);
356
- extensionsWorkbenchService.queryLocal().then(exts => {
357
- const chat = exts.find(ext => ext.identifier.id === 'github.copilot-chat');
358
- if (chat?.local?.validations.some(v => v[0] === Severity$1.Error)) {
359
- const showExtensionLabel = ( localize(7159, "Show Extension"));
360
- const mainMessage = ( localize(
361
- 7160,
362
- "Chat failed to load because the installed version of the {0} extension is not compatible with this version of {1}. Please ensure that the GitHub Copilot Chat extension is up to date.",
363
- 'GitHub Copilot Chat',
364
- productService.nameLong
365
- ));
366
- const commandButton = `[${showExtensionLabel}](command:${showExtensionsWithIdsCommandId}?${encodeURIComponent(JSON.stringify([['GitHub.copilot-chat']]))})`;
367
- const versionMessage = `GitHub Copilot Chat version: ${chat.version}`;
368
- const viewsRegistry = ( (Registry.as(Extensions.ViewsRegistry)));
369
- viewsRegistry.registerViewWelcomeContent(CHAT_VIEW_ID, {
370
- content: [mainMessage, commandButton, versionMessage].join('\n\n'),
371
- when: CONTEXT_CHAT_EXTENSION_INVALID,
372
- });
352
+ this._register(Event.runAndSubscribe(extensionsWorkbenchService.onDidChangeExtensionsNotification, () => {
353
+ const notification = extensionsWorkbenchService.getExtensionsNotification();
354
+ const chatExtension = notification?.extensions.find(ext => ext.identifier.id === 'github.copilot-chat');
355
+ if (chatExtension) {
373
356
  isInvalid.set(true);
357
+ this.registerWelcomeView(chatExtension);
374
358
  }
375
- });
376
- const listener = chatAgentService.onDidChangeAgents(() => {
377
- if (chatAgentService.getDefaultAgent(ChatAgentLocation.Panel)) {
359
+ else {
378
360
  isInvalid.set(false);
379
- listener.dispose();
380
361
  }
381
- });
362
+ }));
363
+ }
364
+ registerWelcomeView(chatExtension) {
365
+ if (this.registeredWelcomeView) {
366
+ return;
367
+ }
368
+ this.registeredWelcomeView = true;
369
+ const showExtensionLabel = ( localize(7373, "Show Extension"));
370
+ const mainMessage = ( localize(
371
+ 7374,
372
+ "Chat failed to load because the installed version of the {0} extension is not compatible with this version of {1}. Please ensure that the GitHub Copilot Chat extension is up to date.",
373
+ 'GitHub Copilot Chat',
374
+ this.productService.nameLong
375
+ ));
376
+ const commandButton = `[${showExtensionLabel}](command:${showExtensionsWithIdsCommandId}?${encodeURIComponent(JSON.stringify([['GitHub.copilot-chat']]))})`;
377
+ const versionMessage = `GitHub Copilot Chat version: ${chatExtension.version}`;
378
+ const viewsRegistry = ( (Registry.as(Extensions.ViewsRegistry)));
379
+ this._register(viewsRegistry.registerViewWelcomeContent(CHAT_VIEW_ID, {
380
+ content: [mainMessage, commandButton, versionMessage].join('\n\n'),
381
+ when: CONTEXT_CHAT_EXTENSION_INVALID,
382
+ }));
382
383
  }
383
384
  };
384
385
  ChatCompatibilityNotifier = ( (__decorate([
385
386
  ( (__param(0, IExtensionsWorkbenchService))),
386
387
  ( (__param(1, IContextKeyService))),
387
- ( (__param(2, IChatAgentService))),
388
- ( (__param(3, IProductService)))
388
+ ( (__param(2, IProductService)))
389
389
  ], ChatCompatibilityNotifier)));
390
390
 
391
391
  export { ChatCompatibilityNotifier, ChatExtensionPointHandler };
@@ -0,0 +1,26 @@
1
+ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
2
+ import { HierarchicalKind } from 'vscode/vscode/vs/base/common/hierarchicalKind';
3
+ import { ILanguageFeaturesService } from 'vscode/vscode/vs/editor/common/services/languageFeatures';
4
+ import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
5
+ import { ChatInputPart } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chatInputPart';
6
+
7
+ class PasteImageProvider {
8
+ constructor() {
9
+ this.kind = ( new HierarchicalKind('image'));
10
+ this.pasteMimeTypes = ['image/*'];
11
+ }
12
+ async provideDocumentPasteEdits(_model, _ranges, dataTransfer, context, token) {
13
+ return;
14
+ }
15
+ }
16
+ let ChatPasteProvidersFeature = class ChatPasteProvidersFeature extends Disposable {
17
+ constructor(languageFeaturesService) {
18
+ super();
19
+ this._register(languageFeaturesService.documentPasteEditProvider.register({ scheme: ChatInputPart.INPUT_SCHEME, pattern: '*', hasAccessToAllModels: true }, ( new PasteImageProvider())));
20
+ }
21
+ };
22
+ ChatPasteProvidersFeature = ( __decorate([
23
+ ( __param(0, ILanguageFeaturesService))
24
+ ], ChatPasteProvidersFeature));
25
+
26
+ export { ChatPasteProvidersFeature, PasteImageProvider };