@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,20 @@
|
|
|
1
|
+
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
2
|
+
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
3
|
+
import { IContextKeyService } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service";
|
|
4
|
+
import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
|
|
5
|
+
import { IWorkbenchContribution } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions";
|
|
6
|
+
import { IWorkbenchAssignmentService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/assignment/common/assignmentService.service";
|
|
7
|
+
/**
|
|
8
|
+
* Resolves the strictly hidden editor harness-picker setting against its experiment treatment.
|
|
9
|
+
* Hidden settings are excluded from the generic configuration experiment resolver.
|
|
10
|
+
*/
|
|
11
|
+
export declare class AgentHostExistingSessionHarnessPickerEnablement extends Disposable implements IWorkbenchContribution {
|
|
12
|
+
private readonly configurationService;
|
|
13
|
+
private readonly assignmentService;
|
|
14
|
+
private readonly logService;
|
|
15
|
+
static readonly ID = "workbench.contrib.agentHostExistingSessionHarnessPickerEnablement";
|
|
16
|
+
private readonly enabledContext;
|
|
17
|
+
private updateRequest;
|
|
18
|
+
constructor(configurationService: IConfigurationService, contextKeyService: IContextKeyService, assignmentService: IWorkbenchAssignmentService, logService: ILogService);
|
|
19
|
+
private update;
|
|
20
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
4
|
+
import { AgentHostExistingSessionHarnessPickerEnabledSettingId, AGENT_HOST_EXISTING_SESSION_HARNESS_PICKER_ENABLED_CONTEXT_KEY } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agentHostEnablementService';
|
|
5
|
+
import { isConfigured } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration';
|
|
6
|
+
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
7
|
+
import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
8
|
+
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
9
|
+
import { IWorkbenchAssignmentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/assignment/common/assignmentService.service';
|
|
10
|
+
|
|
11
|
+
const treatmentId = `config.${AgentHostExistingSessionHarnessPickerEnabledSettingId}`;
|
|
12
|
+
let AgentHostExistingSessionHarnessPickerEnablement = class AgentHostExistingSessionHarnessPickerEnablement extends Disposable {
|
|
13
|
+
static {
|
|
14
|
+
this.ID = "workbench.contrib.agentHostExistingSessionHarnessPickerEnablement";
|
|
15
|
+
}
|
|
16
|
+
constructor(configurationService, contextKeyService, assignmentService, logService) {
|
|
17
|
+
super();
|
|
18
|
+
this.configurationService = configurationService;
|
|
19
|
+
this.assignmentService = assignmentService;
|
|
20
|
+
this.logService = logService;
|
|
21
|
+
this.updateRequest = 0;
|
|
22
|
+
this.enabledContext = AGENT_HOST_EXISTING_SESSION_HARNESS_PICKER_ENABLED_CONTEXT_KEY.bindTo(contextKeyService);
|
|
23
|
+
this._register(this.configurationService.onDidChangeConfiguration(event => {
|
|
24
|
+
if (event.affectsConfiguration(AgentHostExistingSessionHarnessPickerEnabledSettingId)) {
|
|
25
|
+
void this.update();
|
|
26
|
+
}
|
|
27
|
+
}));
|
|
28
|
+
this._register(this.assignmentService.onDidRefetchAssignments(() => void this.update()));
|
|
29
|
+
void this.update();
|
|
30
|
+
}
|
|
31
|
+
async update() {
|
|
32
|
+
const request = ++this.updateRequest;
|
|
33
|
+
const inspection = this.configurationService.inspect(AgentHostExistingSessionHarnessPickerEnabledSettingId);
|
|
34
|
+
if (isConfigured(inspection)) {
|
|
35
|
+
this.enabledContext.set(inspection.value === true);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
let enabled = false;
|
|
39
|
+
try {
|
|
40
|
+
enabled = (await this.assignmentService.getTreatment(treatmentId)) === true;
|
|
41
|
+
} catch (error) {
|
|
42
|
+
if (this._store.isDisposed || request !== this.updateRequest) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
this.logService.warn(
|
|
46
|
+
`[AgentHostExistingSessionHarnessPickerEnablement] Failed to resolve treatment '${treatmentId}'.`,
|
|
47
|
+
error
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
if (this._store.isDisposed || request !== this.updateRequest) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const currentInspection = this.configurationService.inspect(AgentHostExistingSessionHarnessPickerEnabledSettingId);
|
|
54
|
+
this.enabledContext.set(
|
|
55
|
+
isConfigured(currentInspection) ? currentInspection.value === true : enabled
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
AgentHostExistingSessionHarnessPickerEnablement = ( __decorate([( __param(0, IConfigurationService)), ( __param(1, IContextKeyService)), ( __param(2, IWorkbenchAssignmentService)), ( __param(3, ILogService))], AgentHostExistingSessionHarnessPickerEnablement));
|
|
60
|
+
|
|
61
|
+
export { AgentHostExistingSessionHarnessPickerEnablement };
|
|
@@ -0,0 +1,112 @@
|
|
|
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 { SessionModelInfo } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/sessionState";
|
|
4
|
+
import { ILanguageModelChatMetadataAndIdentifier, ILanguageModelChatProvider } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModels";
|
|
5
|
+
import { ILanguageModelsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModels.service";
|
|
6
|
+
/**
|
|
7
|
+
* Returns whether an agent host provider exposes a synthetic "Auto" model to
|
|
8
|
+
* fall back to.
|
|
9
|
+
*
|
|
10
|
+
* Today only the Copilot CLI harness exposes an Auto selection and can run
|
|
11
|
+
* without an explicit model, so it shows "Auto" rather than a "No models
|
|
12
|
+
* available" state when no models are listed. Other harnesses (Claude,
|
|
13
|
+
* Codex, …) require an explicit model.
|
|
14
|
+
*
|
|
15
|
+
* `provider` is the underlying agent provider id (e.g. `'copilotcli'`,
|
|
16
|
+
* `'claude'`, `'codex'`), not the `agent-host-<provider>` session type.
|
|
17
|
+
*
|
|
18
|
+
* TODO: hoist this capability onto the agent host protocol (e.g. a
|
|
19
|
+
* `supportsAutoModel?: boolean` on `IAgentDescriptor` / `AgentInfo`) so each
|
|
20
|
+
* agent declares its own value instead of this allow-list living in core.
|
|
21
|
+
*/
|
|
22
|
+
export declare function agentHostProviderSupportsAutoModel(provider: string): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Read-only view of the workbench model catalogue an agent host's models are enriched from.
|
|
25
|
+
*
|
|
26
|
+
* Narrowed to the reads {@link AgentHostLanguageModelProvider} performs (all plain lookups into
|
|
27
|
+
* already-registered models, so none of them re-enter a provider) plus the change signal, both so
|
|
28
|
+
* the dependency stays obviously side-effect free and so tests can supply a small fake.
|
|
29
|
+
*/
|
|
30
|
+
export type IAgentHostModelCatalogue = Pick<ILanguageModelsService, "getLanguageModelIds" | "lookupLanguageModel" | "onDidChangeLanguageModels">;
|
|
31
|
+
/**
|
|
32
|
+
* Exposes models available from the agent host process as selectable
|
|
33
|
+
* language models in the chat model picker. Models are provided from
|
|
34
|
+
* root state (via {@link AgentInfo.models}) rather than via RPC.
|
|
35
|
+
*/
|
|
36
|
+
export declare class AgentHostLanguageModelProvider extends Disposable implements ILanguageModelChatProvider {
|
|
37
|
+
private readonly _sessionType;
|
|
38
|
+
private readonly _vendor;
|
|
39
|
+
private readonly _catalogue?;
|
|
40
|
+
private readonly _onDidChange;
|
|
41
|
+
readonly onDidChange: import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event<void>;
|
|
42
|
+
private _models;
|
|
43
|
+
constructor(_sessionType: string, _vendor: string, _catalogue?: IAgentHostModelCatalogue | undefined);
|
|
44
|
+
/**
|
|
45
|
+
* Called by {@link AgentHostContribution} when models change in root state.
|
|
46
|
+
*/
|
|
47
|
+
updateModels(models: readonly SessionModelInfo[]): void;
|
|
48
|
+
provideLanguageModelChatInfo(_options: unknown, _token: CancellationToken): Promise<ILanguageModelChatMetadataAndIdentifier[]>;
|
|
49
|
+
/**
|
|
50
|
+
* The workbench catalogue entry describing the same model, when one is known.
|
|
51
|
+
*
|
|
52
|
+
* A host driving the Copilot SDK advertises no billing and, where the SDK omits them, no token
|
|
53
|
+
* limits — so the CAPI-backed Copilot catalogue fills the gaps.
|
|
54
|
+
*
|
|
55
|
+
* Matching by raw model id does not prove the two describe the same offering — they can differ
|
|
56
|
+
* by entitlement, policy, rollout or billing route — so this is restricted to models billed
|
|
57
|
+
* through Copilot and only ever fills fields the host left absent.
|
|
58
|
+
*
|
|
59
|
+
* The token-limit half is a shim: those are native protocol fields, and a host that populates
|
|
60
|
+
* them makes the fallback dead. The billing half is not. Pricing is deliberately kept off the
|
|
61
|
+
* agent host protocol as operator-sensitive, so a client that wants to show it has to source it
|
|
62
|
+
* itself. Removing this join therefore means dropping pricing for these models, which is a
|
|
63
|
+
* product decision rather than a cleanup.
|
|
64
|
+
*/
|
|
65
|
+
private _catalogueEntryFor;
|
|
66
|
+
/**
|
|
67
|
+
* Translate a host's model {@link ConfigSchema} into the picker's schema shape.
|
|
68
|
+
*
|
|
69
|
+
* Values and display text belong to the producer; the workbench only picks the group
|
|
70
|
+
* ({@link _groupForConfigKey}). The one exception is a reasoning-effort enum with no display
|
|
71
|
+
* text at all, labelled locally rather than rendering raw values like `xhigh`.
|
|
72
|
+
*
|
|
73
|
+
* A property is never dropped for want of local enrichment: a host advertises one because it
|
|
74
|
+
* will honour it, and a new model, a staged rollout and an unresolved catalogue all look
|
|
75
|
+
* identical from here.
|
|
76
|
+
*/
|
|
77
|
+
private _toLanguageModelConfigurationSchema;
|
|
78
|
+
/** Config keys whose enum values are reasoning-effort levels, whatever the producer named them. */
|
|
79
|
+
private static readonly _reasoningEffortKeys;
|
|
80
|
+
/**
|
|
81
|
+
* Localized labels and descriptions for a reasoning-effort enum whose producer supplied none.
|
|
82
|
+
*
|
|
83
|
+
* A host that derives its schema from an upstream SDK advertises the accepted effort values
|
|
84
|
+
* without display text, because it has none the SDK did not give it — the Copilot agent host
|
|
85
|
+
* inside a cloud sandbox does exactly that. Deriving the text here keeps the picker from
|
|
86
|
+
* rendering raw values like `xhigh`, and matches what the agents that build their schema
|
|
87
|
+
* locally already emit.
|
|
88
|
+
*
|
|
89
|
+
* Only synthesized when every enum value is a string, since labels align with `enum` by index
|
|
90
|
+
* and a partial list would mislabel the rest.
|
|
91
|
+
*
|
|
92
|
+
* No `default` is synthesized: schema defaults are merged into the configuration that is sent
|
|
93
|
+
* (see `resolveModelConfiguration`), so inventing one would send an explicit effort where the
|
|
94
|
+
* host expects the value omitted and the backend to choose.
|
|
95
|
+
*/
|
|
96
|
+
private static _reasoningEffortDisplay;
|
|
97
|
+
private static _groupForConfigKey;
|
|
98
|
+
/**
|
|
99
|
+
* Derives the picker group id for a model — the vendor its models are bucketed
|
|
100
|
+
* under. A producer may pin the group id explicitly in `_meta` (e.g. Claude
|
|
101
|
+
* stamps its transport vendor — `copilot`/`anthropic` — there while keeping
|
|
102
|
+
* `provider` as the `claude` routing owner); that wins. Otherwise BYOK models
|
|
103
|
+
* are surfaced by the agent host under the `vendor/[group/]id` selection id (see
|
|
104
|
+
* `resolveByokSessionConfig`), so their upstream vendor is the id prefix; native
|
|
105
|
+
* harness models have no prefix and group under their `provider` (the harness,
|
|
106
|
+
* e.g. `copilotcli`). The picker resolves the display name from the vendor
|
|
107
|
+
* registry — no name mapping lives here.
|
|
108
|
+
*/
|
|
109
|
+
private _modelGroupFor;
|
|
110
|
+
sendChatRequest(): Promise<never>;
|
|
111
|
+
provideTokenCount(): Promise<number>;
|
|
112
|
+
}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
|
|
2
|
+
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
3
|
+
import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
4
|
+
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
5
|
+
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
6
|
+
import { readAgentModelNoticesMeta } from '../../../../../../platform/agentHost/common/agentModelNotices.js';
|
|
7
|
+
import { readAgentModelPricingMeta } from '../../../../../../platform/agentHost/common/agentModelPricing.js';
|
|
8
|
+
import { readAgentModelByokIdentifier } from '../../../../../../platform/agentHost/common/agentModelByokMeta.js';
|
|
9
|
+
import { readAgentModelGroupId, readAgentModelSourceId } from '@codingame/monaco-vscode-katex-common/vscode/vs/platform/agentHost/common/agentModelSource';
|
|
10
|
+
import { getReasoningEffortDescription, getReasoningEffortLabel } from '@codingame/monaco-vscode-katex-common/vscode/vs/platform/agentHost/common/reasoningEffort';
|
|
11
|
+
import { nullExtensionDescription } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions';
|
|
12
|
+
import { COPILOT_VENDOR_ID, AUTO_RAW_MODEL_ID, ILanguageModelChatMetadata } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModels';
|
|
13
|
+
|
|
14
|
+
function agentHostProviderSupportsAutoModel(provider) {
|
|
15
|
+
return provider === "copilotcli";
|
|
16
|
+
}
|
|
17
|
+
class AgentHostLanguageModelProvider extends Disposable {
|
|
18
|
+
constructor(_sessionType, _vendor, _catalogue) {
|
|
19
|
+
super();
|
|
20
|
+
this._sessionType = _sessionType;
|
|
21
|
+
this._vendor = _vendor;
|
|
22
|
+
this._catalogue = _catalogue;
|
|
23
|
+
this._onDidChange = this._register(( new Emitter()));
|
|
24
|
+
this.onDidChange = this._onDidChange.event;
|
|
25
|
+
this._models = [];
|
|
26
|
+
if (this._catalogue) {
|
|
27
|
+
this._register(this._catalogue.onDidChangeLanguageModels(vendor => {
|
|
28
|
+
if (vendor === COPILOT_VENDOR_ID) {
|
|
29
|
+
this._onDidChange.fire();
|
|
30
|
+
}
|
|
31
|
+
}));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
updateModels(models) {
|
|
35
|
+
this._models = models;
|
|
36
|
+
this._onDidChange.fire();
|
|
37
|
+
}
|
|
38
|
+
async provideLanguageModelChatInfo(_options, _token) {
|
|
39
|
+
return (this._models.filter(m => m.policyState !== "disabled").map(m => {
|
|
40
|
+
const pricing = readAgentModelPricingMeta(m);
|
|
41
|
+
const multiplierNumeric = pricing.multiplierNumeric;
|
|
42
|
+
const isAuto = m.id === AUTO_RAW_MODEL_ID;
|
|
43
|
+
const notices = isAuto ? undefined : readAgentModelNoticesMeta(m);
|
|
44
|
+
const discountPercent = pricing.discountPercent;
|
|
45
|
+
const hasDiscount = typeof discountPercent === "number" && discountPercent > 0 && discountPercent <= 100;
|
|
46
|
+
const detail = isAuto && hasDiscount ? ( localize(6019, "{0}% discount", discountPercent)) : undefined;
|
|
47
|
+
const tooltip = notices?.rowWarning ?? (isAuto ? ILanguageModelChatMetadata.getAutoModelDescription(hasDiscount ? discountPercent : undefined) : undefined);
|
|
48
|
+
const modelGroup = this._modelGroupFor(m);
|
|
49
|
+
const byokModelIdentifier = readAgentModelByokIdentifier(m);
|
|
50
|
+
const known = this._catalogueEntryFor(m, modelGroup);
|
|
51
|
+
return {
|
|
52
|
+
identifier: `${this._vendor}:${m.id}`,
|
|
53
|
+
metadata: {
|
|
54
|
+
extension: nullExtensionDescription.identifier,
|
|
55
|
+
name: m.name,
|
|
56
|
+
id: m.id,
|
|
57
|
+
vendor: this._vendor,
|
|
58
|
+
version: "1.0",
|
|
59
|
+
family: m.id,
|
|
60
|
+
...(tooltip !== undefined && {
|
|
61
|
+
tooltip
|
|
62
|
+
}),
|
|
63
|
+
...(detail !== undefined && {
|
|
64
|
+
detail
|
|
65
|
+
}),
|
|
66
|
+
maxInputTokens: m.maxPromptTokens ?? known?.maxInputTokens ?? 0,
|
|
67
|
+
maxOutputTokens: m.maxOutputTokens ?? known?.maxOutputTokens ?? 0,
|
|
68
|
+
isDefaultForLocation: {},
|
|
69
|
+
isUserSelectable: true,
|
|
70
|
+
statusIcon: notices?.rowWarning ? Codicon.warning : undefined,
|
|
71
|
+
warningText: notices?.warningText,
|
|
72
|
+
infoText: notices?.infoText,
|
|
73
|
+
pricing: multiplierNumeric !== undefined ? `${multiplierNumeric}x` : known?.pricing,
|
|
74
|
+
multiplierNumeric: multiplierNumeric ?? known?.multiplierNumeric,
|
|
75
|
+
inputCost: pricing.inputCost ?? known?.inputCost,
|
|
76
|
+
cacheCost: pricing.cacheCost ?? known?.cacheCost,
|
|
77
|
+
cacheWriteCost: pricing.cacheWriteCost ?? known?.cacheWriteCost,
|
|
78
|
+
outputCost: pricing.outputCost ?? known?.outputCost,
|
|
79
|
+
longContextInputCost: pricing.longContextInputCost ?? known?.longContextInputCost,
|
|
80
|
+
longContextCacheCost: pricing.longContextCacheCost ?? known?.longContextCacheCost,
|
|
81
|
+
longContextCacheWriteCost: pricing.longContextCacheWriteCost ?? known?.longContextCacheWriteCost,
|
|
82
|
+
longContextOutputCost: pricing.longContextOutputCost ?? known?.longContextOutputCost,
|
|
83
|
+
priceCategory: pricing.priceCategory ?? known?.priceCategory,
|
|
84
|
+
category: pricing.category ?? known?.category,
|
|
85
|
+
promo: pricing.promo ?? known?.promo,
|
|
86
|
+
targetChatSessionType: this._sessionType,
|
|
87
|
+
...(modelGroup ? {
|
|
88
|
+
modelGroup
|
|
89
|
+
} : {}),
|
|
90
|
+
...(byokModelIdentifier !== undefined && {
|
|
91
|
+
byokModelIdentifier
|
|
92
|
+
}),
|
|
93
|
+
capabilities: {
|
|
94
|
+
vision: m.supportsVision ?? known?.capabilities?.vision ?? false,
|
|
95
|
+
toolCalling: true,
|
|
96
|
+
agentMode: true
|
|
97
|
+
},
|
|
98
|
+
configurationSchema: this._toLanguageModelConfigurationSchema(m.configSchema)
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
}));
|
|
102
|
+
}
|
|
103
|
+
_catalogueEntryFor(model, group) {
|
|
104
|
+
if (!this._catalogue || group?.id !== COPILOT_VENDOR_ID) {
|
|
105
|
+
return undefined;
|
|
106
|
+
}
|
|
107
|
+
for (const identifier of this._catalogue.getLanguageModelIds()) {
|
|
108
|
+
const metadata = this._catalogue.lookupLanguageModel(identifier);
|
|
109
|
+
if (metadata?.vendor === COPILOT_VENDOR_ID && metadata.id === model.id) {
|
|
110
|
+
return metadata;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return undefined;
|
|
114
|
+
}
|
|
115
|
+
_toLanguageModelConfigurationSchema(schema) {
|
|
116
|
+
if (!schema) {
|
|
117
|
+
return undefined;
|
|
118
|
+
}
|
|
119
|
+
const properties = {};
|
|
120
|
+
for (const [key, property] of Object.entries(schema.properties)) {
|
|
121
|
+
const effortDisplay = property.enumLabels === undefined && property.enumDescriptions === undefined ? AgentHostLanguageModelProvider._reasoningEffortDisplay(key, property.enum) : undefined;
|
|
122
|
+
properties[key] = {
|
|
123
|
+
type: property.type,
|
|
124
|
+
title: property.title,
|
|
125
|
+
description: property.description,
|
|
126
|
+
default: property.default,
|
|
127
|
+
enum: property.enum,
|
|
128
|
+
enumItemLabels: property.enumLabels ?? effortDisplay?.labels,
|
|
129
|
+
enumDescriptions: property.enumDescriptions ?? effortDisplay?.descriptions,
|
|
130
|
+
readOnly: property.readOnly,
|
|
131
|
+
group: AgentHostLanguageModelProvider._groupForConfigKey(key)
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
return {
|
|
135
|
+
type: schema.type,
|
|
136
|
+
required: schema.required,
|
|
137
|
+
properties
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
static {
|
|
141
|
+
this._reasoningEffortKeys = ( new Set(["reasoningEffort", "thinkingLevel"]));
|
|
142
|
+
}
|
|
143
|
+
static _reasoningEffortDisplay(key, values) {
|
|
144
|
+
if (!( AgentHostLanguageModelProvider._reasoningEffortKeys.has(key)) || !values?.length) {
|
|
145
|
+
return undefined;
|
|
146
|
+
}
|
|
147
|
+
const levels = values.filter(value => typeof value === "string");
|
|
148
|
+
if (levels.length !== values.length) {
|
|
149
|
+
return undefined;
|
|
150
|
+
}
|
|
151
|
+
return {
|
|
152
|
+
labels: ( levels.map(getReasoningEffortLabel)),
|
|
153
|
+
descriptions: ( levels.map(level => getReasoningEffortDescription(level) ?? ""))
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
static _groupForConfigKey(key) {
|
|
157
|
+
switch (key) {
|
|
158
|
+
case "tier":
|
|
159
|
+
case "thinkingLevel":
|
|
160
|
+
case "reasoningEffort":
|
|
161
|
+
return "navigation";
|
|
162
|
+
case "contextSize":
|
|
163
|
+
case "contextTier":
|
|
164
|
+
return "tokens";
|
|
165
|
+
default:
|
|
166
|
+
return undefined;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
_modelGroupFor(model) {
|
|
170
|
+
const explicitGroupId = readAgentModelGroupId(model);
|
|
171
|
+
const slash = model.id.indexOf("/");
|
|
172
|
+
const groupVendorId = explicitGroupId ?? (slash > 0 ? model.id.slice(0, slash) : model.provider);
|
|
173
|
+
if (!groupVendorId) {
|
|
174
|
+
return undefined;
|
|
175
|
+
}
|
|
176
|
+
const sourceId = readAgentModelSourceId(model);
|
|
177
|
+
return {
|
|
178
|
+
id: groupVendorId,
|
|
179
|
+
...(sourceId !== undefined && {
|
|
180
|
+
sourceId
|
|
181
|
+
})
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
async sendChatRequest() {
|
|
185
|
+
throw ( new Error("Agent-host models do not support direct chat requests"));
|
|
186
|
+
}
|
|
187
|
+
async provideTokenCount() {
|
|
188
|
+
return 0;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export { AgentHostLanguageModelProvider, agentHostProviderSupportsAutoModel };
|
|
@@ -64,8 +64,8 @@ let AgentHostPermissionUiContribution = class AgentHostPermissionUiContribution
|
|
|
64
64
|
const path = request.uri.scheme === Schemas.file ? request.uri.fsPath : ( request.uri.toString());
|
|
65
65
|
const fence = "`".repeat((path.match(/`+/g)?.reduce((m, s) => Math.max(m, s.length), 0) ?? 0) + 1);
|
|
66
66
|
const codePath = `${fence}${path}${fence}`;
|
|
67
|
-
const message = ( new MarkdownString(request.mode === AgentHostPermissionMode.Write ? ( localize(
|
|
68
|
-
const description = totalPending > 1 ? totalPending === 2 ? ( localize(
|
|
67
|
+
const message = ( new MarkdownString(request.mode === AgentHostPermissionMode.Write ? ( localize(6034, "Remote agent host \"{0}\" wants to write {1}", hostName, codePath)) : ( localize(6035, "Remote agent host \"{0}\" wants to read {1}", hostName, codePath))));
|
|
68
|
+
const description = totalPending > 1 ? totalPending === 2 ? ( localize(6036, "+1 more request waiting")) : ( localize(6037, "+{0} more requests waiting", totalPending - 1)) : undefined;
|
|
69
69
|
return {
|
|
70
70
|
id: AgentHostPermissionUiContribution_1.NOTIFICATION_ID,
|
|
71
71
|
severity: ChatInputNotificationSeverity.Warning,
|
|
@@ -73,17 +73,17 @@ let AgentHostPermissionUiContribution = class AgentHostPermissionUiContribution
|
|
|
73
73
|
description,
|
|
74
74
|
actions: [{
|
|
75
75
|
kind: ChatInputNotificationActionKind.Command,
|
|
76
|
-
label: ( localize(
|
|
76
|
+
label: ( localize(6038, "Deny")),
|
|
77
77
|
commandId: DENY_COMMAND,
|
|
78
78
|
commandArgs: [request.id]
|
|
79
79
|
}, {
|
|
80
80
|
kind: ChatInputNotificationActionKind.Command,
|
|
81
|
-
label: ( localize(
|
|
81
|
+
label: ( localize(6039, "Allow")),
|
|
82
82
|
commandId: ALLOW_COMMAND,
|
|
83
83
|
commandArgs: [request.id]
|
|
84
84
|
}, {
|
|
85
85
|
kind: ChatInputNotificationActionKind.Command,
|
|
86
|
-
label: ( localize(
|
|
86
|
+
label: ( localize(6040, "Always Allow")),
|
|
87
87
|
commandId: ALLOW_ALWAYS_COMMAND,
|
|
88
88
|
commandArgs: [request.id]
|
|
89
89
|
}],
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Disposable, type IDisposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
2
|
+
import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
3
|
+
import { type IAgentSubscription } from "../../../../../../platform/agentHost/common/state/agentSubscription.js";
|
|
4
|
+
import { type SessionState } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/sessionState";
|
|
5
|
+
import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
|
|
6
|
+
import { IStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service";
|
|
7
|
+
import { IWorkbenchAssignmentService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/assignment/common/assignmentService.service";
|
|
8
|
+
import { IChatInputNotificationService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.service";
|
|
9
|
+
export declare class AgentHostPromptCacheNotification extends Disposable {
|
|
10
|
+
private readonly _notificationService;
|
|
11
|
+
private readonly _storageService;
|
|
12
|
+
private readonly _logService;
|
|
13
|
+
private readonly _trackedSessions;
|
|
14
|
+
private readonly _cacheExpirations;
|
|
15
|
+
private readonly _dismissedExpirations;
|
|
16
|
+
private _experimentEnabled;
|
|
17
|
+
constructor(_notificationService: IChatInputNotificationService, assignmentService: IWorkbenchAssignmentService, _storageService: IStorageService, _logService: ILogService);
|
|
18
|
+
trackSession(sessionResource: URI, subscription: IAgentSubscription<SessionState>): IDisposable;
|
|
19
|
+
private _updateNotification;
|
|
20
|
+
private _notificationId;
|
|
21
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { RunOnceScheduler } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
4
|
+
import { Disposable, DisposableMap, DisposableStore, toDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
5
|
+
import { ResourceMap } from '@codingame/monaco-vscode-api/vscode/vs/base/common/map';
|
|
6
|
+
import { MarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
|
|
7
|
+
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
8
|
+
import { readSessionPromptCacheState } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/sessionState';
|
|
9
|
+
import { CommandsRegistry } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands';
|
|
10
|
+
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
11
|
+
import { StorageScope, StorageTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
|
|
12
|
+
import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
|
|
13
|
+
import { IWorkbenchAssignmentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/assignment/common/assignmentService.service';
|
|
14
|
+
import { ChatInputNotificationActionKind, ChatInputNotificationSeverity } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService';
|
|
15
|
+
import { IChatInputNotificationService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.service';
|
|
16
|
+
|
|
17
|
+
const PROMPT_CACHE_EXPIRATION_NOTIFICATION_EXPERIMENT = "copilotchat.promptCacheExpirationNotification";
|
|
18
|
+
const PROMPT_CACHE_EXPIRATION_DISABLED_STORAGE_KEY = "chat.promptCacheExpirationNotification.disabled";
|
|
19
|
+
const DISABLE_PROMPT_CACHE_EXPIRATION_NOTIFICATION_COMMAND = "workbench.action.chat.disablePromptCacheExpirationNotification";
|
|
20
|
+
const PROMPT_CACHE_EXPIRATION_LEARN_MORE_URL = "https://code.visualstudio.com/docs/agents/agent-troubleshooting/cache-explorer#_why-prompt-caching-matters";
|
|
21
|
+
let AgentHostPromptCacheNotification = class AgentHostPromptCacheNotification extends Disposable {
|
|
22
|
+
constructor(_notificationService, assignmentService, _storageService, _logService) {
|
|
23
|
+
super();
|
|
24
|
+
this._notificationService = _notificationService;
|
|
25
|
+
this._storageService = _storageService;
|
|
26
|
+
this._logService = _logService;
|
|
27
|
+
this._trackedSessions = this._register(( new DisposableMap()));
|
|
28
|
+
this._cacheExpirations = ( new ResourceMap());
|
|
29
|
+
this._dismissedExpirations = ( new ResourceMap());
|
|
30
|
+
this._experimentEnabled = false;
|
|
31
|
+
this._register(
|
|
32
|
+
CommandsRegistry.registerCommand(DISABLE_PROMPT_CACHE_EXPIRATION_NOTIFICATION_COMMAND, () => {
|
|
33
|
+
this._storageService.store(
|
|
34
|
+
PROMPT_CACHE_EXPIRATION_DISABLED_STORAGE_KEY,
|
|
35
|
+
true,
|
|
36
|
+
StorageScope.PROFILE,
|
|
37
|
+
StorageTarget.USER
|
|
38
|
+
);
|
|
39
|
+
for (const sessionResource of ( this._cacheExpirations.keys())) {
|
|
40
|
+
this._notificationService.deleteNotification(this._notificationId(sessionResource));
|
|
41
|
+
}
|
|
42
|
+
})
|
|
43
|
+
);
|
|
44
|
+
this._register(this._notificationService.onDidDismiss(id => {
|
|
45
|
+
for (const [sessionResource, cacheExpiresAt] of this._cacheExpirations) {
|
|
46
|
+
if (id === this._notificationId(sessionResource)) {
|
|
47
|
+
this._dismissedExpirations.set(sessionResource, cacheExpiresAt);
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}));
|
|
52
|
+
void assignmentService.getTreatment(PROMPT_CACHE_EXPIRATION_NOTIFICATION_EXPERIMENT).then(enabled => {
|
|
53
|
+
this._experimentEnabled = enabled === true;
|
|
54
|
+
for (const sessionResource of ( this._cacheExpirations.keys())) {
|
|
55
|
+
this._updateNotification(sessionResource);
|
|
56
|
+
}
|
|
57
|
+
}).catch(error => this._logService.warn(
|
|
58
|
+
`[AgentHostPromptCacheNotification] Failed to resolve experiment: ${error}`
|
|
59
|
+
));
|
|
60
|
+
}
|
|
61
|
+
trackSession(sessionResource, subscription) {
|
|
62
|
+
const key = ( sessionResource.toString());
|
|
63
|
+
const store = ( new DisposableStore());
|
|
64
|
+
this._trackedSessions.set(key, store);
|
|
65
|
+
const expirationScheduler = store.add(( new RunOnceScheduler(() => this._updateNotification(sessionResource), 0)));
|
|
66
|
+
const update = state => {
|
|
67
|
+
expirationScheduler.cancel();
|
|
68
|
+
const promptCache = state && !(state instanceof Error) ? readSessionPromptCacheState(state._meta) : undefined;
|
|
69
|
+
if (promptCache) {
|
|
70
|
+
if (this._cacheExpirations.get(sessionResource) !== promptCache.cacheExpiresAt) {
|
|
71
|
+
this._dismissedExpirations.delete(sessionResource);
|
|
72
|
+
}
|
|
73
|
+
this._cacheExpirations.set(sessionResource, promptCache.cacheExpiresAt);
|
|
74
|
+
const expirationTime = Date.parse(promptCache.cacheExpiresAt);
|
|
75
|
+
if (Number.isFinite(expirationTime)) {
|
|
76
|
+
const remainingTime = expirationTime - Date.now();
|
|
77
|
+
if (remainingTime > 0) {
|
|
78
|
+
expirationScheduler.schedule(remainingTime);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
} else {
|
|
82
|
+
this._cacheExpirations.delete(sessionResource);
|
|
83
|
+
this._dismissedExpirations.delete(sessionResource);
|
|
84
|
+
}
|
|
85
|
+
this._updateNotification(sessionResource);
|
|
86
|
+
};
|
|
87
|
+
store.add(subscription.onDidChange(update));
|
|
88
|
+
update(subscription.value);
|
|
89
|
+
store.add(toDisposable(() => {
|
|
90
|
+
this._cacheExpirations.delete(sessionResource);
|
|
91
|
+
this._dismissedExpirations.delete(sessionResource);
|
|
92
|
+
this._notificationService.deleteNotification(this._notificationId(sessionResource));
|
|
93
|
+
}));
|
|
94
|
+
return toDisposable(() => this._trackedSessions.deleteAndDispose(key));
|
|
95
|
+
}
|
|
96
|
+
_updateNotification(sessionResource) {
|
|
97
|
+
const cacheExpiresAt = this._cacheExpirations.get(sessionResource);
|
|
98
|
+
const expirationTime = cacheExpiresAt ? Date.parse(cacheExpiresAt) : Number.NaN;
|
|
99
|
+
const disabled = this._storageService.getBoolean(PROMPT_CACHE_EXPIRATION_DISABLED_STORAGE_KEY, StorageScope.PROFILE, false);
|
|
100
|
+
if (!this._experimentEnabled || disabled || !Number.isFinite(expirationTime) || Date.now() < expirationTime) {
|
|
101
|
+
this._notificationService.deleteNotification(this._notificationId(sessionResource));
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
if (this._dismissedExpirations.get(sessionResource) === cacheExpiresAt) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
this._notificationService.setNotification({
|
|
108
|
+
id: this._notificationId(sessionResource),
|
|
109
|
+
telemetryId: "copilot.promptCacheExpired",
|
|
110
|
+
severity: ChatInputNotificationSeverity.Info,
|
|
111
|
+
message: ( localize(6041, "This chat's prompt cache is stale")),
|
|
112
|
+
description: ( new MarkdownString(( localize(
|
|
113
|
+
6042,
|
|
114
|
+
"The next prompt will incur increased cost. Consider starting a new chat. [Learn more]({0})",
|
|
115
|
+
PROMPT_CACHE_EXPIRATION_LEARN_MORE_URL
|
|
116
|
+
)))),
|
|
117
|
+
actions: [{
|
|
118
|
+
kind: ChatInputNotificationActionKind.Command,
|
|
119
|
+
label: ( localize(6043, "Start New Chat")),
|
|
120
|
+
commandId: "workbench.action.chat.newChat"
|
|
121
|
+
}],
|
|
122
|
+
dismissible: true,
|
|
123
|
+
autoDismissOnMessage: true,
|
|
124
|
+
mute: {
|
|
125
|
+
commandId: DISABLE_PROMPT_CACHE_EXPIRATION_NOTIFICATION_COMMAND,
|
|
126
|
+
tooltip: ( localize(6044, "Don't Show Again"))
|
|
127
|
+
},
|
|
128
|
+
sessionResources: [sessionResource]
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
_notificationId(sessionResource) {
|
|
132
|
+
return `copilot.promptCacheExpired.${( sessionResource.toString())}`;
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
AgentHostPromptCacheNotification = ( __decorate([( __param(0, IChatInputNotificationService)), ( __param(1, IWorkbenchAssignmentService)), ( __param(2, IStorageService)), ( __param(3, ILogService))], AgentHostPromptCacheNotification));
|
|
136
|
+
|
|
137
|
+
export { AgentHostPromptCacheNotification };
|