@codingame/monaco-vscode-chat-service-override 37.0.0 → 37.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +11 -0
- package/package.json +5 -5
- package/vscode/src/vs/platform/agentHost/browser/agentHostProtocolClient.js +1 -1
- package/vscode/src/vs/platform/agentHost/common/agentHostCustomizationConfig.d.ts +74 -0
- package/vscode/src/vs/platform/agentHost/common/agentHostCustomizationConfig.js +90 -0
- package/vscode/src/vs/platform/agentHost/common/agentHostSlashCommand.d.ts +8 -0
- package/vscode/src/vs/platform/agentHost/common/agentHostSlashCommand.js +16 -0
- package/vscode/src/vs/platform/agentHost/common/agentHostStarter.config.contribution.js +53 -53
- package/vscode/src/vs/platform/agentHost/common/agentHostWorkingDirectories.d.ts +16 -0
- package/vscode/src/vs/platform/agentHost/common/agentHostWorkingDirectories.js +14 -0
- package/vscode/src/vs/platform/agentHost/common/agentMerge.js +7 -7
- package/vscode/src/vs/platform/agentHost/common/agentModelByokMeta.d.ts +24 -0
- package/vscode/src/vs/platform/agentHost/common/agentModelByokMeta.js +13 -0
- package/vscode/src/vs/platform/agentHost/common/agentModelNotices.d.ts +22 -0
- package/vscode/src/vs/platform/agentHost/common/agentModelNotices.js +21 -0
- package/vscode/src/vs/platform/agentHost/common/agentModelPricing.d.ts +114 -0
- package/vscode/src/vs/platform/agentHost/common/agentModelPricing.js +56 -0
- package/vscode/src/vs/platform/agentHost/common/changesetUri.js +15 -1
- package/vscode/src/vs/platform/agentHost/common/copilotConfigSlashCommands.d.ts +73 -0
- package/vscode/src/vs/platform/agentHost/common/copilotConfigSlashCommands.js +141 -0
- package/vscode/src/vs/platform/agentHost/common/meta/agentCompletionAttachmentMeta.js +42 -1
- package/vscode/src/vs/platform/agentHost/common/meta/agentCustomizationMeta.d.ts +27 -0
- package/vscode/src/vs/platform/agentHost/common/meta/agentCustomizationMeta.js +14 -0
- package/vscode/src/vs/platform/agentHost/common/meta/agentEphemeralSessionMeta.d.ts +14 -0
- package/vscode/src/vs/platform/agentHost/common/meta/agentEphemeralSessionMeta.js +11 -0
- package/vscode/src/vs/platform/agentHost/common/sandboxConfigSchema.js +13 -13
- package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.js +1 -1
- package/vscode/src/vs/platform/agentHost/common/state/sessionActions.js +4 -1
- package/vscode/src/vs/platform/agentHost/common/toolSearchConstants.d.ts +4 -0
- package/vscode/src/vs/platform/agentHost/common/toolSearchConstants.js +6 -0
- package/vscode/src/vs/platform/networkFilter/common/networkFilterService.js +1 -1
- package/vscode/src/vs/workbench/browser/chatChangesPill.js +2 -2
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoice.contribution.js +28 -28
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceSessionsPicker.js +2 -2
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidget.js +18 -18
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidgetBinding.js +3 -3
- 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.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.js +9 -9
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/statusRowsComponent.js +5 -5
- 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 +13 -13
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscriptsView.js +7 -7
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/voiceModeOnboarding.js +28 -28
- package/vscode/src/vs/workbench/contrib/agentsVoice/common/voiceTranscriptStore.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.js +18 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +93 -93
- 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 +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFindActions.js +7 -7
- 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 +14 -14
- 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.js +18 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/createPluginAction.js +32 -32
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/exportAgentHostDebugLogsAction.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/openAgentHostStateFileAction.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginCommands.js +7 -7
- 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 +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.js +15 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationContentExpander.d.ts +34 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationContentExpander.js +229 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationItemProvider.d.ts +57 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationItemProvider.js +460 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHost.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHost.contribution.js +92 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostAllowSignedOutWhenUsableContribution.d.ts +23 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostAllowSignedOutWhenUsableContribution.js +46 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostAuth.d.ts +142 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostAuth.js +746 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatContribution.d.ts +77 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatContribution.js +474 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostConfigEditor.d.ts +169 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostConfigEditor.js +261 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCopilotCliSettingsContribution.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCopilotCliSettingsContribution.js +90 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostDownloadProgress.d.ts +35 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostDownloadProgress.js +73 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostExistingSessionHarnessPickerEnablement.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostExistingSessionHarnessPickerEnablement.js +61 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLanguageModelProvider.d.ts +112 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLanguageModelProvider.js +192 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPermissionUiContribution.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPromptCacheNotification.d.ts +21 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPromptCacheNotification.js +137 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostResponseFileChanges.js +301 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostRootConfigForwarder.d.ts +84 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostRootConfigForwarder.js +96 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionHandler.d.ts +884 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionHandler.js +5868 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionInputPills.js +19 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListContribution.d.ts +27 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListContribution.js +129 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListController.d.ts +42 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListController.js +221 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListStore.d.ts +125 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListStore.js +345 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectorySynchronizer.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSettings.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSettings.contribution.js +68 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSettingsFileSystemProvider.d.ts +62 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSettingsFileSystemProvider.js +163 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSignedOutModelsNotification.d.ts +54 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSignedOutModelsNotification.js +219 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSubagentProgress.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSubagentProgress.js +50 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostTerminalContribution.d.ts +42 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostTerminalContribution.js +132 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentSessionSettings.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentSessionSettings.contribution.js +85 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentSessionSettingsFileSystemProvider.d.ts +79 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentSessionSettingsFileSystemProvider.js +161 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/applyAgentHostSubmitConfig.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/applyAgentHostSubmitConfig.js +13 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/copilotConfigSlashSubmitHandler.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/copilotConfigSlashSubmitHandler.js +71 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/openSessionLinkOpener.contribution.d.ts +35 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/openSessionLinkOpener.contribution.js +205 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.js +50 -50
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.js +3 -3
- 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.js +22 -22
- 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/externalSessionsFilterMenu.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/sessionSummaryHover.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessionsConfiguration.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.js +15 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.js +126 -126
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.contribution.js +44 -44
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.js +137 -137
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationPresentation.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePagePromptLaunchers.js +37 -37
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCardList.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCreatorService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationAccessibility.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationCategories.js +145 -145
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationDashboard.js +29 -29
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationServiceImpl.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedAgentPluginDetail.js +40 -40
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedExtensionToolsDetail.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedMcpServerDetail.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/galleryItemRenderer.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.js +75 -75
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.js +115 -115
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/promptsServiceCustomizationItemProvider.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/toolsListWidget.js +50 -50
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.shared.contribution.js +344 -344
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostChatDebugProvider.js +37 -37
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostLogSources.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.js +32 -32
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheExplorerView.js +124 -124
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheInsights.js +72 -72
- 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/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 +22 -22
- 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 +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 +35 -35
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugToolCallContentRenderer.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugWireLogView.js +40 -40
- 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 +3 -3
- 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 +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPills.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.js +63 -63
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +30 -30
- package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievements.contribution.js +12 -12
- 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 +35 -35
- package/vscode/src/vs/workbench/contrib/chat/browser/chatPromoNotification.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuotaNotification.js +25 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/chatRepoInfo.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.js +19 -19
- 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 +26 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.js +16 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.js +20 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.js +62 -62
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipCatalog.js +19 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWindowNotifier.js +7 -7
- 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/defaultModelContribution.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/enablementStatusWidget.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorOverlay.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginGitCommandService.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.js +27 -27
- 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 +2 -2
- 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/promptToolSetsCodeLensProvider.js +2 -2
- 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/promptTimeline/promptTimeline.contribution.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineCard.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineGutterRail.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineModel.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineRulerRail.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineStickyHeader.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/promptsDebugContribution.js +20 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/sessionChatPillOptions.js +18 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/sessionPullRequestPill.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/clientToolSetsContribution.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.js +39 -39
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.js +25 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/utilityModelContribution.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceInputMode/voiceInputMode.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentOpenChat.js +17 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatFind/chatFindAccessibilityHelp.js +15 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.js +10 -10
- 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 +3 -3
- 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 +11 -11
- 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 +8 -8
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +18 -18
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +5 -5
- 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 +154 -154
- package/vscode/src/vs/workbench/contrib/chat/common/sessionChatPills.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +1 -1
- package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarousel.contribution.js +10 -10
- 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/inlineChatActions.js +15 -15
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatDefaultModel.js +2 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditReviewSession.js +1 -1
- 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/terminalChat.js +10 -10
- 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/runInTerminalHelpers.js +6 -6
- 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/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +12 -12
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +2 -2
- 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.js +3 -3
- 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/monitoring/outputMonitor.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +4 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +73 -73
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sendToTerminalTool.js +10 -10
- 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 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/runTaskTool.js +14 -14
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +4 -4
- package/vscode/src/vs/workbench/services/agentEditorComments/browser/agentEditorCommentsOverlayWidget.js +3 -3
- package/vscode/src/vs/platform/agentHost/common/state/legacyProtocolCompatibility.d.ts +0 -30
- package/vscode/src/vs/platform/agentHost/common/state/legacyProtocolCompatibility.js +0 -87
- package/vscode/src/vs/workbench/services/accounts/browser/defaultAccount.d.ts +0 -205
- package/vscode/src/vs/workbench/services/accounts/browser/defaultAccount.js +0 -1580
|
@@ -0,0 +1,884 @@
|
|
|
1
|
+
import { CancellationToken } from "@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation";
|
|
2
|
+
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
3
|
+
import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
4
|
+
import { IModelService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/model.service";
|
|
5
|
+
import { AgentProvider, type IAgentConnection } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agentService";
|
|
6
|
+
import { IRemoteAgentHostService } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/remoteAgentHostService.service";
|
|
7
|
+
import { ToolResultContentType, type ProtectedResourceMetadata } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/state";
|
|
8
|
+
import { type Message, type ModelSelection, type ChatInputAnswer, type ChatInputQuestion, type StringOrMarkdown } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/sessionState";
|
|
9
|
+
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
10
|
+
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
11
|
+
import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
|
|
12
|
+
import { IOpenerService } from "@codingame/monaco-vscode-api/vscode/vs/platform/opener/common/opener.service";
|
|
13
|
+
import { ITelemetryService } from "@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service";
|
|
14
|
+
import { IWorkbenchAssignmentService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/assignment/common/assignmentService.service";
|
|
15
|
+
import { IPathService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/path/common/pathService.service";
|
|
16
|
+
import { IWorkspaceContextService } from "@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service";
|
|
17
|
+
import { IWorkspaceTrustRequestService } from "@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspaceTrust.service";
|
|
18
|
+
import { IWorkspaceTrustManagementService } from "@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspaceTrust.service";
|
|
19
|
+
import { IAgentHostTerminalService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/agentHostTerminalService.service";
|
|
20
|
+
import { ITerminalChatService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal.service";
|
|
21
|
+
import { IChatQuestionAnswers } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService";
|
|
22
|
+
import { IChatService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService.service";
|
|
23
|
+
import { IChatSession, IChatSessionContentProvider, type IChatInputCompletionsParams, type IChatInputCompletionsResult } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService";
|
|
24
|
+
import { IChatEntitlementService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/chat/common/chatEntitlementService.service";
|
|
25
|
+
import { IWorkingCopyService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/workingCopy/common/workingCopyService.service";
|
|
26
|
+
import { IChatEditingService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/editing/chatEditingService.service";
|
|
27
|
+
import { ILanguageModelsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModels.service";
|
|
28
|
+
import { IChatAgentService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/participants/chatAgents.service";
|
|
29
|
+
import { IToolResult } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService";
|
|
30
|
+
import { ILanguageModelToolsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService.service";
|
|
31
|
+
import { IChatWidgetService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service";
|
|
32
|
+
import { IAgentHostActiveClientService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService.service";
|
|
33
|
+
import { IAgentHostCustomizationService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCustomizationService.service";
|
|
34
|
+
import { IAgentHostSessionWorkingDirectoryResolver } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectoryResolver.service";
|
|
35
|
+
import { IAgentHostSessionWorkingDirectorySynchronizer } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectorySynchronizer.service";
|
|
36
|
+
import { IAgentHostShellInitSynchronizer } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostShellInitSynchronizer.service";
|
|
37
|
+
import { IAgentHostNewSessionFolderService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostNewSessionFolderService.service";
|
|
38
|
+
import type { AgentHostPromptCacheNotification } from "./agentHostPromptCacheNotification.js";
|
|
39
|
+
import { IChatResponseFileChangesService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chatResponseFileChangesService.service";
|
|
40
|
+
import { toolDataToDefinition } from "./agentHostToolUtils.js";
|
|
41
|
+
import { IAgentHostUntitledProvisionalSessionService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostUntitledProvisionalSessionService.service";
|
|
42
|
+
import { IAgentHostImportConversationStore } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostImportConversationStore.service";
|
|
43
|
+
export { toolDataToDefinition };
|
|
44
|
+
export declare const UNOBSERVED_CLIENT_TOOL_GRACE_MS = 5000;
|
|
45
|
+
/** Whether `err` reports that the host has no such resource (AHP `NotFound`). */
|
|
46
|
+
export declare function isNotFoundError(err: unknown): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Extracts a user-facing message from a session-load failure so the actual cause
|
|
49
|
+
* (e.g. a git worktree-recreation error) is shown instead of a generic message.
|
|
50
|
+
* Strips the `Failed to restore session <uri>: ` wrapper that `AgentService`
|
|
51
|
+
* adds around restore failures. Returns `undefined` when no message is available.
|
|
52
|
+
*/
|
|
53
|
+
export declare function unwrapSessionLoadErrorMessage(err: unknown): string | undefined;
|
|
54
|
+
export declare function resolveRestoredSubagentChatResource(parentSession: string, toolCallId: string, catalogResource: string | undefined, persistedResource: string | undefined): string;
|
|
55
|
+
/** The draft the chat channel holds, so we only send real changes and can keep its model. */
|
|
56
|
+
export declare class DraftSyncState {
|
|
57
|
+
private _synced;
|
|
58
|
+
private _remoteModel;
|
|
59
|
+
constructor(remoteDraft: Message | undefined);
|
|
60
|
+
get synced(): Message | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* The chosen model the channel holds, which a local fallback must not overwrite. Recorded on
|
|
63
|
+
* publish as well as on receive: a window never sees its own draft echo back through the channel.
|
|
64
|
+
*/
|
|
65
|
+
get remoteModel(): ModelSelection | undefined;
|
|
66
|
+
applyRemote(remoteDraft: Message | undefined): void;
|
|
67
|
+
shouldPublish(outgoing: Message | undefined, chosen?: boolean): boolean;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Converts carousel answers (IChatQuestionAnswers) to protocol
|
|
71
|
+
* ChatInputAnswer records, handling text, single-select,
|
|
72
|
+
* boolean, and multi-select answer shapes.
|
|
73
|
+
*/
|
|
74
|
+
export declare function convertCarouselAnswers(raw: IChatQuestionAnswers, questions?: readonly ChatInputQuestion[]): Record<string, ChatInputAnswer>;
|
|
75
|
+
export interface IAgentHostSessionHandlerConfig {
|
|
76
|
+
readonly provider: AgentProvider;
|
|
77
|
+
/**
|
|
78
|
+
* The URI scheme the host addresses sessions under, when it differs from
|
|
79
|
+
* {@link provider}. Defaults to {@link provider}.
|
|
80
|
+
*
|
|
81
|
+
* Session URIs are client-chosen. For agents core spawns, core picks the URI and
|
|
82
|
+
* uses the provider as the scheme. For sessions core *joins* rather than creates
|
|
83
|
+
* (cloud sandbox, where Mission Control created the session as `ahp-session:/<id>`),
|
|
84
|
+
* the creator's scheme must be used because the host's registry is keyed by the
|
|
85
|
+
* exact URI — while the UI still routes the session to the `copilot` provider.
|
|
86
|
+
*/
|
|
87
|
+
readonly backendSessionScheme?: string;
|
|
88
|
+
readonly agentId: string;
|
|
89
|
+
readonly sessionType: string;
|
|
90
|
+
readonly fullName: string;
|
|
91
|
+
readonly description: string;
|
|
92
|
+
/** The agent connection to use for this handler. */
|
|
93
|
+
readonly connection: IAgentConnection;
|
|
94
|
+
/** Sanitized connection authority for constructing vscode-agent-host:// URIs. */
|
|
95
|
+
readonly connectionAuthority: string;
|
|
96
|
+
/** Extension identifier for the registered agent. Defaults to 'vscode.agent-host'. */
|
|
97
|
+
readonly extensionId?: string;
|
|
98
|
+
/** Extension display name for the registered agent. Defaults to 'Agent Host'. */
|
|
99
|
+
readonly extensionDisplayName?: string;
|
|
100
|
+
/**
|
|
101
|
+
* Optional callback to resolve a working directory for a new session.
|
|
102
|
+
* If not provided or unresolved, session resource resolvers are consulted before
|
|
103
|
+
* falling back to the first workspace folder.
|
|
104
|
+
*/
|
|
105
|
+
readonly resolveWorkingDirectory?: (sessionResource: URI) => URI | undefined;
|
|
106
|
+
/** Whether a final-looking chat resource is still a client-side draft. */
|
|
107
|
+
readonly isNewSession?: (sessionResource: URI) => boolean;
|
|
108
|
+
/** Called after a locally-created session has been accepted by the backend. */
|
|
109
|
+
readonly onSessionMaterialized?: (sessionResource: URI) => void;
|
|
110
|
+
/**
|
|
111
|
+
* Optional callback invoked when the server rejects an operation because
|
|
112
|
+
* authentication is required. Should trigger interactive authentication
|
|
113
|
+
* and return true if the user authenticated successfully.
|
|
114
|
+
*
|
|
115
|
+
* @param protectedResources The protected resources from the agent's root
|
|
116
|
+
* state that require authentication.
|
|
117
|
+
*/
|
|
118
|
+
readonly resolveAuthentication?: (protectedResources: ProtectedResourceMetadata[]) => Promise<boolean>;
|
|
119
|
+
readonly promptCacheNotification?: AgentHostPromptCacheNotification;
|
|
120
|
+
}
|
|
121
|
+
export declare class AgentHostSessionHandler extends Disposable implements IChatSessionContentProvider {
|
|
122
|
+
private readonly _chatAgentService;
|
|
123
|
+
private readonly _chatService;
|
|
124
|
+
private readonly _chatEditingService;
|
|
125
|
+
private readonly _logService;
|
|
126
|
+
private readonly _workspaceContextService;
|
|
127
|
+
private readonly _instantiationService;
|
|
128
|
+
private readonly _terminalChatService;
|
|
129
|
+
private readonly _agentHostTerminalService;
|
|
130
|
+
private readonly _workingDirectoryResolver;
|
|
131
|
+
private readonly _workingDirectorySynchronizer;
|
|
132
|
+
private readonly _shellInitSynchronizer;
|
|
133
|
+
private readonly _newSessionFolderService;
|
|
134
|
+
private readonly _provisionalService;
|
|
135
|
+
private readonly _importConversationStore;
|
|
136
|
+
private readonly _toolsService;
|
|
137
|
+
private readonly _chatWidgetService;
|
|
138
|
+
private readonly _languageModelsService;
|
|
139
|
+
private readonly _openerService;
|
|
140
|
+
private readonly _activeClientService;
|
|
141
|
+
private readonly _chatEntitlementService;
|
|
142
|
+
private readonly _workspaceTrustRequestService;
|
|
143
|
+
private readonly _workspaceTrustManagementService;
|
|
144
|
+
private readonly _modelService;
|
|
145
|
+
private readonly _workingCopyService;
|
|
146
|
+
private readonly _configurationService;
|
|
147
|
+
private readonly _chatResponseFileChangesService;
|
|
148
|
+
private readonly _pathService;
|
|
149
|
+
private readonly _remoteAgentHostService;
|
|
150
|
+
private readonly _customizationService;
|
|
151
|
+
private readonly _telemetryService;
|
|
152
|
+
private static readonly DRAFT_SYNC_DEBOUNCE_MS;
|
|
153
|
+
private static readonly ACTIVE_CLIENT_RECONCILIATION_DEBOUNCE_MS;
|
|
154
|
+
private readonly _activeSessions;
|
|
155
|
+
private readonly _chatURIsBySessionResource;
|
|
156
|
+
/** Per-session subscription to chat model pending request changes. */
|
|
157
|
+
private readonly _pendingMessageSubscriptions;
|
|
158
|
+
private readonly _remotePendingMessageProjections;
|
|
159
|
+
/** Per-session debounced sync from chat input state to AHP draft state. */
|
|
160
|
+
private readonly _draftSyncSubscriptions;
|
|
161
|
+
/** Per-session subscription watching for server-initiated turns. */
|
|
162
|
+
private readonly _serverTurnWatchers;
|
|
163
|
+
/** Per-session subscription silently resolving existing MCP authentication grants. */
|
|
164
|
+
private readonly _mcpAuthWatchers;
|
|
165
|
+
/**
|
|
166
|
+
* Ownership of actionable protocol requests, keyed by backend session URI
|
|
167
|
+
* string. `inputNeeded` is a session-level queue and the single caller of
|
|
168
|
+
* {@link invokeTool} for client tools, so it must be handled exactly once
|
|
169
|
+
* per backend session no matter how many sibling chat resources (default
|
|
170
|
+
* chat, peer chats, subagent chats) are open against it. Each such resource
|
|
171
|
+
* holds a reference; the shared watcher stays alive while any reference
|
|
172
|
+
* remains and is disposed only when the last one is released.
|
|
173
|
+
*/
|
|
174
|
+
private readonly _inputNeededWatchers;
|
|
175
|
+
/**
|
|
176
|
+
* Backend session each open resource's {@link _inputNeededWatchers}
|
|
177
|
+
* reference belongs to, recorded when the reference is installed. Teardown
|
|
178
|
+
* uses this to release the right reference without re-deriving the backend
|
|
179
|
+
* session via {@link _resolveSessionUri}, whose provisional mapping may
|
|
180
|
+
* already be cleared by then.
|
|
181
|
+
*/
|
|
182
|
+
private readonly _inputNeededWatcherBackends;
|
|
183
|
+
/** One reconciliation owner per active session. */
|
|
184
|
+
private readonly _activeClientEntries;
|
|
185
|
+
/** Historical turns with file edits, pending hydration into the editing session. */
|
|
186
|
+
private readonly _pendingHistoryTurns;
|
|
187
|
+
/**
|
|
188
|
+
* Requests a turn observer is currently rendering, keyed by
|
|
189
|
+
* {@link _toolCallKey} for tool calls and {@link _inputRequestKey} for chat
|
|
190
|
+
* input requests (the two key shapes differ in arity, so they cannot
|
|
191
|
+
* collide). The value is the claiming observer's session resource, which
|
|
192
|
+
* the session-level responder uses as the chat context when it executes a
|
|
193
|
+
* client tool so the tool runs against the chat that is actually rendering
|
|
194
|
+
* it. The session-level responder defers to those observers so the inline
|
|
195
|
+
* UI stays in charge of answering.
|
|
196
|
+
*/
|
|
197
|
+
private readonly _renderedRequests;
|
|
198
|
+
/** Tool calls whose protocol outcome has already been dispatched. */
|
|
199
|
+
private readonly _resolvedToolCalls;
|
|
200
|
+
/**
|
|
201
|
+
* A single {@link ChatToolInvocation} per client tool call, keyed by
|
|
202
|
+
* {@link _toolCallKey}. Created lazily by whichever of the session-level
|
|
203
|
+
* watcher or the turn observer arrives first, so both act on one object:
|
|
204
|
+
* the observer renders it while the watcher executes it. Entries are
|
|
205
|
+
* dropped once the call resolves so a later call with the same ids is not
|
|
206
|
+
* mistaken for it.
|
|
207
|
+
*/
|
|
208
|
+
private readonly _clientToolInvocations;
|
|
209
|
+
/**
|
|
210
|
+
* Live `inputNeeded` requests per tool call, keyed by {@link _toolCallKey}.
|
|
211
|
+
* One tool call is represented by a succession of requests — a confirmation
|
|
212
|
+
* is replaced by a client execution once approved — so the shared state
|
|
213
|
+
* above is only released when the last of them goes away.
|
|
214
|
+
*/
|
|
215
|
+
private readonly _clientToolRetainCounts;
|
|
216
|
+
/**
|
|
217
|
+
* Per-session set of MCP server ids that already had an authentication
|
|
218
|
+
* prompt surfaced in the current conversation. A server is removed from the
|
|
219
|
+
* set once it reaches the running state ({@link McpServerStatus.Ready}), so
|
|
220
|
+
* that a later auth requirement for the same server prompts again instead of
|
|
221
|
+
* the prompt repeating on every message.
|
|
222
|
+
*/
|
|
223
|
+
private readonly _surfacedMcpAuthServers;
|
|
224
|
+
private readonly _pendingMcpAutoAuthentication;
|
|
225
|
+
/** Turn IDs dispatched by this client, used to distinguish server-originated turns. */
|
|
226
|
+
private readonly _clientDispatchedTurnIds;
|
|
227
|
+
private readonly _turnStopWatches;
|
|
228
|
+
private readonly _config;
|
|
229
|
+
/** Active session subscriptions, keyed by backend session URI string. */
|
|
230
|
+
private readonly _sessionSubscriptions;
|
|
231
|
+
/**
|
|
232
|
+
* Working-directory synchronizer registrations, keyed by session URI. Each
|
|
233
|
+
* lives exactly as long as that session's {@link _sessionSubscriptions} entry.
|
|
234
|
+
*/
|
|
235
|
+
private readonly _workingDirectoryRegistrations;
|
|
236
|
+
private readonly _shellInitRegistrations;
|
|
237
|
+
/**
|
|
238
|
+
* Active default-chat subscriptions, keyed by backend session URI string.
|
|
239
|
+
* Multi-chat is not yet surfaced: every session is served by a single
|
|
240
|
+
* implicit default chat that carries the conversation contents (turns,
|
|
241
|
+
* active turn, pending/queued messages, input requests). We subscribe to
|
|
242
|
+
* it alongside the session and merge both into the {@link ISessionWithDefaultChat}
|
|
243
|
+
* view returned by {@link _getSessionState}.
|
|
244
|
+
*/
|
|
245
|
+
private readonly _defaultChatSubscriptions;
|
|
246
|
+
/**
|
|
247
|
+
* Active subscriptions for additional (non-default) peer chats, keyed by
|
|
248
|
+
* the chat channel URI string. Populated when a chat widget is opened for
|
|
249
|
+
* a resource that carries a chatId fragment.
|
|
250
|
+
*/
|
|
251
|
+
private readonly _additionalChatSubscriptions;
|
|
252
|
+
/**
|
|
253
|
+
* Chat channel URI that owns each observed terminal, keyed by terminal URI.
|
|
254
|
+
* Recorded while observing a terminal tool call so a later claim (e.g.
|
|
255
|
+
* "Continue in Background") can attribute itself to the chat the terminal
|
|
256
|
+
* actually belongs to rather than assuming the session's default chat.
|
|
257
|
+
*/
|
|
258
|
+
private readonly _terminalChatURIs;
|
|
259
|
+
/**
|
|
260
|
+
* Backend session URIs with an in-flight {@link provideChatSessionContent}
|
|
261
|
+
* call, keyed by session URI string with a refcount value. While a chat is
|
|
262
|
+
* still hydrating its subscriptions, a sibling chat of the same session
|
|
263
|
+
* closing must not tear down the shared session subscription out from under
|
|
264
|
+
* it (see {@link _releaseChatSessionSubscriptions} / {@link _hasOtherSessionHold}).
|
|
265
|
+
*/
|
|
266
|
+
private readonly _hydratingChatSessions;
|
|
267
|
+
/**
|
|
268
|
+
* Whether the `hideAutoExplainability` experiment suppresses Auto's routing
|
|
269
|
+
* row. `undefined` until the treatment resolves — emitting on a guess would
|
|
270
|
+
* append rows to a hidden-cohort turn that cannot be retracted afterwards.
|
|
271
|
+
*/
|
|
272
|
+
private readonly _hideAutoExplainability;
|
|
273
|
+
/** Settles once {@link _hideAutoExplainability} is known. */
|
|
274
|
+
private readonly _hideAutoExplainabilityReady;
|
|
275
|
+
constructor(config: IAgentHostSessionHandlerConfig, _chatAgentService: IChatAgentService, _chatService: IChatService, _chatEditingService: IChatEditingService, _logService: ILogService, _workspaceContextService: IWorkspaceContextService, _instantiationService: IInstantiationService, _terminalChatService: ITerminalChatService, _agentHostTerminalService: IAgentHostTerminalService, _workingDirectoryResolver: IAgentHostSessionWorkingDirectoryResolver, _workingDirectorySynchronizer: IAgentHostSessionWorkingDirectorySynchronizer, _shellInitSynchronizer: IAgentHostShellInitSynchronizer, _newSessionFolderService: IAgentHostNewSessionFolderService, _provisionalService: IAgentHostUntitledProvisionalSessionService, _importConversationStore: IAgentHostImportConversationStore, _toolsService: ILanguageModelToolsService, _chatWidgetService: IChatWidgetService, _languageModelsService: ILanguageModelsService, _openerService: IOpenerService, _activeClientService: IAgentHostActiveClientService, _chatEntitlementService: IChatEntitlementService, _workspaceTrustRequestService: IWorkspaceTrustRequestService, _workspaceTrustManagementService: IWorkspaceTrustManagementService, _modelService: IModelService, _workingCopyService: IWorkingCopyService, _configurationService: IConfigurationService, _chatResponseFileChangesService: IChatResponseFileChangesService, _pathService: IPathService, _remoteAgentHostService: IRemoteAgentHostService, _customizationService: IAgentHostCustomizationService, _telemetryService: ITelemetryService, assignmentService: IWorkbenchAssignmentService);
|
|
276
|
+
/**
|
|
277
|
+
* Resolves the signed-in user's plan context for chat error formatting.
|
|
278
|
+
* The agent host does not know the user's plan, so quota/rate-limit
|
|
279
|
+
* messages are personalized here from `IChatEntitlementService`.
|
|
280
|
+
*/
|
|
281
|
+
private _chatErrorContext;
|
|
282
|
+
provideChatInputCompletions(sessionResource: URI, params: IChatInputCompletionsParams, token: CancellationToken): Promise<IChatInputCompletionsResult | undefined>;
|
|
283
|
+
provideChatInputCompletionTriggerCharacters(): Promise<readonly string[]>;
|
|
284
|
+
private _createCompletionItem;
|
|
285
|
+
private _toChatInputCompletionItem;
|
|
286
|
+
updateChatSessionMetadata(sessionResource: URI, metadata: Record<string, unknown>): void;
|
|
287
|
+
provideChatSessionContent(sessionResource: URI, token: CancellationToken): Promise<IChatSession>;
|
|
288
|
+
private _registerAgent;
|
|
289
|
+
private _invokeAgent;
|
|
290
|
+
private _reportInvocationFailure;
|
|
291
|
+
/**
|
|
292
|
+
* Builds the {@link IChatResponseErrorDetails} for a failed turn so the
|
|
293
|
+
* chat response renders a proper error (and, for quota errors, the upgrade
|
|
294
|
+
* affordance via `ChatQuotaExceededPart`). Returns `undefined` for
|
|
295
|
+
* non-error turns. Falls back to the raw error when no structured chat
|
|
296
|
+
* error was forwarded in `_meta`.
|
|
297
|
+
*/
|
|
298
|
+
private _getTurnErrorDetails;
|
|
299
|
+
/**
|
|
300
|
+
* Returns the {@link SessionState} for a session that was eagerly created
|
|
301
|
+
* at folder-pick time, or `undefined` if no such session exists. Uses the
|
|
302
|
+
* unmanaged subscription accessor so we don't accidentally open a fresh
|
|
303
|
+
* subscription (which would issue a duplicate snapshot fetch on the wire,
|
|
304
|
+
* and in tests would synthesise placeholder state via the mock's auto-
|
|
305
|
+
* hydration path).
|
|
306
|
+
*
|
|
307
|
+
* If the eager subscription exists but hasn't received its first snapshot
|
|
308
|
+
* yet (creation in flight), waits for it to hydrate or error before
|
|
309
|
+
* returning. This closes a race where the chat request arrives between
|
|
310
|
+
* `createSession` resolving and the snapshot landing.
|
|
311
|
+
*/
|
|
312
|
+
private _readEagerlyCreatedSessionState;
|
|
313
|
+
/**
|
|
314
|
+
* Diffs the chat model's pending requests against the protocol state in
|
|
315
|
+
* `_clientState` and dispatches Set/Removed/Reordered actions as needed.
|
|
316
|
+
*/
|
|
317
|
+
private _syncPendingMessages;
|
|
318
|
+
/**
|
|
319
|
+
* Projects protocol pending messages into the chat model.
|
|
320
|
+
* The protocol is authoritative, so matching local state is a no-op.
|
|
321
|
+
*/
|
|
322
|
+
private _applyRemotePendingMessages;
|
|
323
|
+
private _dispatchAction;
|
|
324
|
+
private _requireChatURI;
|
|
325
|
+
private _resolveChatUriFromState;
|
|
326
|
+
private _setChatURI;
|
|
327
|
+
private _getChatURI;
|
|
328
|
+
private _getRenameChatURI;
|
|
329
|
+
private _getCurrentActiveClient;
|
|
330
|
+
/**
|
|
331
|
+
* Drop client-published customizations for a host older than list-shaped enablement, which
|
|
332
|
+
* rejects the newer shape outright with `invalid params: missing field 'enabled'`. Temporary;
|
|
333
|
+
* see {@link CUSTOMIZATION_ENABLEMENT_PROTOCOL_VERSION}.
|
|
334
|
+
*/
|
|
335
|
+
private _withVersionedCustomizations;
|
|
336
|
+
private _ensureActiveClient;
|
|
337
|
+
private _ensureActiveClientEntry;
|
|
338
|
+
private _configureActiveClientReconciliation;
|
|
339
|
+
private _disposeActiveClientEntry;
|
|
340
|
+
/**
|
|
341
|
+
* Sets up a persistent listener on the session's protocol state that
|
|
342
|
+
* detects server-initiated turns (e.g. auto-consumed queued messages).
|
|
343
|
+
* When a new `activeTurn` appears whose `turnId` was NOT dispatched by
|
|
344
|
+
* this client, it signals the {@link AgentHostChatSession} to create a
|
|
345
|
+
* new request in the chat model, removes the consumed pending request
|
|
346
|
+
* if applicable, and pipes turn progress through `progressObs`.
|
|
347
|
+
*/
|
|
348
|
+
private _watchForServerInitiatedTurns;
|
|
349
|
+
private _watchForMcpAuthentication;
|
|
350
|
+
private _watchForSessionInputNeeded;
|
|
351
|
+
private _isOwnedClientToolRequest;
|
|
352
|
+
/**
|
|
353
|
+
* Releases this resource's reference to the shared per-backend-session
|
|
354
|
+
* {@link _watchForSessionInputNeeded} watcher, disposing it only once the
|
|
355
|
+
* last sibling resource has let go.
|
|
356
|
+
*/
|
|
357
|
+
private _releaseSessionInputNeeded;
|
|
358
|
+
/**
|
|
359
|
+
* Holds the shared state for a tool call while an `inputNeeded` request
|
|
360
|
+
* references it. Once the host stops asking — the request disappears, or the
|
|
361
|
+
* watcher is disposed — the outcome is settled, so the dispatch-funnel entry
|
|
362
|
+
* and the shared invocation are dropped and a later call with the same ids
|
|
363
|
+
* is never mistaken for this one.
|
|
364
|
+
*/
|
|
365
|
+
private _retainToolCall;
|
|
366
|
+
/**
|
|
367
|
+
* Returns the shared {@link ChatToolInvocation} for a client tool call,
|
|
368
|
+
* creating it on first use via {@link ILanguageModelToolsService.beginToolCall}.
|
|
369
|
+
* `sessionResource` is deliberately omitted so `beginToolCall` does not
|
|
370
|
+
* append progress into a chat model (which throws once the owning request
|
|
371
|
+
* is complete); it still registers the invocation, so a later `invokeTool`
|
|
372
|
+
* with a matching `chatStreamToolCallId` attaches to this same object. The
|
|
373
|
+
* observer that renders the call and the watcher that executes it therefore
|
|
374
|
+
* act on one invocation.
|
|
375
|
+
*/
|
|
376
|
+
private _ensureClientToolInvocation;
|
|
377
|
+
/** The workbench tool a runtime client-tool call maps to, or `undefined` when it is not installed. */
|
|
378
|
+
private _resolveClientTool;
|
|
379
|
+
/**
|
|
380
|
+
* Whether an unclaimed client tool must wait for a rendering observer
|
|
381
|
+
* before running. There is no protocol field for this, so we use the tool's
|
|
382
|
+
* static {@link IToolData.canRequestPreApproval} signal: a tool that might
|
|
383
|
+
* ask for pre-approval could pop a confirmation, which only makes sense
|
|
384
|
+
* inside a live chat request. Limitation: this is a "might" signal — a tool
|
|
385
|
+
* may set it yet auto-approve at runtime — so an unclaimed such tool is
|
|
386
|
+
* conservatively made to wait (and denied on timeout) rather than risk a
|
|
387
|
+
* headless modal nobody can answer. Only consulted for the unclaimed case;
|
|
388
|
+
* a claimed call always runs with context regardless.
|
|
389
|
+
*/
|
|
390
|
+
private _clientToolRequiresConfirmation;
|
|
391
|
+
/**
|
|
392
|
+
* The one place a client tool is actually invoked. Ensures the shared
|
|
393
|
+
* invocation exists, parses the protocol input (preserving the tool-search
|
|
394
|
+
* candidate handling), invokes the tool, and dispatches the protocol
|
|
395
|
+
* completion. `contextSessionResource` is set when a turn observer is
|
|
396
|
+
* rendering the call: a live chat request then exists, so confirmation
|
|
397
|
+
* renders in the tool part, any pre-approval is honored, and side effects
|
|
398
|
+
* attribute to that observer's chat. Without it the tool runs headlessly,
|
|
399
|
+
* independent of whether the owning turn is live.
|
|
400
|
+
*/
|
|
401
|
+
private _executeClientTool;
|
|
402
|
+
/**
|
|
403
|
+
* Denies a client tool call that needs confirmation but that no sub/agent
|
|
404
|
+
* observer claimed within the grace window: there is no live surface to
|
|
405
|
+
* answer it, so report a failed completion rather than pop a headless
|
|
406
|
+
* modal.
|
|
407
|
+
*/
|
|
408
|
+
private _denyClientTool;
|
|
409
|
+
/**
|
|
410
|
+
* Tracks protocol state changes for a specific server-initiated turn and
|
|
411
|
+
* pushes `IChatProgress[]` items into the session's `progressObs`.
|
|
412
|
+
* When the turn finishes, sets `isCompleteObs` to true.
|
|
413
|
+
*/
|
|
414
|
+
private _trackServerTurnProgress;
|
|
415
|
+
private _completeSessionTurn;
|
|
416
|
+
private _turnStopWatchKey;
|
|
417
|
+
private _ensureTurnStopWatch;
|
|
418
|
+
private _turnDuration;
|
|
419
|
+
private _clearTurnStopWatch;
|
|
420
|
+
private _handleTurn;
|
|
421
|
+
private _handleResumedTurn;
|
|
422
|
+
/**
|
|
423
|
+
* Awaits user confirmation on a PendingConfirmation tool call invocation
|
|
424
|
+
* and dispatches `ChatToolCallConfirmed` back to the server.
|
|
425
|
+
*/
|
|
426
|
+
private _awaitToolConfirmation;
|
|
427
|
+
/**
|
|
428
|
+
* Installs the always-on observable graph that translates session state
|
|
429
|
+
* into `IChatProgress[]` for a specific turn. The same graph is used for:
|
|
430
|
+
* - live turns started by the user via {@link _handleTurn},
|
|
431
|
+
* - reconnect to an in-flight turn from {@link provideChatSessionContent},
|
|
432
|
+
* - server-initiated turns detected by {@link _watchForServerInitiatedTurns}.
|
|
433
|
+
*
|
|
434
|
+
* Differences are captured in {@link IObserveTurnOptions.sink} (where
|
|
435
|
+
* progress is delivered) and {@link IObserveTurnOptions.snapshotToolCalls} /
|
|
436
|
+
* {@link IObserveTurnOptions.seedEmittedLengths} (snapshot continuity for
|
|
437
|
+
* the reconnect case).
|
|
438
|
+
*
|
|
439
|
+
* The returned disposable owns turn progress; subagent observations are
|
|
440
|
+
* retained by the chat session or their root subagent.
|
|
441
|
+
*/
|
|
442
|
+
private _observeTurn;
|
|
443
|
+
/**
|
|
444
|
+
* Surfaces the "MCP server … requires authentication" prompt for a turn.
|
|
445
|
+
*
|
|
446
|
+
* Each server is prompted at most once per conversation: {@link mcpAuthRequired$}
|
|
447
|
+
* is session-wide, so without this guard the prompt would repeat on every
|
|
448
|
+
* message. The per-session {@link _surfacedMcpAuthServers surfaced set} tracks
|
|
449
|
+
* which servers were already prompted; it is pruned by
|
|
450
|
+
* {@link _reconcileSurfacedMcpAuthServers} once a server reaches the running
|
|
451
|
+
* state, so a server that is re-required after being authenticated (e.g.
|
|
452
|
+
* after a restart) prompts again.
|
|
453
|
+
*
|
|
454
|
+
* The emitted part lists only the servers it introduced and shrinks as they
|
|
455
|
+
* authenticate.
|
|
456
|
+
*/
|
|
457
|
+
private _setupMcpAuthPrompt;
|
|
458
|
+
/**
|
|
459
|
+
* Returns the mutable set of MCP server ids already surfaced for
|
|
460
|
+
* authentication in the given session, creating it on first use.
|
|
461
|
+
*/
|
|
462
|
+
private _getSurfacedMcpAuthServers;
|
|
463
|
+
/**
|
|
464
|
+
* Prunes servers that reached the running ({@link McpServerStatus.Ready})
|
|
465
|
+
* state from every session's {@link _surfacedMcpAuthServers surfaced set} so
|
|
466
|
+
* a subsequent auth requirement surfaces a fresh prompt instead of being
|
|
467
|
+
* suppressed. Only the running state counts as actioned — a server that
|
|
468
|
+
* merely left {@link McpServerStatus.AuthRequired} for an error/stopped
|
|
469
|
+
* state was not authenticated and stays suppressed.
|
|
470
|
+
*/
|
|
471
|
+
private _reconcileSurfacedMcpAuthServers;
|
|
472
|
+
private _filterAutoGrantedMcpAuthentication;
|
|
473
|
+
private _autoAuthenticateMcpServer;
|
|
474
|
+
private _setupMarkdownPart;
|
|
475
|
+
private _setupReasoningPart;
|
|
476
|
+
private _setupToolCallPart;
|
|
477
|
+
private _toolCallKey;
|
|
478
|
+
private _inputRequestKey;
|
|
479
|
+
/** Claims a request as rendered until the returned disposable is disposed. */
|
|
480
|
+
private _markRendered;
|
|
481
|
+
/**
|
|
482
|
+
* Records that a turn observer is rendering this chat input request, so the
|
|
483
|
+
* session-level responder leaves its inline elicitation UI in charge.
|
|
484
|
+
*/
|
|
485
|
+
private _markInputRequestRendered;
|
|
486
|
+
/**
|
|
487
|
+
* Records that a turn observer is rendering this tool call, so the
|
|
488
|
+
* session-level responder leaves its inline UI in charge. Releasing the
|
|
489
|
+
* claim also forgets the funnel entries, which is the only cleanup a tool
|
|
490
|
+
* call that never reached `inputNeeded` ever gets.
|
|
491
|
+
*/
|
|
492
|
+
private _markToolCallRendered;
|
|
493
|
+
/**
|
|
494
|
+
* Single funnel for tool-call outcomes, so an inline invocation and the
|
|
495
|
+
* session-level responder can both offer the action while the protocol
|
|
496
|
+
* only ever sees the first answer. Confirming and completing are distinct
|
|
497
|
+
* outcomes, so each is tracked separately.
|
|
498
|
+
*/
|
|
499
|
+
private _resolveToolCall;
|
|
500
|
+
private _forgetResolvedToolCall;
|
|
501
|
+
private _setupOtherClientToolCall;
|
|
502
|
+
private _otherClientToolInvocationOptions;
|
|
503
|
+
/**
|
|
504
|
+
* Per-call setup for a server-driven tool. Adopts a snapshot
|
|
505
|
+
* {@link ChatToolInvocation} when present (reconnect parity); otherwise
|
|
506
|
+
* emits a fresh one. Reacts to status transitions for re-confirmation,
|
|
507
|
+
* terminal revival, finalization, and subagent observation.
|
|
508
|
+
*
|
|
509
|
+
* `renderedBySnapshot` marks a settled tool call the reconnect snapshot
|
|
510
|
+
* already rendered as a serialized part. The invocation is still built so
|
|
511
|
+
* subagent observation has something to drive, but it is not emitted —
|
|
512
|
+
* the snapshot's part is the one on screen.
|
|
513
|
+
*/
|
|
514
|
+
private _setupServerToolCall;
|
|
515
|
+
/** Transitions an invocation from streaming once its AHP tool call is ready. */
|
|
516
|
+
private _ensureLeftStreaming;
|
|
517
|
+
private _createSubagentContext;
|
|
518
|
+
/** Retains each launch's final state so catalog discovery can continue after its parent turn completes. */
|
|
519
|
+
private _trackSubagentToolCall;
|
|
520
|
+
/** Late child activity updates the original response without reopening the completed parent turn. */
|
|
521
|
+
private _appendSubagentProgress;
|
|
522
|
+
private _tryObserveSubagentToolCall;
|
|
523
|
+
/**
|
|
524
|
+
* Per-call setup for a client-provided tool. The observer only renders: it
|
|
525
|
+
* obtains the shared {@link ChatToolInvocation} (created by whichever of
|
|
526
|
+
* this observer or the session-level watcher arrives first), emits it into
|
|
527
|
+
* this chat so it renders in the correct group, drives subagent
|
|
528
|
+
* presentation, and dispatches `ChatToolCallConfirmed` from the
|
|
529
|
+
* invocation's confirmation gate. It never invokes the tool — the
|
|
530
|
+
* session-level watcher owns execution.
|
|
531
|
+
*/
|
|
532
|
+
private _setupClientToolCall;
|
|
533
|
+
private _setupInputRequestPart;
|
|
534
|
+
private _setupPlanReviewInputRequest;
|
|
535
|
+
/**
|
|
536
|
+
* Handle a URL-style {@link ChatInputRequest} by rendering a
|
|
537
|
+
* {@link ChatElicitationRequestPart} that prompts the user to open the
|
|
538
|
+
* URL. Clicking the accept button opens the URL via {@link IOpenerService}
|
|
539
|
+
* and dispatches `ChatInputCompleted` with `Accept`; reject dispatches
|
|
540
|
+
* `Decline`; abandonment / cancellation dispatches `Cancel`.
|
|
541
|
+
*/
|
|
542
|
+
private _setupUrlInputRequest;
|
|
543
|
+
/**
|
|
544
|
+
* Synchronizes PTY and non-PTY terminal content, including the live-to-retained output handoff, and updates invocation metadata.
|
|
545
|
+
*/
|
|
546
|
+
private _reviveTerminalIfNeeded;
|
|
547
|
+
/**
|
|
548
|
+
* Enriches serialized history with inner tool calls from subagent child
|
|
549
|
+
* sessions. For each subagent tool call found in the history, subscribes
|
|
550
|
+
* to the corresponding child session and appends its inner tool calls
|
|
551
|
+
* (with `subAgentInvocationId` set) to the response parts.
|
|
552
|
+
*/
|
|
553
|
+
private _enrichHistoryWithSubagentCalls;
|
|
554
|
+
private _loadSubagentState;
|
|
555
|
+
/**
|
|
556
|
+
* Writes a subagent's accumulated cost (AIC) and model — summed across its
|
|
557
|
+
* child session's turns — onto its serialized subagent tool call so the
|
|
558
|
+
* hover survives a reload. Mirrors the live observers in
|
|
559
|
+
* {@link _setupServerToolCall}.
|
|
560
|
+
*/
|
|
561
|
+
private _applySubagentUsageToHistoryPart;
|
|
562
|
+
private _refreshRestoredSubagentParts;
|
|
563
|
+
private _getSubagentInnerParts;
|
|
564
|
+
/**
|
|
565
|
+
* Subscribes to a child subagent session and forwards its tool calls
|
|
566
|
+
* as progress parts into the parent session's response, with
|
|
567
|
+
* `subAgentInvocationId` set so the renderer groups them under the parent
|
|
568
|
+
* subagent widget.
|
|
569
|
+
*
|
|
570
|
+
* Implementation: builds a per-turn-id keyed observation over the child
|
|
571
|
+
* session's `turns` and `activeTurn`. Each turn id discovered gets its
|
|
572
|
+
* own {@link _observeTurn} instance running in subagent mode (which skips
|
|
573
|
+
* markdown/reasoning/input-request emission and tags tool calls with the
|
|
574
|
+
* parent tool call id). Each per-turn observer self-disposes when its
|
|
575
|
+
* turn reaches a terminal state; the outer observation is torn down when
|
|
576
|
+
* the caller disposes `disposables`.
|
|
577
|
+
*/
|
|
578
|
+
private _observeSubagentSession;
|
|
579
|
+
/**
|
|
580
|
+
* Wires up an ongoing state listener that streams incremental progress
|
|
581
|
+
* from an already-running turn into the chat session's progressObs.
|
|
582
|
+
* This is the reconnection counterpart of {@link _handleTurn}, which
|
|
583
|
+
* handles newly-initiated turns.
|
|
584
|
+
*/
|
|
585
|
+
private _reconnectToActiveTurn;
|
|
586
|
+
/**
|
|
587
|
+
* Ensures the chat model has a snapshot controller bound (creating one
|
|
588
|
+
* via our registered editing-session provider if needed) and returns it.
|
|
589
|
+
* Hydrates the controller from any pending history turns on first access.
|
|
590
|
+
*/
|
|
591
|
+
private _ensureSnapshotController;
|
|
592
|
+
/**
|
|
593
|
+
* Records snapshot data for a completed tool call (so restore-snapshot
|
|
594
|
+
* works) and returns the {@link IChatExternalEdit} progress parts to
|
|
595
|
+
* render the per-file edit pills.
|
|
596
|
+
*/
|
|
597
|
+
private _hydrateFileEdits;
|
|
598
|
+
/**
|
|
599
|
+
* Attaches to an existing server-side terminal via the agent host
|
|
600
|
+
* terminal service and registers it with the terminal chat service.
|
|
601
|
+
*
|
|
602
|
+
* Returns the terminal instance created or reused by the terminal service.
|
|
603
|
+
*/
|
|
604
|
+
private _ensureTerminalInstance;
|
|
605
|
+
/** Maps a UI session resource to a backend provider URI. */
|
|
606
|
+
private _resolveSessionUri;
|
|
607
|
+
private _isNewSessionResource;
|
|
608
|
+
/**
|
|
609
|
+
* Forks the conversation at the given request point into a new peer chat
|
|
610
|
+
* of the same session. AHP models forking at the chat level only, so the
|
|
611
|
+
* fork stays inside the source session and is addressed by a chat
|
|
612
|
+
* fragment on the session resource.
|
|
613
|
+
*/
|
|
614
|
+
private _forkSession;
|
|
615
|
+
private _ensureRequiredAuthentication;
|
|
616
|
+
/** Creates a new backend session and subscribes to its state. */
|
|
617
|
+
private _createAndSubscribe;
|
|
618
|
+
/**
|
|
619
|
+
* Keeps chat model and protocol pending messages synchronized in both directions.
|
|
620
|
+
* No-ops if already subscribed.
|
|
621
|
+
*/
|
|
622
|
+
private _ensurePendingMessageSubscription;
|
|
623
|
+
private _ensureDraftSyncSubscription;
|
|
624
|
+
private _acquireOrWaitForSession;
|
|
625
|
+
private _installDraftSync;
|
|
626
|
+
/** Applies a remote draft without replacing local input state the protocol does not carry. */
|
|
627
|
+
private _applyRemoteDraft;
|
|
628
|
+
private _inputStateToDraft;
|
|
629
|
+
/**
|
|
630
|
+
* Check if an error is an "authentication required" error.
|
|
631
|
+
* Checks for the AHP_AUTH_REQUIRED error code when available,
|
|
632
|
+
* with a message-based fallback for transports that don't preserve
|
|
633
|
+
* structured error codes (e.g. ProxyChannel).
|
|
634
|
+
*/
|
|
635
|
+
private _isAuthRequiredError;
|
|
636
|
+
private _createModelSelection;
|
|
637
|
+
private _draftToInputState;
|
|
638
|
+
/**
|
|
639
|
+
* Extracts the raw model id from a language-model service identifier.
|
|
640
|
+
* E.g. "agent-host-copilot:claude-sonnet-4-20250514" → "claude-sonnet-4-20250514".
|
|
641
|
+
* Foreign extension-host identifiers (`${vendor}/${id}`) are dropped so
|
|
642
|
+
* the agent host falls back to its default model.
|
|
643
|
+
*/
|
|
644
|
+
private _extractRawModelId;
|
|
645
|
+
private _toLanguageModelId;
|
|
646
|
+
private _getTurnResponseDetails;
|
|
647
|
+
/**
|
|
648
|
+
* Builds a per-turn model lookup that namespaces raw AHP model ids into
|
|
649
|
+
* chat-layer language-model ids and resolves human-readable display
|
|
650
|
+
* names via the registered language-model providers (so the chat UI's
|
|
651
|
+
* per-response footer can show e.g. "Claude Opus 4.7" instead of the
|
|
652
|
+
* raw model id). `fallbackRawModelId` is used when a turn's
|
|
653
|
+
* `usage?.model` is not yet set (e.g. older sessions or turns that
|
|
654
|
+
* never reported usage).
|
|
655
|
+
*/
|
|
656
|
+
private _createTurnModelLookup;
|
|
657
|
+
private _resolveRequestedWorkingDirectory;
|
|
658
|
+
/** `undefined` is preserved for createSession to let the host choose its working directories. */
|
|
659
|
+
private _resolveRequestedWorkingDirectories;
|
|
660
|
+
/**
|
|
661
|
+
* Drop working directories whose scheme the host cannot address, falling back to `undefined` so
|
|
662
|
+
* it picks its own. Schemes are compared as the host receives them, after unwrapping.
|
|
663
|
+
*/
|
|
664
|
+
private _hostAddressableWorkingDirectories;
|
|
665
|
+
/**
|
|
666
|
+
* Scope roots always describe a concrete customization lookup. This differs
|
|
667
|
+
* from `_resolveRequestedWorkingDirectories`: its `undefined` is protocol
|
|
668
|
+
* meaningful and lets the host choose working directories for createSession.
|
|
669
|
+
*
|
|
670
|
+
* An existing session's roots are fixed at creation and persisted in its
|
|
671
|
+
* state, so they are read from there rather than recomputed from the current
|
|
672
|
+
* workspace — otherwise a single-folder session opened inside a multi-root
|
|
673
|
+
* workspace would pick up the other workspace folders. New sessions have no
|
|
674
|
+
* state yet, so they fall back to the workspace-derived set they will be
|
|
675
|
+
* created with.
|
|
676
|
+
*/
|
|
677
|
+
private _resolveCustomizationScopeRoots;
|
|
678
|
+
/**
|
|
679
|
+
* The working directories an already-created session was started with, read
|
|
680
|
+
* from its authoritative (hydrated) state.
|
|
681
|
+
*
|
|
682
|
+
* Returns `undefined` when the session's working directories are absent — no
|
|
683
|
+
* hydrated state yet, or a session that inherits its directories — so callers
|
|
684
|
+
* fall back to the workspace-derived set. An explicit empty set is
|
|
685
|
+
* authoritative and returned as `[]`: a workspace-less session must not
|
|
686
|
+
* inherit the current workspace's roots. This mirrors the host-side
|
|
687
|
+
* `undefined` (inherit) vs `[]` (explicitly none) distinction.
|
|
688
|
+
*/
|
|
689
|
+
private _existingSessionWorkingDirectories;
|
|
690
|
+
/**
|
|
691
|
+
* Resolves the local folders the agent will run in, for the workspace-trust
|
|
692
|
+
* gate: an existing session's persisted working directories, or a new session's
|
|
693
|
+
* requested ones.
|
|
694
|
+
*
|
|
695
|
+
* Returns `undefined` for a workspace-less session (a quick chat) to signal the
|
|
696
|
+
* caller to skip the folder-trust gate entirely: its only working directory is
|
|
697
|
+
* an internal scratch dir (`~/.copilot/chats/<id>`), an implementation detail
|
|
698
|
+
* rather than a user workspace, so it must not be treated as a trust root.
|
|
699
|
+
* Otherwise an explicit empty set is honored and only a genuinely unresolved set
|
|
700
|
+
* falls back to the requested/workspace folders.
|
|
701
|
+
*/
|
|
702
|
+
private _resolveSessionTrustFolders;
|
|
703
|
+
/**
|
|
704
|
+
* Grants (and persists) trust for a worktree-isolated session's VS Code-created
|
|
705
|
+
* worktree when the base repository the user already trusts is trusted, so the
|
|
706
|
+
* trust gate does not prompt for the worktree.
|
|
707
|
+
*
|
|
708
|
+
* This lives in the handler because `_invokeAgent` is the only universal
|
|
709
|
+
* chokepoint every turn passes through — follow-up turns bypass the sessions
|
|
710
|
+
* open gate ({@link ISessionsService.canOpenSession}). Protocol `SessionState`
|
|
711
|
+
* does not carry the sessions layer's `gitRepository.workTreeUri`, so
|
|
712
|
+
* eligibility uses the isolation config plus a structural guard: only a strict
|
|
713
|
+
* descendant of the repository's `.worktrees` sibling
|
|
714
|
+
* ({@link isWorktreeUnderRepository}) can inherit trust — a trusted base URI is
|
|
715
|
+
* never enough on its own, and the shared `<repo>.worktrees` container is
|
|
716
|
+
* excluded so a grant can never cascade to every worktree. Mirrors the
|
|
717
|
+
* sessions-layer `ensureSessionWorktreesTrusted`; kept separate because
|
|
718
|
+
* `workbench` must not import `sessions`.
|
|
719
|
+
*/
|
|
720
|
+
private _inheritWorktreeTrust;
|
|
721
|
+
/**
|
|
722
|
+
* Ensures every local (file-scheme) folder the agent will run in is trusted
|
|
723
|
+
* before a session is spawned; returns `false` if the user declines any. Trust
|
|
724
|
+
* is checked for all folders in parallel and only untrusted folders are prompted
|
|
725
|
+
* for, one at a time.
|
|
726
|
+
*/
|
|
727
|
+
private _ensureFoldersTrusted;
|
|
728
|
+
private _convertVariablesToAttachments;
|
|
729
|
+
/**
|
|
730
|
+
* Forward the active editor (which the suggested-context flow omits in agent mode) as ambient context, deduped
|
|
731
|
+
* against files the user attached explicitly. Gated on
|
|
732
|
+
* {@link ChatConfiguration.ImplicitContextActiveEditor} (on by default, off in the Agents window).
|
|
733
|
+
* Unsaved handling lives in {@link _convertVariableToAttachment}.
|
|
734
|
+
*/
|
|
735
|
+
private _appendActiveEditorAttachments;
|
|
736
|
+
/** Add the stored outputs for an active notebook cell as a virtual JSON document. */
|
|
737
|
+
private _appendNotebookCellOutputAttachment;
|
|
738
|
+
/** Dedupe identity for a file/implicit entry: rebased URI, suffixed with the range for a selection. */
|
|
739
|
+
private _fileEntryDedupeKey;
|
|
740
|
+
/** The selection range carried by a file/implicit entry, or `undefined` for whole-document references. */
|
|
741
|
+
private _entrySelection;
|
|
742
|
+
/** Dedupe identity: the bare URI for a whole document, suffixed with the range for a selection. */
|
|
743
|
+
private _attachmentDedupeKey;
|
|
744
|
+
/**
|
|
745
|
+
* Whether this backend reads referenced files from disk (rather than seeing the editor's
|
|
746
|
+
* in-memory buffer) and therefore needs the live text of an unsaved / dirty editor inlined as
|
|
747
|
+
* an embedded resource. Copilot CLI and Codex both run as separate processes with only disk
|
|
748
|
+
* access, so a `@path` mention (or an `untitled:` URI) would give them stale or missing content.
|
|
749
|
+
*/
|
|
750
|
+
private _backendInlinesUnsavedEditors;
|
|
751
|
+
/** A resource is unsaved when it's untitled or a saved file with in-memory (dirty) changes. */
|
|
752
|
+
private _isUnsavedResource;
|
|
753
|
+
/**
|
|
754
|
+
* Inline the live (in-memory) text of an unsaved editor as an embedded resource so a path-reading backend still
|
|
755
|
+
* gets current content, preserving the entry's selection, range and `_meta`. Selection entries inline only the
|
|
756
|
+
* selected text; whole-document entries inline the full buffer. Returns `undefined` when no loaded text model is
|
|
757
|
+
* available or the inlined text exceeds {@link MAX_INLINED_UNSAVED_EDITOR_BYTES}.
|
|
758
|
+
*/
|
|
759
|
+
private _buildUnsavedEditorAttachment;
|
|
760
|
+
/**
|
|
761
|
+
* The inline text to send for an unsaved editor: the selected text for a selection, else the whole buffer. Uses the
|
|
762
|
+
* model length APIs so an over-cap buffer is skipped (returns `undefined`) without ever being materialized.
|
|
763
|
+
*/
|
|
764
|
+
private _getUnsavedEditorAttachmentText;
|
|
765
|
+
/** The editor range of a file/implicit selection entry, used to slice the live model; `undefined` otherwise. */
|
|
766
|
+
private _entryModelSelectionRange;
|
|
767
|
+
/** The {@link Location} of a file/implicit entry that represents a selection, or `undefined` for whole documents. */
|
|
768
|
+
private _entrySelectionLocation;
|
|
769
|
+
private _variableEntriesToAttachments;
|
|
770
|
+
private _convertVariableToAttachment;
|
|
771
|
+
private _toChatReferenceAttachment;
|
|
772
|
+
private _toElementImageAttachment;
|
|
773
|
+
private _toSessionReferenceAttachment;
|
|
774
|
+
private _toSessionReferenceAttachments;
|
|
775
|
+
private _toSessionReferenceTrajectoryAttachment;
|
|
776
|
+
private _toSessionReferenceTrajectoryPath;
|
|
777
|
+
private _toResourceAttachment;
|
|
778
|
+
private _toSelectionAttachment;
|
|
779
|
+
private _toImageAttachment;
|
|
780
|
+
private _toAgentFeedbackAttachment;
|
|
781
|
+
private _toSimpleAttachment;
|
|
782
|
+
private _toEmbeddedTextAttachment;
|
|
783
|
+
private _toAttachmentReferenceRange;
|
|
784
|
+
private _toTextRange;
|
|
785
|
+
/**
|
|
786
|
+
* Rebase a `file:`-scheme attachment URI from the session's requested
|
|
787
|
+
* working directory onto the server-resolved working directory. This
|
|
788
|
+
* matters on the first turn of a worktree-isolated session, where the
|
|
789
|
+
* provider creates a worktree under a different path than the workspace
|
|
790
|
+
* folder the workbench attached the file from. Returns the URI unchanged
|
|
791
|
+
* if the requested and resolved directories match, the URI is not under
|
|
792
|
+
* the requested directory, or either side is unavailable.
|
|
793
|
+
*/
|
|
794
|
+
private _rebaseAttachmentUri;
|
|
795
|
+
/**
|
|
796
|
+
* Get or create a session subscription. The first call for a given URI
|
|
797
|
+
* triggers a server subscribe; subsequent calls increment the refcount.
|
|
798
|
+
*/
|
|
799
|
+
private _ensureSessionSubscription;
|
|
800
|
+
/**
|
|
801
|
+
* Get or create the default-chat subscription for a session. Mirrors the
|
|
802
|
+
* refcount lifecycle of {@link _ensureSessionSubscription}.
|
|
803
|
+
*/
|
|
804
|
+
private _ensureDefaultChatSubscription;
|
|
805
|
+
/**
|
|
806
|
+
* Release the subscriptions held by a single chat session on dispose.
|
|
807
|
+
*
|
|
808
|
+
* Unlike {@link _releaseSessionSubscription} (which tears down every chat
|
|
809
|
+
* of a session at once), this only releases the disposed chat's own
|
|
810
|
+
* conversation subscription and never touches sibling peer chats: closing
|
|
811
|
+
* one chat of a multi-chat session must not strand another chat — including
|
|
812
|
+
* one that is concurrently hydrating in {@link provideChatSessionContent} —
|
|
813
|
+
* on a disposed subscription. The session summary subscription (and its
|
|
814
|
+
* lockstep default-chat subscription) is shared by every chat of the
|
|
815
|
+
* session, so it is only torn down once no sibling chat session is still
|
|
816
|
+
* active or mid-hydration for the same backend session.
|
|
817
|
+
*/
|
|
818
|
+
private _releaseChatSessionSubscriptions;
|
|
819
|
+
/**
|
|
820
|
+
* Returns whether another chat session for the given backend session URI is
|
|
821
|
+
* still active or in the middle of hydrating its subscriptions, so the
|
|
822
|
+
* shared session subscription must be kept alive. Callers invoke this after
|
|
823
|
+
* removing their own entry from {@link _activeSessions}.
|
|
824
|
+
*/
|
|
825
|
+
private _hasOtherSessionHold;
|
|
826
|
+
/**
|
|
827
|
+
* Read the current optimistic session state for a backend session URI,
|
|
828
|
+
* merged with its default chat so conversation contents (turns, active
|
|
829
|
+
* turn, pending/queued messages, input requests) are visible.
|
|
830
|
+
*/
|
|
831
|
+
/**
|
|
832
|
+
* Resolves once a subscription has received its first snapshot (its
|
|
833
|
+
* `value` is no longer `undefined`) — i.e. it has hydrated with state or
|
|
834
|
+
* an error. Resolves immediately if already hydrated or if cancellation
|
|
835
|
+
* is requested.
|
|
836
|
+
*/
|
|
837
|
+
private _whenSubscriptionHydrated;
|
|
838
|
+
private _getSessionState;
|
|
839
|
+
private _isChatReadOnly;
|
|
840
|
+
private _getRawSessionState;
|
|
841
|
+
private _requireRawSessionState;
|
|
842
|
+
private _requireDefaultChatUri;
|
|
843
|
+
/** Read the current optimistic default-chat state for a backend session URI. */
|
|
844
|
+
private _getDefaultChatState;
|
|
845
|
+
/** Read the current optimistic state for an additional peer chat URI. */
|
|
846
|
+
private _getAdditionalChatState;
|
|
847
|
+
/**
|
|
848
|
+
* Get or create the subscription for an additional peer chat, keyed by the
|
|
849
|
+
* chat channel URI. Mirrors {@link _ensureDefaultChatSubscription} but for
|
|
850
|
+
* non-default chats so their conversation contents hydrate independently.
|
|
851
|
+
*/
|
|
852
|
+
private _ensureAdditionalChatSubscription;
|
|
853
|
+
/**
|
|
854
|
+
* Subscribe to the conversation channel of `sessionResource`'s chat and
|
|
855
|
+
* return the {@link IAgentSubscription}. Routes to the default-chat
|
|
856
|
+
* subscription (fragment-less resource) or to an additional peer chat.
|
|
857
|
+
*/
|
|
858
|
+
private _ensureChatSubscription;
|
|
859
|
+
resolveChatResponseUri(_sessionResource: URI, href: string, _kind: "link" | "image"): string;
|
|
860
|
+
/**
|
|
861
|
+
* Read the current root state.
|
|
862
|
+
*/
|
|
863
|
+
private _getRootState;
|
|
864
|
+
dispose(): void;
|
|
865
|
+
}
|
|
866
|
+
/**
|
|
867
|
+
* Converts an internal {@link IToolResult} to a protocol
|
|
868
|
+
* {@link import('../../../../../../platform/agentHost/common/state/protocol/state.js').ToolCallResult}.
|
|
869
|
+
*/
|
|
870
|
+
export declare function toolResultToProtocol(result: IToolResult, toolName: string): {
|
|
871
|
+
success: boolean;
|
|
872
|
+
pastTenseMessage: StringOrMarkdown;
|
|
873
|
+
content?: ({
|
|
874
|
+
type: ToolResultContentType.Text;
|
|
875
|
+
text: string;
|
|
876
|
+
} | {
|
|
877
|
+
type: ToolResultContentType.EmbeddedResource;
|
|
878
|
+
data: string;
|
|
879
|
+
contentType: string;
|
|
880
|
+
})[];
|
|
881
|
+
error?: {
|
|
882
|
+
message: string;
|
|
883
|
+
};
|
|
884
|
+
};
|