@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.
Files changed (324) hide show
  1. package/index.js +11 -0
  2. package/package.json +5 -5
  3. package/vscode/src/vs/platform/agentHost/browser/agentHostProtocolClient.js +1 -1
  4. package/vscode/src/vs/platform/agentHost/common/agentHostCustomizationConfig.d.ts +74 -0
  5. package/vscode/src/vs/platform/agentHost/common/agentHostCustomizationConfig.js +90 -0
  6. package/vscode/src/vs/platform/agentHost/common/agentHostSlashCommand.d.ts +8 -0
  7. package/vscode/src/vs/platform/agentHost/common/agentHostSlashCommand.js +16 -0
  8. package/vscode/src/vs/platform/agentHost/common/agentHostStarter.config.contribution.js +53 -53
  9. package/vscode/src/vs/platform/agentHost/common/agentHostWorkingDirectories.d.ts +16 -0
  10. package/vscode/src/vs/platform/agentHost/common/agentHostWorkingDirectories.js +14 -0
  11. package/vscode/src/vs/platform/agentHost/common/agentMerge.js +7 -7
  12. package/vscode/src/vs/platform/agentHost/common/agentModelByokMeta.d.ts +24 -0
  13. package/vscode/src/vs/platform/agentHost/common/agentModelByokMeta.js +13 -0
  14. package/vscode/src/vs/platform/agentHost/common/agentModelNotices.d.ts +22 -0
  15. package/vscode/src/vs/platform/agentHost/common/agentModelNotices.js +21 -0
  16. package/vscode/src/vs/platform/agentHost/common/agentModelPricing.d.ts +114 -0
  17. package/vscode/src/vs/platform/agentHost/common/agentModelPricing.js +56 -0
  18. package/vscode/src/vs/platform/agentHost/common/changesetUri.js +15 -1
  19. package/vscode/src/vs/platform/agentHost/common/copilotConfigSlashCommands.d.ts +73 -0
  20. package/vscode/src/vs/platform/agentHost/common/copilotConfigSlashCommands.js +141 -0
  21. package/vscode/src/vs/platform/agentHost/common/meta/agentCompletionAttachmentMeta.js +42 -1
  22. package/vscode/src/vs/platform/agentHost/common/meta/agentCustomizationMeta.d.ts +27 -0
  23. package/vscode/src/vs/platform/agentHost/common/meta/agentCustomizationMeta.js +14 -0
  24. package/vscode/src/vs/platform/agentHost/common/meta/agentEphemeralSessionMeta.d.ts +14 -0
  25. package/vscode/src/vs/platform/agentHost/common/meta/agentEphemeralSessionMeta.js +11 -0
  26. package/vscode/src/vs/platform/agentHost/common/sandboxConfigSchema.js +13 -13
  27. package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.js +1 -1
  28. package/vscode/src/vs/platform/agentHost/common/state/sessionActions.js +4 -1
  29. package/vscode/src/vs/platform/agentHost/common/toolSearchConstants.d.ts +4 -0
  30. package/vscode/src/vs/platform/agentHost/common/toolSearchConstants.js +6 -0
  31. package/vscode/src/vs/platform/networkFilter/common/networkFilterService.js +1 -1
  32. package/vscode/src/vs/workbench/browser/chatChangesPill.js +2 -2
  33. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoice.contribution.js +28 -28
  34. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceSessionsPicker.js +2 -2
  35. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidget.js +18 -18
  36. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidgetBinding.js +3 -3
  37. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/confirmationComponent.js +3 -3
  38. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/feedbackDialog.js +6 -6
  39. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/headerComponent.js +11 -11
  40. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/onboardingComponent.js +11 -11
  41. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/sessionListComponent.js +9 -9
  42. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/statusRowsComponent.js +5 -5
  43. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/voiceBarComponent.js +2 -2
  44. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscripts.contribution.js +13 -13
  45. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscriptsView.js +7 -7
  46. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/voiceModeOnboarding.js +28 -28
  47. package/vscode/src/vs/workbench/contrib/agentsVoice/common/voiceTranscriptStore.js +1 -1
  48. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.js +18 -18
  49. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.js +8 -8
  50. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +93 -93
  51. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAgentRecommendationActions.js +1 -1
  52. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +12 -12
  53. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +8 -8
  54. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +7 -7
  55. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +7 -7
  56. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +2 -2
  57. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFindActions.js +7 -7
  58. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +3 -3
  59. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatLanguageModelActions.js +13 -13
  60. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +6 -6
  61. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatNewActions.js +12 -12
  62. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatOpenAgentDebugPanelAction.js +12 -12
  63. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPluginActions.js +14 -14
  64. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPromptNavigationActions.js +2 -2
  65. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQueueActions.js +15 -15
  66. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +8 -8
  67. package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +18 -18
  68. package/vscode/src/vs/workbench/contrib/chat/browser/actions/createPluginAction.js +32 -32
  69. package/vscode/src/vs/workbench/contrib/chat/browser/actions/exportAgentHostDebugLogsAction.js +9 -9
  70. package/vscode/src/vs/workbench/contrib/chat/browser/actions/openAgentHostStateFileAction.js +5 -5
  71. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginCommands.js +7 -7
  72. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.js +2 -2
  73. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditorInput.js +2 -2
  74. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.js +12 -12
  75. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.js +15 -15
  76. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationContentExpander.d.ts +34 -0
  77. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationContentExpander.js +229 -0
  78. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationItemProvider.d.ts +57 -0
  79. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationItemProvider.js +460 -0
  80. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHost.contribution.d.ts +1 -0
  81. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHost.contribution.js +92 -0
  82. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostAllowSignedOutWhenUsableContribution.d.ts +23 -0
  83. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostAllowSignedOutWhenUsableContribution.js +46 -0
  84. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostAuth.d.ts +142 -0
  85. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostAuth.js +746 -0
  86. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatContribution.d.ts +77 -0
  87. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatContribution.js +474 -0
  88. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostConfigEditor.d.ts +169 -0
  89. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostConfigEditor.js +261 -0
  90. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCopilotCliSettingsContribution.d.ts +20 -0
  91. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCopilotCliSettingsContribution.js +90 -0
  92. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostDownloadProgress.d.ts +35 -0
  93. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostDownloadProgress.js +73 -0
  94. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostExistingSessionHarnessPickerEnablement.d.ts +20 -0
  95. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostExistingSessionHarnessPickerEnablement.js +61 -0
  96. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLanguageModelProvider.d.ts +112 -0
  97. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLanguageModelProvider.js +192 -0
  98. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPermissionUiContribution.js +5 -5
  99. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPromptCacheNotification.d.ts +21 -0
  100. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPromptCacheNotification.js +137 -0
  101. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostResponseFileChanges.js +301 -12
  102. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostRootConfigForwarder.d.ts +84 -0
  103. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostRootConfigForwarder.js +96 -0
  104. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionHandler.d.ts +884 -0
  105. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionHandler.js +5868 -0
  106. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionInputPills.js +19 -19
  107. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListContribution.d.ts +27 -0
  108. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListContribution.js +129 -0
  109. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListController.d.ts +42 -0
  110. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListController.js +221 -0
  111. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListStore.d.ts +125 -0
  112. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionListStore.js +345 -0
  113. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectorySynchronizer.js +1 -1
  114. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSettings.contribution.d.ts +1 -0
  115. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSettings.contribution.js +68 -0
  116. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSettingsFileSystemProvider.d.ts +62 -0
  117. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSettingsFileSystemProvider.js +163 -0
  118. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSignedOutModelsNotification.d.ts +54 -0
  119. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSignedOutModelsNotification.js +219 -0
  120. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSubagentProgress.d.ts +10 -0
  121. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSubagentProgress.js +50 -0
  122. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostTerminalContribution.d.ts +42 -0
  123. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostTerminalContribution.js +132 -0
  124. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentSessionSettings.contribution.d.ts +1 -0
  125. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentSessionSettings.contribution.js +85 -0
  126. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentSessionSettingsFileSystemProvider.d.ts +79 -0
  127. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentSessionSettingsFileSystemProvider.js +161 -0
  128. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/applyAgentHostSubmitConfig.d.ts +18 -0
  129. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/applyAgentHostSubmitConfig.js +13 -0
  130. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/copilotConfigSlashSubmitHandler.d.ts +28 -0
  131. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/copilotConfigSlashSubmitHandler.js +71 -0
  132. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/openSessionLinkOpener.contribution.d.ts +35 -0
  133. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/openSessionLinkOpener.contribution.js +205 -0
  134. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.js +1 -1
  135. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.js +50 -50
  136. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.js +3 -3
  137. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjection.js +1 -1
  138. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionActions.js +4 -4
  139. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.js +1 -1
  140. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionsExperiments.contribution.js +4 -4
  141. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.js +22 -22
  142. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccess.js +17 -17
  143. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccessActions.js +4 -4
  144. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/externalSessionsFilterMenu.js +6 -6
  145. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/sessionSummaryHover.js +7 -7
  146. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessionsConfiguration.js +3 -3
  147. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.js +15 -15
  148. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.js +126 -126
  149. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.contribution.js +44 -44
  150. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.js +137 -137
  151. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.js +3 -3
  152. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationPresentation.js +6 -6
  153. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePagePromptLaunchers.js +37 -37
  154. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCardList.js +1 -1
  155. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCreatorService.js +1 -1
  156. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationAccessibility.js +6 -6
  157. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationCategories.js +145 -145
  158. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationDashboard.js +29 -29
  159. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationServiceImpl.js +9 -9
  160. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedAgentPluginDetail.js +40 -40
  161. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedExtensionToolsDetail.js +7 -7
  162. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedMcpServerDetail.js +8 -8
  163. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/galleryItemRenderer.js +5 -5
  164. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.js +75 -75
  165. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.js +115 -115
  166. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/promptsServiceCustomizationItemProvider.js +4 -4
  167. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/toolsListWidget.js +50 -50
  168. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.js +1 -1
  169. package/vscode/src/vs/workbench/contrib/chat/browser/chat.shared.contribution.js +344 -344
  170. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostChatDebugProvider.js +37 -37
  171. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostLogSources.js +5 -5
  172. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.js +32 -32
  173. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheExplorerView.js +124 -124
  174. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheInsights.js +72 -72
  175. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugDetailPanel.js +6 -6
  176. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditorInput.js +2 -2
  177. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEnablement.js +3 -3
  178. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventDetailRenderer.js +20 -20
  179. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventList.js +7 -7
  180. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFilters.js +4 -4
  181. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowChartView.js +7 -7
  182. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowGraph.js +22 -22
  183. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHomeView.js +12 -12
  184. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHookContentRenderer.js +17 -17
  185. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.js +24 -24
  186. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugMessageContentRenderer.js +8 -8
  187. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugModelTurnContentRenderer.js +23 -23
  188. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugOverviewView.js +35 -35
  189. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugToolCallContentRenderer.js +11 -11
  190. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugWireLogView.js +40 -40
  191. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +1 -1
  192. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +14 -14
  193. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +7 -7
  194. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.js +3 -3
  195. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +12 -12
  196. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +2 -2
  197. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +1 -1
  198. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +1 -1
  199. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +3 -3
  200. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +1 -1
  201. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +1 -1
  202. package/vscode/src/vs/workbench/contrib/chat/browser/chatImageCarouselService.js +2 -2
  203. package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPills.js +3 -3
  204. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.js +8 -8
  205. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.js +2 -2
  206. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.js +63 -63
  207. package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +4 -4
  208. package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +30 -30
  209. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievements.contribution.js +12 -12
  210. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementsEditor.js +1 -1
  211. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementsEditorInput.js +1 -1
  212. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementsWidget.js +35 -35
  213. package/vscode/src/vs/workbench/contrib/chat/browser/chatPromoNotification.js +1 -1
  214. package/vscode/src/vs/workbench/contrib/chat/browser/chatQuotaNotification.js +25 -25
  215. package/vscode/src/vs/workbench/contrib/chat/browser/chatRepoInfo.js +2 -2
  216. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.js +19 -19
  217. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.js +10 -10
  218. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupGrowthSession.js +6 -6
  219. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.js +26 -26
  220. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.js +16 -16
  221. package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.js +20 -20
  222. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.js +62 -62
  223. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.js +10 -10
  224. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipCatalog.js +19 -19
  225. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.js +1 -1
  226. package/vscode/src/vs/workbench/contrib/chat/browser/chatWindowNotifier.js +7 -7
  227. package/vscode/src/vs/workbench/contrib/chat/browser/claudePluginRecommendations.js +2 -2
  228. package/vscode/src/vs/workbench/contrib/chat/browser/contextContrib/chatContext.contribution.js +5 -5
  229. package/vscode/src/vs/workbench/contrib/chat/browser/defaultModelContribution.js +5 -5
  230. package/vscode/src/vs/workbench/contrib/chat/browser/enablementStatusWidget.js +2 -2
  231. package/vscode/src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.js +1 -1
  232. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorOverlay.js +6 -6
  233. package/vscode/src/vs/workbench/contrib/chat/browser/pluginGitCommandService.js +6 -6
  234. package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.js +27 -27
  235. package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.js +15 -15
  236. package/vscode/src/vs/workbench/contrib/chat/browser/pluginUrlHandler.js +6 -6
  237. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +2 -2
  238. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.js +27 -27
  239. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.js +3 -3
  240. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionOverlay.js +2 -2
  241. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolSetsCodeLensProvider.js +2 -2
  242. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js +2 -2
  243. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptUrlHandler.js +8 -8
  244. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.js +7 -7
  245. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.js +3 -3
  246. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/skillActions.js +3 -3
  247. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimeline.contribution.js +5 -5
  248. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineCard.js +4 -4
  249. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineGutterRail.js +4 -4
  250. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineModel.js +3 -3
  251. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineRulerRail.js +1 -1
  252. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineStickyHeader.js +3 -3
  253. package/vscode/src/vs/workbench/contrib/chat/browser/promptsDebugContribution.js +20 -20
  254. package/vscode/src/vs/workbench/contrib/chat/browser/sessionChatPillOptions.js +18 -18
  255. package/vscode/src/vs/workbench/contrib/chat/browser/sessionPullRequestPill.js +2 -2
  256. package/vscode/src/vs/workbench/contrib/chat/browser/tools/clientToolSetsContribution.js +10 -10
  257. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.js +39 -39
  258. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.js +25 -25
  259. package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.js +8 -8
  260. package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.js +7 -7
  261. package/vscode/src/vs/workbench/contrib/chat/browser/utilityModelContribution.js +2 -2
  262. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +5 -5
  263. package/vscode/src/vs/workbench/contrib/chat/browser/voiceInputMode/voiceInputMode.js +1 -1
  264. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentOpenChat.js +17 -17
  265. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatFind/chatFindAccessibilityHelp.js +15 -15
  266. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.js +11 -11
  267. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletions.js +1 -1
  268. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.js +10 -10
  269. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorContrib.js +1 -1
  270. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorHover.js +3 -3
  271. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/chatQuick.js +1 -1
  272. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditor.js +1 -1
  273. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.js +11 -11
  274. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.js +2 -2
  275. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.js +8 -8
  276. package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.js +6 -6
  277. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.js +12 -12
  278. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +18 -18
  279. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.js +12 -12
  280. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +5 -5
  281. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.js +12 -12
  282. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.js +154 -154
  283. package/vscode/src/vs/workbench/contrib/chat/common/sessionChatPills.js +9 -9
  284. package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +1 -1
  285. package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarousel.contribution.js +10 -10
  286. package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarouselEditor.js +10 -10
  287. package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarouselEditorInput.js +1 -1
  288. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +15 -15
  289. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatDefaultModel.js +2 -2
  290. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditReviewSession.js +1 -1
  291. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +4 -4
  292. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.js +14 -14
  293. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.js +1 -1
  294. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +10 -10
  295. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +5 -5
  296. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +1 -1
  297. package/vscode/src/vs/workbench/contrib/remoteCodingAgents/browser/remoteCodingAgents.contribution.js +7 -7
  298. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChat.js +10 -10
  299. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.js +16 -16
  300. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +20 -20
  301. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +1 -1
  302. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +6 -6
  303. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +3 -3
  304. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.js +1 -1
  305. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +12 -12
  306. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +2 -2
  307. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalLastCommandTool.js +3 -3
  308. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +3 -3
  309. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalSelectionTool.js +3 -3
  310. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/killTerminalTool.js +3 -3
  311. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +3 -3
  312. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +4 -4
  313. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +73 -73
  314. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sendToTerminalTool.js +10 -10
  315. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/createAndRunTaskTool.js +14 -14
  316. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/getTaskOutputTool.js +7 -7
  317. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/runTaskTool.js +14 -14
  318. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.js +1 -1
  319. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +4 -4
  320. package/vscode/src/vs/workbench/services/agentEditorComments/browser/agentEditorCommentsOverlayWidget.js +3 -3
  321. package/vscode/src/vs/platform/agentHost/common/state/legacyProtocolCompatibility.d.ts +0 -30
  322. package/vscode/src/vs/platform/agentHost/common/state/legacyProtocolCompatibility.js +0 -87
  323. package/vscode/src/vs/workbench/services/accounts/browser/defaultAccount.d.ts +0 -205
  324. package/vscode/src/vs/workbench/services/accounts/browser/defaultAccount.js +0 -1580
