@codingame/monaco-vscode-chat-service-override 17.2.1 → 18.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +7 -4
- package/package.json +36 -30
- package/vscode/src/vs/base/common/objectCache.d.ts +2 -2
- package/vscode/src/vs/base/common/objectCache.js +3 -3
- package/vscode/src/vs/platform/browserElements/common/browserElements.d.ts +10 -0
- package/vscode/src/vs/platform/browserElements/common/browserElements.js +9 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +40 -40
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClearActions.d.ts +6 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClearActions.js +158 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContext.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContext.js +256 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.d.ts +3 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +234 -572
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +4 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatGettingStarted.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +29 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.js +107 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.js +344 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.d.ts +4 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +84 -37
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/chatAttachInstructionsAction.d.ts +18 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/chatAttachInstructionsAction.js +137 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/chatModeActions.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/chatModeActions.js +54 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/chatRunPromptAction.js +40 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/chatSaveToPromptAction.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/chatSaveToPromptAction.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/dialogs/askToSelectPrompt/promptFilePickers.d.ts +15 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/dialogs/askToSelectPrompt/promptFilePickers.js +171 -101
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/dialogs/askToSelectPrompt/utils/attachInstructions.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/dialogs/askToSelectPrompt/utils/attachInstructions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/dialogs/askToSelectPrompt/utils/runPrompt.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/index.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/index.js +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +176 -69
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +15 -29
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorAccessibility.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +22 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +35 -29
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +80 -32
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.d.ts +5 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +11 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +12 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +13 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +15 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSessionStorage.js +3 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookCellEntry.js +10 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +18 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/overlayToolbarDecorator.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/overlayToolbarDecorator.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/simpleBrowserEditorOverlay.js +118 -33
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.d.ts +1 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +46 -48
- package/vscode/src/vs/workbench/contrib/chat/browser/chatPasteProviders.d.ts +49 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatPasteProviders.js +379 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.js +31 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.js +382 -152
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus.js +99 -56
- package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.js +11 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.d.ts +1 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.js +9 -21
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockContextProviderService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.js +10 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorHover.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.d.ts +18 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.js +95 -24
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatSetup.css +92 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/media/github.svg +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/media/google.svg +6 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/media/simpleBrowserOverlay.css +10 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/createPromptCommand.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/createPromptCommand.js +111 -111
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/dialogs/askForPromptName.d.ts +3 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/dialogs/askForPromptName.js +36 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/dialogs/askForPromptSourceFolder.d.ts +5 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/dialogs/askForPromptSourceFolder.js +91 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/errors.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/utils/createPromptFile.d.ts +1 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/utils/createPromptFile.js +4 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js +95 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.d.ts +24 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.js +348 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatResponseResourceFileSystemProvider.d.ts +30 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatResponseResourceFileSystemProvider.js +93 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.d.ts +5 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.js +46 -36
- package/vscode/src/vs/workbench/contrib/chat/common/chatSessionStore.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/configMigration.d.ts +5 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/configMigration.js +21 -11
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/index.js +6 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/index.js +3 -2
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/promptHeaderDiagnosticsProvider.d.ts +4 -3
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/promptHeaderDiagnosticsProvider.js +12 -8
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/promptLinkDiagnosticsProvider.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/promptLinkDiagnosticsProvider.js +1 -2
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/promptLinkProvider.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/promptPathAutocompletion.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/providerInstanceBase.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/providerInstanceBase.js +9 -5
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/providerInstanceManagerBase.d.ts +3 -2
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/providerInstanceManagerBase.js +12 -8
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/textModelPromptParser.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/textModelPromptParser.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.d.ts +21 -10
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.js +111 -124
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts +22 -8
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +159 -97
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/treeUtils.d.ts +15 -3
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/treeUtils.js +2 -14
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.d.ts +8 -2
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +198 -33
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +7 -7
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibleView.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.js +28 -18
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookModifiedCellDecorator.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookModifiedCellDecorator.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/attachInstructionsCommand.d.ts +0 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/attachInstructionsCommand.js +0 -73
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/decorations/frontMatterDecoration.d.ts +0 -29
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/decorations/frontMatterDecoration.js +0 -74
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/decorations/frontMatterMarkerDecoration.d.ts +0 -14
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/decorations/frontMatterMarkerDecoration.js +0 -40
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/decorations/utils/decorationBase.d.ts +0 -23
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/decorations/utils/decorationBase.js +0 -40
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/decorations/utils/index.d.ts +0 -5
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/decorations/utils/index.js +0 -9
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/decorations/utils/reactiveDecorationBase.d.ts +0 -23
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/decorations/utils/reactiveDecorationBase.js +0 -68
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/decorations/utils/types.d.ts +0 -13
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/promptDecorationsProvider.d.ts +0 -19
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/promptDecorationsProvider.js +0 -121
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/types.d.ts +0 -13
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/types.js +0 -13
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
4
|
+
import { VSDataTransfer, createStringDataTransferItem } from '@codingame/monaco-vscode-api/vscode/vs/base/common/dataTransfer';
|
|
5
|
+
import { HierarchicalKind } from '@codingame/monaco-vscode-api/vscode/vs/base/common/hierarchicalKind';
|
|
6
|
+
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
7
|
+
import { revive } from '@codingame/monaco-vscode-api/vscode/vs/base/common/marshalling';
|
|
8
|
+
import { Mimes } from '@codingame/monaco-vscode-api/vscode/vs/base/common/mime';
|
|
9
|
+
import { joinPath, basename } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
10
|
+
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
11
|
+
import { ILanguageFeaturesService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/languageFeatures.service';
|
|
12
|
+
import { IModelService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/model.service';
|
|
13
|
+
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
14
|
+
import { IEnvironmentService } from '@codingame/monaco-vscode-api/vscode/vs/platform/environment/common/environment.service';
|
|
15
|
+
import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
|
|
16
|
+
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
17
|
+
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
18
|
+
import { isProposedApiEnabled } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions';
|
|
19
|
+
import { IExtensionService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service';
|
|
20
|
+
import { IChatVariablesService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatVariables.service';
|
|
21
|
+
import { IChatWidgetService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service';
|
|
22
|
+
import { ChatInputPart } from '@codingame/monaco-vscode-fab30422-b487-5f4e-8d30-8b4d266e3fcd-common/vscode/vs/workbench/contrib/chat/browser/chatInputPart';
|
|
23
|
+
import { ChatDynamicVariableModel } from '@codingame/monaco-vscode-e4d0fd26-1b26-5583-b3f7-582e08d7b389-common/vscode/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables';
|
|
24
|
+
import { cleanupOldImages, createFileForMedia, resizeImage, imageToHash } from '@codingame/monaco-vscode-1cb11a73-359e-5a2f-9e95-6989cc9858ee-common/vscode/vs/workbench/contrib/chat/browser/imageUtils';
|
|
25
|
+
|
|
26
|
+
var CopyAttachmentsProvider_1;
|
|
27
|
+
const COPY_MIME_TYPES = 'application/vnd.code.additional-editor-data';
|
|
28
|
+
let PasteImageProvider = class PasteImageProvider {
|
|
29
|
+
constructor(chatWidgetService, extensionService, fileService, environmentService, logService) {
|
|
30
|
+
this.chatWidgetService = chatWidgetService;
|
|
31
|
+
this.extensionService = extensionService;
|
|
32
|
+
this.fileService = fileService;
|
|
33
|
+
this.environmentService = environmentService;
|
|
34
|
+
this.logService = logService;
|
|
35
|
+
this.kind = ( new HierarchicalKind('chat.attach.image'));
|
|
36
|
+
this.providedPasteEditKinds = [this.kind];
|
|
37
|
+
this.copyMimeTypes = [];
|
|
38
|
+
this.pasteMimeTypes = ['image/*'];
|
|
39
|
+
this.imagesFolder = joinPath(this.environmentService.workspaceStorageHome, 'vscode-chat-images');
|
|
40
|
+
cleanupOldImages(this.fileService, this.logService, this.imagesFolder);
|
|
41
|
+
}
|
|
42
|
+
async provideDocumentPasteEdits(model, ranges, dataTransfer, context, token) {
|
|
43
|
+
if (!( this.extensionService.extensions.some(ext => isProposedApiEnabled(ext, 'chatReferenceBinaryData')))) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const supportedMimeTypes = [
|
|
47
|
+
'image/png',
|
|
48
|
+
'image/jpeg',
|
|
49
|
+
'image/jpg',
|
|
50
|
+
'image/bmp',
|
|
51
|
+
'image/gif',
|
|
52
|
+
'image/tiff'
|
|
53
|
+
];
|
|
54
|
+
let mimeType;
|
|
55
|
+
let imageItem;
|
|
56
|
+
for (const type of supportedMimeTypes) {
|
|
57
|
+
imageItem = dataTransfer.get(type);
|
|
58
|
+
if (imageItem) {
|
|
59
|
+
mimeType = type;
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (!imageItem || !mimeType) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
const currClipboard = await imageItem.asFile()?.data();
|
|
67
|
+
if (token.isCancellationRequested || !currClipboard) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
const widget = this.chatWidgetService.getWidgetByInputUri(model.uri);
|
|
71
|
+
if (!widget) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const attachedVariables = widget.attachmentModel.attachments;
|
|
75
|
+
const displayName = ( localize(4892, 'Pasted Image'));
|
|
76
|
+
let tempDisplayName = displayName;
|
|
77
|
+
for (let appendValue = 2; ( attachedVariables.some(attachment => attachment.name === tempDisplayName)); appendValue++) {
|
|
78
|
+
tempDisplayName = `${displayName} ${appendValue}`;
|
|
79
|
+
}
|
|
80
|
+
const fileReference = await createFileForMedia(this.fileService, this.imagesFolder, currClipboard, mimeType);
|
|
81
|
+
if (token.isCancellationRequested || !fileReference) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
const scaledImageData = await resizeImage(currClipboard);
|
|
85
|
+
if (token.isCancellationRequested || !scaledImageData) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
const scaledImageContext = await getImageAttachContext(scaledImageData, mimeType, token, tempDisplayName, fileReference);
|
|
89
|
+
if (token.isCancellationRequested || !scaledImageContext) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
widget.attachmentModel.addContext(scaledImageContext);
|
|
93
|
+
const currentContextIds = widget.attachmentModel.getAttachmentIDs();
|
|
94
|
+
if (( currentContextIds.has(scaledImageContext.id))) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
const edit = createCustomPasteEdit(model, [scaledImageContext], mimeType, this.kind, ( localize(4893, 'Pasted Image Attachment')), this.chatWidgetService);
|
|
98
|
+
return createEditSession(edit);
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
PasteImageProvider = ( __decorate([
|
|
102
|
+
( __param(2, IFileService)),
|
|
103
|
+
( __param(3, IEnvironmentService)),
|
|
104
|
+
( __param(4, ILogService))
|
|
105
|
+
], PasteImageProvider));
|
|
106
|
+
async function getImageAttachContext(data, mimeType, token, displayName, resource) {
|
|
107
|
+
const imageHash = await imageToHash(data);
|
|
108
|
+
if (token.isCancellationRequested) {
|
|
109
|
+
return undefined;
|
|
110
|
+
}
|
|
111
|
+
return {
|
|
112
|
+
kind: 'image',
|
|
113
|
+
value: data,
|
|
114
|
+
id: imageHash,
|
|
115
|
+
name: displayName,
|
|
116
|
+
icon: Codicon.fileMedia,
|
|
117
|
+
mimeType,
|
|
118
|
+
isPasted: true,
|
|
119
|
+
references: [{ reference: resource, kind: 'reference' }]
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
function isImage(array) {
|
|
123
|
+
if (array.length < 4) {
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
126
|
+
const identifier = {
|
|
127
|
+
png: [0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A],
|
|
128
|
+
jpeg: [0xFF, 0xD8, 0xFF],
|
|
129
|
+
bmp: [0x42, 0x4D],
|
|
130
|
+
gif: [0x47, 0x49, 0x46, 0x38],
|
|
131
|
+
tiff: [0x49, 0x49, 0x2A, 0x00]
|
|
132
|
+
};
|
|
133
|
+
return ( ( Object.values(identifier)).some((signature) => signature.every((byte, index) => array[index] === byte)));
|
|
134
|
+
}
|
|
135
|
+
class CopyTextProvider {
|
|
136
|
+
constructor() {
|
|
137
|
+
this.providedPasteEditKinds = [];
|
|
138
|
+
this.copyMimeTypes = [COPY_MIME_TYPES];
|
|
139
|
+
this.pasteMimeTypes = [];
|
|
140
|
+
}
|
|
141
|
+
async prepareDocumentPaste(model, ranges, dataTransfer, token) {
|
|
142
|
+
if (model.uri.scheme === ChatInputPart.INPUT_SCHEME) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
const customDataTransfer = ( new VSDataTransfer());
|
|
146
|
+
const data = { range: ranges[0], uri: model.uri.toJSON() };
|
|
147
|
+
customDataTransfer.append(COPY_MIME_TYPES, createStringDataTransferItem(JSON.stringify(data)));
|
|
148
|
+
return customDataTransfer;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
let CopyAttachmentsProvider = class CopyAttachmentsProvider {
|
|
152
|
+
static { CopyAttachmentsProvider_1 = this; }
|
|
153
|
+
static { this.ATTACHMENT_MIME_TYPE = 'application/vnd.chat.attachment+json'; }
|
|
154
|
+
constructor(chatWidgetService, chatVariableService) {
|
|
155
|
+
this.chatWidgetService = chatWidgetService;
|
|
156
|
+
this.chatVariableService = chatVariableService;
|
|
157
|
+
this.kind = ( new HierarchicalKind('chat.attach.attachments'));
|
|
158
|
+
this.providedPasteEditKinds = [this.kind];
|
|
159
|
+
this.copyMimeTypes = [CopyAttachmentsProvider_1.ATTACHMENT_MIME_TYPE];
|
|
160
|
+
this.pasteMimeTypes = [CopyAttachmentsProvider_1.ATTACHMENT_MIME_TYPE];
|
|
161
|
+
}
|
|
162
|
+
async prepareDocumentPaste(model, _ranges, _dataTransfer, _token) {
|
|
163
|
+
const widget = this.chatWidgetService.getWidgetByInputUri(model.uri);
|
|
164
|
+
if (!widget || !widget.viewModel) {
|
|
165
|
+
return undefined;
|
|
166
|
+
}
|
|
167
|
+
const attachments = widget.attachmentModel.attachments;
|
|
168
|
+
const dynamicVariables = this.chatVariableService.getDynamicVariables(widget.viewModel.sessionId);
|
|
169
|
+
if (attachments.length === 0 && dynamicVariables.length === 0) {
|
|
170
|
+
return undefined;
|
|
171
|
+
}
|
|
172
|
+
const result = ( new VSDataTransfer());
|
|
173
|
+
result.append(CopyAttachmentsProvider_1.ATTACHMENT_MIME_TYPE, createStringDataTransferItem(JSON.stringify({ attachments, dynamicVariables })));
|
|
174
|
+
return result;
|
|
175
|
+
}
|
|
176
|
+
async provideDocumentPasteEdits(model, _ranges, dataTransfer, _context, token) {
|
|
177
|
+
const widget = this.chatWidgetService.getWidgetByInputUri(model.uri);
|
|
178
|
+
if (!widget || !widget.viewModel) {
|
|
179
|
+
return undefined;
|
|
180
|
+
}
|
|
181
|
+
const chatDynamicVariable = widget.getContrib(ChatDynamicVariableModel.ID);
|
|
182
|
+
if (!chatDynamicVariable) {
|
|
183
|
+
return undefined;
|
|
184
|
+
}
|
|
185
|
+
const text = dataTransfer.get(Mimes.text);
|
|
186
|
+
const data = dataTransfer.get(CopyAttachmentsProvider_1.ATTACHMENT_MIME_TYPE);
|
|
187
|
+
const rawData = await data?.asString();
|
|
188
|
+
const textdata = await text?.asString();
|
|
189
|
+
if (textdata === undefined || rawData === undefined) {
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
if (token.isCancellationRequested) {
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
let pastedData;
|
|
196
|
+
try {
|
|
197
|
+
pastedData = revive(JSON.parse(rawData));
|
|
198
|
+
}
|
|
199
|
+
catch {
|
|
200
|
+
}
|
|
201
|
+
if (!Array.isArray(pastedData?.attachments) && !Array.isArray(pastedData?.dynamicVariables)) {
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
const edit = {
|
|
205
|
+
insertText: textdata,
|
|
206
|
+
title: ( localize(4894, 'Insert Prompt & Attachments')),
|
|
207
|
+
kind: this.kind,
|
|
208
|
+
handledMimeType: CopyAttachmentsProvider_1.ATTACHMENT_MIME_TYPE,
|
|
209
|
+
additionalEdit: {
|
|
210
|
+
edits: []
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
edit.additionalEdit?.edits.push({
|
|
214
|
+
resource: model.uri,
|
|
215
|
+
redo: () => {
|
|
216
|
+
widget.attachmentModel.addContext(...pastedData.attachments);
|
|
217
|
+
for (const dynamicVariable of pastedData.dynamicVariables) {
|
|
218
|
+
chatDynamicVariable?.addReference(dynamicVariable);
|
|
219
|
+
}
|
|
220
|
+
widget.refreshParsedInput();
|
|
221
|
+
},
|
|
222
|
+
undo: () => {
|
|
223
|
+
widget.attachmentModel.delete(...( pastedData.attachments.map(c => c.id)));
|
|
224
|
+
widget.refreshParsedInput();
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
return createEditSession(edit);
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
CopyAttachmentsProvider = CopyAttachmentsProvider_1 = ( __decorate([
|
|
231
|
+
( __param(0, IChatWidgetService)),
|
|
232
|
+
( __param(1, IChatVariablesService))
|
|
233
|
+
], CopyAttachmentsProvider));
|
|
234
|
+
class PasteTextProvider {
|
|
235
|
+
constructor(chatWidgetService, modelService) {
|
|
236
|
+
this.chatWidgetService = chatWidgetService;
|
|
237
|
+
this.modelService = modelService;
|
|
238
|
+
this.kind = ( new HierarchicalKind('chat.attach.text'));
|
|
239
|
+
this.providedPasteEditKinds = [this.kind];
|
|
240
|
+
this.copyMimeTypes = [];
|
|
241
|
+
this.pasteMimeTypes = [COPY_MIME_TYPES];
|
|
242
|
+
}
|
|
243
|
+
async provideDocumentPasteEdits(model, ranges, dataTransfer, _context, token) {
|
|
244
|
+
if (model.uri.scheme !== ChatInputPart.INPUT_SCHEME) {
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
const text = dataTransfer.get(Mimes.text);
|
|
248
|
+
const editorData = dataTransfer.get('vscode-editor-data');
|
|
249
|
+
const additionalEditorData = dataTransfer.get(COPY_MIME_TYPES);
|
|
250
|
+
if (!editorData || !text || !additionalEditorData) {
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
const textdata = await text.asString();
|
|
254
|
+
const metadata = JSON.parse(await editorData.asString());
|
|
255
|
+
const additionalData = JSON.parse(await additionalEditorData.asString());
|
|
256
|
+
const widget = this.chatWidgetService.getWidgetByInputUri(model.uri);
|
|
257
|
+
if (!widget) {
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
const start = additionalData.range.startLineNumber;
|
|
261
|
+
const end = additionalData.range.endLineNumber;
|
|
262
|
+
if (start === end) {
|
|
263
|
+
const textModel = this.modelService.getModel(URI.revive(additionalData.uri));
|
|
264
|
+
if (!textModel) {
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
const lineContent = textModel.getLineContent(start);
|
|
268
|
+
if (lineContent !== textdata) {
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
const copiedContext = getCopiedContext(textdata, URI.revive(additionalData.uri), metadata.mode, additionalData.range);
|
|
273
|
+
if (token.isCancellationRequested || !copiedContext) {
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
const currentContextIds = widget.attachmentModel.getAttachmentIDs();
|
|
277
|
+
if (( currentContextIds.has(copiedContext.id))) {
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
const edit = createCustomPasteEdit(model, [copiedContext], Mimes.text, this.kind, ( localize(4895, 'Pasted Code Attachment')), this.chatWidgetService);
|
|
281
|
+
edit.yieldTo = [{ kind: HierarchicalKind.Empty.append('text', 'plain') }];
|
|
282
|
+
return createEditSession(edit);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
function getCopiedContext(code, file, language, range) {
|
|
286
|
+
const fileName = basename(file);
|
|
287
|
+
const start = range.startLineNumber;
|
|
288
|
+
const end = range.endLineNumber;
|
|
289
|
+
const resultText = `Copied Selection of Code: \n\n\n From the file: ${fileName} From lines ${start} to ${end} \n \`\`\`${code}\`\`\``;
|
|
290
|
+
const pastedLines = start === end ? ( localize(4896, '1 line')) : ( localize(4897, '{0} lines', end + 1 - start));
|
|
291
|
+
return {
|
|
292
|
+
kind: 'paste',
|
|
293
|
+
value: resultText,
|
|
294
|
+
id: `${fileName}${start}${end}${range.startColumn}${range.endColumn}`,
|
|
295
|
+
name: `${fileName} ${pastedLines}`,
|
|
296
|
+
icon: Codicon.code,
|
|
297
|
+
pastedLines,
|
|
298
|
+
language,
|
|
299
|
+
fileName: ( file.toString()),
|
|
300
|
+
copiedFrom: {
|
|
301
|
+
uri: file,
|
|
302
|
+
range
|
|
303
|
+
},
|
|
304
|
+
code,
|
|
305
|
+
references: [{
|
|
306
|
+
reference: file,
|
|
307
|
+
kind: 'reference'
|
|
308
|
+
}]
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
function createCustomPasteEdit(model, context, handledMimeType, kind, title, chatWidgetService) {
|
|
312
|
+
const label = context.length === 1
|
|
313
|
+
? context[0].name
|
|
314
|
+
: ( localize(4898, '{0} and {1} more', context[0].name, context.length - 1));
|
|
315
|
+
const customEdit = {
|
|
316
|
+
resource: model.uri,
|
|
317
|
+
variable: context,
|
|
318
|
+
undo: () => {
|
|
319
|
+
const widget = chatWidgetService.getWidgetByInputUri(model.uri);
|
|
320
|
+
if (!widget) {
|
|
321
|
+
throw ( new Error('No widget found for undo'));
|
|
322
|
+
}
|
|
323
|
+
widget.attachmentModel.delete(...( context.map(c => c.id)));
|
|
324
|
+
},
|
|
325
|
+
redo: () => {
|
|
326
|
+
const widget = chatWidgetService.getWidgetByInputUri(model.uri);
|
|
327
|
+
if (!widget) {
|
|
328
|
+
throw ( new Error('No widget found for redo'));
|
|
329
|
+
}
|
|
330
|
+
widget.attachmentModel.addContext(...context);
|
|
331
|
+
},
|
|
332
|
+
metadata: {
|
|
333
|
+
needsConfirmation: false,
|
|
334
|
+
label
|
|
335
|
+
}
|
|
336
|
+
};
|
|
337
|
+
return {
|
|
338
|
+
insertText: '',
|
|
339
|
+
title,
|
|
340
|
+
kind,
|
|
341
|
+
handledMimeType,
|
|
342
|
+
additionalEdit: {
|
|
343
|
+
edits: [customEdit],
|
|
344
|
+
}
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
function createEditSession(edit) {
|
|
348
|
+
return {
|
|
349
|
+
edits: [edit],
|
|
350
|
+
dispose: () => { },
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
let ChatPasteProvidersFeature = class ChatPasteProvidersFeature extends Disposable {
|
|
354
|
+
constructor(instaService, languageFeaturesService, chatWidgetService, extensionService, fileService, modelService, environmentService, logService) {
|
|
355
|
+
super();
|
|
356
|
+
this._register(languageFeaturesService.documentPasteEditProvider.register({ scheme: ChatInputPart.INPUT_SCHEME, pattern: '*', hasAccessToAllModels: true }, instaService.createInstance(CopyAttachmentsProvider)));
|
|
357
|
+
this._register(languageFeaturesService.documentPasteEditProvider.register({ scheme: ChatInputPart.INPUT_SCHEME, pattern: '*', hasAccessToAllModels: true }, ( new PasteImageProvider(
|
|
358
|
+
chatWidgetService,
|
|
359
|
+
extensionService,
|
|
360
|
+
fileService,
|
|
361
|
+
environmentService,
|
|
362
|
+
logService
|
|
363
|
+
))));
|
|
364
|
+
this._register(languageFeaturesService.documentPasteEditProvider.register({ scheme: ChatInputPart.INPUT_SCHEME, pattern: '*', hasAccessToAllModels: true }, ( new PasteTextProvider(chatWidgetService, modelService))));
|
|
365
|
+
this._register(languageFeaturesService.documentPasteEditProvider.register('*', ( new CopyTextProvider())));
|
|
366
|
+
}
|
|
367
|
+
};
|
|
368
|
+
ChatPasteProvidersFeature = ( __decorate([
|
|
369
|
+
( __param(0, IInstantiationService)),
|
|
370
|
+
( __param(1, ILanguageFeaturesService)),
|
|
371
|
+
( __param(2, IChatWidgetService)),
|
|
372
|
+
( __param(3, IExtensionService)),
|
|
373
|
+
( __param(4, IFileService)),
|
|
374
|
+
( __param(5, IModelService)),
|
|
375
|
+
( __param(6, IEnvironmentService)),
|
|
376
|
+
( __param(7, ILogService))
|
|
377
|
+
], ChatPasteProvidersFeature));
|
|
378
|
+
|
|
379
|
+
export { ChatPasteProvidersFeature, CopyTextProvider, PasteImageProvider, PasteTextProvider, isImage };
|
|
@@ -2,7 +2,7 @@ import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event"
|
|
|
2
2
|
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
3
3
|
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
4
4
|
import { IQuickInputService } from "@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput.service";
|
|
5
|
-
import { IQuickChatOpenOptions } from "@codingame/monaco-vscode-
|
|
5
|
+
import { IQuickChatOpenOptions } from "@codingame/monaco-vscode-7adbeffb-8051-54a9-8c9b-b62ce9e5836f-common/vscode/vs/workbench/contrib/chat/browser/chat";
|
|
6
6
|
import { IQuickChatService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service";
|
|
7
7
|
import { IChatService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService.service";
|
|
8
8
|
export declare class QuickChatService extends Disposable implements IQuickChatService {
|
|
@@ -23,7 +23,7 @@ import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/mini
|
|
|
23
23
|
import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/miscColors';
|
|
24
24
|
import { quickInputBackground, quickInputForeground } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/quickpickColors';
|
|
25
25
|
import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/searchColors';
|
|
26
|
-
import { showChatView } from '@codingame/monaco-vscode-
|
|
26
|
+
import { showChatView } from '@codingame/monaco-vscode-7adbeffb-8051-54a9-8c9b-b62ce9e5836f-common/vscode/vs/workbench/contrib/chat/browser/chat';
|
|
27
27
|
import { ChatWidget } from '@codingame/monaco-vscode-c465110a-57c0-59d7-a6b2-be0a4db7e517-common/vscode/vs/workbench/contrib/chat/browser/chatWidget';
|
|
28
28
|
import { isCellTextEditOperation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatModel';
|
|
29
29
|
import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService.service';
|
|
@@ -3,7 +3,7 @@ import { AccessibleViewProviderId, AccessibleViewType, IAccessibleViewContentPro
|
|
|
3
3
|
import { IAccessibleViewImplementation } from "@codingame/monaco-vscode-api/vscode/vs/platform/accessibility/browser/accessibleViewRegistry";
|
|
4
4
|
import { ServicesAccessor } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
5
5
|
import { AccessibilityVerbositySettingId } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration";
|
|
6
|
-
import { ChatTreeItem, IChatWidget } from "@codingame/monaco-vscode-
|
|
6
|
+
import { ChatTreeItem, IChatWidget } from "@codingame/monaco-vscode-7adbeffb-8051-54a9-8c9b-b62ce9e5836f-common/vscode/vs/workbench/contrib/chat/browser/chat";
|
|
7
7
|
export declare class ChatResponseAccessibleView implements IAccessibleViewImplementation {
|
|
8
8
|
readonly priority = 100;
|
|
9
9
|
readonly name = "panelChat";
|
|
@@ -6,7 +6,7 @@ import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/l
|
|
|
6
6
|
import { AccessibleViewType, AccessibleViewProviderId } from '@codingame/monaco-vscode-api/vscode/vs/platform/accessibility/browser/accessibleView';
|
|
7
7
|
import { AccessibilityVerbositySettingId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration';
|
|
8
8
|
import { ChatContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
|
|
9
|
-
import { isResponseVM } from '@codingame/monaco-vscode-
|
|
9
|
+
import { isResponseVM } from '@codingame/monaco-vscode-3a35f433-1297-5707-ab58-c261b8180e6d-common/vscode/vs/workbench/contrib/chat/common/chatViewModel';
|
|
10
10
|
import { IChatWidgetService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service';
|
|
11
11
|
|
|
12
12
|
class ChatResponseAccessibleView {
|
|
@@ -53,16 +53,37 @@ class ChatResponseAccessibleProvider extends Disposable {
|
|
|
53
53
|
responseContent = item.errorDetails.message;
|
|
54
54
|
}
|
|
55
55
|
if (isResponseVM(item)) {
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
56
|
+
const toolInvocations = item.response.value.filter(item => item.kind === 'toolInvocation');
|
|
57
|
+
for (const toolInvocation of toolInvocations) {
|
|
58
|
+
if (toolInvocation.confirmationMessages) {
|
|
59
|
+
const title = typeof toolInvocation.confirmationMessages.title === 'string' ? toolInvocation.confirmationMessages.title : toolInvocation.confirmationMessages.title.value;
|
|
60
|
+
const message = typeof toolInvocation.confirmationMessages.message === 'string' ? toolInvocation.confirmationMessages.message : stripIcons(renderMarkdownAsPlaintext(toolInvocation.confirmationMessages.message));
|
|
61
|
+
let input = '';
|
|
62
|
+
if (toolInvocation.toolSpecificData) {
|
|
63
|
+
input = toolInvocation.toolSpecificData?.kind === 'terminal'
|
|
64
|
+
? toolInvocation.toolSpecificData.command
|
|
65
|
+
: input = toolInvocation.toolSpecificData?.kind === 'extensions'
|
|
66
|
+
? JSON.stringify(toolInvocation.toolSpecificData.extensions)
|
|
67
|
+
: JSON.stringify(toolInvocation.toolSpecificData.rawInput);
|
|
68
|
+
}
|
|
69
|
+
responseContent += `${title}`;
|
|
70
|
+
if (input) {
|
|
71
|
+
responseContent += `: ${input}`;
|
|
72
|
+
}
|
|
73
|
+
responseContent += `\n${message}\n`;
|
|
74
|
+
}
|
|
75
|
+
else if (toolInvocation.isComplete && toolInvocation.resultDetails && 'input' in toolInvocation.resultDetails) {
|
|
76
|
+
responseContent += toolInvocation.resultDetails.isError ? 'Errored ' : 'Completed ';
|
|
77
|
+
responseContent += `${`${typeof toolInvocation.invocationMessage === 'string' ? toolInvocation.invocationMessage : stripIcons(renderMarkdownAsPlaintext(toolInvocation.invocationMessage))} with input: ${toolInvocation.resultDetails.input}`}\n`;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
const pastConfirmations = item.response.value.filter(item => item.kind === 'toolInvocationSerialized');
|
|
81
|
+
for (const pastConfirmation of pastConfirmations) {
|
|
82
|
+
if (pastConfirmation.isComplete && pastConfirmation.resultDetails && 'input' in pastConfirmation.resultDetails) {
|
|
83
|
+
if (pastConfirmation.pastTenseMessage) {
|
|
84
|
+
responseContent += `\n${`${typeof pastConfirmation.pastTenseMessage === 'string' ? pastConfirmation.pastTenseMessage : stripIcons(renderMarkdownAsPlaintext(pastConfirmation.pastTenseMessage))} with input: ${pastConfirmation.resultDetails.input}`}\n`;
|
|
85
|
+
}
|
|
64
86
|
}
|
|
65
|
-
responseContent += `\n${message}`;
|
|
66
87
|
}
|
|
67
88
|
}
|
|
68
89
|
return renderMarkdownAsPlaintext(( new MarkdownString(responseContent)), true);
|
|
@@ -5,7 +5,7 @@ import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log
|
|
|
5
5
|
import { IProductService } from "@codingame/monaco-vscode-api/vscode/vs/platform/product/common/productService.service";
|
|
6
6
|
import { ITelemetryService } from "@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service";
|
|
7
7
|
import { IWorkbenchContribution } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions";
|
|
8
|
-
import { ChatEntitlementService } from "@codingame/monaco-vscode-
|
|
8
|
+
import { ChatEntitlementService } from "@codingame/monaco-vscode-3a35f433-1297-5707-ab58-c261b8180e6d-common/vscode/vs/workbench/contrib/chat/common/chatEntitlementService";
|
|
9
9
|
export declare class ChatSetupContribution extends Disposable implements IWorkbenchContribution {
|
|
10
10
|
private readonly productService;
|
|
11
11
|
private readonly instantiationService;
|
|
@@ -16,5 +16,6 @@ export declare class ChatSetupContribution extends Disposable implements IWorkbe
|
|
|
16
16
|
constructor(productService: IProductService, instantiationService: IInstantiationService, commandService: ICommandService, telemetryService: ITelemetryService, chatEntitlementService: ChatEntitlementService, logService: ILogService);
|
|
17
17
|
private registerSetupAgents;
|
|
18
18
|
private registerActions;
|
|
19
|
+
private registerMenus;
|
|
19
20
|
private registerUrlLinkHandler;
|
|
20
21
|
}
|