@codingame/monaco-vscode-chat-service-override 23.3.0 → 24.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (273) hide show
  1. package/index.js +13 -10
  2. package/package.json +5 -41
  3. package/vscode/src/vs/platform/domWidget/browser/domWidget.d.ts +52 -0
  4. package/vscode/src/vs/platform/domWidget/browser/domWidget.js +53 -0
  5. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.js +10 -10
  6. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +61 -50
  7. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAgentRecommendationActions.d.ts +18 -0
  8. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAgentRecommendationActions.js +152 -0
  9. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.d.ts +2 -2
  10. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +14 -14
  11. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +37 -28
  12. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +9 -9
  13. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +2 -2
  14. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +4 -4
  15. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatGettingStarted.d.ts +3 -5
  16. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatGettingStarted.js +7 -11
  17. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +10 -10
  18. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatLanguageModelActions.js +12 -14
  19. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +21 -18
  20. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatNewActions.js +27 -18
  21. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPromptNavigationActions.js +4 -4
  22. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.d.ts +1 -1
  23. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +11 -11
  24. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatSessionActions.d.ts +6 -27
  25. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatSessionActions.js +44 -208
  26. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.js +17 -17
  27. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.js +17 -17
  28. package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.d.ts +1 -1
  29. package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +23 -24
  30. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.d.ts +1 -0
  31. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.js +140 -0
  32. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.d.ts +85 -0
  33. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.js +358 -0
  34. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.d.ts +55 -0
  35. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.js +222 -0
  36. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.d.ts +37 -0
  37. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.js +241 -0
  38. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.d.ts +13 -0
  39. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.js +27 -0
  40. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsView.d.ts +11 -19
  41. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsView.js +67 -230
  42. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.d.ts +65 -33
  43. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +186 -62
  44. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/localAgentSessionsProvider.d.ts +23 -0
  45. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/localAgentSessionsProvider.js +140 -0
  46. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentsessionsview.css +2 -7
  47. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentsessionsviewer.css +115 -29
  48. package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +389 -166
  49. package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.d.ts +9 -6
  50. package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.js +22 -16
  51. package/vscode/src/vs/workbench/contrib/chat/browser/chatAttachmentResolveService.d.ts +1 -1
  52. package/vscode/src/vs/workbench/contrib/chat/browser/chatAttachmentResolveService.js +8 -8
  53. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMarkdownAnchorService.d.ts +1 -1
  54. package/vscode/src/vs/workbench/contrib/chat/browser/chatContextService.d.ts +10 -3
  55. package/vscode/src/vs/workbench/contrib/chat/browser/chatContextService.js +63 -3
  56. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCheckpointTimeline.d.ts +7 -3
  57. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCheckpointTimelineImpl.d.ts +14 -5
  58. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCheckpointTimelineImpl.js +173 -32
  59. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.d.ts +1 -0
  60. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +66 -17
  61. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +32 -29
  62. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +12 -12
  63. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.d.ts +4 -2
  64. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +9 -6
  65. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.d.ts +2 -2
  66. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +6 -4
  67. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.d.ts +4 -4
  68. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +8 -18
  69. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingOperations.d.ts +1 -0
  70. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingOperations.js +12 -1
  71. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.d.ts +5 -6
  72. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +15 -24
  73. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.d.ts +13 -11
  74. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +66 -50
  75. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSessionStorage.d.ts +3 -2
  76. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSessionStorage.js +6 -5
  77. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelChangeService.d.ts +3 -1
  78. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelChangeService.js +7 -0
  79. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelContentProviders.d.ts +2 -2
  80. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelContentProviders.js +6 -7
  81. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookSnapshot.d.ts +3 -3
  82. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookSnapshot.js +4 -4
  83. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookCellEntry.d.ts +2 -2
  84. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookCellEntry.js +1 -1
  85. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.d.ts +1 -1
  86. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +15 -4
  87. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/overlayToolbarDecorator.d.ts +1 -1
  88. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/overlayToolbarDecorator.js +3 -4
  89. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/simpleBrowserEditorOverlay.js +30 -37
  90. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.d.ts +13 -10
  91. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.js +23 -32
  92. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.js +8 -9
  93. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditor.d.ts +1 -1
  94. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditor.js +20 -19
  95. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.js +4 -4
  96. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.d.ts +47 -15
  97. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.js +270 -143
  98. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.d.ts +3 -2
  99. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.js +310 -170
  100. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatUsageWidget.js +10 -10
  101. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/media/chatModelsWidget.css +12 -2
  102. package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.d.ts +1 -1
  103. package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +4 -4
  104. package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +42 -42
  105. package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.d.ts +3 -1
  106. package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.js +35 -25
  107. package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.d.ts +1 -1
  108. package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.js +4 -4
  109. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/view/chatSessionsView.d.ts +1 -4
  110. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/view/chatSessionsView.js +22 -26
  111. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/view/sessionsTreeRenderer.d.ts +18 -14
  112. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/view/sessionsTreeRenderer.js +80 -72
  113. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/view/sessionsViewPane.d.ts +2 -8
  114. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/view/sessionsViewPane.js +48 -77
  115. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions.contribution.d.ts +16 -17
  116. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions.contribution.js +257 -77
  117. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetup.d.ts +55 -0
  118. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetup.js +34 -0
  119. package/vscode/src/vs/workbench/contrib/chat/browser/{chatSetup.d.ts → chatSetup/chatSetupContributions.d.ts} +4 -11
  120. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.js +622 -0
  121. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.d.ts +53 -0
  122. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.js +359 -0
  123. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.d.ts +89 -0
  124. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.js +667 -0
  125. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.d.ts +37 -0
  126. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.js +260 -0
  127. package/vscode/src/vs/workbench/contrib/chat/browser/{media → chatSetup/media}/chatSetup.css +4 -6
  128. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatus.d.ts +4 -0
  129. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatus.js +21 -0
  130. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.d.ts +55 -0
  131. package/vscode/src/vs/workbench/contrib/chat/browser/{chatStatus.js → chatStatus/chatStatusDashboard.js} +193 -325
  132. package/vscode/src/vs/workbench/contrib/chat/browser/{chatStatus.d.ts → chatStatus/chatStatusEntry.d.ts} +1 -1
  133. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.js +190 -0
  134. package/vscode/src/vs/workbench/contrib/chat/browser/{chatStatusItemService.d.ts → chatStatus/chatStatusItemService.d.ts} +1 -1
  135. package/vscode/src/vs/workbench/contrib/chat/browser/{media → chatStatus/media}/chatStatus.css +22 -1
  136. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatusWidget.d.ts +25 -0
  137. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatusWidget.js +108 -0
  138. package/vscode/src/vs/workbench/contrib/chat/browser/chatTerminalOutputAccessibleView.d.ts +10 -0
  139. package/vscode/src/vs/workbench/contrib/chat/browser/chatTerminalOutputAccessibleView.js +34 -0
  140. package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.js +1 -1
  141. package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.d.ts +57 -18
  142. package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.js +478 -146
  143. package/vscode/src/vs/workbench/contrib/chat/browser/chatViewTitleControl.d.ts +43 -0
  144. package/vscode/src/vs/workbench/contrib/chat/browser/chatViewTitleControl.js +204 -0
  145. package/vscode/src/vs/workbench/contrib/chat/browser/chatWidgetService.d.ts +44 -0
  146. package/vscode/src/vs/workbench/contrib/chat/browser/chatWidgetService.js +187 -0
  147. package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockContextProviderService.d.ts +1 -1
  148. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.js +108 -62
  149. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorHover.d.ts +1 -1
  150. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorHover.js +3 -3
  151. package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsConfirmationService.d.ts +1 -1
  152. package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsConfirmationService.js +37 -32
  153. package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.d.ts +37 -20
  154. package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.js +232 -97
  155. package/vscode/src/vs/workbench/contrib/chat/browser/media/chatStatusWidget.css +57 -0
  156. package/vscode/src/vs/workbench/contrib/chat/browser/media/chatViewPane.css +142 -0
  157. package/vscode/src/vs/workbench/contrib/chat/browser/media/chatViewTitleControl.css +39 -0
  158. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +51 -35
  159. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionContribution.js +1 -1
  160. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionOverlay.js +5 -4
  161. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptFileActions.js +2 -2
  162. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js +5 -5
  163. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptUrlHandler.js +12 -12
  164. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.js +19 -21
  165. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.d.ts +1 -1
  166. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.js +8 -8
  167. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.js +16 -16
  168. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +6 -6
  169. package/vscode/src/vs/workbench/contrib/chat/common/chatCodeMapperService.d.ts +1 -1
  170. package/vscode/src/vs/workbench/contrib/chat/common/chatModelStore.d.ts +49 -0
  171. package/vscode/src/vs/workbench/contrib/chat/common/chatModelStore.js +100 -0
  172. package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.d.ts +1 -0
  173. package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.js +2 -1
  174. package/vscode/src/vs/workbench/contrib/chat/common/chatResponseResourceFileSystemProvider.js +3 -4
  175. package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.d.ts +41 -15
  176. package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.js +208 -162
  177. package/vscode/src/vs/workbench/contrib/chat/common/chatServiceTelemetry.d.ts +3 -3
  178. package/vscode/src/vs/workbench/contrib/chat/common/chatSessionStore.d.ts +15 -7
  179. package/vscode/src/vs/workbench/contrib/chat/common/chatSessionStore.js +61 -7
  180. package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.d.ts +3 -2
  181. package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.js +2 -2
  182. package/vscode/src/vs/workbench/contrib/chat/common/chatTodoListService.js +1 -1
  183. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +10 -10
  184. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/PromptHeaderDefinitionProvider.js +2 -2
  185. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptBodyAutocompletion.js +3 -3
  186. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.d.ts +5 -1
  187. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.js +60 -43
  188. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptDocumentSemanticTokensProvider.js +1 -1
  189. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +27 -4
  190. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.js +37 -47
  191. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.d.ts +5 -3
  192. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.js +120 -87
  193. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/promptFileContributions.js +1 -1
  194. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.d.ts +49 -42
  195. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.js +293 -187
  196. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts +17 -5
  197. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +43 -9
  198. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.d.ts +2 -0
  199. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +48 -29
  200. package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.d.ts +1 -1
  201. package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +2 -2
  202. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +8 -13
  203. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibilityHelp.js +1 -1
  204. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibleView.js +2 -2
  205. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.d.ts +3 -3
  206. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +36 -41
  207. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.js +3 -3
  208. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookModifiedCellDecorator.d.ts +2 -2
  209. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookModifiedCellDecorator.js +2 -2
  210. package/vscode/src/vs/workbench/contrib/remoteCodingAgents/browser/remoteCodingAgents.contribution.js +7 -7
  211. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminal.chat.contribution.js +1 -1
  212. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.js +18 -18
  213. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibleView.js +1 -1
  214. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +142 -38
  215. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatController.d.ts +1 -1
  216. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatController.js +3 -7
  217. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatEnabler.js +1 -1
  218. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.d.ts +19 -2
  219. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.js +78 -6
  220. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.d.ts +7 -11
  221. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +26 -44
  222. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandLineAutoApprover.js +3 -3
  223. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.d.ts +1 -1
  224. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.js +9 -0
  225. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.d.ts +0 -1
  226. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.js +23 -17
  227. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.d.ts +1 -1
  228. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.js +4 -2
  229. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.d.ts +2 -0
  230. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +26 -5
  231. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.d.ts +3 -1
  232. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.js +32 -4
  233. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +15 -29
  234. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.js +10 -7
  235. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAnalyzer.d.ts +12 -0
  236. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.d.ts +3 -1
  237. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +38 -19
  238. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.d.ts +1 -0
  239. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +32 -7
  240. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalLastCommandTool.js +5 -4
  241. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +4 -3
  242. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalSelectionTool.js +4 -3
  243. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.d.ts +1 -0
  244. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +128 -62
  245. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/types.d.ts +2 -2
  246. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +12 -2
  247. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.d.ts +5 -2
  248. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +68 -22
  249. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/createAndRunTaskTool.js +20 -22
  250. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/getTaskOutputTool.js +13 -12
  251. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/runTaskTool.js +20 -19
  252. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.d.ts +1 -1
  253. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.js +1 -1
  254. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalCommandArtifactCollector.d.ts +12 -0
  255. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalCommandArtifactCollector.js +72 -0
  256. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.d.ts +1 -2
  257. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.js +5 -17
  258. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionViewModel.d.ts +0 -53
  259. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionViewModel.js +0 -154
  260. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.d.ts +0 -7
  261. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.js +0 -13
  262. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionTracker.d.ts +0 -25
  263. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionTracker.js +0 -135
  264. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/localChatSessionsProvider.d.ts +0 -35
  265. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/localChatSessionsProvider.js +0 -216
  266. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.js +0 -1617
  267. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.d.ts +0 -44
  268. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.js +0 -313
  269. /package/vscode/src/vs/workbench/contrib/chat/browser/{media → chatSetup/media}/apple-dark.svg +0 -0
  270. /package/vscode/src/vs/workbench/contrib/chat/browser/{media → chatSetup/media}/apple-light.svg +0 -0
  271. /package/vscode/src/vs/workbench/contrib/chat/browser/{media → chatSetup/media}/github.svg +0 -0
  272. /package/vscode/src/vs/workbench/contrib/chat/browser/{media → chatSetup/media}/google.svg +0 -0
  273. /package/vscode/src/vs/workbench/contrib/chat/browser/{chatStatusItemService.js → chatStatus/chatStatusItemService.js} +0 -0
