@codingame/monaco-vscode-chat-service-override 16.1.0 → 17.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 +6 -6
- package/package.json +30 -27
- package/vscode/src/vs/base/common/objectCache.d.ts +1 -1
- package/vscode/src/vs/base/common/objectCache.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +41 -41
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +16 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.d.ts +4 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +410 -443
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatGettingStarted.d.ts +1 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatGettingStarted.js +3 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +9 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTransfer.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.d.ts +4 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +32 -28
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/chatAttachInstructionsAction.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/chatAttachInstructionsAction.js +61 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/chatRunPromptAction.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/chatRunPromptAction.js +159 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/chatSaveToPromptAction.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/chatSaveToPromptAction.js +140 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/dialogs/askToSelectPrompt/promptFilePickers.d.ts +32 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/dialogs/askToSelectPrompt/promptFilePickers.js +244 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/dialogs/askToSelectPrompt/utils/attachInstructions.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/dialogs/askToSelectPrompt/utils/attachInstructions.js +30 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/dialogs/askToSelectPrompt/utils/runPrompt.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/dialogs/askToSelectPrompt/utils/runPrompt.js +12 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/index.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/promptActions/index.js +13 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +171 -168
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMarkdownAnchorService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEdinputInputContentProvider.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.d.ts +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +48 -45
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.d.ts +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +46 -44
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +118 -123
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.d.ts +5 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +45 -29
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.d.ts +12 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +48 -34
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +53 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +32 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.d.ts +9 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +80 -268
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSessionStorage.d.ts +36 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSessionStorage.js +214 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookDiff.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookSnapshot.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookCellEntry.d.ts +7 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookCellEntry.js +26 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.d.ts +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +186 -106
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/overlayToolbarDecorator.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/overlayToolbarDecorator.js +129 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/simpleBrowserEditorOverlay.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/simpleBrowserEditorOverlay.js +313 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.d.ts +4 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.js +12 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.d.ts +0 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +42 -181
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.js +15 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.d.ts +2 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.js +484 -384
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus.js +187 -101
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatusItemService.d.ts +4 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.d.ts +3 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.js +8 -52
- package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.d.ts +53 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.js +264 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockContextProviderService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.js +28 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorHover.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorHover.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.js +41 -45
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatEditingEditorOverlay.css +8 -32
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatSetup.css +2 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatStatus.css +20 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/media/simpleBrowserOverlay.css +67 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/attachInstructionsCommand.d.ts +6 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/attachInstructionsCommand.js +73 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/createPromptCommand.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/createPromptCommand.js +82 -67
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/dialogs/askForPromptName.d.ts +4 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/dialogs/askForPromptName.js +44 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/dialogs/askForPromptSourceFolder.d.ts +5 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/createPromptCommand/dialogs/askForPromptSourceFolder.js +24 -14
- 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.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/common/chatCodeMapperService.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.d.ts +7 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.js +14 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.d.ts +8 -7
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.js +84 -80
- package/vscode/src/vs/workbench/contrib/chat/common/chatSessionStore.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatSessionStore.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatTransferService.d.ts +5 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatTransferService.js +27 -3
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/configMigration.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/configMigration.js +62 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/index.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/index.js +16 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/index.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/index.js +17 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/decorations/frontMatterDecoration.d.ts +29 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/decorations/frontMatterDecoration.js +74 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/decorations/frontMatterMarkerDecoration.d.ts +14 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/decorations/frontMatterMarkerDecoration.js +40 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/decorations/utils/decorationBase.d.ts +23 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/decorations/utils/decorationBase.js +40 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/decorations/utils/index.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/decorations/utils/index.js +9 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/decorations/utils/reactiveDecorationBase.d.ts +23 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/decorations/utils/reactiveDecorationBase.js +68 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/decorations/utils/types.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/promptDecorationsProvider.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/promptDecorationsProvider.js +121 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/types.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/decorationsProvider/types.js +13 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/promptHeaderDiagnosticsProvider.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/promptHeaderDiagnosticsProvider.js +62 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/promptLinkDiagnosticsProvider.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/promptLinkDiagnosticsProvider.js +65 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/{languageFeatures → contributions/languageFeatures/providers}/promptLinkProvider.js +3 -8
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/{languageFeatures → contributions/languageFeatures/providers}/promptPathAutocompletion.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/{languageFeatures → contributions/languageFeatures/providers}/promptPathAutocompletion.js +14 -19
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/providerInstanceBase.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/providerInstanceBase.js +22 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/providerInstanceManagerBase.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/providers/providerInstanceManagerBase.js +83 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/textModelPromptParser.d.ts +4 -3
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/textModelPromptParser.js +8 -6
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.d.ts +17 -5
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.js +223 -21
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts +5 -4
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +28 -22
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/treeUtils.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/treeUtils.js +25 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +20 -31
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +2 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +15 -12
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibilityHelp.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibleView.js +2 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.js +12 -12
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookModifiedCellDecorator.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookModifiedCellDecorator.js +2 -2
- package/vscode/src/vs/workbench/services/workspaces/common/workspaceUtils.d.ts +0 -2
- package/vscode/src/vs/workbench/services/workspaces/common/workspaceUtils.js +1 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/chatAttachPromptAction.d.ts +0 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/chatAttachPromptAction.js +0 -54
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/askToSelectPrompt.d.ts +0 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/askToSelectPrompt.js +0 -79
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/constants.d.ts +0 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/constants.js +0 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/attachPrompts.d.ts +0 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/attachPrompts.js +0 -53
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/createPlaceholderText.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/createPlaceholderText.js +0 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/createPromptPickItem.d.ts +0 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/createPromptPickItem.js +0 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/handleButtonClick.d.ts +0 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAttachPromptAction/dialogs/askToSelectPrompt/utils/handleButtonClick.js +0 -49
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/usePromptCommand.d.ts +0 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/contributions/usePromptCommand.js +0 -80
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/constants.d.ts +0 -3
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/constants.js +0 -13
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contentProviders/textModelContentsProvider.d.ts +0 -21
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contentProviders/textModelContentsProvider.js +0 -64
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageFeatures/promptLinkDiagnosticsProvider.d.ts +0 -9
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageFeatures/promptLinkDiagnosticsProvider.js +0 -117
- /package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/{languageFeatures → contributions/languageFeatures/providers}/promptLinkProvider.d.ts +0 -0
package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/overlayToolbarDecorator.js
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { Disposable, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
4
|
+
import { AccessibilitySignal } from '@codingame/monaco-vscode-api/vscode/vs/platform/accessibilitySignal/browser/accessibilitySignalService';
|
|
5
|
+
import { IAccessibilitySignalService } from '@codingame/monaco-vscode-api/vscode/vs/platform/accessibilitySignal/browser/accessibilitySignalService.service';
|
|
6
|
+
import { MenuWorkbenchToolBar, HiddenItemStrategy } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/browser/toolbar';
|
|
7
|
+
import { MenuId } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
|
|
8
|
+
import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
9
|
+
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
10
|
+
import { ServiceCollection } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/serviceCollection';
|
|
11
|
+
import { CellEditState } from '@codingame/monaco-vscode-324f9a6e-6231-5bfc-af17-e147abd2dfd2-common/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
|
|
12
|
+
import { CellKind } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
13
|
+
|
|
14
|
+
let OverlayToolbarDecorator = class OverlayToolbarDecorator extends Disposable {
|
|
15
|
+
constructor(notebookEditor, notebookModel, instantiationService, accessibilitySignalService) {
|
|
16
|
+
super();
|
|
17
|
+
this.notebookEditor = notebookEditor;
|
|
18
|
+
this.notebookModel = notebookModel;
|
|
19
|
+
this.instantiationService = instantiationService;
|
|
20
|
+
this.accessibilitySignalService = accessibilitySignalService;
|
|
21
|
+
this._timeout = undefined;
|
|
22
|
+
this.overlayDisposables = this._register(( new DisposableStore()));
|
|
23
|
+
}
|
|
24
|
+
decorate(changes) {
|
|
25
|
+
if (this._timeout !== undefined) {
|
|
26
|
+
clearTimeout(this._timeout);
|
|
27
|
+
}
|
|
28
|
+
this._timeout = setTimeout(() => {
|
|
29
|
+
this._timeout = undefined;
|
|
30
|
+
this.createMarkdownPreviewToolbars(changes);
|
|
31
|
+
}, 100);
|
|
32
|
+
}
|
|
33
|
+
createMarkdownPreviewToolbars(changes) {
|
|
34
|
+
this.overlayDisposables.clear();
|
|
35
|
+
const accessibilitySignalService = this.accessibilitySignalService;
|
|
36
|
+
const editor = this.notebookEditor;
|
|
37
|
+
for (const change of changes) {
|
|
38
|
+
const cellViewModel = this.getCellViewModel(change);
|
|
39
|
+
if (!cellViewModel || cellViewModel.cellKind !== CellKind.Markup) {
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
const toolbarContainer = document.createElement('div');
|
|
43
|
+
let overlayId = undefined;
|
|
44
|
+
editor.changeCellOverlays((accessor) => {
|
|
45
|
+
toolbarContainer.style.right = '44px';
|
|
46
|
+
overlayId = accessor.addOverlay({
|
|
47
|
+
cell: cellViewModel,
|
|
48
|
+
domNode: toolbarContainer,
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
const removeOverlay = () => {
|
|
52
|
+
editor.changeCellOverlays(accessor => {
|
|
53
|
+
if (overlayId) {
|
|
54
|
+
accessor.removeOverlay(overlayId);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
this.overlayDisposables.add({ dispose: removeOverlay });
|
|
59
|
+
const toolbar = document.createElement('div');
|
|
60
|
+
toolbarContainer.appendChild(toolbar);
|
|
61
|
+
toolbar.className = 'chat-diff-change-content-widget';
|
|
62
|
+
toolbar.classList.add('hover');
|
|
63
|
+
toolbar.style.position = 'relative';
|
|
64
|
+
toolbar.style.top = '18px';
|
|
65
|
+
toolbar.style.zIndex = '10';
|
|
66
|
+
toolbar.style.display = cellViewModel.getEditState() === CellEditState.Editing ? 'none' : 'block';
|
|
67
|
+
this.overlayDisposables.add(cellViewModel.onDidChangeState((e) => {
|
|
68
|
+
if (e.editStateChanged) {
|
|
69
|
+
if (cellViewModel.getEditState() === CellEditState.Editing) {
|
|
70
|
+
toolbar.style.display = 'none';
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
toolbar.style.display = 'block';
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}));
|
|
77
|
+
const scopedInstaService = this._register(this.instantiationService.createChild(( new ServiceCollection([IContextKeyService, this.notebookEditor.scopedContextKeyService]))));
|
|
78
|
+
const toolbarWidget = scopedInstaService.createInstance(MenuWorkbenchToolBar, toolbar, MenuId.ChatEditingEditorHunk, {
|
|
79
|
+
telemetrySource: 'chatEditingNotebookHunk',
|
|
80
|
+
hiddenItemStrategy: HiddenItemStrategy.NoHide,
|
|
81
|
+
toolbarOptions: { primaryGroup: () => true },
|
|
82
|
+
menuOptions: {
|
|
83
|
+
renderShortTitle: true,
|
|
84
|
+
arg: {
|
|
85
|
+
async accept() {
|
|
86
|
+
accessibilitySignalService.playSignal(AccessibilitySignal.editsKept, { allowManyInParallel: true });
|
|
87
|
+
removeOverlay();
|
|
88
|
+
toolbarWidget.dispose();
|
|
89
|
+
for (const singleChange of change.diff.get().changes) {
|
|
90
|
+
await change.keep(singleChange);
|
|
91
|
+
}
|
|
92
|
+
return true;
|
|
93
|
+
},
|
|
94
|
+
async reject() {
|
|
95
|
+
accessibilitySignalService.playSignal(AccessibilitySignal.editsUndone, { allowManyInParallel: true });
|
|
96
|
+
removeOverlay();
|
|
97
|
+
toolbarWidget.dispose();
|
|
98
|
+
for (const singleChange of change.diff.get().changes) {
|
|
99
|
+
await change.undo(singleChange);
|
|
100
|
+
}
|
|
101
|
+
return true;
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
this.overlayDisposables.add(toolbarWidget);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
getCellViewModel(change) {
|
|
110
|
+
if (change.type === 'delete' || change.modifiedCellIndex === undefined) {
|
|
111
|
+
return undefined;
|
|
112
|
+
}
|
|
113
|
+
const cell = this.notebookModel.cells[change.modifiedCellIndex];
|
|
114
|
+
const cellViewModel = this.notebookEditor.getViewModel()?.viewCells.find(c => c.handle === cell.handle);
|
|
115
|
+
return cellViewModel;
|
|
116
|
+
}
|
|
117
|
+
dispose() {
|
|
118
|
+
super.dispose();
|
|
119
|
+
if (this._timeout !== undefined) {
|
|
120
|
+
clearTimeout(this._timeout);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
OverlayToolbarDecorator = ( __decorate([
|
|
125
|
+
( __param(2, IInstantiationService)),
|
|
126
|
+
( __param(3, IAccessibilitySignalService))
|
|
127
|
+
], OverlayToolbarDecorator));
|
|
128
|
+
|
|
129
|
+
export { OverlayToolbarDecorator };
|
package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/simpleBrowserEditorOverlay.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
2
|
+
import { IWorkbenchContribution } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions";
|
|
3
|
+
import { IEditorGroupsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService.service";
|
|
4
|
+
export declare class SimpleBrowserOverlay implements IWorkbenchContribution {
|
|
5
|
+
static readonly ID = "chat.simpleBrowser.overlay";
|
|
6
|
+
private readonly _store;
|
|
7
|
+
constructor(editorGroupsService: IEditorGroupsService, instantiationService: IInstantiationService);
|
|
8
|
+
dispose(): void;
|
|
9
|
+
}
|
package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/simpleBrowserEditorOverlay.js
ADDED
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
|
|
2
|
+
import { registerCss } from '@codingame/monaco-vscode-api/css';
|
|
3
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
4
|
+
import * as simpleBrowserOverlay from '../media/simpleBrowserOverlay.css';
|
|
5
|
+
import { DisposableStore, toDisposable, DisposableMap, combinedDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
6
|
+
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
7
|
+
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
8
|
+
import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
|
|
9
|
+
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
10
|
+
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
11
|
+
import { IEditorGroupsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
|
|
12
|
+
import { EditorGroupView } from '@codingame/monaco-vscode-c3c61c00-c254-5856-9dc9-d7929c1f9062-common/vscode/vs/workbench/browser/parts/editor/editorGroupView';
|
|
13
|
+
import { Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
14
|
+
import { ServiceCollection } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/serviceCollection';
|
|
15
|
+
import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
16
|
+
import { EditorResourceAccessor, SideBySideEditor } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor';
|
|
17
|
+
import { joinPath, isEqual } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
18
|
+
import { CancellationTokenSource } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
19
|
+
import { IHostService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/host/browser/host.service';
|
|
20
|
+
import { showChatView } from '@codingame/monaco-vscode-fab30422-b487-5f4e-8d30-8b4d266e3fcd-common/vscode/vs/workbench/contrib/chat/browser/chat';
|
|
21
|
+
import { IChatWidgetService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service';
|
|
22
|
+
import { IViewsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/views/common/viewsService.service';
|
|
23
|
+
import { Button } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/button/button';
|
|
24
|
+
import { defaultButtonStyles } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/browser/defaultStyles';
|
|
25
|
+
import { addDisposableListener } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
26
|
+
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
27
|
+
import { cleanupOldImages, createFileForMedia } from '@codingame/monaco-vscode-fab30422-b487-5f4e-8d30-8b4d266e3fcd-common/vscode/vs/workbench/contrib/chat/browser/imageUtils';
|
|
28
|
+
import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
|
|
29
|
+
import { IEnvironmentService } from '@codingame/monaco-vscode-api/vscode/vs/platform/environment/common/environment.service';
|
|
30
|
+
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
31
|
+
import { IPreferencesService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/preferences/common/preferences.service';
|
|
32
|
+
import { observableSignalFromEvent, observableFromEvent } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/utils';
|
|
33
|
+
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/autorun';
|
|
34
|
+
import { derivedOpts } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/derived';
|
|
35
|
+
|
|
36
|
+
registerCss(simpleBrowserOverlay);
|
|
37
|
+
let SimpleBrowserOverlayWidget = class SimpleBrowserOverlayWidget {
|
|
38
|
+
constructor(_editor, _container, _hostService, _chatWidgetService, _viewService, fileService, environmentService, logService, configurationService, _preferencesService) {
|
|
39
|
+
this._editor = _editor;
|
|
40
|
+
this._container = _container;
|
|
41
|
+
this._hostService = _hostService;
|
|
42
|
+
this._chatWidgetService = _chatWidgetService;
|
|
43
|
+
this._viewService = _viewService;
|
|
44
|
+
this.fileService = fileService;
|
|
45
|
+
this.environmentService = environmentService;
|
|
46
|
+
this.logService = logService;
|
|
47
|
+
this.configurationService = configurationService;
|
|
48
|
+
this._preferencesService = _preferencesService;
|
|
49
|
+
this._showStore = ( new DisposableStore());
|
|
50
|
+
this._timeout = undefined;
|
|
51
|
+
this._showStore.add(this.configurationService.onDidChangeConfiguration(e => {
|
|
52
|
+
if (e.affectsConfiguration('chat.sendElementsToChat.enabled')) {
|
|
53
|
+
if (this.configurationService.getValue('chat.sendElementsToChat.enabled')) {
|
|
54
|
+
this.showElement(this._domNode);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
this.hideElement(this._domNode);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}));
|
|
61
|
+
this.imagesFolder = joinPath(this.environmentService.workspaceStorageHome, 'vscode-chat-images');
|
|
62
|
+
cleanupOldImages(this.fileService, this.logService, this.imagesFolder);
|
|
63
|
+
this._domNode = document.createElement('div');
|
|
64
|
+
this._domNode.className = 'element-selection-message';
|
|
65
|
+
const message = document.createElement('span');
|
|
66
|
+
const startSelectionMessage = ( localize(4761, 'Add element to chat'));
|
|
67
|
+
message.textContent = startSelectionMessage;
|
|
68
|
+
this._domNode.appendChild(message);
|
|
69
|
+
let cts;
|
|
70
|
+
const selectButton = this._showStore.add(( new Button(
|
|
71
|
+
this._domNode,
|
|
72
|
+
{ ...defaultButtonStyles, supportIcons: true, title: ( localize(4762, 'Click to select an element.')) }
|
|
73
|
+
)));
|
|
74
|
+
selectButton.element.className = 'element-selection-start';
|
|
75
|
+
selectButton.label = ( localize(4763, 'Start'));
|
|
76
|
+
const cancelButton = this._showStore.add(( new Button(
|
|
77
|
+
this._domNode,
|
|
78
|
+
{ ...defaultButtonStyles, supportIcons: true, title: ( localize(4764, 'Click to cancel selection.')) }
|
|
79
|
+
)));
|
|
80
|
+
cancelButton.element.className = 'element-selection-cancel hidden';
|
|
81
|
+
cancelButton.label = ( localize(4765, 'Cancel'));
|
|
82
|
+
const configure = this._showStore.add(( new Button(this._domNode, { supportIcons: true, title: ( localize(4766, "Configure Attachments Sent")) })));
|
|
83
|
+
configure.icon = Codicon.gear;
|
|
84
|
+
const collapseOverlay = this._showStore.add(( new Button(this._domNode, { supportIcons: true, title: ( localize(4767, "Collapse Overlay")) })));
|
|
85
|
+
collapseOverlay.icon = Codicon.chevronRight;
|
|
86
|
+
const nextSelection = this._showStore.add(( new Button(this._domNode, { supportIcons: true, title: ( localize(4768, "Select Again")) })));
|
|
87
|
+
nextSelection.icon = Codicon.close;
|
|
88
|
+
nextSelection.element.classList.add('hidden');
|
|
89
|
+
const expandOverlay = this._showStore.add(( new Button(this._domNode, { supportIcons: true, title: ( localize(4769, "Expand Overlay")) })));
|
|
90
|
+
expandOverlay.icon = Codicon.layout;
|
|
91
|
+
const expandContainer = document.createElement('div');
|
|
92
|
+
expandContainer.className = 'element-expand-container hidden';
|
|
93
|
+
expandContainer.appendChild(expandOverlay.element);
|
|
94
|
+
this._container.appendChild(expandContainer);
|
|
95
|
+
const resetButtons = () => {
|
|
96
|
+
this.hideElement(nextSelection.element);
|
|
97
|
+
this.showElement(selectButton.element);
|
|
98
|
+
this.showElement(collapseOverlay.element);
|
|
99
|
+
};
|
|
100
|
+
const finishedSelecting = () => {
|
|
101
|
+
this.hideElement(cancelButton.element);
|
|
102
|
+
this.hideElement(collapseOverlay.element);
|
|
103
|
+
this.showElement(nextSelection.element);
|
|
104
|
+
this._timeout = setTimeout(() => {
|
|
105
|
+
message.textContent = startSelectionMessage;
|
|
106
|
+
resetButtons();
|
|
107
|
+
}, 3000);
|
|
108
|
+
};
|
|
109
|
+
this._showStore.add(addDisposableListener(selectButton.element, 'click', async () => {
|
|
110
|
+
cts = ( new CancellationTokenSource());
|
|
111
|
+
this._editor.focus();
|
|
112
|
+
message.textContent = ( localize(4770, 'Selecting element...'));
|
|
113
|
+
this.hideElement(selectButton.element);
|
|
114
|
+
this.showElement(cancelButton.element);
|
|
115
|
+
await this.addElementToChat(cts);
|
|
116
|
+
message.textContent = ( localize(4771, 'Element added to chat'));
|
|
117
|
+
finishedSelecting();
|
|
118
|
+
}));
|
|
119
|
+
this._showStore.add(addDisposableListener(cancelButton.element, 'click', () => {
|
|
120
|
+
cts.cancel();
|
|
121
|
+
message.textContent = ( localize(4772, 'Selection canceled'));
|
|
122
|
+
finishedSelecting();
|
|
123
|
+
}));
|
|
124
|
+
this._showStore.add(addDisposableListener(collapseOverlay.element, 'click', () => {
|
|
125
|
+
this.hideElement(this._domNode);
|
|
126
|
+
this.showElement(expandContainer);
|
|
127
|
+
}));
|
|
128
|
+
this._showStore.add(addDisposableListener(expandOverlay.element, 'click', () => {
|
|
129
|
+
this.showElement(this._domNode);
|
|
130
|
+
this.hideElement(expandContainer);
|
|
131
|
+
}));
|
|
132
|
+
this._showStore.add(addDisposableListener(nextSelection.element, 'click', () => {
|
|
133
|
+
clearTimeout(this._timeout);
|
|
134
|
+
message.textContent = startSelectionMessage;
|
|
135
|
+
resetButtons();
|
|
136
|
+
}));
|
|
137
|
+
this._showStore.add(addDisposableListener(configure.element, 'click', () => {
|
|
138
|
+
this._preferencesService.openSettings({ jsonEditor: false, query: '@id:chat.sendElementsToChat.enabled,chat.sendElementsToChat.attachCSS,chat.sendElementsToChat.attachImages' });
|
|
139
|
+
}));
|
|
140
|
+
}
|
|
141
|
+
hideElement(element) {
|
|
142
|
+
if (element.classList.contains('hidden')) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
element.classList.add('hidden');
|
|
146
|
+
}
|
|
147
|
+
showElement(element) {
|
|
148
|
+
if (!element.classList.contains('hidden')) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
element.classList.remove('hidden');
|
|
152
|
+
}
|
|
153
|
+
async addElementToChat(cts) {
|
|
154
|
+
const editorContainer = this._container.querySelector('.editor-container');
|
|
155
|
+
const editorContainerPosition = editorContainer ? editorContainer.getBoundingClientRect() : this._container.getBoundingClientRect();
|
|
156
|
+
const elementData = await this._hostService.getElementData(editorContainerPosition, cts.token);
|
|
157
|
+
if (!elementData) {
|
|
158
|
+
throw ( new Error('Element data not found'));
|
|
159
|
+
}
|
|
160
|
+
const bounds = elementData.bounds;
|
|
161
|
+
const toAttach = [];
|
|
162
|
+
const widget = this._chatWidgetService.lastFocusedWidget ?? (await showChatView(this._viewService));
|
|
163
|
+
let value = 'Attached HTML and CSS Context\n\n' + elementData.outerHTML;
|
|
164
|
+
if (this.configurationService.getValue('chat.sendElementsToChat.attachCSS')) {
|
|
165
|
+
value += '\n\n' + elementData.computedStyle;
|
|
166
|
+
}
|
|
167
|
+
toAttach.push({
|
|
168
|
+
id: 'element-' + Date.now(),
|
|
169
|
+
name: this.getDisplayNameFromOuterHTML(elementData.outerHTML),
|
|
170
|
+
fullName: this.getDisplayNameFromOuterHTML(elementData.outerHTML),
|
|
171
|
+
value: value,
|
|
172
|
+
kind: 'element',
|
|
173
|
+
icon: ThemeIcon.fromId(Codicon.layout.id),
|
|
174
|
+
});
|
|
175
|
+
if (this.configurationService.getValue('chat.sendElementsToChat.attachImages')) {
|
|
176
|
+
this._domNode.style.display = 'none';
|
|
177
|
+
await ( new Promise(resolve => setTimeout(resolve, 100)));
|
|
178
|
+
const screenshot = await this._hostService.getScreenshot(bounds);
|
|
179
|
+
if (!screenshot) {
|
|
180
|
+
throw ( new Error('Screenshot failed'));
|
|
181
|
+
}
|
|
182
|
+
const fileReference = await createFileForMedia(this.fileService, this.imagesFolder, screenshot.buffer, 'image/png');
|
|
183
|
+
toAttach.push({
|
|
184
|
+
id: 'element-screenshot-' + Date.now(),
|
|
185
|
+
name: 'Element Screenshot',
|
|
186
|
+
fullName: 'Element Screenshot',
|
|
187
|
+
kind: 'image',
|
|
188
|
+
value: screenshot.buffer,
|
|
189
|
+
references: fileReference ? [{ reference: fileReference, kind: 'reference' }] : [],
|
|
190
|
+
});
|
|
191
|
+
this._domNode.style.display = '';
|
|
192
|
+
}
|
|
193
|
+
widget?.attachmentModel?.addContext(...toAttach);
|
|
194
|
+
}
|
|
195
|
+
getDisplayNameFromOuterHTML(outerHTML) {
|
|
196
|
+
const firstElementMatch = outerHTML.match(/^<(\w+)([^>]*?)>/);
|
|
197
|
+
if (!firstElementMatch) {
|
|
198
|
+
throw ( new Error('No outer element found'));
|
|
199
|
+
}
|
|
200
|
+
const tagName = firstElementMatch[1];
|
|
201
|
+
const idMatch = firstElementMatch[2].match(/\s+id\s*=\s*["']([^"']+)["']/i);
|
|
202
|
+
const id = idMatch ? `#${idMatch[1]}` : '';
|
|
203
|
+
const classMatch = firstElementMatch[2].match(/\s+class\s*=\s*["']([^"']+)["']/i);
|
|
204
|
+
const className = classMatch ? `.${classMatch[1].replace(/\s+/g, '.')}` : '';
|
|
205
|
+
return `${tagName}${id}${className}`;
|
|
206
|
+
}
|
|
207
|
+
dispose() {
|
|
208
|
+
this._showStore.dispose();
|
|
209
|
+
}
|
|
210
|
+
getDomNode() {
|
|
211
|
+
return this._domNode;
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
SimpleBrowserOverlayWidget = ( __decorate([
|
|
215
|
+
( __param(2, IHostService)),
|
|
216
|
+
( __param(3, IChatWidgetService)),
|
|
217
|
+
( __param(4, IViewsService)),
|
|
218
|
+
( __param(5, IFileService)),
|
|
219
|
+
( __param(6, IEnvironmentService)),
|
|
220
|
+
( __param(7, ILogService)),
|
|
221
|
+
( __param(8, IConfigurationService)),
|
|
222
|
+
( __param(9, IPreferencesService))
|
|
223
|
+
], SimpleBrowserOverlayWidget));
|
|
224
|
+
let SimpleBrowserOverlayController = class SimpleBrowserOverlayController {
|
|
225
|
+
constructor(container, group, instaService, configurationService) {
|
|
226
|
+
this.configurationService = configurationService;
|
|
227
|
+
this._store = ( new DisposableStore());
|
|
228
|
+
this._domNode = document.createElement('div');
|
|
229
|
+
if (!this.configurationService.getValue('chat.sendElementsToChat.enabled')) {
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
this._domNode.classList.add('chat-simple-browser-overlay');
|
|
233
|
+
this._domNode.style.position = 'absolute';
|
|
234
|
+
this._domNode.style.bottom = `5px`;
|
|
235
|
+
this._domNode.style.right = `5px`;
|
|
236
|
+
this._domNode.style.zIndex = `100`;
|
|
237
|
+
const widget = instaService.createInstance(SimpleBrowserOverlayWidget, group, container);
|
|
238
|
+
this._domNode.appendChild(widget.getDomNode());
|
|
239
|
+
this._store.add(toDisposable(() => this._domNode.remove()));
|
|
240
|
+
this._store.add(widget);
|
|
241
|
+
const show = () => {
|
|
242
|
+
if (!container.contains(this._domNode)) {
|
|
243
|
+
container.appendChild(this._domNode);
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
const hide = () => {
|
|
247
|
+
if (container.contains(this._domNode)) {
|
|
248
|
+
this._domNode.remove();
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
const activeEditorSignal = observableSignalFromEvent(this, Event.any(group.onDidActiveEditorChange, group.onDidModelChange));
|
|
252
|
+
const activeUriObs = derivedOpts({ equalsFn: isEqual }, r => {
|
|
253
|
+
activeEditorSignal.read(r);
|
|
254
|
+
const editor = group.activeEditorPane;
|
|
255
|
+
if (editor?.input.editorId === 'mainThreadWebview-simpleBrowser.view') {
|
|
256
|
+
const uri = EditorResourceAccessor.getOriginalUri(editor?.input, { supportSideBySide: SideBySideEditor.PRIMARY });
|
|
257
|
+
return uri;
|
|
258
|
+
}
|
|
259
|
+
return undefined;
|
|
260
|
+
});
|
|
261
|
+
this._store.add(autorun(r => {
|
|
262
|
+
const data = activeUriObs.read(r);
|
|
263
|
+
if (!data) {
|
|
264
|
+
hide();
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
show();
|
|
268
|
+
}));
|
|
269
|
+
}
|
|
270
|
+
dispose() {
|
|
271
|
+
this._store.dispose();
|
|
272
|
+
}
|
|
273
|
+
};
|
|
274
|
+
SimpleBrowserOverlayController = ( __decorate([
|
|
275
|
+
( __param(2, IInstantiationService)),
|
|
276
|
+
( __param(3, IConfigurationService))
|
|
277
|
+
], SimpleBrowserOverlayController));
|
|
278
|
+
let SimpleBrowserOverlay = class SimpleBrowserOverlay {
|
|
279
|
+
static { this.ID = 'chat.simpleBrowser.overlay'; }
|
|
280
|
+
constructor(editorGroupsService, instantiationService) {
|
|
281
|
+
this._store = ( new DisposableStore());
|
|
282
|
+
const editorGroups = observableFromEvent(this, Event.any(editorGroupsService.onDidAddGroup, editorGroupsService.onDidRemoveGroup), () => editorGroupsService.groups);
|
|
283
|
+
const overlayWidgets = ( new DisposableMap());
|
|
284
|
+
this._store.add(autorun(r => {
|
|
285
|
+
const toDelete = ( new Set(( overlayWidgets.keys())));
|
|
286
|
+
const groups = editorGroups.read(r);
|
|
287
|
+
for (const group of groups) {
|
|
288
|
+
if (!(group instanceof EditorGroupView)) {
|
|
289
|
+
continue;
|
|
290
|
+
}
|
|
291
|
+
toDelete.delete(group);
|
|
292
|
+
if (!( overlayWidgets.has(group))) {
|
|
293
|
+
const scopedInstaService = instantiationService.createChild(( new ServiceCollection([IContextKeyService, group.scopedContextKeyService])));
|
|
294
|
+
const container = group.element;
|
|
295
|
+
const ctrl = scopedInstaService.createInstance(SimpleBrowserOverlayController, container, group);
|
|
296
|
+
overlayWidgets.set(group, combinedDisposable(ctrl, scopedInstaService));
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
for (const group of toDelete) {
|
|
300
|
+
overlayWidgets.deleteAndDispose(group);
|
|
301
|
+
}
|
|
302
|
+
}));
|
|
303
|
+
}
|
|
304
|
+
dispose() {
|
|
305
|
+
this._store.dispose();
|
|
306
|
+
}
|
|
307
|
+
};
|
|
308
|
+
SimpleBrowserOverlay = ( __decorate([
|
|
309
|
+
( __param(0, IEditorGroupsService)),
|
|
310
|
+
( __param(1, IInstantiationService))
|
|
311
|
+
], SimpleBrowserOverlay));
|
|
312
|
+
|
|
313
|
+
export { SimpleBrowserOverlay };
|
|
@@ -7,12 +7,11 @@ import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/pl
|
|
|
7
7
|
import { IStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service";
|
|
8
8
|
import { ITelemetryService } from "@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service";
|
|
9
9
|
import { IThemeService } from "@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService.service";
|
|
10
|
-
import { EditorPane } from "@codingame/monaco-vscode-
|
|
10
|
+
import { EditorPane } from "@codingame/monaco-vscode-d0fb86d3-2a47-594e-955b-9a24631a7124-common/vscode/vs/workbench/browser/parts/editor/editorPane";
|
|
11
11
|
import { IEditorOpenContext } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor";
|
|
12
12
|
import { IEditorGroup } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService";
|
|
13
|
-
import { IExportableChatData, ISerializableChatData } from "@codingame/monaco-vscode-
|
|
14
|
-
import {
|
|
15
|
-
import { ChatEditorInput } from "@codingame/monaco-vscode-9a6d8b6c-ad4c-5ea3-9558-f43d6dc4c0ad-common/vscode/vs/workbench/contrib/chat/browser/chatEditorInput";
|
|
13
|
+
import { IExportableChatData, ISerializableChatData } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatModel";
|
|
14
|
+
import { ChatEditorInput } from "@codingame/monaco-vscode-fab30422-b487-5f4e-8d30-8b4d266e3fcd-common/vscode/vs/workbench/contrib/chat/browser/chatEditorInput";
|
|
16
15
|
export interface IChatEditorOptions extends IEditorOptions {
|
|
17
16
|
target?: {
|
|
18
17
|
sessionId: string;
|
|
@@ -24,13 +23,12 @@ export declare class ChatEditor extends EditorPane {
|
|
|
24
23
|
private readonly instantiationService;
|
|
25
24
|
private readonly storageService;
|
|
26
25
|
private readonly contextKeyService;
|
|
27
|
-
private readonly chatService;
|
|
28
26
|
private widget;
|
|
29
27
|
private _scopedContextKeyService;
|
|
30
28
|
get scopedContextKeyService(): IScopedContextKeyService;
|
|
31
29
|
private _memento;
|
|
32
30
|
private _viewState;
|
|
33
|
-
constructor(group: IEditorGroup, telemetryService: ITelemetryService, themeService: IThemeService, instantiationService: IInstantiationService, storageService: IStorageService, contextKeyService: IContextKeyService
|
|
31
|
+
constructor(group: IEditorGroup, telemetryService: ITelemetryService, themeService: IThemeService, instantiationService: IInstantiationService, storageService: IStorageService, contextKeyService: IContextKeyService);
|
|
34
32
|
private clear;
|
|
35
33
|
protected createEditor(parent: HTMLElement): void;
|
|
36
34
|
protected setEditorVisible(visible: boolean): void;
|
|
@@ -18,26 +18,24 @@ import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/misc
|
|
|
18
18
|
import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/quickpickColors';
|
|
19
19
|
import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/searchColors';
|
|
20
20
|
import { IThemeService } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService.service';
|
|
21
|
-
import { EditorPane } from '@codingame/monaco-vscode-
|
|
22
|
-
import { Memento } from '@codingame/monaco-vscode-
|
|
21
|
+
import { EditorPane } from '@codingame/monaco-vscode-d0fb86d3-2a47-594e-955b-9a24631a7124-common/vscode/vs/workbench/browser/parts/editor/editorPane';
|
|
22
|
+
import { Memento } from '@codingame/monaco-vscode-c8227507-8e59-53d6-b50b-71c0ab384cf4-common/vscode/vs/workbench/common/memento';
|
|
23
23
|
import { EDITOR_DRAG_AND_DROP_BACKGROUND } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/theme';
|
|
24
|
-
import { CHAT_PROVIDER_ID } from '@codingame/monaco-vscode-
|
|
25
|
-
import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService.service';
|
|
24
|
+
import { CHAT_PROVIDER_ID } from '@codingame/monaco-vscode-fab30422-b487-5f4e-8d30-8b4d266e3fcd-common/vscode/vs/workbench/contrib/chat/common/chatParticipantContribTypes';
|
|
26
25
|
import { ChatAgentLocation, ChatMode } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
|
|
27
|
-
import { clearChatEditor } from '@codingame/monaco-vscode-
|
|
28
|
-
import { ChatEditorInput } from '@codingame/monaco-vscode-
|
|
29
|
-
import { ChatWidget } from '@codingame/monaco-vscode-
|
|
26
|
+
import { clearChatEditor } from '@codingame/monaco-vscode-fab30422-b487-5f4e-8d30-8b4d266e3fcd-common/vscode/vs/workbench/contrib/chat/browser/actions/chatClear';
|
|
27
|
+
import { ChatEditorInput } from '@codingame/monaco-vscode-fab30422-b487-5f4e-8d30-8b4d266e3fcd-common/vscode/vs/workbench/contrib/chat/browser/chatEditorInput';
|
|
28
|
+
import { ChatWidget } from '@codingame/monaco-vscode-c465110a-57c0-59d7-a6b2-be0a4db7e517-common/vscode/vs/workbench/contrib/chat/browser/chatWidget';
|
|
30
29
|
|
|
31
30
|
let ChatEditor = class ChatEditor extends EditorPane {
|
|
32
31
|
get scopedContextKeyService() {
|
|
33
32
|
return this._scopedContextKeyService;
|
|
34
33
|
}
|
|
35
|
-
constructor(group, telemetryService, themeService, instantiationService, storageService, contextKeyService
|
|
34
|
+
constructor(group, telemetryService, themeService, instantiationService, storageService, contextKeyService) {
|
|
36
35
|
super(ChatEditorInput.EditorID, group, telemetryService, themeService, storageService);
|
|
37
36
|
this.instantiationService = instantiationService;
|
|
38
37
|
this.storageService = storageService;
|
|
39
38
|
this.contextKeyService = contextKeyService;
|
|
40
|
-
this.chatService = chatService;
|
|
41
39
|
}
|
|
42
40
|
async clear() {
|
|
43
41
|
if (this.input) {
|
|
@@ -51,17 +49,16 @@ let ChatEditor = class ChatEditor extends EditorPane {
|
|
|
51
49
|
autoScroll: mode => mode !== ChatMode.Ask,
|
|
52
50
|
renderFollowups: true,
|
|
53
51
|
supportsFileReferences: true,
|
|
54
|
-
supportsAdditionalParticipants: true,
|
|
55
52
|
rendererOptions: {
|
|
56
53
|
renderTextEditsAsSummary: (uri) => {
|
|
57
|
-
return
|
|
54
|
+
return true;
|
|
58
55
|
},
|
|
59
|
-
referencesExpandedWhenEmptyResponse:
|
|
56
|
+
referencesExpandedWhenEmptyResponse: false,
|
|
60
57
|
progressMessageAtBottomOfResponse: mode => mode !== ChatMode.Ask,
|
|
61
58
|
},
|
|
62
59
|
enableImplicitContext: true,
|
|
63
|
-
enableWorkingSet:
|
|
64
|
-
supportsChangingModes:
|
|
60
|
+
enableWorkingSet: 'explicit',
|
|
61
|
+
supportsChangingModes: true,
|
|
65
62
|
}, {
|
|
66
63
|
listForeground: editorForeground,
|
|
67
64
|
listBackground: editorBackground,
|
|
@@ -124,8 +121,7 @@ ChatEditor = ( __decorate([
|
|
|
124
121
|
( __param(2, IThemeService)),
|
|
125
122
|
( __param(3, IInstantiationService)),
|
|
126
123
|
( __param(4, IStorageService)),
|
|
127
|
-
( __param(5, IContextKeyService))
|
|
128
|
-
( __param(6, IChatService))
|
|
124
|
+
( __param(5, IContextKeyService))
|
|
129
125
|
], ChatEditor));
|
|
130
126
|
|
|
131
127
|
export { ChatEditor };
|
|
@@ -2,7 +2,6 @@ import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/l
|
|
|
2
2
|
import { IContextKeyService } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service";
|
|
3
3
|
import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
|
|
4
4
|
import { IProductService } from "@codingame/monaco-vscode-api/vscode/vs/platform/product/common/productService.service";
|
|
5
|
-
import { ViewPane } from "@codingame/monaco-vscode-65619f8f-0eab-5d8b-855a-43b6353fe527-common/vscode/vs/workbench/browser/parts/views/viewPane";
|
|
6
5
|
import { IWorkbenchContribution } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions";
|
|
7
6
|
import { IExtensionsWorkbenchService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/extensions/common/extensions.service";
|
|
8
7
|
import { IChatAgentService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatAgents.service";
|
|
@@ -21,6 +20,3 @@ export declare class ChatCompatibilityNotifier extends Disposable implements IWo
|
|
|
21
20
|
constructor(extensionsWorkbenchService: IExtensionsWorkbenchService, contextKeyService: IContextKeyService, productService: IProductService);
|
|
22
21
|
private registerWelcomeView;
|
|
23
22
|
}
|
|
24
|
-
export declare class MovedChatEditsViewPane extends ViewPane {
|
|
25
|
-
shouldShowWelcome(): boolean;
|
|
26
|
-
}
|