@@ -0,0 +1,77 @@
1
+ import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
2
+ import { IAgentHostService } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agentService.service";
3
+ import { IAgentHostEnablementService } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agentHostEnablementService.service";
4
+ import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
5
+ import { IDefaultAccountService } from "@codingame/monaco-vscode-api/vscode/vs/platform/defaultAccount/common/defaultAccount.service";
6
+ import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
7
+ import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
8
+ import { IWorkbenchContribution } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions";
9
+ import { IAgentHostFileSystemService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/agentHost/common/agentHostFileSystemService.service";
10
+ import { IAuthenticationService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/common/authentication.service";
11
+ import { IWorkbenchEnvironmentService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/environment/common/environmentService.service";
12
+ import { IChatSessionsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService.service";
13
+ import { ICustomizationHarnessService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/customizationHarnessService.service";
14
+ import { ILanguageModelsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModels.service";
15
+ import { IAgentHostActiveClientService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService.service";
16
+ import { IAgentHostProtectedResourcesService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostProtectedResourcesService.service";
17
+ export { AgentHostSessionHandler } from "./agentHostSessionHandler.js";
18
+ /**
19
+ * Discovers available agents from the agent host process and dynamically
20
+ * registers each one as a chat session type with its own session handler,
21
+ * customization harness, and language model provider.
22
+ *
23
+ * Gated on Agent Host runtime availability.
24
+ */
25
+ export declare class AgentHostContribution extends Disposable implements IWorkbenchContribution {
26
+ private readonly _agentHostService;
27
+ private readonly _chatSessionsService;
28
+ private readonly _defaultAccountService;
29
+ private readonly _authenticationService;
30
+ private readonly _logService;
31
+ private readonly _languageModelsService;
32
+ private readonly _instantiationService;
33
+ private readonly _agentHostFileSystemService;
34
+ private readonly _configurationService;
35
+ private readonly _customizationHarnessService;
36
+ private readonly _activeClientService;
37
+ private readonly _protectedResourcesService;
38
+ private readonly _agentHostEnablementService;
39
+ static readonly ID = "workbench.contrib.agentHostContribution";
40
+ private readonly _agentRegistrations;
41
+ /** Model providers keyed by agent provider, for pushing model updates. */
42
+ private readonly _modelProviders;
43
+ /** Dedupes redundant `authenticate` RPCs when the resolved token hasn't changed. */
44
+ private readonly _authTokenCache;
45
+ private readonly _authRecovery;
46
+ private readonly _isSessionsWindow;
47
+ private readonly _enableSmokeTestDriver;
48
+ private _initialized;
49
+ private readonly _enablementStore;
50
+ private _authenticationGeneration;
51
+ private _didStartInitialAuthentication;
52
+ private _promptCacheNotification;
53
+ constructor(_agentHostService: IAgentHostService, _chatSessionsService: IChatSessionsService, _defaultAccountService: IDefaultAccountService, _authenticationService: IAuthenticationService, _logService: ILogService, _languageModelsService: ILanguageModelsService, _instantiationService: IInstantiationService, _agentHostFileSystemService: IAgentHostFileSystemService, _configurationService: IConfigurationService, _customizationHarnessService: ICustomizationHarnessService, environmentService: IWorkbenchEnvironmentService, _activeClientService: IAgentHostActiveClientService, _protectedResourcesService: IAgentHostProtectedResourcesService, _agentHostEnablementService: IAgentHostEnablementService);
54
+ private _initialize;
55
+ private _enable;
56
+ private _shouldRegisterAgent;
57
+ private _handleRootStateChange;
58
+ private _registerAgent;
59
+ private _handleAuthenticationSessionsChanged;
60
+ private _getRootAgents;
61
+ /**
62
+ * Authenticate using protectedResources from agent info in root state.
63
+ * Resolves tokens via the standard VS Code authentication service.
64
+ */
65
+ private _authenticateWithServer;
66
+ private _authenticateNotificationResource;
67
+ /**
68
+ * Interactively prompt the user to authenticate when the server requires it.
69
+ * Uses protectedResources from root state, resolves the auth provider,
70
+ * creates a session (which triggers the login UI), and pushes the token
71
+ * to the server. Returns true if authentication succeeded.
72
+ */
73
+ private _resolveAuthenticationInteractively;
74
+ private _getScenarioAutomationToken;
75
+ private _isAuthenticationCurrent;
76
+ private _authenticateIfCurrent;
77
+ }
@@ -0,0 +1,474 @@
1
+
2
+ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
+ import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
4
+ import { isCancellationError, CancellationError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
5
+ import { Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
6
+ import { Disposable, DisposableMap, MutableDisposable, DisposableStore, toDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
7
+ import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
8
+ import { mark } from '@codingame/monaco-vscode-api/vscode/vs/base/common/performance';
9
+ import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
10
+ import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
11
+ import { shouldSurfaceLocalAgentHostProvider, affectsAgentHostProviderPreference } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agentService';
12
+ import { IAgentHostService } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agentService.service';
13
+ import { IAgentHostEnablementService } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agentHostEnablementService.service';
14
+ import { LOCAL_AGENT_HOST_AUTHORITY } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agentHostUri';
15
+ import { NotificationType } from '../../../../../../platform/agentHost/common/state/sessionActions.js';
16
+ import { CHATGPT_SUBSCRIPTION_MODEL_SOURCE_ID } from '@codingame/monaco-vscode-katex-common/vscode/vs/platform/agentHost/common/agentModelSource';
17
+ import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
18
+ import { IDefaultAccountService } from '@codingame/monaco-vscode-api/vscode/vs/platform/defaultAccount/common/defaultAccount.service';
19
+ import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
20
+ import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
21
+ import { Registry } from '@codingame/monaco-vscode-api/vscode/vs/platform/registry/common/platform';
22
+ import { IAgentHostFileSystemService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/agentHost/common/agentHostFileSystemService.service';
23
+ import { IAuthenticationService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/common/authentication.service';
24
+ import { IWorkbenchEnvironmentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/environment/common/environmentService.service';
25
+ import { ChatSessionsExtensions, isLocalAgentHostTarget } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService';
26
+ import { IChatSessionsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService.service';
27
+ import { ChatAgentLocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
28
+ import { ICustomizationHarnessService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/customizationHarnessService.service';
29
+ import { ILanguageModelsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModels.service';
30
+ import { languageModelSourcePresentationRegistry } from '@codingame/monaco-vscode-katex-common/vscode/vs/workbench/contrib/chat/common/languageModelSourcePresentation';
31
+ import { Target } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/promptTypes';
32
+ import { AgentCustomizationItemProvider } from './agentCustomizationItemProvider.js';
33
+ import { agentHostProviderHasBuiltInGitHubMcpServer, COPILOT_CHAT_GITHUB_MCP_COLLECTION_ID } from './agentHostMcpServerSupport.js';
34
+ import { AgentHostDownloadProgress } from './agentHostDownloadProgress.js';
35
+ import { AgentHostAuthTokenCache, AgentHostAuthenticationRecovery, revokeAuthenticationForRemovedSessions, authenticateAgentProtectedResourcesWithToken, authenticateProtectedResources, authenticateProtectedResourcesWithToken, resolveAuthenticationInteractively } from './agentHostAuth.js';
36
+ import { agentHostProviderSupportsAutoModel, AgentHostLanguageModelProvider } from './agentHostLanguageModelProvider.js';
37
+ import { AgentHostSessionHandler } from './agentHostSessionHandler.js';
38
+ import { AgentHostPromptCacheNotification } from './agentHostPromptCacheNotification.js';
39
+ import { IAgentHostActiveClientService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService.service';
40
+ import { IAgentHostProtectedResourcesService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostProtectedResourcesService.service';
41
+ import { AICustomizationManagementSection } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/aiCustomizationWorkspaceService';
42
+ import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
43
+ import { protectedResourcesRequireGitHubCopilotSignIn } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agent';
44
+
45
+ const LOCAL_AGENT_HOST_SESSION_TYPE_PREFIX = "agent-host-";
46
+ languageModelSourcePresentationRegistry.register({
47
+ ownerVendor: "agent-host-codex",
48
+ sourceId: CHATGPT_SUBSCRIPTION_MODEL_SOURCE_ID,
49
+ label: ( localize(5988, "ChatGPT")),
50
+ icon: Codicon.openai,
51
+ description: ( localize(5989, "Models provided by your ChatGPT subscription"))
52
+ });
53
+ ( Registry.as(ChatSessionsExtensions.AsyncActivation)).register({
54
+ matchSessionType: sessionType => isLocalAgentHostTarget(sessionType),
55
+ waitForActivation: waitForLocalAgentHostActivation
56
+ });
57
+ async function waitForLocalAgentHostActivation(accessor, sessionType) {
58
+ const agentHostEnablementService = accessor.get(IAgentHostEnablementService);
59
+ const agentHostService = accessor.get(IAgentHostService);
60
+ const configurationService = accessor.get(IConfigurationService);
61
+ const environmentService = accessor.get(IWorkbenchEnvironmentService);
62
+ if (!agentHostEnablementService.enabled.get()) {
63
+ return false;
64
+ }
65
+ const provider = getLocalAgentHostProviderForSessionType(sessionType);
66
+ if (!provider) {
67
+ return false;
68
+ }
69
+ while (true) {
70
+ const rootState = agentHostService.rootState.value;
71
+ if (rootState instanceof Error) {
72
+ return false;
73
+ }
74
+ if (rootState) {
75
+ return ( rootState.agents.some(
76
+ agent => agent.provider === provider && shouldSurfaceLocalAgentHostProvider(agent.provider, configurationService, environmentService.isSessionsWindow)
77
+ ));
78
+ }
79
+ const changed = await Promise.race([
80
+ Event.toPromise(agentHostService.rootState.onDidChange).then(() => true),
81
+ Event.toPromise(agentHostService.onAgentHostExit).then(() => false)
82
+ ]);
83
+ if (!changed) {
84
+ return false;
85
+ }
86
+ }
87
+ }
88
+ function getLocalAgentHostProviderForSessionType(sessionType) {
89
+ if (!isLocalAgentHostTarget(sessionType) || !sessionType.startsWith(LOCAL_AGENT_HOST_SESSION_TYPE_PREFIX)) {
90
+ return undefined;
91
+ }
92
+ return sessionType.slice(LOCAL_AGENT_HOST_SESSION_TYPE_PREFIX.length) || undefined;
93
+ }
94
+ let AgentHostContribution = class AgentHostContribution extends Disposable {
95
+ static {
96
+ this.ID = "workbench.contrib.agentHostContribution";
97
+ }
98
+ constructor(
99
+ _agentHostService,
100
+ _chatSessionsService,
101
+ _defaultAccountService,
102
+ _authenticationService,
103
+ _logService,
104
+ _languageModelsService,
105
+ _instantiationService,
106
+ _agentHostFileSystemService,
107
+ _configurationService,
108
+ _customizationHarnessService,
109
+ environmentService,
110
+ _activeClientService,
111
+ _protectedResourcesService,
112
+ _agentHostEnablementService
113
+ ) {
114
+ super();
115
+ this._agentHostService = _agentHostService;
116
+ this._chatSessionsService = _chatSessionsService;
117
+ this._defaultAccountService = _defaultAccountService;
118
+ this._authenticationService = _authenticationService;
119
+ this._logService = _logService;
120
+ this._languageModelsService = _languageModelsService;
121
+ this._instantiationService = _instantiationService;
122
+ this._agentHostFileSystemService = _agentHostFileSystemService;
123
+ this._configurationService = _configurationService;
124
+ this._customizationHarnessService = _customizationHarnessService;
125
+ this._activeClientService = _activeClientService;
126
+ this._protectedResourcesService = _protectedResourcesService;
127
+ this._agentHostEnablementService = _agentHostEnablementService;
128
+ this._agentRegistrations = this._register(( new DisposableMap()));
129
+ this._modelProviders = ( new Map());
130
+ this._authTokenCache = ( new AgentHostAuthTokenCache());
131
+ this._authRecovery = ( new AgentHostAuthenticationRecovery());
132
+ this._initialized = false;
133
+ this._enablementStore = this._register(( new MutableDisposable()));
134
+ this._authenticationGeneration = 0;
135
+ this._didStartInitialAuthentication = false;
136
+ this._isSessionsWindow = environmentService.isSessionsWindow;
137
+ this._enableSmokeTestDriver = !!environmentService.enableSmokeTestDriver;
138
+ this._register(autorun(reader => {
139
+ const enabled = this._agentHostEnablementService.enabled.read(reader);
140
+ if (enabled) {
141
+ const wasInitialized = this._initialized;
142
+ this._initialize();
143
+ this._enable();
144
+ const current = this._agentHostService.rootState.value;
145
+ if (wasInitialized && current && !(current instanceof Error)) {
146
+ this._handleRootStateChange(current);
147
+ }
148
+ } else {
149
+ this._authenticationGeneration++;
150
+ this._authTokenCache.clear();
151
+ this._authRecovery.clear();
152
+ this._enablementStore.clear();
153
+ this._agentHostService.setAuthenticationPending(false);
154
+ this._agentRegistrations.clearAndDisposeAll();
155
+ this._modelProviders.clear();
156
+ }
157
+ }));
158
+ }
159
+ _initialize() {
160
+ if (this._initialized) {
161
+ return;
162
+ }
163
+ this._initialized = true;
164
+ this._promptCacheNotification = this._register(
165
+ this._instantiationService.createInstance(AgentHostPromptCacheNotification)
166
+ );
167
+ this._register(
168
+ this._agentHostFileSystemService.registerAuthority(LOCAL_AGENT_HOST_AUTHORITY, this._agentHostService)
169
+ );
170
+ this._register(this._agentHostService.rootState.onDidChange(rootState => {
171
+ this._handleRootStateChange(rootState);
172
+ }));
173
+ const initialRootState = this._agentHostService.rootState.value;
174
+ if (initialRootState && !(initialRootState instanceof Error)) {
175
+ this._handleRootStateChange(initialRootState);
176
+ }
177
+ this._register(this._configurationService.onDidChangeConfiguration(e => {
178
+ if (!affectsAgentHostProviderPreference(e, this._isSessionsWindow)) {
179
+ return;
180
+ }
181
+ const current = this._agentHostService.rootState.value;
182
+ if (current && !(current instanceof Error)) {
183
+ this._handleRootStateChange(current);
184
+ }
185
+ }));
186
+ }
187
+ _enable() {
188
+ if (this._enablementStore.value) {
189
+ return;
190
+ }
191
+ const store = ( new DisposableStore());
192
+ store.add(this._agentHostService.onDidNotification(notification => {
193
+ if (notification.type !== NotificationType.AuthRequired) {
194
+ return;
195
+ }
196
+ this._authenticateNotificationResource(notification.resource);
197
+ }));
198
+ store.add(this._defaultAccountService.onDidChangeDefaultAccount(() => {
199
+ this._authenticateWithServer(this._getRootAgents()).catch(() => {});
200
+ }));
201
+ store.add(this._authenticationService.onDidRegisterAuthenticationProvider(() => {
202
+ this._authenticateWithServer(this._getRootAgents()).catch(() => {});
203
+ }));
204
+ store.add(this._authenticationService.onDidChangeSessions(event => {
205
+ void this._handleAuthenticationSessionsChanged(event.providerId, event.event.removed ?? []);
206
+ }));
207
+ if (!this._isSessionsWindow) {
208
+ const downloadProgress = store.add(this._instantiationService.createInstance(AgentHostDownloadProgress));
209
+ store.add(this._agentHostService.onDidNotification(n => {
210
+ if (n.type === NotificationType.Progress) {
211
+ downloadProgress.handleProgress(n);
212
+ }
213
+ }));
214
+ }
215
+ this._enablementStore.value = store;
216
+ }
217
+ _shouldRegisterAgent(provider) {
218
+ return shouldSurfaceLocalAgentHostProvider(provider, this._configurationService, this._isSessionsWindow);
219
+ }
220
+ _handleRootStateChange(rootState) {
221
+ if (!this._agentHostEnablementService.enabled.get()) {
222
+ return;
223
+ }
224
+ const allowed = rootState.agents.filter(a => this._shouldRegisterAgent(a.provider));
225
+ const incoming = ( new Set(( allowed.map(a => a.provider))));
226
+ for (const [provider] of this._agentRegistrations) {
227
+ if (!( incoming.has(provider))) {
228
+ this._agentRegistrations.deleteAndDispose(provider);
229
+ this._modelProviders.delete(provider);
230
+ }
231
+ }
232
+ this._authenticateWithServer(allowed).catch(() => {});
233
+ for (const agent of allowed) {
234
+ if (!( this._agentRegistrations.has(agent.provider))) {
235
+ this._registerAgent(agent);
236
+ } else {
237
+ const modelProvider = this._modelProviders.get(agent.provider);
238
+ modelProvider?.updateModels(agent.models);
239
+ }
240
+ }
241
+ }
242
+ _registerAgent(agent) {
243
+ const store = ( new DisposableStore());
244
+ this._agentRegistrations.set(agent.provider, store);
245
+ const sessionType = `agent-host-${agent.provider}`;
246
+ const agentId = sessionType;
247
+ const vendor = sessionType;
248
+ const ahService = this._agentHostService;
249
+ store.add(this._chatSessionsService.registerChatSessionContribution({
250
+ type: sessionType,
251
+ name: agentId,
252
+ displayName: agent.displayName,
253
+ description: agent.description,
254
+ locations: agent.provider === "copilotcli" ? [
255
+ ChatAgentLocation.Chat,
256
+ ChatAgentLocation.Terminal,
257
+ ChatAgentLocation.EditorInline
258
+ ] : undefined,
259
+ customAgentTarget: this._isSessionsWindow ? undefined : Target.GitHubCopilot,
260
+ canDelegate: true,
261
+ requiresCustomModels: true,
262
+ supportsAutoModel: agentHostProviderSupportsAutoModel(agent.provider),
263
+ requiresCopilotSignIn: () => {
264
+ const resources = this._protectedResourcesService.getProtectedResources(agent.provider);
265
+ return resources !== undefined ? protectedResourcesRequireGitHubCopilotSignIn(resources) : true;
266
+ },
267
+ onDidChangeRequiresCopilotSignIn: Event.signal(Event.filter(
268
+ this._protectedResourcesService.onDidChange,
269
+ provider => provider === agent.provider,
270
+ store
271
+ )),
272
+ agentHostProviderId: agent.provider,
273
+ supportsDelegation: false,
274
+ capabilities: {
275
+ supportsCheckpoints: true,
276
+ supportsPromptAttachments: true,
277
+ supportsImageAttachments: true,
278
+ get terminalCommandPrefix() {
279
+ return ahService.initializeResult.get()?.terminalCommandPrefix;
280
+ }
281
+ }
282
+ }));
283
+ const syncProvider = this._activeClientService.getSyncProvider(sessionType);
284
+ const ambientScope = store.add(this._activeClientService.acquireScope(sessionType, []));
285
+ const itemProvider = store.add(this._instantiationService.createInstance(
286
+ AgentCustomizationItemProvider,
287
+ "local",
288
+ undefined,
289
+ syncedUri => this._activeClientService.getOrigin(syncedUri)
290
+ ));
291
+ itemProvider.setDraftCustomAgents(ambientScope.customAgents);
292
+ itemProvider.setDraftCustomizations(ambientScope.customizations);
293
+ store.add(this._customizationHarnessService.registerExternalHarness({
294
+ id: sessionType,
295
+ label: agent.displayName,
296
+ icon: ThemeIcon.fromId(Codicon.server.id),
297
+ hiddenSections: agent.provider === "copilotcli" ? [AICustomizationManagementSection.Prompts] : [
298
+ AICustomizationManagementSection.Tools,
299
+ AICustomizationManagementSection.Prompts
300
+ ],
301
+ hideGenerateButton: true,
302
+ syncProvider,
303
+ itemProvider,
304
+ hiddenMcpServerCollectionIds: agentHostProviderHasBuiltInGitHubMcpServer(agent.provider) ? [COPILOT_CHAT_GITHUB_MCP_COLLECTION_ID] : undefined
305
+ }));
306
+ const sessionHandler = store.add(this._instantiationService.createInstance(AgentHostSessionHandler, {
307
+ provider: agent.provider,
308
+ agentId,
309
+ sessionType,
310
+ fullName: agent.displayName,
311
+ description: agent.description,
312
+ connection: this._agentHostService,
313
+ connectionAuthority: LOCAL_AGENT_HOST_AUTHORITY,
314
+ onSessionMaterialized: resource => this._chatSessionsService.notifySessionMaterialized?.(resource),
315
+ resolveAuthentication: resources => this._resolveAuthenticationInteractively(resources),
316
+ promptCacheNotification: this._promptCacheNotification
317
+ }));
318
+ store.add(
319
+ this._chatSessionsService.registerChatSessionContentProvider(sessionType, sessionHandler)
320
+ );
321
+ const vendorDescriptor = {
322
+ vendor,
323
+ displayName: agent.displayName,
324
+ configuration: undefined,
325
+ managementCommand: undefined,
326
+ when: undefined
327
+ };
328
+ this._languageModelsService.deltaLanguageModelChatProviderDescriptors([vendorDescriptor], []);
329
+ store.add(toDisposable(
330
+ () => this._languageModelsService.deltaLanguageModelChatProviderDescriptors([], [vendorDescriptor])
331
+ ));
332
+ const modelProvider = store.add(( new AgentHostLanguageModelProvider(sessionType, vendor, this._languageModelsService)));
333
+ this._modelProviders.set(agent.provider, modelProvider);
334
+ store.add(toDisposable(() => this._modelProviders.delete(agent.provider)));
335
+ store.add(
336
+ this._languageModelsService.registerLanguageModelProvider(vendor, modelProvider)
337
+ );
338
+ modelProvider.updateModels(agent.models);
339
+ }
340
+ async _handleAuthenticationSessionsChanged(providerId, removedSessions) {
341
+ const agents = this._getRootAgents();
342
+ if (removedSessions.length > 0) {
343
+ const generation = this._authenticationGeneration;
344
+ try {
345
+ await this._instantiationService.invokeFunction(
346
+ revokeAuthenticationForRemovedSessions,
347
+ agents,
348
+ providerId,
349
+ removedSessions,
350
+ {
351
+ authTokenCache: this._authTokenCache,
352
+ logPrefix: "[AgentHost]",
353
+ isCurrent: () => this._isAuthenticationCurrent(generation),
354
+ authenticate: request => this._authenticateIfCurrent(request, generation)
355
+ }
356
+ );
357
+ } catch (error) {
358
+ if (!isCancellationError(error)) {
359
+ this._logService.error("[AgentHost] Failed to revoke removed authentication session", error);
360
+ }
361
+ }
362
+ }
363
+ await this._authenticateWithServer(agents);
364
+ }
365
+ _getRootAgents() {
366
+ const rootState = this._agentHostService.rootState.value;
367
+ const agents = (rootState && !(rootState instanceof Error)) ? rootState.agents : [];
368
+ return agents.filter(a => this._shouldRegisterAgent(a.provider));
369
+ }
370
+ async _authenticateWithServer(agents) {
371
+ const generation = this._authenticationGeneration;
372
+ if (!this._isAuthenticationCurrent(generation)) {
373
+ return;
374
+ }
375
+ const isInitialAuthentication = agents.length > 0 && !this._didStartInitialAuthentication;
376
+ if (isInitialAuthentication) {
377
+ this._didStartInitialAuthentication = true;
378
+ mark("code/agentHost/willAuthenticate");
379
+ }
380
+ this._agentHostService.setAuthenticationPending(true);
381
+ try {
382
+ const testToken = this._getScenarioAutomationToken();
383
+ if (testToken !== undefined) {
384
+ await authenticateAgentProtectedResourcesWithToken(agents, testToken, {
385
+ authTokenCache: this._authTokenCache,
386
+ isCurrent: () => this._isAuthenticationCurrent(generation),
387
+ authenticate: request => this._authenticateIfCurrent(request, generation)
388
+ });
389
+ return;
390
+ }
391
+ await this._instantiationService.invokeFunction(authenticateProtectedResources, agents, {
392
+ authTokenCache: this._authTokenCache,
393
+ logPrefix: "[AgentHost]",
394
+ isCurrent: () => this._isAuthenticationCurrent(generation),
395
+ authenticate: request => this._authenticateIfCurrent(request, generation)
396
+ });
397
+ } catch (err) {
398
+ if (!isCancellationError(err)) {
399
+ this._logService.error("[AgentHost] Failed to authenticate with server", err);
400
+ }
401
+ } finally {
402
+ if (this._isAuthenticationCurrent(generation)) {
403
+ this._agentHostService.setAuthenticationPending(false);
404
+ }
405
+ if (isInitialAuthentication) {
406
+ mark("code/agentHost/didAuthenticate");
407
+ }
408
+ }
409
+ }
410
+ _authenticateNotificationResource(protectedResource) {
411
+ const generation = this._authenticationGeneration;
412
+ if (!this._isAuthenticationCurrent(generation)) {
413
+ return;
414
+ }
415
+ this._agentHostService.setAuthenticationPending(true);
416
+ this._instantiationService.invokeFunction(accessor => this._authRecovery.recover(accessor, protectedResource, {
417
+ authTokenCache: this._authTokenCache,
418
+ logPrefix: "[AgentHost]",
419
+ isCurrent: () => this._isAuthenticationCurrent(generation),
420
+ authenticate: request => this._authenticateIfCurrent(request, generation)
421
+ })).catch(err => {
422
+ if (!isCancellationError(err)) {
423
+ this._logService.error(
424
+ `[AgentHost] Failed to authenticate notified resource ${protectedResource.resource}`,
425
+ err
426
+ );
427
+ }
428
+ }).finally(() => {
429
+ if (this._isAuthenticationCurrent(generation)) {
430
+ this._agentHostService.setAuthenticationPending(false);
431
+ }
432
+ });
433
+ }
434
+ async _resolveAuthenticationInteractively(protectedResources) {
435
+ const generation = this._authenticationGeneration;
436
+ if (!this._isAuthenticationCurrent(generation)) {
437
+ return false;
438
+ }
439
+ const testToken = this._getScenarioAutomationToken();
440
+ if (testToken !== undefined) {
441
+ await authenticateProtectedResourcesWithToken(protectedResources, testToken, {
442
+ authTokenCache: this._authTokenCache,
443
+ isCurrent: () => this._isAuthenticationCurrent(generation),
444
+ authenticate: request => this._authenticateIfCurrent(request, generation)
445
+ });
446
+ return protectedResources.length > 0;
447
+ }
448
+ return this._instantiationService.invokeFunction(resolveAuthenticationInteractively, protectedResources, {
449
+ authTokenCache: this._authTokenCache,
450
+ logPrefix: "[AgentHost]",
451
+ isCurrent: () => this._isAuthenticationCurrent(generation),
452
+ authenticate: request => this._authenticateIfCurrent(request, generation)
453
+ });
454
+ }
455
+ _getScenarioAutomationToken() {
456
+ if (!this._enableSmokeTestDriver) {
457
+ return undefined;
458
+ }
459
+ const token = this._configurationService.getValue("chat.agentHost.unsafeTestToken");
460
+ return typeof token === "string" && token.length > 0 ? token : undefined;
461
+ }
462
+ _isAuthenticationCurrent(generation) {
463
+ return generation === this._authenticationGeneration && this._agentHostEnablementService.enabled.get();
464
+ }
465
+ _authenticateIfCurrent(request, generation) {
466
+ if (!this._isAuthenticationCurrent(generation)) {
467
+ return Promise.reject(( new CancellationError()));
468
+ }
469
+ return this._agentHostService.authenticate(request);
470
+ }
471
+ };
472
+ AgentHostContribution = ( __decorate([( __param(0, IAgentHostService)), ( __param(1, IChatSessionsService)), ( __param(2, IDefaultAccountService)), ( __param(3, IAuthenticationService)), ( __param(4, ILogService)), ( __param(5, ILanguageModelsService)), ( __param(6, IInstantiationService)), ( __param(7, IAgentHostFileSystemService)), ( __param(8, IConfigurationService)), ( __param(9, ICustomizationHarnessService)), ( __param(10, IWorkbenchEnvironmentService)), ( __param(11, IAgentHostActiveClientService)), ( __param(12, IAgentHostProtectedResourcesService)), ( __param(13, IAgentHostEnablementService))], AgentHostContribution));
473
+
474
+ export { AgentHostContribution, AgentHostSessionHandler };