@codingame/monaco-vscode-chat-service-override 17.2.0 → 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
|
@@ -3,7 +3,7 @@ import { registerCss } from '@codingame/monaco-vscode-api/css';
|
|
|
3
3
|
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
4
4
|
import * as chatSetup from './media/chatSetup.css';
|
|
5
5
|
import { $ } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
6
|
-
import { Dialog } from '@codingame/monaco-vscode-f1bbc6d3-6129-583c-a2ba-c80b832993d2-common/vscode/vs/base/browser/ui/dialog/dialog';
|
|
6
|
+
import { Dialog, DialogContentsAlignment } from '@codingame/monaco-vscode-f1bbc6d3-6129-583c-a2ba-c80b832993d2-common/vscode/vs/base/browser/ui/dialog/dialog';
|
|
7
7
|
import { toAction } from '@codingame/monaco-vscode-api/vscode/vs/base/common/actions';
|
|
8
8
|
import { timeout } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
9
9
|
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
@@ -19,14 +19,13 @@ import { equalsIgnoreCase } from '@codingame/monaco-vscode-api/vscode/vs/base/co
|
|
|
19
19
|
import { isObject } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
20
20
|
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
21
21
|
import { MarkdownRenderer } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/widget/markdownRenderer/browser/markdownRenderer';
|
|
22
|
-
import {
|
|
23
|
-
import { Action2, MenuId, registerAction2 } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
|
|
22
|
+
import { localize2, localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
23
|
+
import { Action2, MenuId, registerAction2, MenuRegistry } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
|
|
24
24
|
import { ICommandService } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service';
|
|
25
25
|
import { ConfigurationTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration';
|
|
26
26
|
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
27
27
|
import { Extensions } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configurationRegistry';
|
|
28
28
|
import { ContextKeyExpr } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
|
|
29
|
-
import { IContextMenuService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextview/browser/contextView.service';
|
|
30
29
|
import { createWorkbenchDialogOptions } from '@codingame/monaco-vscode-f1bbc6d3-6129-583c-a2ba-c80b832993d2-common/vscode/vs/platform/dialogs/browser/dialog';
|
|
31
30
|
import { IDialogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service';
|
|
32
31
|
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
@@ -45,7 +44,7 @@ import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platfo
|
|
|
45
44
|
import { IWorkspaceTrustRequestService } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspaceTrust.service';
|
|
46
45
|
import { ViewContainerLocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/views';
|
|
47
46
|
import { IViewDescriptorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/views.service';
|
|
48
|
-
import { ProgressBadge } from '@codingame/monaco-vscode-
|
|
47
|
+
import { ProgressBadge } from '@codingame/monaco-vscode-937ecbdf-94c7-5b16-aefa-ad78ae557a93-common/vscode/vs/workbench/services/activity/common/activity';
|
|
49
48
|
import { IActivityService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/activity/common/activity.service';
|
|
50
49
|
import { IAuthenticationService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/common/authentication.service';
|
|
51
50
|
import { ExtensionUrlHandlerOverrideRegistry } from '@codingame/monaco-vscode-8c844347-a703-5de1-9eeb-5e0c7f503a58-common/vscode/vs/workbench/services/extensions/browser/extensionUrlHandler';
|
|
@@ -55,21 +54,26 @@ import { Parts } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services
|
|
|
55
54
|
import { IWorkbenchLayoutService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/layout/browser/layoutService.service';
|
|
56
55
|
import { ILifecycleService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/lifecycle/common/lifecycle.service';
|
|
57
56
|
import { IViewsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/views/common/viewsService.service';
|
|
57
|
+
import { ToolDataSource } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModelToolsService';
|
|
58
58
|
import { ILanguageModelToolsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModelToolsService.service';
|
|
59
59
|
import { IExtensionsWorkbenchService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/extensions/common/extensions.service';
|
|
60
60
|
import { IChatAgentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatAgents.service';
|
|
61
61
|
import { ChatContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
|
|
62
|
-
import { ChatEntitlement, ChatEntitlementRequests, isProUser } from '@codingame/monaco-vscode-
|
|
62
|
+
import { ChatEntitlement, ChatEntitlementRequests, isProUser } from '@codingame/monaco-vscode-3a35f433-1297-5707-ab58-c261b8180e6d-common/vscode/vs/workbench/contrib/chat/common/chatEntitlementService';
|
|
63
63
|
import { IChatEntitlementService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatEntitlementService.service';
|
|
64
64
|
import { ChatRequestModel } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatModel';
|
|
65
65
|
import { ChatRequestToolPart, ChatRequestAgentPart } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatParserTypes';
|
|
66
66
|
import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService.service';
|
|
67
67
|
import { ChatConfiguration, ChatAgentLocation, ChatMode, validateChatMode } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
|
|
68
68
|
import { ILanguageModelsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModels.service';
|
|
69
|
-
import { CHAT_SETUP_ACTION_ID, CHAT_CATEGORY, CHAT_OPEN_ACTION_ID } from '@codingame/monaco-vscode-
|
|
70
|
-
import { showCopilotView, ChatViewId } from '@codingame/monaco-vscode-
|
|
69
|
+
import { CHAT_SETUP_ACTION_ID, CHAT_CATEGORY, CHAT_OPEN_ACTION_ID } from '@codingame/monaco-vscode-3a35f433-1297-5707-ab58-c261b8180e6d-common/vscode/vs/workbench/contrib/chat/browser/actions/chatActions';
|
|
70
|
+
import { showCopilotView, ChatViewId } from '@codingame/monaco-vscode-7adbeffb-8051-54a9-8c9b-b62ce9e5836f-common/vscode/vs/workbench/contrib/chat/browser/chat';
|
|
71
71
|
import { IChatWidgetService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service';
|
|
72
72
|
import { CHAT_SIDEBAR_PANEL_ID } from './chatViewPane.js';
|
|
73
|
+
import { coalesce } from '@codingame/monaco-vscode-api/vscode/vs/base/common/arrays';
|
|
74
|
+
import { IContextMenuService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextview/browser/contextView.service';
|
|
75
|
+
import { ChatMode2 } from '@codingame/monaco-vscode-fab30422-b487-5f4e-8d30-8b4d266e3fcd-common/vscode/vs/workbench/contrib/chat/common/chatModes';
|
|
76
|
+
import { IWorkbenchEnvironmentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/environment/common/environmentService.service';
|
|
73
77
|
|
|
74
78
|
var SetupAgent_1, ChatSetup_1;
|
|
75
79
|
registerCss(chatSetup);
|
|
@@ -77,15 +81,16 @@ const defaultChat = {
|
|
|
77
81
|
extensionId: product.defaultChatAgent?.extensionId ?? '',
|
|
78
82
|
chatExtensionId: product.defaultChatAgent?.chatExtensionId ?? '',
|
|
79
83
|
documentationUrl: product.defaultChatAgent?.documentationUrl ?? '',
|
|
80
|
-
termsStatementUrl: product.defaultChatAgent?.termsStatementUrl ?? '',
|
|
81
|
-
privacyStatementUrl: product.defaultChatAgent?.privacyStatementUrl ?? '',
|
|
82
84
|
skusDocumentationUrl: product.defaultChatAgent?.skusDocumentationUrl ?? '',
|
|
83
85
|
publicCodeMatchesUrl: product.defaultChatAgent?.publicCodeMatchesUrl ?? '',
|
|
84
86
|
manageOveragesUrl: product.defaultChatAgent?.manageOverageUrl ?? '',
|
|
85
87
|
upgradePlanUrl: product.defaultChatAgent?.upgradePlanUrl ?? '',
|
|
88
|
+
signUpUrl: product.defaultChatAgent?.signUpUrl ?? '',
|
|
86
89
|
providerName: product.defaultChatAgent?.providerName ?? '',
|
|
87
90
|
enterpriseProviderId: product.defaultChatAgent?.enterpriseProviderId ?? '',
|
|
88
91
|
enterpriseProviderName: product.defaultChatAgent?.enterpriseProviderName ?? '',
|
|
92
|
+
alternativeProviderId: product.defaultChatAgent?.alternativeProviderId ?? '',
|
|
93
|
+
alternativeProviderName: product.defaultChatAgent?.alternativeProviderName ?? '',
|
|
89
94
|
providerUriSetting: product.defaultChatAgent?.providerUriSetting ?? '',
|
|
90
95
|
providerScopes: product.defaultChatAgent?.providerScopes ?? [[]],
|
|
91
96
|
manageSettingsUrl: product.defaultChatAgent?.manageSettingsUrl ?? '',
|
|
@@ -94,12 +99,6 @@ const defaultChat = {
|
|
|
94
99
|
completionsRefreshTokenCommand: product.defaultChatAgent?.completionsRefreshTokenCommand ?? '',
|
|
95
100
|
chatRefreshTokenCommand: product.defaultChatAgent?.chatRefreshTokenCommand ?? '',
|
|
96
101
|
};
|
|
97
|
-
const copilotSettingsMessage = ( localize(
|
|
98
|
-
4850,
|
|
99
|
-
"Copilot Free and Pro may show [public code]({0}) suggestions and we may use your data for product improvement. You can change these [settings]({1}) at any time.",
|
|
100
|
-
defaultChat.publicCodeMatchesUrl,
|
|
101
|
-
defaultChat.manageSettingsUrl
|
|
102
|
-
));
|
|
103
102
|
const ToolsAgentContextKey = ( ContextKeyExpr.and(( ContextKeyExpr.equals(`config.${ChatConfiguration.AgentEnabled}`, true)), ( ChatContextKeys.Editing.agentModeDisallowed.negate()),
|
|
104
103
|
ContextKeyExpr.not(`previewFeaturesDisabled`)));
|
|
105
104
|
let SetupAgent = class SetupAgent extends Disposable {
|
|
@@ -108,7 +107,7 @@ let SetupAgent = class SetupAgent extends Disposable {
|
|
|
108
107
|
return instantiationService.invokeFunction(accessor => {
|
|
109
108
|
const chatAgentService = accessor.get(IChatAgentService);
|
|
110
109
|
let id;
|
|
111
|
-
let description =
|
|
110
|
+
let description = ChatMode2.Ask.description;
|
|
112
111
|
switch (location) {
|
|
113
112
|
case ChatAgentLocation.Panel:
|
|
114
113
|
if (mode === ChatMode.Ask) {
|
|
@@ -116,11 +115,11 @@ let SetupAgent = class SetupAgent extends Disposable {
|
|
|
116
115
|
}
|
|
117
116
|
else if (mode === ChatMode.Edit) {
|
|
118
117
|
id = 'setup.edits';
|
|
119
|
-
description =
|
|
118
|
+
description = ChatMode2.Edit.description;
|
|
120
119
|
}
|
|
121
120
|
else {
|
|
122
121
|
id = 'setup.agent';
|
|
123
|
-
description =
|
|
122
|
+
description = ChatMode2.Agent.description;
|
|
124
123
|
}
|
|
125
124
|
break;
|
|
126
125
|
case ChatAgentLocation.Terminal:
|
|
@@ -140,21 +139,18 @@ let SetupAgent = class SetupAgent extends Disposable {
|
|
|
140
139
|
return instantiationService.invokeFunction(accessor => {
|
|
141
140
|
const chatAgentService = accessor.get(IChatAgentService);
|
|
142
141
|
const disposables = ( new DisposableStore());
|
|
143
|
-
const { agent, disposable } = SetupAgent_1.doRegisterAgent(instantiationService, chatAgentService, 'setup.vscode', 'vscode', false, ( localize2(
|
|
142
|
+
const { agent, disposable } = SetupAgent_1.doRegisterAgent(instantiationService, chatAgentService, 'setup.vscode', 'vscode', false, ( localize2(4899, "Ask questions about VS Code")).value, ChatAgentLocation.Panel, undefined, context, controller);
|
|
144
143
|
disposables.add(disposable);
|
|
145
144
|
disposables.add(SetupTool.registerTool(instantiationService, {
|
|
146
145
|
id: 'setup.tools.createNewWorkspace',
|
|
147
|
-
source:
|
|
148
|
-
type: 'internal',
|
|
149
|
-
},
|
|
146
|
+
source: ToolDataSource.Internal,
|
|
150
147
|
icon: Codicon.newFolder,
|
|
151
|
-
displayName: ( localize(
|
|
152
|
-
modelDescription: ( localize(
|
|
153
|
-
userDescription: ( localize(
|
|
148
|
+
displayName: ( localize(4900, "New Workspace")),
|
|
149
|
+
modelDescription: ( localize(4901, "Scaffold a new workspace in VS Code")),
|
|
150
|
+
userDescription: ( localize(4901, "Scaffold a new workspace in VS Code")),
|
|
154
151
|
canBeReferencedInPrompt: true,
|
|
155
152
|
toolReferenceName: 'new',
|
|
156
153
|
when: ContextKeyExpr.true(),
|
|
157
|
-
supportsToolPicker: true,
|
|
158
154
|
}).disposable);
|
|
159
155
|
return { agent, disposable: disposables };
|
|
160
156
|
});
|
|
@@ -179,10 +175,13 @@ let SetupAgent = class SetupAgent extends Disposable {
|
|
|
179
175
|
}));
|
|
180
176
|
const agent = disposables.add(instantiationService.createInstance(SetupAgent_1, context, controller, location));
|
|
181
177
|
disposables.add(chatAgentService.registerAgentImplementation(id, agent));
|
|
178
|
+
if (mode === ChatMode.Agent) {
|
|
179
|
+
chatAgentService.updateAgent(id, { themeIcon: Codicon.tools });
|
|
180
|
+
}
|
|
182
181
|
return { agent, disposable: disposables };
|
|
183
182
|
}
|
|
184
|
-
static { this.SETUP_NEEDED_MESSAGE = ( new MarkdownString(( localize(
|
|
185
|
-
constructor(context, controller, location, instantiationService, logService, configurationService, telemetryService) {
|
|
183
|
+
static { this.SETUP_NEEDED_MESSAGE = ( new MarkdownString(( localize(4902, "You need to set up Copilot and be signed in to use Chat.")))); }
|
|
184
|
+
constructor(context, controller, location, instantiationService, logService, configurationService, telemetryService, environmentService) {
|
|
186
185
|
super();
|
|
187
186
|
this.context = context;
|
|
188
187
|
this.controller = controller;
|
|
@@ -191,6 +190,7 @@ let SetupAgent = class SetupAgent extends Disposable {
|
|
|
191
190
|
this.logService = logService;
|
|
192
191
|
this.configurationService = configurationService;
|
|
193
192
|
this.telemetryService = telemetryService;
|
|
193
|
+
this.environmentService = environmentService;
|
|
194
194
|
this._onUnresolvableError = this._register(( new Emitter()));
|
|
195
195
|
this.onUnresolvableError = this._onUnresolvableError.event;
|
|
196
196
|
this.pendingForwardedRequests = ( new Map());
|
|
@@ -202,11 +202,11 @@ let SetupAgent = class SetupAgent extends Disposable {
|
|
|
202
202
|
const chatWidgetService = accessor.get(IChatWidgetService);
|
|
203
203
|
const chatAgentService = accessor.get(IChatAgentService);
|
|
204
204
|
const languageModelToolsService = accessor.get(ILanguageModelToolsService);
|
|
205
|
-
return this.doInvoke(request, progress, chatService, languageModelsService, chatWidgetService, chatAgentService, languageModelToolsService);
|
|
205
|
+
return this.doInvoke(request, part => progress([part]), chatService, languageModelsService, chatWidgetService, chatAgentService, languageModelToolsService);
|
|
206
206
|
});
|
|
207
207
|
}
|
|
208
208
|
async doInvoke(request, progress, chatService, languageModelsService, chatWidgetService, chatAgentService, languageModelToolsService) {
|
|
209
|
-
if (!this.context.state.installed || this.context.state.entitlement === ChatEntitlement.Available || this.context.state.entitlement === ChatEntitlement.Unknown) {
|
|
209
|
+
if (!this.context.state.installed || this.context.state.disabled || this.context.state.entitlement === ChatEntitlement.Available || this.context.state.entitlement === ChatEntitlement.Unknown) {
|
|
210
210
|
return this.doInvokeWithSetup(request, progress, chatService, languageModelsService, chatWidgetService, chatAgentService, languageModelToolsService);
|
|
211
211
|
}
|
|
212
212
|
return this.doInvokeWithoutSetup(request, progress, chatService, languageModelsService, chatWidgetService, chatAgentService, languageModelToolsService);
|
|
@@ -219,7 +219,7 @@ let SetupAgent = class SetupAgent extends Disposable {
|
|
|
219
219
|
}
|
|
220
220
|
progress({
|
|
221
221
|
kind: 'progressMessage',
|
|
222
|
-
content: ( new MarkdownString(( localize(
|
|
222
|
+
content: ( new MarkdownString(( localize(4903, "Getting Copilot ready.")))),
|
|
223
223
|
});
|
|
224
224
|
await this.forwardRequestToCopilot(requestModel, progress, chatService, languageModelsService, chatAgentService, chatWidgetService, languageModelToolsService);
|
|
225
225
|
return {};
|
|
@@ -231,7 +231,7 @@ let SetupAgent = class SetupAgent extends Disposable {
|
|
|
231
231
|
catch (error) {
|
|
232
232
|
progress({
|
|
233
233
|
kind: 'warning',
|
|
234
|
-
content: ( new MarkdownString(( localize(
|
|
234
|
+
content: ( new MarkdownString(( localize(4904, "Copilot failed to get a response. Please try again."))))
|
|
235
235
|
});
|
|
236
236
|
}
|
|
237
237
|
}
|
|
@@ -259,27 +259,36 @@ let SetupAgent = class SetupAgent extends Disposable {
|
|
|
259
259
|
const timeoutHandle = setTimeout(() => {
|
|
260
260
|
progress({
|
|
261
261
|
kind: 'progressMessage',
|
|
262
|
-
content: ( new MarkdownString(( localize(
|
|
262
|
+
content: ( new MarkdownString(( localize(4905, "Copilot is almost ready.")))),
|
|
263
263
|
});
|
|
264
264
|
}, 10000);
|
|
265
265
|
try {
|
|
266
266
|
const ready = await Promise.race([
|
|
267
|
-
timeout(20000).then(() => 'timedout'),
|
|
267
|
+
timeout(this.environmentService.remoteAuthority ? 60000 : 20000).then(() => 'timedout'),
|
|
268
268
|
this.whenDefaultAgentFailed(chatService).then(() => 'error'),
|
|
269
269
|
Promise.allSettled([whenLanguageModelReady, whenAgentReady, whenToolsModelReady])
|
|
270
270
|
]);
|
|
271
271
|
if (ready === 'error' || ready === 'timedout') {
|
|
272
|
+
let warningMessage;
|
|
273
|
+
if (ready === 'timedout') {
|
|
274
|
+
warningMessage = ( localize(
|
|
275
|
+
4906,
|
|
276
|
+
"Copilot took too long to get ready. Please ensure you are signed in to {0} and that the extension `{1}` is installed and enabled.",
|
|
277
|
+
defaultChat.providerName,
|
|
278
|
+
defaultChat.chatExtensionId
|
|
279
|
+
));
|
|
280
|
+
}
|
|
281
|
+
else {
|
|
282
|
+
warningMessage = ( localize(
|
|
283
|
+
4907,
|
|
284
|
+
"Copilot failed to get ready. Please ensure you are signed in to {0} and that the extension `{1}` is installed and enabled.",
|
|
285
|
+
defaultChat.providerName,
|
|
286
|
+
defaultChat.chatExtensionId
|
|
287
|
+
));
|
|
288
|
+
}
|
|
272
289
|
progress({
|
|
273
290
|
kind: 'warning',
|
|
274
|
-
content: ( new MarkdownString(
|
|
275
|
-
( localize(
|
|
276
|
-
4861,
|
|
277
|
-
"Copilot took too long to get ready. Please review the guidance in the Chat view."
|
|
278
|
-
)) :
|
|
279
|
-
( localize(
|
|
280
|
-
4862,
|
|
281
|
-
"Copilot failed to get ready. Please review the guidance in the Chat view."
|
|
282
|
-
))))
|
|
291
|
+
content: ( new MarkdownString(warningMessage))
|
|
283
292
|
});
|
|
284
293
|
this._onUnresolvableError.fire();
|
|
285
294
|
return;
|
|
@@ -289,7 +298,11 @@ let SetupAgent = class SetupAgent extends Disposable {
|
|
|
289
298
|
clearTimeout(timeoutHandle);
|
|
290
299
|
}
|
|
291
300
|
}
|
|
292
|
-
await chatService.resendRequest(requestModel, {
|
|
301
|
+
await chatService.resendRequest(requestModel, {
|
|
302
|
+
mode,
|
|
303
|
+
userSelectedModelId: languageModel,
|
|
304
|
+
userSelectedTools: widget?.getUserSelectedTools()
|
|
305
|
+
});
|
|
293
306
|
}
|
|
294
307
|
whenLanguageModelReady(languageModelsService) {
|
|
295
308
|
for (const id of languageModelsService.getLanguageModelIds()) {
|
|
@@ -343,7 +356,7 @@ let SetupAgent = class SetupAgent extends Disposable {
|
|
|
343
356
|
progress({
|
|
344
357
|
kind: 'progressMessage',
|
|
345
358
|
content: ( new MarkdownString(( localize(
|
|
346
|
-
|
|
359
|
+
4908,
|
|
347
360
|
"Signing in to {0}.",
|
|
348
361
|
ChatEntitlementRequests.providerId(this.configurationService) === defaultChat.enterpriseProviderId ? defaultChat.enterpriseProviderName : defaultChat.providerName
|
|
349
362
|
)))),
|
|
@@ -352,14 +365,14 @@ let SetupAgent = class SetupAgent extends Disposable {
|
|
|
352
365
|
case ChatSetupStep.Installing:
|
|
353
366
|
progress({
|
|
354
367
|
kind: 'progressMessage',
|
|
355
|
-
content: ( new MarkdownString(( localize(
|
|
368
|
+
content: ( new MarkdownString(( localize(4909, "Getting Copilot ready.")))),
|
|
356
369
|
});
|
|
357
370
|
break;
|
|
358
371
|
}
|
|
359
372
|
}));
|
|
360
373
|
let result = undefined;
|
|
361
374
|
try {
|
|
362
|
-
result = await ChatSetup.getInstance(this.instantiationService, this.context, this.controller).run();
|
|
375
|
+
result = await ChatSetup.getInstance(this.instantiationService, this.context, this.controller).run({ disableChatViewReveal: true });
|
|
363
376
|
}
|
|
364
377
|
catch (error) {
|
|
365
378
|
this.logService.error(`[chat setup] Error during setup: ${toErrorMessage(error)}`);
|
|
@@ -372,7 +385,7 @@ let SetupAgent = class SetupAgent extends Disposable {
|
|
|
372
385
|
if (result.dialogSkipped) {
|
|
373
386
|
progress({
|
|
374
387
|
kind: 'markdownContent',
|
|
375
|
-
content: ( new MarkdownString(
|
|
388
|
+
content: ( new MarkdownString(( localize(4910, "Copilot setup finished successfully."))))
|
|
376
389
|
});
|
|
377
390
|
}
|
|
378
391
|
else if (requestModel) {
|
|
@@ -384,7 +397,7 @@ let SetupAgent = class SetupAgent extends Disposable {
|
|
|
384
397
|
else {
|
|
385
398
|
progress({
|
|
386
399
|
kind: 'warning',
|
|
387
|
-
content: ( new MarkdownString(( localize(
|
|
400
|
+
content: ( new MarkdownString(( localize(4911, "Copilot setup failed."))))
|
|
388
401
|
});
|
|
389
402
|
}
|
|
390
403
|
}
|
|
@@ -476,7 +489,8 @@ SetupAgent = SetupAgent_1 = ( __decorate([
|
|
|
476
489
|
( __param(3, IInstantiationService)),
|
|
477
490
|
( __param(4, ILogService)),
|
|
478
491
|
( __param(5, IConfigurationService)),
|
|
479
|
-
( __param(6, ITelemetryService))
|
|
492
|
+
( __param(6, ITelemetryService)),
|
|
493
|
+
( __param(7, IWorkbenchEnvironmentService))
|
|
480
494
|
], SetupAgent));
|
|
481
495
|
class SetupTool extends Disposable {
|
|
482
496
|
static registerTool(instantiationService, toolData) {
|
|
@@ -510,6 +524,7 @@ var ChatSetupStrategy;
|
|
|
510
524
|
ChatSetupStrategy[ChatSetupStrategy["DefaultSetup"] = 1] = "DefaultSetup";
|
|
511
525
|
ChatSetupStrategy[ChatSetupStrategy["SetupWithoutEnterpriseProvider"] = 2] = "SetupWithoutEnterpriseProvider";
|
|
512
526
|
ChatSetupStrategy[ChatSetupStrategy["SetupWithEnterpriseProvider"] = 3] = "SetupWithEnterpriseProvider";
|
|
527
|
+
ChatSetupStrategy[ChatSetupStrategy["SetupWithAccountCreate"] = 4] = "SetupWithAccountCreate";
|
|
513
528
|
})(ChatSetupStrategy || (ChatSetupStrategy = {}));
|
|
514
529
|
let ChatSetup = class ChatSetup {
|
|
515
530
|
static { ChatSetup_1 = this; }
|
|
@@ -523,39 +538,45 @@ let ChatSetup = class ChatSetup {
|
|
|
523
538
|
controller,
|
|
524
539
|
instantiationService,
|
|
525
540
|
accessor.get(ITelemetryService),
|
|
526
|
-
accessor.get(IContextMenuService),
|
|
527
541
|
accessor.get(IWorkbenchLayoutService),
|
|
528
542
|
accessor.get(IKeybindingService),
|
|
529
543
|
accessor.get(IChatEntitlementService),
|
|
530
544
|
accessor.get(ILogService),
|
|
531
|
-
accessor.get(IConfigurationService)
|
|
545
|
+
accessor.get(IConfigurationService),
|
|
546
|
+
accessor.get(IViewsService),
|
|
547
|
+
accessor.get(IProductService),
|
|
548
|
+
accessor.get(IOpenerService),
|
|
549
|
+
accessor.get(IContextMenuService)
|
|
532
550
|
));
|
|
533
551
|
});
|
|
534
552
|
}
|
|
535
553
|
return instance;
|
|
536
554
|
}
|
|
537
|
-
constructor(context, controller, instantiationService, telemetryService,
|
|
555
|
+
constructor(context, controller, instantiationService, telemetryService, layoutService, keybindingService, chatEntitlementService, logService, configurationService, viewsService, productService, openerService, contextMenuService) {
|
|
538
556
|
this.context = context;
|
|
539
557
|
this.controller = controller;
|
|
540
558
|
this.instantiationService = instantiationService;
|
|
541
559
|
this.telemetryService = telemetryService;
|
|
542
|
-
this.contextMenuService = contextMenuService;
|
|
543
560
|
this.layoutService = layoutService;
|
|
544
561
|
this.keybindingService = keybindingService;
|
|
545
562
|
this.chatEntitlementService = chatEntitlementService;
|
|
546
563
|
this.logService = logService;
|
|
547
564
|
this.configurationService = configurationService;
|
|
565
|
+
this.viewsService = viewsService;
|
|
566
|
+
this.productService = productService;
|
|
567
|
+
this.openerService = openerService;
|
|
568
|
+
this.contextMenuService = contextMenuService;
|
|
548
569
|
this.pendingRun = undefined;
|
|
549
570
|
this.skipDialogOnce = false;
|
|
550
571
|
}
|
|
551
572
|
skipDialog() {
|
|
552
573
|
this.skipDialogOnce = true;
|
|
553
574
|
}
|
|
554
|
-
async run() {
|
|
575
|
+
async run(options) {
|
|
555
576
|
if (this.pendingRun) {
|
|
556
577
|
return this.pendingRun;
|
|
557
578
|
}
|
|
558
|
-
this.pendingRun = this.doRun();
|
|
579
|
+
this.pendingRun = this.doRun(options);
|
|
559
580
|
try {
|
|
560
581
|
return await this.pendingRun;
|
|
561
582
|
}
|
|
@@ -563,11 +584,12 @@ let ChatSetup = class ChatSetup {
|
|
|
563
584
|
this.pendingRun = undefined;
|
|
564
585
|
}
|
|
565
586
|
}
|
|
566
|
-
async doRun() {
|
|
587
|
+
async doRun(options) {
|
|
588
|
+
this.context.update({ later: false });
|
|
567
589
|
const dialogSkipped = this.skipDialogOnce;
|
|
568
590
|
this.skipDialogOnce = false;
|
|
569
591
|
let setupStrategy;
|
|
570
|
-
if (dialogSkipped || isProUser(this.chatEntitlementService.entitlement) || this.chatEntitlementService.entitlement === ChatEntitlement.
|
|
592
|
+
if (dialogSkipped || isProUser(this.chatEntitlementService.entitlement) || this.chatEntitlementService.entitlement === ChatEntitlement.Free) {
|
|
571
593
|
setupStrategy = ChatSetupStrategy.DefaultSetup;
|
|
572
594
|
}
|
|
573
595
|
else {
|
|
@@ -576,6 +598,9 @@ let ChatSetup = class ChatSetup {
|
|
|
576
598
|
if (setupStrategy === ChatSetupStrategy.DefaultSetup && ChatEntitlementRequests.providerId(this.configurationService) === defaultChat.enterpriseProviderId) {
|
|
577
599
|
setupStrategy = ChatSetupStrategy.SetupWithEnterpriseProvider;
|
|
578
600
|
}
|
|
601
|
+
if (setupStrategy !== ChatSetupStrategy.Canceled && !options?.disableChatViewReveal) {
|
|
602
|
+
showCopilotView(this.viewsService, this.layoutService);
|
|
603
|
+
}
|
|
579
604
|
let success = undefined;
|
|
580
605
|
try {
|
|
581
606
|
switch (setupStrategy) {
|
|
@@ -588,7 +613,11 @@ let ChatSetup = class ChatSetup {
|
|
|
588
613
|
case ChatSetupStrategy.DefaultSetup:
|
|
589
614
|
success = await this.controller.value.setup();
|
|
590
615
|
break;
|
|
616
|
+
case ChatSetupStrategy.SetupWithAccountCreate:
|
|
617
|
+
this.openerService.open(( URI.parse(defaultChat.signUpUrl)));
|
|
618
|
+
return this.doRun(options);
|
|
591
619
|
case ChatSetupStrategy.Canceled:
|
|
620
|
+
this.context.update({ later: true });
|
|
592
621
|
this.telemetryService.publicLog2('commandCenter.chatInstall', { installResult: 'failedMaybeLater', installDuration: 0, signUpErrorCode: undefined });
|
|
593
622
|
break;
|
|
594
623
|
}
|
|
@@ -600,24 +629,207 @@ let ChatSetup = class ChatSetup {
|
|
|
600
629
|
return { success, dialogSkipped };
|
|
601
630
|
}
|
|
602
631
|
async showDialog() {
|
|
632
|
+
let dialogVariant = this.configurationService.getValue('chat.setup.signInDialogVariant');
|
|
633
|
+
if (this.context.state.entitlement !== ChatEntitlement.Unknown && (dialogVariant === 'input-email' || dialogVariant === 'account-create')) {
|
|
634
|
+
dialogVariant = this.productService.quality !== 'stable' ? 'modern' : 'default';
|
|
635
|
+
}
|
|
636
|
+
if (dialogVariant === 'default') {
|
|
637
|
+
return this.showLegacyDialog();
|
|
638
|
+
}
|
|
639
|
+
const disposables = ( new DisposableStore());
|
|
640
|
+
const buttons = this.getButtons(dialogVariant);
|
|
641
|
+
let icon;
|
|
642
|
+
switch (dialogVariant) {
|
|
643
|
+
case 'brand-gh':
|
|
644
|
+
icon = Codicon.github;
|
|
645
|
+
break;
|
|
646
|
+
case 'brand-vsc':
|
|
647
|
+
icon = this.productService.quality === 'stable' ? Codicon.vscode : this.productService.quality === 'insider' ? Codicon.vscodeInsiders : Codicon.codeOss;
|
|
648
|
+
break;
|
|
649
|
+
default:
|
|
650
|
+
icon = Codicon.copilotLarge;
|
|
651
|
+
break;
|
|
652
|
+
}
|
|
653
|
+
const dialog = disposables.add(( new Dialog(
|
|
654
|
+
this.layoutService.activeContainer,
|
|
655
|
+
this.getDialogTitle(dialogVariant),
|
|
656
|
+
( buttons.map(button => button[0])),
|
|
657
|
+
createWorkbenchDialogOptions({
|
|
658
|
+
type: 'none',
|
|
659
|
+
extraClasses: coalesce([
|
|
660
|
+
'chat-setup-dialog',
|
|
661
|
+
dialogVariant === 'style-glow' ? 'chat-setup-glow' : undefined,
|
|
662
|
+
dialogVariant === 'input-email' ? 'chat-setup-input-email' : undefined
|
|
663
|
+
]),
|
|
664
|
+
detail: ' ',
|
|
665
|
+
icon,
|
|
666
|
+
alignment: DialogContentsAlignment.Vertical,
|
|
667
|
+
cancelId: buttons.length - 1,
|
|
668
|
+
inputs: this.getInputs(dialogVariant),
|
|
669
|
+
disableCloseButton: true,
|
|
670
|
+
renderFooter: this.telemetryService.telemetryLevel !== TelemetryLevel.NONE ? footer => footer.appendChild(this.createDialogFooter(disposables)) : undefined,
|
|
671
|
+
buttonOptions: ( buttons.map(button => button[2]))
|
|
672
|
+
}, this.keybindingService, this.layoutService)
|
|
673
|
+
)));
|
|
674
|
+
const { button } = await dialog.show();
|
|
675
|
+
disposables.dispose();
|
|
676
|
+
return buttons[button]?.[1] ?? ChatSetupStrategy.Canceled;
|
|
677
|
+
}
|
|
678
|
+
getInputs(variant) {
|
|
679
|
+
if (variant !== 'input-email') {
|
|
680
|
+
return undefined;
|
|
681
|
+
}
|
|
682
|
+
return [{ placeholder: ( localize(4912, "Enter your email or {0} username", defaultChat.providerName)) }];
|
|
683
|
+
}
|
|
684
|
+
getButtons(variant) {
|
|
685
|
+
let buttons;
|
|
686
|
+
if (this.context.state.entitlement === ChatEntitlement.Unknown) {
|
|
687
|
+
const supportAlternateProvider = this.configurationService.getValue('chat.setup.signInWithAlternateProvider') === true && defaultChat.alternativeProviderId;
|
|
688
|
+
switch (variant) {
|
|
689
|
+
case 'input-email':
|
|
690
|
+
buttons = coalesce([
|
|
691
|
+
[( localize(4913, "Continue")), ChatSetupStrategy.SetupWithoutEnterpriseProvider, undefined],
|
|
692
|
+
[( localize(4914, "Create a New Account")), ChatSetupStrategy.SetupWithAccountCreate, {
|
|
693
|
+
styleButton: button => {
|
|
694
|
+
button.element.classList.add('link-button');
|
|
695
|
+
const separator = button.element.parentElement?.appendChild($('.buttons-separator'));
|
|
696
|
+
separator?.appendChild($('.buttons-separator-left'));
|
|
697
|
+
separator?.appendChild($('.buttons-separator-center', undefined, ( localize(4915, "Or"))));
|
|
698
|
+
separator?.appendChild($('.buttons-separator-right'));
|
|
699
|
+
}
|
|
700
|
+
}],
|
|
701
|
+
supportAlternateProvider ? [( localize(4916, "Continue with {0}", defaultChat.alternativeProviderName)), ChatSetupStrategy.SetupWithoutEnterpriseProvider, {
|
|
702
|
+
styleButton: button => {
|
|
703
|
+
button.element.classList.add('continue-button', 'alternate');
|
|
704
|
+
}
|
|
705
|
+
}] : undefined,
|
|
706
|
+
[( localize(4916, "Continue with {0}", defaultChat.enterpriseProviderName)), ChatSetupStrategy.SetupWithEnterpriseProvider, {
|
|
707
|
+
styleButton: button => {
|
|
708
|
+
button.element.classList.add('continue-button', 'default');
|
|
709
|
+
}
|
|
710
|
+
}]
|
|
711
|
+
]);
|
|
712
|
+
break;
|
|
713
|
+
default:
|
|
714
|
+
if (ChatEntitlementRequests.providerId(this.configurationService) === defaultChat.enterpriseProviderId) {
|
|
715
|
+
buttons = coalesce([
|
|
716
|
+
[( localize(4916, "Continue with {0}", defaultChat.enterpriseProviderName)), ChatSetupStrategy.SetupWithEnterpriseProvider, {
|
|
717
|
+
styleButton: button => {
|
|
718
|
+
button.element.classList.add('continue-button', 'default');
|
|
719
|
+
}
|
|
720
|
+
}],
|
|
721
|
+
supportAlternateProvider ? [( localize(4916, "Continue with {0}", defaultChat.alternativeProviderName)), ChatSetupStrategy.SetupWithoutEnterpriseProvider, {
|
|
722
|
+
styleButton: button => {
|
|
723
|
+
button.element.classList.add('continue-button', 'alternate');
|
|
724
|
+
}
|
|
725
|
+
}] : undefined,
|
|
726
|
+
[variant !== 'account-create' ? ( localize(4917, "Sign in with a {0} account", defaultChat.providerName)) : ( localize(4918, "Continue with {0}", defaultChat.providerName)), ChatSetupStrategy.SetupWithoutEnterpriseProvider, {
|
|
727
|
+
styleButton: button => {
|
|
728
|
+
if (variant !== 'account-create') {
|
|
729
|
+
button.element.classList.add('link-button');
|
|
730
|
+
}
|
|
731
|
+
else {
|
|
732
|
+
button.element.classList.add('continue-button', 'default');
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
}]
|
|
736
|
+
]);
|
|
737
|
+
}
|
|
738
|
+
else {
|
|
739
|
+
buttons = coalesce([
|
|
740
|
+
[( localize(4916, "Continue with {0}", defaultChat.providerName)), ChatSetupStrategy.SetupWithoutEnterpriseProvider, {
|
|
741
|
+
styleButton: button => {
|
|
742
|
+
button.element.classList.add('continue-button', 'default');
|
|
743
|
+
}
|
|
744
|
+
}],
|
|
745
|
+
supportAlternateProvider ? [( localize(4916, "Continue with {0}", defaultChat.alternativeProviderName)), ChatSetupStrategy.SetupWithoutEnterpriseProvider, {
|
|
746
|
+
styleButton: button => {
|
|
747
|
+
button.element.classList.add('continue-button', 'alternate');
|
|
748
|
+
}
|
|
749
|
+
}] : undefined,
|
|
750
|
+
[variant !== 'account-create' ? ( localize(4917, "Sign in with a {0} account", defaultChat.enterpriseProviderName)) : ( localize(4918, "Continue with {0}", defaultChat.enterpriseProviderName)), ChatSetupStrategy.SetupWithEnterpriseProvider, {
|
|
751
|
+
styleButton: button => {
|
|
752
|
+
if (variant !== 'account-create') {
|
|
753
|
+
button.element.classList.add('link-button');
|
|
754
|
+
}
|
|
755
|
+
else {
|
|
756
|
+
button.element.classList.add('continue-button', 'default');
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
}]
|
|
760
|
+
]);
|
|
761
|
+
}
|
|
762
|
+
if (supportAlternateProvider && variant === 'alt-first') {
|
|
763
|
+
[buttons[0], buttons[1]] = [buttons[1], buttons[0]];
|
|
764
|
+
}
|
|
765
|
+
if (variant === 'account-create') {
|
|
766
|
+
buttons.push([( localize(4914, "Create a New Account")), ChatSetupStrategy.SetupWithAccountCreate, {
|
|
767
|
+
styleButton: button => {
|
|
768
|
+
button.element.classList.add('link-button');
|
|
769
|
+
}
|
|
770
|
+
}]);
|
|
771
|
+
}
|
|
772
|
+
break;
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
else {
|
|
776
|
+
buttons = [[( localize(4919, "Set up Copilot")), ChatSetupStrategy.DefaultSetup, undefined]];
|
|
777
|
+
}
|
|
778
|
+
buttons.push([( localize(4920, "Skip for now")), ChatSetupStrategy.Canceled, { styleButton: button => button.element.classList.add('link-button', 'skip-button') }]);
|
|
779
|
+
return buttons;
|
|
780
|
+
}
|
|
781
|
+
getDialogTitle(variant) {
|
|
782
|
+
if (this.context.state.entitlement === ChatEntitlement.Unknown) {
|
|
783
|
+
switch (variant) {
|
|
784
|
+
case 'brand-gh':
|
|
785
|
+
return localize(4921, "Sign in to use {0} Copilot", defaultChat.providerName);
|
|
786
|
+
case 'brand-vsc':
|
|
787
|
+
return localize(4922, "Sign in to use AI");
|
|
788
|
+
default:
|
|
789
|
+
return localize(4923, "Sign in to use Copilot");
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
switch (variant) {
|
|
793
|
+
case 'brand-gh':
|
|
794
|
+
return localize(4924, "Start using {0} Copilot", defaultChat.providerName);
|
|
795
|
+
case 'brand-vsc':
|
|
796
|
+
return localize(4925, "Start using AI");
|
|
797
|
+
default:
|
|
798
|
+
return localize(4926, "Start using Copilot");
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
createDialogFooter(disposables) {
|
|
802
|
+
const element = $('.chat-setup-dialog-footer');
|
|
803
|
+
const markdown = this.instantiationService.createInstance(MarkdownRenderer, {});
|
|
804
|
+
const settings = ( localize(
|
|
805
|
+
4927,
|
|
806
|
+
"{0} Copilot Free, Pro and Pro+ may show [public code]({1}) suggestions and we may use your data for product improvement. You can change these [settings]({2}) at any time.",
|
|
807
|
+
defaultChat.providerName,
|
|
808
|
+
defaultChat.publicCodeMatchesUrl,
|
|
809
|
+
defaultChat.manageSettingsUrl
|
|
810
|
+
));
|
|
811
|
+
element.appendChild($('p', undefined, disposables.add(markdown.render(( new MarkdownString(settings, { isTrusted: true })))).element));
|
|
812
|
+
return element;
|
|
813
|
+
}
|
|
814
|
+
async showLegacyDialog() {
|
|
603
815
|
const disposables = ( new DisposableStore());
|
|
604
816
|
let result = undefined;
|
|
605
|
-
const buttons = [this.
|
|
817
|
+
const buttons = [this.getLegacyPrimaryButton(), ( localize(4928, "Maybe Later"))];
|
|
606
818
|
const dialog = disposables.add(( new Dialog(
|
|
607
819
|
this.layoutService.activeContainer,
|
|
608
|
-
this.
|
|
820
|
+
this.getLegacyDialogTitle(),
|
|
609
821
|
buttons,
|
|
610
822
|
createWorkbenchDialogOptions({
|
|
611
823
|
type: 'none',
|
|
612
824
|
icon: Codicon.copilotLarge,
|
|
613
825
|
cancelId: buttons.length - 1,
|
|
614
|
-
renderBody: body => body.appendChild(this.
|
|
826
|
+
renderBody: body => body.appendChild(this.createLegacyDialog(disposables)),
|
|
615
827
|
primaryButtonDropdown: {
|
|
616
828
|
contextMenuProvider: this.contextMenuService,
|
|
617
829
|
addPrimaryActionToDropdown: false,
|
|
618
830
|
actions: [
|
|
619
|
-
toAction({ id: 'setupWithProvider', label: ( localize(
|
|
620
|
-
toAction({ id: 'setupWithEnterpriseProvider', label: ( localize(
|
|
831
|
+
toAction({ id: 'setupWithProvider', label: ( localize(4929, "Sign in with a {0} Account", defaultChat.providerName)), run: () => result = ChatSetupStrategy.SetupWithoutEnterpriseProvider }),
|
|
832
|
+
toAction({ id: 'setupWithEnterpriseProvider', label: ( localize(4930, "Sign in with a {0} Account", defaultChat.enterpriseProviderName)), run: () => result = ChatSetupStrategy.SetupWithEnterpriseProvider }),
|
|
621
833
|
]
|
|
622
834
|
}
|
|
623
835
|
}, this.keybindingService, this.layoutService)
|
|
@@ -626,39 +838,41 @@ let ChatSetup = class ChatSetup {
|
|
|
626
838
|
disposables.dispose();
|
|
627
839
|
return button === 0 ? result ?? ChatSetupStrategy.DefaultSetup : ChatSetupStrategy.Canceled;
|
|
628
840
|
}
|
|
629
|
-
|
|
841
|
+
getLegacyPrimaryButton() {
|
|
630
842
|
if (this.context.state.entitlement === ChatEntitlement.Unknown) {
|
|
631
|
-
|
|
843
|
+
if (ChatEntitlementRequests.providerId(this.configurationService) === defaultChat.enterpriseProviderId) {
|
|
844
|
+
return localize(4931, "Sign in with {0}", defaultChat.enterpriseProviderName);
|
|
845
|
+
}
|
|
846
|
+
return localize(4932, "Sign in");
|
|
632
847
|
}
|
|
633
|
-
return localize(
|
|
848
|
+
return localize(4933, "Use Copilot");
|
|
634
849
|
}
|
|
635
|
-
|
|
850
|
+
getLegacyDialogTitle() {
|
|
636
851
|
if (this.context.state.entitlement === ChatEntitlement.Unknown) {
|
|
637
|
-
return this.context.state.registered ? ( localize(
|
|
852
|
+
return this.context.state.registered ? ( localize(4934, "Sign in to use Copilot")) : ( localize(4935, "Sign in to use Copilot for free"));
|
|
638
853
|
}
|
|
639
854
|
if (isProUser(this.context.state.entitlement)) {
|
|
640
|
-
return localize(
|
|
855
|
+
return localize(4936, "Start using Copilot Pro");
|
|
641
856
|
}
|
|
642
|
-
return this.context.state.registered ? ( localize(
|
|
857
|
+
return this.context.state.registered ? ( localize(4937, "Start using Copilot")) : ( localize(4938, "Start using Copilot for free"));
|
|
643
858
|
}
|
|
644
|
-
|
|
645
|
-
const element = $('.chat-setup-dialog');
|
|
859
|
+
createLegacyDialog(disposables) {
|
|
860
|
+
const element = $('.chat-setup-dialog-legacy');
|
|
646
861
|
const markdown = this.instantiationService.createInstance(MarkdownRenderer, {});
|
|
647
862
|
const header = ( localize(
|
|
648
|
-
|
|
863
|
+
4939,
|
|
649
864
|
"[Copilot]({0}) is your AI pair programmer. Write code faster with completions, fix bugs and build new features across multiple files, and learn about your codebase through chat.",
|
|
650
865
|
defaultChat.documentationUrl
|
|
651
866
|
));
|
|
652
867
|
element.appendChild($('p.setup-header', undefined, disposables.add(markdown.render(( new MarkdownString(header, { isTrusted: true })))).element));
|
|
653
|
-
const terms = ( localize(
|
|
654
|
-
4878,
|
|
655
|
-
"By continuing, you agree to the [Terms]({0}) and [Privacy Policy]({1}).",
|
|
656
|
-
defaultChat.termsStatementUrl,
|
|
657
|
-
defaultChat.privacyStatementUrl
|
|
658
|
-
));
|
|
659
|
-
element.appendChild($('p.setup-legal', undefined, disposables.add(markdown.render(( new MarkdownString(terms, { isTrusted: true })))).element));
|
|
660
868
|
if (this.telemetryService.telemetryLevel !== TelemetryLevel.NONE) {
|
|
661
|
-
const settings =
|
|
869
|
+
const settings = ( localize(
|
|
870
|
+
4927,
|
|
871
|
+
"{0} Copilot Free, Pro and Pro+ may show [public code]({1}) suggestions and we may use your data for product improvement. You can change these [settings]({2}) at any time.",
|
|
872
|
+
defaultChat.providerName,
|
|
873
|
+
defaultChat.publicCodeMatchesUrl,
|
|
874
|
+
defaultChat.manageSettingsUrl
|
|
875
|
+
));
|
|
662
876
|
element.appendChild($('p.setup-settings', undefined, disposables.add(markdown.render(( new MarkdownString(settings, { isTrusted: true })))).element));
|
|
663
877
|
}
|
|
664
878
|
return element;
|
|
@@ -667,12 +881,15 @@ let ChatSetup = class ChatSetup {
|
|
|
667
881
|
ChatSetup = ChatSetup_1 = ( __decorate([
|
|
668
882
|
( __param(2, IInstantiationService)),
|
|
669
883
|
( __param(3, ITelemetryService)),
|
|
670
|
-
( __param(4,
|
|
671
|
-
( __param(5,
|
|
672
|
-
( __param(6,
|
|
673
|
-
( __param(7,
|
|
674
|
-
( __param(8,
|
|
675
|
-
( __param(9,
|
|
884
|
+
( __param(4, ILayoutService)),
|
|
885
|
+
( __param(5, IKeybindingService)),
|
|
886
|
+
( __param(6, IChatEntitlementService)),
|
|
887
|
+
( __param(7, ILogService)),
|
|
888
|
+
( __param(8, IConfigurationService)),
|
|
889
|
+
( __param(9, IViewsService)),
|
|
890
|
+
( __param(10, IProductService)),
|
|
891
|
+
( __param(11, IOpenerService)),
|
|
892
|
+
( __param(12, IContextMenuService))
|
|
676
893
|
], ChatSetup));
|
|
677
894
|
let ChatSetupContribution = class ChatSetupContribution extends Disposable {
|
|
678
895
|
static { this.ID = 'workbench.contrib.chatSetup'; }
|
|
@@ -693,14 +910,14 @@ let ChatSetupContribution = class ChatSetupContribution extends Disposable {
|
|
|
693
910
|
));
|
|
694
911
|
this.registerSetupAgents(context, controller);
|
|
695
912
|
this.registerActions(context, requests, controller);
|
|
913
|
+
this.registerMenus();
|
|
696
914
|
this.registerUrlLinkHandler();
|
|
697
915
|
}
|
|
698
916
|
registerSetupAgents(context, controller) {
|
|
699
917
|
const defaultAgentDisposables = markAsSingleton(( new MutableDisposable()));
|
|
700
918
|
const vscodeAgentDisposables = markAsSingleton(( new MutableDisposable()));
|
|
701
919
|
const updateRegistration = () => {
|
|
702
|
-
|
|
703
|
-
if (!disabled) {
|
|
920
|
+
if (!context.state.hidden && !context.state.disabled) {
|
|
704
921
|
if (!defaultAgentDisposables.value) {
|
|
705
922
|
const disposables = defaultAgentDisposables.value = ( new DisposableStore());
|
|
706
923
|
const panelAgentDisposables = disposables.add(( new DisposableStore()));
|
|
@@ -716,7 +933,7 @@ let ChatSetupContribution = class ChatSetupContribution extends Disposable {
|
|
|
716
933
|
disposables.add(SetupAgent.registerDefaultAgents(this.instantiationService, ChatAgentLocation.Notebook, undefined, context, controller).disposable);
|
|
717
934
|
disposables.add(SetupAgent.registerDefaultAgents(this.instantiationService, ChatAgentLocation.Editor, undefined, context, controller).disposable);
|
|
718
935
|
}
|
|
719
|
-
if (!context.state.installed && !vscodeAgentDisposables.value) {
|
|
936
|
+
if (!(context.state.installed && !context.state.disabled) && !vscodeAgentDisposables.value) {
|
|
720
937
|
const disposables = vscodeAgentDisposables.value = ( new DisposableStore());
|
|
721
938
|
disposables.add(SetupAgent.registerVSCodeAgent(this.instantiationService, context, controller).disposable);
|
|
722
939
|
}
|
|
@@ -725,7 +942,7 @@ let ChatSetupContribution = class ChatSetupContribution extends Disposable {
|
|
|
725
942
|
defaultAgentDisposables.clear();
|
|
726
943
|
vscodeAgentDisposables.clear();
|
|
727
944
|
}
|
|
728
|
-
if (context.state.installed) {
|
|
945
|
+
if (context.state.installed && !context.state.disabled) {
|
|
729
946
|
vscodeAgentDisposables.clear();
|
|
730
947
|
}
|
|
731
948
|
};
|
|
@@ -733,7 +950,7 @@ let ChatSetupContribution = class ChatSetupContribution extends Disposable {
|
|
|
733
950
|
}
|
|
734
951
|
registerActions(context, requests, controller) {
|
|
735
952
|
const chatSetupTriggerContext = ( ContextKeyExpr.or(( ChatContextKeys.Setup.installed.negate()), ChatContextKeys.Entitlement.canSignUp));
|
|
736
|
-
const CHAT_SETUP_ACTION_LABEL = ( localize2(
|
|
953
|
+
const CHAT_SETUP_ACTION_LABEL = ( localize2(4940, "Use AI Features with Copilot for free..."));
|
|
737
954
|
class ChatSetupTriggerAction extends Action2 {
|
|
738
955
|
constructor() {
|
|
739
956
|
super({
|
|
@@ -752,9 +969,8 @@ let ChatSetupContribution = class ChatSetupContribution extends Disposable {
|
|
|
752
969
|
const commandService = accessor.get(ICommandService);
|
|
753
970
|
const lifecycleService = accessor.get(ILifecycleService);
|
|
754
971
|
await context.update({ hidden: false });
|
|
755
|
-
const chatWidgetPromise = showCopilotView(viewsService, layoutService);
|
|
756
972
|
if (mode) {
|
|
757
|
-
const chatWidget = await
|
|
973
|
+
const chatWidget = await showCopilotView(viewsService, layoutService);
|
|
758
974
|
chatWidget?.input.setChatMode(mode);
|
|
759
975
|
}
|
|
760
976
|
const setup = ChatSetup.getInstance(instantiationService, context, controller);
|
|
@@ -762,13 +978,14 @@ let ChatSetupContribution = class ChatSetupContribution extends Disposable {
|
|
|
762
978
|
if (success === false && !lifecycleService.willShutdown) {
|
|
763
979
|
const { confirmed } = await dialogService.confirm({
|
|
764
980
|
type: Severity.Error,
|
|
765
|
-
message: ( localize(
|
|
766
|
-
primaryButton: ( localize(
|
|
981
|
+
message: ( localize(4941, "Copilot setup failed. Would you like to try again?")),
|
|
982
|
+
primaryButton: ( localize(4942, "Retry")),
|
|
767
983
|
});
|
|
768
984
|
if (confirmed) {
|
|
769
|
-
commandService.executeCommand(CHAT_SETUP_ACTION_ID);
|
|
985
|
+
return Boolean(await commandService.executeCommand(CHAT_SETUP_ACTION_ID));
|
|
770
986
|
}
|
|
771
987
|
}
|
|
988
|
+
return Boolean(success);
|
|
772
989
|
}
|
|
773
990
|
}
|
|
774
991
|
class ChatSetupTriggerWithoutDialogAction extends Action2 {
|
|
@@ -786,14 +1003,14 @@ let ChatSetupContribution = class ChatSetupContribution extends Disposable {
|
|
|
786
1003
|
await context.update({ hidden: false });
|
|
787
1004
|
const chatWidget = await showCopilotView(viewsService, layoutService);
|
|
788
1005
|
ChatSetup.getInstance(instantiationService, context, controller).skipDialog();
|
|
789
|
-
chatWidget?.acceptInput(( localize(
|
|
1006
|
+
chatWidget?.acceptInput(( localize(4943, "Set up Copilot.")));
|
|
790
1007
|
}
|
|
791
1008
|
}
|
|
792
1009
|
class ChatSetupFromAccountsAction extends Action2 {
|
|
793
1010
|
constructor() {
|
|
794
1011
|
super({
|
|
795
1012
|
id: 'workbench.action.chat.triggerSetupFromAccounts',
|
|
796
|
-
title: ( localize2(
|
|
1013
|
+
title: ( localize2(4944, "Sign in to use Copilot...")),
|
|
797
1014
|
menu: {
|
|
798
1015
|
id: MenuId.AccountsContext,
|
|
799
1016
|
group: '2_copilot',
|
|
@@ -810,7 +1027,7 @@ let ChatSetupContribution = class ChatSetupContribution extends Disposable {
|
|
|
810
1027
|
}
|
|
811
1028
|
class ChatSetupHideAction extends Action2 {
|
|
812
1029
|
static { this.ID = 'workbench.action.chat.hideSetup'; }
|
|
813
|
-
static { this.TITLE = ( localize2(
|
|
1030
|
+
static { this.TITLE = ( localize2(4945, "Hide Copilot")); }
|
|
814
1031
|
constructor() {
|
|
815
1032
|
super({
|
|
816
1033
|
id: ChatSetupHideAction.ID,
|
|
@@ -831,13 +1048,13 @@ let ChatSetupContribution = class ChatSetupContribution extends Disposable {
|
|
|
831
1048
|
const layoutService = accessor.get(IWorkbenchLayoutService);
|
|
832
1049
|
const dialogService = accessor.get(IDialogService);
|
|
833
1050
|
const { confirmed } = await dialogService.confirm({
|
|
834
|
-
message: ( localize(
|
|
1051
|
+
message: ( localize(4946, "Are you sure you want to hide Copilot?")),
|
|
835
1052
|
detail: ( localize(
|
|
836
|
-
|
|
1053
|
+
4947,
|
|
837
1054
|
"You can restore Copilot by running the '{0}' command.",
|
|
838
1055
|
CHAT_SETUP_ACTION_LABEL.value
|
|
839
1056
|
)),
|
|
840
|
-
primaryButton: ( localize(
|
|
1057
|
+
primaryButton: ( localize(4948, "Hide Copilot"))
|
|
841
1058
|
});
|
|
842
1059
|
if (!confirmed) {
|
|
843
1060
|
return;
|
|
@@ -857,15 +1074,15 @@ let ChatSetupContribution = class ChatSetupContribution extends Disposable {
|
|
|
857
1074
|
constructor() {
|
|
858
1075
|
super({
|
|
859
1076
|
id: 'workbench.action.chat.upgradePlan',
|
|
860
|
-
title: ( localize2(
|
|
861
|
-
category: ( localize2(
|
|
1077
|
+
title: ( localize2(4949, "Upgrade to Copilot Pro")),
|
|
1078
|
+
category: ( localize2(4950, 'Chat')),
|
|
862
1079
|
f1: true,
|
|
863
|
-
precondition: ( ContextKeyExpr.or(ChatContextKeys.Entitlement.canSignUp, ChatContextKeys.Entitlement.
|
|
1080
|
+
precondition: ( ContextKeyExpr.or(ChatContextKeys.Entitlement.canSignUp, ChatContextKeys.Entitlement.free)),
|
|
864
1081
|
menu: {
|
|
865
1082
|
id: MenuId.ChatTitleBarMenu,
|
|
866
1083
|
group: 'a_first',
|
|
867
1084
|
order: 1,
|
|
868
|
-
when: ( ContextKeyExpr.and(ChatContextKeys.Entitlement.
|
|
1085
|
+
when: ( ContextKeyExpr.and(ChatContextKeys.Entitlement.free, ( ContextKeyExpr.or(
|
|
869
1086
|
ChatContextKeys.chatQuotaExceeded,
|
|
870
1087
|
ChatContextKeys.completionsQuotaExceeded
|
|
871
1088
|
))))
|
|
@@ -896,8 +1113,8 @@ let ChatSetupContribution = class ChatSetupContribution extends Disposable {
|
|
|
896
1113
|
constructor() {
|
|
897
1114
|
super({
|
|
898
1115
|
id: 'workbench.action.chat.manageOverages',
|
|
899
|
-
title: ( localize2(
|
|
900
|
-
category: ( localize2(
|
|
1116
|
+
title: ( localize2(4951, "Manage Copilot Overages")),
|
|
1117
|
+
category: ( localize2(4950, 'Chat')),
|
|
901
1118
|
f1: true,
|
|
902
1119
|
precondition: ( ContextKeyExpr.or(ChatContextKeys.Entitlement.pro, ChatContextKeys.Entitlement.proPlus)),
|
|
903
1120
|
menu: {
|
|
@@ -923,6 +1140,28 @@ let ChatSetupContribution = class ChatSetupContribution extends Disposable {
|
|
|
923
1140
|
registerAction2(UpgradePlanAction);
|
|
924
1141
|
registerAction2(EnableOveragesAction);
|
|
925
1142
|
}
|
|
1143
|
+
registerMenus() {
|
|
1144
|
+
const menuContext = ( ContextKeyExpr.and((
|
|
1145
|
+
ChatContextKeys.Setup.installed.negate()), ( ChatContextKeys.Setup.hidden.negate()), ( ChatContextKeys.Setup.disabled.negate())));
|
|
1146
|
+
MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
|
|
1147
|
+
submenu: MenuId.ChatExplorerMenu,
|
|
1148
|
+
group: '5_copilot',
|
|
1149
|
+
title: ( localize(4952, "Copilot")),
|
|
1150
|
+
when: menuContext
|
|
1151
|
+
});
|
|
1152
|
+
MenuRegistry.appendMenuItem(MenuId.EditorContext, {
|
|
1153
|
+
submenu: MenuId.ChatTextEditorMenu,
|
|
1154
|
+
group: '1_copilot',
|
|
1155
|
+
title: ( localize(4952, "Copilot")),
|
|
1156
|
+
when: menuContext
|
|
1157
|
+
});
|
|
1158
|
+
MenuRegistry.appendMenuItem(MenuId.TerminalInstanceContext, {
|
|
1159
|
+
submenu: MenuId.ChatTerminalMenu,
|
|
1160
|
+
group: '2_copilot',
|
|
1161
|
+
title: ( localize(4952, "Copilot")),
|
|
1162
|
+
when: menuContext
|
|
1163
|
+
});
|
|
1164
|
+
}
|
|
926
1165
|
registerUrlLinkHandler() {
|
|
927
1166
|
this._register(ExtensionUrlHandlerOverrideRegistry.registerHandler({
|
|
928
1167
|
canHandleURL: url => {
|
|
@@ -987,7 +1226,7 @@ let ChatSetupController = class ChatSetupController extends Disposable {
|
|
|
987
1226
|
}
|
|
988
1227
|
async setup(options) {
|
|
989
1228
|
const watch = ( new StopWatch(false));
|
|
990
|
-
const title = ( localize(
|
|
1229
|
+
const title = ( localize(4953, "Getting Copilot ready..."));
|
|
991
1230
|
const badge = this.activityService.showViewContainerActivity(CHAT_SIDEBAR_PANEL_ID, {
|
|
992
1231
|
badge: ( new ProgressBadge(() => title)),
|
|
993
1232
|
});
|
|
@@ -1013,14 +1252,15 @@ let ChatSetupController = class ChatSetupController extends Disposable {
|
|
|
1013
1252
|
this.setStep(ChatSetupStep.SigningIn);
|
|
1014
1253
|
const result = await this.signIn(providerId);
|
|
1015
1254
|
if (!result.session) {
|
|
1255
|
+
this.doInstall();
|
|
1016
1256
|
this.telemetryService.publicLog2('commandCenter.chatInstall', { installResult: 'failedNotSignedIn', installDuration: watch.elapsed(), signUpErrorCode: undefined });
|
|
1017
|
-
return
|
|
1257
|
+
return undefined;
|
|
1018
1258
|
}
|
|
1019
1259
|
session = result.session;
|
|
1020
1260
|
entitlement = result.entitlement;
|
|
1021
1261
|
}
|
|
1022
1262
|
const trusted = await this.workspaceTrustRequestService.requestWorkspaceTrust({
|
|
1023
|
-
message: ( localize(
|
|
1263
|
+
message: ( localize(4954, "Copilot is currently only supported in trusted workspaces."))
|
|
1024
1264
|
});
|
|
1025
1265
|
if (!trusted) {
|
|
1026
1266
|
this.telemetryService.publicLog2('commandCenter.chatInstall', { installResult: 'failedNotTrusted', installDuration: watch.elapsed(), signUpErrorCode: undefined });
|
|
@@ -1048,12 +1288,12 @@ let ChatSetupController = class ChatSetupController extends Disposable {
|
|
|
1048
1288
|
const { confirmed } = await this.dialogService.confirm({
|
|
1049
1289
|
type: Severity.Error,
|
|
1050
1290
|
message: ( localize(
|
|
1051
|
-
|
|
1291
|
+
4955,
|
|
1052
1292
|
"Failed to sign in to {0}. Would you like to try again?",
|
|
1053
1293
|
ChatEntitlementRequests.providerId(this.configurationService) === defaultChat.enterpriseProviderId ? defaultChat.enterpriseProviderName : defaultChat.providerName
|
|
1054
1294
|
)),
|
|
1055
|
-
detail: ( localize(
|
|
1056
|
-
primaryButton: ( localize(
|
|
1295
|
+
detail: ( localize(4956, "You must be signed in to use Copilot.")),
|
|
1296
|
+
primaryButton: ( localize(4942, "Retry"))
|
|
1057
1297
|
});
|
|
1058
1298
|
if (confirmed) {
|
|
1059
1299
|
return this.signIn(providerId);
|
|
@@ -1062,10 +1302,10 @@ let ChatSetupController = class ChatSetupController extends Disposable {
|
|
|
1062
1302
|
return { session, entitlement: entitlements?.entitlement };
|
|
1063
1303
|
}
|
|
1064
1304
|
async install(session, entitlement, providerId, watch) {
|
|
1065
|
-
const
|
|
1305
|
+
const wasRunning = this.context.state.installed && !this.context.state.disabled;
|
|
1066
1306
|
let signUpResult = undefined;
|
|
1067
1307
|
try {
|
|
1068
|
-
if (entitlement !== ChatEntitlement.
|
|
1308
|
+
if (entitlement !== ChatEntitlement.Free &&
|
|
1069
1309
|
!isProUser(entitlement) &&
|
|
1070
1310
|
entitlement !== ChatEntitlement.Unavailable
|
|
1071
1311
|
) {
|
|
@@ -1080,12 +1320,12 @@ let ChatSetupController = class ChatSetupController extends Disposable {
|
|
|
1080
1320
|
return false;
|
|
1081
1321
|
}
|
|
1082
1322
|
}
|
|
1083
|
-
signUpResult = await this.requests.
|
|
1323
|
+
signUpResult = await this.requests.signUpFree(session);
|
|
1084
1324
|
if (typeof signUpResult !== 'boolean' ) {
|
|
1085
1325
|
this.telemetryService.publicLog2('commandCenter.chatInstall', { installResult: 'failedSignUp', installDuration: watch.elapsed(), signUpErrorCode: signUpResult.errorCode });
|
|
1086
1326
|
}
|
|
1087
1327
|
}
|
|
1088
|
-
await this.
|
|
1328
|
+
await this.doInstallWithRetry();
|
|
1089
1329
|
}
|
|
1090
1330
|
catch (error) {
|
|
1091
1331
|
this.logService.error(`[chat setup] install: error ${error}`);
|
|
@@ -1093,23 +1333,17 @@ let ChatSetupController = class ChatSetupController extends Disposable {
|
|
|
1093
1333
|
return false;
|
|
1094
1334
|
}
|
|
1095
1335
|
if (typeof signUpResult === 'boolean') {
|
|
1096
|
-
this.telemetryService.publicLog2('commandCenter.chatInstall', { installResult:
|
|
1336
|
+
this.telemetryService.publicLog2('commandCenter.chatInstall', { installResult: wasRunning && !signUpResult ? 'alreadyInstalled' : 'installed', installDuration: watch.elapsed(), signUpErrorCode: undefined });
|
|
1097
1337
|
}
|
|
1098
|
-
if (
|
|
1338
|
+
if (wasRunning && signUpResult === true) {
|
|
1099
1339
|
refreshTokens(this.commandService);
|
|
1100
1340
|
}
|
|
1101
1341
|
return true;
|
|
1102
1342
|
}
|
|
1103
|
-
async
|
|
1343
|
+
async doInstallWithRetry() {
|
|
1104
1344
|
let error;
|
|
1105
1345
|
try {
|
|
1106
|
-
await this.
|
|
1107
|
-
enable: true,
|
|
1108
|
-
isApplicationScoped: true,
|
|
1109
|
-
isMachineScoped: false,
|
|
1110
|
-
installEverywhere: true,
|
|
1111
|
-
installPreReleaseVersion: this.productService.quality !== 'stable'
|
|
1112
|
-
}, ChatViewId);
|
|
1346
|
+
await this.doInstall();
|
|
1113
1347
|
}
|
|
1114
1348
|
catch (e) {
|
|
1115
1349
|
this.logService.error(`[chat setup] install: error ${error}`);
|
|
@@ -1120,19 +1354,28 @@ let ChatSetupController = class ChatSetupController extends Disposable {
|
|
|
1120
1354
|
const { confirmed } = await this.dialogService.confirm({
|
|
1121
1355
|
type: Severity.Error,
|
|
1122
1356
|
message: ( localize(
|
|
1123
|
-
|
|
1357
|
+
4957,
|
|
1124
1358
|
"An error occurred while setting up Copilot. Would you like to try again?"
|
|
1125
1359
|
)),
|
|
1126
1360
|
detail: error && !isCancellationError(error) ? toErrorMessage(error) : undefined,
|
|
1127
|
-
primaryButton: ( localize(
|
|
1361
|
+
primaryButton: ( localize(4942, "Retry"))
|
|
1128
1362
|
});
|
|
1129
1363
|
if (confirmed) {
|
|
1130
|
-
return this.
|
|
1364
|
+
return this.doInstallWithRetry();
|
|
1131
1365
|
}
|
|
1132
1366
|
}
|
|
1133
1367
|
throw error;
|
|
1134
1368
|
}
|
|
1135
1369
|
}
|
|
1370
|
+
async doInstall() {
|
|
1371
|
+
await this.extensionsWorkbenchService.install(defaultChat.extensionId, {
|
|
1372
|
+
enable: true,
|
|
1373
|
+
isApplicationScoped: true,
|
|
1374
|
+
isMachineScoped: false,
|
|
1375
|
+
installEverywhere: true,
|
|
1376
|
+
installPreReleaseVersion: this.productService.quality !== 'stable'
|
|
1377
|
+
}, ChatViewId);
|
|
1378
|
+
}
|
|
1136
1379
|
async setupWithProvider(options) {
|
|
1137
1380
|
const registry = ( Registry.as(Extensions.Configuration));
|
|
1138
1381
|
registry.registerConfiguration({
|
|
@@ -1155,7 +1398,7 @@ let ChatSetupController = class ChatSetupController extends Disposable {
|
|
|
1155
1398
|
if (options.useEnterpriseProvider) {
|
|
1156
1399
|
const success = await this.handleEnterpriseInstance();
|
|
1157
1400
|
if (!success) {
|
|
1158
|
-
return
|
|
1401
|
+
return success;
|
|
1159
1402
|
}
|
|
1160
1403
|
}
|
|
1161
1404
|
let existingAdvancedSetting = this.configurationService.inspect(defaultChat.completionsAdvancedSetting).user?.value;
|
|
@@ -1173,7 +1416,6 @@ let ChatSetupController = class ChatSetupController extends Disposable {
|
|
|
1173
1416
|
...existingAdvancedSetting,
|
|
1174
1417
|
'authProvider': undefined
|
|
1175
1418
|
} : undefined, ConfigurationTarget.USER);
|
|
1176
|
-
await this.configurationService.updateValue(defaultChat.providerUriSetting, undefined, ConfigurationTarget.USER);
|
|
1177
1419
|
}
|
|
1178
1420
|
return this.setup({ ...options, forceSignIn: true });
|
|
1179
1421
|
}
|
|
@@ -1186,8 +1428,8 @@ let ChatSetupController = class ChatSetupController extends Disposable {
|
|
|
1186
1428
|
}
|
|
1187
1429
|
let isSingleWord = false;
|
|
1188
1430
|
const result = await this.quickInputService.input({
|
|
1189
|
-
prompt: ( localize(
|
|
1190
|
-
placeHolder: ( localize(
|
|
1431
|
+
prompt: ( localize(4958, "What is your {0} instance?", defaultChat.enterpriseProviderName)),
|
|
1432
|
+
placeHolder: ( localize(4959, 'i.e. "octocat" or "https://octocat.ghe.com"...')),
|
|
1191
1433
|
ignoreFocusLost: true,
|
|
1192
1434
|
value: uri,
|
|
1193
1435
|
validateInput: async (value) => {
|
|
@@ -1198,14 +1440,14 @@ let ChatSetupController = class ChatSetupController extends Disposable {
|
|
|
1198
1440
|
if (domainRegEx.test(value)) {
|
|
1199
1441
|
isSingleWord = true;
|
|
1200
1442
|
return {
|
|
1201
|
-
content: ( localize(
|
|
1443
|
+
content: ( localize(4960, "Will resolve to {0}", `https://${value}.ghe.com`)),
|
|
1202
1444
|
severity: Severity.Info
|
|
1203
1445
|
};
|
|
1204
1446
|
}
|
|
1205
1447
|
if (!fullUriRegEx.test(value)) {
|
|
1206
1448
|
return {
|
|
1207
1449
|
content: ( localize(
|
|
1208
|
-
|
|
1450
|
+
4961,
|
|
1209
1451
|
'You must enter a valid {0} instance (i.e. "octocat" or "https://octocat.ghe.com")',
|
|
1210
1452
|
defaultChat.enterpriseProviderName
|
|
1211
1453
|
)),
|
|
@@ -1216,19 +1458,7 @@ let ChatSetupController = class ChatSetupController extends Disposable {
|
|
|
1216
1458
|
}
|
|
1217
1459
|
});
|
|
1218
1460
|
if (!result) {
|
|
1219
|
-
|
|
1220
|
-
type: Severity.Error,
|
|
1221
|
-
message: ( localize(
|
|
1222
|
-
4900,
|
|
1223
|
-
"The provided {0} instance is invalid. Would you like to enter it again?",
|
|
1224
|
-
defaultChat.enterpriseProviderName
|
|
1225
|
-
)),
|
|
1226
|
-
primaryButton: ( localize(4881, "Retry"))
|
|
1227
|
-
});
|
|
1228
|
-
if (confirmed) {
|
|
1229
|
-
return this.handleEnterpriseInstance();
|
|
1230
|
-
}
|
|
1231
|
-
return false;
|
|
1461
|
+
return undefined;
|
|
1232
1462
|
}
|
|
1233
1463
|
let resolvedUri = result;
|
|
1234
1464
|
if (isSingleWord) {
|