@codingame/monaco-vscode-chat-service-override 31.0.1 → 32.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (343) hide show
  1. package/index.d.ts +1 -1
  2. package/index.js +22 -5
  3. package/package.json +5 -5
  4. package/vscode/src/vs/base/common/defaultAccount.d.ts +69 -0
  5. package/vscode/src/vs/base/common/defaultAccount.js +12 -0
  6. package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostProtocolClient.d.ts +91 -22
  7. package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostProtocolClient.js +301 -68
  8. package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.d.ts +24 -5
  9. package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.js +89 -16
  10. package/vscode/src/vs/platform/agentHost/browser/webSocketClientTransport.d.ts +17 -5
  11. package/vscode/src/vs/platform/agentHost/browser/webSocketClientTransport.js +73 -10
  12. package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemProvider.d.ts +32 -6
  13. package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemProvider.js +32 -20
  14. package/vscode/src/vs/platform/agentHost/common/agentHostPermissionService.d.ts +37 -0
  15. package/vscode/src/vs/platform/agentHost/common/agentHostPermissionService.js +15 -0
  16. package/vscode/src/vs/platform/agentHost/common/agentService.d.ts +242 -201
  17. package/vscode/src/vs/platform/agentHost/common/agentService.js +3 -1
  18. package/vscode/src/vs/platform/agentHost/common/ahpJsonlLogger.d.ts +35 -0
  19. package/vscode/src/vs/platform/agentHost/common/ahpJsonlLogger.js +106 -0
  20. package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.d.ts +38 -30
  21. package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.js +2 -1
  22. package/vscode/src/vs/platform/agentHost/common/state/protocol/errors.d.ts +114 -4
  23. package/vscode/src/vs/platform/agentHost/common/state/protocol/reducers.d.ts +10 -10
  24. package/vscode/src/vs/platform/agentHost/common/state/protocol/reducers.js +52 -19
  25. package/vscode/src/vs/platform/agentHost/common/state/protocol/version/registry.d.ts +42 -0
  26. package/vscode/src/vs/platform/agentHost/common/state/protocol/version/registry.js +7 -0
  27. package/vscode/src/vs/platform/agentHost/common/state/sessionActions.d.ts +42 -41
  28. package/vscode/src/vs/platform/agentHost/common/state/sessionTransport.d.ts +6 -6
  29. package/vscode/src/vs/platform/agentHost/common/transportConstants.d.ts +15 -0
  30. package/vscode/src/vs/platform/agentHost/common/transportConstants.js +6 -0
  31. package/vscode/src/vs/platform/agentPlugins/common/pluginParsers.d.ts +4 -3
  32. package/vscode/src/vs/platform/agentPlugins/common/pluginParsers.js +4 -3
  33. package/vscode/src/vs/platform/networkFilter/common/networkFilterService.d.ts +4 -2
  34. package/vscode/src/vs/platform/networkFilter/common/networkFilterService.js +15 -7
  35. package/vscode/src/vs/workbench/contrib/browserView/common/browserChatToolReferenceNames.d.ts +19 -0
  36. package/vscode/src/vs/workbench/contrib/browserView/common/browserChatToolReferenceNames.js +17 -0
  37. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityService.js +2 -2
  38. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.d.ts +2 -2
  39. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.js +16 -16
  40. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.js +14 -10
  41. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +64 -59
  42. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAgentRecommendationActions.js +1 -1
  43. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +31 -16
  44. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +18 -9
  45. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.d.ts +16 -0
  46. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +8 -8
  47. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +30 -5
  48. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +2 -2
  49. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatForkActions.js +8 -7
  50. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +3 -3
  51. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatLanguageModelActions.js +13 -13
  52. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +6 -6
  53. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatNewActions.js +12 -12
  54. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatOpenAgentDebugPanelAction.js +12 -12
  55. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPluginActions.js +27 -18
  56. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPromptNavigationActions.js +2 -2
  57. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQueueActions.js +11 -11
  58. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +8 -8
  59. package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +21 -20
  60. package/vscode/src/vs/workbench/contrib/chat/browser/actions/createPluginAction.js +22 -22
  61. package/vscode/src/vs/workbench/contrib/chat/browser/actions/reviewEdits.d.ts +12 -0
  62. package/vscode/src/vs/workbench/contrib/chat/browser/actions/reviewEdits.js +171 -0
  63. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginActions.d.ts +1 -1
  64. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginActions.js +8 -8
  65. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.js +4 -4
  66. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditorInput.js +2 -2
  67. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginItems.d.ts +1 -1
  68. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.d.ts +3 -2
  69. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.js +12 -10
  70. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.d.ts +0 -3
  71. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.js +16 -17
  72. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPermissionUiContribution.d.ts +28 -0
  73. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPermissionUiContribution.js +99 -0
  74. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectoryResolver.d.ts +2 -1
  75. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectoryResolver.js +11 -4
  76. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.js +9 -3
  77. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.js +63 -53
  78. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.d.ts +2 -0
  79. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.js +10 -7
  80. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsQuickAccess.js +3 -3
  81. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjection.js +1 -1
  82. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionActions.js +4 -4
  83. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.js +1 -1
  84. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionsExperiments.contribution.js +5 -4
  85. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.js +25 -48
  86. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccess.js +17 -17
  87. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccessActions.js +4 -4
  88. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/localAgentSessionsController.js +5 -0
  89. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.d.ts +8 -4
  90. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.js +99 -39
  91. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.d.ts +2 -2
  92. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.js +17 -30
  93. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemsModel.d.ts +78 -0
  94. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemsModel.js +38 -0
  95. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.d.ts +35 -37
  96. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.js +347 -326
  97. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidgetUtils.d.ts +6 -2
  98. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidgetUtils.js +1 -11
  99. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.contribution.js +113 -109
  100. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.d.ts +37 -15
  101. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.js +436 -134
  102. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.js +1 -1
  103. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePagePromptLaunchers.d.ts +2 -0
  104. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePagePromptLaunchers.js +52 -26
  105. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCreatorService.js +7 -1
  106. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.d.ts +2 -1
  107. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.js +13 -5
  108. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedAgentPluginDetail.d.ts +23 -0
  109. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedAgentPluginDetail.js +60 -0
  110. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedMcpServerDetail.d.ts +25 -0
  111. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedMcpServerDetail.js +93 -0
  112. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.d.ts +9 -2
  113. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.js +73 -104
  114. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationManagement.css +272 -41
  115. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationWelcomePromptLaunchers.css +12 -2
  116. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.d.ts +30 -1
  117. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.js +430 -185
  118. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.d.ts +5 -2
  119. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.js +44 -3
  120. package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +480 -279
  121. package/vscode/src/vs/workbench/contrib/chat/browser/chat.view.contribution.d.ts +1 -0
  122. package/vscode/src/vs/workbench/contrib/chat/browser/chat.view.contribution.js +5 -0
  123. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.js +32 -32
  124. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheDiff.d.ts +138 -0
  125. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheDiff.js +221 -0
  126. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheExplorerView.d.ts +84 -0
  127. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheExplorerView.js +1216 -0
  128. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugDetailPanel.js +6 -6
  129. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditor.d.ts +2 -1
  130. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditor.js +32 -4
  131. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditorInput.js +2 -2
  132. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventDetailRenderer.js +26 -19
  133. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventList.js +7 -7
  134. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFilters.js +4 -4
  135. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowChartView.js +7 -7
  136. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowGraph.js +28 -25
  137. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHomeView.js +13 -13
  138. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHookContentRenderer.js +17 -17
  139. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.js +25 -24
  140. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugMessageContentRenderer.js +8 -8
  141. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugModelTurnContentRenderer.js +23 -23
  142. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugOverviewView.d.ts +2 -1
  143. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugOverviewView.js +68 -33
  144. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugToolCallContentRenderer.js +11 -11
  145. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugTypes.d.ts +3 -2
  146. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugTypes.js +1 -0
  147. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/media/chatDebug.css +650 -6
  148. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +2 -2
  149. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.d.ts +46 -0
  150. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +533 -0
  151. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.d.ts +29 -0
  152. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +390 -0
  153. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.js +3 -3
  154. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.d.ts +101 -0
  155. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +509 -0
  156. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +2 -2
  157. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +18 -3
  158. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +1 -1
  159. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +11 -11
  160. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +3 -2
  161. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditingEditorOverlay.css +130 -0
  162. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditingExplanationWidget.css +276 -0
  163. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +1 -1
  164. package/vscode/src/vs/workbench/contrib/chat/browser/chatImageCarouselService.js +1 -1
  165. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.js +8 -7
  166. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.js +2 -2
  167. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.d.ts +1 -7
  168. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.js +6 -87
  169. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.d.ts +1 -1
  170. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.js +116 -182
  171. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/media/chatModelsWidget.css +12 -39
  172. package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +3 -3
  173. package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +31 -31
  174. package/vscode/src/vs/workbench/contrib/chat/browser/chatRepoInfo.js +2 -2
  175. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.js +61 -41
  176. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.js +10 -10
  177. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupGrowthSession.js +6 -6
  178. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.js +27 -27
  179. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.d.ts +2 -0
  180. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.js +16 -13
  181. package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.d.ts +20 -0
  182. package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.js +106 -36
  183. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.d.ts +25 -7
  184. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.js +629 -425
  185. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.d.ts +9 -1
  186. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.js +105 -29
  187. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusItemService.d.ts +1 -0
  188. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/media/chatStatus.css +175 -148
  189. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipCatalog.js +20 -33
  190. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.js +9 -2
  191. package/vscode/src/vs/workbench/contrib/chat/browser/chatWindowNotifier.js +4 -4
  192. package/vscode/src/vs/workbench/contrib/chat/browser/claudePluginRecommendations.js +2 -2
  193. package/vscode/src/vs/workbench/contrib/chat/browser/defaultModelContribution.js +4 -4
  194. package/vscode/src/vs/workbench/contrib/chat/browser/enablementActions.js +4 -4
  195. package/vscode/src/vs/workbench/contrib/chat/browser/enablementStatusWidget.js +2 -2
  196. package/vscode/src/vs/workbench/contrib/chat/browser/githubRepoFetcher.d.ts +58 -0
  197. package/vscode/src/vs/workbench/contrib/chat/browser/githubRepoFetcher.js +339 -0
  198. package/vscode/src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.js +1 -1
  199. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/media/planReviewFeedback.css +160 -0
  200. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorActions.d.ts +9 -0
  201. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorActions.js +123 -0
  202. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorContribution.d.ts +37 -0
  203. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorContribution.js +572 -0
  204. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackService.d.ts +36 -0
  205. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackService.js +167 -0
  206. package/vscode/src/vs/workbench/contrib/chat/browser/pluginGitCommandService.d.ts +49 -7
  207. package/vscode/src/vs/workbench/contrib/chat/browser/pluginGitCommandService.js +315 -19
  208. package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.js +45 -24
  209. package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.js +15 -15
  210. package/vscode/src/vs/workbench/contrib/chat/browser/pluginUrlHandler.js +6 -6
  211. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +6 -6
  212. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.js +44 -40
  213. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.js +5 -5
  214. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionOverlay.js +2 -2
  215. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptFileContributions.js +4 -1
  216. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js +2 -2
  217. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptUrlHandler.js +8 -8
  218. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.js +7 -7
  219. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.js +3 -3
  220. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/skillActions.js +3 -3
  221. package/vscode/src/vs/workbench/contrib/chat/browser/promptsDebugContribution.js +20 -20
  222. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.js +39 -39
  223. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.d.ts +9 -1
  224. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.js +111 -52
  225. package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.d.ts +3 -7
  226. package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.js +13 -47
  227. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolHelpers.d.ts +3 -2
  228. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolHelpers.js +4 -8
  229. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolResultCompressorService.d.ts +18 -0
  230. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolResultCompressorService.js +56 -0
  231. package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.d.ts +3 -7
  232. package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.js +14 -52
  233. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +5 -5
  234. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidgetService.d.ts +3 -1
  235. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidgetService.js +17 -2
  236. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.d.ts +2 -0
  237. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.js +23 -12
  238. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletions.d.ts +39 -0
  239. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletions.js +136 -0
  240. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletionsBase.d.ts +72 -0
  241. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletionsBase.js +56 -0
  242. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletionUtils.d.ts +7 -0
  243. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletionUtils.js +14 -1
  244. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.js +41 -26
  245. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorContrib.js +30 -12
  246. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorHover.js +1 -1
  247. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/chatQuick.js +1 -1
  248. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditor.js +2 -5
  249. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.js +25 -6
  250. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.js +2 -2
  251. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.d.ts +2 -2
  252. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.js +5 -4
  253. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.d.ts +1 -0
  254. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.js +108 -45
  255. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceTelemetry.js +7 -3
  256. package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionOperationLog.js +3 -1
  257. package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.d.ts +20 -1
  258. package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.js +65 -26
  259. package/vscode/src/vs/workbench/contrib/chat/common/participants/chatSlashCommands.d.ts +5 -3
  260. package/vscode/src/vs/workbench/contrib/chat/common/participants/chatSlashCommands.js +38 -11
  261. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.d.ts +17 -1
  262. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.js +165 -16
  263. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.d.ts +1 -0
  264. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.js +62 -1
  265. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +18 -18
  266. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/PromptHeaderDefinitionProvider.js +2 -1
  267. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.js +5 -5
  268. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.d.ts +1 -3
  269. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +15 -21
  270. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.d.ts +1 -3
  271. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.js +18 -24
  272. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.d.ts +4 -2
  273. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.js +203 -180
  274. package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +1 -1
  275. package/vscode/src/vs/workbench/contrib/chat/common/workingDirectory.d.ts +30 -0
  276. package/vscode/src/vs/workbench/contrib/chat/common/workingDirectory.js +35 -0
  277. package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/aiEditTelemetry/aiEditTelemetryServiceImpl.d.ts +2 -1
  278. package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/aiEditTelemetry/aiEditTelemetryServiceImpl.js +27 -2
  279. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.d.ts +1 -1
  280. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +14 -49
  281. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.d.ts +0 -16
  282. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +35 -177
  283. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatDefaultModel.js +2 -8
  284. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.d.ts +1 -2
  285. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.js +2 -3
  286. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.d.ts +4 -4
  287. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +11 -11
  288. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.js +14 -14
  289. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.js +1 -1
  290. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +13 -13
  291. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +5 -5
  292. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +1 -1
  293. package/vscode/src/vs/workbench/contrib/remoteCodingAgents/browser/remoteCodingAgents.contribution.js +7 -7
  294. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.js +16 -16
  295. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +20 -20
  296. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.d.ts +29 -3
  297. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +129 -3
  298. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.js +3 -2
  299. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.d.ts +2 -1
  300. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +14 -6
  301. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalLastCommandTool.js +3 -3
  302. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.d.ts +1 -4
  303. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +12 -38
  304. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalSelectionTool.js +3 -3
  305. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/killTerminalTool.js +4 -4
  306. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +2 -2
  307. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sendToTerminalTool.d.ts +12 -7
  308. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sendToTerminalTool.js +77 -70
  309. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/createAndRunTaskTool.js +14 -14
  310. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/getTaskOutputTool.js +7 -7
  311. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/runTaskTool.js +14 -14
  312. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.js +1 -1
  313. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalOutputCompressor.d.ts +32 -0
  314. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalOutputCompressor.js +232 -0
  315. package/vscode/src/vs/workbench/services/agentHost/common/agentHostPermissionService.d.ts +83 -0
  316. package/vscode/src/vs/workbench/services/agentHost/common/agentHostPermissionService.js +243 -0
  317. package/vscode/src/vs/platform/agentHost/common/state/protocol/commands.d.ts +0 -749
  318. package/vscode/src/vs/platform/agentHost/common/state/protocol/commands.js +0 -14
  319. package/vscode/src/vs/platform/agentHost/common/state/sessionCapabilities.d.ts +0 -17
  320. package/vscode/src/vs/platform/agentHost/common/state/sessionCapabilities.js +0 -5
  321. package/vscode/src/vs/platform/agentHost/common/state/sessionProtocol.d.ts +0 -40
  322. package/vscode/src/vs/platform/agentHost/common/state/sessionProtocol.js +0 -14
  323. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemSource.d.ts +0 -131
  324. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemSource.js +0 -363
  325. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/promptsServiceCustomizationItemProvider.d.ts +0 -24
  326. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/promptsServiceCustomizationItemProvider.js +0 -306
  327. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatStatusWidget.d.ts +0 -23
  328. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatStatusWidget.js +0 -97
  329. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/media/chatStatusWidget.css +0 -57
  330. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.d.ts +0 -50
  331. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.js +0 -29
  332. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookClaudeCompat.d.ts +0 -50
  333. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookClaudeCompat.js +0 -78
  334. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCompatibility.d.ts +0 -77
  335. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCompatibility.js +0 -120
  336. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCopilotCliCompat.d.ts +0 -10
  337. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCopilotCliCompat.js +0 -23
  338. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.d.ts +0 -242
  339. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.js +0 -1701
  340. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts +0 -191
  341. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +0 -728
  342. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatHistoryService.d.ts +0 -14
  343. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatHistoryService.js +0 -69
