@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,29 +1,32 @@
1
- import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
1
+
2
+ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
2
3
  import { renderStringAsPlaintext } from 'vscode/vscode/vs/base/browser/markdownRenderer';
3
4
  import { RunOnceScheduler } from 'vscode/vscode/vs/base/common/async';
4
- import { CancellationError } from 'vscode/vscode/vs/base/common/errors';
5
+ import { CancellationError, isCancellationError } from 'vscode/vscode/vs/base/common/errors';
5
6
  import { Emitter } from 'vscode/vscode/vs/base/common/event';
6
7
  import { Iterable } from 'vscode/vscode/vs/base/common/iterator';
7
8
  import { Disposable, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
8
9
  import { localize } from 'vscode/vscode/vs/nls';
9
10
  import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
10
11
  import { IDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs.service';
12
+ import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service';
11
13
  import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions.service';
12
14
  import { ChatToolInvocation } from '../common/chatProgressTypes/chatToolInvocation.js';
13
15
  import { IChatService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatService.service';
14
16
 
15
17
  let LanguageModelToolsService = class LanguageModelToolsService extends Disposable {
16
- constructor(_extensionService, _contextKeyService, _chatService, _dialogService) {
18
+ constructor(_extensionService, _contextKeyService, _chatService, _dialogService, _telemetryService) {
17
19
  super();
18
20
  this._extensionService = _extensionService;
19
21
  this._contextKeyService = _contextKeyService;
20
22
  this._chatService = _chatService;
21
23
  this._dialogService = _dialogService;
22
- this._onDidChangeTools = ( (new Emitter()));
24
+ this._telemetryService = _telemetryService;
25
+ this._onDidChangeTools = ( new Emitter());
23
26
  this.onDidChangeTools = this._onDidChangeTools.event;
24
- this._onDidChangeToolsScheduler = ( (new RunOnceScheduler(() => this._onDidChangeTools.fire(), 750)));
25
- this._tools = ( (new Map()));
26
- this._toolContextKeys = ( (new Set()));
27
+ this._onDidChangeToolsScheduler = ( new RunOnceScheduler(() => this._onDidChangeTools.fire(), 750));
28
+ this._tools = ( new Map());
29
+ this._toolContextKeys = ( new Set());
27
30
  this._register(this._contextKeyService.onDidChangeContext(e => {
28
31
  if (e.affectsSome(this._toolContextKeys)) {
29
32
  this._onDidChangeToolsScheduler.schedule();
@@ -31,8 +34,8 @@ let LanguageModelToolsService = class LanguageModelToolsService extends Disposab
31
34
  }));
32
35
  }
33
36
  registerToolData(toolData) {
34
- if (( (this._tools.has(toolData.id)))) {
35
- throw ( (new Error(`Tool "${toolData.id}" is already registered.`)));
37
+ if (( this._tools.has(toolData.id))) {
38
+ throw ( new Error(`Tool "${toolData.id}" is already registered.`));
36
39
  }
37
40
  this._tools.set(toolData.id, { data: toolData });
38
41
  this._onDidChangeToolsScheduler.schedule();
@@ -45,17 +48,17 @@ let LanguageModelToolsService = class LanguageModelToolsService extends Disposab
45
48
  }
46
49
  _refreshAllToolContextKeys() {
47
50
  this._toolContextKeys.clear();
48
- for (const tool of ( (this._tools.values()))) {
51
+ for (const tool of ( this._tools.values())) {
49
52
  tool.data.when?.keys().forEach(key => this._toolContextKeys.add(key));
50
53
  }
51
54
  }
52
55
  registerToolImplementation(id, tool) {
53
56
  const entry = this._tools.get(id);
54
57
  if (!entry) {
55
- throw ( (new Error(`Tool "${id}" was not contributed.`)));
58
+ throw ( new Error(`Tool "${id}" was not contributed.`));
56
59
  }
57
60
  if (entry.impl) {
58
- throw ( (new Error(`Tool "${id}" already has an implementation.`)));
61
+ throw ( new Error(`Tool "${id}" already has an implementation.`));
59
62
  }
60
63
  entry.impl = tool;
61
64
  return toDisposable(() => {
@@ -63,7 +66,7 @@ let LanguageModelToolsService = class LanguageModelToolsService extends Disposab
63
66
  });
64
67
  }
65
68
  getTools() {
66
- const toolDatas = ( (Iterable.map( (this._tools.values()), i => i.data)));
69
+ const toolDatas = ( Iterable.map(( this._tools.values()), i => i.data));
67
70
  return Iterable.filter(toolDatas, toolData => !toolData.when || this._contextKeyService.contextMatchesRules(toolData.when));
68
71
  }
69
72
  getTool(id) {
@@ -89,60 +92,78 @@ let LanguageModelToolsService = class LanguageModelToolsService extends Disposab
89
92
  async invokeTool(dto, countTokens, token) {
90
93
  let tool = this._tools.get(dto.toolId);
91
94
  if (!tool) {
92
- throw ( (new Error(`Tool ${dto.toolId} was not contributed`)));
95
+ throw ( new Error(`Tool ${dto.toolId} was not contributed`));
93
96
  }
94
97
  if (!tool.impl) {
95
98
  await this._extensionService.activateByEvent(`onLanguageModelTool:${dto.toolId}`);
96
99
  tool = this._tools.get(dto.toolId);
97
100
  if (!tool?.impl) {
98
- throw ( (new Error(`Tool ${dto.toolId} does not have an implementation registered.`)));
101
+ throw ( new Error(`Tool ${dto.toolId} does not have an implementation registered.`));
99
102
  }
100
103
  }
101
104
  let toolInvocation;
102
- if (dto.context) {
103
- const model = this._chatService.getSession(dto.context?.sessionId);
104
- const request = model.getRequests().at(-1);
105
- const prepared = tool.impl.prepareToolInvocation ?
106
- await tool.impl.prepareToolInvocation(dto.parameters, token)
107
- : undefined;
108
- const defaultMessage = ( localize(3215, "Using {0}", `"${tool.data.displayName}"`));
109
- const invocationMessage = prepared?.invocationMessage ?? defaultMessage;
110
- toolInvocation = ( (new ChatToolInvocation(invocationMessage, prepared?.confirmationMessages)));
111
- token.onCancellationRequested(() => {
112
- toolInvocation.confirmed.complete(false);
113
- });
114
- model.acceptResponseProgress(request, toolInvocation);
115
- if (prepared?.confirmationMessages) {
116
- const userConfirmed = await toolInvocation.confirmed.p;
117
- if (!userConfirmed) {
118
- throw ( (new CancellationError()));
105
+ try {
106
+ if (dto.context) {
107
+ const model = this._chatService.getSession(dto.context?.sessionId);
108
+ const request = model.getRequests().at(-1);
109
+ const prepared = tool.impl.prepareToolInvocation ?
110
+ await tool.impl.prepareToolInvocation(dto.parameters, token)
111
+ : undefined;
112
+ const defaultMessage = ( localize(4575, "Using {0}", `"${tool.data.displayName}"`));
113
+ const invocationMessage = prepared?.invocationMessage ?? defaultMessage;
114
+ toolInvocation = ( new ChatToolInvocation(invocationMessage, prepared?.confirmationMessages));
115
+ token.onCancellationRequested(() => {
116
+ toolInvocation.confirmed.complete(false);
117
+ });
118
+ model.acceptResponseProgress(request, toolInvocation);
119
+ if (prepared?.confirmationMessages) {
120
+ const userConfirmed = await toolInvocation.confirmed.p;
121
+ if (!userConfirmed) {
122
+ throw ( new CancellationError());
123
+ }
119
124
  }
120
125
  }
121
- }
122
- else {
123
- const prepared = tool.impl.prepareToolInvocation ?
124
- await tool.impl.prepareToolInvocation(dto.parameters, token)
125
- : undefined;
126
- if (prepared?.confirmationMessages) {
127
- const result = await this._dialogService.confirm({ message: prepared.confirmationMessages.title, detail: renderStringAsPlaintext(prepared.confirmationMessages.message) });
128
- if (!result.confirmed) {
129
- throw ( (new CancellationError()));
126
+ else {
127
+ const prepared = tool.impl.prepareToolInvocation ?
128
+ await tool.impl.prepareToolInvocation(dto.parameters, token)
129
+ : undefined;
130
+ if (prepared?.confirmationMessages) {
131
+ const result = await this._dialogService.confirm({ message: prepared.confirmationMessages.title, detail: renderStringAsPlaintext(prepared.confirmationMessages.message) });
132
+ if (!result.confirmed) {
133
+ throw ( new CancellationError());
134
+ }
130
135
  }
131
136
  }
137
+ const result = await tool.impl.invoke(dto, countTokens, token);
138
+ this._telemetryService.publicLog2('languageModelToolInvoked', {
139
+ result: 'success',
140
+ chatSessionId: dto.context?.sessionId,
141
+ toolId: tool.data.id,
142
+ toolExtensionId: tool.data.extensionId?.value,
143
+ });
144
+ return result;
132
145
  }
133
- try {
134
- return await tool.impl.invoke(dto, countTokens, token);
146
+ catch (err) {
147
+ const result = isCancellationError(err) ? 'userCancelled' : 'error';
148
+ this._telemetryService.publicLog2('languageModelToolInvoked', {
149
+ result,
150
+ chatSessionId: dto.context?.sessionId,
151
+ toolId: tool.data.id,
152
+ toolExtensionId: tool.data.extensionId?.value,
153
+ });
154
+ throw err;
135
155
  }
136
156
  finally {
137
157
  toolInvocation?.isCompleteDeferred.complete();
138
158
  }
139
159
  }
140
160
  };
141
- LanguageModelToolsService = ( (__decorate([
142
- ( (__param(0, IExtensionService))),
143
- ( (__param(1, IContextKeyService))),
144
- ( (__param(2, IChatService))),
145
- ( (__param(3, IDialogService)))
146
- ], LanguageModelToolsService)));
161
+ LanguageModelToolsService = ( __decorate([
162
+ ( __param(0, IExtensionService)),
163
+ ( __param(1, IContextKeyService)),
164
+ ( __param(2, IChatService)),
165
+ ( __param(3, IDialogService)),
166
+ ( __param(4, ITelemetryService))
167
+ ], LanguageModelToolsService));
147
168
 
148
169
  export { LanguageModelToolsService };
@@ -0,0 +1,6 @@
1
+ import n from 'vscode/external/rollup-plugin-styles/dist/runtime/inject-css';
2
+
3
+ var css = ".chat-welcome-view .chat-setup-view{text-align:center;p{width:100%}.chat-features-container{background-color:var(--vscode-chat-requestBackground);border:1px solid var(--vscode-chat-requestBorder);border-radius:2px;text-align:initial}.chat-feature-container{align-items:center;display:flex;gap:6px;padding:5px 10px}.chat-feature-container .codicon[class*=codicon-]{font-size:16px}.codicon[class*=codicon-]{font-size:13px;line-height:1.4em;vertical-align:bottom}.button-container{padding-top:20px}.monaco-button-dropdown,.monaco-button-dropdown .monaco-text-button{width:100%}p>.monaco-button{display:inline-block;padding:4px 7px;text-align:center;width:100%}}";
4
+ n(css,{});
5
+
6
+ export { css, css as default };
@@ -0,0 +1,7 @@
1
+ import { ILogService } from "vscode/vscode/vs/platform/log/common/log.service";
2
+ import { IWorkbenchContribution } from "vscode/vscode/vs/workbench/common/contributions";
3
+ export declare class ChatViewsWelcomeHandler implements IWorkbenchContribution {
4
+ private readonly logService;
5
+ static readonly ID = "workbench.contrib.chatViewsWelcomeHandler";
6
+ constructor(logService: ILogService);
7
+ }
@@ -1,4 +1,5 @@
1
- import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
1
+
2
+ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
2
3
  import { MarkdownString } from 'vscode/vscode/vs/base/common/htmlContent';
3
4
  import { ThemeIcon } from 'vscode/vscode/vs/base/common/themables';
4
5
  import { localize } from 'vscode/vscode/vs/nls';
@@ -7,11 +8,12 @@ import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
7
8
  import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
8
9
  import { checkProposedApiEnabled } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions';
9
10
  import { ExtensionsRegistry } from 'vscode/vscode/vs/workbench/services/extensions/common/extensionsRegistry';
11
+ import { ChatViewsWelcomeExtensions } from '@codingame/monaco-vscode-c465110a-57c0-59d7-a6b2-be0a4db7e517-common/vscode/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcome';
10
12
 
11
13
  const chatViewsWelcomeExtensionPoint = ExtensionsRegistry.registerExtensionPoint({
12
14
  extensionPoint: 'chatViewsWelcome',
13
15
  jsonSchema: {
14
- description: ( localize(7675, 'Contributes a welcome message to a chat view')),
16
+ description: ( localize(4577, 'Contributes a welcome message to a chat view')),
15
17
  type: 'array',
16
18
  items: {
17
19
  additionalProperties: false,
@@ -19,22 +21,22 @@ const chatViewsWelcomeExtensionPoint = ExtensionsRegistry.registerExtensionPoint
19
21
  properties: {
20
22
  icon: {
21
23
  type: 'string',
22
- description: ( localize(7676, 'The icon for the welcome message.')),
24
+ description: ( localize(4578, 'The icon for the welcome message.')),
23
25
  },
24
26
  title: {
25
27
  type: 'string',
26
- description: ( localize(7677, 'The title of the welcome message.')),
28
+ description: ( localize(4579, 'The title of the welcome message.')),
27
29
  },
28
30
  content: {
29
31
  type: 'string',
30
32
  description: ( localize(
31
- 7678,
33
+ 4580,
32
34
  'The content of the welcome message. The first command link will be rendered as a button.'
33
35
  )),
34
36
  },
35
37
  when: {
36
38
  type: 'string',
37
- description: ( localize(7679, 'Condition when the welcome message is shown.')),
39
+ description: ( localize(4581, 'Condition when the welcome message is shown.')),
38
40
  }
39
41
  }
40
42
  },
@@ -58,18 +60,16 @@ let ChatViewsWelcomeHandler = class ChatViewsWelcomeHandler {
58
60
  ...providerDescriptor,
59
61
  when,
60
62
  icon: ThemeIcon.fromString(providerDescriptor.icon),
61
- content: ( (new MarkdownString(providerDescriptor.content, { isTrusted: true }))),
63
+ content: ( new MarkdownString(providerDescriptor.content, { isTrusted: true })),
62
64
  };
63
- ( (Registry.as(
64
- "workbench.registry.chat.viewsWelcome"
65
- ))).register(descriptor);
65
+ ( Registry.as(ChatViewsWelcomeExtensions.ChatViewsWelcomeRegistry)).register(descriptor);
66
66
  }
67
67
  }
68
68
  });
69
69
  }
70
70
  };
71
- ChatViewsWelcomeHandler = ( (__decorate([
72
- ( (__param(0, ILogService)))
73
- ], ChatViewsWelcomeHandler)));
71
+ ChatViewsWelcomeHandler = ( __decorate([
72
+ ( __param(0, ILogService))
73
+ ], ChatViewsWelcomeHandler));
74
74
 
75
75
  export { ChatViewsWelcomeHandler };
@@ -0,0 +1,44 @@
1
+ import { CancellationToken } from "vscode/vscode/vs/base/common/cancellation";
2
+ import { IDisposable } from "vscode/vscode/vs/base/common/lifecycle";
3
+ import { URI } from "vscode/vscode/vs/base/common/uri";
4
+ import { DocumentContextItem, TextEdit } from "vscode/vscode/vs/editor/common/languages";
5
+ import { IChatAgentResult } from "vscode/vscode/vs/workbench/contrib/chat/common/chatAgents";
6
+ import { ICodeMapperService } from "vscode/vscode/vs/workbench/contrib/chat/common/chatCodeMapperService.service";
7
+ import { IChatResponseModel } from "@codingame/monaco-vscode-fab30422-b487-5f4e-8d30-8b4d266e3fcd-common/vscode/vs/workbench/contrib/chat/common/chatModel";
8
+ import { IChatContentReference } from "vscode/vscode/vs/workbench/contrib/chat/common/chatService";
9
+ export interface ICodeMapperResponse {
10
+ textEdit: (resource: URI, textEdit: TextEdit[]) => void;
11
+ }
12
+ export interface ICodeMapperCodeBlock {
13
+ readonly code: string;
14
+ readonly resource: URI;
15
+ readonly markdownBeforeBlock?: string;
16
+ }
17
+ export interface ConversationRequest {
18
+ readonly type: "request";
19
+ readonly message: string;
20
+ }
21
+ export interface ConversationResponse {
22
+ readonly type: "response";
23
+ readonly message: string;
24
+ readonly result?: IChatAgentResult;
25
+ readonly references?: DocumentContextItem[];
26
+ }
27
+ export interface ICodeMapperRequest {
28
+ readonly codeBlocks: ICodeMapperCodeBlock[];
29
+ readonly conversation: (ConversationResponse | ConversationRequest)[];
30
+ }
31
+ export interface ICodeMapperResult {
32
+ readonly errorMessage?: string;
33
+ }
34
+ export interface ICodeMapperProvider {
35
+ mapCode(request: ICodeMapperRequest, response: ICodeMapperResponse, token: CancellationToken): Promise<ICodeMapperResult | undefined>;
36
+ }
37
+ export declare class CodeMapperService implements ICodeMapperService {
38
+ _serviceBrand: undefined;
39
+ private readonly providers;
40
+ registerCodeMapperProvider(handle: number, provider: ICodeMapperProvider): IDisposable;
41
+ mapCode(request: ICodeMapperRequest, response: ICodeMapperResponse, token: CancellationToken): Promise<ICodeMapperResult | undefined>;
42
+ mapCodeFromResponse(responseModel: IChatResponseModel, response: ICodeMapperResponse, token: CancellationToken): Promise<ICodeMapperResult | undefined>;
43
+ }
44
+ export declare function getReferencesAsDocumentContext(res: readonly IChatContentReference[]): DocumentContextItem[];
@@ -1,3 +1,5 @@
1
+
2
+ import { CharCode } from 'vscode/vscode/vs/base/common/charCode';
1
3
  import { ResourceMap } from 'vscode/vscode/vs/base/common/map';
2
4
  import { splitLinesIncludeSeparators } from 'vscode/vscode/vs/base/common/strings';
3
5
  import { isString } from 'vscode/vscode/vs/base/common/types';
@@ -114,7 +116,7 @@ function iterateLinesOrUris(responseModel) {
114
116
  }
115
117
  function isLineIncomplete(line) {
116
118
  const lastChar = line.charCodeAt(line.length - 1);
117
- return lastChar !== 10 && lastChar !== 13 ;
119
+ return lastChar !== CharCode.LineFeed && lastChar !== CharCode.CarriageReturn;
118
120
  }
119
121
  function getReferencesAsDocumentContext(res) {
120
122
  const map = ( new ResourceMap());
@@ -0,0 +1,22 @@
1
+ import { DeferredPromise } from "vscode/vscode/vs/base/common/async";
2
+ import { IMarkdownString } from "vscode/vscode/vs/base/common/htmlContent";
3
+ import { IChatToolInvocation, IChatToolInvocationSerialized } from "vscode/vscode/vs/workbench/contrib/chat/common/chatService";
4
+ import { IToolConfirmationMessages } from "vscode/vscode/vs/workbench/contrib/chat/common/languageModelToolsService";
5
+ export declare class ChatToolInvocation implements IChatToolInvocation {
6
+ readonly invocationMessage: string | IMarkdownString;
7
+ private _confirmationMessages;
8
+ readonly kind: "toolInvocation";
9
+ private _isComplete;
10
+ get isComplete(): boolean;
11
+ private _isCompleteDeferred;
12
+ get isCompleteDeferred(): DeferredPromise<void>;
13
+ private _isCanceled;
14
+ get isCanceled(): boolean | undefined;
15
+ private _confirmDeferred;
16
+ get confirmed(): DeferredPromise<boolean>;
17
+ private _isConfirmed;
18
+ get isConfirmed(): boolean | undefined;
19
+ constructor(invocationMessage: string | IMarkdownString, _confirmationMessages: IToolConfirmationMessages | undefined);
20
+ get confirmationMessages(): IToolConfirmationMessages | undefined;
21
+ toJSON(): IChatToolInvocationSerialized;
22
+ }
@@ -1,3 +1,4 @@
1
+
1
2
  import { DeferredPromise } from 'vscode/vscode/vs/base/common/async';
2
3
 
3
4
  class ChatToolInvocation {
@@ -0,0 +1,80 @@
1
+ import { CancellationToken } from "vscode/vscode/vs/base/common/cancellation";
2
+ import { Event } from "vscode/vscode/vs/base/common/event";
3
+ import { Disposable } from "vscode/vscode/vs/base/common/lifecycle";
4
+ import { URI } from "vscode/vscode/vs/base/common/uri";
5
+ import { IConfigurationService } from "vscode/vscode/vs/platform/configuration/common/configuration.service";
6
+ import { IInstantiationService } from "vscode/vscode/vs/platform/instantiation/common/instantiation";
7
+ import { ILogService } from "vscode/vscode/vs/platform/log/common/log.service";
8
+ import { IStorageService } from "vscode/vscode/vs/platform/storage/common/storage.service";
9
+ import { ITelemetryService } from "vscode/vscode/vs/platform/telemetry/common/telemetry.service";
10
+ import { IWorkspaceContextService } from "vscode/vscode/vs/platform/workspace/common/workspace.service";
11
+ import { IExtensionService } from "vscode/vscode/vs/workbench/services/extensions/common/extensions.service";
12
+ import { ChatAgentLocation } from "vscode/vscode/vs/workbench/contrib/chat/common/chatAgents";
13
+ import { IChatAgentService } from "vscode/vscode/vs/workbench/contrib/chat/common/chatAgents.service";
14
+ import { ChatModel, IChatModel, IChatRequestModel, IChatRequestVariableData, IExportableChatData, ISerializableChatData } from "@codingame/monaco-vscode-fab30422-b487-5f4e-8d30-8b4d266e3fcd-common/vscode/vs/workbench/contrib/chat/common/chatModel";
15
+ import { IParsedChatRequest } from "@codingame/monaco-vscode-fab30422-b487-5f4e-8d30-8b4d266e3fcd-common/vscode/vs/workbench/contrib/chat/common/chatParserTypes";
16
+ import { IChatCompleteResponse, IChatDetail, IChatSendRequestData, IChatSendRequestOptions, IChatTransferredSessionData, IChatUserActionEvent } from "vscode/vscode/vs/workbench/contrib/chat/common/chatService";
17
+ import { IChatService } from "vscode/vscode/vs/workbench/contrib/chat/common/chatService.service";
18
+ import { IChatSlashCommandService } from "vscode/vscode/vs/workbench/contrib/chat/common/chatSlashCommands.service";
19
+ import { IChatVariablesService } from "vscode/vscode/vs/workbench/contrib/chat/common/chatVariables.service";
20
+ export declare class ChatService extends Disposable implements IChatService {
21
+ private readonly storageService;
22
+ private readonly logService;
23
+ private readonly extensionService;
24
+ private readonly instantiationService;
25
+ private readonly telemetryService;
26
+ private readonly workspaceContextService;
27
+ private readonly chatSlashCommandService;
28
+ private readonly chatVariablesService;
29
+ private readonly chatAgentService;
30
+ private readonly configurationService;
31
+ _serviceBrand: undefined;
32
+ private readonly _sessionModels;
33
+ private readonly _pendingRequests;
34
+ private _persistedSessions;
35
+ private _deletedChatIds;
36
+ private _transferredSessionData;
37
+ get transferredSessionData(): IChatTransferredSessionData | undefined;
38
+ private readonly _onDidPerformUserAction;
39
+ readonly onDidPerformUserAction: Event<IChatUserActionEvent>;
40
+ private readonly _onDidDisposeSession;
41
+ readonly onDidDisposeSession: Event<{
42
+ sessionId: string;
43
+ reason: "initializationFailed" | "cleared";
44
+ }>;
45
+ private readonly _sessionFollowupCancelTokens;
46
+ private readonly _chatServiceTelemetry;
47
+ constructor(storageService: IStorageService, logService: ILogService, extensionService: IExtensionService, instantiationService: IInstantiationService, telemetryService: ITelemetryService, workspaceContextService: IWorkspaceContextService, chatSlashCommandService: IChatSlashCommandService, chatVariablesService: IChatVariablesService, chatAgentService: IChatAgentService, configurationService: IConfigurationService);
48
+ isEnabled(location: ChatAgentLocation): boolean;
49
+ private saveState;
50
+ private syncEmptyWindowChats;
51
+ notifyUserAction(action: IChatUserActionEvent): void;
52
+ setChatSessionTitle(sessionId: string, title: string): void;
53
+ private trace;
54
+ private error;
55
+ private deserializeChats;
56
+ private getTransferredSessionData;
57
+ getHistory(): IChatDetail[];
58
+ removeHistoryEntry(sessionId: string): void;
59
+ clearAllHistoryEntries(): void;
60
+ startSession(location: ChatAgentLocation, token: CancellationToken): ChatModel;
61
+ private _startSession;
62
+ private initializeSession;
63
+ getSession(sessionId: string): IChatModel | undefined;
64
+ getOrRestoreSession(sessionId: string): ChatModel | undefined;
65
+ loadSessionFromContent(data: IExportableChatData | ISerializableChatData): IChatModel | undefined;
66
+ resendRequest(request: IChatRequestModel, options?: IChatSendRequestOptions): Promise<void>;
67
+ sendRequest(sessionId: string, request: string, options?: IChatSendRequestOptions): Promise<IChatSendRequestData | undefined>;
68
+ private parseChatRequest;
69
+ private refreshFollowupsCancellationToken;
70
+ private _sendRequestAsync;
71
+ private attachmentKindsForTelemetry;
72
+ private getHistoryEntriesFromModel;
73
+ removeRequest(sessionId: string, requestId: string): Promise<void>;
74
+ adoptRequest(sessionId: string, request: IChatRequestModel): Promise<void>;
75
+ addCompleteRequest(sessionId: string, message: IParsedChatRequest | string, variableData: IChatRequestVariableData | undefined, attempt: number | undefined, response: IChatCompleteResponse): Promise<void>;
76
+ cancelCurrentRequestForSession(sessionId: string): void;
77
+ clearSession(sessionId: string): void;
78
+ hasSessions(): boolean;
79
+ transferChatSession(transferredSessionData: IChatTransferredSessionData, toWorkspace: URI): void;
80
+ }