@codingame/monaco-vscode-chat-service-override 11.1.2 → 12.0.1
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,23 +1,32 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
|
|
3
|
+
import { VSDataTransfer, createStringDataTransferItem } from 'vscode/vscode/vs/base/common/dataTransfer';
|
|
2
4
|
import { HierarchicalKind } from 'vscode/vscode/vs/base/common/hierarchicalKind';
|
|
3
5
|
import { ILanguageFeaturesService } from 'vscode/vscode/vs/editor/common/services/languageFeatures';
|
|
4
6
|
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
5
|
-
import { ChatInputPart } from '@codingame/monaco-vscode-
|
|
7
|
+
import { ChatInputPart } from '@codingame/monaco-vscode-fab30422-b487-5f4e-8d30-8b4d266e3fcd-common/vscode/vs/workbench/contrib/chat/browser/chatInputPart';
|
|
6
8
|
import { IChatWidgetService } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chat.service';
|
|
7
9
|
import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
|
|
8
10
|
import { localize } from 'vscode/vscode/vs/nls';
|
|
9
11
|
import { isProposedApiEnabled } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions';
|
|
10
12
|
import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions.service';
|
|
13
|
+
import { Mimes } from 'vscode/vscode/vs/base/common/mime';
|
|
14
|
+
import { IModelService } from 'vscode/vscode/vs/editor/common/services/model';
|
|
15
|
+
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
16
|
+
import { basename } from 'vscode/vscode/vs/base/common/resources';
|
|
11
17
|
|
|
18
|
+
const COPY_MIME_TYPES = 'application/vnd.code.additional-editor-data';
|
|
12
19
|
class PasteImageProvider {
|
|
13
20
|
constructor(chatWidgetService, extensionService) {
|
|
14
21
|
this.chatWidgetService = chatWidgetService;
|
|
15
22
|
this.extensionService = extensionService;
|
|
16
|
-
this.kind = (
|
|
23
|
+
this.kind = ( new HierarchicalKind('chat.attach.image'));
|
|
24
|
+
this.providedPasteEditKinds = [this.kind];
|
|
25
|
+
this.copyMimeTypes = [];
|
|
17
26
|
this.pasteMimeTypes = ['image/*'];
|
|
18
27
|
}
|
|
19
|
-
async provideDocumentPasteEdits(
|
|
20
|
-
if (!(
|
|
28
|
+
async provideDocumentPasteEdits(model, ranges, dataTransfer, context, token) {
|
|
29
|
+
if (!( this.extensionService.extensions.some(ext => isProposedApiEnabled(ext, 'chatReferenceBinaryData')))) {
|
|
21
30
|
return;
|
|
22
31
|
}
|
|
23
32
|
const supportedMimeTypes = [
|
|
@@ -44,14 +53,14 @@ class PasteImageProvider {
|
|
|
44
53
|
if (token.isCancellationRequested || !currClipboard) {
|
|
45
54
|
return;
|
|
46
55
|
}
|
|
47
|
-
const widget = this.chatWidgetService.getWidgetByInputUri(
|
|
56
|
+
const widget = this.chatWidgetService.getWidgetByInputUri(model.uri);
|
|
48
57
|
if (!widget) {
|
|
49
58
|
return;
|
|
50
59
|
}
|
|
51
60
|
const attachedVariables = widget.attachmentModel.attachments;
|
|
52
|
-
const displayName = ( localize(
|
|
61
|
+
const displayName = ( localize(4499, 'Pasted Image'));
|
|
53
62
|
let tempDisplayName = displayName;
|
|
54
|
-
for (let appendValue = 2; (
|
|
63
|
+
for (let appendValue = 2; ( attachedVariables.some(attachment => attachment.name === tempDisplayName)); appendValue++) {
|
|
55
64
|
tempDisplayName = `${displayName} ${appendValue}`;
|
|
56
65
|
}
|
|
57
66
|
const imageContext = await getImageAttachContext(currClipboard, mimeType, token, tempDisplayName);
|
|
@@ -59,11 +68,11 @@ class PasteImageProvider {
|
|
|
59
68
|
return;
|
|
60
69
|
}
|
|
61
70
|
const currentContextIds = widget.attachmentModel.getAttachmentIDs();
|
|
62
|
-
if ((
|
|
71
|
+
if (( currentContextIds.has(imageContext.id))) {
|
|
63
72
|
return;
|
|
64
73
|
}
|
|
65
|
-
|
|
66
|
-
return;
|
|
74
|
+
const edit = createCustomPasteEdit(model, imageContext, mimeType, this.kind, ( localize(4500, 'Pasted Image Attachment')), this.chatWidgetService);
|
|
75
|
+
return createEditSession(edit);
|
|
67
76
|
}
|
|
68
77
|
}
|
|
69
78
|
async function getImageAttachContext(data, mimeType, token, displayName) {
|
|
@@ -78,14 +87,13 @@ async function getImageAttachContext(data, mimeType, token, displayName) {
|
|
|
78
87
|
isImage: true,
|
|
79
88
|
icon: Codicon.fileMedia,
|
|
80
89
|
isDynamic: true,
|
|
81
|
-
isFile: false,
|
|
82
90
|
mimeType
|
|
83
91
|
};
|
|
84
92
|
}
|
|
85
93
|
async function imageToHash(data) {
|
|
86
94
|
const hashBuffer = await crypto.subtle.digest('SHA-256', data);
|
|
87
|
-
const hashArray = Array.from((
|
|
88
|
-
return (
|
|
95
|
+
const hashArray = Array.from(( new Uint8Array(hashBuffer)));
|
|
96
|
+
return ( hashArray.map(b => ( b.toString(16)).padStart(2, '0'))).join('');
|
|
89
97
|
}
|
|
90
98
|
function isImage(array) {
|
|
91
99
|
if (array.length < 4) {
|
|
@@ -98,20 +106,151 @@ function isImage(array) {
|
|
|
98
106
|
gif: [0x47, 0x49, 0x46, 0x38],
|
|
99
107
|
tiff: [0x49, 0x49, 0x2A, 0x00]
|
|
100
108
|
};
|
|
101
|
-
return (
|
|
102
|
-
|
|
103
|
-
|
|
109
|
+
return ( ( Object.values(identifier)).some((signature) => signature.every((byte, index) => array[index] === byte)));
|
|
110
|
+
}
|
|
111
|
+
class CopyTextProvider {
|
|
112
|
+
constructor() {
|
|
113
|
+
this.providedPasteEditKinds = [];
|
|
114
|
+
this.copyMimeTypes = [COPY_MIME_TYPES];
|
|
115
|
+
this.pasteMimeTypes = [];
|
|
116
|
+
}
|
|
117
|
+
async prepareDocumentPaste(model, ranges, dataTransfer, token) {
|
|
118
|
+
if (model.uri.scheme === ChatInputPart.INPUT_SCHEME) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
const customDataTransfer = ( new VSDataTransfer());
|
|
122
|
+
const data = { range: ranges[0], uri: model.uri.toJSON() };
|
|
123
|
+
customDataTransfer.append(COPY_MIME_TYPES, createStringDataTransferItem(JSON.stringify(data)));
|
|
124
|
+
return customDataTransfer;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
class PasteTextProvider {
|
|
128
|
+
constructor(chatWidgetService, modelService) {
|
|
129
|
+
this.chatWidgetService = chatWidgetService;
|
|
130
|
+
this.modelService = modelService;
|
|
131
|
+
this.kind = ( new HierarchicalKind('chat.attach.text'));
|
|
132
|
+
this.providedPasteEditKinds = [this.kind];
|
|
133
|
+
this.copyMimeTypes = [];
|
|
134
|
+
this.pasteMimeTypes = [COPY_MIME_TYPES];
|
|
135
|
+
}
|
|
136
|
+
async provideDocumentPasteEdits(model, ranges, dataTransfer, context, token) {
|
|
137
|
+
if (model.uri.scheme !== ChatInputPart.INPUT_SCHEME) {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
const text = dataTransfer.get(Mimes.text);
|
|
141
|
+
const editorData = dataTransfer.get('vscode-editor-data');
|
|
142
|
+
const additionalEditorData = dataTransfer.get(COPY_MIME_TYPES);
|
|
143
|
+
if (!editorData || !text || !additionalEditorData) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
const textdata = await text.asString();
|
|
147
|
+
const metadata = JSON.parse(await editorData.asString());
|
|
148
|
+
const additionalData = JSON.parse(await additionalEditorData.asString());
|
|
149
|
+
const widget = this.chatWidgetService.getWidgetByInputUri(model.uri);
|
|
150
|
+
if (!widget) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
const start = additionalData.range.startLineNumber;
|
|
154
|
+
const end = additionalData.range.endLineNumber;
|
|
155
|
+
if (start === end) {
|
|
156
|
+
const textModel = this.modelService.getModel(URI.revive(additionalData.uri));
|
|
157
|
+
if (!textModel) {
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
const lineContent = textModel.getLineContent(start);
|
|
161
|
+
if (lineContent !== textdata) {
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
const copiedContext = getCopiedContext(textdata, URI.revive(additionalData.uri), metadata.mode, additionalData.range);
|
|
166
|
+
if (token.isCancellationRequested || !copiedContext) {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
const currentContextIds = widget.attachmentModel.getAttachmentIDs();
|
|
170
|
+
if (( currentContextIds.has(copiedContext.id))) {
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
const edit = createCustomPasteEdit(model, copiedContext, Mimes.text, this.kind, ( localize(4501, 'Pasted Code Attachment')), this.chatWidgetService);
|
|
174
|
+
edit.yieldTo = [{ kind: HierarchicalKind.Empty.append('text', 'plain') }];
|
|
175
|
+
return createEditSession(edit);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
function getCopiedContext(code, file, language, range) {
|
|
179
|
+
const fileName = basename(file);
|
|
180
|
+
const start = range.startLineNumber;
|
|
181
|
+
const end = range.endLineNumber;
|
|
182
|
+
const resultText = `Copied Selection of Code: \n\n\n From the file: ${fileName} From lines ${start} to ${end} \n \`\`\`${code}\`\`\``;
|
|
183
|
+
const pastedLines = start === end ? ( localize(4502, '1 line')) : ( localize(4503, '{0} lines', end + 1 - start));
|
|
184
|
+
return {
|
|
185
|
+
kind: 'paste',
|
|
186
|
+
value: resultText,
|
|
187
|
+
id: `${fileName}${start}${end}${range.startColumn}${range.endColumn}`,
|
|
188
|
+
name: `${fileName} ${pastedLines}`,
|
|
189
|
+
icon: Codicon.code,
|
|
190
|
+
isDynamic: true,
|
|
191
|
+
pastedLines,
|
|
192
|
+
language,
|
|
193
|
+
fileName: ( file.toString()),
|
|
194
|
+
copiedFrom: {
|
|
195
|
+
uri: file,
|
|
196
|
+
range
|
|
197
|
+
},
|
|
198
|
+
code,
|
|
199
|
+
references: [{
|
|
200
|
+
reference: file,
|
|
201
|
+
kind: 'reference'
|
|
202
|
+
}]
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
function createCustomPasteEdit(model, context, handledMimeType, kind, title, chatWidgetService) {
|
|
206
|
+
const customEdit = {
|
|
207
|
+
resource: model.uri,
|
|
208
|
+
variable: context,
|
|
209
|
+
undo: () => {
|
|
210
|
+
const widget = chatWidgetService.getWidgetByInputUri(model.uri);
|
|
211
|
+
if (!widget) {
|
|
212
|
+
throw ( new Error('No widget found for undo'));
|
|
213
|
+
}
|
|
214
|
+
widget.attachmentModel.delete(context.id);
|
|
215
|
+
},
|
|
216
|
+
redo: () => {
|
|
217
|
+
const widget = chatWidgetService.getWidgetByInputUri(model.uri);
|
|
218
|
+
if (!widget) {
|
|
219
|
+
throw ( new Error('No widget found for redo'));
|
|
220
|
+
}
|
|
221
|
+
widget.attachmentModel.addContext(context);
|
|
222
|
+
},
|
|
223
|
+
metadata: { needsConfirmation: false, label: context.name }
|
|
224
|
+
};
|
|
225
|
+
return {
|
|
226
|
+
insertText: '',
|
|
227
|
+
title,
|
|
228
|
+
kind,
|
|
229
|
+
handledMimeType,
|
|
230
|
+
additionalEdit: {
|
|
231
|
+
edits: [customEdit],
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
function createEditSession(edit) {
|
|
236
|
+
return {
|
|
237
|
+
edits: [edit],
|
|
238
|
+
dispose: () => { },
|
|
239
|
+
};
|
|
104
240
|
}
|
|
105
241
|
let ChatPasteProvidersFeature = class ChatPasteProvidersFeature extends Disposable {
|
|
106
|
-
constructor(languageFeaturesService, chatWidgetService, extensionService) {
|
|
242
|
+
constructor(languageFeaturesService, chatWidgetService, extensionService, modelService) {
|
|
107
243
|
super();
|
|
108
|
-
this._register(languageFeaturesService.documentPasteEditProvider.register({ scheme: ChatInputPart.INPUT_SCHEME, pattern: '*', hasAccessToAllModels: true }, (
|
|
244
|
+
this._register(languageFeaturesService.documentPasteEditProvider.register({ scheme: ChatInputPart.INPUT_SCHEME, pattern: '*', hasAccessToAllModels: true }, ( new PasteImageProvider(chatWidgetService, extensionService))));
|
|
245
|
+
this._register(languageFeaturesService.documentPasteEditProvider.register({ scheme: ChatInputPart.INPUT_SCHEME, pattern: '*', hasAccessToAllModels: true }, ( new PasteTextProvider(chatWidgetService, modelService))));
|
|
246
|
+
this._register(languageFeaturesService.documentPasteEditProvider.register('*', ( new CopyTextProvider())));
|
|
109
247
|
}
|
|
110
248
|
};
|
|
111
|
-
ChatPasteProvidersFeature = (
|
|
112
|
-
(
|
|
113
|
-
(
|
|
114
|
-
(
|
|
115
|
-
|
|
249
|
+
ChatPasteProvidersFeature = ( __decorate([
|
|
250
|
+
( __param(0, ILanguageFeaturesService)),
|
|
251
|
+
( __param(1, IChatWidgetService)),
|
|
252
|
+
( __param(2, IExtensionService)),
|
|
253
|
+
( __param(3, IModelService))
|
|
254
|
+
], ChatPasteProvidersFeature));
|
|
116
255
|
|
|
117
|
-
export { ChatPasteProvidersFeature, PasteImageProvider, imageToHash, isImage };
|
|
256
|
+
export { ChatPasteProvidersFeature, CopyTextProvider, PasteImageProvider, PasteTextProvider, imageToHash, isImage };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Event } from "vscode/vscode/vs/base/common/event";
|
|
2
|
+
import { Disposable } from "vscode/vscode/vs/base/common/lifecycle";
|
|
3
|
+
import { IInstantiationService } from "vscode/vscode/vs/platform/instantiation/common/instantiation";
|
|
4
|
+
import { IQuickInputService } from "vscode/vscode/vs/platform/quickinput/common/quickInput.service";
|
|
5
|
+
import { IQuickChatOpenOptions } from "@codingame/monaco-vscode-fab30422-b487-5f4e-8d30-8b4d266e3fcd-common/vscode/vs/workbench/contrib/chat/browser/chat";
|
|
6
|
+
import { IQuickChatService } from "vscode/vscode/vs/workbench/contrib/chat/browser/chat.service";
|
|
7
|
+
import { IChatService } from "vscode/vscode/vs/workbench/contrib/chat/common/chatService.service";
|
|
8
|
+
export declare class QuickChatService extends Disposable implements IQuickChatService {
|
|
9
|
+
private readonly quickInputService;
|
|
10
|
+
private readonly chatService;
|
|
11
|
+
private readonly instantiationService;
|
|
12
|
+
readonly _serviceBrand: undefined;
|
|
13
|
+
private readonly _onDidClose;
|
|
14
|
+
readonly onDidClose: Event<void>;
|
|
15
|
+
private _input;
|
|
16
|
+
private _currentChat;
|
|
17
|
+
private _container;
|
|
18
|
+
constructor(quickInputService: IQuickInputService, chatService: IChatService, instantiationService: IInstantiationService);
|
|
19
|
+
get enabled(): boolean;
|
|
20
|
+
get focused(): boolean;
|
|
21
|
+
toggle(options?: IQuickChatOpenOptions): void;
|
|
22
|
+
open(options?: IQuickChatOpenOptions): void;
|
|
23
|
+
focus(): void;
|
|
24
|
+
close(): void;
|
|
25
|
+
openInChatView(): Promise<void>;
|
|
26
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
|
|
2
3
|
import { isAncestorOfActiveElement, $ } from 'vscode/vscode/vs/base/browser/dom';
|
|
3
|
-
import { Sash } from 'vscode/vscode/vs/base/browser/ui/sash/sash';
|
|
4
|
+
import { Sash, Orientation } from 'vscode/vscode/vs/base/browser/ui/sash/sash';
|
|
4
5
|
import { disposableTimeout } from 'vscode/vscode/vs/base/common/async';
|
|
5
6
|
import { CancellationToken } from 'vscode/vscode/vs/base/common/cancellation';
|
|
6
7
|
import { Emitter, Event } from 'vscode/vscode/vs/base/common/event';
|
|
@@ -22,8 +23,8 @@ import 'vscode/vscode/vs/platform/theme/common/colors/minimapColors';
|
|
|
22
23
|
import 'vscode/vscode/vs/platform/theme/common/colors/miscColors';
|
|
23
24
|
import { quickInputForeground, quickInputBackground } from 'vscode/vscode/vs/platform/theme/common/colors/quickpickColors';
|
|
24
25
|
import 'vscode/vscode/vs/platform/theme/common/colors/searchColors';
|
|
25
|
-
import { showChatView } from '@codingame/monaco-vscode-
|
|
26
|
-
import { ChatWidget } from '@codingame/monaco-vscode-
|
|
26
|
+
import { showChatView } from '@codingame/monaco-vscode-fab30422-b487-5f4e-8d30-8b4d266e3fcd-common/vscode/vs/workbench/contrib/chat/browser/chat';
|
|
27
|
+
import { ChatWidget } from '@codingame/monaco-vscode-c465110a-57c0-59d7-a6b2-be0a4db7e517-common/vscode/vs/workbench/contrib/chat/browser/chatWidget';
|
|
27
28
|
import { ChatAgentLocation } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatAgents';
|
|
28
29
|
import { IChatService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatService.service';
|
|
29
30
|
import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService.service';
|
|
@@ -193,7 +194,7 @@ let QuickChat = class QuickChat extends Disposable {
|
|
|
193
194
|
this.sash = this._register(( new Sash(
|
|
194
195
|
parent,
|
|
195
196
|
{ getHorizontalSashTop: () => parent.offsetHeight },
|
|
196
|
-
{ orientation:
|
|
197
|
+
{ orientation: Orientation.HORIZONTAL }
|
|
197
198
|
)));
|
|
198
199
|
this.registerListeners(parent);
|
|
199
200
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Disposable } from "vscode/vscode/vs/base/common/lifecycle";
|
|
2
|
+
import { AccessibleViewProviderId, AccessibleViewType, IAccessibleViewContentProvider } from "vscode/vscode/vs/platform/accessibility/browser/accessibleView";
|
|
3
|
+
import { IAccessibleViewImplentation } from "vscode/vscode/vs/platform/accessibility/browser/accessibleViewRegistry";
|
|
4
|
+
import { ServicesAccessor } from "vscode/vscode/vs/platform/instantiation/common/instantiation";
|
|
5
|
+
import { AccessibilityVerbositySettingId } from "vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration";
|
|
6
|
+
import { ChatTreeItem, IChatWidget } from "@codingame/monaco-vscode-fab30422-b487-5f4e-8d30-8b4d266e3fcd-common/vscode/vs/workbench/contrib/chat/browser/chat";
|
|
7
|
+
export declare class ChatResponseAccessibleView implements IAccessibleViewImplentation {
|
|
8
|
+
readonly priority = 100;
|
|
9
|
+
readonly name = "panelChat";
|
|
10
|
+
readonly type = AccessibleViewType.View;
|
|
11
|
+
readonly when: import("vscode/vscode/vs/platform/contextkey/common/contextkey").RawContextKey<boolean>;
|
|
12
|
+
getProvider(accessor: ServicesAccessor): ChatResponseAccessibleProvider | undefined;
|
|
13
|
+
}
|
|
14
|
+
declare class ChatResponseAccessibleProvider extends Disposable implements IAccessibleViewContentProvider {
|
|
15
|
+
private readonly _widget;
|
|
16
|
+
private readonly _chatInputFocused;
|
|
17
|
+
private _focusedItem;
|
|
18
|
+
constructor(_widget: IChatWidget, item: ChatTreeItem, _chatInputFocused: boolean);
|
|
19
|
+
readonly id = AccessibleViewProviderId.PanelChat;
|
|
20
|
+
readonly verbositySettingKey = AccessibilityVerbositySettingId.Chat;
|
|
21
|
+
readonly options: {
|
|
22
|
+
type: AccessibleViewType;
|
|
23
|
+
};
|
|
24
|
+
provideContent(): string;
|
|
25
|
+
private _getContent;
|
|
26
|
+
onClose(): void;
|
|
27
|
+
provideNextContent(): string | undefined;
|
|
28
|
+
providePreviousContent(): string | undefined;
|
|
29
|
+
}
|
|
30
|
+
export {};
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
+
|
|
1
2
|
import { renderMarkdownAsPlaintext } from 'vscode/vscode/vs/base/browser/markdownRenderer';
|
|
2
3
|
import { MarkdownString } from 'vscode/vscode/vs/base/common/htmlContent';
|
|
3
4
|
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
5
|
+
import { AccessibleViewType, AccessibleViewProviderId } from 'vscode/vscode/vs/platform/accessibility/browser/accessibleView';
|
|
6
|
+
import { AccessibilityVerbositySettingId } from 'vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration';
|
|
7
|
+
import { ChatContextKeys } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
|
|
8
|
+
import { isResponseVM } from '@codingame/monaco-vscode-fab30422-b487-5f4e-8d30-8b4d266e3fcd-common/vscode/vs/workbench/contrib/chat/common/chatViewModel';
|
|
6
9
|
import { IChatWidgetService } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chat.service';
|
|
7
10
|
|
|
8
11
|
class ChatResponseAccessibleView {
|
|
9
12
|
constructor() {
|
|
10
13
|
this.priority = 100;
|
|
11
14
|
this.name = 'panelChat';
|
|
12
|
-
this.type =
|
|
13
|
-
this.when =
|
|
15
|
+
this.type = AccessibleViewType.View;
|
|
16
|
+
this.when = ChatContextKeys.inChatSession;
|
|
14
17
|
}
|
|
15
18
|
getProvider(accessor) {
|
|
16
19
|
const widgetService = accessor.get(IChatWidgetService);
|
|
@@ -35,9 +38,9 @@ class ChatResponseAccessibleProvider extends Disposable {
|
|
|
35
38
|
super();
|
|
36
39
|
this._widget = _widget;
|
|
37
40
|
this._chatInputFocused = _chatInputFocused;
|
|
38
|
-
this.id =
|
|
39
|
-
this.verbositySettingKey =
|
|
40
|
-
this.options = { type:
|
|
41
|
+
this.id = AccessibleViewProviderId.PanelChat;
|
|
42
|
+
this.verbositySettingKey = AccessibilityVerbositySettingId.Chat;
|
|
43
|
+
this.options = { type: AccessibleViewType.View };
|
|
41
44
|
this._focusedItem = item;
|
|
42
45
|
}
|
|
43
46
|
provideContent() {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Disposable } from "vscode/vscode/vs/base/common/lifecycle";
|
|
2
|
+
import { IInstantiationService } from "vscode/vscode/vs/platform/instantiation/common/instantiation";
|
|
3
|
+
import { IProductService } from "vscode/vscode/vs/platform/product/common/productService.service";
|
|
4
|
+
import { IWorkbenchContribution } from "vscode/vscode/vs/workbench/common/contributions";
|
|
5
|
+
export declare const SetupWelcomeViewKeys: Set<string>;
|
|
6
|
+
export declare const SetupWelcomeViewCondition: import("vscode/vscode/vs/platform/contextkey/common/contextkey").ContextKeyExpression;
|
|
7
|
+
export declare class ChatSetupContribution extends Disposable implements IWorkbenchContribution {
|
|
8
|
+
private readonly productService;
|
|
9
|
+
private readonly instantiationService;
|
|
10
|
+
static readonly ID = "workbench.chat.setup";
|
|
11
|
+
private readonly context;
|
|
12
|
+
private readonly requests;
|
|
13
|
+
private readonly controller;
|
|
14
|
+
constructor(productService: IProductService, instantiationService: IInstantiationService);
|
|
15
|
+
private registerChatWelcome;
|
|
16
|
+
private registerActions;
|
|
17
|
+
}
|