@@ -0,0 +1,43 @@
1
+ import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
2
+ import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
3
+ import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
4
+ import { IViewDescriptorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/views.service";
5
+ import { IChatModel } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatModel";
6
+ export interface IChatViewTitleDelegate {
7
+ updateTitle(title: string): void;
8
+ focusChat(): void;
9
+ }
10
+ export declare class ChatViewTitleControl extends Disposable {
11
+ private readonly container;
12
+ private readonly delegate;
13
+ private readonly configurationService;
14
+ private readonly viewDescriptorService;
15
+ private readonly instantiationService;
16
+ private static readonly DEFAULT_TITLE;
17
+ private readonly _onDidChangeHeight;
18
+ readonly onDidChangeHeight: import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event<void>;
19
+ private get viewContainerModel();
20
+ private title;
21
+ private titleContainer;
22
+ private titleLabel;
23
+ private titleIcon;
24
+ private model;
25
+ private modelDisposables;
26
+ private navigationToolbar?;
27
+ private actionsToolbar?;
28
+ private lastKnownHeight;
29
+ constructor(container: HTMLElement, delegate: IChatViewTitleDelegate, configurationService: IConfigurationService, viewDescriptorService: IViewDescriptorService, instantiationService: IInstantiationService);
30
+ private registerListeners;
31
+ private render;
32
+ update(model: IChatModel | undefined): void;
33
+ private doUpdate;
34
+ private updateIcon;
35
+ private getIcon;
36
+ private getIconHoverContent;
37
+ private updateTitle;
38
+ private shouldRender;
39
+ private isEnabled;
40
+ getSingleViewPaneContainerTitle(): string | undefined;
41
+ private getTitleWithPrefix;
42
+ getHeight(): number;
43
+ }
@@ -0,0 +1,204 @@
1
+
2
+ import { registerCss } from '@codingame/monaco-vscode-api/css';
3
+ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
4
+ import * as chatViewTitleControl from './media/chatViewTitleControl.css';
5
+ import { h, EventType as EventType$1, addDisposableListener } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
6
+ import { renderAsPlaintext } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/markdownRenderer';
7
+ import { Gesture, EventType } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/touch';
8
+ import { getBaseLayerHoverDelegate } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/hover/hoverDelegate2';
9
+ import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
10
+ import { MarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
11
+ import { Disposable, MutableDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
12
+ import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
13
+ import { MarshalledId } from '@codingame/monaco-vscode-api/vscode/vs/base/common/marshallingIds';
14
+ import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
15
+ import { MenuWorkbenchToolBar, HiddenItemStrategy } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/browser/toolbar';
16
+ import { MenuId } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
17
+ import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
18
+ import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
19
+ import { IViewDescriptorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/views.service';
20
+ import { LayoutSettings, ActivityBarPosition } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/layout/browser/layoutService';
21
+ import { ChatConfiguration } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
22
+ import { ChatViewId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat';
23
+ import { AgentSessionProviders, getAgentSessionProviderIcon, getAgentSessionProviderName } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessions';
24
+
25
+ var ChatViewTitleControl_1;
26
+ registerCss(chatViewTitleControl);
27
+ let ChatViewTitleControl = class ChatViewTitleControl extends Disposable {
28
+ static { ChatViewTitleControl_1 = this; }
29
+ static { this.DEFAULT_TITLE = ( localize(5650, "Chat")); }
30
+ get viewContainerModel() {
31
+ const viewContainer = this.viewDescriptorService.getViewContainerByViewId(ChatViewId);
32
+ if (viewContainer) {
33
+ return this.viewDescriptorService.getViewContainerModel(viewContainer);
34
+ }
35
+ return undefined;
36
+ }
37
+ constructor(container, delegate, configurationService, viewDescriptorService, instantiationService) {
38
+ super();
39
+ this.container = container;
40
+ this.delegate = delegate;
41
+ this.configurationService = configurationService;
42
+ this.viewDescriptorService = viewDescriptorService;
43
+ this.instantiationService = instantiationService;
44
+ this._onDidChangeHeight = this._register(( new Emitter()));
45
+ this.onDidChangeHeight = this._onDidChangeHeight.event;
46
+ this.title = undefined;
47
+ this.modelDisposables = this._register(( new MutableDisposable()));
48
+ this.lastKnownHeight = 0;
49
+ this.render(this.container);
50
+ this.registerListeners();
51
+ }
52
+ registerListeners() {
53
+ if (this.viewContainerModel) {
54
+ this._register(this.viewContainerModel.onDidAddVisibleViewDescriptors(() => this.doUpdate()));
55
+ this._register(this.viewContainerModel.onDidRemoveVisibleViewDescriptors(() => this.doUpdate()));
56
+ }
57
+ this._register(this.configurationService.onDidChangeConfiguration(e => {
58
+ if (e.affectsConfiguration(LayoutSettings.ACTIVITY_BAR_LOCATION) ||
59
+ e.affectsConfiguration(ChatConfiguration.ChatViewTitleEnabled)) {
60
+ this.doUpdate();
61
+ }
62
+ }));
63
+ }
64
+ render(parent) {
65
+ const elements = h('div.chat-view-title-container', [
66
+ h('div.chat-view-title-navigation-toolbar@navigationToolbar'),
67
+ h('span.chat-view-title-icon@icon'),
68
+ h('span.chat-view-title-label@label'),
69
+ h('div.chat-view-title-actions-toolbar@actionsToolbar'),
70
+ ]);
71
+ this.navigationToolbar = this._register(this.instantiationService.createInstance(MenuWorkbenchToolBar, elements.navigationToolbar, MenuId.ChatViewSessionTitleNavigationToolbar, {
72
+ menuOptions: { shouldForwardArgs: true },
73
+ hiddenItemStrategy: HiddenItemStrategy.NoHide
74
+ }));
75
+ this.actionsToolbar = this._register(this.instantiationService.createInstance(MenuWorkbenchToolBar, elements.actionsToolbar, MenuId.ChatViewSessionTitleToolbar, {
76
+ menuOptions: { shouldForwardArgs: true },
77
+ hiddenItemStrategy: HiddenItemStrategy.NoHide
78
+ }));
79
+ this.titleContainer = elements.root;
80
+ this.titleLabel = elements.label;
81
+ this.titleIcon = elements.icon;
82
+ this._register(getBaseLayerHoverDelegate().setupDelayedHoverAtMouse(this.titleIcon, () => ({
83
+ content: this.getIconHoverContent() ?? '',
84
+ appearance: { compact: true }
85
+ })));
86
+ this._register(Gesture.addTarget(this.titleContainer));
87
+ for (const eventType of [EventType.Tap, EventType$1.CLICK]) {
88
+ this._register(addDisposableListener(this.titleContainer, eventType, () => {
89
+ this.delegate.focusChat();
90
+ }));
91
+ }
92
+ parent.appendChild(this.titleContainer);
93
+ }
94
+ update(model) {
95
+ this.model = model;
96
+ this.modelDisposables.value = model?.onDidChange(e => {
97
+ if (e.kind === 'setCustomTitle' || e.kind === 'addRequest') {
98
+ this.doUpdate();
99
+ }
100
+ });
101
+ this.doUpdate();
102
+ }
103
+ doUpdate() {
104
+ const markdownTitle = ( new MarkdownString(this.model?.title ?? ''));
105
+ this.title = renderAsPlaintext(markdownTitle);
106
+ this.delegate.updateTitle(this.getTitleWithPrefix());
107
+ this.updateTitle(this.title ?? ChatViewTitleControl_1.DEFAULT_TITLE);
108
+ this.updateIcon();
109
+ const context = this.model && {
110
+ $mid: MarshalledId.ChatViewContext,
111
+ sessionResource: this.model.sessionResource
112
+ };
113
+ if (this.navigationToolbar) {
114
+ this.navigationToolbar.context = context;
115
+ }
116
+ if (this.actionsToolbar) {
117
+ this.actionsToolbar.context = context;
118
+ }
119
+ }
120
+ updateIcon() {
121
+ if (!this.titleIcon) {
122
+ return;
123
+ }
124
+ const icon = this.getIcon();
125
+ if (icon) {
126
+ this.titleIcon.className = `chat-view-title-icon ${ThemeIcon.asClassName(icon)}`;
127
+ }
128
+ else {
129
+ this.titleIcon.className = 'chat-view-title-icon';
130
+ }
131
+ }
132
+ getIcon() {
133
+ const sessionType = this.model?.contributedChatSession?.chatSessionType;
134
+ switch (sessionType) {
135
+ case AgentSessionProviders.Background:
136
+ case AgentSessionProviders.Cloud:
137
+ return getAgentSessionProviderIcon(sessionType);
138
+ }
139
+ return undefined;
140
+ }
141
+ getIconHoverContent() {
142
+ const sessionType = this.model?.contributedChatSession?.chatSessionType;
143
+ switch (sessionType) {
144
+ case AgentSessionProviders.Background:
145
+ case AgentSessionProviders.Cloud:
146
+ return localize(5651, "{0} Agent Session", getAgentSessionProviderName(sessionType));
147
+ }
148
+ return undefined;
149
+ }
150
+ updateTitle(title) {
151
+ if (!this.titleContainer || !this.titleLabel) {
152
+ return;
153
+ }
154
+ this.titleContainer.classList.toggle('visible', this.shouldRender());
155
+ this.titleLabel.textContent = title;
156
+ const currentHeight = this.getHeight();
157
+ if (currentHeight !== this.lastKnownHeight) {
158
+ this.lastKnownHeight = currentHeight;
159
+ this._onDidChangeHeight.fire();
160
+ }
161
+ }
162
+ shouldRender() {
163
+ if (!this.isEnabled()) {
164
+ return false;
165
+ }
166
+ if (this.viewContainerModel && this.viewContainerModel.visibleViewDescriptors.length > 1) {
167
+ return false;
168
+ }
169
+ if (this.configurationService.getValue(LayoutSettings.ACTIVITY_BAR_LOCATION) !== ActivityBarPosition.DEFAULT) {
170
+ return false;
171
+ }
172
+ return !!this.model?.title;
173
+ }
174
+ isEnabled() {
175
+ return this.configurationService.getValue(ChatConfiguration.ChatViewTitleEnabled) === true;
176
+ }
177
+ getSingleViewPaneContainerTitle() {
178
+ if (!this.isEnabled() ||
179
+ this.shouldRender()
180
+ ) {
181
+ return undefined;
182
+ }
183
+ return this.getTitleWithPrefix();
184
+ }
185
+ getTitleWithPrefix() {
186
+ if (this.title) {
187
+ return localize(5652, "Chat: {0}", this.title);
188
+ }
189
+ return ChatViewTitleControl_1.DEFAULT_TITLE;
190
+ }
191
+ getHeight() {
192
+ if (!this.titleContainer || this.titleContainer.style.display === 'none') {
193
+ return 0;
194
+ }
195
+ return this.titleContainer.offsetHeight;
196
+ }
197
+ };
198
+ ChatViewTitleControl = ChatViewTitleControl_1 = ( __decorate([
199
+ ( __param(2, IConfigurationService)),
200
+ ( __param(3, IViewDescriptorService)),
201
+ ( __param(4, IInstantiationService))
202
+ ], ChatViewTitleControl));
203
+
204
+ export { ChatViewTitleControl };
@@ -0,0 +1,44 @@
1
+ import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
2
+ import { Disposable, IDisposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
3
+ import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
4
+ import { ILayoutService } from "@codingame/monaco-vscode-api/vscode/vs/platform/layout/browser/layoutService.service";
5
+ import { type PreferredGroup } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService";
6
+ import { IEditorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service";
7
+ import { IEditorGroupsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService.service";
8
+ import { IViewsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/views/common/viewsService.service";
9
+ import { ChatAgentLocation } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants";
10
+ import { ChatViewPaneTarget, IChatWidget } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat";
11
+ import { IQuickChatService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service";
12
+ import { IChatWidgetService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service";
13
+ import { IChatEditorOptions } from "./chatEditor.js";
14
+ export declare class ChatWidgetService extends Disposable implements IChatWidgetService {
15
+ private readonly editorGroupsService;
16
+ private readonly viewsService;
17
+ private readonly quickChatService;
18
+ private readonly layoutService;
19
+ private readonly editorService;
20
+ readonly _serviceBrand: undefined;
21
+ private _widgets;
22
+ private _lastFocusedWidget;
23
+ private readonly _onDidAddWidget;
24
+ readonly onDidAddWidget: Event<IChatWidget>;
25
+ constructor(editorGroupsService: IEditorGroupsService, viewsService: IViewsService, quickChatService: IQuickChatService, layoutService: ILayoutService, editorService: IEditorService);
26
+ get lastFocusedWidget(): IChatWidget | undefined;
27
+ getAllWidgets(): ReadonlyArray<IChatWidget>;
28
+ getWidgetsByLocations(location: ChatAgentLocation): ReadonlyArray<IChatWidget>;
29
+ getWidgetByInputUri(uri: URI): IChatWidget | undefined;
30
+ getWidgetBySessionResource(sessionResource: URI): IChatWidget | undefined;
31
+ revealWidget(preserveFocus?: boolean): Promise<IChatWidget | undefined>;
32
+ reveal(widget: IChatWidget, preserveFocus?: boolean): Promise<boolean>;
33
+ /**
34
+ * Reveal the session if already open, otherwise open it.
35
+ */
36
+ openSession(sessionResource: URI, target?: typeof ChatViewPaneTarget): Promise<IChatWidget | undefined>;
37
+ openSession(sessionResource: URI, target?: PreferredGroup, options?: IChatEditorOptions): Promise<IChatWidget | undefined>;
38
+ private revealSessionIfAlreadyOpen;
39
+ private prepareSessionForMove;
40
+ private findExistingChatEditorByUri;
41
+ private isSameEditorTarget;
42
+ private setLastFocusedWidget;
43
+ register(newWidget: IChatWidget): IDisposable;
44
+ }
@@ -0,0 +1,187 @@
1
+
2
+ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
+ import { getWindow } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
4
+ import { raceCancellablePromises, timeout } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
5
+ import { Emitter, Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
6
+ import { Disposable, combinedDisposable, toDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
7
+ import { isEqual } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
8
+ import { ILayoutService } from '@codingame/monaco-vscode-api/vscode/vs/platform/layout/browser/layoutService.service';
9
+ import { ACTIVE_GROUP } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService';
10
+ import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
11
+ import { isEditorGroup } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService';
12
+ import { IEditorGroupsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
13
+ import { IViewsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/views/common/viewsService.service';
14
+ import { ChatViewId, isIChatViewViewContext, ChatViewPaneTarget } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat';
15
+ import { IQuickChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service';
16
+ import { ChatEditor } from './chatEditor.js';
17
+ import { ChatEditorInput } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chatEditorInput';
18
+
19
+ let ChatWidgetService = class ChatWidgetService extends Disposable {
20
+ constructor(editorGroupsService, viewsService, quickChatService, layoutService, editorService) {
21
+ super();
22
+ this.editorGroupsService = editorGroupsService;
23
+ this.viewsService = viewsService;
24
+ this.quickChatService = quickChatService;
25
+ this.layoutService = layoutService;
26
+ this.editorService = editorService;
27
+ this._widgets = [];
28
+ this._lastFocusedWidget = undefined;
29
+ this._onDidAddWidget = this._register(( new Emitter()));
30
+ this.onDidAddWidget = this._onDidAddWidget.event;
31
+ }
32
+ get lastFocusedWidget() {
33
+ return this._lastFocusedWidget;
34
+ }
35
+ getAllWidgets() {
36
+ return this._widgets;
37
+ }
38
+ getWidgetsByLocations(location) {
39
+ return this._widgets.filter(w => w.location === location);
40
+ }
41
+ getWidgetByInputUri(uri) {
42
+ return this._widgets.find(w => isEqual(w.input.inputUri, uri));
43
+ }
44
+ getWidgetBySessionResource(sessionResource) {
45
+ return this._widgets.find(w => isEqual(w.viewModel?.sessionResource, sessionResource));
46
+ }
47
+ async revealWidget(preserveFocus) {
48
+ const last = this.lastFocusedWidget;
49
+ if (last && (await this.reveal(last, preserveFocus))) {
50
+ return last;
51
+ }
52
+ return (await this.viewsService.openView(ChatViewId, !preserveFocus))?.widget;
53
+ }
54
+ async reveal(widget, preserveFocus) {
55
+ if (widget.viewModel?.sessionResource) {
56
+ const alreadyOpenWidget = await this.revealSessionIfAlreadyOpen(widget.viewModel.sessionResource, { preserveFocus });
57
+ if (alreadyOpenWidget) {
58
+ return true;
59
+ }
60
+ }
61
+ if (isIChatViewViewContext(widget.viewContext)) {
62
+ const view = await this.viewsService.openView(widget.viewContext.viewId, !preserveFocus);
63
+ if (!preserveFocus) {
64
+ view?.focus();
65
+ }
66
+ return !!view;
67
+ }
68
+ return false;
69
+ }
70
+ async openSession(sessionResource, target, options) {
71
+ if (typeof target === 'undefined' || options?.revealIfOpened) {
72
+ const alreadyOpenWidget = await this.revealSessionIfAlreadyOpen(sessionResource, options);
73
+ if (alreadyOpenWidget) {
74
+ return alreadyOpenWidget;
75
+ }
76
+ }
77
+ else {
78
+ await this.prepareSessionForMove(sessionResource, target);
79
+ }
80
+ if (target === ChatViewPaneTarget) {
81
+ const chatView = await this.viewsService.openView(ChatViewId, !options?.preserveFocus);
82
+ if (chatView) {
83
+ await chatView.loadSession(sessionResource);
84
+ if (!options?.preserveFocus) {
85
+ chatView.focusInput();
86
+ }
87
+ }
88
+ return chatView?.widget;
89
+ }
90
+ const pane = await this.editorService.openEditor({
91
+ resource: sessionResource,
92
+ options: {
93
+ ...options,
94
+ revealIfOpened: options?.revealIfOpened ?? true
95
+ }
96
+ }, target);
97
+ return pane instanceof ChatEditor ? pane.widget : undefined;
98
+ }
99
+ async revealSessionIfAlreadyOpen(sessionResource, options) {
100
+ const chatView = this.viewsService.getViewWithId(ChatViewId);
101
+ if (chatView?.widget.viewModel?.sessionResource && isEqual(chatView.widget.viewModel.sessionResource, sessionResource)) {
102
+ const view = await this.viewsService.openView(ChatViewId, !options?.preserveFocus);
103
+ if (!options?.preserveFocus) {
104
+ view?.focus();
105
+ }
106
+ return chatView.widget;
107
+ }
108
+ const existingEditor = this.findExistingChatEditorByUri(sessionResource);
109
+ if (existingEditor) {
110
+ const existingEditorWindowId = existingEditor.group.windowId;
111
+ const isGroupActive = () => getWindow(this.layoutService.activeContainer).vscodeWindowId === existingEditorWindowId;
112
+ let ensureFocusTransfer;
113
+ if (!isGroupActive()) {
114
+ ensureFocusTransfer = raceCancellablePromises([
115
+ timeout(500),
116
+ Event.toPromise(Event.once(Event.filter(this.layoutService.onDidChangeActiveContainer, isGroupActive))),
117
+ ]);
118
+ }
119
+ const pane = await existingEditor.group.openEditor(existingEditor.editor, options);
120
+ await ensureFocusTransfer;
121
+ return pane instanceof ChatEditor ? pane.widget : undefined;
122
+ }
123
+ if (isEqual(sessionResource, this.quickChatService.sessionResource)) {
124
+ this.quickChatService.focus();
125
+ return undefined;
126
+ }
127
+ return undefined;
128
+ }
129
+ async prepareSessionForMove(sessionResource, target) {
130
+ const existingWidget = this.getWidgetBySessionResource(sessionResource);
131
+ if (existingWidget) {
132
+ const existingEditor = isIChatViewViewContext(existingWidget.viewContext) ?
133
+ undefined :
134
+ this.findExistingChatEditorByUri(sessionResource);
135
+ if (isIChatViewViewContext(existingWidget.viewContext) && target === ChatViewPaneTarget) {
136
+ return;
137
+ }
138
+ if (!isIChatViewViewContext(existingWidget.viewContext) && target !== ChatViewPaneTarget && existingEditor && this.isSameEditorTarget(existingEditor.group.id, target)) {
139
+ return;
140
+ }
141
+ if (existingEditor) {
142
+ await this.editorService.closeEditor({ editor: existingEditor.editor, groupId: existingEditor.group.id }, { preserveFocus: true });
143
+ }
144
+ else {
145
+ await existingWidget.clear();
146
+ }
147
+ }
148
+ }
149
+ findExistingChatEditorByUri(sessionUri) {
150
+ for (const group of this.editorGroupsService.groups) {
151
+ for (const editor of group.editors) {
152
+ if (editor instanceof ChatEditorInput && isEqual(editor.sessionResource, sessionUri)) {
153
+ return { editor, group };
154
+ }
155
+ }
156
+ }
157
+ return undefined;
158
+ }
159
+ isSameEditorTarget(currentGroupId, target) {
160
+ return typeof target === 'number' && target === currentGroupId ||
161
+ target === ACTIVE_GROUP && this.editorGroupsService.activeGroup?.id === currentGroupId ||
162
+ isEditorGroup(target) && target.id === currentGroupId;
163
+ }
164
+ setLastFocusedWidget(widget) {
165
+ if (widget === this._lastFocusedWidget) {
166
+ return;
167
+ }
168
+ this._lastFocusedWidget = widget;
169
+ }
170
+ register(newWidget) {
171
+ if (( this._widgets.some(widget => widget === newWidget))) {
172
+ throw ( new Error('Cannot register the same widget multiple times'));
173
+ }
174
+ this._widgets.push(newWidget);
175
+ this._onDidAddWidget.fire(newWidget);
176
+ return combinedDisposable(newWidget.onDidFocus(() => this.setLastFocusedWidget(newWidget)), toDisposable(() => this._widgets.splice(this._widgets.indexOf(newWidget), 1)));
177
+ }
178
+ };
179
+ ChatWidgetService = ( __decorate([
180
+ ( __param(0, IEditorGroupsService)),
181
+ ( __param(1, IViewsService)),
182
+ ( __param(2, IQuickChatService)),
183
+ ( __param(3, ILayoutService)),
184
+ ( __param(4, IEditorService))
185
+ ], ChatWidgetService));
186
+
187
+ export { ChatWidgetService };
@@ -1,5 +1,5 @@
1
1
  import { IDisposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
2
- import { ICodeBlockActionContextProvider } from "@codingame/monaco-vscode-2339d6ac-d6bb-53cd-95ee-81911735d1c7-common/vscode/vs/workbench/contrib/chat/browser/chat";
2
+ import { ICodeBlockActionContextProvider } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat";
3
3
  import { IChatCodeBlockContextProviderService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service";
4
4
  export declare class ChatCodeBlockContextProviderService implements IChatCodeBlockContextProviderService {
5
5
  _serviceBrand: undefined;