@@ -5,7 +5,8 @@ import { Gesture, EventType as EventType$1 } from '@codingame/monaco-vscode-api/
5
5
  import { ActionBar } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/actionbar/actionbar';
6
6
  import { renderLabelWithIcons } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/iconLabel/iconLabels';
7
7
  import { Button } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/button/button';
8
- import { Checkbox } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/toggle/toggle';
8
+ import { SelectBox } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/selectBox/selectBox';
9
+ import { Checkbox, TriStateCheckbox } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/toggle/toggle';
9
10
  import { toAction } from '@codingame/monaco-vscode-api/vscode/vs/base/common/actions';
10
11
  import { cancelOnDispose } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
11
12
  import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
@@ -17,11 +18,13 @@ import { language } from '@codingame/monaco-vscode-api/vscode/vs/base/common/pla
17
18
  import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
18
19
  import { isObject } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
19
20
  import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
21
+ import { stripIcons } from '@codingame/monaco-vscode-api/vscode/vs/base/common/iconLabels';
20
22
  import { IInlineCompletionsService } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/services/inlineCompletionsService.service';
21
23
  import { ILanguageService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/language.service';
22
24
  import { ITextResourceConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/textResourceConfiguration.service';
23
25
  import { ILanguageFeaturesService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/languageFeatures.service';
24
- import { IQuickInputService } from '@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput.service';
26
+ import { StorageScope, StorageTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
27
+ import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
25
28
  import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
26
29
  import { ICommandService } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service';
27
30
  import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
@@ -31,73 +34,30 @@ import { IMarkdownRendererService } from '@codingame/monaco-vscode-api/vscode/vs
31
34
  import { Link } from '@codingame/monaco-vscode-api/vscode/vs/platform/opener/browser/link';
32
35
  import { IOpenerService } from '@codingame/monaco-vscode-api/vscode/vs/platform/opener/common/opener.service';
33
36
  import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
34
- import { defaultButtonStyles, defaultCheckboxStyles } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/browser/defaultStyles';
37
+ import { defaultButtonStyles, defaultSelectBoxStyles, defaultCheckboxStyles } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/browser/defaultStyles';
35
38
  import { DomWidget } from '../../../../../platform/domWidget/browser/domWidget.js';
36
39
  import { EditorResourceAccessor, SideBySideEditor } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor';
37
40
  import { getChatPlanName, ChatEntitlement } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/chat/common/chatEntitlementService';
38
41
  import { IChatEntitlementService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/chat/common/chatEntitlementService.service';
39
42
  import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
43
+ import { IContextViewService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextview/browser/contextView.service';
40
44
  import { isNewUser } from './chatStatus.js';
41
45
  import { IChatStatusItemService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chatStatus/chatStatusItemService.service';
42
46
  import product from '@codingame/monaco-vscode-api/vscode/vs/platform/product/common/product';
43
- import { registerColor, transparent } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colorUtils';
44
- import { contrastBorder } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/baseColors';
45
- import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/chartsColors';
46
- import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/editorColors';
47
- import { inputValidationInfoBorder, inputValidationWarningBorder, inputValidationErrorBorder } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/inputColors';
48
- import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/listColors';
49
- import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/menuColors';
50
- import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/minimapColors';
51
- import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/miscColors';
52
- import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/quickpickColors';
53
- import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/searchColors';
54
- import { Color } from '@codingame/monaco-vscode-api/vscode/vs/base/common/color';
55
47
  import { isCompletionsEnabled } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/completionsEnablement';
56
48
 
49
+ var ChatStatusDashboard_1;
57
50
  const defaultChat = product.defaultChatAgent;
58
- const gaugeForeground = registerColor("gauge.foreground", {
59
- dark: inputValidationInfoBorder,
60
- light: inputValidationInfoBorder,
61
- hcDark: contrastBorder,
62
- hcLight: contrastBorder
63
- }, ( localize(6379, "Gauge foreground color.")));
64
- registerColor("gauge.background", {
65
- dark: ( transparent(gaugeForeground, 0.3)),
66
- light: ( transparent(gaugeForeground, 0.3)),
67
- hcDark: Color.white,
68
- hcLight: Color.white
69
- }, ( localize(6380, "Gauge background color.")));
70
- registerColor("gauge.border", {
71
- dark: null,
72
- light: null,
73
- hcDark: contrastBorder,
74
- hcLight: contrastBorder
75
- }, ( localize(6381, "Gauge border color.")));
76
- const gaugeWarningForeground = registerColor("gauge.warningForeground", {
77
- dark: inputValidationWarningBorder,
78
- light: inputValidationWarningBorder,
79
- hcDark: contrastBorder,
80
- hcLight: contrastBorder
81
- }, ( localize(6382, "Gauge warning foreground color.")));
82
- registerColor("gauge.warningBackground", {
83
- dark: ( transparent(gaugeWarningForeground, 0.3)),
84
- light: ( transparent(gaugeWarningForeground, 0.3)),
85
- hcDark: Color.white,
86
- hcLight: Color.white
87
- }, ( localize(6383, "Gauge warning background color.")));
88
- const gaugeErrorForeground = registerColor("gauge.errorForeground", {
89
- dark: inputValidationErrorBorder,
90
- light: inputValidationErrorBorder,
91
- hcDark: contrastBorder,
92
- hcLight: contrastBorder
93
- }, ( localize(6384, "Gauge error foreground color.")));
94
- registerColor("gauge.errorBackground", {
95
- dark: ( transparent(gaugeErrorForeground, 0.3)),
96
- light: ( transparent(gaugeErrorForeground, 0.3)),
97
- hcDark: Color.white,
98
- hcLight: Color.white
99
- }, ( localize(6385, "Gauge error background color.")));
100
51
  let ChatStatusDashboard = class ChatStatusDashboard extends DomWidget {
52
+ static {
53
+ ChatStatusDashboard_1 = this;
54
+ }
55
+ static {
56
+ this.QUICK_SETTINGS_COLLAPSED_KEY = "chatStatusDashboard.quickSettingsCollapsed";
57
+ }
58
+ static {
59
+ this.CONTRIBUTED_COLLAPSED_KEY_PREFIX = "chatStatusDashboard.contributedCollapsed.";
60
+ }
101
61
  constructor(
102
62
  options,
103
63
  chatEntitlementService,
@@ -113,7 +73,8 @@ let ChatStatusDashboard = class ChatStatusDashboard extends DomWidget {
113
73
  inlineCompletionsService,
114
74
  markdownRendererService,
115
75
  languageFeaturesService,
116
- quickInputService
76
+ contextViewService,
77
+ storageService
117
78
  ) {
118
79
  super();
119
80
  this.options = options;
@@ -130,7 +91,8 @@ let ChatStatusDashboard = class ChatStatusDashboard extends DomWidget {
130
91
  this.inlineCompletionsService = inlineCompletionsService;
131
92
  this.markdownRendererService = markdownRendererService;
132
93
  this.languageFeaturesService = languageFeaturesService;
133
- this.quickInputService = quickInputService;
94
+ this.contextViewService = contextViewService;
95
+ this.storageService = storageService;
134
96
  this.element = $("div.chat-status-bar-entry-tooltip");
135
97
  this.dateFormatter = safeIntl.DateTimeFormat(language, {
136
98
  month: "short",
@@ -141,10 +103,10 @@ let ChatStatusDashboard = class ChatStatusDashboard extends DomWidget {
141
103
  minute: "numeric"
142
104
  });
143
105
  this.quotaPercentageFormatter = safeIntl.NumberFormat(undefined, {
144
- maximumFractionDigits: 1,
106
+ maximumFractionDigits: 0,
145
107
  minimumFractionDigits: 0
146
108
  });
147
- this.quotaOverageFormatter = safeIntl.NumberFormat(undefined, {
109
+ this.quotaCreditsFormatter = safeIntl.NumberFormat(language, {
148
110
  maximumFractionDigits: 2,
149
111
  minimumFractionDigits: 0
150
112
  });
@@ -160,167 +122,84 @@ let ChatStatusDashboard = class ChatStatusDashboard extends DomWidget {
160
122
  const hasQuotas = !!(chat || premiumChat);
161
123
  const isAnonymousWithSentiment = this.chatEntitlementService.anonymous && this.chatEntitlementService.sentiment.completed;
162
124
  const hasUsageSection = hasQuotas || isAnonymousWithSentiment;
163
- const hasVisibleUsageContent = !!(chat && !chat.unlimited && chat.total > 0) || !!(premiumChat && !premiumChat.unlimited && premiumChat.total > 0) || !!(completions && !completions.unlimited && completions.total > 0) || isAnonymousWithSentiment;
164
- const hasInlineSuggestionsSection = !this.options?.disableInlineSuggestionsSettings || !this.options?.disableModelSelection || !this.options?.disableProviderOptions || !this.options?.disableCompletionsSnooze;
125
+ const hasVisibleUsageContent = chat?.unlimited === false || premiumChat?.unlimited === false || completions?.unlimited === false || isAnonymousWithSentiment;
126
+ const contributedEntries = [...this.chatStatusItemService.getEntries()];
127
+ const hasQuickSettingsContent = !this.options?.disableInlineSuggestionsSettings || !this.options?.disableModelSelection || !this.options?.disableProviderOptions || !this.options?.disableCompletionsSnooze;
128
+ let headerAdditionalSpendButton;
165
129
  if (hasUsageSection) {
166
130
  const planName = getChatPlanName(this.chatEntitlementService.entitlement);
167
- this.renderHeader(this.element, this._store, planName, toAction({
131
+ const headerHost = this.options?.titleHeaderContainer ?? this.element;
132
+ const header = this.renderHeader(headerHost, this._store, planName, toAction({
168
133
  id: "workbench.action.manageCopilot",
169
- label: ( localize(6386, "Manage Chat")),
170
- tooltip: ( localize(6387, "Manage Chat")),
134
+ label: ( localize(6625, "Manage Copilot Settings")),
135
+ tooltip: ( localize(6626, "Manage Copilot Settings")),
171
136
  class: ThemeIcon.asClassName(Codicon.settings),
172
137
  run: () => this.runCommandAndClose(() => this.openerService.open(( URI.parse(defaultChat.manageSettingsUrl))))
173
138
  }));
174
- }
175
- const updatePromise = this.chatEntitlementService.update(token);
176
- if (hasVisibleUsageContent && hasInlineSuggestionsSection) {
177
- const usageContent = $("div.tab-content.active");
178
- usageContent.setAttribute("role", "tabpanel");
179
- usageContent.id = "chat-status-usage-panel";
180
- const inlineSuggestionsContent = $("div.tab-content");
181
- inlineSuggestionsContent.setAttribute("role", "tabpanel");
182
- inlineSuggestionsContent.id = "chat-status-inline-suggestions-panel";
183
- inlineSuggestionsContent.inert = true;
184
- const tabBar = this.element.appendChild($("div.tab-bar"));
185
- tabBar.setAttribute("role", "tablist");
186
- const usageTab = tabBar.appendChild($("button.tab.active"));
187
- usageTab.textContent = ( localize(6388, "Usage"));
188
- usageTab.setAttribute("role", "tab");
189
- usageTab.setAttribute("aria-selected", "true");
190
- usageTab.setAttribute("aria-controls", usageContent.id);
191
- usageTab.setAttribute("tabindex", "0");
192
- const quickSettingsTab = tabBar.appendChild($("button.tab"));
193
- quickSettingsTab.textContent = ( localize(6389, "Quick Settings"));
194
- quickSettingsTab.setAttribute("role", "tab");
195
- quickSettingsTab.setAttribute("aria-selected", "false");
196
- quickSettingsTab.setAttribute("aria-controls", inlineSuggestionsContent.id);
197
- quickSettingsTab.setAttribute("tabindex", "-1");
198
- const switchTab = (activeTab, inactiveTab, showContent, hideContent) => {
199
- activeTab.classList.add("active");
200
- activeTab.setAttribute("aria-selected", "true");
201
- activeTab.setAttribute("tabindex", "0");
202
- inactiveTab.classList.remove("active");
203
- inactiveTab.setAttribute("aria-selected", "false");
204
- inactiveTab.setAttribute("tabindex", "-1");
205
- showContent.classList.add("active");
206
- showContent.inert = false;
207
- hideContent.classList.remove("active");
208
- hideContent.inert = true;
209
- };
210
- this._store.add(addDisposableListener(
211
- usageTab,
212
- EventType.CLICK,
213
- () => switchTab(usageTab, quickSettingsTab, usageContent, inlineSuggestionsContent)
214
- ));
215
- this._store.add(addDisposableListener(
216
- quickSettingsTab,
217
- EventType.CLICK,
218
- () => switchTab(quickSettingsTab, usageTab, inlineSuggestionsContent, usageContent)
219
- ));
220
- this._store.add(addDisposableListener(tabBar, EventType.KEY_DOWN, e => {
221
- if (e.key === "ArrowRight" || e.key === "ArrowLeft") {
222
- e.preventDefault();
223
- if (usageTab.classList.contains("active")) {
224
- switchTab(quickSettingsTab, usageTab, inlineSuggestionsContent, usageContent);
225
- quickSettingsTab.focus();
226
- } else {
227
- switchTab(usageTab, quickSettingsTab, usageContent, inlineSuggestionsContent);
228
- usageTab.focus();
229
- }
230
- }
231
- }));
232
- const tabContentContainer = this.element.appendChild($("div.tab-content-container"));
233
- tabContentContainer.appendChild(usageContent);
234
- tabContentContainer.appendChild(inlineSuggestionsContent);
235
- this.renderUsageContent(usageContent, token, updatePromise);
236
- this.renderInlineSuggestionsContent(inlineSuggestionsContent, token, updatePromise);
237
- } else if (hasVisibleUsageContent) {
238
- this.renderUsageContent(this.element, token, updatePromise);
239
- } else if (hasInlineSuggestionsSection) {
240
- this.renderInlineSuggestionsContent(this.element, token, updatePromise);
241
- }
242
- {
243
- for (const item of this.chatStatusItemService.getEntries()) {
244
- this.element.appendChild($("hr"));
245
- const itemDisposables = this._store.add(( new MutableDisposable()));
246
- let rendered = this.renderContributedChatStatusItem(item);
247
- itemDisposables.value = rendered.disposables;
248
- this.element.appendChild(rendered.element);
249
- this._store.add(this.chatStatusItemService.onDidChange(e => {
250
- if (e.entry.id === item.id) {
251
- const previousElement = rendered.element;
252
- rendered = this.renderContributedChatStatusItem(e.entry);
253
- itemDisposables.value = rendered.disposables;
254
- previousElement.replaceWith(rendered.element);
255
- }
256
- }));
257
- }
258
- }
259
- {
260
- const newUser = isNewUser(this.chatEntitlementService);
261
- const anonymousUser = this.chatEntitlementService.anonymous;
262
- const disabled = this.chatEntitlementService.sentiment.disabled || this.chatEntitlementService.sentiment.untrusted;
263
- const signedOut = this.chatEntitlementService.entitlement === ChatEntitlement.Unknown;
264
- if (newUser || signedOut || disabled) {
265
- this.element.appendChild($("hr"));
266
- let descriptionText;
267
- let descriptionClass = ".description";
268
- if (newUser && anonymousUser) {
269
- descriptionText = ( new MarkdownString(( localize(
270
- 6390,
271
- "By continuing with {0} Copilot, you agree to {1}'s [Terms]({2}) and [Privacy Statement]({3})",
272
- defaultChat.provider.default.name,
273
- defaultChat.provider.default.name,
274
- defaultChat.termsStatementUrl,
275
- defaultChat.privacyStatementUrl
276
- )), {
277
- isTrusted: true
278
- }));
279
- descriptionClass = `${descriptionClass}.terms`;
280
- } else if (newUser) {
281
- descriptionText = ( localize(6391, "Set up Copilot to use AI features."));
282
- } else if (anonymousUser) {
283
- descriptionText = ( localize(6392, "Sign in to enable more Copilot AI features."));
284
- } else if (disabled) {
285
- descriptionText = ( localize(6393, "Enable Copilot to use AI features."));
286
- } else {
287
- descriptionText = ( localize(6394, "Sign in to use Copilot AI features."));
288
- }
289
- let buttonLabel;
290
- if (newUser) {
291
- buttonLabel = ( localize(6395, "Use AI Features"));
292
- } else if (anonymousUser) {
293
- buttonLabel = ( localize(6396, "Enable more AI Features"));
294
- } else if (disabled) {
295
- buttonLabel = ( localize(6397, "Enable AI Features"));
296
- } else {
297
- buttonLabel = ( localize(6398, "Sign in to use AI Features"));
298
- }
299
- let commandId;
300
- if (newUser && anonymousUser) {
301
- commandId = "workbench.action.chat.triggerSetupAnonymousWithoutDialog";
139
+ const canConfigureAdditionalSpend = this.chatEntitlementService.entitlement === ChatEntitlement.EDU || this.chatEntitlementService.entitlement === ChatEntitlement.Pro || this.chatEntitlementService.entitlement === ChatEntitlement.ProPlus || this.chatEntitlementService.entitlement === ChatEntitlement.Max;
140
+ const showUpgrade = this.chatEntitlementService.entitlement !== ChatEntitlement.ProPlus && this.chatEntitlementService.entitlement !== ChatEntitlement.Max && this.chatEntitlementService.entitlement !== ChatEntitlement.Business && this.chatEntitlementService.entitlement !== ChatEntitlement.Enterprise;
141
+ const actionBarElement = header.lastElementChild;
142
+ const initialAdditionalUsageEnabled = this.chatEntitlementService.quotas.additionalUsageEnabled ?? false;
143
+ const initialIsUsageBasedBilling = this.chatEntitlementService.quotas.usageBasedBilling === true;
144
+ if (canConfigureAdditionalSpend) {
145
+ headerAdditionalSpendButton = this._store.add(( new Button(header, {
146
+ ...defaultButtonStyles,
147
+ hoverDelegate: nativeHoverDelegate,
148
+ secondary: true
149
+ })));
150
+ headerAdditionalSpendButton.element.classList.add("header-cta-button");
151
+ if (initialIsUsageBasedBilling) {
152
+ headerAdditionalSpendButton.label = initialAdditionalUsageEnabled ? ( localize(6627, "Manage Additional Spend")) : ( localize(6628, "Configure Additional Spend"));
302
153
  } else {
303
- commandId = "workbench.action.chat.triggerSetup";
154
+ headerAdditionalSpendButton.label = initialAdditionalUsageEnabled ? ( localize(6629, "Manage Budget")) : ( localize(6630, "Configure Budget"));
304
155
  }
305
- if (typeof descriptionText === "string") {
306
- this.element.appendChild($(`div${descriptionClass}`, undefined, descriptionText));
307
- } else {
308
- this.element.appendChild($(
309
- `div${descriptionClass}`,
310
- undefined,
311
- this._store.add(this.markdownRendererService.render(descriptionText)).element
312
- ));
156
+ this._store.add(headerAdditionalSpendButton.onDidClick(() => {
157
+ this.telemetryService.publicLog2("workbenchActionExecuted", {
158
+ id: "workbench.action.chat.manageAdditionalSpend",
159
+ from: "chat-status"
160
+ });
161
+ this.runCommandAndClose(() => this.openerService.open(( URI.parse(defaultChat.manageOverageUrl))));
162
+ }));
163
+ if (actionBarElement) {
164
+ header.insertBefore(headerAdditionalSpendButton.element, actionBarElement);
313
165
  }
314
- const button = this._store.add(( new Button(this.element, {
166
+ }
167
+ if (showUpgrade) {
168
+ const upgradeButton = this._store.add(( new Button(header, {
315
169
  ...defaultButtonStyles,
316
170
  hoverDelegate: nativeHoverDelegate
317
171
  })));
318
- button.label = buttonLabel;
319
- this._store.add(button.onDidClick(() => this.runCommandAndClose(commandId)));
172
+ upgradeButton.element.classList.add("header-cta-button");
173
+ upgradeButton.label = ( localize(6631, "Upgrade"));
174
+ this._store.add(
175
+ upgradeButton.onDidClick(() => this.runCommandAndClose("workbench.action.chat.upgradePlan"))
176
+ );
177
+ if (actionBarElement) {
178
+ header.insertBefore(upgradeButton.element, actionBarElement);
179
+ }
320
180
  }
321
181
  }
182
+ const updatePromise = this.chatEntitlementService.update(token);
183
+ if (hasVisibleUsageContent) {
184
+ this.renderUsageContent(this.element, token, headerAdditionalSpendButton, updatePromise);
185
+ }
186
+ const hasPremiumUnlimited = !!premiumChat?.unlimited;
187
+ if (hasPremiumUnlimited) {
188
+ const includedTitle = this.chatEntitlementService.quotas.usageBasedBilling ? ( localize(6632, "Credits")) : ( localize(6633, "Premium Requests"));
189
+ const includedContainer = this.element.appendChild($("div.quota-indicator.included"));
190
+ includedContainer.appendChild($("div.quota-title", undefined, includedTitle));
191
+ includedContainer.appendChild($("div.description", undefined, ( localize(6634, "Included with your organization's plan."))));
192
+ }
193
+ if (hasQuickSettingsContent) {
194
+ const hasContentAbove = hasUsageSection || hasVisibleUsageContent || hasPremiumUnlimited;
195
+ this.renderInlineSuggestionsSection(hasContentAbove);
196
+ }
197
+ if (contributedEntries.length > 0) {
198
+ this.renderContributedSections(contributedEntries);
199
+ }
200
+ this.renderSetupSection();
322
201
  }
323
- renderUsageContent(container, token, updatePromise) {
202
+ renderUsageContent(container, token, headerAdditionalSpendButton, updatePromise) {
324
203
  const {
325
204
  chat: chatQuota,
326
205
  completions: completionsQuota,
@@ -330,48 +209,41 @@ let ChatStatusDashboard = class ChatStatusDashboard extends DomWidget {
330
209
  } = this.chatEntitlementService.quotas;
331
210
  if (chatQuota || premiumChatQuota || completionsQuota) {
332
211
  const resetLabel = resetDate ? (resetDateHasTime ? ( localize(
333
- 6399,
212
+ 6635,
334
213
  "Resets {0} at {1}",
335
214
  this.dateFormatter.value.format(( new Date(resetDate))),
336
215
  this.timeFormatter.value.format(( new Date(resetDate)))
337
216
  )) : ( localize(
338
- 6400,
217
+ 6636,
339
218
  "Resets {0}",
340
219
  this.dateFormatter.value.format(( new Date(resetDate)))
341
220
  ))) : undefined;
221
+ const globalCalloutUpdater = this.createGlobalQuotaCallout(container);
222
+ const {
223
+ calloutVisible: initialCalloutVisible
224
+ } = globalCalloutUpdater();
225
+ if (headerAdditionalSpendButton) {
226
+ headerAdditionalSpendButton.element.style.display = initialCalloutVisible ? "" : "none";
227
+ }
342
228
  let chatQuotaIndicator;
343
- if (chatQuota && !chatQuota.unlimited && chatQuota.total > 0) {
344
- chatQuotaIndicator = this.createQuotaIndicator(container, this._store, chatQuota, ( localize(6401, "Chat messages")), false, resetLabel);
229
+ if (chatQuota && !chatQuota.unlimited && (!this.chatEntitlementService.quotas.usageBasedBilling || this.chatEntitlementService.entitlement === ChatEntitlement.Free)) {
230
+ const chatLabel = this.chatEntitlementService.quotas.usageBasedBilling && this.chatEntitlementService.entitlement === ChatEntitlement.Free ? ( localize(6637, "Credits")) : ( localize(6638, "Chat messages"));
231
+ chatQuotaIndicator = this.createQuotaIndicator(container, chatQuota, chatLabel, resetLabel);
345
232
  }
346
233
  let premiumChatQuotaIndicator;
347
- if (premiumChatQuota && !premiumChatQuota.unlimited && premiumChatQuota.total > 0) {
348
- const premiumChatLabel = premiumChatQuota.overageEnabled ? ( localize(6402, "Included premium requests")) : ( localize(6403, "Premium requests"));
349
- premiumChatQuotaIndicator = this.createQuotaIndicator(
350
- container,
351
- this._store,
352
- premiumChatQuota,
353
- premiumChatLabel,
354
- true,
355
- resetLabel
356
- );
234
+ if (premiumChatQuota && !premiumChatQuota.unlimited && premiumChatQuota.percentRemaining >= 0) {
235
+ const isUBB = this.chatEntitlementService.quotas.usageBasedBilling;
236
+ const premiumChatLabel = isUBB ? ( localize(6637, "Credits")) : this.chatEntitlementService.quotas.additionalUsageEnabled ? ( localize(6639, "Included premium requests")) : ( localize(6640, "Premium requests"));
237
+ const premiumChatResetLabel = isUBB ? this.formatResetAtLabel(premiumChatQuota.resetAt) ?? resetLabel : resetLabel;
238
+ premiumChatQuotaIndicator = this.createQuotaIndicator(container, premiumChatQuota, premiumChatLabel, premiumChatResetLabel);
357
239
  }
358
240
  let completionsQuotaIndicator;
359
- if (completionsQuota && !completionsQuota.unlimited && completionsQuota.total > 0) {
360
- completionsQuotaIndicator = this.createQuotaIndicator(container, this._store, completionsQuota, ( localize(6404, "Inline Suggestions")), false, resetLabel);
361
- }
362
- if (this.chatEntitlementService.entitlement === ChatEntitlement.Free && (Number(chatQuota?.percentRemaining) <= 25 || Number(completionsQuota?.percentRemaining) <= 25)) {
363
- const upgradeProButton = this._store.add(( new Button(container, {
364
- ...defaultButtonStyles,
365
- hoverDelegate: nativeHoverDelegate,
366
- secondary: this.canUseChat()
367
- })));
368
- upgradeProButton.label = ( localize(6405, "Upgrade to GitHub Copilot Pro"));
369
- this._store.add(
370
- upgradeProButton.onDidClick(() => this.runCommandAndClose("workbench.action.chat.upgradePlan"))
371
- );
241
+ const showCompletions = completionsQuota && !completionsQuota.unlimited && completionsQuota.percentRemaining >= 0 && (!this.chatEntitlementService.quotas.usageBasedBilling || this.chatEntitlementService.entitlement === ChatEntitlement.Free);
242
+ if (showCompletions) {
243
+ completionsQuotaIndicator = this.createQuotaIndicator(container, completionsQuota, ( localize(6641, "Inline Suggestions")), resetLabel);
372
244
  }
373
245
  (async () => {
374
- await (updatePromise ?? this.chatEntitlementService.update(token));
246
+ await updatePromise;
375
247
  if (token.isCancellationRequested) {
376
248
  return;
377
249
  }
@@ -389,15 +261,251 @@ let ChatStatusDashboard = class ChatStatusDashboard extends DomWidget {
389
261
  if (completionsQuota) {
390
262
  completionsQuotaIndicator?.(completionsQuota);
391
263
  }
264
+ const {
265
+ calloutVisible,
266
+ additionalUsageEnabled: isAdditionalUsageEnabled
267
+ } = globalCalloutUpdater();
268
+ if (headerAdditionalSpendButton) {
269
+ headerAdditionalSpendButton.element.style.display = calloutVisible ? "" : "none";
270
+ const isUBB = this.chatEntitlementService.quotas.usageBasedBilling === true;
271
+ if (isUBB) {
272
+ headerAdditionalSpendButton.label = isAdditionalUsageEnabled ? ( localize(6627, "Manage Additional Spend")) : ( localize(6628, "Configure Additional Spend"));
273
+ } else {
274
+ headerAdditionalSpendButton.label = isAdditionalUsageEnabled ? ( localize(6629, "Manage Budget")) : ( localize(6630, "Configure Budget"));
275
+ }
276
+ }
392
277
  })();
393
278
  }
394
279
  else if (this.chatEntitlementService.anonymous && this.chatEntitlementService.sentiment.completed) {
395
- this.createQuotaIndicator(container, this._store, ( localize(6406, "Limited")), ( localize(6401, "Chat messages")), false);
280
+ this.createQuotaIndicator(container, ( localize(6642, "Limited")), ( localize(6638, "Chat messages")));
396
281
  }
397
282
  }
398
- renderInlineSuggestionsContent(container, _token, _updatePromise) {
283
+ renderInlineSuggestionsSection(hasContentAbove) {
284
+ const nonCollapsible = !!this.options?.disableQuickSettingsCollapsible;
285
+ const collapsed = !nonCollapsible && this.storageService.getBoolean(
286
+ ChatStatusDashboard_1.QUICK_SETTINGS_COLLAPSED_KEY,
287
+ StorageScope.PROFILE,
288
+ true
289
+ );
290
+ const activeLanguageId = this.editorService.activeTextEditorLanguageId;
291
+ const getStatusText = () => {
292
+ if (!this.canUseChat()) {
293
+ return localize(6643, "Disabled");
294
+ }
295
+ const enabled = activeLanguageId ? isCompletionsEnabled(this.configurationService, activeLanguageId) : isCompletionsEnabled(this.configurationService);
296
+ return enabled ? ( localize(6644, "Enabled")) : ( localize(6643, "Disabled"));
297
+ };
298
+ let disclosureHeader;
299
+ let chevron;
300
+ let statusEl;
301
+ if (!nonCollapsible) {
302
+ disclosureHeader = this.element.appendChild($("button.collapsible-header"));
303
+ if (!hasContentAbove) {
304
+ disclosureHeader.classList.add("no-border");
305
+ }
306
+ disclosureHeader.setAttribute("aria-expanded", String(!collapsed));
307
+ disclosureHeader.appendChild($("span.collapsible-label", undefined, ( localize(6645, "Inline Suggestions"))));
308
+ chevron = disclosureHeader.appendChild($("span.collapsible-chevron"));
309
+ chevron.classList.add(
310
+ ...ThemeIcon.asClassNameArray(collapsed ? Codicon.chevronRight : Codicon.chevronDown)
311
+ );
312
+ statusEl = disclosureHeader.appendChild($("span.collapsible-status", undefined, getStatusText()));
313
+ }
314
+ const collapsibleContent = this.element.appendChild($("div.collapsible-content"));
315
+ const collapsibleInner = collapsibleContent.appendChild($("div.collapsible-inner"));
316
+ if (collapsed) {
317
+ collapsibleContent.classList.add("collapsed");
318
+ collapsibleInner.inert = true;
319
+ }
320
+ if (disclosureHeader && chevron) {
321
+ const toggle = () => {
322
+ const isCollapsed = collapsibleContent.classList.toggle("collapsed");
323
+ collapsibleInner.inert = isCollapsed;
324
+ disclosureHeader.setAttribute("aria-expanded", String(!isCollapsed));
325
+ chevron.className = "collapsible-chevron";
326
+ chevron.classList.add(
327
+ ...ThemeIcon.asClassNameArray(isCollapsed ? Codicon.chevronRight : Codicon.chevronDown)
328
+ );
329
+ this.storageService.store(
330
+ ChatStatusDashboard_1.QUICK_SETTINGS_COLLAPSED_KEY,
331
+ isCollapsed,
332
+ StorageScope.PROFILE,
333
+ StorageTarget.USER
334
+ );
335
+ };
336
+ this._store.add(addDisposableListener(disclosureHeader, EventType.CLICK, () => toggle()));
337
+ }
338
+ if (statusEl) {
339
+ this._store.add(this.configurationService.onDidChangeConfiguration(e => {
340
+ if (e.affectsConfiguration(defaultChat.completionsEnablementSetting)) {
341
+ statusEl.textContent = getStatusText();
342
+ }
343
+ }));
344
+ }
345
+ this.renderInlineSuggestionsContent(collapsibleInner);
346
+ }
347
+ renderContributedSections(contributedEntries) {
348
+ const nonCollapsible = !!this.options?.disableContributedSectionsCollapsible;
349
+ for (const item of contributedEntries) {
350
+ const storageKey = ChatStatusDashboard_1.CONTRIBUTED_COLLAPSED_KEY_PREFIX + item.id;
351
+ const collapsed = !nonCollapsible && this.storageService.getBoolean(storageKey, StorageScope.PROFILE, true);
352
+ const headerLabel = typeof item.label === "string" ? item.label : item.label.label;
353
+ const headerLink = typeof item.label === "string" ? undefined : item.label.link;
354
+ const linkDescription = typeof item.label === "string" ? undefined : item.label.helpText;
355
+ const disclosureHeader = this.element.appendChild(
356
+ nonCollapsible ? $("div.collapsible-header.non-collapsible") : $("button.collapsible-header")
357
+ );
358
+ let chevron;
359
+ disclosureHeader.appendChild($("span.collapsible-label", undefined, headerLabel));
360
+ if (!nonCollapsible) {
361
+ disclosureHeader.setAttribute("aria-expanded", String(!collapsed));
362
+ chevron = disclosureHeader.appendChild($("span.collapsible-chevron"));
363
+ chevron.classList.add(
364
+ ...ThemeIcon.asClassNameArray(collapsed ? Codicon.chevronRight : Codicon.chevronDown)
365
+ );
366
+ }
367
+ const statusEl = disclosureHeader.appendChild($("span.collapsible-status"));
368
+ statusEl.append(...renderLabelWithIcons(item.description));
369
+ statusEl.title = stripIcons(item.description).trim();
370
+ const collapsibleContent = this.element.appendChild($("div.collapsible-content"));
371
+ const collapsibleInner = collapsibleContent.appendChild($("div.collapsible-inner"));
372
+ if (collapsed) {
373
+ collapsibleContent.classList.add("collapsed");
374
+ collapsibleInner.inert = true;
375
+ }
376
+ if (!nonCollapsible) {
377
+ const toggle = () => {
378
+ const isCollapsed = collapsibleContent.classList.toggle("collapsed");
379
+ collapsibleInner.inert = isCollapsed;
380
+ disclosureHeader.setAttribute("aria-expanded", String(!isCollapsed));
381
+ chevron.className = "collapsible-chevron";
382
+ chevron.classList.add(
383
+ ...ThemeIcon.asClassNameArray(isCollapsed ? Codicon.chevronRight : Codicon.chevronDown)
384
+ );
385
+ this.storageService.store(storageKey, isCollapsed, StorageScope.PROFILE, StorageTarget.USER);
386
+ };
387
+ this._store.add(addDisposableListener(disclosureHeader, EventType.CLICK, () => toggle()));
388
+ }
389
+ const sectionDisposables = this._store.add(( new MutableDisposable()));
390
+ const sectionStore = ( new DisposableStore());
391
+ sectionDisposables.value = sectionStore;
392
+ let descriptionEl;
393
+ if (headerLink) {
394
+ descriptionEl = collapsibleInner.appendChild($("div.section-description"));
395
+ const descText = linkDescription ? `${linkDescription} [${( localize(6646, "Learn More"))}](${headerLink})` : `[${( localize(6646, "Learn More"))}](${headerLink})`;
396
+ this.renderTextPlus(descriptionEl, descText, sectionStore);
397
+ }
398
+ let detailEl;
399
+ if (item.detail) {
400
+ detailEl = collapsibleInner.appendChild($("div.section-detail"));
401
+ this.renderTextPlus(detailEl, item.detail, sectionStore);
402
+ }
403
+ this._store.add(this.chatStatusItemService.onDidChange(e => {
404
+ if (e.entry.id === item.id) {
405
+ statusEl.textContent = "";
406
+ statusEl.append(...renderLabelWithIcons(e.entry.description));
407
+ statusEl.title = stripIcons(e.entry.description).trim();
408
+ const newStore = ( new DisposableStore());
409
+ sectionDisposables.value = newStore;
410
+ if (detailEl) {
411
+ if (e.entry.detail) {
412
+ detailEl.textContent = "";
413
+ this.renderTextPlus(detailEl, e.entry.detail, newStore);
414
+ } else {
415
+ detailEl.remove();
416
+ detailEl = undefined;
417
+ }
418
+ } else if (e.entry.detail) {
419
+ detailEl = collapsibleInner.appendChild($("div.section-detail"));
420
+ this.renderTextPlus(detailEl, e.entry.detail, newStore);
421
+ }
422
+ const updatedLink = typeof e.entry.label === "string" ? undefined : e.entry.label.link;
423
+ const updatedLinkDesc = typeof e.entry.label === "string" ? undefined : e.entry.label.helpText;
424
+ if (descriptionEl) {
425
+ if (updatedLink) {
426
+ descriptionEl.textContent = "";
427
+ const descText = updatedLinkDesc ? `${updatedLinkDesc} [${( localize(6646, "Learn More"))}](${updatedLink})` : `[${( localize(6646, "Learn More"))}](${updatedLink})`;
428
+ this.renderTextPlus(descriptionEl, descText, newStore);
429
+ } else {
430
+ descriptionEl.remove();
431
+ descriptionEl = undefined;
432
+ }
433
+ } else if (updatedLink) {
434
+ descriptionEl = collapsibleInner.insertBefore($("div.section-description"), detailEl ?? null);
435
+ const descText = updatedLinkDesc ? `${updatedLinkDesc} [${( localize(6646, "Learn More"))}](${updatedLink})` : `[${( localize(6646, "Learn More"))}](${updatedLink})`;
436
+ this.renderTextPlus(descriptionEl, descText, newStore);
437
+ }
438
+ }
439
+ }));
440
+ }
441
+ }
442
+ renderSetupSection() {
443
+ const newUser = isNewUser(this.chatEntitlementService);
444
+ const anonymousUser = this.chatEntitlementService.anonymous;
445
+ const disabled = this.chatEntitlementService.sentiment.disabled || this.chatEntitlementService.sentiment.untrusted;
446
+ const signedOut = this.chatEntitlementService.entitlement === ChatEntitlement.Unknown;
447
+ if (!(newUser || signedOut || disabled)) {
448
+ return;
449
+ }
450
+ this.element.appendChild($("hr"));
451
+ let descriptionText;
452
+ let descriptionClass = ".description";
453
+ if (newUser && anonymousUser) {
454
+ descriptionText = ( new MarkdownString(( localize(
455
+ 6647,
456
+ "By continuing with {0} Copilot, you agree to {1}'s [Terms]({2}) and [Privacy Statement]({3})",
457
+ defaultChat.provider.default.name,
458
+ defaultChat.provider.default.name,
459
+ defaultChat.termsStatementUrl,
460
+ defaultChat.privacyStatementUrl
461
+ )), {
462
+ isTrusted: true
463
+ }));
464
+ descriptionClass = `${descriptionClass}.terms`;
465
+ } else if (newUser) {
466
+ descriptionText = ( localize(6648, "Set up Copilot to use AI features."));
467
+ } else if (anonymousUser) {
468
+ descriptionText = ( localize(6649, "Sign in to enable more Copilot AI features."));
469
+ } else if (disabled) {
470
+ descriptionText = ( localize(6650, "Enable Copilot to use AI features."));
471
+ } else {
472
+ descriptionText = ( localize(6651, "Sign in to use Copilot AI features."));
473
+ }
474
+ let buttonLabel;
475
+ if (newUser) {
476
+ buttonLabel = ( localize(6652, "Use AI Features"));
477
+ } else if (anonymousUser) {
478
+ buttonLabel = ( localize(6653, "Enable more AI Features"));
479
+ } else if (disabled) {
480
+ buttonLabel = ( localize(6654, "Enable AI Features"));
481
+ } else {
482
+ buttonLabel = ( localize(6655, "Sign in to use AI Features"));
483
+ }
484
+ let commandId;
485
+ if (newUser && anonymousUser) {
486
+ commandId = "workbench.action.chat.triggerSetupAnonymousWithoutDialog";
487
+ } else {
488
+ commandId = "workbench.action.chat.triggerSetup";
489
+ }
490
+ if (typeof descriptionText === "string") {
491
+ this.element.appendChild($(`div${descriptionClass}`, undefined, descriptionText));
492
+ } else {
493
+ this.element.appendChild($(
494
+ `div${descriptionClass}`,
495
+ undefined,
496
+ this._store.add(this.markdownRendererService.render(descriptionText)).element
497
+ ));
498
+ }
499
+ const button = this._store.add(( new Button(this.element, {
500
+ ...defaultButtonStyles,
501
+ hoverDelegate: nativeHoverDelegate
502
+ })));
503
+ button.label = buttonLabel;
504
+ this._store.add(button.onDidClick(() => this.runCommandAndClose(commandId)));
505
+ }
506
+ renderInlineSuggestionsContent(container) {
399
507
  if (!this.options?.disableInlineSuggestionsSettings) {
400
- this.createSettings(container, this._store);
508
+ this.createSettings(container);
401
509
  }
402
510
  const providers = (!this.options?.disableModelSelection || !this.options?.disableProviderOptions) ? this.languageFeaturesService.inlineCompletionsProvider.allNoModel() : undefined;
403
511
  if (!this.options?.disableModelSelection && providers) {
@@ -407,23 +515,29 @@ let ChatStatusDashboard = class ChatStatusDashboard extends DomWidget {
407
515
  const currentModel = modelInfo.models.find(m => m.id === modelInfo.currentModelId);
408
516
  if (currentModel) {
409
517
  const modelContainer = container.appendChild($("div.model-selection"));
410
- modelContainer.appendChild($("span.model-text", undefined, ( localize(6407, "Model"))));
411
- const actionBar = modelContainer.appendChild($("div.model-action-bar"));
412
- const toolbar = this._store.add(( new ActionBar(actionBar, {
413
- hoverDelegate: nativeHoverDelegate
518
+ modelContainer.appendChild($("span.model-text", undefined, ( localize(6656, "Model"))));
519
+ const selectOptions = ( modelInfo.models.map(m => ({
520
+ text: m.name
414
521
  })));
415
- toolbar.push([toAction({
416
- id: "workbench.action.selectInlineCompletionsModel",
417
- label: currentModel.name,
418
- tooltip: ( localize(6408, "Select Model")),
419
- class: ThemeIcon.asClassName(Codicon.gear),
420
- run: async () => {
421
- await this.showModelPicker(provider);
522
+ const selectedIndex = modelInfo.models.findIndex(m => m.id === modelInfo.currentModelId);
523
+ const selectBox = this._store.add(( new SelectBox(
524
+ selectOptions,
525
+ Math.max(0, selectedIndex),
526
+ this.contextViewService,
527
+ defaultSelectBoxStyles,
528
+ {
529
+ ariaLabel: ( localize(6657, "Select Model")),
530
+ optionsAsChildren: true
422
531
  }
423
- })], {
424
- icon: false,
425
- label: true
426
- });
532
+ )));
533
+ const selectContainer = modelContainer.appendChild($("div.model-select-container"));
534
+ selectBox.render(selectContainer);
535
+ this._store.add(selectBox.onDidSelect(async e => {
536
+ const selectedModel = modelInfo.models[e.index];
537
+ if (selectedModel && selectedModel.id !== modelInfo.currentModelId && provider.setModelId) {
538
+ await provider.setModelId(selectedModel.id);
539
+ }
540
+ }));
427
541
  }
428
542
  }
429
543
  }
@@ -435,21 +549,28 @@ let ChatStatusDashboard = class ChatStatusDashboard extends DomWidget {
435
549
  if (currentValue) {
436
550
  const optionContainer = container.appendChild($("div.suggest-option-selection"));
437
551
  optionContainer.appendChild($("span.suggest-option-text", undefined, option.label));
438
- const actionBar = optionContainer.appendChild($("div.suggest-option-action-bar"));
439
- const toolbar = this._store.add(( new ActionBar(actionBar, {
440
- hoverDelegate: nativeHoverDelegate
552
+ const selectOptions = ( option.values.map(v => ({
553
+ text: v.label
441
554
  })));
442
- toolbar.push([toAction({
443
- id: `workbench.action.selectProviderOption.${option.id}`,
444
- label: currentValue.label,
445
- tooltip: ( localize(6409, "Select {0}", option.label)),
446
- run: async () => {
447
- await this.showProviderOptionPicker(provider, option);
555
+ const selectedIndex = option.values.findIndex(v => v.id === option.currentValueId);
556
+ const selectBox = this._store.add(( new SelectBox(
557
+ selectOptions,
558
+ Math.max(0, selectedIndex),
559
+ this.contextViewService,
560
+ defaultSelectBoxStyles,
561
+ {
562
+ ariaLabel: ( localize(6658, "Select {0}", option.label)),
563
+ optionsAsChildren: true
564
+ }
565
+ )));
566
+ const selectContainer = optionContainer.appendChild($("div.suggest-option-select-container"));
567
+ selectBox.render(selectContainer);
568
+ this._store.add(selectBox.onDidSelect(async e => {
569
+ const selectedValue = option.values[e.index];
570
+ if (selectedValue && selectedValue.id !== option.currentValueId && provider.setProviderOption) {
571
+ await provider.setProviderOption(option.id, selectedValue.id);
448
572
  }
449
- })], {
450
- icon: false,
451
- label: true
452
- });
573
+ }));
453
574
  }
454
575
  }
455
576
  }
@@ -457,7 +578,7 @@ let ChatStatusDashboard = class ChatStatusDashboard extends DomWidget {
457
578
  }
458
579
  if (!this.options?.disableCompletionsSnooze && this.canUseChat()) {
459
580
  const snooze = append(container, $("div.snooze-completions"));
460
- this.createCompletionsSnooze(snooze, ( localize(6410, "Snooze")), this._store);
581
+ this.createCompletionsSnooze(snooze, ( localize(6659, "Snooze")));
461
582
  }
462
583
  }
463
584
  canUseChat() {
@@ -473,7 +594,8 @@ let ChatStatusDashboard = class ChatStatusDashboard extends DomWidget {
473
594
  return true;
474
595
  }
475
596
  renderHeader(container, disposables, label, action) {
476
- const header = container.appendChild($("div.header", undefined, label ?? ""));
597
+ const header = container.appendChild($("div.header"));
598
+ header.appendChild($("span.header-label", undefined, label));
477
599
  if (action) {
478
600
  const toolbar = disposables.add(( new ActionBar(header, {
479
601
  hoverDelegate: nativeHoverDelegate
@@ -483,32 +605,7 @@ let ChatStatusDashboard = class ChatStatusDashboard extends DomWidget {
483
605
  label: false
484
606
  });
485
607
  }
486
- }
487
- renderContributedChatStatusItem(item) {
488
- const disposables = ( new DisposableStore());
489
- const itemElement = $("div.contribution");
490
- const headerLabel = typeof item.label === "string" ? item.label : item.label.label;
491
- const headerLink = typeof item.label === "string" ? undefined : item.label.link;
492
- this.renderHeader(itemElement, disposables, headerLabel, headerLink ? toAction({
493
- id: "workbench.action.openChatStatusItemLink",
494
- label: ( localize(6411, "Learn More")),
495
- tooltip: ( localize(6411, "Learn More")),
496
- class: ThemeIcon.asClassName(Codicon.linkExternal),
497
- run: () => this.runCommandAndClose(() => this.openerService.open(( URI.parse(headerLink))))
498
- }) : undefined);
499
- const itemBody = itemElement.appendChild($("div.body"));
500
- const description = itemBody.appendChild($("span.description"));
501
- this.renderTextPlus(description, item.description, disposables);
502
- if (item.detail) {
503
- const separator = itemBody.appendChild($("span.separator"));
504
- separator.textContent = "—";
505
- const detail = itemBody.appendChild($("span.detail-item"));
506
- this.renderTextPlus(detail, item.detail, disposables);
507
- }
508
- return {
509
- element: itemElement,
510
- disposables
511
- };
608
+ return header;
512
609
  }
513
610
  renderTextPlus(target, text, store) {
514
611
  for (const node of parseLinkedText(text).nodes) {
@@ -532,7 +629,19 @@ let ChatStatusDashboard = class ChatStatusDashboard extends DomWidget {
532
629
  }
533
630
  this.hoverService.hideHover(true);
534
631
  }
535
- createQuotaIndicator(container, disposables, quota, label, supportsOverage, resetLabel) {
632
+ formatResetAtLabel(resetAt) {
633
+ if (!resetAt) {
634
+ return undefined;
635
+ }
636
+ const resetDate = ( new Date(resetAt * 1000));
637
+ return localize(
638
+ 6635,
639
+ "Resets {0} at {1}",
640
+ this.dateFormatter.value.format(resetDate),
641
+ this.timeFormatter.value.format(resetDate)
642
+ );
643
+ }
644
+ createQuotaIndicator(container, quota, label, resetLabel) {
536
645
  const quotaValue = $("span.quota-value");
537
646
  const quotaValueSuffix = $("span.quota-value-suffix");
538
647
  const quotaBit = $("div.quota-bit");
@@ -540,120 +649,172 @@ let ChatStatusDashboard = class ChatStatusDashboard extends DomWidget {
540
649
  if (resetLabel) {
541
650
  resetValue.textContent = resetLabel;
542
651
  }
543
- const quotaIndicator = container.appendChild($(
652
+ const quotaPercentage = $("div.quota-percentage", undefined, quotaValue, quotaValueSuffix);
653
+ quotaPercentage.tabIndex = 0;
654
+ container.appendChild($(
544
655
  "div.quota-indicator",
545
656
  undefined,
546
657
  $("div.quota-title", undefined, label),
547
- $(
548
- "div.quota-details",
549
- undefined,
550
- $("div.quota-percentage", undefined, quotaValue, quotaValueSuffix),
551
- resetValue
552
- ),
658
+ $("div.quota-details", undefined, quotaPercentage, resetValue),
553
659
  $("div.quota-bar", undefined, quotaBit)
554
660
  ));
555
- const calloutIcon = $("span.callout-icon");
556
- const calloutText = $("span.callout-text");
557
- const quotaCallout = container.appendChild($("div.quota-callout", undefined, calloutIcon, calloutText));
558
- quotaCallout.style.display = "none";
559
- if (supportsOverage && (this.chatEntitlementService.entitlement === ChatEntitlement.EDU || this.chatEntitlementService.entitlement === ChatEntitlement.Pro || this.chatEntitlementService.entitlement === ChatEntitlement.ProPlus)) {
560
- const manageOverageButton = disposables.add(( new Button(container, {
561
- ...defaultButtonStyles,
562
- secondary: true,
563
- hoverDelegate: nativeHoverDelegate
564
- })));
565
- manageOverageButton.label = ( localize(6412, "Manage paid premium requests"));
566
- disposables.add(
567
- manageOverageButton.onDidClick(() => this.runCommandAndClose(() => this.openerService.open(( URI.parse(defaultChat.manageOverageUrl)))))
568
- );
569
- }
570
- const isEnterpriseUser = this.chatEntitlementService.entitlement === ChatEntitlement.Enterprise || this.chatEntitlementService.entitlement === ChatEntitlement.Business;
661
+ let currentQuota = quota;
662
+ let isHovered = false;
663
+ const showPercentage = () => {
664
+ if (typeof currentQuota === "string") {
665
+ quotaValue.textContent = currentQuota;
666
+ quotaValueSuffix.textContent = "";
667
+ } else {
668
+ const usedPercentage = Math.max(0, 100 - currentQuota.percentRemaining);
669
+ quotaValue.textContent = ( localize(
670
+ 6660,
671
+ "{0}%",
672
+ this.quotaPercentageFormatter.value.format(Math.floor(usedPercentage))
673
+ ));
674
+ quotaValueSuffix.textContent = ` ${( localize(6661, "used"))}`;
675
+ }
676
+ };
677
+ const showCredits = () => {
678
+ if (typeof currentQuota !== "string" && currentQuota.entitlement) {
679
+ const total = currentQuota.entitlement;
680
+ const used = total * (100 - currentQuota.percentRemaining) / 100;
681
+ const usedFormatted = this.quotaCreditsFormatter.value.format(used);
682
+ const totalFormatted = this.quotaCreditsFormatter.value.format(total);
683
+ quotaValue.textContent = ( localize(6662, "{0} / {1}", usedFormatted, totalFormatted));
684
+ quotaValueSuffix.textContent = ` ${( localize(6661, "used"))}`;
685
+ }
686
+ };
687
+ this._store.add(addDisposableListener(quotaPercentage, EventType.MOUSE_ENTER, () => {
688
+ isHovered = true;
689
+ showCredits();
690
+ }));
691
+ this._store.add(addDisposableListener(quotaPercentage, EventType.MOUSE_LEAVE, () => {
692
+ isHovered = false;
693
+ showPercentage();
694
+ }));
695
+ this._store.add(addDisposableListener(quotaPercentage, EventType.FOCUS, () => {
696
+ isHovered = true;
697
+ showCredits();
698
+ }));
699
+ this._store.add(addDisposableListener(quotaPercentage, EventType.BLUR, () => {
700
+ isHovered = false;
701
+ showPercentage();
702
+ }));
571
703
  const update = quota => {
572
- quotaIndicator.classList.remove("error");
573
- quotaIndicator.classList.remove("warning");
574
- quotaIndicator.classList.remove("dimmed");
575
- quotaIndicator.classList.remove("info");
704
+ currentQuota = quota;
576
705
  let usedPercentage;
577
706
  if (typeof quota === "string") {
578
707
  usedPercentage = 0;
579
708
  } else {
580
709
  usedPercentage = Math.max(0, 100 - quota.percentRemaining);
581
710
  }
582
- if (typeof quota === "string") {
583
- quotaValue.textContent = quota;
584
- quotaValueSuffix.textContent = "";
585
- } else if (quota.overageCount) {
586
- quotaValue.textContent = `+${this.quotaOverageFormatter.value.format(quota.overageCount)}`;
587
- quotaValueSuffix.textContent = ` ${( localize(6413, "requests"))}`;
711
+ if (isHovered) {
712
+ showCredits();
588
713
  } else {
589
- quotaValue.textContent = ( localize(6414, "{0}%", this.quotaPercentageFormatter.value.format(usedPercentage)));
590
- quotaValueSuffix.textContent = ` ${( localize(6415, "used"))}`;
714
+ showPercentage();
591
715
  }
592
716
  quotaBit.style.width = `${usedPercentage}%`;
593
- const overageEnabled = supportsOverage && typeof quota !== "string" && quota?.overageEnabled;
594
- if (usedPercentage >= 100 && overageEnabled) {
595
- quotaIndicator.classList.add("dimmed");
717
+ };
718
+ update(quota);
719
+ return update;
720
+ }
721
+ createGlobalQuotaCallout(container) {
722
+ const calloutIcon = $("span.callout-icon");
723
+ const calloutText = $("span.callout-text");
724
+ const quotaCallout = container.appendChild($("div.quota-callout", undefined, calloutIcon, calloutText));
725
+ quotaCallout.style.display = "none";
726
+ const update = () => {
727
+ const quotas = this.chatEntitlementService.quotas;
728
+ const additionalUsageEnabled = quotas.additionalUsageEnabled ?? false;
729
+ const isEnterpriseUser = this.chatEntitlementService.entitlement === ChatEntitlement.Enterprise || this.chatEntitlementService.entitlement === ChatEntitlement.Business;
730
+ const isUsageBasedBilling = quotas.usageBasedBilling === true;
731
+ const allQuotas = [];
732
+ if (quotas.chat && !quotas.chat.unlimited) {
733
+ allQuotas.push(quotas.chat);
734
+ }
735
+ if (quotas.premiumChat && !quotas.premiumChat.unlimited) {
736
+ allQuotas.push(quotas.premiumChat);
737
+ }
738
+ if (quotas.completions && !quotas.completions.unlimited) {
739
+ allQuotas.push(quotas.completions);
740
+ }
741
+ const maxUsedPercentage = allQuotas.length > 0 ? Math.max(...( allQuotas.map(q => Math.max(0, 100 - q.percentRemaining)))) : 0;
742
+ if (maxUsedPercentage >= 100 && additionalUsageEnabled) {
596
743
  quotaCallout.style.display = "";
597
744
  quotaCallout.className = "quota-callout info";
598
745
  calloutIcon.className = `callout-icon ${ThemeIcon.asClassName(Codicon.info)}`;
599
- calloutText.textContent = ( localize(6416, "Using Overage Budget until limits reset."));
600
- } else if (usedPercentage >= 75 && overageEnabled) {
601
- quotaIndicator.classList.add("info");
746
+ calloutText.textContent = isUsageBasedBilling ? ( localize(
747
+ 6663,
748
+ "Additional spend is configured. Usage will continue until limits reset."
749
+ )) : ( localize(
750
+ 6664,
751
+ "Premium request budget is configured. Usage will continue until limits reset."
752
+ ));
753
+ } else if (maxUsedPercentage >= 75 && maxUsedPercentage < 100 && additionalUsageEnabled) {
602
754
  quotaCallout.style.display = "";
603
755
  quotaCallout.className = "quota-callout info";
604
756
  calloutIcon.className = `callout-icon ${ThemeIcon.asClassName(Codicon.info)}`;
605
- calloutText.textContent = ( localize(6417, "Once the limit is reached, your Overage Budget will be used."));
606
- } else if (usedPercentage >= 100 && !overageEnabled) {
607
- quotaIndicator.classList.add("dimmed");
757
+ calloutText.textContent = isUsageBasedBilling ? ( localize(6665, "Once the limit is reached, additional spend will be used.")) : ( localize(6666, "Once the limit is reached, premium request budget will be used."));
758
+ } else if (maxUsedPercentage >= 100 && !additionalUsageEnabled) {
608
759
  quotaCallout.style.display = "";
609
- quotaCallout.className = "quota-callout error";
610
- calloutIcon.className = `callout-icon ${ThemeIcon.asClassName(Codicon.error)}`;
760
+ quotaCallout.className = "quota-callout info";
761
+ calloutIcon.className = `callout-icon ${ThemeIcon.asClassName(Codicon.info)}`;
611
762
  calloutText.textContent = isEnterpriseUser ? ( localize(
612
- 6418,
763
+ 6667,
613
764
  "Copilot is paused until the limit resets. Contact your administrator for more information."
614
- )) : ( localize(6419, "Copilot is paused until the limit resets."));
615
- } else if (usedPercentage >= 75 && !overageEnabled) {
616
- quotaIndicator.classList.add("warning");
765
+ )) : ( localize(6668, "Copilot is paused until the limit resets."));
766
+ } else if (maxUsedPercentage >= 75 && !additionalUsageEnabled) {
617
767
  quotaCallout.style.display = "";
618
- quotaCallout.className = "quota-callout warning";
619
- calloutIcon.className = `callout-icon ${ThemeIcon.asClassName(Codicon.warning)}`;
768
+ quotaCallout.className = "quota-callout info";
769
+ calloutIcon.className = `callout-icon ${ThemeIcon.asClassName(Codicon.info)}`;
620
770
  calloutText.textContent = isEnterpriseUser ? ( localize(
621
- 6420,
771
+ 6669,
622
772
  "Copilot will pause when the limit is reached. Contact your administrator for more information."
623
- )) : ( localize(6421, "Copilot will pause when the limit is reached."));
773
+ )) : ( localize(6670, "Copilot will pause when the limit is reached."));
624
774
  } else {
625
775
  quotaCallout.style.display = "none";
626
776
  }
777
+ return {
778
+ calloutVisible: quotaCallout.style.display !== "none",
779
+ additionalUsageEnabled
780
+ };
627
781
  };
628
- update(quota);
782
+ update();
629
783
  return update;
630
784
  }
631
- createSettings(container, disposables) {
785
+ createSettings(container) {
632
786
  const modeId = this.editorService.activeTextEditorLanguageId;
633
787
  const settings = container.appendChild($("div.settings"));
634
788
  {
635
789
  const globalSetting = append(settings, $("div.setting"));
636
- this.createInlineSuggestionsSetting(globalSetting, ( localize(6422, "All files")), "*", disposables);
790
+ this.createInlineSuggestionsSetting(globalSetting, ( localize(6671, "Ghost text suggestions")), "*");
791
+ const overriddenHint = globalSetting.appendChild($("span.setting-overridden"));
792
+ const updateOverriddenHint = () => {
793
+ const obj = this.configurationService.getValue(defaultChat.completionsEnablementSetting);
794
+ const hasOverride = modeId && isObject(obj) && typeof obj[modeId] !== "undefined" && Boolean(obj[modeId]) !== Boolean(obj["*"]);
795
+ overriddenHint.textContent = hasOverride ? ( localize(6672, "(overridden)")) : "";
796
+ };
797
+ updateOverriddenHint();
637
798
  if (modeId) {
638
799
  const languageSetting = append(settings, $("div.setting"));
639
- this.createInlineSuggestionsSetting(languageSetting, ( localize(6423, "{0}", this.languageService.getLanguageName(modeId) ?? modeId)), modeId, disposables);
800
+ const languageName = this.languageService.getLanguageName(modeId) ?? modeId;
801
+ this.createTriStateLanguageSetting(languageSetting, ( localize(6673, "Ghost text suggestions for {0}", languageName)), modeId, updateOverriddenHint);
640
802
  }
641
803
  }
642
804
  {
643
805
  const setting = append(settings, $("div.setting"));
644
- this.createNextEditSuggestionsSetting(setting, ( localize(6424, "Next edit suggestions")), this.getCompletionsSettingAccessor(modeId), disposables);
806
+ this.createNextEditSuggestionsSetting(setting, ( localize(6674, "Next edit suggestions")), this.getCompletionsSettingAccessor(modeId));
645
807
  }
646
- return settings;
647
808
  }
648
- createSetting(container, settingIdsToReEvaluate, label, accessor, disposables) {
649
- const checkbox = disposables.add(( new Checkbox(label, Boolean(accessor.readSetting()), {
809
+ createSetting(container, settingIdsToReEvaluate, label, accessor) {
810
+ const checkbox = this._store.add(( new Checkbox(label, Boolean(accessor.readSetting()), {
650
811
  ...defaultCheckboxStyles
651
812
  })));
652
813
  container.appendChild(checkbox.domNode);
653
814
  const settingLabel = append(container, $("span.setting-label", undefined, label));
654
- disposables.add(Gesture.addTarget(settingLabel));
815
+ this._store.add(Gesture.addTarget(settingLabel));
655
816
  [EventType.CLICK, EventType$1.Tap].forEach(eventType => {
656
- disposables.add(addDisposableListener(settingLabel, eventType, e => {
817
+ this._store.add(addDisposableListener(settingLabel, eventType, e => {
657
818
  if (checkbox?.enabled) {
658
819
  EventHelper.stop(e, true);
659
820
  checkbox.checked = !checkbox.checked;
@@ -662,10 +823,10 @@ let ChatStatusDashboard = class ChatStatusDashboard extends DomWidget {
662
823
  }
663
824
  }));
664
825
  });
665
- disposables.add(checkbox.onChange(() => {
826
+ this._store.add(checkbox.onChange(() => {
666
827
  accessor.writeSetting(checkbox.checked);
667
828
  }));
668
- disposables.add(this.configurationService.onDidChangeConfiguration(e => {
829
+ this._store.add(this.configurationService.onDidChangeConfiguration(e => {
669
830
  if (( settingIdsToReEvaluate.some(id => e.affectsConfiguration(id)))) {
670
831
  checkbox.checked = Boolean(accessor.readSetting());
671
832
  }
@@ -677,15 +838,101 @@ let ChatStatusDashboard = class ChatStatusDashboard extends DomWidget {
677
838
  }
678
839
  return checkbox;
679
840
  }
680
- createInlineSuggestionsSetting(container, label, modeId, disposables) {
841
+ createInlineSuggestionsSetting(container, label, modeId) {
681
842
  this.createSetting(
682
843
  container,
683
844
  [defaultChat.completionsEnablementSetting],
684
845
  label,
685
- this.getCompletionsSettingAccessor(modeId),
686
- disposables
846
+ this.getCompletionsSettingAccessor(modeId)
687
847
  );
688
848
  }
849
+ createTriStateLanguageSetting(container, label, modeId, onStateChange) {
850
+ const settingId = defaultChat.completionsEnablementSetting;
851
+ const getState = () => {
852
+ const obj = this.configurationService.getValue(settingId);
853
+ if (!isObject(obj) || typeof obj[modeId] === "undefined") {
854
+ return "mixed";
855
+ }
856
+ return Boolean(obj[modeId]);
857
+ };
858
+ const checkbox = this._store.add(( new TriStateCheckbox(label, getState(), {
859
+ ...defaultCheckboxStyles
860
+ })));
861
+ container.appendChild(checkbox.domNode);
862
+ const settingLabel = append(container, $("span.setting-label", undefined, label));
863
+ this._store.add(Gesture.addTarget(settingLabel));
864
+ const cycleState = () => {
865
+ const current = checkbox.checked;
866
+ if (current === true) {
867
+ checkbox.checked = false;
868
+ } else if (current === false) {
869
+ checkbox.checked = "mixed";
870
+ } else {
871
+ checkbox.checked = true;
872
+ }
873
+ };
874
+ const writeState = state => {
875
+ let result = this.configurationService.getValue(settingId);
876
+ if (!isObject(result)) {
877
+ result = Object.create(null);
878
+ }
879
+ if (state === "mixed") {
880
+ const {
881
+ [modeId]: _,
882
+ ...rest
883
+ } = result;
884
+ const inheritedEnablement = typeof rest["*"] === "boolean" ? (rest["*"] ? "enabled" : "disabled") : "enabled";
885
+ this.telemetryService.publicLog2("chatStatus.settingChanged", {
886
+ settingIdentifier: settingId,
887
+ settingMode: modeId,
888
+ settingEnablement: inheritedEnablement
889
+ });
890
+ this.configurationService.updateValue(settingId, rest);
891
+ } else {
892
+ this.telemetryService.publicLog2("chatStatus.settingChanged", {
893
+ settingIdentifier: settingId,
894
+ settingMode: modeId,
895
+ settingEnablement: state ? "enabled" : "disabled"
896
+ });
897
+ this.configurationService.updateValue(settingId, {
898
+ ...result,
899
+ [modeId]: state
900
+ });
901
+ }
902
+ onStateChange();
903
+ };
904
+ let previousState = getState();
905
+ const cycleAndWrite = () => {
906
+ cycleState();
907
+ previousState = checkbox.checked;
908
+ writeState(checkbox.checked);
909
+ };
910
+ [EventType.CLICK, EventType$1.Tap].forEach(eventType => {
911
+ this._store.add(addDisposableListener(settingLabel, eventType, e => {
912
+ if (checkbox?.enabled) {
913
+ EventHelper.stop(e, true);
914
+ cycleAndWrite();
915
+ checkbox.focus();
916
+ }
917
+ }));
918
+ });
919
+ this._store.add(checkbox.onChange(() => {
920
+ checkbox.checked = previousState;
921
+ cycleAndWrite();
922
+ }));
923
+ this._store.add(this.configurationService.onDidChangeConfiguration(e => {
924
+ if (e.affectsConfiguration(settingId)) {
925
+ checkbox.checked = getState();
926
+ previousState = checkbox.checked;
927
+ onStateChange();
928
+ }
929
+ }));
930
+ if (!this.canUseChat()) {
931
+ container.classList.add("disabled");
932
+ checkbox.disable();
933
+ checkbox.checked = false;
934
+ }
935
+ }
689
936
  getCompletionsSettingAccessor(modeId = "*") {
690
937
  const settingId = defaultChat.completionsEnablementSetting;
691
938
  return {
@@ -707,7 +954,7 @@ let ChatStatusDashboard = class ChatStatusDashboard extends DomWidget {
707
954
  }
708
955
  };
709
956
  }
710
- createNextEditSuggestionsSetting(container, label, completionsSettingAccessor, disposables) {
957
+ createNextEditSuggestionsSetting(container, label, completionsSettingAccessor) {
711
958
  const nesSettingId = defaultChat.nextEditSuggestionsSetting;
712
959
  const completionsSettingId = defaultChat.completionsEnablementSetting;
713
960
  const resource = EditorResourceAccessor.getOriginalUri(this.editorService.activeEditor, {
@@ -722,12 +969,12 @@ let ChatStatusDashboard = class ChatStatusDashboard extends DomWidget {
722
969
  });
723
970
  return this.textResourceConfigurationService.updateValue(resource, nesSettingId, value);
724
971
  }
725
- }, disposables);
972
+ });
726
973
  if (!completionsSettingAccessor.readSetting()) {
727
974
  container.classList.add("disabled");
728
975
  checkbox.disable();
729
976
  }
730
- disposables.add(this.configurationService.onDidChangeConfiguration(e => {
977
+ this._store.add(this.configurationService.onDidChangeConfiguration(e => {
731
978
  if (e.affectsConfiguration(completionsSettingId)) {
732
979
  if (completionsSettingAccessor.readSetting() && this.canUseChat()) {
733
980
  checkbox.enable();
@@ -739,13 +986,13 @@ let ChatStatusDashboard = class ChatStatusDashboard extends DomWidget {
739
986
  }
740
987
  }));
741
988
  }
742
- createCompletionsSnooze(container, label, disposables) {
989
+ createCompletionsSnooze(container, label) {
743
990
  const isEnabled = () => {
744
991
  const completionsEnabled = isCompletionsEnabled(this.configurationService);
745
992
  const completionsEnabledActiveLanguage = isCompletionsEnabled(this.configurationService, this.editorService.activeTextEditorLanguageId);
746
993
  return completionsEnabled || completionsEnabledActiveLanguage;
747
994
  };
748
- const button = disposables.add(( new Button(container, {
995
+ const button = this._store.add(( new Button(container, {
749
996
  disabled: !isEnabled(),
750
997
  ...defaultButtonStyles,
751
998
  hoverDelegate: nativeHoverDelegate,
@@ -753,12 +1000,12 @@ let ChatStatusDashboard = class ChatStatusDashboard extends DomWidget {
753
1000
  })));
754
1001
  const timerDisplay = container.appendChild($("span.snooze-label"));
755
1002
  const actionBar = container.appendChild($("div.snooze-action-bar"));
756
- const toolbar = disposables.add(( new ActionBar(actionBar, {
1003
+ const toolbar = this._store.add(( new ActionBar(actionBar, {
757
1004
  hoverDelegate: nativeHoverDelegate
758
1005
  })));
759
1006
  const cancelAction = toAction({
760
1007
  id: "workbench.action.cancelSnoozeStatusBarLink",
761
- label: ( localize(6425, "Cancel Snooze")),
1008
+ label: ( localize(6675, "Cancel Snooze")),
762
1009
  run: () => this.inlineCompletionsService.cancelSnooze(),
763
1010
  class: ThemeIcon.asClassName(Codicon.stopCircle)
764
1011
  });
@@ -767,26 +1014,26 @@ let ChatStatusDashboard = class ChatStatusDashboard extends DomWidget {
767
1014
  toolbar.clear();
768
1015
  const timeLeftMs = this.inlineCompletionsService.snoozeTimeLeft;
769
1016
  if (!isEnabled || timeLeftMs <= 0) {
770
- timerDisplay.textContent = ( localize(6426, "Hide suggestions for 5 min"));
1017
+ timerDisplay.textContent = ( localize(6676, "Hide suggestions for 5 min"));
771
1018
  timerDisplay.title = "";
772
1019
  button.label = label;
773
- button.setTitle(( localize(6427, "Hide inline suggestions for 5 min")));
1020
+ button.setTitle(( localize(6677, "Hide inline suggestions for 5 min")));
774
1021
  return true;
775
1022
  }
776
1023
  const timeLeftSeconds = Math.ceil(timeLeftMs / 1000);
777
1024
  const minutes = Math.floor(timeLeftSeconds / 60);
778
1025
  const seconds = timeLeftSeconds % 60;
779
- timerDisplay.textContent = `${minutes}:${seconds < 10 ? "0" : ""}${seconds} ${( localize(6428, "remaining"))}`;
780
- timerDisplay.title = ( localize(6429, "Inline suggestions are hidden for the remaining duration"));
781
- button.label = ( localize(6430, "+5 min"));
782
- button.setTitle(( localize(6431, "Snooze additional 5 min")));
1026
+ timerDisplay.textContent = `${minutes}:${seconds < 10 ? "0" : ""}${seconds} ${( localize(6678, "remaining"))}`;
1027
+ timerDisplay.title = ( localize(6679, "Inline suggestions are hidden for the remaining duration"));
1028
+ button.label = ( localize(6680, "+5 min"));
1029
+ button.setTitle(( localize(6681, "Snooze additional 5 min")));
783
1030
  toolbar.push([cancelAction], {
784
1031
  icon: true,
785
1032
  label: false
786
1033
  });
787
1034
  return false;
788
1035
  };
789
- const timerDisposables = disposables.add(( new DisposableStore()));
1036
+ const timerDisposables = this._store.add(( new DisposableStore()));
790
1037
  function updateIntervalTimer() {
791
1038
  timerDisposables.clear();
792
1039
  const enabled = isEnabled();
@@ -798,64 +1045,21 @@ let ChatStatusDashboard = class ChatStatusDashboard extends DomWidget {
798
1045
  );
799
1046
  }
800
1047
  updateIntervalTimer();
801
- disposables.add(button.onDidClick(() => {
1048
+ this._store.add(button.onDidClick(() => {
802
1049
  this.inlineCompletionsService.snooze();
803
1050
  update(isEnabled());
804
1051
  }));
805
- disposables.add(this.configurationService.onDidChangeConfiguration(e => {
1052
+ this._store.add(this.configurationService.onDidChangeConfiguration(e => {
806
1053
  if (e.affectsConfiguration(defaultChat.completionsEnablementSetting)) {
807
1054
  button.enabled = isEnabled();
808
1055
  }
809
1056
  updateIntervalTimer();
810
1057
  }));
811
- disposables.add(this.inlineCompletionsService.onDidChangeIsSnoozing(e => {
1058
+ this._store.add(this.inlineCompletionsService.onDidChangeIsSnoozing(() => {
812
1059
  updateIntervalTimer();
813
1060
  }));
814
1061
  }
815
- async showModelPicker(provider) {
816
- if (!provider.modelInfo || !provider.setModelId) {
817
- return;
818
- }
819
- const modelInfo = provider.modelInfo;
820
- const items = ( modelInfo.models.map(model => ({
821
- id: model.id,
822
- label: model.name,
823
- description: model.id === modelInfo.currentModelId ? ( localize(6432, "Currently selected")) : undefined,
824
- picked: model.id === modelInfo.currentModelId
825
- })));
826
- const selected = await this.quickInputService.pick(items, {
827
- placeHolder: ( localize(
828
- 6433,
829
- "Select a model for {0}",
830
- provider.displayName || "inline completions"
831
- )),
832
- canPickMany: false
833
- });
834
- if (selected && selected.id && selected.id !== modelInfo.currentModelId) {
835
- await provider.setModelId(selected.id);
836
- }
837
- this.hoverService.hideHover(true);
838
- }
839
- async showProviderOptionPicker(provider, option) {
840
- if (!provider.setProviderOption) {
841
- return;
842
- }
843
- const items = ( option.values.map(value => ({
844
- id: value.id,
845
- label: value.label,
846
- description: value.id === option.currentValueId ? ( localize(6434, "Currently selected")) : undefined,
847
- picked: value.id === option.currentValueId
848
- })));
849
- const selected = await this.quickInputService.pick(items, {
850
- placeHolder: ( localize(6435, "Select {0}", option.label)),
851
- canPickMany: false
852
- });
853
- if (selected && selected.id && selected.id !== option.currentValueId) {
854
- await provider.setProviderOption(option.id, selected.id);
855
- }
856
- this.hoverService.hideHover(true);
857
- }
858
1062
  };
859
- ChatStatusDashboard = ( __decorate([( __param(1, IChatEntitlementService)), ( __param(2, IChatStatusItemService)), ( __param(3, ICommandService)), ( __param(4, IConfigurationService)), ( __param(5, IEditorService)), ( __param(6, IHoverService)), ( __param(7, ILanguageService)), ( __param(8, IOpenerService)), ( __param(9, ITelemetryService)), ( __param(10, ITextResourceConfigurationService)), ( __param(11, IInlineCompletionsService)), ( __param(12, IMarkdownRendererService)), ( __param(13, ILanguageFeaturesService)), ( __param(14, IQuickInputService))], ChatStatusDashboard));
1063
+ ChatStatusDashboard = ChatStatusDashboard_1 = ( __decorate([( __param(1, IChatEntitlementService)), ( __param(2, IChatStatusItemService)), ( __param(3, ICommandService)), ( __param(4, IConfigurationService)), ( __param(5, IEditorService)), ( __param(6, IHoverService)), ( __param(7, ILanguageService)), ( __param(8, IOpenerService)), ( __param(9, ITelemetryService)), ( __param(10, ITextResourceConfigurationService)), ( __param(11, IInlineCompletionsService)), ( __param(12, IMarkdownRendererService)), ( __param(13, ILanguageFeaturesService)), ( __param(14, IContextViewService)), ( __param(15, IStorageService))], ChatStatusDashboard));
860
1064
 
861
1065
  export { ChatStatusDashboard };