@codingame/monaco-vscode-extensions-service-override 37.1.0 → 37.3.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 +2 -17
- package/package.json +3 -3
- package/service-override/tools/missingMainThreadCustomers.d.ts +1 -0
- package/service-override/tools/missingMainThreadCustomers.js +274 -0
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagementCLI.js +37 -37
- package/vscode/src/vs/workbench/api/browser/mainThreadAgentEditorComments.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadAgentEditorComments.js +3 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadAiEmbeddingVector.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadAiEmbeddingVector.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadAiRelatedInformation.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadAiRelatedInformation.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadAiSettingsSearch.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadAiSettingsSearch.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadAuthentication.js +32 -32
- package/vscode/src/vs/workbench/api/browser/mainThreadBrowserTunnelProxy.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadBrowserTunnelProxy.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadBrowsers.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadBrowsers.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadBulkEdits.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadBulkEdits.js +7 -7
- package/vscode/src/vs/workbench/api/browser/mainThreadCLICommands.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadChatOutputRenderer.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadClipboard.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadClipboard.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadCodeInsets.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadCodeInsets.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadCommands.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadCommands.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadComments.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadComments.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadConfiguration.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadConfiguration.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadConsole.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadConsole.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadDataChannels.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadDataChannels.js +9 -9
- package/vscode/src/vs/workbench/api/browser/mainThreadDebugService.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadDebugService.js +7 -7
- package/vscode/src/vs/workbench/api/browser/mainThreadDecorations.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadDecorations.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadDiagnostics.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadDiagnostics.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadDialogs.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadDialogs.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadDocumentContentProviders.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadDocumentContentProviders.js +4 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadDocumentDiff.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadDocumentDiff.js +5 -5
- package/vscode/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadDocumentsAndEditors.js +9 -9
- package/vscode/src/vs/workbench/api/browser/mainThreadDownloadService.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadDownloadService.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadEditSessionIdentityParticipant.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadEditSessionIdentityParticipant.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadEditor.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadEditor.js +5 -5
- package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadEditorTabs.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadEditors.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadEditors.js +10 -10
- package/vscode/src/vs/workbench/api/browser/mainThreadEmbeddings.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadEmbeddings.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadErrors.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadExtensionService.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadExtensionService.js +13 -13
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystem.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystem.js +3 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystemEventService.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadFileSystemEventService.js +21 -21
- package/vscode/src/vs/workbench/api/browser/mainThreadGitExtensionService.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadGitExtensionService.js +5 -5
- package/vscode/src/vs/workbench/api/browser/mainThreadInteractive.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadInteractive.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadLabelService.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadLabelService.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageFeatures.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageFeatures.js +16 -16
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguages.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguages.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadLocalization.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadLocalization.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadLogService.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadLogService.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadManagedSockets.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadManagedSockets.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadMessageService.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadMessageService.js +7 -7
- package/vscode/src/vs/workbench/api/browser/mainThreadMeteredConnection.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadMeteredConnection.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadOutputService.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadOutputService.js +4 -4
- package/vscode/src/vs/workbench/api/browser/mainThreadPower.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadPower.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadProfileContentHandlers.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadProfileContentHandlers.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadProgress.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadProgress.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadQuickDiff.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadQuickDiff.js +3 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadQuickOpen.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadQuickOpen.js +4 -4
- package/vscode/src/vs/workbench/api/browser/mainThreadRemoteConnectionData.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadRemoteConnectionData.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadSCM.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadSCM.js +8 -8
- package/vscode/src/vs/workbench/api/browser/mainThreadSaveParticipant.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadSaveParticipant.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadSearch.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadSearch.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadSecretState.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadSecretState.js +3 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadShare.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadShare.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadSpeech.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadSpeech.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadStatusBar.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadStatusBar.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadStorage.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadStorage.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTask.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTask.js +3 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadTelemetry.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTelemetry.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTerminalService.d.ts +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadTerminalService.js +6 -6
- package/vscode/src/vs/workbench/api/browser/mainThreadTerminalShellIntegration.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTerminalShellIntegration.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadTesting.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTesting.js +13 -7
- package/vscode/src/vs/workbench/api/browser/mainThreadTheming.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTheming.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTimeline.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTimeline.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTreeViews.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTreeViews.js +14 -9
- package/vscode/src/vs/workbench/api/browser/mainThreadTunnelService.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTunnelService.js +7 -7
- package/vscode/src/vs/workbench/api/browser/mainThreadUriOpeners.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadUriOpeners.js +3 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadUrls.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadUrls.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewManager.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewManager.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewPanels.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviewViews.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviews.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviews.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadWindow.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadWindow.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.js +15 -13
- package/vscode/src/vs/workbench/contrib/customEditor/common/customTextEditorModel.js +1 -1
- package/vscode/src/vs/workbench/services/extensionManagement/browser/extensionBisect.js +25 -25
- package/vscode/src/vs/workbench/services/extensionManagement/browser/webExtensionsScannerService.js +37 -32
- package/vscode/src/vs/workbench/services/extensions/browser/extensionService.js +18 -10
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +55 -45
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +5 -5
- package/vscode/src/vs/workbench/services/extensions/common/extensionRunningLocationTracker.js +3 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensionsProposedApi.js +4 -2
- package/vscode/src/vs/workbench/services/extensions/common/extensionsUtil.js +4 -4
- package/vscode/src/vs/workbench/services/extensions/common/lazyCreateExtensionHostManager.js +4 -2
- package/vscode/src/vs/workbench/services/themes/browser/cssExtensionPoint.js +5 -5
- package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.d.ts +0 -104
- package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.js +0 -827
- package/vscode/src/vs/workbench/api/browser/mainThreadChatCodeMapper.d.ts +0 -15
- package/vscode/src/vs/workbench/api/browser/mainThreadChatCodeMapper.js +0 -71
- package/vscode/src/vs/workbench/api/browser/mainThreadChatContext.d.ts +0 -16
- package/vscode/src/vs/workbench/api/browser/mainThreadChatContext.js +0 -95
- package/vscode/src/vs/workbench/api/browser/mainThreadChatDebug.d.ts +0 -22
- package/vscode/src/vs/workbench/api/browser/mainThreadChatDebug.js +0 -286
- package/vscode/src/vs/workbench/api/browser/mainThreadChatInputNotification.d.ts +0 -10
- package/vscode/src/vs/workbench/api/browser/mainThreadChatInputNotification.js +0 -38
- package/vscode/src/vs/workbench/api/browser/mainThreadChatQuota.d.ts +0 -9
- package/vscode/src/vs/workbench/api/browser/mainThreadChatQuota.js +0 -22
- package/vscode/src/vs/workbench/api/browser/mainThreadChatSessions.d.ts +0 -130
- package/vscode/src/vs/workbench/api/browser/mainThreadChatSessions.js +0 -907
- package/vscode/src/vs/workbench/api/browser/mainThreadChatStatus.d.ts +0 -10
- package/vscode/src/vs/workbench/api/browser/mainThreadChatStatus.js +0 -28
- package/vscode/src/vs/workbench/api/browser/mainThreadDocuments.d.ts +0 -63
- package/vscode/src/vs/workbench/api/browser/mainThreadDocuments.js +0 -305
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModelTools.d.ts +0 -27
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModelTools.js +0 -167
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModels.d.ts +0 -46
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModels.js +0 -356
- package/vscode/src/vs/workbench/api/browser/mainThreadMcp.d.ts +0 -108
- package/vscode/src/vs/workbench/api/browser/mainThreadMcp.js +0 -698
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebook.d.ts +0 -22
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebook.js +0 -210
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocuments.d.ts +0 -24
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocuments.js +0 -138
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocumentsAndEditors.d.ts +0 -29
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocumentsAndEditors.js +0 -194
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDto.d.ts +0 -17
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDto.js +0 -128
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookEditors.d.ts +0 -27
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookEditors.js +0 -149
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookKernels.d.ts +0 -49
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookKernels.js +0 -372
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookRenderers.d.ts +0 -10
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookRenderers.js +0 -26
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookSaveParticipant.d.ts +0 -9
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookSaveParticipant.js +0 -43
- package/vscode/src/vs/workbench/services/extensions/common/extHostCustomers.d.ts +0 -32
- package/vscode/src/vs/workbench/services/extensions/common/extHostCustomers.js +0 -45
|
@@ -1,827 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
-
import { DeferredPromise } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
4
|
-
import { CancellationToken } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
5
|
-
import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
6
|
-
import { Disposable, DisposableMap } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
7
|
-
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
8
|
-
import { revive } from '@codingame/monaco-vscode-api/vscode/vs/base/common/marshalling';
|
|
9
|
-
import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
|
|
10
|
-
import { escapeRegExpCharacters } from '@codingame/monaco-vscode-api/vscode/vs/base/common/strings';
|
|
11
|
-
import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
|
|
12
|
-
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
13
|
-
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
14
|
-
import { Range } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/core/range';
|
|
15
|
-
import { getWordAtText } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/core/wordHelper';
|
|
16
|
-
import { CompletionItemKind } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/languages';
|
|
17
|
-
import { ILanguageFeaturesService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/languageFeatures.service';
|
|
18
|
-
import { ExtensionIdentifier } from '@codingame/monaco-vscode-api/vscode/vs/platform/extensions/common/extensions';
|
|
19
|
-
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
20
|
-
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
21
|
-
import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
22
|
-
import { IUriIdentityService } from '@codingame/monaco-vscode-api/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
|
|
23
|
-
import { IChatWidgetService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service';
|
|
24
|
-
import { IChatAgentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/participants/chatAgents.service';
|
|
25
|
-
import { PromptsStorage } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService';
|
|
26
|
-
import { IPromptsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.service';
|
|
27
|
-
import { PromptsType, isValidPromptType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/promptTypes';
|
|
28
|
-
import { ChatRequestAgentPart } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/requestParser/chatParserTypes';
|
|
29
|
-
import { ChatRequestParser } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/requestParser/chatRequestParser';
|
|
30
|
-
import { getDynamicVariablesForWidget, getSelectedToolAndToolSetsForWidget } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/attachments/chatVariables';
|
|
31
|
-
import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService.service';
|
|
32
|
-
import { ChatSessionOptionsMap } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService';
|
|
33
|
-
import { IChatSessionsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService.service';
|
|
34
|
-
import { ChatModeKind, ChatAgentLocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
|
|
35
|
-
import { ILanguageModelToolsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService.service';
|
|
36
|
-
import { extHostNamedCustomer } from '../../services/extensions/common/extHostCustomers.js';
|
|
37
|
-
import { IExtensionService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service';
|
|
38
|
-
import { ExtHostContext, MainContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/api/common/extHost.protocol';
|
|
39
|
-
import { NotebookDto } from './mainThreadNotebookDto.js';
|
|
40
|
-
import { isUntitledChatSession, getChatSessionType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatUri';
|
|
41
|
-
import { ICustomizationHarnessService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/customizationHarnessService.service';
|
|
42
|
-
import { AICustomizationManagementSection } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/aiCustomizationWorkspaceService';
|
|
43
|
-
import { IAgentPluginService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/plugins/agentPluginService.service';
|
|
44
|
-
import { IWorkbenchEnvironmentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/environment/common/environmentService.service';
|
|
45
|
-
import { getAgentSessionProvider, AgentSessionProviders } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessions';
|
|
46
|
-
import { addDynamicVariableActionId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/widget/input/editor/chatDynamicVariablesConstant';
|
|
47
|
-
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
48
|
-
|
|
49
|
-
class MainThreadChatTask {
|
|
50
|
-
get onDidAddProgress() {
|
|
51
|
-
return this._onDidAddProgress.event;
|
|
52
|
-
}
|
|
53
|
-
constructor(content) {
|
|
54
|
-
this.content = content;
|
|
55
|
-
this.kind = "progressTask";
|
|
56
|
-
this.deferred = ( new DeferredPromise());
|
|
57
|
-
this._onDidAddProgress = ( new Emitter());
|
|
58
|
-
this.progress = [];
|
|
59
|
-
}
|
|
60
|
-
task() {
|
|
61
|
-
return this.deferred.p;
|
|
62
|
-
}
|
|
63
|
-
isSettled() {
|
|
64
|
-
return this.deferred.isSettled;
|
|
65
|
-
}
|
|
66
|
-
complete(v) {
|
|
67
|
-
this.deferred.complete(v);
|
|
68
|
-
}
|
|
69
|
-
add(progress) {
|
|
70
|
-
this.progress.push(progress);
|
|
71
|
-
this._onDidAddProgress.fire(progress);
|
|
72
|
-
}
|
|
73
|
-
toJSON() {
|
|
74
|
-
return {
|
|
75
|
-
kind: "progressTaskSerialized",
|
|
76
|
-
content: this.content,
|
|
77
|
-
progress: this.progress
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
let MainThreadChatAgents2 = class MainThreadChatAgents2 extends Disposable {
|
|
82
|
-
constructor(
|
|
83
|
-
extHostContext,
|
|
84
|
-
_chatAgentService,
|
|
85
|
-
_chatSessionService,
|
|
86
|
-
_chatService,
|
|
87
|
-
_languageFeaturesService,
|
|
88
|
-
_chatWidgetService,
|
|
89
|
-
_instantiationService,
|
|
90
|
-
_logService,
|
|
91
|
-
_extensionService,
|
|
92
|
-
_uriIdentityService,
|
|
93
|
-
_promptsService,
|
|
94
|
-
_languageModelToolsService,
|
|
95
|
-
_customizationHarnessService,
|
|
96
|
-
_telemetryService,
|
|
97
|
-
_agentPluginService,
|
|
98
|
-
_environmentService
|
|
99
|
-
) {
|
|
100
|
-
super();
|
|
101
|
-
this._chatAgentService = _chatAgentService;
|
|
102
|
-
this._chatSessionService = _chatSessionService;
|
|
103
|
-
this._chatService = _chatService;
|
|
104
|
-
this._languageFeaturesService = _languageFeaturesService;
|
|
105
|
-
this._chatWidgetService = _chatWidgetService;
|
|
106
|
-
this._instantiationService = _instantiationService;
|
|
107
|
-
this._logService = _logService;
|
|
108
|
-
this._extensionService = _extensionService;
|
|
109
|
-
this._uriIdentityService = _uriIdentityService;
|
|
110
|
-
this._promptsService = _promptsService;
|
|
111
|
-
this._languageModelToolsService = _languageModelToolsService;
|
|
112
|
-
this._customizationHarnessService = _customizationHarnessService;
|
|
113
|
-
this._telemetryService = _telemetryService;
|
|
114
|
-
this._agentPluginService = _agentPluginService;
|
|
115
|
-
this._environmentService = _environmentService;
|
|
116
|
-
this._agents = this._register(( new DisposableMap()));
|
|
117
|
-
this._agentCompletionProviders = this._register(( new DisposableMap()));
|
|
118
|
-
this._agentIdsToCompletionProviders = this._register(( new DisposableMap()));
|
|
119
|
-
this._chatParticipantDetectionProviders = this._register(( new DisposableMap()));
|
|
120
|
-
this._promptFileProviders = this._register(( new DisposableMap()));
|
|
121
|
-
this._promptFileProviderEmitters = this._register(( new DisposableMap()));
|
|
122
|
-
this._promptFileContentRegistrations = this._register(( new DisposableMap()));
|
|
123
|
-
this._customizationProviders = this._register(( new DisposableMap()));
|
|
124
|
-
this._customizationProviderEmitters = this._register(( new DisposableMap()));
|
|
125
|
-
this._pendingProgress = ( new Map());
|
|
126
|
-
this._activeTasks = ( new Map());
|
|
127
|
-
this._unresolvedAnchors = ( new Map());
|
|
128
|
-
this._proxy = ( extHostContext.getProxy(ExtHostContext.ExtHostChatAgents2));
|
|
129
|
-
this._register(this._chatService.onDidDisposeSession(e => {
|
|
130
|
-
for (const resource of e.sessionResources) {
|
|
131
|
-
this._proxy.$releaseSession(resource);
|
|
132
|
-
}
|
|
133
|
-
}));
|
|
134
|
-
this._register(this._chatService.onDidPerformUserAction(e => {
|
|
135
|
-
if (typeof e.agentId === "string") {
|
|
136
|
-
for (const [handle, agent] of this._agents) {
|
|
137
|
-
if (agent.id === e.agentId) {
|
|
138
|
-
if (e.action.kind === "vote") {
|
|
139
|
-
this._proxy.$acceptFeedback(handle, e.result ?? {}, e.action);
|
|
140
|
-
} else {
|
|
141
|
-
this._proxy.$acceptAction(handle, e.result || {}, e);
|
|
142
|
-
}
|
|
143
|
-
break;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}));
|
|
148
|
-
this._register(this._chatService.onDidReceiveQuestionCarouselAnswer(e => {
|
|
149
|
-
this._proxy.$handleQuestionCarouselAnswer(e.requestId, e.resolveId, e.answers);
|
|
150
|
-
}));
|
|
151
|
-
this._register(this._chatWidgetService.onDidChangeFocusedSession(() => {
|
|
152
|
-
this._acceptActiveChatSession(this._chatWidgetService.lastFocusedWidget);
|
|
153
|
-
}));
|
|
154
|
-
this._acceptActiveChatSession(this._chatWidgetService.lastFocusedWidget);
|
|
155
|
-
this._register(this._promptsService.onDidChangeCustomAgents(() => {
|
|
156
|
-
this._proxy.$onDidChangeCustomAgents();
|
|
157
|
-
}));
|
|
158
|
-
this._register(this._promptsService.onDidChangeInstructions(() => {
|
|
159
|
-
this._proxy.$onDidChangeInstructions();
|
|
160
|
-
}));
|
|
161
|
-
this._register(this._promptsService.onDidChangeSkills(() => {
|
|
162
|
-
this._proxy.$onDidChangeSkills();
|
|
163
|
-
}));
|
|
164
|
-
this._register(this._promptsService.onDidChangeSlashCommands(() => {
|
|
165
|
-
this._proxy.$onDidChangeSlashCommands();
|
|
166
|
-
}));
|
|
167
|
-
this._register(this._promptsService.onDidChangeHooks(() => {
|
|
168
|
-
this._proxy.$onDidChangeHooks();
|
|
169
|
-
}));
|
|
170
|
-
this._register(autorun(reader => {
|
|
171
|
-
this._agentPluginService.plugins.read(reader);
|
|
172
|
-
this._proxy.$onDidChangePlugins();
|
|
173
|
-
}));
|
|
174
|
-
}
|
|
175
|
-
_acceptActiveChatSession(widget) {
|
|
176
|
-
const sessionResource = widget?.viewModel?.sessionResource;
|
|
177
|
-
const isLocal = sessionResource && getAgentSessionProvider(sessionResource) === AgentSessionProviders.Local;
|
|
178
|
-
this._proxy.$acceptActiveChatSession(isLocal ? sessionResource : undefined);
|
|
179
|
-
}
|
|
180
|
-
_toChatResourceSource(storage) {
|
|
181
|
-
switch (storage) {
|
|
182
|
-
case PromptsStorage.local:
|
|
183
|
-
return "local";
|
|
184
|
-
case PromptsStorage.user:
|
|
185
|
-
return "user";
|
|
186
|
-
case PromptsStorage.extension:
|
|
187
|
-
return "extension";
|
|
188
|
-
case PromptsStorage.plugin:
|
|
189
|
-
return "plugin";
|
|
190
|
-
case PromptsStorage.builtIn:
|
|
191
|
-
return "builtin";
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
_toCustomAgentDto(agent) {
|
|
195
|
-
return {
|
|
196
|
-
uri: agent.uri,
|
|
197
|
-
name: agent.name,
|
|
198
|
-
description: agent.description,
|
|
199
|
-
source: this._toChatResourceSource(agent.source.storage),
|
|
200
|
-
extensionId: agent.source.storage === PromptsStorage.extension ? agent.source.extensionId.value : undefined,
|
|
201
|
-
pluginUri: agent.source.storage === PromptsStorage.plugin ? agent.source.pluginUri : undefined,
|
|
202
|
-
sessionTypes: agent.sessionTypes,
|
|
203
|
-
argumentHint: agent.argumentHint,
|
|
204
|
-
tools: agent.tools,
|
|
205
|
-
model: agent.model,
|
|
206
|
-
userInvocable: agent.visibility.userInvocable,
|
|
207
|
-
disableModelInvocation: !agent.visibility.agentInvocable,
|
|
208
|
-
enabled: agent.enabled
|
|
209
|
-
};
|
|
210
|
-
}
|
|
211
|
-
_toInstructionDto(instruction) {
|
|
212
|
-
return {
|
|
213
|
-
uri: instruction.uri,
|
|
214
|
-
name: instruction.name,
|
|
215
|
-
description: instruction.description,
|
|
216
|
-
source: this._toChatResourceSource(instruction.storage),
|
|
217
|
-
extensionId: instruction.extension?.identifier.value,
|
|
218
|
-
pluginUri: instruction.pluginUri,
|
|
219
|
-
sessionTypes: instruction.sessionTypes,
|
|
220
|
-
pattern: instruction.pattern
|
|
221
|
-
};
|
|
222
|
-
}
|
|
223
|
-
_toSkillDto(skill) {
|
|
224
|
-
return {
|
|
225
|
-
uri: skill.uri,
|
|
226
|
-
name: skill.name,
|
|
227
|
-
description: skill.description,
|
|
228
|
-
source: this._toChatResourceSource(skill.storage),
|
|
229
|
-
extensionId: skill.extension?.identifier.value,
|
|
230
|
-
pluginUri: skill.pluginUri,
|
|
231
|
-
sessionTypes: skill.sessionTypes,
|
|
232
|
-
userInvocable: skill.userInvocable,
|
|
233
|
-
disableModelInvocation: skill.disableModelInvocation
|
|
234
|
-
};
|
|
235
|
-
}
|
|
236
|
-
_toSlashCommandDto(slashCommand) {
|
|
237
|
-
return {
|
|
238
|
-
uri: slashCommand.uri,
|
|
239
|
-
name: slashCommand.name,
|
|
240
|
-
description: slashCommand.description,
|
|
241
|
-
source: this._toChatResourceSource(slashCommand.storage),
|
|
242
|
-
extensionId: slashCommand.extension?.identifier.value,
|
|
243
|
-
pluginUri: slashCommand.pluginUri,
|
|
244
|
-
sessionTypes: slashCommand.sessionTypes,
|
|
245
|
-
argumentHint: slashCommand.argumentHint,
|
|
246
|
-
userInvocable: slashCommand.userInvocable
|
|
247
|
-
};
|
|
248
|
-
}
|
|
249
|
-
_toHookDto(hookFile) {
|
|
250
|
-
return {
|
|
251
|
-
uri: hookFile.uri,
|
|
252
|
-
sessionTypes: hookFile.sessionTypes,
|
|
253
|
-
source: this._toChatResourceSource(hookFile.storage),
|
|
254
|
-
extensionId: hookFile.extension?.identifier.value,
|
|
255
|
-
pluginUri: hookFile.pluginUri
|
|
256
|
-
};
|
|
257
|
-
}
|
|
258
|
-
_toPluginDto(plugin) {
|
|
259
|
-
return {
|
|
260
|
-
uri: plugin.uri
|
|
261
|
-
};
|
|
262
|
-
}
|
|
263
|
-
async $provideCustomAgents(token) {
|
|
264
|
-
const customAgents = await this._promptsService.getCustomAgents(token);
|
|
265
|
-
return ( customAgents.map(agent => this._toCustomAgentDto(agent)));
|
|
266
|
-
}
|
|
267
|
-
async $provideInstructions(token) {
|
|
268
|
-
const instructions = await this._promptsService.getInstructionFiles(token);
|
|
269
|
-
return ( instructions.map(instruction => this._toInstructionDto(instruction)));
|
|
270
|
-
}
|
|
271
|
-
async $provideSkills(token) {
|
|
272
|
-
const skills = (await this._promptsService.findAgentSkills(token)) ?? [];
|
|
273
|
-
return ( skills.map(skill => this._toSkillDto(skill)));
|
|
274
|
-
}
|
|
275
|
-
async $provideSlashCommands(token) {
|
|
276
|
-
const slashCommands = await this._promptsService.getPromptSlashCommands(token);
|
|
277
|
-
return ( slashCommands.map(slashCommand => this._toSlashCommandDto(slashCommand)));
|
|
278
|
-
}
|
|
279
|
-
async $provideHooks(token) {
|
|
280
|
-
const hookFiles = await this._promptsService.listPromptFiles(PromptsType.hook, token);
|
|
281
|
-
return ( hookFiles.map(hookFile => this._toHookDto(hookFile)));
|
|
282
|
-
}
|
|
283
|
-
async $providePlugins(_token) {
|
|
284
|
-
const plugins = this._agentPluginService.plugins.get();
|
|
285
|
-
return ( plugins.map(plugin => this._toPluginDto(plugin)));
|
|
286
|
-
}
|
|
287
|
-
$unregisterAgent(handle) {
|
|
288
|
-
this._agents.deleteAndDispose(handle);
|
|
289
|
-
}
|
|
290
|
-
async $transferActiveChatSession(toWorkspace) {
|
|
291
|
-
const widget = this._chatWidgetService.lastFocusedWidget;
|
|
292
|
-
const model = widget?.viewModel?.model;
|
|
293
|
-
if (!model) {
|
|
294
|
-
this._logService.error(`MainThreadChat#$transferActiveChatSession: No active chat session found`);
|
|
295
|
-
return;
|
|
296
|
-
}
|
|
297
|
-
await this._chatService.transferChatSession(model.sessionResource, URI.revive(toWorkspace));
|
|
298
|
-
}
|
|
299
|
-
async $registerAgent(handle, extension, id, metadata, dynamicProps) {
|
|
300
|
-
await this._extensionService.whenInstalledExtensionsRegistered();
|
|
301
|
-
const staticAgentRegistration = this._chatAgentService.getAgent(id, true);
|
|
302
|
-
const chatSessionRegistration = this._chatSessionService.getAllChatSessionContributions().find(c => c.type === id || c.alternativeIds?.includes(id));
|
|
303
|
-
if (!staticAgentRegistration && !chatSessionRegistration && !dynamicProps) {
|
|
304
|
-
if (this._chatAgentService.getAgentsByName(id).length) {
|
|
305
|
-
throw ( new Error(
|
|
306
|
-
`chatParticipant must be declared with an ID in package.json. The "id" property may be missing! "${id}"`
|
|
307
|
-
));
|
|
308
|
-
}
|
|
309
|
-
throw ( new Error(`chatParticipant must be declared in package.json: ${id}`));
|
|
310
|
-
}
|
|
311
|
-
const impl = {
|
|
312
|
-
invoke: async (request, progress, history, token) => {
|
|
313
|
-
const chatSession = this._chatService.getSession(request.sessionResource);
|
|
314
|
-
this._pendingProgress.set(request.requestId, {
|
|
315
|
-
progress,
|
|
316
|
-
chatSession,
|
|
317
|
-
isSubagent: !!request.subAgentInvocationId
|
|
318
|
-
});
|
|
319
|
-
try {
|
|
320
|
-
const chatSessionResource = request.sessionResource;
|
|
321
|
-
const chatSessionContext = {
|
|
322
|
-
chatSessionResource,
|
|
323
|
-
isUntitled: isUntitledChatSession(chatSessionResource),
|
|
324
|
-
initialSessionOptions: ChatSessionOptionsMap.toStrValueArray(this._chatSessionService.getSessionOptions(chatSessionResource))
|
|
325
|
-
};
|
|
326
|
-
const rpcResult = await this._proxy.$invokeAgent(handle, request, {
|
|
327
|
-
history,
|
|
328
|
-
chatSessionContext
|
|
329
|
-
}, token);
|
|
330
|
-
if (rpcResult?.errorCallstack && !rpcResult.errorDetails?.isRateLimited && !rpcResult.errorDetails?.isQuotaExceeded && !rpcResult.errorDetails?.isExpectedError) {
|
|
331
|
-
this._telemetryService.publicLogError2("chatAgentError", {
|
|
332
|
-
callstack: rpcResult.errorCallstack,
|
|
333
|
-
msg: rpcResult.errorDetails?.message ?? "",
|
|
334
|
-
errorName: rpcResult.errorName ?? "",
|
|
335
|
-
agent: id,
|
|
336
|
-
agentExtensionId: extension.value
|
|
337
|
-
});
|
|
338
|
-
}
|
|
339
|
-
if (rpcResult) {
|
|
340
|
-
const {
|
|
341
|
-
errorCallstack: _,
|
|
342
|
-
errorName: _2,
|
|
343
|
-
...result
|
|
344
|
-
} = rpcResult;
|
|
345
|
-
return result;
|
|
346
|
-
}
|
|
347
|
-
return {};
|
|
348
|
-
} finally {
|
|
349
|
-
this._pendingProgress.delete(request.requestId);
|
|
350
|
-
}
|
|
351
|
-
},
|
|
352
|
-
setRequestTools: (requestId, tools) => {
|
|
353
|
-
this._proxy.$setRequestTools(requestId, tools);
|
|
354
|
-
},
|
|
355
|
-
setYieldRequested: (requestId, value) => {
|
|
356
|
-
this._proxy.$setYieldRequested(requestId, value);
|
|
357
|
-
},
|
|
358
|
-
provideFollowups: async (request, result, history, token) => {
|
|
359
|
-
if (!this._agents.get(handle)?.hasFollowups) {
|
|
360
|
-
return [];
|
|
361
|
-
}
|
|
362
|
-
return this._proxy.$provideFollowups(request, handle, result, {
|
|
363
|
-
history
|
|
364
|
-
}, token);
|
|
365
|
-
},
|
|
366
|
-
provideChatTitle: (history, token) => {
|
|
367
|
-
return this._proxy.$provideChatTitle(handle, history, token);
|
|
368
|
-
},
|
|
369
|
-
provideChatSummary: (history, token) => {
|
|
370
|
-
return this._proxy.$provideChatSummary(handle, history, token);
|
|
371
|
-
}
|
|
372
|
-
};
|
|
373
|
-
if (chatSessionRegistration?.alternativeIds?.includes(id)) {
|
|
374
|
-
return;
|
|
375
|
-
}
|
|
376
|
-
let disposable;
|
|
377
|
-
if (!staticAgentRegistration && dynamicProps) {
|
|
378
|
-
const extensionDescription = this._extensionService.extensions.find(e => ExtensionIdentifier.equals(e.identifier, extension));
|
|
379
|
-
disposable = this._chatAgentService.registerDynamicAgent({
|
|
380
|
-
id,
|
|
381
|
-
name: dynamicProps.name,
|
|
382
|
-
description: dynamicProps.description,
|
|
383
|
-
extensionId: extension,
|
|
384
|
-
extensionVersion: extensionDescription?.version,
|
|
385
|
-
extensionDisplayName: extensionDescription?.displayName ?? extension.value,
|
|
386
|
-
extensionPublisherId: extensionDescription?.publisher ?? "",
|
|
387
|
-
publisherDisplayName: dynamicProps.publisherName,
|
|
388
|
-
fullName: dynamicProps.fullName,
|
|
389
|
-
metadata: revive(metadata),
|
|
390
|
-
slashCommands: [],
|
|
391
|
-
disambiguation: [],
|
|
392
|
-
locations: [ChatAgentLocation.Chat],
|
|
393
|
-
modes: [ChatModeKind.Ask, ChatModeKind.Agent, ChatModeKind.Edit]
|
|
394
|
-
}, impl);
|
|
395
|
-
} else {
|
|
396
|
-
disposable = this._chatAgentService.registerAgentImplementation(id, impl);
|
|
397
|
-
}
|
|
398
|
-
this._agents.set(handle, {
|
|
399
|
-
id: id,
|
|
400
|
-
extensionId: extension,
|
|
401
|
-
dispose: () => disposable.dispose(),
|
|
402
|
-
hasFollowups: metadata.hasFollowups
|
|
403
|
-
});
|
|
404
|
-
}
|
|
405
|
-
async $updateAgent(handle, metadataUpdate) {
|
|
406
|
-
await this._extensionService.whenInstalledExtensionsRegistered();
|
|
407
|
-
const data = this._agents.get(handle);
|
|
408
|
-
if (!data) {
|
|
409
|
-
this._logService.error(
|
|
410
|
-
`MainThreadChatAgents2#$updateAgent: No agent with handle ${handle} registered`
|
|
411
|
-
);
|
|
412
|
-
return;
|
|
413
|
-
}
|
|
414
|
-
data.hasFollowups = metadataUpdate.hasFollowups;
|
|
415
|
-
this._chatAgentService.updateAgent(data.id, revive(metadataUpdate));
|
|
416
|
-
}
|
|
417
|
-
async $handleProgressChunk(requestId, chunks) {
|
|
418
|
-
const pendingProgress = this._pendingProgress.get(requestId);
|
|
419
|
-
if (!pendingProgress) {
|
|
420
|
-
this._logService.warn(
|
|
421
|
-
`MainThreadChatAgents2#$handleProgressChunk: No pending progress for requestId ${requestId}`
|
|
422
|
-
);
|
|
423
|
-
return;
|
|
424
|
-
}
|
|
425
|
-
const {
|
|
426
|
-
progress,
|
|
427
|
-
chatSession,
|
|
428
|
-
isSubagent
|
|
429
|
-
} = pendingProgress;
|
|
430
|
-
const chatProgressParts = [];
|
|
431
|
-
const response = chatSession?.getRequests().find(req => req.id === requestId)?.response;
|
|
432
|
-
for (const item of chunks) {
|
|
433
|
-
const [progress, responsePartHandle] = Array.isArray(item) ? item : [item];
|
|
434
|
-
if (progress.kind === "externalEdits") {
|
|
435
|
-
if (chatSession?.editingSession && responsePartHandle !== undefined && response) {
|
|
436
|
-
const parts = progress.start ? await chatSession.editingSession.startExternalEdits(
|
|
437
|
-
response,
|
|
438
|
-
responsePartHandle,
|
|
439
|
-
revive(progress.resources),
|
|
440
|
-
progress.undoStopId
|
|
441
|
-
) : await chatSession.editingSession.stopExternalEdits(response, responsePartHandle);
|
|
442
|
-
chatProgressParts.push(...parts);
|
|
443
|
-
}
|
|
444
|
-
continue;
|
|
445
|
-
}
|
|
446
|
-
if (progress.kind === "beginToolInvocation") {
|
|
447
|
-
this._languageModelToolsService.beginToolCall({
|
|
448
|
-
toolCallId: progress.toolCallId,
|
|
449
|
-
toolId: progress.toolName,
|
|
450
|
-
chatRequestId: requestId,
|
|
451
|
-
sessionResource: chatSession?.sessionResource,
|
|
452
|
-
subagentInvocationId: progress.subagentInvocationId
|
|
453
|
-
});
|
|
454
|
-
continue;
|
|
455
|
-
}
|
|
456
|
-
if (progress.kind === "updateToolInvocation") {
|
|
457
|
-
this._languageModelToolsService.updateToolStream(
|
|
458
|
-
progress.toolCallId,
|
|
459
|
-
progress.streamData?.partialInput,
|
|
460
|
-
CancellationToken.None
|
|
461
|
-
);
|
|
462
|
-
continue;
|
|
463
|
-
}
|
|
464
|
-
if (progress.kind === "usage") {
|
|
465
|
-
if (isSubagent) {
|
|
466
|
-
chatProgressParts.push({
|
|
467
|
-
kind: "usage",
|
|
468
|
-
promptTokens: progress.promptTokens,
|
|
469
|
-
completionTokens: progress.completionTokens,
|
|
470
|
-
outputBuffer: progress.outputBuffer,
|
|
471
|
-
copilotCredits: progress.copilotCredits,
|
|
472
|
-
promptTokenDetails: progress.promptTokenDetails
|
|
473
|
-
});
|
|
474
|
-
} else if (response) {
|
|
475
|
-
response.setUsage({
|
|
476
|
-
kind: "usage",
|
|
477
|
-
promptTokens: progress.promptTokens,
|
|
478
|
-
completionTokens: progress.completionTokens,
|
|
479
|
-
outputBuffer: progress.outputBuffer,
|
|
480
|
-
copilotCredits: progress.copilotCredits,
|
|
481
|
-
promptTokenDetails: progress.promptTokenDetails
|
|
482
|
-
});
|
|
483
|
-
} else {
|
|
484
|
-
this._logService.warn(
|
|
485
|
-
`MainThreadChatAgents2#$handleProgressChunk: No response model for usage of non-subagent request ${requestId}; dropping usage.`
|
|
486
|
-
);
|
|
487
|
-
}
|
|
488
|
-
continue;
|
|
489
|
-
}
|
|
490
|
-
const revivedProgress = progress.kind === "notebookEdit" ? ChatNotebookEdit.fromChatEdit(progress) : revive(progress);
|
|
491
|
-
if (revivedProgress.kind === "notebookEdit" || revivedProgress.kind === "textEdit" || revivedProgress.kind === "codeblockUri") {
|
|
492
|
-
revivedProgress.uri = this._uriIdentityService.asCanonicalUri(revivedProgress.uri);
|
|
493
|
-
}
|
|
494
|
-
if (responsePartHandle !== undefined) {
|
|
495
|
-
if (revivedProgress.kind === "progressTask") {
|
|
496
|
-
const handle = responsePartHandle;
|
|
497
|
-
const responsePartId = `${requestId}_${handle}`;
|
|
498
|
-
const task = ( new MainThreadChatTask(revivedProgress.content));
|
|
499
|
-
this._activeTasks.set(responsePartId, task);
|
|
500
|
-
chatProgressParts.push(task);
|
|
501
|
-
} else if (responsePartHandle !== undefined) {
|
|
502
|
-
const responsePartId = `${requestId}_${responsePartHandle}`;
|
|
503
|
-
const task = this._activeTasks.get(responsePartId);
|
|
504
|
-
switch (revivedProgress.kind) {
|
|
505
|
-
case "progressTaskResult":
|
|
506
|
-
if (task && revivedProgress.content) {
|
|
507
|
-
task.complete(revivedProgress.content.value);
|
|
508
|
-
this._activeTasks.delete(responsePartId);
|
|
509
|
-
} else {
|
|
510
|
-
task?.complete(undefined);
|
|
511
|
-
}
|
|
512
|
-
break;
|
|
513
|
-
case "warning":
|
|
514
|
-
case "reference":
|
|
515
|
-
task?.add(revivedProgress);
|
|
516
|
-
break;
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
|
-
continue;
|
|
520
|
-
}
|
|
521
|
-
if (revivedProgress.kind === "inlineReference" && revivedProgress.resolveId && response) {
|
|
522
|
-
if (!( this._unresolvedAnchors.has(requestId))) {
|
|
523
|
-
this._unresolvedAnchors.set(requestId, ( new Map()));
|
|
524
|
-
}
|
|
525
|
-
this._unresolvedAnchors.get(requestId)?.set(revivedProgress.resolveId, {
|
|
526
|
-
response
|
|
527
|
-
});
|
|
528
|
-
}
|
|
529
|
-
chatProgressParts.push(revivedProgress);
|
|
530
|
-
}
|
|
531
|
-
progress(chatProgressParts);
|
|
532
|
-
}
|
|
533
|
-
$handleAnchorResolve(requestId, handle, resolveAnchor) {
|
|
534
|
-
const unresolvedAnchorsForRequest = this._unresolvedAnchors.get(requestId);
|
|
535
|
-
if (!unresolvedAnchorsForRequest) {
|
|
536
|
-
return;
|
|
537
|
-
}
|
|
538
|
-
const unresolvedAnchor = unresolvedAnchorsForRequest.get(handle);
|
|
539
|
-
if (!unresolvedAnchor) {
|
|
540
|
-
return;
|
|
541
|
-
}
|
|
542
|
-
unresolvedAnchorsForRequest.delete(handle);
|
|
543
|
-
if (unresolvedAnchorsForRequest.size === 0) {
|
|
544
|
-
this._unresolvedAnchors.delete(requestId);
|
|
545
|
-
}
|
|
546
|
-
if (resolveAnchor) {
|
|
547
|
-
const revivedAnchor = revive(resolveAnchor);
|
|
548
|
-
unresolvedAnchor.response.resolveInlineReference(handle, revivedAnchor);
|
|
549
|
-
}
|
|
550
|
-
}
|
|
551
|
-
$registerAgentCompletionsProvider(handle, id, triggerCharacters) {
|
|
552
|
-
const provide = async (query, token) => {
|
|
553
|
-
const completions = await this._proxy.$invokeCompletionProvider(handle, query, token);
|
|
554
|
-
return ( completions.map(c => ({
|
|
555
|
-
...c,
|
|
556
|
-
icon: c.icon ? ThemeIcon.fromId(c.icon) : undefined
|
|
557
|
-
})));
|
|
558
|
-
};
|
|
559
|
-
this._agentIdsToCompletionProviders.set(id, this._chatAgentService.registerAgentCompletionProvider(id, provide));
|
|
560
|
-
this._agentCompletionProviders.set(handle, this._languageFeaturesService.completionProvider.register({
|
|
561
|
-
scheme: Schemas.vscodeChatInput,
|
|
562
|
-
hasAccessToAllModels: true
|
|
563
|
-
}, {
|
|
564
|
-
_debugDisplayName: "chatAgentCompletions:" + handle,
|
|
565
|
-
triggerCharacters,
|
|
566
|
-
provideCompletionItems: async (model, position, _context, token) => {
|
|
567
|
-
const widget = this._chatWidgetService.getWidgetByInputUri(model.uri);
|
|
568
|
-
if (!widget || !widget.viewModel) {
|
|
569
|
-
return;
|
|
570
|
-
}
|
|
571
|
-
const triggerCharsPart = ( triggerCharacters.map(c => escapeRegExpCharacters(c))).join("");
|
|
572
|
-
const wordRegex = ( new RegExp(`[${triggerCharsPart}]\\S*`, "g"));
|
|
573
|
-
const query = getWordAtText(position.column, wordRegex, model.getLineContent(position.lineNumber), 0)?.word ?? "";
|
|
574
|
-
if (query && !( triggerCharacters.some(c => query.startsWith(c)))) {
|
|
575
|
-
return;
|
|
576
|
-
}
|
|
577
|
-
const context = {
|
|
578
|
-
sessionType: getChatSessionType(widget.viewModel.model.sessionResource)
|
|
579
|
-
};
|
|
580
|
-
const parsedRequest = this._instantiationService.createInstance(ChatRequestParser).parseChatRequestWithReferences(
|
|
581
|
-
getDynamicVariablesForWidget(widget),
|
|
582
|
-
getSelectedToolAndToolSetsForWidget(widget),
|
|
583
|
-
model.getValue(),
|
|
584
|
-
ChatAgentLocation.Chat,
|
|
585
|
-
context
|
|
586
|
-
).parts;
|
|
587
|
-
const agentPart = parsedRequest.find(part => part instanceof ChatRequestAgentPart);
|
|
588
|
-
const thisAgentId = this._agents.get(handle)?.id;
|
|
589
|
-
if (agentPart?.agent.id !== thisAgentId) {
|
|
590
|
-
return;
|
|
591
|
-
}
|
|
592
|
-
const range = computeCompletionRanges(model, position, wordRegex);
|
|
593
|
-
if (!range) {
|
|
594
|
-
return null;
|
|
595
|
-
}
|
|
596
|
-
const result = await provide(query, token);
|
|
597
|
-
const variableItems = ( result.map(v => {
|
|
598
|
-
const insertText = v.insertText ?? (typeof v.label === "string" ? v.label : v.label.label);
|
|
599
|
-
const rangeAfterInsert = ( new Range(
|
|
600
|
-
range.insert.startLineNumber,
|
|
601
|
-
range.insert.startColumn,
|
|
602
|
-
range.insert.endLineNumber,
|
|
603
|
-
range.insert.startColumn + insertText.length
|
|
604
|
-
));
|
|
605
|
-
return {
|
|
606
|
-
label: v.label,
|
|
607
|
-
range,
|
|
608
|
-
insertText: insertText + " ",
|
|
609
|
-
kind: CompletionItemKind.Text,
|
|
610
|
-
detail: v.detail,
|
|
611
|
-
documentation: v.documentation,
|
|
612
|
-
command: {
|
|
613
|
-
id: addDynamicVariableActionId,
|
|
614
|
-
title: "",
|
|
615
|
-
arguments: [{
|
|
616
|
-
id: v.id,
|
|
617
|
-
widget,
|
|
618
|
-
range: rangeAfterInsert,
|
|
619
|
-
variableData: revive(v.value),
|
|
620
|
-
command: v.command
|
|
621
|
-
}]
|
|
622
|
-
}
|
|
623
|
-
};
|
|
624
|
-
}));
|
|
625
|
-
return {
|
|
626
|
-
suggestions: variableItems
|
|
627
|
-
};
|
|
628
|
-
}
|
|
629
|
-
}));
|
|
630
|
-
}
|
|
631
|
-
$unregisterAgentCompletionsProvider(handle, id) {
|
|
632
|
-
this._agentCompletionProviders.deleteAndDispose(handle);
|
|
633
|
-
this._agentIdsToCompletionProviders.deleteAndDispose(id);
|
|
634
|
-
}
|
|
635
|
-
$registerChatParticipantDetectionProvider(handle) {
|
|
636
|
-
this._chatParticipantDetectionProviders.set(
|
|
637
|
-
handle,
|
|
638
|
-
this._chatAgentService.registerChatParticipantDetectionProvider(handle, {
|
|
639
|
-
provideParticipantDetection: async (request, history, options, token) => {
|
|
640
|
-
return await this._proxy.$detectChatParticipant(handle, request, {
|
|
641
|
-
history
|
|
642
|
-
}, options, token);
|
|
643
|
-
}
|
|
644
|
-
})
|
|
645
|
-
);
|
|
646
|
-
}
|
|
647
|
-
$unregisterChatParticipantDetectionProvider(handle) {
|
|
648
|
-
this._chatParticipantDetectionProviders.deleteAndDispose(handle);
|
|
649
|
-
}
|
|
650
|
-
async $registerPromptFileProvider(handle, type, extensionId) {
|
|
651
|
-
const extension = await this._extensionService.getExtension(extensionId.value);
|
|
652
|
-
if (!extension) {
|
|
653
|
-
this._logService.error(
|
|
654
|
-
`[MainThreadChatAgents2] Could not find extension for prompt file provider: ${extensionId.value}`
|
|
655
|
-
);
|
|
656
|
-
return;
|
|
657
|
-
}
|
|
658
|
-
if (!isValidPromptType(type)) {
|
|
659
|
-
this._logService.error(`[MainThreadChatAgents2] Invalid contribution type: ${type}`);
|
|
660
|
-
return;
|
|
661
|
-
}
|
|
662
|
-
const emitter = ( new Emitter());
|
|
663
|
-
this._promptFileProviderEmitters.set(handle, emitter);
|
|
664
|
-
const contentRegistrations = ( new DisposableMap());
|
|
665
|
-
this._promptFileContentRegistrations.set(handle, contentRegistrations);
|
|
666
|
-
const disposable = this._promptsService.registerPromptFileProvider(extension, type, {
|
|
667
|
-
onDidChangePromptFiles: emitter.event,
|
|
668
|
-
providePromptFiles: async (context, token) => {
|
|
669
|
-
const contributions = await this._proxy.$providePromptFiles(handle, type, context, token);
|
|
670
|
-
if (!contributions) {
|
|
671
|
-
return undefined;
|
|
672
|
-
}
|
|
673
|
-
return ( contributions.map(c => {
|
|
674
|
-
return {
|
|
675
|
-
name: c.name,
|
|
676
|
-
description: c.description,
|
|
677
|
-
sessionTypes: c.sessionTypes,
|
|
678
|
-
when: c.when,
|
|
679
|
-
uri: URI.revive(c.uri)
|
|
680
|
-
};
|
|
681
|
-
}));
|
|
682
|
-
}
|
|
683
|
-
});
|
|
684
|
-
this._promptFileProviders.set(handle, disposable);
|
|
685
|
-
}
|
|
686
|
-
$unregisterPromptFileProvider(handle) {
|
|
687
|
-
this._promptFileProviders.deleteAndDispose(handle);
|
|
688
|
-
this._promptFileProviderEmitters.deleteAndDispose(handle);
|
|
689
|
-
this._promptFileContentRegistrations.deleteAndDispose(handle);
|
|
690
|
-
}
|
|
691
|
-
$onDidChangePromptFiles(handle) {
|
|
692
|
-
const emitter = this._promptFileProviderEmitters.get(handle);
|
|
693
|
-
if (emitter) {
|
|
694
|
-
emitter.fire();
|
|
695
|
-
}
|
|
696
|
-
}
|
|
697
|
-
async $registerChatSessionCustomizationProvider(handle, chatSessionType, metadata, extensionId) {
|
|
698
|
-
if (this._environmentService.isSessionsWindow && !this._chatSessionService.getContentProviderSchemes().includes(chatSessionType)) {
|
|
699
|
-
return;
|
|
700
|
-
}
|
|
701
|
-
const extension = await this._extensionService.getExtension(extensionId.value);
|
|
702
|
-
if (!extension) {
|
|
703
|
-
this._logService.error(
|
|
704
|
-
`[MainThreadChatAgents2] Could not find extension for customization provider: ${extensionId.value}`
|
|
705
|
-
);
|
|
706
|
-
return;
|
|
707
|
-
}
|
|
708
|
-
const emitter = ( new Emitter());
|
|
709
|
-
this._customizationProviderEmitters.set(handle, emitter);
|
|
710
|
-
const itemProvider = {
|
|
711
|
-
onDidChange: emitter.event,
|
|
712
|
-
provideChatSessionCustomizations: async (sessionResource, token) => {
|
|
713
|
-
const items = await this._proxy.$provideChatSessionCustomizations(handle, sessionResource, token);
|
|
714
|
-
if (!items) {
|
|
715
|
-
return undefined;
|
|
716
|
-
}
|
|
717
|
-
return ( items.map(item => ({
|
|
718
|
-
uri: URI.revive(item.uri),
|
|
719
|
-
type: item.type,
|
|
720
|
-
name: item.name,
|
|
721
|
-
source: item.source,
|
|
722
|
-
description: item.description,
|
|
723
|
-
groupKey: item.groupKey,
|
|
724
|
-
badge: item.badge,
|
|
725
|
-
badgeTooltip: item.badgeTooltip,
|
|
726
|
-
extensionId: item.extensionId,
|
|
727
|
-
pluginUri: item.pluginUri ? URI.revive(item.pluginUri) : undefined,
|
|
728
|
-
pluginLabel: item.pluginLabel,
|
|
729
|
-
userInvocable: item.userInvocable
|
|
730
|
-
})));
|
|
731
|
-
},
|
|
732
|
-
provideSourceFolders: async (sessionResource, type, token) => {
|
|
733
|
-
const folders = await this._proxy.$provideSourceFolders(handle, sessionResource, type, token);
|
|
734
|
-
if (!folders) {
|
|
735
|
-
return undefined;
|
|
736
|
-
}
|
|
737
|
-
return ( folders.map(folder => ({
|
|
738
|
-
uri: URI.revive(folder.uri),
|
|
739
|
-
label: folder.label,
|
|
740
|
-
source: folder.source,
|
|
741
|
-
destinationGroupId: folder.destinationGroupId
|
|
742
|
-
})));
|
|
743
|
-
}
|
|
744
|
-
};
|
|
745
|
-
const typeToSection = {
|
|
746
|
-
"agent": AICustomizationManagementSection.Agents,
|
|
747
|
-
"skill": AICustomizationManagementSection.Skills,
|
|
748
|
-
"instructions": AICustomizationManagementSection.Instructions,
|
|
749
|
-
"prompt": AICustomizationManagementSection.Prompts,
|
|
750
|
-
"hook": AICustomizationManagementSection.Hooks,
|
|
751
|
-
"plugins": AICustomizationManagementSection.Plugins
|
|
752
|
-
};
|
|
753
|
-
let hiddenSections;
|
|
754
|
-
if (metadata.supportedTypes) {
|
|
755
|
-
const supportedSections = ( new Set());
|
|
756
|
-
for (const t of metadata.supportedTypes) {
|
|
757
|
-
const section = typeToSection[t];
|
|
758
|
-
if (section) {
|
|
759
|
-
supportedSections.add(section);
|
|
760
|
-
}
|
|
761
|
-
}
|
|
762
|
-
hiddenSections = ( Object.values(typeToSection)).filter(section => !( supportedSections.has(section)));
|
|
763
|
-
}
|
|
764
|
-
const descriptor = {
|
|
765
|
-
id: chatSessionType,
|
|
766
|
-
label: metadata.label,
|
|
767
|
-
icon: metadata.iconId ? ThemeIcon.fromId(metadata.iconId) : ThemeIcon.fromId(Codicon.extensions.id),
|
|
768
|
-
hiddenSections,
|
|
769
|
-
itemProvider
|
|
770
|
-
};
|
|
771
|
-
const registration = this._customizationHarnessService.registerExternalHarness(descriptor);
|
|
772
|
-
this._customizationProviders.set(handle, registration);
|
|
773
|
-
}
|
|
774
|
-
$unregisterChatSessionCustomizationProvider(handle) {
|
|
775
|
-
this._customizationProviders.deleteAndDispose(handle);
|
|
776
|
-
this._customizationProviderEmitters.deleteAndDispose(handle);
|
|
777
|
-
}
|
|
778
|
-
$onDidChangeCustomizations(handle) {
|
|
779
|
-
const emitter = this._customizationProviderEmitters.get(handle);
|
|
780
|
-
if (emitter) {
|
|
781
|
-
emitter.fire();
|
|
782
|
-
}
|
|
783
|
-
}
|
|
784
|
-
};
|
|
785
|
-
MainThreadChatAgents2 = __decorate([extHostNamedCustomer(MainContext.MainThreadChatAgents2), ( __param(1, IChatAgentService)), ( __param(2, IChatSessionsService)), ( __param(3, IChatService)), ( __param(4, ILanguageFeaturesService)), ( __param(5, IChatWidgetService)), ( __param(6, IInstantiationService)), ( __param(7, ILogService)), ( __param(8, IExtensionService)), ( __param(9, IUriIdentityService)), ( __param(10, IPromptsService)), ( __param(11, ILanguageModelToolsService)), ( __param(12, ICustomizationHarnessService)), ( __param(13, ITelemetryService)), ( __param(14, IAgentPluginService)), ( __param(15, IWorkbenchEnvironmentService))], MainThreadChatAgents2);
|
|
786
|
-
function computeCompletionRanges(model, position, reg) {
|
|
787
|
-
const varWord = getWordAtText(position.column, reg, model.getLineContent(position.lineNumber), 0);
|
|
788
|
-
if (!varWord && model.getWordUntilPosition(position).word) {
|
|
789
|
-
return;
|
|
790
|
-
}
|
|
791
|
-
let insert;
|
|
792
|
-
let replace;
|
|
793
|
-
if (!varWord) {
|
|
794
|
-
insert = replace = Range.fromPositions(position);
|
|
795
|
-
} else {
|
|
796
|
-
insert = ( new Range(
|
|
797
|
-
position.lineNumber,
|
|
798
|
-
varWord.startColumn,
|
|
799
|
-
position.lineNumber,
|
|
800
|
-
position.column
|
|
801
|
-
));
|
|
802
|
-
replace = ( new Range(
|
|
803
|
-
position.lineNumber,
|
|
804
|
-
varWord.startColumn,
|
|
805
|
-
position.lineNumber,
|
|
806
|
-
varWord.endColumn
|
|
807
|
-
));
|
|
808
|
-
}
|
|
809
|
-
return {
|
|
810
|
-
insert,
|
|
811
|
-
replace
|
|
812
|
-
};
|
|
813
|
-
}
|
|
814
|
-
var ChatNotebookEdit;
|
|
815
|
-
(function(ChatNotebookEdit) {
|
|
816
|
-
function fromChatEdit(part) {
|
|
817
|
-
return {
|
|
818
|
-
kind: "notebookEdit",
|
|
819
|
-
uri: URI.revive(part.uri),
|
|
820
|
-
done: part.done,
|
|
821
|
-
edits: ( part.edits.map(NotebookDto.fromCellEditOperationDto))
|
|
822
|
-
};
|
|
823
|
-
}
|
|
824
|
-
ChatNotebookEdit.fromChatEdit = fromChatEdit;
|
|
825
|
-
})(ChatNotebookEdit || (ChatNotebookEdit = {}));
|
|
826
|
-
|
|
827
|
-
export { MainThreadChatAgents2, MainThreadChatTask };
|