@codingame/monaco-vscode-chat-service-override 37.2.0 → 37.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/common.d.ts +9 -0
- package/common.js +372 -0
- package/index.d.ts +4 -6
- package/index.js +20 -377
- package/package.json +12 -5
- package/session.d.ts +8 -0
- package/session.js +56 -0
- package/vscode/src/vs/platform/agentHost/browser/agentHostConnectionsService.js +5 -2
- package/vscode/src/vs/platform/agentHost/browser/agentHostEnablementService.js +1 -1
- package/vscode/src/vs/platform/agentHost/browser/agentHostIpcChannelTransport.d.ts +1 -1
- package/vscode/src/vs/platform/agentHost/browser/agentHostIpcChannelTransport.js +2 -2
- package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.js +35 -11
- package/vscode/src/vs/platform/agentHost/browser/webSocketClientTransport.d.ts +1 -1
- package/vscode/src/vs/platform/agentHost/browser/webSocketClientTransport.js +2 -2
- package/vscode/src/vs/platform/agentHost/common/agentHostCustomizationConfig.js +34 -18
- package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemService.d.ts +1 -1
- package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemService.js +1 -1
- package/vscode/src/vs/platform/agentHost/common/agentHostStarter.config.contribution.js +54 -54
- package/vscode/src/vs/platform/agentHost/common/agentModelPricing.js +20 -23
- package/vscode/src/vs/platform/agentHost/common/copilotConfigSlashCommands.js +8 -8
- package/vscode/src/vs/platform/agentHost/common/meta/clientPluginCustomizationMeta.js +3 -1
- package/vscode/src/vs/platform/agentHost/common/otlp/otlpLogEmitter.d.ts +198 -0
- package/vscode/src/vs/platform/agentHost/common/otlp/otlpLogEmitter.js +197 -0
- package/vscode/src/vs/platform/agentHost/common/sandboxConfigSchema.js +14 -14
- package/vscode/src/vs/platform/agentHost/common/state/sessionWorkingDirectories.d.ts +1 -1
- package/vscode/src/vs/platform/agentHost/common/wslRemoteAgentHost.d.ts +63 -0
- package/vscode/src/vs/platform/agentHost/common/wslRemoteAgentHost.js +7 -0
- package/vscode/src/vs/platform/agentHost/common/wslRemoteAgentHost.service.d.ts +51 -0
- package/vscode/src/vs/platform/agentHost/common/wslRemoteAgentHost.service.js +6 -0
- package/vscode/src/vs/platform/networkFilter/common/networkFilterService.js +3 -3
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxEngine.d.ts +1 -1
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxEngine.js +6 -6
- package/vscode/src/vs/sessions/browser/parts/mobile/contributions/media/mobileMultiDiffView.css +215 -0
- package/vscode/src/vs/sessions/browser/parts/mobile/contributions/mobileDiffHelpers.d.ts +28 -0
- package/vscode/src/vs/sessions/browser/parts/mobile/contributions/mobileDiffHelpers.js +429 -0
- package/vscode/src/vs/sessions/browser/parts/mobile/contributions/mobileDiffView.d.ts +100 -0
- package/vscode/src/vs/sessions/browser/parts/mobile/contributions/mobileDiffView.js +675 -0
- package/vscode/src/vs/sessions/browser/parts/mobile/contributions/mobileMultiDiffView.d.ts +86 -0
- package/vscode/src/vs/sessions/browser/parts/mobile/contributions/mobileMultiDiffView.js +860 -0
- package/vscode/src/vs/sessions/browser/parts/mobile/contributions/mobileMultiDiffVirtualizer.d.ts +35 -0
- package/vscode/src/vs/sessions/browser/parts/mobile/contributions/mobileMultiDiffVirtualizer.js +67 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/agentHostDelegation.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/agentHostDelegation.js +41 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/aiCustomizationWorkspaceService.d.ts +85 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/aiCustomizationWorkspaceService.js +247 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/branchChatSessionAction.d.ts +16 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/branchChatSessionAction.js +71 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/btwSlashCommand.contribution.d.ts +15 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/btwSlashCommand.contribution.js +106 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/chat.contribution.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/chat.contribution.js +438 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/chatPetAchievements.d.ts +8 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/chatPetAchievements.js +25 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/customizationsDebugLog.contribution.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/customizationsDebugLog.contribution.js +173 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/media/runScriptAction.css +186 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/newSession.d.ts +9 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/newSessionFolderQuickPickAction.d.ts +12 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/newSessionFolderQuickPickAction.js +104 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/nullInlineChatSessionService.d.ts +15 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/nullInlineChatSessionService.js +23 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/openSessionLinkOpener.contribution.d.ts +51 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/openSessionLinkOpener.contribution.js +151 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/promptsService.d.ts +32 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/promptsService.js +85 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/registerDefaultSessionTaskRunners.d.ts +14 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/registerDefaultSessionTaskRunners.js +20 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/requestOriginProvider.contribution.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/requestOriginProvider.contribution.js +34 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/runScriptAction.d.ts +39 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/runScriptAction.js +828 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/runScriptCustomTaskWidget.d.ts +48 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/runScriptCustomTaskWidget.js +215 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/sessionTurnChanges.d.ts +27 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/sessionTurnChanges.js +237 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/sessionsChatAccessibilityHelp.d.ts +10 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/sessionsChatAccessibilityHelp.js +348 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/sessionsOpenerParticipant.d.ts +6 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/sessionsOpenerParticipant.js +35 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/sideChatProvider.contribution.d.ts +45 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/sideChatProvider.contribution.js +189 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/unifiedWorkspacePickerConfiguration.d.ts +3 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/unifiedWorkspacePickerConfiguration.js +17 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/voiceBridge.contribution.d.ts +14 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/voiceBridge.contribution.js +381 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/workbenchSessionTaskRunner.d.ts +23 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/workbenchSessionTaskRunner.js +48 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/worktreeCreatedTaskDispatcher.d.ts +40 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/worktreeCreatedTaskDispatcher.js +116 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostAgentPicker.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostAgentPicker.js +300 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostSettings.contribution.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostSettings.contribution.js +74 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostSettingsFileSystemProvider.d.ts +55 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostSettingsFileSystemProvider.js +103 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostSettingsShared.d.ts +50 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostSettingsShared.js +72 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentSessionSettings.contribution.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentSessionSettings.contribution.js +70 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentSessionSettingsFileSystemProvider.d.ts +69 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentSessionSettingsFileSystemProvider.js +151 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/openAgentHostStateFileAction.d.ts +17 -0
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/openAgentHostStateFileAction.js +39 -0
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/branchPicker.d.ts +31 -0
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/branchPicker.js +150 -0
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessions.contribution.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessions.contribution.js +42 -0
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsActions.d.ts +19 -0
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsActions.js +199 -0
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsChangesets.d.ts +104 -0
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsChangesets.js +301 -0
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsProvider.d.ts +518 -0
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsProvider.js +3121 -0
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/mobilePermissionPicker.contribution.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/mobilePermissionPicker.contribution.js +37 -0
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/mobilePermissionPicker.d.ts +25 -0
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/mobilePermissionPicker.js +97 -0
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/modePicker.d.ts +74 -0
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/modePicker.js +355 -0
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/permissionPicker.d.ts +135 -0
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/permissionPicker.js +521 -0
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/sandboxPicker.d.ts +26 -0
- package/vscode/src/vs/sessions/contrib/providers/copilotChatSessions/browser/sandboxPicker.js +86 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxAgentHost.contribution.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxAgentHost.contribution.js +14 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxAgentHostContribution.d.ts +166 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxAgentHostContribution.js +586 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxConnectionCustomization.d.ts +15 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxConnectionCustomization.js +47 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxReadOnlySessionHandler.d.ts +45 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxReadOnlySessionHandler.js +109 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxSessionsProvider.d.ts +49 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxSessionsProvider.js +69 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/entryDrivenProviderContribution.d.ts +47 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/entryDrivenProviderContribution.js +109 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/hostFilter.contribution.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/hostFilter.contribution.js +72 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/hostFilterActionViewItem.d.ts +79 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/hostFilterActionViewItem.js +353 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/manageRemoteAgentHosts.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/manageRemoteAgentHosts.js +161 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/managedReconnectAgentHostContribution.d.ts +95 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/managedReconnectAgentHostContribution.js +172 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/media/hostFilter.css +259 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/media/hostPickerSheet.css +351 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/mobileHostFilterActionViewItem.d.ts +36 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/mobileHostFilterActionViewItem.js +236 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHost.contribution.d.ts +80 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHost.contribution.js +686 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHostActions.d.ts +20 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHostActions.js +1210 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHostCustomizationHarness.d.ts +31 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHostCustomizationHarness.js +136 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHostLogForwarder.d.ts +103 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHostLogForwarder.js +173 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHostTerminal.contribution.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHostTerminal.contribution.js +51 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/tunnelAgentHost.contribution.d.ts +74 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/tunnelAgentHost.contribution.js +438 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/webSocketAgentHost.contribution.d.ts +14 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/webSocketAgentHost.contribution.js +52 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/wslAgentHost.contribution.d.ts +44 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/wslAgentHost.contribution.js +171 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/mobile/mobileOverlayContribution.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/mobile/mobileOverlayContribution.js +98 -0
- package/vscode/src/vs/sessions/services/agentHost/browser/agentHostCustomizationService.d.ts +24 -0
- package/vscode/src/vs/sessions/services/agentHost/browser/agentHostCustomizationService.js +142 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatAgents2.js +22 -22
- package/vscode/src/vs/workbench/api/browser/mainThreadChatCodeMapper.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadChatContext.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadChatDebug.js +7 -7
- package/vscode/src/vs/workbench/api/browser/mainThreadChatInputNotification.js +3 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadChatSessions.js +14 -14
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModelTools.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageModels.js +9 -7
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoice.contribution.js +35 -35
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceSessionsPicker.js +4 -4
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidget.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidget.js +20 -20
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidgetBinding.js +7 -7
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWindowService.js +3 -3
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/confirmationComponent.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/confirmationComponent.js +3 -3
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/feedbackDialog.js +6 -6
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/headerComponent.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/headerComponent.js +11 -11
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/onboardingComponent.js +11 -11
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/sessionListComponent.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/sessionListComponent.js +9 -9
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/statusRowsComponent.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/statusRowsComponent.js +5 -5
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/transcriptComponent.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/voiceBarComponent.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/voiceBarComponent.js +2 -2
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscripts.contribution.js +14 -14
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscriptsView.js +7 -7
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/voiceModeOnboarding.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/voiceModeOnboarding.js +40 -40
- package/vscode/src/vs/workbench/contrib/agentsVoice/common/voiceTranscriptStore.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.js +27 -31
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +97 -97
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAgentRecommendationActions.js +5 -3
- 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 +17 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFindActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatLanguageModelActions.js +15 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatNewActions.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatOpenAgentDebugPanelAction.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPluginActions.js +19 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPromptNavigationActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQueueActions.js +15 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +20 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/createPluginAction.js +50 -42
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/exportAgentHostDebugLogsAction.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/openAgentHostStateFileAction.js +9 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginCommands.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditorInput.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditorInput.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.js +21 -21
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationContentExpander.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationContentExpander.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationItemProvider.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationItemProvider.js +8 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationSyncProvider.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHost.contribution.js +2 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostAuth.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatContribution.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCopilotCliSettingsContribution.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCustomizationService.js +431 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostExistingSessionHarnessPickerEnablement.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLanguageModelProvider.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLocalCustomizations.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLocalCustomizations.js +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostMcpServerSupport.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostMcpServerSupport.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostModeSynchronizer.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPermissionUiContribution.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPromptCacheNotification.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPromptCacheNotification.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostProtectedResourcesService.js +4 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostResponseFileChanges.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostResponseFileChanges.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostRootConfigForwarder.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionHandler.js +83 -74
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionInputPills.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionInputPills.js +48 -43
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListContribution.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListController.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListStore.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListStore.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectorySynchronizer.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectorySynchronizer.js +9 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSettings.contribution.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSettingsFileSystemProvider.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostShellInitSynchronizer.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostShellInitSynchronizer.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSignedOutModelsNotification.js +10 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostTerminalContribution.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostUntitledProvisionalSessionService.js +12 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentSessionSettings.contribution.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentSessionSettingsFileSystemProvider.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentSessionSettingsFileSystemProvider.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/applyAgentHostSessionConfig.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/applyAgentHostSubmitConfig.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/openSessionLinkOpener.contribution.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/syncedCustomizationBundler.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.js +56 -54
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjection.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionActions.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionActions.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionsExperiments.contribution.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.js +26 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccess.js +20 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccessActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/localAgentSessionsController.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/sessionSummaryHoverService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/sessionSummaryHoverService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessionsConfiguration.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.contribution.js +48 -48
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationAccessibility.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationServiceImpl.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationServiceImpl.js +26 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpServerCustomizationMigration.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpServerCustomizationMigration.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatReferenceAttachmentWidget.contribution.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/transcriptContextAttachmentWidget.contribution.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.shared.contribution.js +400 -426
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostChatDebugProvider.js +42 -42
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostLogSources.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostUsageSidecar.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostUsageSidecar.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.js +36 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheExplorerView.js +136 -136
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheInsights.js +75 -75
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugDetailPanel.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditor.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditorInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEnablement.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventDetailRenderer.js +20 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventList.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFilters.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowChartView.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowGraph.js +26 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowLayout.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHomeView.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHookContentRenderer.js +17 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.js +27 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugMessageContentRenderer.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugModelTurnContentRenderer.js +23 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugOverviewView.js +35 -35
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugToolCallContentRenderer.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugTypes.js +32 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugWireLogView.js +42 -42
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCheckpointTimelineImpl.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingDeletedFileEntry.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +19 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +15 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +18 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSessionStorage.js +4 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelChangeService.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookSnapshot.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookCellEntry.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/helpers.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatImageCarouselService.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditor.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +36 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievements.contribution.js +18 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementsEditor.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementsEditorInput.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementsWidget.js +39 -39
- package/vscode/src/vs/workbench/contrib/chat/browser/chatPromoNotification.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuotaNotification.js +27 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/chatRepoInfo.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionDescription.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.js +21 -21
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupGrowthSession.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupGrowthSession.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.js +38 -38
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.js +60 -55
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.js +39 -37
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.js +15 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipCatalog.js +19 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWindowNotifier.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/claudePluginRecommendations.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/contextContrib/chatContext.contribution.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/contextContrib/chatContextService.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/defaultModelContribution.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/enablementStatusWidget.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/expNotification/chatExpNotificationConfig.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/expNotification/chatExpNotificationConfig.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/expNotification/chatExpNotificationContribution.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/githubRepoFetcher.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorOverlay.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackService.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginGitCommandService.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.js +32 -32
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.js +22 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginUrlHandler.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionOverlay.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptFileActions.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolSetsCodeLensProvider.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptUrlHandler.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/skillActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptBucketing.js +5 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimeline.contribution.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineCard.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineGutterRail.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineModel.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineRulerRail.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineStickyHeader.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineWidgetContrib.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/promptsDebugContribution.js +36 -29
- package/vscode/src/vs/workbench/contrib/chat/browser/telemetry/chatEditorTopologyTelemetry.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/clientToolSetsContribution.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.js +46 -42
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.js +34 -34
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolHelpers.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolResultCompressorService.js +68 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/utilityModelContribution.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceClientService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceClientService.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceInputMode/voiceInputMode.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownAnchorService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentOpenChat.js +25 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatFind/chatFindAccessibilityHelp.js +15 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatPetWidgetService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatPetWidgetService.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNoticeHub.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNoticeHub.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletions.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletions.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCommandArgumentHint.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.js +99 -95
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorContrib.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorHover.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/editorHoverWrapper.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/chatQuick.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditor.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.js +19 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/common/chatDebugService.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.js +28 -26
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceTelemetry.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatModelStore.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionOperationLog.js +5 -2
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/common/model/objectMutationLog.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/participants/chatSlashCommands.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.js +21 -21
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/workspacePluginSettingsService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/workspacePluginSettingsService.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +20 -20
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +18 -12
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.js +157 -157
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/confirmationTool.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/manageTodoListTool.js +17 -17
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/reviewPlanTool.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/runSubagentTool.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactRulesTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactsTool.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/tools.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/tools/chatArtifactsService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +26 -26
- package/vscode/src/vs/workbench/contrib/chat/common/tools/toolResultCompressor.js +5 -1
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatResponseResourceFileSystemProvider.js +1 -1
- package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarousel.contribution.js +13 -13
- package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarouselEditor.js +10 -10
- package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarouselEditorInput.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibilityHelp.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +16 -16
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatDefaultModel.js +3 -3
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditReviewSession.js +3 -3
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +5 -5
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.js +29 -25
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +13 -13
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +10 -10
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.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/remoteCodingAgents/browser/remoteCodingAgents.contribution.js +7 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChat.js +22 -22
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.js +16 -16
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +21 -21
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.js +4 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +4 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/agentHostSandboxForwarder.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +15 -15
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.js +2 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.js +7 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +5 -5
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +18 -18
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +9 -9
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/consoleCompactor/consoleCompactor.js +28 -25
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalLastCommandTool.js +4 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +4 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalSelectionTool.js +4 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/killTerminalTool.js +4 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +4 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +5 -5
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +79 -79
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sendToTerminalTool.js +11 -11
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/createAndRunTaskTool.js +16 -16
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/getTaskOutputTool.js +9 -9
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/runTaskTool.js +16 -16
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalCommandArtifactCollector.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalCommandParser.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalOutputCache.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalOutputCache.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalOutputCompressor.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/sandboxSettingsReader.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +7 -7
- package/vscode/src/vs/workbench/services/agentEditorComments/browser/agentEditorCommentsOverlayWidget.js +4 -4
- package/vscode/src/vs/workbench/services/agentHost/browser/editorRemoteAgentHostServiceClient.d.ts +3 -3
- package/vscode/src/vs/workbench/services/agentHost/browser/editorRemoteAgentHostServiceClient.js +4 -4
- package/vscode/src/vs/workbench/services/agentHost/common/agentHostFileSystemService.d.ts +1 -1
- package/vscode/src/vs/workbench/services/agentHost/common/agentHostFileSystemService.js +1 -1
- package/vscode/src/vs/workbench/services/agentHost/common/agentHostResourceService.js +6 -6
- package/vscode/src/vs/workbench/services/agentHost/common/editorRemoteAgentHostTransport.js +25 -25
- package/vscode/src/vs/platform/agentHost/browser/agentHostProtocolClient.d.ts +0 -603
- package/vscode/src/vs/platform/agentHost/browser/agentHostProtocolClient.js +0 -1911
- package/vscode/src/vs/platform/agentHost/common/agentHostClientInfo.d.ts +0 -9
- package/vscode/src/vs/platform/agentHost/common/agentHostClientInfo.js +0 -20
- package/vscode/src/vs/platform/agentHost/common/agentHostExtensionProtocol.d.ts +0 -144
- package/vscode/src/vs/platform/agentHost/common/agentHostExtensionProtocol.js +0 -20
- package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemProvider.d.ts +0 -204
- package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemProvider.js +0 -440
- package/vscode/src/vs/platform/agentHost/common/agentHostManagedRules.d.ts +0 -47
- package/vscode/src/vs/platform/agentHost/common/agentHostManagedRules.js +0 -75
- package/vscode/src/vs/platform/agentHost/common/agentHostManagedSettings.d.ts +0 -68
- package/vscode/src/vs/platform/agentHost/common/agentHostManagedSettings.js +0 -161
- package/vscode/src/vs/platform/agentHost/common/agentHostWorkingDirectories.d.ts +0 -16
- package/vscode/src/vs/platform/agentHost/common/agentHostWorkingDirectories.js +0 -14
- package/vscode/src/vs/platform/agentHost/common/agentMerge.d.ts +0 -261
- package/vscode/src/vs/platform/agentHost/common/agentMerge.js +0 -67
- package/vscode/src/vs/platform/agentHost/common/ahpJsonlLogger.d.ts +0 -39
- package/vscode/src/vs/platform/agentHost/common/ahpJsonlLogger.js +0 -169
- package/vscode/src/vs/platform/agentHost/common/changesetUri.d.ts +0 -130
- package/vscode/src/vs/platform/agentHost/common/changesetUri.js +0 -41
- package/vscode/src/vs/platform/agentHost/common/customAgents.d.ts +0 -42
- package/vscode/src/vs/platform/agentHost/common/customAgents.js +0 -20
- package/vscode/src/vs/platform/agentHost/common/meta/agentCompletionAttachmentMeta.d.ts +0 -110
- package/vscode/src/vs/platform/agentHost/common/meta/agentCompletionAttachmentMeta.js +0 -79
- package/vscode/src/vs/platform/agentHost/common/meta/agentHostArtifactRemovalMeta.d.ts +0 -4
- package/vscode/src/vs/platform/agentHost/common/resourceReadLogging.d.ts +0 -1
- package/vscode/src/vs/platform/agentHost/common/resourceReadLogging.js +0 -26
- package/vscode/src/vs/platform/agentHost/common/sessionArtifacts.d.ts +0 -75
- package/vscode/src/vs/platform/agentHost/common/sessionArtifacts.js +0 -84
- package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.d.ts +0 -461
- package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.js +0 -803
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-annotations/reducer.d.ts +0 -18
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-annotations/reducer.js +0 -89
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-automation/reducer.d.ts +0 -4
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-automation/reducer.js +0 -37
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-automation-run/reducer.d.ts +0 -4
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-automation-run/reducer.js +0 -45
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-changeset/reducer.d.ts +0 -13
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-changeset/reducer.js +0 -147
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-chat/reducer.d.ts +0 -6
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-chat/reducer.js +0 -544
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-root/reducer.d.ts +0 -6
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-root/reducer.js +0 -30
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-session/reducer.d.ts +0 -6
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-session/reducer.js +0 -430
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-terminal/reducer.d.ts +0 -6
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-terminal/reducer.js +0 -114
- package/vscode/src/vs/platform/agentHost/common/state/protocol/common/reducer-helpers.d.ts +0 -17
- package/vscode/src/vs/platform/agentHost/common/state/protocol/common/reducer-helpers.js +0 -9
- package/vscode/src/vs/platform/agentHost/common/state/protocol/common/timestamps.d.ts +0 -1
- package/vscode/src/vs/platform/agentHost/common/state/protocol/common/timestamps.js +0 -7
- package/vscode/src/vs/platform/agentHost/common/state/protocol/version/registry.d.ts +0 -67
- package/vscode/src/vs/platform/agentHost/common/state/protocol/version/registry.js +0 -117
- package/vscode/src/vs/platform/agentHost/common/state/sessionActions.d.ts +0 -106
- package/vscode/src/vs/platform/agentHost/common/state/sessionActions.js +0 -23
- package/vscode/src/vs/platform/agentHost/common/transportConstants.d.ts +0 -15
- package/vscode/src/vs/platform/agentHost/common/transportConstants.js +0 -6
- package/vscode/src/vs/platform/agentHost/common/worktreePaths.d.ts +0 -24
- package/vscode/src/vs/platform/agentHost/common/worktreePaths.js +0 -15
- package/vscode/src/vs/platform/domWidget/browser/domWidget.d.ts +0 -52
- package/vscode/src/vs/platform/domWidget/browser/domWidget.js +0 -53
- package/vscode/src/vs/platform/networkFilter/common/domainMatcher.d.ts +0 -54
- package/vscode/src/vs/platform/networkFilter/common/domainMatcher.js +0 -210
- package/vscode/src/vs/platform/networkFilter/common/settings.d.ts +0 -8
- package/vscode/src/vs/platform/networkFilter/common/settings.js +0 -10
- package/vscode/src/vs/workbench/browser/chatChangesPill.d.ts +0 -29
- package/vscode/src/vs/workbench/browser/chatChangesPill.js +0 -84
- package/vscode/src/vs/workbench/common/chatPullRequest.d.ts +0 -19
- package/vscode/src/vs/workbench/common/chatPullRequest.js +0 -53
- package/vscode/src/vs/workbench/contrib/chat/browser/agentHostCompletionAction.d.ts +0 -30
- package/vscode/src/vs/workbench/contrib/chat/browser/agentHostCompletionAction.js +0 -37
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginItems.d.ts +0 -30
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginItems.js +0 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostDownloadProgress.d.ts +0 -35
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostDownloadProgress.js +0 -73
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostToolSetEnablementService.d.ts +0 -51
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostToolSetEnablementService.js +0 -167
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/externalSessionsFilterMenu.d.ts +0 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/externalSessionsFilterMenu.js +0 -62
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/sessionSummaryHover.css +0 -104
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/sessionSummaryHover.d.ts +0 -115
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/sessionSummaryHover.js +0 -168
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.d.ts +0 -35
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.js +0 -294
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.d.ts +0 -66
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.js +0 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemSource.d.ts +0 -147
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemSource.js +0 -31
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemsModel.d.ts +0 -83
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemsModel.js +0 -55
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.d.ts +0 -278
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.js +0 -2036
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidgetUtils.d.ts +0 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidgetUtils.js +0 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.d.ts +0 -397
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.js +0 -4127
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.d.ts +0 -37
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.js +0 -93
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementSectionRegistry.d.ts +0 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementSectionRegistry.js +0 -34
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationPresentation.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationPresentation.js +0 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePage.d.ts +0 -57
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePage.js +0 -48
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePagePromptLaunchers.d.ts +0 -40
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePagePromptLaunchers.js +0 -369
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCardList.d.ts +0 -40
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCardList.js +0 -302
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCreatorService.d.ts +0 -70
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCreatorService.js +0 -74
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationGroupHeaderRenderer.d.ts +0 -43
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationGroupHeaderRenderer.js +0 -63
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigration.d.ts +0 -38
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigration.js +0 -240
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationCategories.d.ts +0 -82
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationCategories.js +0 -762
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationDashboard.d.ts +0 -80
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationDashboard.js +0 -279
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedAgentPluginDetail.d.ts +0 -109
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedAgentPluginDetail.js +0 -743
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedExtensionToolsDetail.d.ts +0 -42
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedExtensionToolsDetail.js +0 -130
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedMcpServerDetail.d.ts +0 -62
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedMcpServerDetail.js +0 -217
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/galleryItemRenderer.d.ts +0 -46
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/galleryItemRenderer.js +0 -91
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.d.ts +0 -357
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.js +0 -2656
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationManagement.css +0 -3742
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationWelcomePromptLaunchers.css +0 -301
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/customizationMigrationDashboard.css +0 -354
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.d.ts +0 -197
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.js +0 -2205
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/promptsServiceCustomizationItemProvider.d.ts +0 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/promptsServiceCustomizationItemProvider.js +0 -317
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/toolsListWidget.d.ts +0 -132
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/toolsListWidget.js +0 -1216
- package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPills.d.ts +0 -86
- package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPills.js +0 -282
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.d.ts +0 -118
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.js +0 -540
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.d.ts +0 -82
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.js +0 -1448
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/media/chatModelsWidget.css +0 -329
- package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementPreview.d.ts +0 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementPreview.js +0 -114
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatus.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatus.js +0 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.d.ts +0 -99
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.js +0 -1268
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/media/chatStatus.css +0 -552
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.d.ts +0 -31
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.js +0 -676
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.d.ts +0 -68
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.js +0 -225
- package/vscode/src/vs/workbench/contrib/chat/browser/sessionChatPillOptions.d.ts +0 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/sessionChatPillOptions.js +0 -52
- package/vscode/src/vs/workbench/contrib/chat/browser/sessionPullRequestPill.d.ts +0 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/sessionPullRequestPill.js +0 -58
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceInputUtils.d.ts +0 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceInputUtils.js +0 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletionsBase.d.ts +0 -73
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletionsBase.js +0 -65
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletionUtils.d.ts +0 -31
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletionUtils.js +0 -110
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputPlaceholderDecoration.d.ts +0 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputPlaceholderDecoration.js +0 -28
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputReferenceDecorations.d.ts +0 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputReferenceDecorations.js +0 -16
- package/vscode/src/vs/workbench/contrib/chat/common/automations/automationBlueprint.d.ts +0 -22
- package/vscode/src/vs/workbench/contrib/chat/common/automations/automationBlueprint.js +0 -163
- package/vscode/src/vs/workbench/contrib/chat/common/chatNotification.d.ts +0 -6
- package/vscode/src/vs/workbench/contrib/chat/common/chatNotification.js +0 -12
- package/vscode/src/vs/workbench/contrib/chat/common/customizationHarnessService.d.ts +0 -300
- package/vscode/src/vs/workbench/contrib/chat/common/customizationHarnessService.js +0 -272
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginEnablement.d.ts +0 -25
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginEnablement.js +0 -178
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.d.ts +0 -78
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.js +0 -51
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/fileBackedInstalledPluginsStore.d.ts +0 -67
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/fileBackedInstalledPluginsStore.js +0 -195
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/marketplaceReference.d.ts +0 -67
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/marketplaceReference.js +0 -294
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.d.ts +0 -212
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.js +0 -955
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/strictKnownMarketplaces.d.ts +0 -31
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/strictKnownMarketplaces.js +0 -122
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookClaudeCompat.d.ts +0 -50
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookClaudeCompat.js +0 -78
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCompatibility.d.ts +0 -77
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCompatibility.js +0 -120
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCopilotCliCompat.d.ts +0 -10
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCopilotCliCompat.js +0 -23
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/customizationMigrationService.d.ts +0 -115
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/customizationMigrationService.js +0 -69
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/extensionPromptFileService.d.ts +0 -92
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/extensionPromptFileService.js +0 -335
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.d.ts +0 -235
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.js +0 -1673
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts +0 -202
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +0 -872
- package/vscode/src/vs/workbench/contrib/chat/common/sessionChatPills.d.ts +0 -60
- package/vscode/src/vs/workbench/contrib/chat/common/sessionChatPills.js +0 -139
|
@@ -1,1911 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
-
import { TimeoutTimer, DeferredPromise } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
4
|
-
import { CancellationError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
|
|
5
|
-
import { Emitter, Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
6
|
-
import { Disposable, MutableDisposable, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
7
|
-
import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
|
|
8
|
-
import { hasKey } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
9
|
-
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
10
|
-
import { generateUuid } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uuid';
|
|
11
|
-
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
12
|
-
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
13
|
-
import { toFileSystemProviderErrorCode, FileSystemProviderErrorCode } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files';
|
|
14
|
-
import { ConfigurationTarget, ConfigurationTargetToString } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration';
|
|
15
|
-
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
16
|
-
import { AgentSession } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agent';
|
|
17
|
-
import { AGENT_HOST_DEBUG_LOGS_MAX_ENTRIES, AGENT_HOST_DEBUG_LOGS_CHUNK_BYTES } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agentService';
|
|
18
|
-
import { RemoveSessionArtifactExtensionMethod, CreateAgentHostDetachedWorktreeExtensionMethod, SetAgentHostDetachedWorktreeArchivedExtensionMethod, ClaimAgentHostDetachedWorktreeExtensionMethod, DeleteAgentHostDetachedWorktreeExtensionMethod, ReconcileAgentHostDetachedWorktreesExtensionMethod, supportsAgentHostChatStateFile, GetAgentHostSessionStateFileExtensionMethod, CollectAgentHostDebugLogsExtensionMethod, ReadAgentHostDebugLogsChunkExtensionMethod, RequestAgentHostWorkspaceTrustExtensionMethod } from '../common/agentHostExtensionProtocol.js';
|
|
19
|
-
import { AMBIENT_AGENT_HOST_AUTHORITY } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agentHostConnectionsService';
|
|
20
|
-
import { createRemoteWatchHandle } from '../common/agentHostFileSystemProvider.js';
|
|
21
|
-
import { AgentSubscriptionManager } from '../common/state/agentSubscription.js';
|
|
22
|
-
import { agentHostAuthority, identityAgentHostResourceUriMapper, createAgentHostResourceUriMapper, AGENT_HOST_SCHEME, fromAgentHostUri, toAgentHostUri } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agentHostUri';
|
|
23
|
-
import { LOCAL_AGENT_HOST_RESOURCE_IDENTITY, AgentHostResourcePermissionError } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agentHostResourceService';
|
|
24
|
-
import { IAgentHostResourceService } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agentHostResourceService.service';
|
|
25
|
-
import { ActionType } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/common/actions';
|
|
26
|
-
import '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/common/notifications';
|
|
27
|
-
import { ROOT_STATE_URI, isAhpRootChannel, StateComponents, isDefaultChatUri } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/sessionState';
|
|
28
|
-
import { normalizeLegacyActionEnvelope } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/legacyProtocolCompatibility';
|
|
29
|
-
import { SUPPORTED_PROTOCOL_VERSIONS } from '../common/state/protocol/version/registry.js';
|
|
30
|
-
import { ProtocolError, isJsonRpcRequest, isJsonRpcResponse, isJsonRpcNotification } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/sessionProtocol';
|
|
31
|
-
import { isClientTransport, NonReconnectableTransportError } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/sessionTransport';
|
|
32
|
-
import { AhpErrorCodes, JsonRpcErrorCodes } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/common/errors';
|
|
33
|
-
import { ReconnectResultType, ContentEncoding } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/common/commands';
|
|
34
|
-
import '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-session/commands';
|
|
35
|
-
import { ChatSourceKind } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-chat/commands';
|
|
36
|
-
import '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-changeset/commands';
|
|
37
|
-
import { decodeBase64, encodeBase64 } from '@codingame/monaco-vscode-api/vscode/vs/base/common/buffer';
|
|
38
|
-
import { getExpirationTime, isExpired, getRemainingTimeInSeconds } from '@codingame/monaco-vscode-api/vscode/vs/base/common/date';
|
|
39
|
-
import { LoadEstimator } from '@codingame/monaco-vscode-api/vscode/vs/base/parts/ipc/common/ipc.net';
|
|
40
|
-
import { TELEMETRY_SETTING_ID, TELEMETRY_OLD_SETTING_ID, TELEMETRY_CRASH_REPORTER_SETTING_ID, TelemetryLevel } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry';
|
|
41
|
-
import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
42
|
-
import { getTelemetryLevel } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetryUtils';
|
|
43
|
-
import { GLOBAL_AUTO_APPROVE_SETTING_ID, TERMINAL_AUTO_APPROVE_ENABLED_SETTING_ID, TERMINAL_AUTO_APPROVE_SETTING_ID, TERMINAL_IGNORE_DEFAULT_AUTO_APPROVE_RULES_SETTING_ID, DISABLE_REPO_INFO_TELEMETRY_SETTING_ID, AgentHostAutoApprovePolicyRestrictedConfigKey, AgentHostWorkspaceTrustConfigKey, AgentHostTelemetryLevelConfigKey, telemetryLevelToAgentHostConfigValue, AgentHostDisableRepoInfoTelemetryConfigKey, AgentHostTerminalAutoApproveEnabledConfigKey, AgentHostTerminalAutoApproveRulesConfigKey, getAgentHostTerminalAutoApproveRulesConfig } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agentHostSchema';
|
|
44
|
-
import { getAgentHostConfigurationSyncEntries, getAgentHostConfigurationSyncTarget, resolveAgentHostConfigurationSyncValue, formatAgentHostConfigurationSyncValueForLog, resolveAgentHostConfigurationSyncPatch } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agentHostConfigurationSync';
|
|
45
|
-
import { managedPermissionsConfigurationIds, resolveManagedSettingsPermissions } from '../common/agentHostManagedSettings.js';
|
|
46
|
-
import { toAgentHostClientMeta, AgentHostClientConnectionKind } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agentHostTelemetry';
|
|
47
|
-
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
48
|
-
import { isFileResourceRead } from '../common/resourceReadLogging.js';
|
|
49
|
-
import { ResourceSet } from '@codingame/monaco-vscode-api/vscode/vs/base/common/map';
|
|
50
|
-
import { DEFAULT_RECONNECT_POLICY, hasExhaustedReconnectAttempts, computeReconnectDelay } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/reconnectPolicy';
|
|
51
|
-
import { IWorkspaceTrustEnablementService, IWorkspaceTrustManagementService, IWorkspaceTrustRequestService } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspaceTrust.service';
|
|
52
|
-
import { isWorktreeUnderRepository } from '../common/worktreePaths.js';
|
|
53
|
-
import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableValue';
|
|
54
|
-
import { MessageAttachmentKind } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-chat/state';
|
|
55
|
-
|
|
56
|
-
const AHP_CLIENT_CONNECTION_CLOSED = -32e3;
|
|
57
|
-
const CLIENT_SUPPORTED_PROTOCOL_VERSIONS = SUPPORTED_PROTOCOL_VERSIONS.filter(version => version !== "0.8.0");
|
|
58
|
-
const PING_INTERVAL_MS = 5_000;
|
|
59
|
-
const LIVENESS_TIMEOUT_MS = 20_000;
|
|
60
|
-
function connectionTimeoutError(address, silenceMs) {
|
|
61
|
-
return ( new ProtocolError(
|
|
62
|
-
AHP_CLIENT_CONNECTION_CLOSED,
|
|
63
|
-
`Connection appears dead: ${address}; no message received for ${silenceMs}ms.`
|
|
64
|
-
));
|
|
65
|
-
}
|
|
66
|
-
function connectionClosedError(address) {
|
|
67
|
-
return ( new ProtocolError(AHP_CLIENT_CONNECTION_CLOSED, `Connection closed: ${address}`));
|
|
68
|
-
}
|
|
69
|
-
function connectionDisposedError(address) {
|
|
70
|
-
return ( new ProtocolError(AHP_CLIENT_CONNECTION_CLOSED, `Connection disposed: ${address}`));
|
|
71
|
-
}
|
|
72
|
-
function transportLostError(address) {
|
|
73
|
-
return ( new ProtocolError(AHP_CLIENT_CONNECTION_CLOSED, `Transport lost (reconnecting): ${address}`));
|
|
74
|
-
}
|
|
75
|
-
function isConnectionClosedError(error) {
|
|
76
|
-
return error instanceof ProtocolError && error.code === AHP_CLIENT_CONNECTION_CLOSED;
|
|
77
|
-
}
|
|
78
|
-
var AgentHostClientState;
|
|
79
|
-
(function(AgentHostClientState) {
|
|
80
|
-
AgentHostClientState["Connecting"] = "connecting";
|
|
81
|
-
AgentHostClientState["Incompatible"] = "incompatible";
|
|
82
|
-
AgentHostClientState["Connected"] = "connected";
|
|
83
|
-
AgentHostClientState["Reconnecting"] = "reconnecting";
|
|
84
|
-
AgentHostClientState["Closed"] = "closed";
|
|
85
|
-
})(AgentHostClientState || (AgentHostClientState = {}));
|
|
86
|
-
class InitialAuthenticationError extends Error {
|
|
87
|
-
constructor(error) {
|
|
88
|
-
super(
|
|
89
|
-
`Initial authentication failed: ${error instanceof Error ? error.message : String(error)}`
|
|
90
|
-
);
|
|
91
|
-
this.name = "InitialAuthenticationError";
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
let AgentHostProtocolClient = class AgentHostProtocolClient extends Disposable {
|
|
95
|
-
get clientId() {
|
|
96
|
-
return this._clientId;
|
|
97
|
-
}
|
|
98
|
-
get address() {
|
|
99
|
-
return this._address;
|
|
100
|
-
}
|
|
101
|
-
get defaultDirectory() {
|
|
102
|
-
return this._defaultDirectory;
|
|
103
|
-
}
|
|
104
|
-
get connectionState() {
|
|
105
|
-
return this._state.kind;
|
|
106
|
-
}
|
|
107
|
-
get nextReconnectAt() {
|
|
108
|
-
return this._state.kind === AgentHostClientState.Reconnecting ? this._state.reconnect.nextAttemptAt : undefined;
|
|
109
|
-
}
|
|
110
|
-
get initializeResult() {
|
|
111
|
-
return this._initializeResult;
|
|
112
|
-
}
|
|
113
|
-
constructor(
|
|
114
|
-
identity,
|
|
115
|
-
transportOrFactory,
|
|
116
|
-
options,
|
|
117
|
-
_logService,
|
|
118
|
-
_resourceService,
|
|
119
|
-
_configurationService,
|
|
120
|
-
_telemetryService,
|
|
121
|
-
_workspaceTrustEnablementService,
|
|
122
|
-
_workspaceTrustManagementService,
|
|
123
|
-
_workspaceTrustRequestService
|
|
124
|
-
) {
|
|
125
|
-
super();
|
|
126
|
-
this._logService = _logService;
|
|
127
|
-
this._resourceService = _resourceService;
|
|
128
|
-
this._configurationService = _configurationService;
|
|
129
|
-
this._telemetryService = _telemetryService;
|
|
130
|
-
this._workspaceTrustEnablementService = _workspaceTrustEnablementService;
|
|
131
|
-
this._workspaceTrustManagementService = _workspaceTrustManagementService;
|
|
132
|
-
this._workspaceTrustRequestService = _workspaceTrustRequestService;
|
|
133
|
-
this._transportListeners = this._register(( new MutableDisposable()));
|
|
134
|
-
this._serverSeq = 0;
|
|
135
|
-
this._nextClientSeq = 1;
|
|
136
|
-
this._initializeResult = observableValue("agentHostInitializeResult", undefined);
|
|
137
|
-
this._onDidAction = this._register(( new Emitter()));
|
|
138
|
-
this.onDidAction = this._onDidAction.event;
|
|
139
|
-
this._onDidNotification = this._register(( new Emitter()));
|
|
140
|
-
this.onDidNotification = this._onDidNotification.event;
|
|
141
|
-
this._onMcpNotification = this._register(( new Emitter()));
|
|
142
|
-
this.onMcpNotification = this._onMcpNotification.event;
|
|
143
|
-
this._onDidReceiveOtlpLogs = this._register(( new Emitter()));
|
|
144
|
-
this.onDidReceiveOtlpLogs = this._onDidReceiveOtlpLogs.event;
|
|
145
|
-
this._onDidClose = this._register(( new Emitter()));
|
|
146
|
-
this.onDidClose = this._onDidClose.event;
|
|
147
|
-
this._onDidFatalClose = this._register(( new Emitter()));
|
|
148
|
-
this.onDidFatalClose = this._onDidFatalClose.event;
|
|
149
|
-
this._onDidChangeConnectionState = this._register(( new Emitter()));
|
|
150
|
-
this.onDidChangeConnectionState = this._onDidChangeConnectionState.event;
|
|
151
|
-
this._onDidScheduleReconnect = this._register(( new Emitter()));
|
|
152
|
-
this.onDidScheduleReconnect = this._onDidScheduleReconnect.event;
|
|
153
|
-
this._state = {
|
|
154
|
-
kind: AgentHostClientState.Connecting,
|
|
155
|
-
outbox: []
|
|
156
|
-
};
|
|
157
|
-
this._pendingRequests = ( new Map());
|
|
158
|
-
this._authentication = ( new Map());
|
|
159
|
-
this._nextRequestId = 1;
|
|
160
|
-
this._pendingReverseRequests = ( new WeakMap());
|
|
161
|
-
this._livenessDeferred = false;
|
|
162
|
-
this._subscriptionsAwaitingRestore = ( new Set());
|
|
163
|
-
this._authenticationRestorePending = false;
|
|
164
|
-
this._lastReadTime = Date.now();
|
|
165
|
-
this._pingTimer = this._register(new TimeoutTimer());
|
|
166
|
-
this._closeTimer = this._register(new TimeoutTimer());
|
|
167
|
-
this._grantedImplicitReadUris = ( new ResourceSet());
|
|
168
|
-
this._implicitReadGrants = this._register(( new DisposableStore()));
|
|
169
|
-
this._resourceIdentity = identity;
|
|
170
|
-
this._address = identity === LOCAL_AGENT_HOST_RESOURCE_IDENTITY ? AMBIENT_AGENT_HOST_AUTHORITY : identity;
|
|
171
|
-
this._clientId = options?.clientId ?? generateUuid();
|
|
172
|
-
this._connectionAuthority = identity === LOCAL_AGENT_HOST_RESOURCE_IDENTITY ? AMBIENT_AGENT_HOST_AUTHORITY : agentHostAuthority(identity);
|
|
173
|
-
this.resourceUris = identity === LOCAL_AGENT_HOST_RESOURCE_IDENTITY ? identityAgentHostResourceUriMapper : createAgentHostResourceUriMapper(this._connectionAuthority);
|
|
174
|
-
this._loadEstimator = options?.loadEstimator ?? LoadEstimator.getInstance();
|
|
175
|
-
this._clientInfo = options?.clientInfo;
|
|
176
|
-
this._reconnectPolicy = options?.reconnectPolicy ?? DEFAULT_RECONNECT_POLICY;
|
|
177
|
-
this._resolveInitialAuthentication = options?.resolveInitialAuthentication;
|
|
178
|
-
if (typeof transportOrFactory === "function") {
|
|
179
|
-
this._transportFactory = transportOrFactory;
|
|
180
|
-
this._installTransport(transportOrFactory());
|
|
181
|
-
} else {
|
|
182
|
-
this._transportFactory = undefined;
|
|
183
|
-
this._installTransport(transportOrFactory);
|
|
184
|
-
}
|
|
185
|
-
this._subscriptionManager = this._register(( new AgentSubscriptionManager(
|
|
186
|
-
this._clientId,
|
|
187
|
-
() => this.nextClientSeq(),
|
|
188
|
-
msg => this._logService.warn(`[AgentHostProtocolClient] ${msg}`),
|
|
189
|
-
resource => this.subscribe(resource),
|
|
190
|
-
resource => this.unsubscribe(resource)
|
|
191
|
-
)));
|
|
192
|
-
this._register(this.onDidAction(envelope => {
|
|
193
|
-
this._subscriptionManager.receiveEnvelope(envelope);
|
|
194
|
-
}));
|
|
195
|
-
this._register(this._configurationService.onDidChangeConfiguration(e => {
|
|
196
|
-
if (this._state.kind !== AgentHostClientState.Connected) {
|
|
197
|
-
return;
|
|
198
|
-
}
|
|
199
|
-
const patch = {};
|
|
200
|
-
const mirrored = [];
|
|
201
|
-
if (e.source !== ConfigurationTarget.WORKSPACE && e.source !== ConfigurationTarget.WORKSPACE_FOLDER && e.source !== ConfigurationTarget.MEMORY) {
|
|
202
|
-
for (const entry of getAgentHostConfigurationSyncEntries(getAgentHostConfigurationSyncTarget(this._resourceIdentity))) {
|
|
203
|
-
if (!e.affectsConfiguration(entry.settingId)) {
|
|
204
|
-
continue;
|
|
205
|
-
}
|
|
206
|
-
const value = resolveAgentHostConfigurationSyncValue(this._configurationService, entry);
|
|
207
|
-
if (value !== undefined) {
|
|
208
|
-
patch[entry.sync.key] = value;
|
|
209
|
-
mirrored.push(
|
|
210
|
-
`${entry.sync.key}=${formatAgentHostConfigurationSyncValueForLog(entry.settingId, value)} (${entry.settingId})`
|
|
211
|
-
);
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
if (( Object.keys(patch)).length) {
|
|
216
|
-
this._logService.info(
|
|
217
|
-
`[RemoteAgentHostProtocol] Mirroring configuration to host root config from ${ConfigurationTargetToString(e.source)}: ${mirrored.join(", ")}`
|
|
218
|
-
);
|
|
219
|
-
this._dispatchRootConfig(patch);
|
|
220
|
-
}
|
|
221
|
-
if (e.affectsConfiguration(GLOBAL_AUTO_APPROVE_SETTING_ID)) {
|
|
222
|
-
this._updateAutoApprovePolicyRestriction();
|
|
223
|
-
}
|
|
224
|
-
if (e.affectsConfiguration(TELEMETRY_SETTING_ID) || e.affectsConfiguration(TELEMETRY_OLD_SETTING_ID) || e.affectsConfiguration(TELEMETRY_CRASH_REPORTER_SETTING_ID)) {
|
|
225
|
-
this._updateTelemetryLevel();
|
|
226
|
-
}
|
|
227
|
-
if (e.affectsConfiguration(TERMINAL_AUTO_APPROVE_ENABLED_SETTING_ID)) {
|
|
228
|
-
this._updateTerminalAutoApproveEnabled();
|
|
229
|
-
}
|
|
230
|
-
if (e.affectsConfiguration(TERMINAL_AUTO_APPROVE_SETTING_ID) || e.affectsConfiguration(TERMINAL_IGNORE_DEFAULT_AUTO_APPROVE_RULES_SETTING_ID)) {
|
|
231
|
-
this._updateTerminalAutoApproveRules();
|
|
232
|
-
}
|
|
233
|
-
if (e.affectsConfiguration(DISABLE_REPO_INFO_TELEMETRY_SETTING_ID)) {
|
|
234
|
-
this._updateDisableRepoInfoTelemetry();
|
|
235
|
-
}
|
|
236
|
-
if (( managedPermissionsConfigurationIds.some(settingId => e.affectsConfiguration(settingId)))) {
|
|
237
|
-
void this._updateManagedSettingsPermissions();
|
|
238
|
-
}
|
|
239
|
-
}));
|
|
240
|
-
this._register(Event.any(
|
|
241
|
-
this._workspaceTrustManagementService.onDidChangeTrustedFolders,
|
|
242
|
-
this._workspaceTrustManagementService.onDidChangeTrust
|
|
243
|
-
)(() => {
|
|
244
|
-
if (this._state.kind === AgentHostClientState.Connected) {
|
|
245
|
-
this._updateWorkspaceTrust();
|
|
246
|
-
}
|
|
247
|
-
}));
|
|
248
|
-
if (!isClientTransport(this._transport)) {
|
|
249
|
-
this._resetLivenessTimers();
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
_installTransport(transport) {
|
|
253
|
-
const listeners = ( new DisposableStore());
|
|
254
|
-
listeners.add(transport);
|
|
255
|
-
listeners.add(transport.onMessage(msg => this._handleMessage(msg)));
|
|
256
|
-
listeners.add(transport.onClose(() => this._handleTransportClose()));
|
|
257
|
-
this._transport = transport;
|
|
258
|
-
this._transportListeners.value = listeners;
|
|
259
|
-
}
|
|
260
|
-
_transitionTo(next) {
|
|
261
|
-
if (this._state.kind === next.kind) {
|
|
262
|
-
return;
|
|
263
|
-
}
|
|
264
|
-
if (this._state.kind === AgentHostClientState.Reconnecting) {
|
|
265
|
-
const reconnect = this._state.reconnect;
|
|
266
|
-
if (reconnect.timeoutHandle !== undefined) {
|
|
267
|
-
clearTimeout(reconnect.timeoutHandle);
|
|
268
|
-
reconnect.timeoutHandle = undefined;
|
|
269
|
-
}
|
|
270
|
-
reconnect.nextAttemptAt = undefined;
|
|
271
|
-
}
|
|
272
|
-
this._state = next;
|
|
273
|
-
this._onDidChangeConnectionState.fire(next.kind);
|
|
274
|
-
}
|
|
275
|
-
_newReconnectGate() {
|
|
276
|
-
const deferred = ( new DeferredPromise());
|
|
277
|
-
deferred.p.then(undefined, () => {});
|
|
278
|
-
return deferred;
|
|
279
|
-
}
|
|
280
|
-
_newReconnectState() {
|
|
281
|
-
return {
|
|
282
|
-
gate: this._newReconnectGate(),
|
|
283
|
-
outbox: [],
|
|
284
|
-
attempt: 0,
|
|
285
|
-
timeoutHandle: undefined,
|
|
286
|
-
nextAttemptAt: undefined
|
|
287
|
-
};
|
|
288
|
-
}
|
|
289
|
-
dispose() {
|
|
290
|
-
this._handleClose(connectionDisposedError(this._address));
|
|
291
|
-
super.dispose();
|
|
292
|
-
}
|
|
293
|
-
async connect() {
|
|
294
|
-
try {
|
|
295
|
-
if (isClientTransport(this._transport)) {
|
|
296
|
-
await this._raceClose(this._transport.connect());
|
|
297
|
-
}
|
|
298
|
-
if (this._state.kind !== AgentHostClientState.Connecting) {
|
|
299
|
-
throw transportLostError(this._address);
|
|
300
|
-
}
|
|
301
|
-
const result = await this._dispatchRequest("initialize", {
|
|
302
|
-
channel: ROOT_STATE_URI,
|
|
303
|
-
protocolVersions: [...CLIENT_SUPPORTED_PROTOCOL_VERSIONS],
|
|
304
|
-
clientId: this._clientId,
|
|
305
|
-
clientInfo: this._clientInfo,
|
|
306
|
-
_meta: this._clientMeta(),
|
|
307
|
-
initialSubscriptions: [ROOT_STATE_URI]
|
|
308
|
-
}, {
|
|
309
|
-
bypassInitializeQueue: true
|
|
310
|
-
});
|
|
311
|
-
this._applyInitializeResult(result);
|
|
312
|
-
if (this._resolveInitialAuthentication || this._authentication.size > 0) {
|
|
313
|
-
await this._restoreAuthenticationAfterFreshInitialize(AgentHostClientState.Connecting);
|
|
314
|
-
if (this._state.kind !== AgentHostClientState.Connecting) {
|
|
315
|
-
throw transportLostError(this._address);
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
for (const snapshot of result.snapshots ?? []) {
|
|
319
|
-
if (isAhpRootChannel(snapshot.resource)) {
|
|
320
|
-
this._subscriptionManager.handleRootSnapshot(snapshot.state, snapshot.fromSeq);
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
if (isClientTransport(this._transport) && this._state.kind === AgentHostClientState.Connecting) {
|
|
324
|
-
for (const message of this._state.outbox) {
|
|
325
|
-
this._transport.send(message);
|
|
326
|
-
}
|
|
327
|
-
this._state.outbox.length = 0;
|
|
328
|
-
}
|
|
329
|
-
this._transitionTo({
|
|
330
|
-
kind: AgentHostClientState.Connected
|
|
331
|
-
});
|
|
332
|
-
this._resetLivenessTimers();
|
|
333
|
-
} catch (error) {
|
|
334
|
-
const protocolError = error instanceof ProtocolError ? error : ( new ProtocolError(
|
|
335
|
-
AHP_CLIENT_CONNECTION_CLOSED,
|
|
336
|
-
error instanceof Error ? error.message : String(error)
|
|
337
|
-
));
|
|
338
|
-
if (protocolError.code === AhpErrorCodes.UnsupportedProtocolVersion || error instanceof InitialAuthenticationError) {
|
|
339
|
-
this._cancelLivenessTimers();
|
|
340
|
-
if (this._state.kind === AgentHostClientState.Connecting) {
|
|
341
|
-
this._state.outbox.length = 0;
|
|
342
|
-
}
|
|
343
|
-
this._rejectPendingRequests(protocolError);
|
|
344
|
-
this._transitionTo({
|
|
345
|
-
kind: AgentHostClientState.Incompatible,
|
|
346
|
-
error: protocolError
|
|
347
|
-
});
|
|
348
|
-
throw error;
|
|
349
|
-
}
|
|
350
|
-
if (error instanceof NonReconnectableTransportError) {
|
|
351
|
-
this._handleFatalClose(protocolError, error.reason);
|
|
352
|
-
throw error;
|
|
353
|
-
}
|
|
354
|
-
if (this._state.kind === AgentHostClientState.Reconnecting) {
|
|
355
|
-
throw error;
|
|
356
|
-
}
|
|
357
|
-
if (protocolError.code === AHP_CLIENT_CONNECTION_CLOSED && this._beginReconnectFromConnecting(protocolError)) {
|
|
358
|
-
throw error;
|
|
359
|
-
}
|
|
360
|
-
this._handleClose(protocolError);
|
|
361
|
-
throw error;
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
notifyTransportClosed() {
|
|
365
|
-
this._handleTransportClose();
|
|
366
|
-
}
|
|
367
|
-
_handleTransportClose() {
|
|
368
|
-
switch (this._state.kind) {
|
|
369
|
-
case AgentHostClientState.Closed:
|
|
370
|
-
return;
|
|
371
|
-
case AgentHostClientState.Connecting:
|
|
372
|
-
if (!this._beginReconnectFromConnecting(connectionClosedError(this._address))) {
|
|
373
|
-
this._handleClose(connectionClosedError(this._address));
|
|
374
|
-
}
|
|
375
|
-
return;
|
|
376
|
-
case AgentHostClientState.Incompatible:
|
|
377
|
-
this._handleClose(connectionClosedError(this._address));
|
|
378
|
-
return;
|
|
379
|
-
case AgentHostClientState.Connected:
|
|
380
|
-
{
|
|
381
|
-
if (!this._transportFactory) {
|
|
382
|
-
this._handleClose(connectionClosedError(this._address));
|
|
383
|
-
return;
|
|
384
|
-
}
|
|
385
|
-
if (!this._reconnectPolicy.autoRestore) {
|
|
386
|
-
const error = connectionClosedError(this._address);
|
|
387
|
-
this._logService.info(
|
|
388
|
-
`[RemoteAgentHostProtocol] Transport lost for ${this._address}; automatic reconnect is disabled.`
|
|
389
|
-
);
|
|
390
|
-
this._handleFatalClose(error);
|
|
391
|
-
return;
|
|
392
|
-
}
|
|
393
|
-
this._logService.info(
|
|
394
|
-
`[RemoteAgentHostProtocol] Transport lost for ${this._address}; scheduling reconnect.`
|
|
395
|
-
);
|
|
396
|
-
this._transitionTo({
|
|
397
|
-
kind: AgentHostClientState.Reconnecting,
|
|
398
|
-
reconnect: this._newReconnectState()
|
|
399
|
-
});
|
|
400
|
-
this._cancelLivenessTimers();
|
|
401
|
-
this._rejectPendingRequests(transportLostError(this._address));
|
|
402
|
-
this._scheduleReconnect();
|
|
403
|
-
return;
|
|
404
|
-
}
|
|
405
|
-
case AgentHostClientState.Reconnecting:
|
|
406
|
-
this._logService.info(
|
|
407
|
-
`[RemoteAgentHostProtocol] Transport lost for ${this._address} mid-reconnect; aborting the current attempt.`
|
|
408
|
-
);
|
|
409
|
-
this._cancelLivenessTimers();
|
|
410
|
-
this._rejectPendingRequests(transportLostError(this._address));
|
|
411
|
-
return;
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
_beginReconnectFromConnecting(error) {
|
|
415
|
-
if (this._state.kind !== AgentHostClientState.Connecting || !this._transportFactory) {
|
|
416
|
-
return false;
|
|
417
|
-
}
|
|
418
|
-
if (!this._reconnectPolicy.autoRestore) {
|
|
419
|
-
this._logService.info(
|
|
420
|
-
`[RemoteAgentHostProtocol] Transport lost while connecting to ${this._address}; automatic reconnect is disabled.`
|
|
421
|
-
);
|
|
422
|
-
this._handleFatalClose(error);
|
|
423
|
-
return true;
|
|
424
|
-
}
|
|
425
|
-
this._logService.info(
|
|
426
|
-
`[RemoteAgentHostProtocol] Transport lost while connecting to ${this._address}; scheduling a fresh initialize.`
|
|
427
|
-
);
|
|
428
|
-
const outbox = this._state.outbox;
|
|
429
|
-
this._rejectPendingRequests(error);
|
|
430
|
-
this._grantedImplicitReadUris.clear();
|
|
431
|
-
this._implicitReadGrants.clear();
|
|
432
|
-
this._transitionTo({
|
|
433
|
-
kind: AgentHostClientState.Reconnecting,
|
|
434
|
-
reconnect: {
|
|
435
|
-
...this._newReconnectState(),
|
|
436
|
-
outbox
|
|
437
|
-
}
|
|
438
|
-
});
|
|
439
|
-
this._cancelLivenessTimers();
|
|
440
|
-
this._scheduleReconnect();
|
|
441
|
-
return true;
|
|
442
|
-
}
|
|
443
|
-
reconnectFromClosed() {
|
|
444
|
-
if (this._state.kind !== AgentHostClientState.Closed || !this._transportFactory || this._store.isDisposed) {
|
|
445
|
-
return false;
|
|
446
|
-
}
|
|
447
|
-
this._transitionTo({
|
|
448
|
-
kind: AgentHostClientState.Reconnecting,
|
|
449
|
-
reconnect: this._newReconnectState()
|
|
450
|
-
});
|
|
451
|
-
this._scheduleReconnect(true);
|
|
452
|
-
return true;
|
|
453
|
-
}
|
|
454
|
-
reconnectNow() {
|
|
455
|
-
if (this._state.kind !== AgentHostClientState.Reconnecting || this._state.reconnect.timeoutHandle === undefined) {
|
|
456
|
-
return false;
|
|
457
|
-
}
|
|
458
|
-
const reconnect = this._state.reconnect;
|
|
459
|
-
clearTimeout(reconnect.timeoutHandle);
|
|
460
|
-
reconnect.timeoutHandle = undefined;
|
|
461
|
-
reconnect.nextAttemptAt = undefined;
|
|
462
|
-
reconnect.attempt = 0;
|
|
463
|
-
this._onDidScheduleReconnect.fire();
|
|
464
|
-
void this._attemptReconnect();
|
|
465
|
-
return true;
|
|
466
|
-
}
|
|
467
|
-
_scheduleReconnect(userInitiated = false) {
|
|
468
|
-
if (this._state.kind !== AgentHostClientState.Reconnecting || !this._transportFactory) {
|
|
469
|
-
return;
|
|
470
|
-
}
|
|
471
|
-
const reconnect = this._state.reconnect;
|
|
472
|
-
if (reconnect.timeoutHandle !== undefined) {
|
|
473
|
-
return;
|
|
474
|
-
}
|
|
475
|
-
if (!userInitiated && !this._reconnectPolicy.autoRestore) {
|
|
476
|
-
const error = connectionClosedError(this._address);
|
|
477
|
-
this._logService.info(
|
|
478
|
-
`[RemoteAgentHostProtocol] Automatic reconnect to ${this._address} is disabled.`
|
|
479
|
-
);
|
|
480
|
-
this._handleFatalClose(error);
|
|
481
|
-
return;
|
|
482
|
-
}
|
|
483
|
-
if (!userInitiated && hasExhaustedReconnectAttempts(this._reconnectPolicy, reconnect.attempt)) {
|
|
484
|
-
const error = ( new ProtocolError(
|
|
485
|
-
AHP_CLIENT_CONNECTION_CLOSED,
|
|
486
|
-
`Automatic reconnect gave up after ${reconnect.attempt} attempts.`
|
|
487
|
-
));
|
|
488
|
-
this._logService.warn(
|
|
489
|
-
`[RemoteAgentHostProtocol] Automatic reconnect to ${this._address} gave up after ${reconnect.attempt} attempts.`
|
|
490
|
-
);
|
|
491
|
-
this._handleFatalClose(error);
|
|
492
|
-
return;
|
|
493
|
-
}
|
|
494
|
-
const attempt = reconnect.attempt + 1;
|
|
495
|
-
const delay = computeReconnectDelay(this._reconnectPolicy, attempt);
|
|
496
|
-
this._logService.info(
|
|
497
|
-
`[RemoteAgentHostProtocol] Reconnecting to ${this._address} in ${delay}ms (attempt ${attempt}).`
|
|
498
|
-
);
|
|
499
|
-
reconnect.nextAttemptAt = Date.now() + delay;
|
|
500
|
-
reconnect.timeoutHandle = setTimeout(() => {
|
|
501
|
-
if (this._state.kind === AgentHostClientState.Reconnecting) {
|
|
502
|
-
this._state.reconnect.timeoutHandle = undefined;
|
|
503
|
-
this._state.reconnect.nextAttemptAt = undefined;
|
|
504
|
-
}
|
|
505
|
-
void this._attemptReconnect();
|
|
506
|
-
}, delay);
|
|
507
|
-
this._onDidScheduleReconnect.fire();
|
|
508
|
-
}
|
|
509
|
-
async _attemptReconnect() {
|
|
510
|
-
if (this._state.kind !== AgentHostClientState.Reconnecting || !this._transportFactory) {
|
|
511
|
-
return;
|
|
512
|
-
}
|
|
513
|
-
const reconnect = this._state.reconnect;
|
|
514
|
-
reconnect.attempt++;
|
|
515
|
-
let transport;
|
|
516
|
-
try {
|
|
517
|
-
transport = this._transportFactory();
|
|
518
|
-
this._installTransport(transport);
|
|
519
|
-
if (isClientTransport(transport)) {
|
|
520
|
-
await transport.connect();
|
|
521
|
-
}
|
|
522
|
-
if (this._state.kind !== AgentHostClientState.Reconnecting) {
|
|
523
|
-
return;
|
|
524
|
-
}
|
|
525
|
-
const subscriptions = ( this._subscriptionManager.currentSubscriptionUris().map(u => ( u.toString())));
|
|
526
|
-
if (!subscriptions.includes(ROOT_STATE_URI)) {
|
|
527
|
-
subscriptions.unshift(ROOT_STATE_URI);
|
|
528
|
-
}
|
|
529
|
-
const lastSeenServerSeq = this._serverSeq;
|
|
530
|
-
const {
|
|
531
|
-
result,
|
|
532
|
-
freshInitialize
|
|
533
|
-
} = await this._reconnectOrInitialize(lastSeenServerSeq, subscriptions);
|
|
534
|
-
if (this._state.kind !== AgentHostClientState.Reconnecting) {
|
|
535
|
-
return;
|
|
536
|
-
}
|
|
537
|
-
this._applyReconnectResult(result, freshInitialize);
|
|
538
|
-
this._updateManagedSettingsPermissions(true);
|
|
539
|
-
if ((freshInitialize && result.type === ReconnectResultType.Snapshot) || this._authenticationRestorePending) {
|
|
540
|
-
if (freshInitialize && result.type === ReconnectResultType.Snapshot) {
|
|
541
|
-
this._markSubscriptionsAwaitingRestore(result.snapshots);
|
|
542
|
-
}
|
|
543
|
-
await this._restoreAuthenticationAfterFreshInitialize(AgentHostClientState.Reconnecting);
|
|
544
|
-
if (this._state.kind !== AgentHostClientState.Reconnecting) {
|
|
545
|
-
return;
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
if (this._subscriptionsAwaitingRestore.size > 0) {
|
|
549
|
-
await this._restoreSubscriptionsAwaitingRestore();
|
|
550
|
-
if (this._state.kind !== AgentHostClientState.Reconnecting) {
|
|
551
|
-
return;
|
|
552
|
-
}
|
|
553
|
-
}
|
|
554
|
-
this._forwardClientConfig(false);
|
|
555
|
-
const {
|
|
556
|
-
gate
|
|
557
|
-
} = reconnect;
|
|
558
|
-
this._drainAfterReconnect(reconnect.outbox);
|
|
559
|
-
this._lastReadTime = Date.now();
|
|
560
|
-
this._resetLivenessTimers();
|
|
561
|
-
this._transitionTo({
|
|
562
|
-
kind: AgentHostClientState.Connected
|
|
563
|
-
});
|
|
564
|
-
gate.complete();
|
|
565
|
-
this._logService.info(`[RemoteAgentHostProtocol] Reconnected to ${this._address}.`);
|
|
566
|
-
} catch (err) {
|
|
567
|
-
this._logService.warn(
|
|
568
|
-
`[RemoteAgentHostProtocol] Reconnect attempt failed for ${this._address}: ${err instanceof Error ? err.message : String(err)}`
|
|
569
|
-
);
|
|
570
|
-
transport?.dispose();
|
|
571
|
-
if (this._state.kind !== AgentHostClientState.Reconnecting) {
|
|
572
|
-
return;
|
|
573
|
-
}
|
|
574
|
-
if (err instanceof NonReconnectableTransportError) {
|
|
575
|
-
const protocolError = ( new ProtocolError(AHP_CLIENT_CONNECTION_CLOSED, err.message));
|
|
576
|
-
this._handleFatalClose(protocolError, err.reason);
|
|
577
|
-
return;
|
|
578
|
-
}
|
|
579
|
-
if (err instanceof InitialAuthenticationError) {
|
|
580
|
-
const protocolError = ( new ProtocolError(AHP_CLIENT_CONNECTION_CLOSED, err.message));
|
|
581
|
-
this._cancelLivenessTimers();
|
|
582
|
-
this._rejectPendingRequests(protocolError);
|
|
583
|
-
reconnect.gate.error(err);
|
|
584
|
-
this._transitionTo({
|
|
585
|
-
kind: AgentHostClientState.Incompatible,
|
|
586
|
-
error: protocolError
|
|
587
|
-
});
|
|
588
|
-
return;
|
|
589
|
-
}
|
|
590
|
-
const oldGate = this._state.reconnect.gate;
|
|
591
|
-
this._state.reconnect.gate = this._newReconnectGate();
|
|
592
|
-
oldGate.error(err);
|
|
593
|
-
this._scheduleReconnect();
|
|
594
|
-
}
|
|
595
|
-
}
|
|
596
|
-
async _reconnectOrInitialize(lastSeenServerSeq, subscriptions) {
|
|
597
|
-
try {
|
|
598
|
-
const result = await this._dispatchRequest("reconnect", {
|
|
599
|
-
clientId: this._clientId,
|
|
600
|
-
lastSeenServerSeq,
|
|
601
|
-
subscriptions,
|
|
602
|
-
_meta: this._clientMeta()
|
|
603
|
-
}, {
|
|
604
|
-
bypassReconnectGate: true
|
|
605
|
-
});
|
|
606
|
-
return {
|
|
607
|
-
result,
|
|
608
|
-
freshInitialize: false
|
|
609
|
-
};
|
|
610
|
-
} catch (error) {
|
|
611
|
-
if (!(error instanceof ProtocolError) || error.code !== AhpErrorCodes.NotFound) {
|
|
612
|
-
throw error;
|
|
613
|
-
}
|
|
614
|
-
}
|
|
615
|
-
this._logService.info(
|
|
616
|
-
`[RemoteAgentHostProtocol] Server forgot client ${this._clientId}; initializing a fresh connection.`
|
|
617
|
-
);
|
|
618
|
-
const initializeResult = await this._dispatchRequest("initialize", {
|
|
619
|
-
channel: ROOT_STATE_URI,
|
|
620
|
-
protocolVersions: [...CLIENT_SUPPORTED_PROTOCOL_VERSIONS],
|
|
621
|
-
clientId: this._clientId,
|
|
622
|
-
clientInfo: this._clientInfo,
|
|
623
|
-
_meta: this._clientMeta(),
|
|
624
|
-
initialSubscriptions: subscriptions
|
|
625
|
-
}, {
|
|
626
|
-
bypassReconnectGate: true
|
|
627
|
-
});
|
|
628
|
-
this._applyInitializeResult(initializeResult, false);
|
|
629
|
-
return {
|
|
630
|
-
result: {
|
|
631
|
-
type: ReconnectResultType.Snapshot,
|
|
632
|
-
snapshots: initializeResult.snapshots ?? []
|
|
633
|
-
},
|
|
634
|
-
freshInitialize: true
|
|
635
|
-
};
|
|
636
|
-
}
|
|
637
|
-
_markSubscriptionsAwaitingRestore(initialSnapshots) {
|
|
638
|
-
const restored = ( new Set(( initialSnapshots.map(snapshot => snapshot.resource))));
|
|
639
|
-
this._subscriptionsAwaitingRestore.clear();
|
|
640
|
-
for (const subscription of this._subscriptionManager.getActiveSubscriptions()) {
|
|
641
|
-
const resource = ( subscription.resource.toString());
|
|
642
|
-
if (!( restored.has(resource))) {
|
|
643
|
-
this._subscriptionsAwaitingRestore.add(resource);
|
|
644
|
-
}
|
|
645
|
-
}
|
|
646
|
-
}
|
|
647
|
-
async _restoreSubscriptionsAwaitingRestore() {
|
|
648
|
-
if (this._subscriptionsAwaitingRestore.size === 0) {
|
|
649
|
-
return;
|
|
650
|
-
}
|
|
651
|
-
const pending = this._subscriptionManager.getActiveSubscriptions().filter(subscription => ( this._subscriptionsAwaitingRestore.has(( subscription.resource.toString()))));
|
|
652
|
-
this._subscriptionsAwaitingRestore.clear();
|
|
653
|
-
for (const subscription of pending) {
|
|
654
|
-
this._subscriptionsAwaitingRestore.add(( subscription.resource.toString()));
|
|
655
|
-
this._subscriptionManager.beginSnapshotRefresh(subscription.resource);
|
|
656
|
-
}
|
|
657
|
-
const restoreGroup = async subscriptions => {
|
|
658
|
-
await Promise.all(( subscriptions.map(async subscription => {
|
|
659
|
-
const resource = ( subscription.resource.toString());
|
|
660
|
-
try {
|
|
661
|
-
const result = await this._dispatchRequest("subscribe", {
|
|
662
|
-
channel: resource
|
|
663
|
-
}, {
|
|
664
|
-
bypassReconnectGate: true
|
|
665
|
-
});
|
|
666
|
-
if (!result.snapshot) {
|
|
667
|
-
throw ( new Error(`subscribe returned no snapshot for ${resource}`));
|
|
668
|
-
}
|
|
669
|
-
this._subscriptionManager.applyReconnectSnapshot(
|
|
670
|
-
result.snapshot.resource,
|
|
671
|
-
result.snapshot.state,
|
|
672
|
-
result.snapshot.fromSeq,
|
|
673
|
-
true
|
|
674
|
-
);
|
|
675
|
-
this._serverSeq = Math.max(this._serverSeq, result.snapshot.fromSeq);
|
|
676
|
-
this._subscriptionsAwaitingRestore.delete(resource);
|
|
677
|
-
} catch (error) {
|
|
678
|
-
if (error instanceof ProtocolError && error.code === AHP_CLIENT_CONNECTION_CLOSED) {
|
|
679
|
-
this._subscriptionManager.cancelSnapshotRefresh(subscription.resource);
|
|
680
|
-
throw error;
|
|
681
|
-
}
|
|
682
|
-
this._logService.warn(
|
|
683
|
-
`[AgentHostProtocolClient] Failed to restore subscription ${resource} after host restart: ${error instanceof Error ? error.message : String(error)}`
|
|
684
|
-
);
|
|
685
|
-
this._subscriptionManager.cancelSnapshotRefresh(subscription.resource);
|
|
686
|
-
this._subscriptionManager.markSubscriptionsMissing([subscription.resource]);
|
|
687
|
-
this._subscriptionsAwaitingRestore.delete(resource);
|
|
688
|
-
}
|
|
689
|
-
})));
|
|
690
|
-
};
|
|
691
|
-
await restoreGroup(
|
|
692
|
-
pending.filter(subscription => subscription.kind === StateComponents.Session)
|
|
693
|
-
);
|
|
694
|
-
await Promise.all([
|
|
695
|
-
restoreGroup(pending.filter(subscription => subscription.kind === StateComponents.Chat)),
|
|
696
|
-
restoreGroup(pending.filter(
|
|
697
|
-
subscription => subscription.kind !== StateComponents.Session && subscription.kind !== StateComponents.Chat
|
|
698
|
-
))
|
|
699
|
-
]);
|
|
700
|
-
}
|
|
701
|
-
async _restoreAuthenticationAfterFreshInitialize(expectedState) {
|
|
702
|
-
this._authenticationRestorePending = true;
|
|
703
|
-
let initialAuthenticationKey;
|
|
704
|
-
if (this._resolveInitialAuthentication) {
|
|
705
|
-
try {
|
|
706
|
-
const initialAuthentication = await this._resolveInitialAuthentication();
|
|
707
|
-
if (initialAuthentication) {
|
|
708
|
-
const normalizedParams = this._normalizeAuthenticationParams(initialAuthentication);
|
|
709
|
-
initialAuthenticationKey = this._authenticationKey(normalizedParams);
|
|
710
|
-
const expiresAt = getExpirationTime(normalizedParams.expiresIn);
|
|
711
|
-
this._authentication.set(initialAuthenticationKey, {
|
|
712
|
-
params: normalizedParams,
|
|
713
|
-
expiresAt
|
|
714
|
-
});
|
|
715
|
-
}
|
|
716
|
-
} catch (error) {
|
|
717
|
-
throw ( new InitialAuthenticationError(error));
|
|
718
|
-
}
|
|
719
|
-
if (this._state.kind !== expectedState) {
|
|
720
|
-
return;
|
|
721
|
-
}
|
|
722
|
-
}
|
|
723
|
-
await Promise.all(( [...this._authentication.entries()].map(async ([key, authentication]) => {
|
|
724
|
-
const now = Date.now();
|
|
725
|
-
if (isExpired(authentication.expiresAt, now)) {
|
|
726
|
-
this._authentication.delete(key);
|
|
727
|
-
return;
|
|
728
|
-
}
|
|
729
|
-
const expiresIn = getRemainingTimeInSeconds(authentication.expiresAt, now);
|
|
730
|
-
const params = authentication.params;
|
|
731
|
-
try {
|
|
732
|
-
await this._dispatchRequest("authenticate", {
|
|
733
|
-
channel: ROOT_STATE_URI,
|
|
734
|
-
...params,
|
|
735
|
-
scopes: params.scopes ? [...params.scopes] : undefined,
|
|
736
|
-
...(expiresIn === undefined ? {} : {
|
|
737
|
-
expiresIn
|
|
738
|
-
})
|
|
739
|
-
}, this._state.kind === AgentHostClientState.Connecting ? {
|
|
740
|
-
bypassInitializeQueue: true,
|
|
741
|
-
bypassReconnectGate: true
|
|
742
|
-
} : {
|
|
743
|
-
bypassReconnectGate: true
|
|
744
|
-
});
|
|
745
|
-
} catch (error) {
|
|
746
|
-
if (isConnectionClosedError(error)) {
|
|
747
|
-
throw error;
|
|
748
|
-
}
|
|
749
|
-
if (key === initialAuthenticationKey) {
|
|
750
|
-
throw ( new InitialAuthenticationError(error));
|
|
751
|
-
}
|
|
752
|
-
this._logService.warn(
|
|
753
|
-
`[AgentHostProtocolClient] Failed to restore authentication for ${params.resource} after host restart: ${error instanceof Error ? error.message : String(error)}`
|
|
754
|
-
);
|
|
755
|
-
}
|
|
756
|
-
})));
|
|
757
|
-
this._authenticationRestorePending = false;
|
|
758
|
-
}
|
|
759
|
-
_clientMeta() {
|
|
760
|
-
const telemetryLevel = this._effectiveTelemetryLevel();
|
|
761
|
-
const sendIdentity = telemetryLevel >= TelemetryLevel.USAGE;
|
|
762
|
-
return toAgentHostClientMeta(
|
|
763
|
-
this._transport.clientConnectionKind,
|
|
764
|
-
telemetryLevel,
|
|
765
|
-
sendIdentity ? this._telemetryService.machineId : undefined,
|
|
766
|
-
sendIdentity ? this._telemetryService.devDeviceId : undefined
|
|
767
|
-
);
|
|
768
|
-
}
|
|
769
|
-
_applyInitializeResult(result, forwardClientConfig = true) {
|
|
770
|
-
this._initializeResult.set(result, undefined);
|
|
771
|
-
this._serverSeq = result.serverSeq;
|
|
772
|
-
if (result.defaultDirectory) {
|
|
773
|
-
const directory = result.defaultDirectory;
|
|
774
|
-
this._defaultDirectory = typeof directory === "string" ? ( URI.parse(directory)).path : URI.revive(directory).path;
|
|
775
|
-
}
|
|
776
|
-
if (forwardClientConfig) {
|
|
777
|
-
this._forwardClientConfig();
|
|
778
|
-
}
|
|
779
|
-
}
|
|
780
|
-
_forwardClientConfig(includeManagedSettings = true) {
|
|
781
|
-
this._dispatchRootConfig(resolveAgentHostConfigurationSyncPatch(
|
|
782
|
-
this._configurationService,
|
|
783
|
-
getAgentHostConfigurationSyncTarget(this._resourceIdentity)
|
|
784
|
-
));
|
|
785
|
-
this._updateTelemetryLevel();
|
|
786
|
-
this._updateTerminalAutoApproveEnabled();
|
|
787
|
-
this._updateTerminalAutoApproveRules();
|
|
788
|
-
this._updateAutoApprovePolicyRestriction();
|
|
789
|
-
this._updateWorkspaceTrust();
|
|
790
|
-
this._updateDisableRepoInfoTelemetry();
|
|
791
|
-
if (includeManagedSettings) {
|
|
792
|
-
void this._updateManagedSettingsPermissions();
|
|
793
|
-
}
|
|
794
|
-
}
|
|
795
|
-
_updateAutoApprovePolicyRestriction() {
|
|
796
|
-
const policyRestricted = this._configurationService.inspect(GLOBAL_AUTO_APPROVE_SETTING_ID)?.policyValue === false;
|
|
797
|
-
this._dispatchRootConfig({
|
|
798
|
-
[AgentHostAutoApprovePolicyRestrictedConfigKey]: policyRestricted
|
|
799
|
-
});
|
|
800
|
-
}
|
|
801
|
-
_updateWorkspaceTrust() {
|
|
802
|
-
const remoteAuthority = typeof this._resourceIdentity === "string" && this._resourceIdentity.startsWith(`${Schemas.vscodeRemote}://`) ? ( URI.parse(this._resourceIdentity)).authority : undefined;
|
|
803
|
-
const trustedUris = ( ( this._workspaceTrustManagementService.getTrustedUris().filter(
|
|
804
|
-
uri => this._resourceIdentity === LOCAL_AGENT_HOST_RESOURCE_IDENTITY ? uri.scheme === Schemas.file : (uri.scheme === AGENT_HOST_SCHEME && uri.authority === this._connectionAuthority) || (remoteAuthority !== undefined && uri.scheme === Schemas.vscodeRemote && uri.authority === remoteAuthority)
|
|
805
|
-
).map(uri => uri.scheme === Schemas.vscodeRemote ? uri.with({
|
|
806
|
-
scheme: Schemas.file,
|
|
807
|
-
authority: ""
|
|
808
|
-
}) : this.resourceUris.toAgentHost(uri))).filter(uri => uri.scheme === Schemas.file).map(uri => ( uri.toString())));
|
|
809
|
-
this._dispatchRootConfig({
|
|
810
|
-
[AgentHostWorkspaceTrustConfigKey]: {
|
|
811
|
-
enabled: this._workspaceTrustEnablementService.isWorkspaceTrustEnabled(),
|
|
812
|
-
trustedUris
|
|
813
|
-
}
|
|
814
|
-
});
|
|
815
|
-
}
|
|
816
|
-
_applyReconnectResult(result, preservePending = false) {
|
|
817
|
-
if (result.type === ReconnectResultType.Replay) {
|
|
818
|
-
let maxSeq = this._serverSeq;
|
|
819
|
-
for (const envelope of result.actions) {
|
|
820
|
-
if (envelope.origin?.clientId === this._clientId && envelope.origin.clientSeq !== undefined && !envelope.rejectionReason) {
|
|
821
|
-
this._subscriptionManager.dropPendingAction(envelope.channel, envelope.origin.clientSeq);
|
|
822
|
-
}
|
|
823
|
-
if (envelope.serverSeq > maxSeq) {
|
|
824
|
-
maxSeq = envelope.serverSeq;
|
|
825
|
-
}
|
|
826
|
-
this._onDidAction.fire(normalizeLegacyActionEnvelope(envelope));
|
|
827
|
-
}
|
|
828
|
-
this._serverSeq = maxSeq;
|
|
829
|
-
if (result.missing.length > 0) {
|
|
830
|
-
this._logService.info(
|
|
831
|
-
`[RemoteAgentHostProtocol] Server cannot resume ${result.missing.length} subscription(s) after reconnect.`
|
|
832
|
-
);
|
|
833
|
-
this._subscriptionManager.markSubscriptionsMissing(( result.missing.map(u => ( URI.parse(u)))));
|
|
834
|
-
for (const resource of result.missing) {
|
|
835
|
-
this._subscriptionsAwaitingRestore.delete(resource);
|
|
836
|
-
}
|
|
837
|
-
}
|
|
838
|
-
} else {
|
|
839
|
-
let maxSeq = this._serverSeq;
|
|
840
|
-
for (const snapshot of result.snapshots) {
|
|
841
|
-
this._subscriptionManager.applyReconnectSnapshot(snapshot.resource, snapshot.state, snapshot.fromSeq, preservePending);
|
|
842
|
-
this._subscriptionsAwaitingRestore.delete(snapshot.resource);
|
|
843
|
-
if (snapshot.fromSeq > maxSeq) {
|
|
844
|
-
maxSeq = snapshot.fromSeq;
|
|
845
|
-
}
|
|
846
|
-
}
|
|
847
|
-
this._serverSeq = maxSeq;
|
|
848
|
-
}
|
|
849
|
-
}
|
|
850
|
-
_drainAfterReconnect(outbox) {
|
|
851
|
-
const queuedSeqs = ( new Set());
|
|
852
|
-
for (const msg of outbox) {
|
|
853
|
-
if (hasKey(msg, {
|
|
854
|
-
method: true
|
|
855
|
-
}) && msg.method === "dispatchAction") {
|
|
856
|
-
queuedSeqs.add(msg.params.clientSeq);
|
|
857
|
-
}
|
|
858
|
-
}
|
|
859
|
-
const replays = [];
|
|
860
|
-
for (const entry of this._subscriptionManager.getPendingActions()) {
|
|
861
|
-
if (( queuedSeqs.has(entry.clientSeq))) {
|
|
862
|
-
continue;
|
|
863
|
-
}
|
|
864
|
-
this._grantImplicitReadsForOutgoingAction(entry.action);
|
|
865
|
-
replays.push({
|
|
866
|
-
jsonrpc: "2.0",
|
|
867
|
-
method: "dispatchAction",
|
|
868
|
-
params: {
|
|
869
|
-
channel: entry.channel,
|
|
870
|
-
clientSeq: entry.clientSeq,
|
|
871
|
-
action: entry.action
|
|
872
|
-
}
|
|
873
|
-
});
|
|
874
|
-
}
|
|
875
|
-
if (replays.length > 0) {
|
|
876
|
-
this._logService.info(
|
|
877
|
-
`[RemoteAgentHostProtocol] Replaying ${replays.length} pending action(s) after reconnect to ${this._address}.`
|
|
878
|
-
);
|
|
879
|
-
}
|
|
880
|
-
for (const msg of replays) {
|
|
881
|
-
this._transport.send(msg);
|
|
882
|
-
}
|
|
883
|
-
for (const msg of outbox) {
|
|
884
|
-
this._transport.send(msg);
|
|
885
|
-
}
|
|
886
|
-
}
|
|
887
|
-
get rootState() {
|
|
888
|
-
return this._subscriptionManager.rootState;
|
|
889
|
-
}
|
|
890
|
-
getSubscription(kind, resource, owner) {
|
|
891
|
-
return this._subscriptionManager.getSubscription(kind, resource, owner);
|
|
892
|
-
}
|
|
893
|
-
getSubscriptionUnmanaged(_kind, resource) {
|
|
894
|
-
return this._subscriptionManager.getSubscriptionUnmanaged(resource);
|
|
895
|
-
}
|
|
896
|
-
getInflightSessionCreate(resource) {
|
|
897
|
-
return this._subscriptionManager.getInflightSessionCreate(resource);
|
|
898
|
-
}
|
|
899
|
-
trackSessionCreate(resource, promise) {
|
|
900
|
-
this._subscriptionManager.trackSessionCreate(resource, promise);
|
|
901
|
-
}
|
|
902
|
-
getActiveSubscriptions() {
|
|
903
|
-
return this._subscriptionManager.getActiveSubscriptions();
|
|
904
|
-
}
|
|
905
|
-
dispatch(channel, action) {
|
|
906
|
-
const seq = this._subscriptionManager.dispatchOptimistic(channel, action);
|
|
907
|
-
this.dispatchAction(channel, action, this._clientId, seq);
|
|
908
|
-
}
|
|
909
|
-
async subscribe(resource) {
|
|
910
|
-
this._logService.trace(`[RemoteAgentHostProtocol] subscribe start: ${( resource.toString())}`);
|
|
911
|
-
const result = await this._sendRequest("subscribe", {
|
|
912
|
-
channel: ( resource.toString())
|
|
913
|
-
});
|
|
914
|
-
if (!result.snapshot) {
|
|
915
|
-
throw ( new Error(`subscribe to ${( resource.toString())} returned no snapshot`));
|
|
916
|
-
}
|
|
917
|
-
this._logService.trace(`[RemoteAgentHostProtocol] subscribe done: ${( resource.toString())}`);
|
|
918
|
-
return result.snapshot;
|
|
919
|
-
}
|
|
920
|
-
async subscribeStateless(resource) {
|
|
921
|
-
await this._sendRequest("subscribe", {
|
|
922
|
-
channel: ( resource.toString())
|
|
923
|
-
});
|
|
924
|
-
}
|
|
925
|
-
unsubscribe(resource) {
|
|
926
|
-
this._sendNotification("unsubscribe", {
|
|
927
|
-
channel: ( resource.toString())
|
|
928
|
-
});
|
|
929
|
-
}
|
|
930
|
-
dispatchAction(channel, action, _clientId, clientSeq) {
|
|
931
|
-
this._grantImplicitReadsForOutgoingAction(action);
|
|
932
|
-
this._sendNotification("dispatchAction", {
|
|
933
|
-
channel,
|
|
934
|
-
clientSeq,
|
|
935
|
-
action
|
|
936
|
-
});
|
|
937
|
-
}
|
|
938
|
-
createSession(config) {
|
|
939
|
-
const provider = config?.provider;
|
|
940
|
-
if (!provider) {
|
|
941
|
-
throw ( new Error("Cannot create remote agent host session without a provider."));
|
|
942
|
-
}
|
|
943
|
-
const session = config?.session ?? AgentSession.uri(provider, generateUuid());
|
|
944
|
-
if (config?.activeClient?.customizations) {
|
|
945
|
-
this._grantImplicitReadsForCustomizations(config.activeClient.customizations);
|
|
946
|
-
}
|
|
947
|
-
const promise = this._sendRequest("createSession", {
|
|
948
|
-
channel: ( session.toString()),
|
|
949
|
-
_meta: config?._meta,
|
|
950
|
-
provider,
|
|
951
|
-
workingDirectories: config?.workingDirectories?.map(d => ( fromAgentHostUri(d).toString())),
|
|
952
|
-
config: config?.config,
|
|
953
|
-
activeClient: config?.activeClient,
|
|
954
|
-
progressToken: config?.progressToken
|
|
955
|
-
}).then(() => session);
|
|
956
|
-
this._subscriptionManager.trackSessionCreate(session, promise);
|
|
957
|
-
return promise;
|
|
958
|
-
}
|
|
959
|
-
async removeSessionArtifact(session, artifactId) {
|
|
960
|
-
await this._sendExtensionRequest(RemoveSessionArtifactExtensionMethod, {
|
|
961
|
-
session: ( session.toString()),
|
|
962
|
-
artifactId
|
|
963
|
-
});
|
|
964
|
-
}
|
|
965
|
-
async createDetachedWorktree(session, prompt) {
|
|
966
|
-
const result = await this._sendExtensionRequest(CreateAgentHostDetachedWorktreeExtensionMethod, {
|
|
967
|
-
session: ( session.toString()),
|
|
968
|
-
prompt
|
|
969
|
-
});
|
|
970
|
-
if (!result) {
|
|
971
|
-
throw ( new Error("Agent Host does not support detached worktrees."));
|
|
972
|
-
}
|
|
973
|
-
return {
|
|
974
|
-
handle: result.handle,
|
|
975
|
-
worktree: ( URI.parse(result.resource))
|
|
976
|
-
};
|
|
977
|
-
}
|
|
978
|
-
async setDetachedWorktreeArchived(handle, archived) {
|
|
979
|
-
await this._sendExtensionRequest(SetAgentHostDetachedWorktreeArchivedExtensionMethod, {
|
|
980
|
-
handle,
|
|
981
|
-
archived
|
|
982
|
-
});
|
|
983
|
-
}
|
|
984
|
-
async claimDetachedWorktree(handle) {
|
|
985
|
-
await this._sendExtensionRequest(ClaimAgentHostDetachedWorktreeExtensionMethod, {
|
|
986
|
-
handle
|
|
987
|
-
});
|
|
988
|
-
}
|
|
989
|
-
async deleteDetachedWorktree(handle) {
|
|
990
|
-
await this._sendExtensionRequest(DeleteAgentHostDetachedWorktreeExtensionMethod, {
|
|
991
|
-
handle
|
|
992
|
-
});
|
|
993
|
-
}
|
|
994
|
-
async reconcileDetachedWorktrees(scope, activeHandles) {
|
|
995
|
-
await this._sendExtensionRequest(ReconcileAgentHostDetachedWorktreesExtensionMethod, {
|
|
996
|
-
scope,
|
|
997
|
-
activeHandles: [...activeHandles]
|
|
998
|
-
});
|
|
999
|
-
}
|
|
1000
|
-
async resolveSessionConfig(params) {
|
|
1001
|
-
return this._sendRequest("resolveSessionConfig", {
|
|
1002
|
-
channel: ROOT_STATE_URI,
|
|
1003
|
-
provider: params.provider,
|
|
1004
|
-
workingDirectory: params.workingDirectory ? ( fromAgentHostUri(params.workingDirectory).toString()) : undefined,
|
|
1005
|
-
config: params.config
|
|
1006
|
-
});
|
|
1007
|
-
}
|
|
1008
|
-
async sessionConfigCompletions(params) {
|
|
1009
|
-
return this._sendRequest("sessionConfigCompletions", {
|
|
1010
|
-
channel: ROOT_STATE_URI,
|
|
1011
|
-
provider: params.provider,
|
|
1012
|
-
workingDirectory: params.workingDirectory ? ( fromAgentHostUri(params.workingDirectory).toString()) : undefined,
|
|
1013
|
-
config: params.config,
|
|
1014
|
-
property: params.property,
|
|
1015
|
-
query: params.query
|
|
1016
|
-
});
|
|
1017
|
-
}
|
|
1018
|
-
async completions(params) {
|
|
1019
|
-
return this._sendRequest("completions", params);
|
|
1020
|
-
}
|
|
1021
|
-
async listAutomationTriggerDefinitions(params) {
|
|
1022
|
-
return this._sendRequest("listAutomationTriggerDefinitions", params);
|
|
1023
|
-
}
|
|
1024
|
-
async runAutomation(params) {
|
|
1025
|
-
return this._sendRequest("runAutomation", params);
|
|
1026
|
-
}
|
|
1027
|
-
async fetchAutomationRuns(params) {
|
|
1028
|
-
return this._sendRequest("fetchAutomationRuns", params);
|
|
1029
|
-
}
|
|
1030
|
-
async ping() {
|
|
1031
|
-
await this._sendRequest("ping", {
|
|
1032
|
-
channel: ROOT_STATE_URI
|
|
1033
|
-
});
|
|
1034
|
-
}
|
|
1035
|
-
async getCompletionTriggerCharacters() {
|
|
1036
|
-
while (this._state.kind === AgentHostClientState.Connecting) {
|
|
1037
|
-
await Event.toPromise(this.onDidChangeConnectionState);
|
|
1038
|
-
}
|
|
1039
|
-
switch (this._state.kind) {
|
|
1040
|
-
case AgentHostClientState.Incompatible:
|
|
1041
|
-
case AgentHostClientState.Closed:
|
|
1042
|
-
throw this._state.error;
|
|
1043
|
-
case AgentHostClientState.Connected:
|
|
1044
|
-
case AgentHostClientState.Reconnecting:
|
|
1045
|
-
return this._initializeResult.get()?.completionTriggerCharacters ?? [];
|
|
1046
|
-
}
|
|
1047
|
-
}
|
|
1048
|
-
async authenticate(params) {
|
|
1049
|
-
const normalizedParams = this._normalizeAuthenticationParams(params);
|
|
1050
|
-
const expiresAt = getExpirationTime(params.expiresIn);
|
|
1051
|
-
await this._sendRequest("authenticate", {
|
|
1052
|
-
channel: ROOT_STATE_URI,
|
|
1053
|
-
...normalizedParams,
|
|
1054
|
-
scopes: normalizedParams.scopes ? [...normalizedParams.scopes] : undefined
|
|
1055
|
-
});
|
|
1056
|
-
const key = this._authenticationKey(normalizedParams);
|
|
1057
|
-
if (params.token) {
|
|
1058
|
-
this._authentication.set(key, {
|
|
1059
|
-
params: normalizedParams,
|
|
1060
|
-
expiresAt
|
|
1061
|
-
});
|
|
1062
|
-
} else {
|
|
1063
|
-
this._authentication.delete(key);
|
|
1064
|
-
}
|
|
1065
|
-
return {
|
|
1066
|
-
authenticated: true
|
|
1067
|
-
};
|
|
1068
|
-
}
|
|
1069
|
-
_normalizeAuthenticationParams(params) {
|
|
1070
|
-
return {
|
|
1071
|
-
...params,
|
|
1072
|
-
scopes: params.scopes ? [...( new Set(params.scopes))].sort() : undefined
|
|
1073
|
-
};
|
|
1074
|
-
}
|
|
1075
|
-
_authenticationKey(params) {
|
|
1076
|
-
return `${params.resource}\0${JSON.stringify(params.scopes ?? [])}`;
|
|
1077
|
-
}
|
|
1078
|
-
async shutdown() {
|
|
1079
|
-
await this._sendExtensionRequest("shutdown");
|
|
1080
|
-
}
|
|
1081
|
-
async getNetworkDiagnosticsInfo() {
|
|
1082
|
-
return this._sendExtensionRequest("getNetworkDiagnosticsInfo");
|
|
1083
|
-
}
|
|
1084
|
-
async getManagedSettingsDiagnostics() {
|
|
1085
|
-
return this._sendExtensionRequest("getManagedSettingsDiagnostics");
|
|
1086
|
-
}
|
|
1087
|
-
async getSessionStateFile(session, chat) {
|
|
1088
|
-
const targetChat = chat && !isDefaultChatUri(chat) ? chat : undefined;
|
|
1089
|
-
if (targetChat && !supportsAgentHostChatStateFile(this._initializeResult.get())) {
|
|
1090
|
-
return undefined;
|
|
1091
|
-
}
|
|
1092
|
-
const result = await this._sendExtensionRequest(GetAgentHostSessionStateFileExtensionMethod, {
|
|
1093
|
-
session: ( session.toString()),
|
|
1094
|
-
chat: targetChat?.toString()
|
|
1095
|
-
});
|
|
1096
|
-
if (!result.resource) {
|
|
1097
|
-
return undefined;
|
|
1098
|
-
}
|
|
1099
|
-
const resource = ( URI.parse(result.resource, true));
|
|
1100
|
-
if (resource.scheme !== Schemas.file) {
|
|
1101
|
-
throw ( new ProtocolError(
|
|
1102
|
-
JsonRpcErrorCodes.InvalidParams,
|
|
1103
|
-
`Agent Host returned a non-file session state resource: ${( resource.toString())}`
|
|
1104
|
-
));
|
|
1105
|
-
}
|
|
1106
|
-
return toAgentHostUri(resource, this._connectionAuthority);
|
|
1107
|
-
}
|
|
1108
|
-
async collectDebugLogs(session, kind, chat) {
|
|
1109
|
-
const result = await this._sendExtensionRequest(CollectAgentHostDebugLogsExtensionMethod, {
|
|
1110
|
-
session: session?.toString(),
|
|
1111
|
-
chat: chat?.toString(),
|
|
1112
|
-
kind
|
|
1113
|
-
});
|
|
1114
|
-
if (result.kind !== kind) {
|
|
1115
|
-
throw ( new ProtocolError(
|
|
1116
|
-
JsonRpcErrorCodes.InvalidParams,
|
|
1117
|
-
`Agent Host returned ${result.kind} debug logs for a ${kind} request`
|
|
1118
|
-
));
|
|
1119
|
-
}
|
|
1120
|
-
const resource = ( URI.parse(result.resource, true));
|
|
1121
|
-
if (resource.scheme !== Schemas.file) {
|
|
1122
|
-
throw ( new ProtocolError(
|
|
1123
|
-
JsonRpcErrorCodes.InvalidParams,
|
|
1124
|
-
`Agent Host returned a non-file debug log resource: ${( resource.toString())}`
|
|
1125
|
-
));
|
|
1126
|
-
}
|
|
1127
|
-
if (!Number.isSafeInteger(result.size) || result.size < 0 || !Number.isSafeInteger(result.uncompressedSize) || result.uncompressedSize < 0) {
|
|
1128
|
-
throw ( new ProtocolError(
|
|
1129
|
-
JsonRpcErrorCodes.InvalidParams,
|
|
1130
|
-
"Agent Host returned invalid debug log artifact sizes"
|
|
1131
|
-
));
|
|
1132
|
-
}
|
|
1133
|
-
if (!Array.isArray(result.entries) || result.entries.length > AGENT_HOST_DEBUG_LOGS_MAX_ENTRIES) {
|
|
1134
|
-
throw ( new ProtocolError(
|
|
1135
|
-
JsonRpcErrorCodes.InvalidParams,
|
|
1136
|
-
"Agent Host returned an invalid debug log artifact manifest"
|
|
1137
|
-
));
|
|
1138
|
-
}
|
|
1139
|
-
const entryPaths = ( new Set());
|
|
1140
|
-
let manifestSize = 0;
|
|
1141
|
-
for (const entry of result.entries) {
|
|
1142
|
-
const segments = entry.path.split("/");
|
|
1143
|
-
if (!entry.path || entry.path.includes("\\") || ( segments.some(segment => !segment || segment === "." || segment === "..")) || !Number.isSafeInteger(entry.size) || entry.size < 0 || ( entryPaths.has(entry.path))) {
|
|
1144
|
-
throw ( new ProtocolError(
|
|
1145
|
-
JsonRpcErrorCodes.InvalidParams,
|
|
1146
|
-
"Agent Host returned an invalid debug log artifact manifest entry"
|
|
1147
|
-
));
|
|
1148
|
-
}
|
|
1149
|
-
entryPaths.add(entry.path);
|
|
1150
|
-
manifestSize += entry.size;
|
|
1151
|
-
}
|
|
1152
|
-
if (!Number.isSafeInteger(manifestSize) || manifestSize !== result.uncompressedSize) {
|
|
1153
|
-
throw ( new ProtocolError(
|
|
1154
|
-
JsonRpcErrorCodes.InvalidParams,
|
|
1155
|
-
"Agent Host debug log artifact manifest size does not match its declared size"
|
|
1156
|
-
));
|
|
1157
|
-
}
|
|
1158
|
-
return {
|
|
1159
|
-
kind: result.kind,
|
|
1160
|
-
resource: toAgentHostUri(resource, this._connectionAuthority),
|
|
1161
|
-
providerLogsIncluded: result.providerLogsIncluded,
|
|
1162
|
-
size: result.size,
|
|
1163
|
-
uncompressedSize: result.uncompressedSize,
|
|
1164
|
-
entries: result.entries
|
|
1165
|
-
};
|
|
1166
|
-
}
|
|
1167
|
-
async readDebugLogsChunk(resource, position) {
|
|
1168
|
-
const result = await this._sendExtensionRequest(ReadAgentHostDebugLogsChunkExtensionMethod, {
|
|
1169
|
-
resource: ( fromAgentHostUri(resource).toString()),
|
|
1170
|
-
position
|
|
1171
|
-
});
|
|
1172
|
-
const data = decodeBase64(result.data);
|
|
1173
|
-
if (data.byteLength > AGENT_HOST_DEBUG_LOGS_CHUNK_BYTES) {
|
|
1174
|
-
throw ( new ProtocolError(
|
|
1175
|
-
JsonRpcErrorCodes.InvalidParams,
|
|
1176
|
-
"Agent Host returned an oversized debug log chunk"
|
|
1177
|
-
));
|
|
1178
|
-
}
|
|
1179
|
-
return {
|
|
1180
|
-
data,
|
|
1181
|
-
eof: result.eof === true
|
|
1182
|
-
};
|
|
1183
|
-
}
|
|
1184
|
-
async diagnosticsFetch(url) {
|
|
1185
|
-
return this._sendExtensionRequest("diagnosticsFetch", {
|
|
1186
|
-
url
|
|
1187
|
-
});
|
|
1188
|
-
}
|
|
1189
|
-
async disposeSession(session) {
|
|
1190
|
-
await this._sendRequest("disposeSession", {
|
|
1191
|
-
channel: ( session.toString())
|
|
1192
|
-
});
|
|
1193
|
-
}
|
|
1194
|
-
async createChat(session, chat, options) {
|
|
1195
|
-
await this._sendRequest("createChat", {
|
|
1196
|
-
channel: ( session.toString()),
|
|
1197
|
-
chat: ( chat.toString()),
|
|
1198
|
-
...(options?.fork ? {
|
|
1199
|
-
source: {
|
|
1200
|
-
kind: ChatSourceKind.Fork,
|
|
1201
|
-
chat: ( options.fork.source.toString()),
|
|
1202
|
-
turnId: options.fork.turnId
|
|
1203
|
-
}
|
|
1204
|
-
} : {}),
|
|
1205
|
-
...(options?.sideChat ? {
|
|
1206
|
-
source: {
|
|
1207
|
-
kind: ChatSourceKind.SideChat,
|
|
1208
|
-
chat: ( options.sideChat.source.toString()),
|
|
1209
|
-
turnId: options.sideChat.turnId,
|
|
1210
|
-
...(options.sideChat.selection ? {
|
|
1211
|
-
selection: options.sideChat.selection
|
|
1212
|
-
} : {})
|
|
1213
|
-
}
|
|
1214
|
-
} : {})
|
|
1215
|
-
});
|
|
1216
|
-
}
|
|
1217
|
-
async disposeChat(chat) {
|
|
1218
|
-
await this._sendRequest("disposeChat", {
|
|
1219
|
-
channel: ( chat.toString())
|
|
1220
|
-
});
|
|
1221
|
-
}
|
|
1222
|
-
async createTerminal(params) {
|
|
1223
|
-
await this._sendRequest("createTerminal", params);
|
|
1224
|
-
}
|
|
1225
|
-
async disposeTerminal(terminal) {
|
|
1226
|
-
await this._sendRequest("disposeTerminal", {
|
|
1227
|
-
channel: ( terminal.toString())
|
|
1228
|
-
});
|
|
1229
|
-
}
|
|
1230
|
-
async invokeChangesetOperation(params) {
|
|
1231
|
-
return await this._sendRequest("invokeChangesetOperation", params);
|
|
1232
|
-
}
|
|
1233
|
-
async handleMcpRequest(channel, method, params) {
|
|
1234
|
-
return await this._dispatchRequest(method, {
|
|
1235
|
-
...(params ?? {}),
|
|
1236
|
-
channel
|
|
1237
|
-
});
|
|
1238
|
-
}
|
|
1239
|
-
async listSessions() {
|
|
1240
|
-
const result = await this._sendRequest("listSessions", {
|
|
1241
|
-
channel: ROOT_STATE_URI
|
|
1242
|
-
});
|
|
1243
|
-
return ( result.items.map(s => ({
|
|
1244
|
-
session: ( URI.parse(s.resource)),
|
|
1245
|
-
startTime: Date.parse(s.createdAt),
|
|
1246
|
-
modifiedTime: Date.parse(s.modifiedAt),
|
|
1247
|
-
...(s.project ? {
|
|
1248
|
-
project: {
|
|
1249
|
-
uri: this._toClientUri(( URI.parse(s.project.uri))),
|
|
1250
|
-
displayName: s.project.displayName
|
|
1251
|
-
}
|
|
1252
|
-
} : {}),
|
|
1253
|
-
summary: s.title,
|
|
1254
|
-
status: s.status,
|
|
1255
|
-
activity: s.activity,
|
|
1256
|
-
workingDirectory: typeof s.workingDirectories?.[0] === "string" ? this._toClientUri(( URI.parse(s.workingDirectories[0]))) : undefined,
|
|
1257
|
-
workingDirectories: s.workingDirectories?.map(d => this._toClientUri(( URI.parse(d)))),
|
|
1258
|
-
changes: s.changes,
|
|
1259
|
-
...(s._meta !== undefined ? {
|
|
1260
|
-
_meta: s._meta
|
|
1261
|
-
} : {})
|
|
1262
|
-
})));
|
|
1263
|
-
}
|
|
1264
|
-
_toClientUri(uri) {
|
|
1265
|
-
return uri.scheme === Schemas.file ? toAgentHostUri(uri, this._connectionAuthority) : uri;
|
|
1266
|
-
}
|
|
1267
|
-
_grantImplicitReadsForOutgoingAction(action) {
|
|
1268
|
-
switch (action.type) {
|
|
1269
|
-
case ActionType.SessionActiveClientSet:
|
|
1270
|
-
if (action.activeClient.customizations) {
|
|
1271
|
-
this._grantImplicitReadsForCustomizations(action.activeClient.customizations);
|
|
1272
|
-
}
|
|
1273
|
-
break;
|
|
1274
|
-
case ActionType.ChatTurnStarted:
|
|
1275
|
-
case ActionType.ChatPendingMessageSet:
|
|
1276
|
-
this._grantImplicitReadsForMessage(action.message);
|
|
1277
|
-
break;
|
|
1278
|
-
}
|
|
1279
|
-
}
|
|
1280
|
-
_grantImplicitReadsForMessage(message) {
|
|
1281
|
-
for (const attachment of message.attachments ?? []) {
|
|
1282
|
-
if (attachment.type !== MessageAttachmentKind.Resource) {
|
|
1283
|
-
continue;
|
|
1284
|
-
}
|
|
1285
|
-
try {
|
|
1286
|
-
this._grantImplicitRead(( URI.parse(attachment.uri)));
|
|
1287
|
-
} catch {
|
|
1288
|
-
continue;
|
|
1289
|
-
}
|
|
1290
|
-
}
|
|
1291
|
-
}
|
|
1292
|
-
_grantImplicitReadsForCustomizations(refs) {
|
|
1293
|
-
for (const ref of refs) {
|
|
1294
|
-
let uri;
|
|
1295
|
-
try {
|
|
1296
|
-
uri = ( URI.parse(ref.uri));
|
|
1297
|
-
} catch {
|
|
1298
|
-
continue;
|
|
1299
|
-
}
|
|
1300
|
-
this._grantImplicitRead(uri);
|
|
1301
|
-
}
|
|
1302
|
-
}
|
|
1303
|
-
_grantImplicitRead(uri) {
|
|
1304
|
-
if (( this._grantedImplicitReadUris.has(uri))) {
|
|
1305
|
-
return;
|
|
1306
|
-
}
|
|
1307
|
-
this._grantedImplicitReadUris.add(uri);
|
|
1308
|
-
this._implicitReadGrants.add(this._resourceService.grantImplicitRead(this._resourceIdentity, uri));
|
|
1309
|
-
}
|
|
1310
|
-
async resourceList(uri) {
|
|
1311
|
-
return await this._sendRequest("resourceList", {
|
|
1312
|
-
channel: ROOT_STATE_URI,
|
|
1313
|
-
uri: ( uri.toString())
|
|
1314
|
-
});
|
|
1315
|
-
}
|
|
1316
|
-
async resourceRead(uri, encoding) {
|
|
1317
|
-
return this._sendRequest("resourceRead", {
|
|
1318
|
-
channel: ROOT_STATE_URI,
|
|
1319
|
-
uri: ( uri.toString()),
|
|
1320
|
-
encoding
|
|
1321
|
-
});
|
|
1322
|
-
}
|
|
1323
|
-
async resourceWrite(params) {
|
|
1324
|
-
return this._sendRequest("resourceWrite", params);
|
|
1325
|
-
}
|
|
1326
|
-
async resourceCopy(params) {
|
|
1327
|
-
return this._sendRequest("resourceCopy", params);
|
|
1328
|
-
}
|
|
1329
|
-
async resourceDelete(params) {
|
|
1330
|
-
return this._sendRequest("resourceDelete", params);
|
|
1331
|
-
}
|
|
1332
|
-
async resourceMove(params) {
|
|
1333
|
-
return this._sendRequest("resourceMove", params);
|
|
1334
|
-
}
|
|
1335
|
-
async resourceResolve(params) {
|
|
1336
|
-
return this._sendRequest("resourceResolve", params);
|
|
1337
|
-
}
|
|
1338
|
-
async resourceMkdir(params) {
|
|
1339
|
-
return this._sendRequest("resourceMkdir", params);
|
|
1340
|
-
}
|
|
1341
|
-
async createResourceWatch(params) {
|
|
1342
|
-
return this._sendRequest("createResourceWatch", params);
|
|
1343
|
-
}
|
|
1344
|
-
watchResource(params) {
|
|
1345
|
-
return createRemoteWatchHandle({
|
|
1346
|
-
createResourceWatch: p => this.createResourceWatch(p),
|
|
1347
|
-
subscribe: uri => this.subscribe(uri),
|
|
1348
|
-
unsubscribe: uri => this.unsubscribe(uri),
|
|
1349
|
-
onDidAction: this.onDidAction
|
|
1350
|
-
}, params);
|
|
1351
|
-
}
|
|
1352
|
-
triggerVscodeUpgrade(method) {
|
|
1353
|
-
return this._dispatchRequest(method, {}, {
|
|
1354
|
-
allowIncompatibleUpgrade: true
|
|
1355
|
-
});
|
|
1356
|
-
}
|
|
1357
|
-
_handleMessage(msg) {
|
|
1358
|
-
if (this._state.kind === AgentHostClientState.Closed) {
|
|
1359
|
-
return;
|
|
1360
|
-
}
|
|
1361
|
-
this._lastReadTime = Date.now();
|
|
1362
|
-
this._resetLivenessTimers();
|
|
1363
|
-
if (isJsonRpcRequest(msg)) {
|
|
1364
|
-
this._handleReverseRequest(msg.id, msg.method, msg.params);
|
|
1365
|
-
} else if (isJsonRpcResponse(msg)) {
|
|
1366
|
-
const pending = this._pendingRequests.get(msg.id);
|
|
1367
|
-
if (pending) {
|
|
1368
|
-
this._pendingRequests.delete(msg.id);
|
|
1369
|
-
if (hasKey(msg, {
|
|
1370
|
-
error: true
|
|
1371
|
-
})) {
|
|
1372
|
-
if (this._shouldLogFailedRequest(pending, msg.error)) {
|
|
1373
|
-
this._logService.warn(`[RemoteAgentHostProtocol] Request ${msg.id} failed:`, msg.error);
|
|
1374
|
-
}
|
|
1375
|
-
pending.deferred.error(this._toProtocolError(msg.error));
|
|
1376
|
-
} else {
|
|
1377
|
-
pending.deferred.complete(msg.result);
|
|
1378
|
-
}
|
|
1379
|
-
} else {
|
|
1380
|
-
this._logService.warn(
|
|
1381
|
-
`[RemoteAgentHostProtocol] Received response for unknown request id ${msg.id}`
|
|
1382
|
-
);
|
|
1383
|
-
}
|
|
1384
|
-
} else if (isJsonRpcNotification(msg)) {
|
|
1385
|
-
switch (msg.method) {
|
|
1386
|
-
case "action":
|
|
1387
|
-
{
|
|
1388
|
-
const envelope = msg.params;
|
|
1389
|
-
this._serverSeq = Math.max(this._serverSeq, envelope.serverSeq);
|
|
1390
|
-
this._onDidAction.fire(normalizeLegacyActionEnvelope(envelope));
|
|
1391
|
-
break;
|
|
1392
|
-
}
|
|
1393
|
-
case "root/sessionAdded":
|
|
1394
|
-
case "root/sessionRemoved":
|
|
1395
|
-
case "root/sessionSummaryChanged":
|
|
1396
|
-
case "root/progress":
|
|
1397
|
-
case "auth/required":
|
|
1398
|
-
{
|
|
1399
|
-
this._logService.trace(`[RemoteAgentHostProtocol] Notification: ${msg.method}`);
|
|
1400
|
-
this._onDidNotification.fire({
|
|
1401
|
-
type: msg.method,
|
|
1402
|
-
...msg.params
|
|
1403
|
-
});
|
|
1404
|
-
break;
|
|
1405
|
-
}
|
|
1406
|
-
case "otlp/exportLogs":
|
|
1407
|
-
this._onDidReceiveOtlpLogs.fire(msg.params);
|
|
1408
|
-
break;
|
|
1409
|
-
case "otlp/exportTraces":
|
|
1410
|
-
case "otlp/exportMetrics":
|
|
1411
|
-
break;
|
|
1412
|
-
default:
|
|
1413
|
-
{
|
|
1414
|
-
const rawChannel = msg.params && typeof msg.params === "object" ? msg.params.channel : undefined;
|
|
1415
|
-
if (typeof rawChannel === "string" && rawChannel.toLowerCase().startsWith("mcp:/")) {
|
|
1416
|
-
const {
|
|
1417
|
-
channel: _channel,
|
|
1418
|
-
...rest
|
|
1419
|
-
} = msg.params;
|
|
1420
|
-
this._onMcpNotification.fire({
|
|
1421
|
-
channel: rawChannel,
|
|
1422
|
-
method: msg.method,
|
|
1423
|
-
params: rest
|
|
1424
|
-
});
|
|
1425
|
-
break;
|
|
1426
|
-
}
|
|
1427
|
-
this._logService.trace(`[RemoteAgentHostProtocol] Unhandled method: ${msg.method}`);
|
|
1428
|
-
break;
|
|
1429
|
-
}
|
|
1430
|
-
}
|
|
1431
|
-
} else {
|
|
1432
|
-
this._logService.warn(`[RemoteAgentHostProtocol] Unrecognized message:`, JSON.stringify(msg));
|
|
1433
|
-
}
|
|
1434
|
-
}
|
|
1435
|
-
_handleFatalClose(error, reason) {
|
|
1436
|
-
this._onDidFatalClose.fire(error);
|
|
1437
|
-
this._handleClose(error, reason);
|
|
1438
|
-
}
|
|
1439
|
-
_handleClose(error, reason) {
|
|
1440
|
-
if (this._state.kind === AgentHostClientState.Closed) {
|
|
1441
|
-
return;
|
|
1442
|
-
}
|
|
1443
|
-
this._cancelLivenessTimers();
|
|
1444
|
-
if (this._state.kind === AgentHostClientState.Reconnecting) {
|
|
1445
|
-
const reconnect = this._state.reconnect;
|
|
1446
|
-
if (reconnect.timeoutHandle !== undefined) {
|
|
1447
|
-
clearTimeout(reconnect.timeoutHandle);
|
|
1448
|
-
}
|
|
1449
|
-
if (!reconnect.gate.isSettled) {
|
|
1450
|
-
reconnect.gate.error(error);
|
|
1451
|
-
}
|
|
1452
|
-
}
|
|
1453
|
-
if (this._state.kind === AgentHostClientState.Connecting) {
|
|
1454
|
-
this._state.outbox.length = 0;
|
|
1455
|
-
}
|
|
1456
|
-
this._rejectPendingRequests(error);
|
|
1457
|
-
this._grantedImplicitReadUris.clear();
|
|
1458
|
-
this._implicitReadGrants.clear();
|
|
1459
|
-
this._resourceService.connectionClosed(this._resourceIdentity);
|
|
1460
|
-
this._transitionTo({
|
|
1461
|
-
kind: AgentHostClientState.Closed,
|
|
1462
|
-
error
|
|
1463
|
-
});
|
|
1464
|
-
this._onDidClose.fire(reason);
|
|
1465
|
-
}
|
|
1466
|
-
async _raceClose(promise) {
|
|
1467
|
-
if (this._state.kind === AgentHostClientState.Closed) {
|
|
1468
|
-
return Promise.reject(this._state.error);
|
|
1469
|
-
}
|
|
1470
|
-
let closeListener = Disposable.None;
|
|
1471
|
-
const closePromise = ( new Promise((_resolve, reject) => {
|
|
1472
|
-
closeListener = this.onDidClose(() => reject(
|
|
1473
|
-
this._state.kind === AgentHostClientState.Closed ? this._state.error : connectionClosedError(this._address)
|
|
1474
|
-
));
|
|
1475
|
-
}));
|
|
1476
|
-
try {
|
|
1477
|
-
return await Promise.race([promise, closePromise]);
|
|
1478
|
-
} finally {
|
|
1479
|
-
closeListener.dispose();
|
|
1480
|
-
}
|
|
1481
|
-
}
|
|
1482
|
-
_handleReverseRequest(id, method, params) {
|
|
1483
|
-
const transport = this._transport;
|
|
1484
|
-
this._pendingReverseRequests.set(transport, (this._pendingReverseRequests.get(transport) ?? 0) + 1);
|
|
1485
|
-
const sendResponse = response => {
|
|
1486
|
-
try {
|
|
1487
|
-
transport.send(response);
|
|
1488
|
-
} finally {
|
|
1489
|
-
const pending = this._pendingReverseRequests.get(transport);
|
|
1490
|
-
if (pending === 1) {
|
|
1491
|
-
this._pendingReverseRequests.delete(transport);
|
|
1492
|
-
if (transport === this._transport) {
|
|
1493
|
-
this._resetLivenessTimers();
|
|
1494
|
-
}
|
|
1495
|
-
} else if (pending !== undefined) {
|
|
1496
|
-
this._pendingReverseRequests.set(transport, pending - 1);
|
|
1497
|
-
}
|
|
1498
|
-
}
|
|
1499
|
-
};
|
|
1500
|
-
const sendResult = result => {
|
|
1501
|
-
sendResponse({
|
|
1502
|
-
jsonrpc: "2.0",
|
|
1503
|
-
id,
|
|
1504
|
-
result
|
|
1505
|
-
});
|
|
1506
|
-
};
|
|
1507
|
-
const sendError = err => {
|
|
1508
|
-
if (err instanceof AgentHostResourcePermissionError) {
|
|
1509
|
-
sendResponse({
|
|
1510
|
-
jsonrpc: "2.0",
|
|
1511
|
-
id,
|
|
1512
|
-
error: {
|
|
1513
|
-
code: AhpErrorCodes.PermissionDenied,
|
|
1514
|
-
message: err.message,
|
|
1515
|
-
data: err.request ? {
|
|
1516
|
-
request: err.request
|
|
1517
|
-
} : undefined
|
|
1518
|
-
}
|
|
1519
|
-
});
|
|
1520
|
-
return;
|
|
1521
|
-
}
|
|
1522
|
-
const fsCode = toFileSystemProviderErrorCode(err instanceof Error ? err : undefined);
|
|
1523
|
-
let code = -32e3;
|
|
1524
|
-
switch (fsCode) {
|
|
1525
|
-
case FileSystemProviderErrorCode.FileNotFound:
|
|
1526
|
-
code = AhpErrorCodes.NotFound;
|
|
1527
|
-
break;
|
|
1528
|
-
case FileSystemProviderErrorCode.NoPermissions:
|
|
1529
|
-
code = AhpErrorCodes.PermissionDenied;
|
|
1530
|
-
break;
|
|
1531
|
-
case FileSystemProviderErrorCode.FileExists:
|
|
1532
|
-
code = AhpErrorCodes.AlreadyExists;
|
|
1533
|
-
break;
|
|
1534
|
-
}
|
|
1535
|
-
sendResponse({
|
|
1536
|
-
jsonrpc: "2.0",
|
|
1537
|
-
id,
|
|
1538
|
-
error: {
|
|
1539
|
-
code,
|
|
1540
|
-
message: err instanceof Error ? err.message : String(err)
|
|
1541
|
-
}
|
|
1542
|
-
});
|
|
1543
|
-
};
|
|
1544
|
-
const p = (params ?? {});
|
|
1545
|
-
const identity = this._resourceIdentity;
|
|
1546
|
-
void (async () => {
|
|
1547
|
-
try {
|
|
1548
|
-
switch (method) {
|
|
1549
|
-
case RequestAgentHostWorkspaceTrustExtensionMethod:
|
|
1550
|
-
{
|
|
1551
|
-
if (typeof p.workspace !== "string") {
|
|
1552
|
-
throw ( new Error("Missing workspace"));
|
|
1553
|
-
}
|
|
1554
|
-
const hostWorkspace = ( URI.parse(p.workspace, true));
|
|
1555
|
-
if (hostWorkspace.scheme !== Schemas.file || !hostWorkspace.path.startsWith("/")) {
|
|
1556
|
-
throw ( new Error("Workspace must be an absolute file URI"));
|
|
1557
|
-
}
|
|
1558
|
-
const workspace = this.resourceUris.fromAgentHost(hostWorkspace);
|
|
1559
|
-
if (p.trustedParent !== undefined) {
|
|
1560
|
-
if (typeof p.trustedParent !== "string") {
|
|
1561
|
-
throw ( new Error("Invalid trustedParent"));
|
|
1562
|
-
}
|
|
1563
|
-
const hostParent = ( URI.parse(p.trustedParent, true));
|
|
1564
|
-
if (hostParent.scheme !== Schemas.file || !hostParent.path.startsWith("/")) {
|
|
1565
|
-
throw ( new Error("Trusted parent must be an absolute file URI"));
|
|
1566
|
-
}
|
|
1567
|
-
if (!isWorktreeUnderRepository(hostWorkspace, hostParent)) {
|
|
1568
|
-
throw ( new Error("Workspace is not a managed worktree under the trusted parent"));
|
|
1569
|
-
}
|
|
1570
|
-
const parent = this.resourceUris.fromAgentHost(hostParent);
|
|
1571
|
-
const parentTrust = await this._workspaceTrustManagementService.getUriTrustInfo(parent);
|
|
1572
|
-
if (parentTrust.trusted) {
|
|
1573
|
-
const workspaceTrust = await this._workspaceTrustManagementService.getUriTrustInfo(workspace);
|
|
1574
|
-
if (!workspaceTrust.trusted) {
|
|
1575
|
-
await this._workspaceTrustManagementService.setUrisTrust([workspace], true);
|
|
1576
|
-
}
|
|
1577
|
-
sendResult({
|
|
1578
|
-
trusted: true
|
|
1579
|
-
});
|
|
1580
|
-
return;
|
|
1581
|
-
}
|
|
1582
|
-
}
|
|
1583
|
-
const trusted = await this._workspaceTrustRequestService.requestResourcesTrust({
|
|
1584
|
-
uri: workspace,
|
|
1585
|
-
message: ( localize(
|
|
1586
|
-
1847,
|
|
1587
|
-
"An agent session will be able to read files, run commands, and make changes in this folder."
|
|
1588
|
-
))
|
|
1589
|
-
});
|
|
1590
|
-
sendResult({
|
|
1591
|
-
trusted: trusted === true
|
|
1592
|
-
});
|
|
1593
|
-
return;
|
|
1594
|
-
}
|
|
1595
|
-
case "resourceList":
|
|
1596
|
-
{
|
|
1597
|
-
if (!p.uri) {
|
|
1598
|
-
throw ( new Error("Missing uri"));
|
|
1599
|
-
}
|
|
1600
|
-
const result = await this._resourceService.list(identity, ( URI.parse(p.uri)));
|
|
1601
|
-
sendResult({
|
|
1602
|
-
entries: result.entries
|
|
1603
|
-
});
|
|
1604
|
-
return;
|
|
1605
|
-
}
|
|
1606
|
-
case "resourceRead":
|
|
1607
|
-
{
|
|
1608
|
-
if (!p.uri) {
|
|
1609
|
-
throw ( new Error("Missing uri"));
|
|
1610
|
-
}
|
|
1611
|
-
const result = await this._resourceService.read(identity, ( URI.parse(p.uri)));
|
|
1612
|
-
sendResult({
|
|
1613
|
-
data: encodeBase64(result.bytes),
|
|
1614
|
-
encoding: ContentEncoding.Base64
|
|
1615
|
-
});
|
|
1616
|
-
return;
|
|
1617
|
-
}
|
|
1618
|
-
case "resourceWrite":
|
|
1619
|
-
{
|
|
1620
|
-
if (!p.uri || p.data === undefined) {
|
|
1621
|
-
throw ( new Error("Missing uri or data"));
|
|
1622
|
-
}
|
|
1623
|
-
await this._resourceService.write(identity, p);
|
|
1624
|
-
sendResult({});
|
|
1625
|
-
return;
|
|
1626
|
-
}
|
|
1627
|
-
case "resourceDelete":
|
|
1628
|
-
{
|
|
1629
|
-
if (!p.uri) {
|
|
1630
|
-
throw ( new Error("Missing uri"));
|
|
1631
|
-
}
|
|
1632
|
-
await this._resourceService.del(identity, p);
|
|
1633
|
-
sendResult({});
|
|
1634
|
-
return;
|
|
1635
|
-
}
|
|
1636
|
-
case "resourceMove":
|
|
1637
|
-
{
|
|
1638
|
-
if (!p.source || !p.destination) {
|
|
1639
|
-
throw ( new Error("Missing source or destination"));
|
|
1640
|
-
}
|
|
1641
|
-
await this._resourceService.move(identity, p);
|
|
1642
|
-
sendResult({});
|
|
1643
|
-
return;
|
|
1644
|
-
}
|
|
1645
|
-
case "resourceCopy":
|
|
1646
|
-
{
|
|
1647
|
-
if (!p.source || !p.destination) {
|
|
1648
|
-
throw ( new Error("Missing source or destination"));
|
|
1649
|
-
}
|
|
1650
|
-
await this._resourceService.copy(identity, p);
|
|
1651
|
-
sendResult({});
|
|
1652
|
-
return;
|
|
1653
|
-
}
|
|
1654
|
-
case "resourceResolve":
|
|
1655
|
-
{
|
|
1656
|
-
if (!p.uri) {
|
|
1657
|
-
throw ( new Error("Missing uri"));
|
|
1658
|
-
}
|
|
1659
|
-
const result = await this._resourceService.resolve(identity, p);
|
|
1660
|
-
sendResult(result);
|
|
1661
|
-
return;
|
|
1662
|
-
}
|
|
1663
|
-
case "resourceMkdir":
|
|
1664
|
-
{
|
|
1665
|
-
if (!p.uri) {
|
|
1666
|
-
throw ( new Error("Missing uri"));
|
|
1667
|
-
}
|
|
1668
|
-
await this._resourceService.mkdir(identity, p);
|
|
1669
|
-
sendResult({});
|
|
1670
|
-
return;
|
|
1671
|
-
}
|
|
1672
|
-
case "resourceRequest":
|
|
1673
|
-
{
|
|
1674
|
-
try {
|
|
1675
|
-
await this._resourceService.request(identity, p);
|
|
1676
|
-
sendResult({});
|
|
1677
|
-
} catch (err) {
|
|
1678
|
-
if (err instanceof CancellationError) {
|
|
1679
|
-
throw ( new AgentHostResourcePermissionError(undefined));
|
|
1680
|
-
}
|
|
1681
|
-
throw err;
|
|
1682
|
-
}
|
|
1683
|
-
return;
|
|
1684
|
-
}
|
|
1685
|
-
default:
|
|
1686
|
-
this._logService.warn(`[RemoteAgentHostProtocol] Unhandled reverse request: ${method}`);
|
|
1687
|
-
throw ( new Error(`Unknown method: ${method}`));
|
|
1688
|
-
}
|
|
1689
|
-
} catch (err) {
|
|
1690
|
-
sendError(err);
|
|
1691
|
-
}
|
|
1692
|
-
})();
|
|
1693
|
-
}
|
|
1694
|
-
_sendNotification(method, params) {
|
|
1695
|
-
this._sendNotificationMessage(method, params);
|
|
1696
|
-
}
|
|
1697
|
-
_sendExtensionNotification(method, params, sendDuringReconnect = false) {
|
|
1698
|
-
this._sendNotificationMessage(method, params, sendDuringReconnect);
|
|
1699
|
-
}
|
|
1700
|
-
_sendNotificationMessage(method, params, sendDuringReconnect = false) {
|
|
1701
|
-
if (this._state.kind === AgentHostClientState.Closed || this._state.kind === AgentHostClientState.Incompatible) {
|
|
1702
|
-
return;
|
|
1703
|
-
}
|
|
1704
|
-
const message = {
|
|
1705
|
-
jsonrpc: "2.0",
|
|
1706
|
-
method,
|
|
1707
|
-
params
|
|
1708
|
-
};
|
|
1709
|
-
if (isClientTransport(this._transport) && this._state.kind === AgentHostClientState.Connecting) {
|
|
1710
|
-
this._state.outbox.push(message);
|
|
1711
|
-
return;
|
|
1712
|
-
}
|
|
1713
|
-
if (this._state.kind === AgentHostClientState.Reconnecting && !sendDuringReconnect) {
|
|
1714
|
-
this._state.reconnect.outbox.push(message);
|
|
1715
|
-
return;
|
|
1716
|
-
}
|
|
1717
|
-
this._transport.send(message);
|
|
1718
|
-
}
|
|
1719
|
-
_sendRequest(method, params) {
|
|
1720
|
-
return this._dispatchRequest(method, params);
|
|
1721
|
-
}
|
|
1722
|
-
_sendExtensionRequest(method, params) {
|
|
1723
|
-
return this._dispatchRequest(method, params);
|
|
1724
|
-
}
|
|
1725
|
-
_updateTelemetryLevel() {
|
|
1726
|
-
this._dispatchRootConfig({
|
|
1727
|
-
[AgentHostTelemetryLevelConfigKey]: telemetryLevelToAgentHostConfigValue(this._effectiveTelemetryLevel())
|
|
1728
|
-
});
|
|
1729
|
-
}
|
|
1730
|
-
_effectiveTelemetryLevel() {
|
|
1731
|
-
return Math.min(
|
|
1732
|
-
getTelemetryLevel(this._configurationService),
|
|
1733
|
-
this._telemetryService.telemetryLevel
|
|
1734
|
-
);
|
|
1735
|
-
}
|
|
1736
|
-
_dispatchRootConfig(config) {
|
|
1737
|
-
this.dispatchAction(ROOT_STATE_URI, {
|
|
1738
|
-
type: ActionType.RootConfigChanged,
|
|
1739
|
-
config
|
|
1740
|
-
}, this._clientId, 0);
|
|
1741
|
-
}
|
|
1742
|
-
_updateDisableRepoInfoTelemetry() {
|
|
1743
|
-
const disabled = this._configurationService.getValue(DISABLE_REPO_INFO_TELEMETRY_SETTING_ID) === true;
|
|
1744
|
-
this._dispatchRootConfig({
|
|
1745
|
-
[AgentHostDisableRepoInfoTelemetryConfigKey]: disabled
|
|
1746
|
-
});
|
|
1747
|
-
}
|
|
1748
|
-
_updateTerminalAutoApproveEnabled() {
|
|
1749
|
-
const enabled = this._configurationService.getValue(TERMINAL_AUTO_APPROVE_ENABLED_SETTING_ID) !== false;
|
|
1750
|
-
this._dispatchRootConfig({
|
|
1751
|
-
[AgentHostTerminalAutoApproveEnabledConfigKey]: enabled
|
|
1752
|
-
});
|
|
1753
|
-
}
|
|
1754
|
-
_updateTerminalAutoApproveRules() {
|
|
1755
|
-
this._dispatchRootConfig({
|
|
1756
|
-
[AgentHostTerminalAutoApproveRulesConfigKey]: getAgentHostTerminalAutoApproveRulesConfig(this._configurationService)
|
|
1757
|
-
});
|
|
1758
|
-
}
|
|
1759
|
-
_updateManagedSettingsPermissions(sendDuringReconnect = false) {
|
|
1760
|
-
const permissions = this._resourceIdentity === LOCAL_AGENT_HOST_RESOURCE_IDENTITY ? resolveManagedSettingsPermissions(this._configurationService) : {};
|
|
1761
|
-
this._sendExtensionNotification("setClientManagedSettingsPermissions", {
|
|
1762
|
-
permissions
|
|
1763
|
-
}, sendDuringReconnect);
|
|
1764
|
-
}
|
|
1765
|
-
async _dispatchRequest(method, params, options = {}) {
|
|
1766
|
-
if (this._state.kind === AgentHostClientState.Closed) {
|
|
1767
|
-
throw this._state.error;
|
|
1768
|
-
}
|
|
1769
|
-
if (this._state.kind === AgentHostClientState.Incompatible) {
|
|
1770
|
-
if (!options.allowIncompatibleUpgrade) {
|
|
1771
|
-
throw this._state.error;
|
|
1772
|
-
}
|
|
1773
|
-
const {
|
|
1774
|
-
request,
|
|
1775
|
-
result
|
|
1776
|
-
} = this._createRequest(method, params);
|
|
1777
|
-
this._transport.send(request);
|
|
1778
|
-
return result;
|
|
1779
|
-
}
|
|
1780
|
-
if (!options.bypassInitializeQueue && isClientTransport(this._transport) && this._state.kind === AgentHostClientState.Connecting) {
|
|
1781
|
-
const {
|
|
1782
|
-
request,
|
|
1783
|
-
result
|
|
1784
|
-
} = this._createRequest(method, params);
|
|
1785
|
-
this._state.outbox.push(request);
|
|
1786
|
-
return result;
|
|
1787
|
-
}
|
|
1788
|
-
while (!options.bypassReconnectGate && this._state.kind === AgentHostClientState.Reconnecting) {
|
|
1789
|
-
const current = this._state;
|
|
1790
|
-
if (current.kind !== AgentHostClientState.Reconnecting) {
|
|
1791
|
-
break;
|
|
1792
|
-
}
|
|
1793
|
-
try {
|
|
1794
|
-
await current.reconnect.gate.p;
|
|
1795
|
-
} catch {}
|
|
1796
|
-
}
|
|
1797
|
-
const current = this._state;
|
|
1798
|
-
if (current.kind === AgentHostClientState.Closed || current.kind === AgentHostClientState.Incompatible) {
|
|
1799
|
-
throw current.error;
|
|
1800
|
-
}
|
|
1801
|
-
const {
|
|
1802
|
-
request,
|
|
1803
|
-
result
|
|
1804
|
-
} = this._createRequest(method, params);
|
|
1805
|
-
this._transport.send(request);
|
|
1806
|
-
return result;
|
|
1807
|
-
}
|
|
1808
|
-
_createRequest(method, params) {
|
|
1809
|
-
const id = this._nextRequestId++;
|
|
1810
|
-
const deferred = ( new DeferredPromise());
|
|
1811
|
-
this._pendingRequests.set(id, {
|
|
1812
|
-
deferred,
|
|
1813
|
-
suppressNotFoundWarning: isFileResourceRead(method, params),
|
|
1814
|
-
sentAt: Date.now()
|
|
1815
|
-
});
|
|
1816
|
-
return {
|
|
1817
|
-
request: {
|
|
1818
|
-
jsonrpc: "2.0",
|
|
1819
|
-
id,
|
|
1820
|
-
method,
|
|
1821
|
-
params
|
|
1822
|
-
},
|
|
1823
|
-
result: deferred.p
|
|
1824
|
-
};
|
|
1825
|
-
}
|
|
1826
|
-
_shouldLogFailedRequest(request, error) {
|
|
1827
|
-
if (error.code === AhpErrorCodes.NotFound && request.suppressNotFoundWarning) {
|
|
1828
|
-
return false;
|
|
1829
|
-
}
|
|
1830
|
-
return true;
|
|
1831
|
-
}
|
|
1832
|
-
_toProtocolError(error) {
|
|
1833
|
-
return ( new ProtocolError(error.code, error.message, error.data));
|
|
1834
|
-
}
|
|
1835
|
-
_rejectPendingRequests(error) {
|
|
1836
|
-
for (const pending of ( this._pendingRequests.values())) {
|
|
1837
|
-
pending.deferred.error(error);
|
|
1838
|
-
}
|
|
1839
|
-
this._pendingRequests.clear();
|
|
1840
|
-
}
|
|
1841
|
-
_resetLivenessTimers() {
|
|
1842
|
-
this._cancelLivenessTimers();
|
|
1843
|
-
if (this._state.kind === AgentHostClientState.Incompatible || this._state.kind === AgentHostClientState.Reconnecting || this._state.kind === AgentHostClientState.Closed) {
|
|
1844
|
-
return;
|
|
1845
|
-
}
|
|
1846
|
-
this._pingTimer.cancelAndSet(() => this._onPingTimer(), PING_INTERVAL_MS);
|
|
1847
|
-
this._closeTimer.cancelAndSet(() => this._onCloseTimer(), PING_INTERVAL_MS + LIVENESS_TIMEOUT_MS);
|
|
1848
|
-
}
|
|
1849
|
-
_cancelLivenessTimers() {
|
|
1850
|
-
this._pingTimer.cancel();
|
|
1851
|
-
this._closeTimer.cancel();
|
|
1852
|
-
this._livenessDeferred = false;
|
|
1853
|
-
this._livenessDeferredSince = undefined;
|
|
1854
|
-
}
|
|
1855
|
-
_onPingTimer() {
|
|
1856
|
-
if (this._state.kind === AgentHostClientState.Incompatible || this._state.kind === AgentHostClientState.Closed || this._state.kind === AgentHostClientState.Reconnecting) {
|
|
1857
|
-
return;
|
|
1858
|
-
}
|
|
1859
|
-
void this.ping().catch(() => undefined);
|
|
1860
|
-
}
|
|
1861
|
-
_onCloseTimer() {
|
|
1862
|
-
if (this._state.kind === AgentHostClientState.Incompatible || this._state.kind === AgentHostClientState.Closed || this._state.kind === AgentHostClientState.Reconnecting) {
|
|
1863
|
-
return;
|
|
1864
|
-
}
|
|
1865
|
-
if (this._transport.clientConnectionKind === AgentHostClientConnectionKind.Local) {
|
|
1866
|
-
return;
|
|
1867
|
-
}
|
|
1868
|
-
const pendingReverseRequests = this._pendingReverseRequests.get(this._transport) ?? 0;
|
|
1869
|
-
if (pendingReverseRequests > 0 || this._loadEstimator.hasHighLoad()) {
|
|
1870
|
-
this._deferLivenessCheck(pendingReverseRequests);
|
|
1871
|
-
return;
|
|
1872
|
-
}
|
|
1873
|
-
if (this._livenessDeferred) {
|
|
1874
|
-
this._livenessDeferred = false;
|
|
1875
|
-
this._livenessDeferredSince = undefined;
|
|
1876
|
-
this._pingTimer.cancelAndSet(() => this._onPingTimer(), PING_INTERVAL_MS);
|
|
1877
|
-
this._closeTimer.cancelAndSet(() => this._onCloseTimer(), PING_INTERVAL_MS + LIVENESS_TIMEOUT_MS);
|
|
1878
|
-
return;
|
|
1879
|
-
}
|
|
1880
|
-
const silence = Date.now() - this._lastReadTime;
|
|
1881
|
-
this._logService.info(
|
|
1882
|
-
`[RemoteAgentHostProtocol] Liveness: no message from ${this._address} for ${silence}ms; forcing close to trigger reconnect.`
|
|
1883
|
-
);
|
|
1884
|
-
this._transportListeners.clear();
|
|
1885
|
-
if (this._transportFactory) {
|
|
1886
|
-
this._rejectPendingRequests(connectionTimeoutError(this._address, silence));
|
|
1887
|
-
this._handleTransportClose();
|
|
1888
|
-
return;
|
|
1889
|
-
}
|
|
1890
|
-
this._handleClose(connectionTimeoutError(this._address, silence));
|
|
1891
|
-
}
|
|
1892
|
-
_deferLivenessCheck(pendingReverseRequests) {
|
|
1893
|
-
const now = Date.now();
|
|
1894
|
-
if (!this._livenessDeferred) {
|
|
1895
|
-
this._livenessDeferred = true;
|
|
1896
|
-
this._livenessDeferredSince = now;
|
|
1897
|
-
}
|
|
1898
|
-
const deferredSince = this._livenessDeferredSince ?? now;
|
|
1899
|
-
this._logService.trace(
|
|
1900
|
-
`[RemoteAgentHostProtocol] Liveness: deferring close for ${now - deferredSince}ms; ${pendingReverseRequests} reverse request(s) outstanding.`
|
|
1901
|
-
);
|
|
1902
|
-
this._pingTimer.cancelAndSet(() => this._onPingTimer(), PING_INTERVAL_MS);
|
|
1903
|
-
this._closeTimer.cancelAndSet(() => this._onCloseTimer(), PING_INTERVAL_MS);
|
|
1904
|
-
}
|
|
1905
|
-
nextClientSeq() {
|
|
1906
|
-
return this._nextClientSeq++;
|
|
1907
|
-
}
|
|
1908
|
-
};
|
|
1909
|
-
AgentHostProtocolClient = ( __decorate([( __param(3, ILogService)), ( __param(4, IAgentHostResourceService)), ( __param(5, IConfigurationService)), ( __param(6, ITelemetryService)), ( __param(7, IWorkspaceTrustEnablementService)), ( __param(8, IWorkspaceTrustManagementService)), ( __param(9, IWorkspaceTrustRequestService))], AgentHostProtocolClient));
|
|
1910
|
-
|
|
1911
|
-
export { AgentHostClientState, AgentHostProtocolClient, InitialAuthenticationError };
|