@codingame/monaco-vscode-chat-service-override 32.0.1 → 33.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +1 -1
- package/index.js +15 -5
- package/package.json +5 -5
- package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostProtocolClient.d.ts +170 -24
- package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostProtocolClient.js +372 -66
- package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.d.ts +18 -1
- package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.js +160 -31
- package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemService.d.ts +8 -0
- package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemService.js +19 -0
- package/vscode/src/vs/platform/agentHost/common/agentHostSchema.d.ts +134 -0
- package/vscode/src/vs/platform/agentHost/common/agentHostSchema.js +257 -0
- package/vscode/src/vs/platform/agentHost/common/agentService.d.ts +84 -3
- package/vscode/src/vs/platform/agentHost/common/agentService.js +9 -1
- package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.d.ts +61 -1
- package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.js +61 -1
- package/vscode/src/vs/platform/agentHost/common/state/protocol/errors.js +3 -1
- package/vscode/src/vs/platform/agentHost/common/state/protocol/reducers.js +1 -1
- package/vscode/src/vs/platform/agentHost/common/state/protocol/version/registry.d.ts +1 -1
- package/vscode/src/vs/platform/agentHost/common/state/protocol/version/registry.js +1 -1
- package/vscode/src/vs/platform/agentHost/common/state/sessionActions.d.ts +4 -4
- package/vscode/src/vs/platform/agentHost/common/state/sessionActions.js +1 -1
- package/vscode/src/vs/platform/networkFilter/common/networkFilterService.d.ts +2 -7
- package/vscode/src/vs/platform/networkFilter/common/networkFilterService.js +8 -29
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityService.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.js +16 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +60 -60
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAgentRecommendationActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +10 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatForkActions.d.ts +10 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatForkActions.js +180 -174
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatLanguageModelActions.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatNewActions.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatOpenAgentDebugPanelAction.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPluginActions.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPromptNavigationActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQueueActions.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +18 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/createPluginAction.js +20 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/exportAgentHostDebugLogsAction.d.ts +64 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/exportAgentHostDebugLogsAction.js +330 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/openCopilotCliStateFileAction.d.ts +24 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/openCopilotCliStateFileAction.js +77 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditorInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPermissionUiContribution.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostUntitledProvisionalSessionService.d.ts +51 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostUntitledProvisionalSessionService.js +267 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.js +4 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.js +53 -53
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsQuickAccess.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjection.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionsExperiments.contribution.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.d.ts +5 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.js +30 -28
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccess.js +17 -17
- 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 +26 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.d.ts +7 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.js +150 -119
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.contribution.js +45 -44
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.js +58 -76
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePagePromptLaunchers.js +25 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationGroupHeaderRenderer.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedAgentPluginDetail.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedMcpServerDetail.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.d.ts +2 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.js +88 -70
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationManagement.css +82 -56
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationWelcomePromptLaunchers.css +10 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.d.ts +2 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.js +89 -71
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +2 -2843
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.shared.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.shared.contribution.js +2934 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.js +32 -32
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheExplorerView.js +99 -99
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugDetailPanel.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditorInput.js +2 -2
- 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 +22 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHomeView.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHookContentRenderer.js +17 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.js +24 -24
- 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 +33 -33
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugToolCallContentRenderer.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatImageCarouselService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.js +53 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.js +131 -61
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/media/chatModelsWidget.css +22 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.d.ts +23 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +91 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +30 -30
- package/vscode/src/vs/workbench/contrib/chat/browser/chatRepoInfo.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.js +23 -21
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupGrowthSession.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.js +29 -28
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.js +19 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.d.ts +15 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.js +203 -163
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.d.ts +1 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.js +31 -54
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusItemService.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/media/chatStatus.css +88 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipCatalog.js +19 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWindowNotifier.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/claudePluginRecommendations.js +17 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/contextContrib/chatContext.contribution.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contextContrib/chatContext.contribution.js +91 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/copilotCliEventsUri.d.ts +52 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/copilotCliEventsUri.js +82 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/defaultModelContribution.d.ts +21 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/defaultModelContribution.js +55 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/enablementActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/enablementStatusWidget.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/hasByokModelsContribution.d.ts +51 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/hasByokModelsContribution.js +106 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.js +4 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorContribution.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginAutoUpdate.d.ts +38 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginAutoUpdate.js +59 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginGitCommandService.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.js +25 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.js +15 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginUrlHandler.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.js +27 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionOverlay.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptFileContributions.js +4 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptUrlHandler.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/skillActions.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/promptsDebugContribution.js +20 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.js +39 -39
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.js +38 -28
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.js +5 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolResultCompressorService.d.ts +5 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolResultCompressorService.js +106 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.js +6 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/utilityModelContribution.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/utilityModelContribution.js +75 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/{toolInvocationParts/chatToolOutputStateCache.d.ts → chatOutputPartStateCache.d.ts} +5 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/{toolInvocationParts/chatToolOutputStateCache.js → chatOutputPartStateCache.js} +19 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletions.js +58 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorContrib.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorHover.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/chatQuick.js +1 -1
- 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.js +18 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.js +13 -5
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceTelemetry.js +6 -2
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.js +19 -18
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +18 -18
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/PromptHeaderDefinitionProvider.js +1 -2
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +6 -7
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.js +14 -15
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.js +155 -156
- package/vscode/src/vs/workbench/contrib/chat/common/tools/copilotToolIds.d.ts +6 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/copilotToolIds.js +12 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/toolResultCompressor.d.ts +88 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/toolResultCompressor.js +25 -0
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +1 -1
- package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarousel.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarousel.contribution.js +237 -0
- package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarouselEditor.d.ts +66 -0
- package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarouselEditor.js +600 -0
- package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarouselEditorInput.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarouselEditorInput.js +47 -0
- package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarouselTypes.d.ts +22 -0
- package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarouselTypes.js +7 -0
- package/vscode/src/vs/workbench/contrib/imageCarousel/browser/media/imageCarousel.css +298 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +15 -15
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatDefaultModel.js +2 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +4 -4
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.js +14 -14
- 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 +10 -10
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +5 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +1 -1
- package/vscode/src/vs/workbench/contrib/remoteCodingAgents/browser/remoteCodingAgents.contribution.js +7 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.js +16 -16
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +20 -20
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalLastCommandTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.d.ts +12 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +78 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalSelectionTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/killTerminalTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +2 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sendToTerminalTool.js +15 -11
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/createAndRunTaskTool.js +14 -14
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/getTaskOutputTool.js +7 -9
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/runTaskTool.js +14 -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/terminalCommandParser.d.ts +60 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalCommandParser.js +286 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalOutputCache.d.ts +24 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalOutputCache.js +285 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalOutputCompressor.d.ts +19 -12
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalOutputCompressor.js +415 -47
- package/vscode/src/vs/workbench/services/agentHost/common/agentHostFileSystemService.d.ts +2 -7
- package/vscode/src/vs/workbench/services/agentHost/common/agentHostFileSystemService.js +1 -1
- package/vscode/src/vs/base/common/defaultAccount.d.ts +0 -69
- package/vscode/src/vs/base/common/defaultAccount.js +0 -12
- package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/aiEditTelemetry/aiEditTelemetryServiceImpl.d.ts +0 -15
- package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/aiEditTelemetry/aiEditTelemetryServiceImpl.js +0 -85
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
2
|
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
-
import {
|
|
3
|
+
import { TimeoutTimer, DeferredPromise } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
4
4
|
import { CancellationError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
|
|
5
5
|
import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
6
|
-
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
6
|
+
import { Disposable, MutableDisposable, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
7
7
|
import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
|
|
8
8
|
import { hasKey } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
9
9
|
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
@@ -11,29 +11,36 @@ import { generateUuid } from '@codingame/monaco-vscode-api/vscode/vs/base/common
|
|
|
11
11
|
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
12
12
|
import { toFileSystemProviderErrorCode, FileSystemProviderErrorCode } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files';
|
|
13
13
|
import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
|
|
14
|
+
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
14
15
|
import { AgentSession } from '../common/agentService.js';
|
|
15
16
|
import { AgentSubscriptionManager } from '../common/state/agentSubscription.js';
|
|
16
17
|
import { agentHostAuthority, fromAgentHostUri, toAgentHostUri } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agentHostUri';
|
|
17
18
|
import { AgentHostPermissionMode } from '../common/agentHostPermissionService.js';
|
|
18
19
|
import { IAgentHostPermissionService } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agentHostPermissionService.service';
|
|
19
|
-
import { ActionType } from '@codingame/monaco-vscode-
|
|
20
|
+
import { ActionType } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/actions';
|
|
20
21
|
import '@codingame/monaco-vscode-xterm-common/vscode/vs/platform/agentHost/common/state/protocol/notifications';
|
|
21
|
-
import { ROOT_STATE_URI } from '@codingame/monaco-vscode-
|
|
22
|
+
import { ROOT_STATE_URI } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/sessionState';
|
|
22
23
|
import { PROTOCOL_VERSION } from '../common/state/protocol/version/registry.js';
|
|
23
24
|
import { ProtocolError, isJsonRpcRequest, isJsonRpcResponse, isJsonRpcNotification } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/sessionProtocol';
|
|
24
25
|
import { isClientTransport } from '../common/state/sessionTransport.js';
|
|
25
26
|
import { AhpErrorCodes } from '../common/state/protocol/errors.js';
|
|
26
|
-
import { ContentEncoding } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/commands';
|
|
27
|
+
import { ReconnectResultType, ContentEncoding } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/commands';
|
|
27
28
|
import { decodeBase64, VSBuffer, encodeBase64 } from '@codingame/monaco-vscode-api/vscode/vs/base/common/buffer';
|
|
29
|
+
import { LoadEstimator } from '@codingame/monaco-vscode-api/vscode/vs/base/parts/ipc/common/ipc.net';
|
|
30
|
+
import { TELEMETRY_SETTING_ID, TELEMETRY_OLD_SETTING_ID, TELEMETRY_CRASH_REPORTER_SETTING_ID } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry';
|
|
31
|
+
import { getTelemetryLevel } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetryUtils';
|
|
32
|
+
import { AgentHostTelemetryLevelConfigKey, telemetryLevelToAgentHostConfigValue } from '../common/agentHostSchema.js';
|
|
28
33
|
import { SessionStatus } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/state';
|
|
29
34
|
|
|
30
35
|
const AHP_CLIENT_CONNECTION_CLOSED = -32e3;
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
|
|
36
|
+
const RECONNECT_INITIAL_DELAY_MS = 1_000;
|
|
37
|
+
const RECONNECT_MAX_DELAY_MS = 30_000;
|
|
38
|
+
const PING_INTERVAL_MS = 5_000;
|
|
39
|
+
const LIVENESS_TIMEOUT_MS = 20_000;
|
|
40
|
+
function connectionTimeoutError(address, silenceMs) {
|
|
34
41
|
return ( new ProtocolError(
|
|
35
42
|
AHP_CLIENT_CONNECTION_CLOSED,
|
|
36
|
-
`Connection appears dead: ${address}; no message received for ${
|
|
43
|
+
`Connection appears dead: ${address}; no message received for ${silenceMs}ms.`
|
|
37
44
|
));
|
|
38
45
|
}
|
|
39
46
|
function connectionClosedError(address) {
|
|
@@ -42,6 +49,16 @@ function connectionClosedError(address) {
|
|
|
42
49
|
function connectionDisposedError(address) {
|
|
43
50
|
return ( new ProtocolError(AHP_CLIENT_CONNECTION_CLOSED, `Connection disposed: ${address}`));
|
|
44
51
|
}
|
|
52
|
+
function transportLostError(address) {
|
|
53
|
+
return ( new ProtocolError(AHP_CLIENT_CONNECTION_CLOSED, `Transport lost (reconnecting): ${address}`));
|
|
54
|
+
}
|
|
55
|
+
var AgentHostClientState;
|
|
56
|
+
(function(AgentHostClientState) {
|
|
57
|
+
AgentHostClientState["Connecting"] = "connecting";
|
|
58
|
+
AgentHostClientState["Connected"] = "connected";
|
|
59
|
+
AgentHostClientState["Reconnecting"] = "reconnecting";
|
|
60
|
+
AgentHostClientState["Closed"] = "closed";
|
|
61
|
+
})(AgentHostClientState || (AgentHostClientState = {}));
|
|
45
62
|
let RemoteAgentHostProtocolClient = class RemoteAgentHostProtocolClient extends Disposable {
|
|
46
63
|
get clientId() {
|
|
47
64
|
return this._clientId;
|
|
@@ -52,12 +69,25 @@ let RemoteAgentHostProtocolClient = class RemoteAgentHostProtocolClient extends
|
|
|
52
69
|
get defaultDirectory() {
|
|
53
70
|
return this._defaultDirectory;
|
|
54
71
|
}
|
|
55
|
-
|
|
72
|
+
get connectionState() {
|
|
73
|
+
return this._state.kind;
|
|
74
|
+
}
|
|
75
|
+
constructor(
|
|
76
|
+
address,
|
|
77
|
+
transportOrFactory,
|
|
78
|
+
loadEstimator,
|
|
79
|
+
_logService,
|
|
80
|
+
_fileService,
|
|
81
|
+
_permissionService,
|
|
82
|
+
_configurationService
|
|
83
|
+
) {
|
|
56
84
|
super();
|
|
57
85
|
this._logService = _logService;
|
|
58
86
|
this._fileService = _fileService;
|
|
59
87
|
this._permissionService = _permissionService;
|
|
88
|
+
this._configurationService = _configurationService;
|
|
60
89
|
this._clientId = generateUuid();
|
|
90
|
+
this._transportListeners = this._register(( new MutableDisposable()));
|
|
61
91
|
this._serverSeq = 0;
|
|
62
92
|
this._nextClientSeq = 1;
|
|
63
93
|
this._completionTriggerCharacters = [];
|
|
@@ -67,20 +97,27 @@ let RemoteAgentHostProtocolClient = class RemoteAgentHostProtocolClient extends
|
|
|
67
97
|
this.onDidNotification = this._onDidNotification.event;
|
|
68
98
|
this._onDidClose = this._register(( new Emitter()));
|
|
69
99
|
this.onDidClose = this._onDidClose.event;
|
|
100
|
+
this._onDidChangeConnectionState = this._register(( new Emitter()));
|
|
101
|
+
this.onDidChangeConnectionState = this._onDidChangeConnectionState.event;
|
|
102
|
+
this._state = {
|
|
103
|
+
kind: AgentHostClientState.Connecting
|
|
104
|
+
};
|
|
70
105
|
this._pendingRequests = ( new Map());
|
|
71
106
|
this._nextRequestId = 1;
|
|
72
|
-
this._isClosed = false;
|
|
73
107
|
this._lastReadTime = Date.now();
|
|
74
|
-
this.
|
|
108
|
+
this._pingTimer = this._register(new TimeoutTimer());
|
|
109
|
+
this._closeTimer = this._register(new TimeoutTimer());
|
|
75
110
|
this._grantedCustomizationUris = ( new Set());
|
|
76
111
|
this._address = address;
|
|
77
112
|
this._connectionAuthority = agentHostAuthority(address);
|
|
78
|
-
this.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
113
|
+
this._loadEstimator = loadEstimator ?? LoadEstimator.getInstance();
|
|
114
|
+
if (typeof transportOrFactory === "function") {
|
|
115
|
+
this._transportFactory = transportOrFactory;
|
|
116
|
+
this._installTransport(transportOrFactory());
|
|
117
|
+
} else {
|
|
118
|
+
this._transportFactory = undefined;
|
|
119
|
+
this._installTransport(transportOrFactory);
|
|
120
|
+
}
|
|
84
121
|
this._subscriptionManager = this._register(( new AgentSubscriptionManager(
|
|
85
122
|
this._clientId,
|
|
86
123
|
() => this.nextClientSeq(),
|
|
@@ -91,7 +128,43 @@ let RemoteAgentHostProtocolClient = class RemoteAgentHostProtocolClient extends
|
|
|
91
128
|
this._register(this.onDidAction(envelope => {
|
|
92
129
|
this._subscriptionManager.receiveEnvelope(envelope);
|
|
93
130
|
}));
|
|
94
|
-
this.
|
|
131
|
+
this._register(this._configurationService.onDidChangeConfiguration(e => {
|
|
132
|
+
if (e.affectsConfiguration(TELEMETRY_SETTING_ID) || e.affectsConfiguration(TELEMETRY_OLD_SETTING_ID) || e.affectsConfiguration(TELEMETRY_CRASH_REPORTER_SETTING_ID)) {
|
|
133
|
+
if (this._state.kind !== AgentHostClientState.Connected) {
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
this._updateTelemetryLevel();
|
|
137
|
+
}
|
|
138
|
+
}));
|
|
139
|
+
this._resetLivenessTimers();
|
|
140
|
+
}
|
|
141
|
+
_installTransport(transport) {
|
|
142
|
+
const listeners = ( new DisposableStore());
|
|
143
|
+
listeners.add(transport);
|
|
144
|
+
listeners.add(transport.onMessage(msg => this._handleMessage(msg)));
|
|
145
|
+
listeners.add(transport.onClose(() => this._handleTransportClose()));
|
|
146
|
+
this._transport = transport;
|
|
147
|
+
this._transportListeners.value = listeners;
|
|
148
|
+
}
|
|
149
|
+
_transitionTo(next) {
|
|
150
|
+
if (this._state.kind === next.kind) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
this._state = next;
|
|
154
|
+
this._onDidChangeConnectionState.fire(next.kind);
|
|
155
|
+
}
|
|
156
|
+
_newReconnectGate() {
|
|
157
|
+
const deferred = ( new DeferredPromise());
|
|
158
|
+
deferred.p.then(undefined, () => {});
|
|
159
|
+
return deferred;
|
|
160
|
+
}
|
|
161
|
+
_newReconnectState() {
|
|
162
|
+
return {
|
|
163
|
+
gate: this._newReconnectGate(),
|
|
164
|
+
outbox: [],
|
|
165
|
+
attempt: 0,
|
|
166
|
+
timeoutHandle: undefined
|
|
167
|
+
};
|
|
95
168
|
}
|
|
96
169
|
dispose() {
|
|
97
170
|
this._handleClose(connectionDisposedError(this._address));
|
|
@@ -121,6 +194,192 @@ let RemoteAgentHostProtocolClient = class RemoteAgentHostProtocolClient extends
|
|
|
121
194
|
}
|
|
122
195
|
}
|
|
123
196
|
this._completionTriggerCharacters = result.completionTriggerCharacters ?? [];
|
|
197
|
+
this._updateTelemetryLevel();
|
|
198
|
+
this._transitionTo({
|
|
199
|
+
kind: AgentHostClientState.Connected
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
_handleTransportClose() {
|
|
203
|
+
switch (this._state.kind) {
|
|
204
|
+
case AgentHostClientState.Closed:
|
|
205
|
+
return;
|
|
206
|
+
case AgentHostClientState.Connecting:
|
|
207
|
+
this._handleClose(connectionClosedError(this._address));
|
|
208
|
+
return;
|
|
209
|
+
case AgentHostClientState.Connected:
|
|
210
|
+
{
|
|
211
|
+
if (!this._transportFactory) {
|
|
212
|
+
this._handleClose(connectionClosedError(this._address));
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
this._logService.info(
|
|
216
|
+
`[RemoteAgentHostProtocol] Transport lost for ${this._address}; scheduling reconnect.`
|
|
217
|
+
);
|
|
218
|
+
this._transitionTo({
|
|
219
|
+
kind: AgentHostClientState.Reconnecting,
|
|
220
|
+
reconnect: this._newReconnectState()
|
|
221
|
+
});
|
|
222
|
+
this._cancelLivenessTimers();
|
|
223
|
+
this._rejectPendingRequests(transportLostError(this._address));
|
|
224
|
+
this._scheduleReconnect();
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
case AgentHostClientState.Reconnecting:
|
|
228
|
+
this._logService.info(
|
|
229
|
+
`[RemoteAgentHostProtocol] Transport lost for ${this._address} mid-reconnect; aborting the current attempt.`
|
|
230
|
+
);
|
|
231
|
+
this._cancelLivenessTimers();
|
|
232
|
+
this._rejectPendingRequests(transportLostError(this._address));
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
_scheduleReconnect() {
|
|
237
|
+
if (this._state.kind !== AgentHostClientState.Reconnecting || !this._transportFactory) {
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
const reconnect = this._state.reconnect;
|
|
241
|
+
if (reconnect.timeoutHandle !== undefined) {
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
const attempt = reconnect.attempt + 1;
|
|
245
|
+
const delay = Math.min(
|
|
246
|
+
RECONNECT_INITIAL_DELAY_MS * Math.pow(2, attempt - 1),
|
|
247
|
+
RECONNECT_MAX_DELAY_MS
|
|
248
|
+
);
|
|
249
|
+
this._logService.info(
|
|
250
|
+
`[RemoteAgentHostProtocol] Reconnecting to ${this._address} in ${delay}ms (attempt ${attempt}).`
|
|
251
|
+
);
|
|
252
|
+
reconnect.timeoutHandle = setTimeout(() => {
|
|
253
|
+
if (this._state.kind === AgentHostClientState.Reconnecting) {
|
|
254
|
+
this._state.reconnect.timeoutHandle = undefined;
|
|
255
|
+
}
|
|
256
|
+
void this._attemptReconnect();
|
|
257
|
+
}, delay);
|
|
258
|
+
}
|
|
259
|
+
async _attemptReconnect() {
|
|
260
|
+
if (this._state.kind !== AgentHostClientState.Reconnecting || !this._transportFactory) {
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
const reconnect = this._state.reconnect;
|
|
264
|
+
reconnect.attempt++;
|
|
265
|
+
let transport;
|
|
266
|
+
try {
|
|
267
|
+
transport = this._transportFactory();
|
|
268
|
+
this._installTransport(transport);
|
|
269
|
+
if (isClientTransport(transport)) {
|
|
270
|
+
await transport.connect();
|
|
271
|
+
}
|
|
272
|
+
if (this._state.kind !== AgentHostClientState.Reconnecting) {
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
const subscriptions = ( this._subscriptionManager.currentSubscriptionUris().map(u => ( u.toString())));
|
|
276
|
+
if (!subscriptions.includes(ROOT_STATE_URI)) {
|
|
277
|
+
subscriptions.unshift(ROOT_STATE_URI);
|
|
278
|
+
}
|
|
279
|
+
const lastSeenServerSeq = this._serverSeq;
|
|
280
|
+
const result = await this._dispatchRequest("reconnect", {
|
|
281
|
+
clientId: this._clientId,
|
|
282
|
+
lastSeenServerSeq,
|
|
283
|
+
subscriptions
|
|
284
|
+
}, {
|
|
285
|
+
bypassReconnectGate: true
|
|
286
|
+
});
|
|
287
|
+
if (this._state.kind !== AgentHostClientState.Reconnecting) {
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
this._applyReconnectResult(result);
|
|
291
|
+
const {
|
|
292
|
+
gate
|
|
293
|
+
} = reconnect;
|
|
294
|
+
this._drainAfterReconnect(reconnect.outbox);
|
|
295
|
+
this._lastReadTime = Date.now();
|
|
296
|
+
this._resetLivenessTimers();
|
|
297
|
+
this._transitionTo({
|
|
298
|
+
kind: AgentHostClientState.Connected
|
|
299
|
+
});
|
|
300
|
+
gate.complete();
|
|
301
|
+
this._logService.info(`[RemoteAgentHostProtocol] Reconnected to ${this._address}.`);
|
|
302
|
+
} catch (err) {
|
|
303
|
+
this._logService.warn(
|
|
304
|
+
`[RemoteAgentHostProtocol] Reconnect attempt failed for ${this._address}: ${err instanceof Error ? err.message : String(err)}`
|
|
305
|
+
);
|
|
306
|
+
transport?.dispose();
|
|
307
|
+
if (this._state.kind !== AgentHostClientState.Reconnecting) {
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
const oldGate = this._state.reconnect.gate;
|
|
311
|
+
this._state.reconnect.gate = this._newReconnectGate();
|
|
312
|
+
oldGate.error(err);
|
|
313
|
+
this._scheduleReconnect();
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
_applyReconnectResult(result) {
|
|
317
|
+
if (result.type === ReconnectResultType.Replay) {
|
|
318
|
+
let maxSeq = this._serverSeq;
|
|
319
|
+
for (const envelope of result.actions) {
|
|
320
|
+
if (envelope.origin?.clientId === this._clientId && envelope.origin.clientSeq !== undefined && !envelope.rejectionReason && hasKey(envelope.action, {
|
|
321
|
+
session: true
|
|
322
|
+
})) {
|
|
323
|
+
this._subscriptionManager.dropPendingSessionAction(envelope.action.session, envelope.origin.clientSeq);
|
|
324
|
+
}
|
|
325
|
+
if (envelope.serverSeq > maxSeq) {
|
|
326
|
+
maxSeq = envelope.serverSeq;
|
|
327
|
+
}
|
|
328
|
+
this._onDidAction.fire(envelope);
|
|
329
|
+
}
|
|
330
|
+
this._serverSeq = maxSeq;
|
|
331
|
+
if (result.missing.length > 0) {
|
|
332
|
+
this._logService.info(
|
|
333
|
+
`[RemoteAgentHostProtocol] Server cannot resume ${result.missing.length} subscription(s) after reconnect.`
|
|
334
|
+
);
|
|
335
|
+
this._subscriptionManager.markSubscriptionsMissing(( result.missing.map(u => ( URI.parse(u)))));
|
|
336
|
+
}
|
|
337
|
+
} else {
|
|
338
|
+
let maxSeq = this._serverSeq;
|
|
339
|
+
for (const snapshot of result.snapshots) {
|
|
340
|
+
this._subscriptionManager.applyReconnectSnapshot(( URI.parse(snapshot.resource)), snapshot.state, snapshot.fromSeq);
|
|
341
|
+
if (snapshot.fromSeq > maxSeq) {
|
|
342
|
+
maxSeq = snapshot.fromSeq;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
this._serverSeq = maxSeq;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
_drainAfterReconnect(outbox) {
|
|
349
|
+
const queuedSeqs = ( new Set());
|
|
350
|
+
for (const msg of outbox) {
|
|
351
|
+
if (hasKey(msg, {
|
|
352
|
+
method: true
|
|
353
|
+
}) && msg.method === "dispatchAction") {
|
|
354
|
+
queuedSeqs.add(msg.params.clientSeq);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
const replays = [];
|
|
358
|
+
for (const entry of this._subscriptionManager.getPendingSessionActions()) {
|
|
359
|
+
if (( queuedSeqs.has(entry.clientSeq))) {
|
|
360
|
+
continue;
|
|
361
|
+
}
|
|
362
|
+
this._grantImplicitReadsForOutgoingAction(entry.action);
|
|
363
|
+
replays.push({
|
|
364
|
+
jsonrpc: "2.0",
|
|
365
|
+
method: "dispatchAction",
|
|
366
|
+
params: {
|
|
367
|
+
clientSeq: entry.clientSeq,
|
|
368
|
+
action: entry.action
|
|
369
|
+
}
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
if (replays.length > 0) {
|
|
373
|
+
this._logService.info(
|
|
374
|
+
`[RemoteAgentHostProtocol] Replaying ${replays.length} pending action(s) after reconnect to ${this._address}.`
|
|
375
|
+
);
|
|
376
|
+
}
|
|
377
|
+
for (const msg of replays) {
|
|
378
|
+
this._transport.send(msg);
|
|
379
|
+
}
|
|
380
|
+
for (const msg of outbox) {
|
|
381
|
+
this._transport.send(msg);
|
|
382
|
+
}
|
|
124
383
|
}
|
|
125
384
|
get rootState() {
|
|
126
385
|
return this._subscriptionManager.rootState;
|
|
@@ -191,6 +450,9 @@ let RemoteAgentHostProtocolClient = class RemoteAgentHostProtocolClient extends
|
|
|
191
450
|
async completions(params) {
|
|
192
451
|
return this._sendRequest("completions", params);
|
|
193
452
|
}
|
|
453
|
+
async ping() {
|
|
454
|
+
await this._sendRequest("ping", {});
|
|
455
|
+
}
|
|
194
456
|
async getCompletionTriggerCharacters() {
|
|
195
457
|
return this._completionTriggerCharacters;
|
|
196
458
|
}
|
|
@@ -283,11 +545,15 @@ let RemoteAgentHostProtocolClient = class RemoteAgentHostProtocolClient extends
|
|
|
283
545
|
async resourceMove(params) {
|
|
284
546
|
return this._sendRequest("resourceMove", params);
|
|
285
547
|
}
|
|
548
|
+
triggerVscodeUpgrade(method) {
|
|
549
|
+
return this._dispatchRequest(method, {});
|
|
550
|
+
}
|
|
286
551
|
_handleMessage(msg) {
|
|
287
|
-
if (this.
|
|
552
|
+
if (this._state.kind === AgentHostClientState.Closed) {
|
|
288
553
|
return;
|
|
289
554
|
}
|
|
290
555
|
this._lastReadTime = Date.now();
|
|
556
|
+
this._resetLivenessTimers();
|
|
291
557
|
if (isJsonRpcRequest(msg)) {
|
|
292
558
|
this._handleReverseRequest(msg.id, msg.method, msg.params);
|
|
293
559
|
} else if (isJsonRpcResponse(msg)) {
|
|
@@ -332,24 +598,37 @@ let RemoteAgentHostProtocolClient = class RemoteAgentHostProtocolClient extends
|
|
|
332
598
|
}
|
|
333
599
|
}
|
|
334
600
|
_handleClose(error) {
|
|
335
|
-
if (this.
|
|
601
|
+
if (this._state.kind === AgentHostClientState.Closed) {
|
|
336
602
|
return;
|
|
337
603
|
}
|
|
338
|
-
this.
|
|
339
|
-
this.
|
|
340
|
-
|
|
604
|
+
this._cancelLivenessTimers();
|
|
605
|
+
if (this._state.kind === AgentHostClientState.Reconnecting) {
|
|
606
|
+
const reconnect = this._state.reconnect;
|
|
607
|
+
if (reconnect.timeoutHandle !== undefined) {
|
|
608
|
+
clearTimeout(reconnect.timeoutHandle);
|
|
609
|
+
}
|
|
610
|
+
if (!reconnect.gate.isSettled) {
|
|
611
|
+
reconnect.gate.error(error);
|
|
612
|
+
}
|
|
613
|
+
}
|
|
341
614
|
this._rejectPendingRequests(error);
|
|
342
615
|
this._permissionService.connectionClosed(this._address);
|
|
343
616
|
this._grantedCustomizationUris.clear();
|
|
617
|
+
this._transitionTo({
|
|
618
|
+
kind: AgentHostClientState.Closed,
|
|
619
|
+
error
|
|
620
|
+
});
|
|
344
621
|
this._onDidClose.fire();
|
|
345
622
|
}
|
|
346
623
|
async _raceClose(promise) {
|
|
347
|
-
if (this.
|
|
348
|
-
return Promise.reject(this.
|
|
624
|
+
if (this._state.kind === AgentHostClientState.Closed) {
|
|
625
|
+
return Promise.reject(this._state.error);
|
|
349
626
|
}
|
|
350
627
|
let closeListener = Disposable.None;
|
|
351
628
|
const closePromise = ( new Promise((_resolve, reject) => {
|
|
352
|
-
closeListener = this.onDidClose(() => reject(
|
|
629
|
+
closeListener = this.onDidClose(() => reject(
|
|
630
|
+
this._state.kind === AgentHostClientState.Closed ? this._state.error : connectionClosedError(this._address)
|
|
631
|
+
));
|
|
353
632
|
}));
|
|
354
633
|
try {
|
|
355
634
|
return await Promise.race([promise, closePromise]);
|
|
@@ -358,8 +637,9 @@ let RemoteAgentHostProtocolClient = class RemoteAgentHostProtocolClient extends
|
|
|
358
637
|
}
|
|
359
638
|
}
|
|
360
639
|
_handleReverseRequest(id, method, params) {
|
|
640
|
+
const transport = this._transport;
|
|
361
641
|
const sendResult = result => {
|
|
362
|
-
|
|
642
|
+
transport.send({
|
|
363
643
|
jsonrpc: "2.0",
|
|
364
644
|
id,
|
|
365
645
|
result
|
|
@@ -379,7 +659,7 @@ let RemoteAgentHostProtocolClient = class RemoteAgentHostProtocolClient extends
|
|
|
379
659
|
code = AhpErrorCodes.AlreadyExists;
|
|
380
660
|
break;
|
|
381
661
|
}
|
|
382
|
-
|
|
662
|
+
transport.send({
|
|
383
663
|
jsonrpc: "2.0",
|
|
384
664
|
id,
|
|
385
665
|
error: {
|
|
@@ -389,7 +669,7 @@ let RemoteAgentHostProtocolClient = class RemoteAgentHostProtocolClient extends
|
|
|
389
669
|
});
|
|
390
670
|
};
|
|
391
671
|
const sendPermissionDenied = request => {
|
|
392
|
-
|
|
672
|
+
transport.send({
|
|
393
673
|
jsonrpc: "2.0",
|
|
394
674
|
id,
|
|
395
675
|
error: {
|
|
@@ -541,33 +821,46 @@ let RemoteAgentHostProtocolClient = class RemoteAgentHostProtocolClient extends
|
|
|
541
821
|
}
|
|
542
822
|
}
|
|
543
823
|
_sendNotification(method, params) {
|
|
544
|
-
this.
|
|
824
|
+
if (this._state.kind === AgentHostClientState.Closed) {
|
|
825
|
+
return;
|
|
826
|
+
}
|
|
827
|
+
const message = {
|
|
545
828
|
jsonrpc: "2.0",
|
|
546
829
|
method,
|
|
547
830
|
params
|
|
548
|
-
}
|
|
831
|
+
};
|
|
832
|
+
if (this._state.kind === AgentHostClientState.Reconnecting) {
|
|
833
|
+
this._state.reconnect.outbox.push(message);
|
|
834
|
+
return;
|
|
835
|
+
}
|
|
836
|
+
this._transport.send(message);
|
|
549
837
|
}
|
|
550
838
|
_sendRequest(method, params) {
|
|
551
|
-
|
|
552
|
-
return Promise.reject(this._closeError);
|
|
553
|
-
}
|
|
554
|
-
const id = this._nextRequestId++;
|
|
555
|
-
const deferred = ( new DeferredPromise());
|
|
556
|
-
this._pendingRequests.set(id, {
|
|
557
|
-
deferred,
|
|
558
|
-
sentAt: Date.now()
|
|
559
|
-
});
|
|
560
|
-
this._transport.send({
|
|
561
|
-
jsonrpc: "2.0",
|
|
562
|
-
id,
|
|
563
|
-
method,
|
|
564
|
-
params
|
|
565
|
-
});
|
|
566
|
-
return deferred.p;
|
|
839
|
+
return this._dispatchRequest(method, params);
|
|
567
840
|
}
|
|
568
841
|
_sendExtensionRequest(method, params) {
|
|
569
|
-
|
|
570
|
-
|
|
842
|
+
return this._dispatchRequest(method, params);
|
|
843
|
+
}
|
|
844
|
+
_updateTelemetryLevel() {
|
|
845
|
+
this.dispatchAction({
|
|
846
|
+
type: ActionType.RootConfigChanged,
|
|
847
|
+
config: {
|
|
848
|
+
[AgentHostTelemetryLevelConfigKey]: telemetryLevelToAgentHostConfigValue(getTelemetryLevel(this._configurationService))
|
|
849
|
+
}
|
|
850
|
+
}, this._clientId, 0);
|
|
851
|
+
}
|
|
852
|
+
async _dispatchRequest(method, params, options = {}) {
|
|
853
|
+
while (!options.bypassReconnectGate && this._state.kind === AgentHostClientState.Reconnecting) {
|
|
854
|
+
const current = this._state;
|
|
855
|
+
if (current.kind !== AgentHostClientState.Reconnecting) {
|
|
856
|
+
break;
|
|
857
|
+
}
|
|
858
|
+
try {
|
|
859
|
+
await current.reconnect.gate.p;
|
|
860
|
+
} catch {}
|
|
861
|
+
}
|
|
862
|
+
if (this._state.kind === AgentHostClientState.Closed) {
|
|
863
|
+
throw this._state.error;
|
|
571
864
|
}
|
|
572
865
|
const id = this._nextRequestId++;
|
|
573
866
|
const deferred = ( new DeferredPromise());
|
|
@@ -593,34 +886,47 @@ let RemoteAgentHostProtocolClient = class RemoteAgentHostProtocolClient extends
|
|
|
593
886
|
}
|
|
594
887
|
this._pendingRequests.clear();
|
|
595
888
|
}
|
|
596
|
-
|
|
597
|
-
if (this.
|
|
889
|
+
_resetLivenessTimers() {
|
|
890
|
+
if (this._state.kind === AgentHostClientState.Reconnecting || this._state.kind === AgentHostClientState.Closed) {
|
|
598
891
|
return;
|
|
599
892
|
}
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
893
|
+
this._pingTimer.cancelAndSet(() => this._onPingTimer(), PING_INTERVAL_MS);
|
|
894
|
+
this._closeTimer.cancelAndSet(() => this._onCloseTimer(), PING_INTERVAL_MS + LIVENESS_TIMEOUT_MS);
|
|
895
|
+
}
|
|
896
|
+
_cancelLivenessTimers() {
|
|
897
|
+
this._pingTimer.cancel();
|
|
898
|
+
this._closeTimer.cancel();
|
|
899
|
+
}
|
|
900
|
+
_onPingTimer() {
|
|
901
|
+
if (this._state.kind === AgentHostClientState.Closed || this._state.kind === AgentHostClientState.Reconnecting) {
|
|
603
902
|
return;
|
|
604
903
|
}
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
904
|
+
void this.ping().catch(() => undefined);
|
|
905
|
+
}
|
|
906
|
+
_onCloseTimer() {
|
|
907
|
+
if (this._state.kind === AgentHostClientState.Closed || this._state.kind === AgentHostClientState.Reconnecting) {
|
|
908
|
+
return;
|
|
610
909
|
}
|
|
611
|
-
|
|
612
|
-
|
|
910
|
+
if (this._loadEstimator.hasHighLoad()) {
|
|
911
|
+
this._closeTimer.cancelAndSet(() => this._onCloseTimer(), PING_INTERVAL_MS);
|
|
613
912
|
return;
|
|
614
913
|
}
|
|
914
|
+
const silence = Date.now() - this._lastReadTime;
|
|
615
915
|
this._logService.info(
|
|
616
|
-
`[RemoteAgentHostProtocol]
|
|
916
|
+
`[RemoteAgentHostProtocol] Liveness: no message from ${this._address} for ${silence}ms; forcing close to trigger reconnect.`
|
|
617
917
|
);
|
|
618
|
-
this.
|
|
918
|
+
this._transportListeners.clear();
|
|
919
|
+
if (this._transportFactory) {
|
|
920
|
+
this._rejectPendingRequests(connectionTimeoutError(this._address, silence));
|
|
921
|
+
this._handleTransportClose();
|
|
922
|
+
return;
|
|
923
|
+
}
|
|
924
|
+
this._handleClose(connectionTimeoutError(this._address, silence));
|
|
619
925
|
}
|
|
620
926
|
nextClientSeq() {
|
|
621
927
|
return this._nextClientSeq++;
|
|
622
928
|
}
|
|
623
929
|
};
|
|
624
|
-
RemoteAgentHostProtocolClient = ( __decorate([( __param(
|
|
930
|
+
RemoteAgentHostProtocolClient = ( __decorate([( __param(3, ILogService)), ( __param(4, IFileService)), ( __param(5, IAgentHostPermissionService)), ( __param(6, IConfigurationService))], RemoteAgentHostProtocolClient));
|
|
625
931
|
|
|
626
|
-
export { RemoteAgentHostProtocolClient };
|
|
932
|
+
export { AgentHostClientState, RemoteAgentHostProtocolClient };
|
|
@@ -4,20 +4,29 @@ import { IEnvironmentService } from "@codingame/monaco-vscode-api/vscode/vs/plat
|
|
|
4
4
|
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
5
5
|
import { ILabelService } from "@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service";
|
|
6
6
|
import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
|
|
7
|
+
import { IStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service";
|
|
7
8
|
import { type IAgentConnection } from "../common/agentService.js";
|
|
8
9
|
import { type IRemoteAgentHostConnectionInfo, type IRemoteAgentHostEntry } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/remoteAgentHostService";
|
|
9
10
|
import { IRemoteAgentHostService } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/remoteAgentHostService.service";
|
|
11
|
+
import { type IVscodeUpgradeResult } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocolUpgrade";
|
|
10
12
|
export declare class RemoteAgentHostService extends Disposable implements IRemoteAgentHostService {
|
|
11
13
|
private readonly _configurationService;
|
|
12
14
|
private readonly _instantiationService;
|
|
13
15
|
private readonly _logService;
|
|
14
16
|
private readonly _labelService;
|
|
15
17
|
private readonly _environmentService;
|
|
18
|
+
private readonly _storageService;
|
|
16
19
|
private static readonly ConnectionWaitTimeout;
|
|
17
20
|
/** Initial reconnect delay in milliseconds. */
|
|
18
21
|
private static readonly ReconnectInitialDelay;
|
|
19
22
|
/** Maximum reconnect delay in milliseconds. */
|
|
20
23
|
private static readonly ReconnectMaxDelay;
|
|
24
|
+
/**
|
|
25
|
+
* How long to wait for a server-upgrade trigger to be acknowledged.
|
|
26
|
+
* The CLI awaits the binary download synchronously before responding,
|
|
27
|
+
* so this needs to accommodate first-time downloads on slow networks.
|
|
28
|
+
*/
|
|
29
|
+
private static readonly UpgradeRequestTimeout;
|
|
21
30
|
readonly _serviceBrand: undefined;
|
|
22
31
|
private readonly _onDidChangeConnections;
|
|
23
32
|
readonly onDidChangeConnections: import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event<void>;
|
|
@@ -43,11 +52,12 @@ export declare class RemoteAgentHostService extends Disposable implements IRemot
|
|
|
43
52
|
* label for an agent host URI gets the friendly name.
|
|
44
53
|
*/
|
|
45
54
|
private readonly _labelFormatters;
|
|
46
|
-
constructor(_configurationService: IConfigurationService, _instantiationService: IInstantiationService, _logService: ILogService, _labelService: ILabelService, _environmentService: IEnvironmentService);
|
|
55
|
+
constructor(_configurationService: IConfigurationService, _instantiationService: IInstantiationService, _logService: ILogService, _labelService: ILabelService, _environmentService: IEnvironmentService, _storageService: IStorageService);
|
|
47
56
|
get connections(): readonly IRemoteAgentHostConnectionInfo[];
|
|
48
57
|
get configuredEntries(): readonly IRemoteAgentHostEntry[];
|
|
49
58
|
getConnection(address: string): IAgentConnection | undefined;
|
|
50
59
|
getEntryByAddress(address: string): IRemoteAgentHostEntry | undefined;
|
|
60
|
+
triggerServerUpgrade(address: string, method: string): Promise<IVscodeUpgradeResult>;
|
|
51
61
|
reconnect(address: string): void;
|
|
52
62
|
addRemoteAgentHost(input: IRemoteAgentHostEntry): Promise<IRemoteAgentHostConnectionInfo>;
|
|
53
63
|
addManagedConnection(entry: IRemoteAgentHostEntry, connection: IAgentConnection, transportDisposable?: IDisposable): Promise<IRemoteAgentHostConnectionInfo>;
|
|
@@ -69,6 +79,13 @@ export declare class RemoteAgentHostService extends Disposable implements IRemot
|
|
|
69
79
|
private _upsertConfiguredEntry;
|
|
70
80
|
private _getConfigurationTarget;
|
|
71
81
|
private _storeConfiguredEntries;
|
|
82
|
+
private _getConfiguredSettingEntries;
|
|
83
|
+
private _getConfiguredSettingEntriesForTarget;
|
|
84
|
+
private _getConfiguredRawEntriesForTarget;
|
|
85
|
+
private _getStoredSSHEntries;
|
|
86
|
+
private _storeStoredSSHEntries;
|
|
87
|
+
private _migrateSSHEntriesFromSetting;
|
|
88
|
+
private _mergeConfiguredEntries;
|
|
72
89
|
private _getOrCreateConnectionWait;
|
|
73
90
|
private _resolvePendingConnectionWait;
|
|
74
91
|
private _rejectPendingConnectionWait;
|