@codingame/monaco-vscode-chat-service-override 22.1.8 → 23.0.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 (276) hide show
  1. package/index.js +16 -7
  2. package/package.json +43 -41
  3. package/vscode/src/vs/editor/common/diff/documentDiffProvider.d.ts +1 -1
  4. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.js +6 -6
  5. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +57 -48
  6. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.d.ts +2 -2
  7. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +18 -18
  8. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.d.ts +1 -1
  9. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +26 -17
  10. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +51 -5
  11. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +2 -2
  12. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +4 -4
  13. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatGettingStarted.js +2 -2
  14. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +7 -7
  15. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatLanguageModelActions.js +13 -13
  16. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +19 -19
  17. package/vscode/src/vs/workbench/contrib/chat/browser/actions/{chatClearActions.d.ts → chatNewActions.d.ts} +2 -1
  18. package/vscode/src/vs/workbench/contrib/chat/browser/actions/{chatClearActions.js → chatNewActions.js} +32 -32
  19. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPromptNavigationActions.js +4 -4
  20. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +9 -9
  21. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatSessionActions.d.ts +9 -9
  22. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatSessionActions.js +101 -98
  23. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.js +35 -24
  24. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.js +43 -25
  25. package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.d.ts +1 -1
  26. package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +33 -32
  27. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionViewModel.d.ts +53 -0
  28. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionViewModel.js +154 -0
  29. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.d.ts +7 -0
  30. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.js +13 -0
  31. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsView.d.ts +44 -0
  32. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsView.js +347 -0
  33. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.d.ts +85 -0
  34. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +250 -0
  35. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentsessionsview.css +24 -0
  36. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentsessionsviewer.css +97 -0
  37. package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +290 -231
  38. package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.d.ts +2 -2
  39. package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.js +7 -10
  40. package/vscode/src/vs/workbench/contrib/chat/browser/chatAttachmentResolveService.d.ts +1 -1
  41. package/vscode/src/vs/workbench/contrib/chat/browser/chatAttachmentResolveService.js +6 -6
  42. package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMarkdownAnchorService.d.ts +1 -1
  43. package/vscode/src/vs/workbench/contrib/chat/browser/chatContextService.d.ts +24 -0
  44. package/vscode/src/vs/workbench/contrib/chat/browser/chatContextService.js +113 -0
  45. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCheckpointTimeline.d.ts +31 -0
  46. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCheckpointTimelineImpl.d.ts +102 -0
  47. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCheckpointTimelineImpl.js +646 -0
  48. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.d.ts +2 -3
  49. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +46 -26
  50. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.d.ts +17 -4
  51. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +44 -34
  52. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +14 -14
  53. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.d.ts +25 -6
  54. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +46 -10
  55. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.d.ts +45 -6
  56. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +30 -10
  57. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.d.ts +10 -3
  58. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +60 -9
  59. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingOperations.d.ts +117 -0
  60. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingOperations.js +12 -0
  61. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.d.ts +6 -4
  62. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +60 -55
  63. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.d.ts +29 -16
  64. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +365 -143
  65. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSessionStorage.d.ts +2 -3
  66. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSessionStorage.js +3 -30
  67. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelChangeService.d.ts +7 -3
  68. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelChangeService.js +58 -22
  69. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelContentProviders.d.ts +1 -1
  70. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelContentProviders.js +5 -4
  71. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookSnapshot.d.ts +3 -3
  72. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookSnapshot.js +1 -1
  73. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookCellEntry.d.ts +3 -3
  74. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookCellEntry.js +5 -5
  75. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +6 -18
  76. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookFileSystemProvider.d.ts +1 -3
  77. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookFileSystemProvider.js +7 -11
  78. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/overlayToolbarDecorator.d.ts +1 -1
  79. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/overlayToolbarDecorator.js +13 -1
  80. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/simpleBrowserEditorOverlay.js +38 -33
  81. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.d.ts +11 -6
  82. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.js +83 -24
  83. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.d.ts +1 -0
  84. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.js +91 -0
  85. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditor.d.ts +64 -0
  86. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditor.js +370 -0
  87. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.d.ts +25 -0
  88. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.js +56 -0
  89. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.d.ts +61 -0
  90. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.js +349 -0
  91. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.d.ts +43 -0
  92. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.js +787 -0
  93. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatUsageWidget.d.ts +17 -0
  94. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatUsageWidget.js +109 -0
  95. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/media/chatManagementEditor.css +122 -0
  96. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/media/chatModelsWidget.css +211 -0
  97. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/media/chatUsageWidget.css +69 -0
  98. package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.d.ts +1 -1
  99. package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +21 -20
  100. package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +54 -54
  101. package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.d.ts +1 -1
  102. package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.js +31 -22
  103. package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.d.ts +1 -1
  104. package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.js +16 -6
  105. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionTracker.d.ts +6 -3
  106. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionTracker.js +29 -21
  107. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/localChatSessionsProvider.d.ts +5 -2
  108. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/localChatSessionsProvider.js +37 -33
  109. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/view/chatSessionsView.d.ts +15 -12
  110. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/view/chatSessionsView.js +96 -131
  111. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/view/sessionsTreeRenderer.d.ts +12 -7
  112. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/view/sessionsTreeRenderer.js +66 -34
  113. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/view/sessionsViewPane.d.ts +5 -3
  114. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/view/sessionsViewPane.js +77 -71
  115. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions.contribution.d.ts +91 -18
  116. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions.contribution.js +458 -138
  117. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.d.ts +3 -1
  118. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.js +212 -150
  119. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus.js +96 -89
  120. package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.d.ts +3 -2
  121. package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.js +5 -5
  122. package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.d.ts +3 -4
  123. package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.js +15 -16
  124. package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockContextProviderService.d.ts +1 -1
  125. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.js +33 -17
  126. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorHover.d.ts +1 -1
  127. package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorHover.js +3 -3
  128. package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsConfirmationService.d.ts +27 -0
  129. package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsConfirmationService.js +688 -0
  130. package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.d.ts +15 -10
  131. package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.js +126 -135
  132. package/vscode/src/vs/workbench/contrib/chat/browser/media/chatEditingEditorOverlay.css +6 -1
  133. package/vscode/src/vs/workbench/contrib/chat/browser/media/chatEditorController.css +2 -1
  134. package/vscode/src/vs/workbench/contrib/chat/browser/media/chatSessions.css +38 -1
  135. package/vscode/src/vs/workbench/contrib/chat/browser/media/simpleBrowserOverlay.css +14 -14
  136. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.d.ts +1 -1
  137. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +28 -26
  138. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionContribution.js +1 -1
  139. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionOverlay.js +3 -3
  140. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptFileActions.js +9 -6
  141. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js +24 -13
  142. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptUrlHandler.js +15 -14
  143. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.js +25 -23
  144. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.d.ts +21 -0
  145. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.js +89 -0
  146. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.js +16 -16
  147. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +30 -29
  148. package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.d.ts +10 -19
  149. package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.js +61 -43
  150. package/vscode/src/vs/workbench/contrib/chat/common/chatResponseResourceFileSystemProvider.js +7 -4
  151. package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.d.ts +28 -28
  152. package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.js +254 -165
  153. package/vscode/src/vs/workbench/contrib/chat/common/chatServiceTelemetry.d.ts +4 -4
  154. package/vscode/src/vs/workbench/contrib/chat/common/chatServiceTelemetry.js +2 -2
  155. package/vscode/src/vs/workbench/contrib/chat/common/chatSessionStore.d.ts +1 -1
  156. package/vscode/src/vs/workbench/contrib/chat/common/chatSessionStore.js +4 -6
  157. package/vscode/src/vs/workbench/contrib/chat/common/chatTodoListService.d.ts +10 -6
  158. package/vscode/src/vs/workbench/contrib/chat/common/chatTodoListService.js +20 -12
  159. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +13 -17
  160. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/PromptHeaderDefinitionProvider.js +9 -8
  161. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptBodyAutocompletion.d.ts +1 -0
  162. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptBodyAutocompletion.js +51 -21
  163. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.d.ts +7 -3
  164. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.js +74 -20
  165. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptDocumentSemanticTokensProvider.js +11 -6
  166. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.d.ts +1 -2
  167. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +83 -53
  168. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.d.ts +2 -1
  169. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.js +136 -78
  170. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptLinkProvider.js +4 -4
  171. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.d.ts +18 -10
  172. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.js +357 -157
  173. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/promptFileContributions.js +1 -1
  174. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.d.ts +55 -28
  175. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.js +235 -108
  176. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts +12 -2
  177. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +50 -4
  178. package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +27 -27
  179. package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.d.ts +1 -1
  180. package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +2 -2
  181. package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/aiEditTelemetry/aiEditTelemetryServiceImpl.d.ts +3 -1
  182. package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/aiEditTelemetry/aiEditTelemetryServiceImpl.js +11 -7
  183. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +12 -14
  184. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibilityHelp.js +1 -1
  185. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibleView.js +1 -1
  186. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.d.ts +18 -30
  187. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +62 -139
  188. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.d.ts +1 -1
  189. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.js +16 -15
  190. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookModifiedCellDecorator.d.ts +1 -1
  191. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookModifiedCellDecorator.js +2 -2
  192. package/vscode/src/vs/workbench/contrib/remoteCodingAgents/browser/remoteCodingAgents.contribution.js +7 -7
  193. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminal.chat.contribution.js +3 -0
  194. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.js +16 -16
  195. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +119 -15
  196. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatController.js +6 -4
  197. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.d.ts +47 -0
  198. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.js +192 -0
  199. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.d.ts +7 -5
  200. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +21 -16
  201. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandLineAutoApprover.js +8 -3
  202. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.d.ts +2 -2
  203. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.js +18 -27
  204. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.d.ts +5 -2
  205. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.js +3 -1
  206. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.d.ts +1 -1
  207. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.js +4 -25
  208. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.d.ts +2 -2
  209. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.js +18 -27
  210. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/strategyHelpers.d.ts +12 -0
  211. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/strategyHelpers.js +31 -0
  212. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.d.ts +3 -0
  213. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +24 -8
  214. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.js +8 -0
  215. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.d.ts +1 -1
  216. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.js +33 -4
  217. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +42 -13
  218. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.js +14 -21
  219. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAnalyzer.d.ts +23 -0
  220. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.d.ts +18 -0
  221. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +227 -0
  222. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.d.ts +17 -0
  223. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +133 -0
  224. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineCdPrefixRewriter.d.ts +5 -0
  225. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineCdPrefixRewriter.js +36 -0
  226. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePwshChainOperatorRewriter.d.ts +8 -0
  227. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePwshChainOperatorRewriter.js +33 -0
  228. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineRewriter.d.ts +17 -0
  229. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalLastCommandTool.js +4 -4
  230. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +3 -3
  231. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalSelectionTool.js +3 -3
  232. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.d.ts +5 -1
  233. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +75 -37
  234. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/types.d.ts +1 -0
  235. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.d.ts +8 -0
  236. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +71 -0
  237. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.d.ts +28 -15
  238. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +366 -363
  239. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/createAndRunTaskTool.js +18 -18
  240. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/getTaskOutputTool.js +9 -9
  241. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/runTaskTool.js +16 -16
  242. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.js +1 -1
  243. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.d.ts +19 -0
  244. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.js +123 -0
  245. package/vscode/src/vs/base/common/yaml.d.ts +0 -74
  246. package/vscode/src/vs/base/common/yaml.js +0 -597
  247. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContext.d.ts +0 -8
  248. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContext.js +0 -239
  249. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTimeline.d.ts +0 -102
  250. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTimeline.js +0 -435
  251. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookDiff.d.ts +0 -14
  252. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookDiff.js +0 -67
  253. package/vscode/src/vs/workbench/contrib/chat/browser/chatPasteProviders.d.ts +0 -49
  254. package/vscode/src/vs/workbench/contrib/chat/browser/chatPasteProviders.js +0 -380
  255. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/common.d.ts +0 -37
  256. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/common.js +0 -137
  257. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/attachInstructionsAction.d.ts +0 -44
  258. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/attachInstructionsAction.js +0 -176
  259. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/newPromptFileActions.d.ts +0 -4
  260. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/newPromptFileActions.js +0 -206
  261. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/askForPromptName.d.ts +0 -7
  262. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/askForPromptName.js +0 -79
  263. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/askForPromptSourceFolder.d.ts +0 -8
  264. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/askForPromptSourceFolder.js +0 -145
  265. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/promptFilePickers.d.ts +0 -65
  266. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/promptFilePickers.js +0 -306
  267. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveToPromptAction.d.ts +0 -12
  268. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveToPromptAction.js +0 -102
  269. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/newPromptsParser.d.ts +0 -97
  270. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/newPromptsParser.js +0 -247
  271. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.d.ts +0 -118
  272. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.js +0 -10
  273. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandSimplifier.d.ts +0 -10
  274. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandSimplifier.js +0 -55
  275. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/subCommands.d.ts +0 -2
  276. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/subCommands.js +0 -66
@@ -1,16 +1,18 @@
1
1
  import { CancellationToken } from "@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation";
2
2
  import { Emitter, Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
3
3
  import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
4
+ import { IWorkbenchContribution } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions";
4
5
  import { IEditorGroupsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService.service";
5
6
  import { IChatService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService.service";
6
- import { IChatSessionItemProvider, IChatSessionItem } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService";
7
+ import { IChatSessionItem, IChatSessionItemProvider } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService";
7
8
  import { IChatSessionsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService.service";
8
9
  import { IChatWidgetService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service";
9
- export declare class LocalChatSessionsProvider extends Disposable implements IChatSessionItemProvider {
10
+ export declare class LocalChatSessionsProvider extends Disposable implements IChatSessionItemProvider, IWorkbenchContribution {
10
11
  private readonly editorGroupService;
11
12
  private readonly chatWidgetService;
12
13
  private readonly chatService;
13
14
  private readonly chatSessionsService;
15
+ static readonly ID = "workbench.contrib.localChatSessionsProvider";
14
16
  static readonly CHAT_WIDGET_VIEW_ID = "workbench.panel.chat.view.copilot";
15
17
  static readonly HISTORY_NODE_ID = "show-history";
16
18
  readonly chatSessionType = "local";
@@ -22,6 +24,7 @@ export declare class LocalChatSessionsProvider extends Disposable implements ICh
22
24
  private editorOrder;
23
25
  constructor(editorGroupService: IEditorGroupsService, chatWidgetService: IChatWidgetService, chatService: IChatService, chatSessionsService: IChatSessionsService);
24
26
  private registerWidgetListeners;
27
+ private _registerWidgetModelListeners;
25
28
  private registerProgressListener;
26
29
  private registerModelTitleListener;
27
30
  private initializeCurrentEditorSet;
@@ -3,19 +3,22 @@ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib
3
3
  import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
4
4
  import { Emitter, Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
5
5
  import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
6
+ import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
7
+ import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
6
8
  import { localize, localize2 } from '@codingame/monaco-vscode-api/vscode/vs/nls';
7
9
  import { IEditorGroupsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
8
10
  import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService.service';
9
- import { ChatSessionStatus } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService';
11
+ import { localChatSessionType, ChatSessionStatus } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService';
10
12
  import { IChatSessionsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService.service';
11
13
  import { ChatAgentLocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
12
14
  import { IChatWidgetService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service';
13
- import { ChatEditorInput } from '@codingame/monaco-vscode-b994942c-360d-5b68-8a33-77d4bde6b714-common/vscode/vs/workbench/contrib/chat/browser/chatEditorInput';
14
- import { isChatSession, getChatSessionType } from './common.js';
15
+ import { ChatEditorInput } from '@codingame/monaco-vscode-aac7027b-326c-513a-95a9-e4eedd151b38-common/vscode/vs/workbench/contrib/chat/browser/chatEditorInput';
16
+ import { isChatSession } from '@codingame/monaco-vscode-2339d6ac-d6bb-53cd-95ee-81911735d1c7-common/vscode/vs/workbench/contrib/chat/browser/chatSessions/common';
15
17
 
16
18
  var LocalChatSessionsProvider_1;
17
19
  let LocalChatSessionsProvider = class LocalChatSessionsProvider extends Disposable {
18
20
  static { LocalChatSessionsProvider_1 = this; }
21
+ static { this.ID = 'workbench.contrib.localChatSessionsProvider'; }
19
22
  static { this.CHAT_WIDGET_VIEW_ID = 'workbench.panel.chat.view.copilot'; }
20
23
  static { this.HISTORY_NODE_ID = 'show-history'; }
21
24
  get onDidChangeChatSessionItems() { return this._onDidChangeChatSessionItems.event; }
@@ -25,12 +28,13 @@ let LocalChatSessionsProvider = class LocalChatSessionsProvider extends Disposab
25
28
  this.chatWidgetService = chatWidgetService;
26
29
  this.chatService = chatService;
27
30
  this.chatSessionsService = chatSessionsService;
28
- this.chatSessionType = 'local';
31
+ this.chatSessionType = localChatSessionType;
29
32
  this._onDidChange = this._register(( new Emitter()));
30
33
  this.onDidChange = this._onDidChange.event;
31
34
  this._onDidChangeChatSessionItems = this._register(( new Emitter()));
32
35
  this.currentEditorSet = ( new Set());
33
36
  this.editorOrder = [];
37
+ this._register(this.chatSessionsService.registerChatSessionItemProvider(this));
34
38
  this.initializeCurrentEditorSet();
35
39
  this.registerWidgetListeners();
36
40
  this._register(this.chatService.onDidDisposeSession(() => {
@@ -50,30 +54,27 @@ let LocalChatSessionsProvider = class LocalChatSessionsProvider extends Disposab
50
54
  'viewId' in widget.viewContext &&
51
55
  widget.viewContext.viewId === LocalChatSessionsProvider_1.CHAT_WIDGET_VIEW_ID) {
52
56
  this._onDidChange.fire();
53
- this._register(widget.onDidChangeViewModel(() => {
54
- this._onDidChange.fire();
55
- if (widget.viewModel) {
56
- this.registerProgressListener(widget.viewModel.model.requestInProgressObs);
57
- }
58
- }));
59
- this.registerModelTitleListener(widget);
60
- if (widget.viewModel) {
61
- this.registerProgressListener(widget.viewModel.model.requestInProgressObs);
62
- }
57
+ this._registerWidgetModelListeners(widget);
63
58
  }
64
59
  }));
65
60
  const existingWidgets = this.chatWidgetService.getWidgetsByLocations(ChatAgentLocation.Chat)
66
61
  .filter(widget => typeof widget.viewContext === 'object' && 'viewId' in widget.viewContext && widget.viewContext.viewId === LocalChatSessionsProvider_1.CHAT_WIDGET_VIEW_ID);
67
62
  existingWidgets.forEach(widget => {
68
- this._register(widget.onDidChangeViewModel(() => {
69
- this._onDidChange.fire();
70
- this.registerModelTitleListener(widget);
71
- }));
63
+ this._registerWidgetModelListeners(widget);
64
+ });
65
+ }
66
+ _registerWidgetModelListeners(widget) {
67
+ const register = () => {
72
68
  this.registerModelTitleListener(widget);
73
69
  if (widget.viewModel) {
74
70
  this.registerProgressListener(widget.viewModel.model.requestInProgressObs);
75
71
  }
76
- });
72
+ };
73
+ this._register(widget.onDidChangeViewModel(() => {
74
+ register();
75
+ this._onDidChangeChatSessionItems.fire();
76
+ }));
77
+ register();
77
78
  }
78
79
  registerProgressListener(observable) {
79
80
  const progressEvent = Event.fromObservableLight(observable);
@@ -108,14 +109,13 @@ let LocalChatSessionsProvider = class LocalChatSessionsProvider extends Disposab
108
109
  return `${group.id}-${editor.typeId}-${editor.resource?.toString() || editor.getName()}`;
109
110
  }
110
111
  isLocalChatSession(editor) {
111
- if (!isChatSession(editor)) {
112
+ if (!isChatSession(this.chatSessionsService.getContentProviderSchemes(), editor)) {
112
113
  return false;
113
114
  }
114
115
  if (!(editor instanceof ChatEditorInput)) {
115
116
  return false;
116
117
  }
117
- const sessionType = getChatSessionType(editor);
118
- return sessionType === 'local';
118
+ return editor.getSessionType() === localChatSessionType;
119
119
  }
120
120
  modelToStatus(model) {
121
121
  if (model.requestInProgress) {
@@ -125,7 +125,7 @@ let LocalChatSessionsProvider = class LocalChatSessionsProvider extends Disposab
125
125
  const requests = model.getRequests();
126
126
  if (requests.length > 0) {
127
127
  const lastRequest = requests[requests.length - 1];
128
- if (lastRequest && lastRequest.response) {
128
+ if (lastRequest?.response) {
129
129
  if (lastRequest.response.isCanceled || lastRequest.response.result?.errorDetails) {
130
130
  return ChatSessionStatus.Failed;
131
131
  }
@@ -156,10 +156,12 @@ let LocalChatSessionsProvider = class LocalChatSessionsProvider extends Disposab
156
156
  const status = chatWidget?.viewModel?.model ? this.modelToStatus(chatWidget.viewModel.model) : undefined;
157
157
  const widgetSession = {
158
158
  id: LocalChatSessionsProvider_1.CHAT_WIDGET_VIEW_ID,
159
- label: chatWidget?.viewModel?.model.title || ( localize2(5235, "Chat")).value,
160
- description: ( localize(5236, "Chat View")),
159
+ resource: ( URI.parse(`${Schemas.vscodeLocalChatSession}://widget`)),
160
+ label: chatWidget?.viewModel?.model.title || ( localize2(5399, "Chat")).value,
161
+ description: ( localize(5400, "Chat View")),
161
162
  iconPath: Codicon.chatSparkle,
162
163
  status,
164
+ timing: { startTime: chatWidget?.viewModel?.model.getRequests().at(0)?.timestamp || 0 },
163
165
  provider: this
164
166
  };
165
167
  sessions.push(widgetSession);
@@ -167,28 +169,28 @@ let LocalChatSessionsProvider = class LocalChatSessionsProvider extends Disposab
167
169
  const editorInfo = editorMap.get(editorKey);
168
170
  if (editorInfo) {
169
171
  let status;
170
- let timestamp;
171
- if (editorInfo.editor instanceof ChatEditorInput && editorInfo.editor.sessionId) {
172
- const model = this.chatService.getSession(editorInfo.editor.sessionId);
172
+ let startTime;
173
+ if (editorInfo.editor instanceof ChatEditorInput && editorInfo.editor.sessionResource && editorInfo.editor.sessionId) {
174
+ const model = this.chatService.getSession(editorInfo.editor.sessionResource);
173
175
  if (model) {
174
176
  status = this.modelToStatus(model);
175
177
  const requests = model.getRequests();
176
178
  if (requests.length > 0) {
177
- const lastRequest = requests[requests.length - 1];
178
- timestamp = lastRequest.timestamp;
179
+ startTime = requests.at(0)?.timestamp;
179
180
  }
180
181
  else {
181
- timestamp = Date.now();
182
+ startTime = Date.now();
182
183
  }
183
184
  }
184
185
  const editorSession = {
185
186
  id: editorInfo.editor.sessionId,
187
+ resource: editorInfo.editor.resource,
186
188
  label: editorInfo.editor.getName(),
187
189
  iconPath: Codicon.chatSparkle,
188
190
  status,
189
191
  provider: this,
190
192
  timing: {
191
- startTime: timestamp ?? 0
193
+ startTime: startTime ?? 0
192
194
  }
193
195
  };
194
196
  sessions.push(editorSession);
@@ -197,7 +199,9 @@ let LocalChatSessionsProvider = class LocalChatSessionsProvider extends Disposab
197
199
  });
198
200
  const historyNode = {
199
201
  id: LocalChatSessionsProvider_1.HISTORY_NODE_ID,
200
- label: ( localize(5237, "History")),
202
+ resource: ( URI.parse(`${Schemas.vscodeLocalChatSession}://history`)),
203
+ label: ( localize(5401, "History")),
204
+ timing: { startTime: 0 }
201
205
  };
202
206
  return [...sessions, historyNode];
203
207
  }
@@ -1,22 +1,25 @@
1
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
2
  import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
3
+ import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
4
+ import { IProductService } from "@codingame/monaco-vscode-api/vscode/vs/platform/product/common/productService.service";
4
5
  import { IWorkbenchContribution } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions";
5
- import { IChatEntitlementService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/chat/common/chatEntitlementService.service";
6
6
  import { IChatSessionsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService.service";
7
7
  export declare class ChatSessionsView extends Disposable implements IWorkbenchContribution {
8
- private readonly configurationService;
8
+ static readonly ID = "workbench.contrib.chatSessionsView";
9
+ constructor();
10
+ private registerViewContainer;
11
+ }
12
+ export declare class ChatSessionsViewContrib extends Disposable implements IWorkbenchContribution {
9
13
  private readonly instantiationService;
10
14
  private readonly chatSessionsService;
11
- private readonly chatEntitlementService;
15
+ private readonly logService;
16
+ private readonly productService;
12
17
  static readonly ID = "workbench.contrib.chatSessions";
13
- private isViewContainerRegistered;
14
- private localProvider;
15
18
  private readonly sessionTracker;
16
- private viewContainer;
17
- constructor(configurationService: IConfigurationService, instantiationService: IInstantiationService, chatSessionsService: IChatSessionsService, chatEntitlementService: IChatEntitlementService);
18
- private setupEditorTracking;
19
- private updateViewContainerRegistration;
20
- private registerViewContainer;
21
- private deregisterViewContainer;
19
+ private readonly registeredViewDescriptors;
20
+ constructor(instantiationService: IInstantiationService, chatSessionsService: IChatSessionsService, logService: ILogService, productService: IProductService);
21
+ private getAllChatSessionItemProviders;
22
+ private updateViewRegistration;
23
+ private registerViews;
24
+ dispose(): void;
22
25
  }
@@ -4,6 +4,7 @@ import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codi
4
4
  import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
5
5
  import { localize2, localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
6
6
  import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
7
+ import { ContextKeyExpr } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
7
8
  import { IContextMenuService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextview/browser/contextView.service';
8
9
  import { SyncDescriptor } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/descriptors';
9
10
  import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
@@ -18,127 +19,59 @@ import { IWorkspaceContextService } from '@codingame/monaco-vscode-api/vscode/vs
18
19
  import { ViewPaneContainer } from '@codingame/monaco-vscode-a8d3bd74-e63e-5327-96e8-4f931661e329-common/vscode/vs/workbench/browser/parts/views/viewPaneContainer';
19
20
  import { Extensions, ViewContainerLocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/views';
20
21
  import { IViewDescriptorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/views.service';
21
- import { IChatEntitlementService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/chat/common/chatEntitlementService.service';
22
22
  import { IExtensionService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service';
23
23
  import { IWorkbenchLayoutService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/layout/browser/layoutService.service';
24
+ import { ChatContextKeyExprs } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
25
+ import { localChatSessionType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService';
24
26
  import { IChatSessionsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService.service';
25
- import { ChatConfiguration, VIEWLET_ID } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
26
- import { ACTION_ID_OPEN_CHAT } from '@codingame/monaco-vscode-c2deffc4-ad68-5e63-8f95-9b89e0fc6898-common/vscode/vs/workbench/contrib/chat/browser/actions/chatActions';
27
+ import { AGENT_SESSIONS_VIEWLET_ID } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
28
+ import { ACTION_ID_OPEN_CHAT } from '@codingame/monaco-vscode-2339d6ac-d6bb-53cd-95ee-81911735d1c7-common/vscode/vs/workbench/contrib/chat/browser/actions/chatActions';
27
29
  import { ChatSessionTracker } from '../chatSessionTracker.js';
28
- import { LocalChatSessionsProvider } from '../localChatSessionsProvider.js';
29
30
  import { SessionsViewPane } from './sessionsViewPane.js';
30
31
 
31
- let ChatSessionsView = class ChatSessionsView extends Disposable {
32
- static { this.ID = 'workbench.contrib.chatSessions'; }
33
- constructor(configurationService, instantiationService, chatSessionsService, chatEntitlementService) {
32
+ class ChatSessionsView extends Disposable {
33
+ static { this.ID = 'workbench.contrib.chatSessionsView'; }
34
+ constructor() {
34
35
  super();
35
- this.configurationService = configurationService;
36
- this.instantiationService = instantiationService;
37
- this.chatSessionsService = chatSessionsService;
38
- this.chatEntitlementService = chatEntitlementService;
39
- this.isViewContainerRegistered = false;
40
- this.sessionTracker = this._register(this.instantiationService.createInstance(ChatSessionTracker));
41
- this.setupEditorTracking();
42
- this.localProvider = this._register(this.instantiationService.createInstance(LocalChatSessionsProvider));
43
- this._register(this.chatSessionsService.registerChatSessionItemProvider(this.localProvider));
44
- this.updateViewContainerRegistration();
45
- this._register(this.configurationService.onDidChangeConfiguration(e => {
46
- if (e.affectsConfiguration(ChatConfiguration.AgentSessionsViewLocation)) {
47
- this.updateViewContainerRegistration();
48
- }
49
- }));
50
- this._register(this.chatEntitlementService.onDidChangeSentiment(e => {
51
- this.updateViewContainerRegistration();
52
- }));
53
- }
54
- setupEditorTracking() {
55
- this._register(this.sessionTracker.onDidChangeEditors(e => {
56
- this.chatSessionsService.notifySessionItemsChanged(e.sessionType);
57
- }));
58
- }
59
- updateViewContainerRegistration() {
60
- const location = this.configurationService.getValue(ChatConfiguration.AgentSessionsViewLocation);
61
- const sentiment = this.chatEntitlementService.sentiment;
62
- if (sentiment.disabled || sentiment.hidden || (location !== 'view' && this.isViewContainerRegistered)) {
63
- this.deregisterViewContainer();
64
- }
65
- else if (location === 'view' && !this.isViewContainerRegistered) {
66
- this.registerViewContainer();
67
- }
36
+ this.registerViewContainer();
68
37
  }
69
38
  registerViewContainer() {
70
- if (this.isViewContainerRegistered) {
71
- return;
72
- }
73
- this.viewContainer = ( Registry.as(Extensions.ViewContainersRegistry)).registerViewContainer({
74
- id: VIEWLET_ID,
75
- title: ( localize2(5238, "Chat Sessions")),
76
- ctorDescriptor: ( new SyncDescriptor(ChatSessionsViewPaneContainer, [this.sessionTracker])),
77
- hideIfEmpty: false,
78
- icon: registerIcon('chat-sessions-icon', Codicon.commentDiscussionSparkle, 'Icon for Chat Sessions View'),
39
+ ( Registry.as(Extensions.ViewContainersRegistry)).registerViewContainer({
40
+ id: AGENT_SESSIONS_VIEWLET_ID,
41
+ title: ( localize2(5402, "Agent Sessions")),
42
+ ctorDescriptor: ( new SyncDescriptor(ChatSessionsViewPaneContainer)),
43
+ hideIfEmpty: true,
44
+ icon: registerIcon('chat-sessions-icon', Codicon.commentDiscussionSparkle, 'Icon for Agent Sessions View'),
79
45
  order: 6
80
46
  }, ViewContainerLocation.Sidebar);
81
- this.isViewContainerRegistered = true;
82
- }
83
- deregisterViewContainer() {
84
- if (this.viewContainer) {
85
- const allViews = ( Registry.as(Extensions.ViewsRegistry)).getViews(this.viewContainer);
86
- if (allViews.length > 0) {
87
- ( Registry.as(Extensions.ViewsRegistry)).deregisterViews(allViews, this.viewContainer);
88
- }
89
- ( Registry.as(Extensions.ViewContainersRegistry)).deregisterViewContainer(this.viewContainer);
90
- this.viewContainer = undefined;
91
- this.isViewContainerRegistered = false;
92
- }
93
47
  }
94
- };
95
- ChatSessionsView = ( __decorate([
96
- ( __param(0, IConfigurationService)),
97
- ( __param(1, IInstantiationService)),
98
- ( __param(2, IChatSessionsService)),
99
- ( __param(3, IChatEntitlementService))
100
- ], ChatSessionsView));
101
- let ChatSessionsViewPaneContainer = class ChatSessionsViewPaneContainer extends ViewPaneContainer {
102
- constructor(sessionTracker, instantiationService, configurationService, layoutService, contextMenuService, telemetryService, extensionService, themeService, storageService, contextService, viewDescriptorService, logService, productService, chatSessionsService) {
103
- super(VIEWLET_ID, {
104
- mergeViewWithContainerWhenSingleView: false,
105
- }, instantiationService, configurationService, layoutService, contextMenuService, telemetryService, extensionService, themeService, storageService, contextService, viewDescriptorService, logService);
106
- this.sessionTracker = sessionTracker;
107
- this.productService = productService;
48
+ }
49
+ let ChatSessionsViewContrib = class ChatSessionsViewContrib extends Disposable {
50
+ static { this.ID = 'workbench.contrib.chatSessions'; }
51
+ constructor(instantiationService, chatSessionsService, logService, productService) {
52
+ super();
53
+ this.instantiationService = instantiationService;
108
54
  this.chatSessionsService = chatSessionsService;
55
+ this.logService = logService;
56
+ this.productService = productService;
109
57
  this.registeredViewDescriptors = ( new Map());
110
- this.updateViewRegistration();
58
+ this.sessionTracker = this._register(this.instantiationService.createInstance(ChatSessionTracker));
59
+ void this.updateViewRegistration();
111
60
  this._register(this.chatSessionsService.onDidChangeItemsProviders(() => {
112
- this.updateViewRegistration();
113
- }));
114
- this._register(this.chatSessionsService.onDidChangeSessionItems((chatSessionType) => {
115
- this.refreshProviderTree(chatSessionType);
61
+ void this.updateViewRegistration();
116
62
  }));
117
63
  this._register(this.chatSessionsService.onDidChangeAvailability(() => {
118
- this.updateViewRegistration();
64
+ void this.updateViewRegistration();
119
65
  }));
120
66
  }
121
- getTitle() {
122
- const title = ( localize(5239, "Chat Sessions"));
123
- return title;
124
- }
125
67
  getAllChatSessionItemProviders() {
126
68
  return Array.from(this.chatSessionsService.getAllChatSessionItemProviders());
127
69
  }
128
- refreshProviderTree(chatSessionType) {
129
- const providers = this.getAllChatSessionItemProviders();
130
- const targetProvider = providers.find(provider => provider.chatSessionType === chatSessionType);
131
- if (targetProvider) {
132
- const viewId = `${VIEWLET_ID}.${chatSessionType}`;
133
- const view = this.getView(viewId);
134
- if (view) {
135
- view.refreshTree();
136
- }
137
- }
138
- }
139
70
  async updateViewRegistration() {
140
71
  const contributions = this.chatSessionsService.getAllChatSessionContributions();
141
- await Promise.all(( contributions.map(contrib => this.chatSessionsService.canResolveItemProvider(contrib.type))));
72
+ await Promise.all(( contributions.map(
73
+ contrib => this.chatSessionsService.hasChatSessionItemProvider(contrib.type)
74
+ )));
142
75
  const currentProviders = this.getAllChatSessionItemProviders();
143
76
  const currentProviderIds = ( new Set(( currentProviders.map(p => p.chatSessionType))));
144
77
  const viewsToUnregister = [];
@@ -149,7 +82,7 @@ let ChatSessionsViewPaneContainer = class ChatSessionsViewPaneContainer extends
149
82
  }
150
83
  }
151
84
  if (viewsToUnregister.length > 0) {
152
- const container = ( Registry.as(Extensions.ViewContainersRegistry)).get(VIEWLET_ID);
85
+ const container = ( Registry.as(Extensions.ViewContainersRegistry)).get(AGENT_SESSIONS_VIEWLET_ID);
153
86
  if (container) {
154
87
  ( Registry.as(Extensions.ViewsRegistry)).deregisterViews(viewsToUnregister, container);
155
88
  }
@@ -157,13 +90,13 @@ let ChatSessionsViewPaneContainer = class ChatSessionsViewPaneContainer extends
157
90
  this.registerViews(contributions);
158
91
  }
159
92
  async registerViews(extensionPointContributions) {
160
- const container = ( Registry.as(Extensions.ViewContainersRegistry)).get(VIEWLET_ID);
93
+ const container = ( Registry.as(Extensions.ViewContainersRegistry)).get(AGENT_SESSIONS_VIEWLET_ID);
161
94
  const providers = this.getAllChatSessionItemProviders();
162
95
  if (container && providers.length > 0) {
163
96
  const viewDescriptorsToRegister = [];
164
- const localProvider = providers.find(p => p.chatSessionType === 'local');
97
+ const localProvider = providers.find(p => p.chatSessionType === localChatSessionType);
165
98
  const historyProvider = providers.find(p => p.chatSessionType === 'history');
166
- const otherProviders = providers.filter(p => p.chatSessionType !== 'local' && p.chatSessionType !== 'history');
99
+ const otherProviders = providers.filter(p => p.chatSessionType !== localChatSessionType && p.chatSessionType !== 'history');
167
100
  const providersWithDisplayNames = ( otherProviders.map(provider => {
168
101
  const extContribution = extensionPointContributions.find(c => c.type === provider.chatSessionType);
169
102
  if (!extContribution) {
@@ -172,28 +105,45 @@ let ChatSessionsViewPaneContainer = class ChatSessionsViewPaneContainer extends
172
105
  }
173
106
  return {
174
107
  provider,
175
- displayName: extContribution.displayName
108
+ displayName: extContribution.displayName,
109
+ order: extContribution.order
176
110
  };
177
111
  })).filter(item => item !== null);
178
- providersWithDisplayNames.sort((a, b) => a.displayName.localeCompare(b.displayName));
112
+ providersWithDisplayNames.sort((a, b) => {
113
+ if (a.order === undefined && b.order === undefined) {
114
+ return a.displayName.localeCompare(b.displayName);
115
+ }
116
+ if (a.order === undefined) {
117
+ return 1;
118
+ }
119
+ if (b.order === undefined) {
120
+ return -1;
121
+ }
122
+ const orderCompare = a.order - b.order;
123
+ if (orderCompare !== 0) {
124
+ return orderCompare;
125
+ }
126
+ return a.displayName.localeCompare(b.displayName);
127
+ });
179
128
  const orderedProviders = [
180
- ...(localProvider ? [{ provider: localProvider, displayName: 'Local Chat Sessions', baseOrder: 0 }] : []),
181
- ...(historyProvider ? [{ provider: historyProvider, displayName: 'History', baseOrder: 1, when: undefined }] : []),
129
+ ...(localProvider ? [{ provider: localProvider, displayName: 'Local Chat Agent', baseOrder: 0, when: ChatContextKeyExprs.agentViewWhen }] : []),
130
+ ...(historyProvider ? [{ provider: historyProvider, displayName: 'History', baseOrder: 1, when: ChatContextKeyExprs.agentViewWhen }] : []),
182
131
  ...( providersWithDisplayNames.map((item, index) => ({
183
132
  ...item,
184
133
  baseOrder: 2 + index,
185
- when: undefined,
134
+ when: ChatContextKeyExprs.agentViewWhen,
186
135
  })))
187
136
  ];
188
137
  orderedProviders.forEach(({ provider, displayName, baseOrder, when }) => {
189
138
  if (!( this.registeredViewDescriptors.has(provider.chatSessionType))) {
139
+ const viewId = `${AGENT_SESSIONS_VIEWLET_ID}.${provider.chatSessionType}`;
190
140
  const viewDescriptor = {
191
- id: `${VIEWLET_ID}.${provider.chatSessionType}`,
141
+ id: viewId,
192
142
  name: {
193
143
  value: displayName,
194
144
  original: displayName,
195
145
  },
196
- ctorDescriptor: ( new SyncDescriptor(SessionsViewPane, [provider, this.sessionTracker])),
146
+ ctorDescriptor: ( new SyncDescriptor(SessionsViewPane, [provider, this.sessionTracker, viewId])),
197
147
  canToggleVisibility: true,
198
148
  canMoveView: true,
199
149
  order: baseOrder,
@@ -201,33 +151,33 @@ let ChatSessionsViewPaneContainer = class ChatSessionsViewPaneContainer extends
201
151
  };
202
152
  viewDescriptorsToRegister.push(viewDescriptor);
203
153
  this.registeredViewDescriptors.set(provider.chatSessionType, viewDescriptor);
204
- if (provider.chatSessionType === 'local') {
154
+ if (provider.chatSessionType === localChatSessionType) {
205
155
  const viewsRegistry = ( Registry.as(Extensions.ViewsRegistry));
206
156
  this._register(viewsRegistry.registerViewWelcomeContent(viewDescriptor.id, {
207
157
  content: ( localize(
208
- 5240,
209
- "No local chat sessions\n[Start a Chat](command:{0})",
158
+ 5403,
159
+ "No local chat agent sessions\n[Start an Agent Session](command:{0})",
210
160
  ACTION_ID_OPEN_CHAT
211
161
  )),
212
162
  }));
213
163
  }
214
164
  }
215
165
  });
216
- const gettingStartedViewId = `${VIEWLET_ID}.gettingStarted`;
166
+ const gettingStartedViewId = `${AGENT_SESSIONS_VIEWLET_ID}.gettingStarted`;
217
167
  if (!( this.registeredViewDescriptors.has('gettingStarted'))
218
- && this.productService.chatSessionRecommendations
219
- && this.productService.chatSessionRecommendations.length) {
168
+ && this.productService.chatSessionRecommendations?.length) {
220
169
  const gettingStartedDescriptor = {
221
170
  id: gettingStartedViewId,
222
171
  name: {
223
- value: ( localize(5241, "Getting Started")),
172
+ value: ( localize(5404, "Getting Started")),
224
173
  original: 'Getting Started',
225
174
  },
226
- ctorDescriptor: ( new SyncDescriptor(SessionsViewPane, [null, this.sessionTracker])),
175
+ ctorDescriptor: ( new SyncDescriptor(SessionsViewPane, [null, this.sessionTracker, gettingStartedViewId])),
227
176
  canToggleVisibility: true,
228
177
  canMoveView: true,
229
178
  order: 1000,
230
179
  collapsed: !!otherProviders.length,
180
+ when: ( ContextKeyExpr.false())
231
181
  };
232
182
  viewDescriptorsToRegister.push(gettingStartedDescriptor);
233
183
  this.registeredViewDescriptors.set('gettingStarted', gettingStartedDescriptor);
@@ -239,7 +189,7 @@ let ChatSessionsViewPaneContainer = class ChatSessionsViewPaneContainer extends
239
189
  }
240
190
  dispose() {
241
191
  if (this.registeredViewDescriptors.size > 0) {
242
- const container = ( Registry.as(Extensions.ViewContainersRegistry)).get(VIEWLET_ID);
192
+ const container = ( Registry.as(Extensions.ViewContainersRegistry)).get(AGENT_SESSIONS_VIEWLET_ID);
243
193
  if (container) {
244
194
  const allRegisteredViews = Array.from(( this.registeredViewDescriptors.values()));
245
195
  ( Registry.as(Extensions.ViewsRegistry)).deregisterViews(allRegisteredViews, container);
@@ -249,20 +199,35 @@ let ChatSessionsViewPaneContainer = class ChatSessionsViewPaneContainer extends
249
199
  super.dispose();
250
200
  }
251
201
  };
202
+ ChatSessionsViewContrib = ( __decorate([
203
+ ( __param(0, IInstantiationService)),
204
+ ( __param(1, IChatSessionsService)),
205
+ ( __param(2, ILogService)),
206
+ ( __param(3, IProductService))
207
+ ], ChatSessionsViewContrib));
208
+ let ChatSessionsViewPaneContainer = class ChatSessionsViewPaneContainer extends ViewPaneContainer {
209
+ constructor(instantiationService, configurationService, layoutService, contextMenuService, telemetryService, extensionService, themeService, storageService, contextService, viewDescriptorService, logService) {
210
+ super(AGENT_SESSIONS_VIEWLET_ID, {
211
+ mergeViewWithContainerWhenSingleView: false,
212
+ }, instantiationService, configurationService, layoutService, contextMenuService, telemetryService, extensionService, themeService, storageService, contextService, viewDescriptorService, logService);
213
+ }
214
+ getTitle() {
215
+ const title = ( localize(5405, "Agent Sessions"));
216
+ return title;
217
+ }
218
+ };
252
219
  ChatSessionsViewPaneContainer = ( __decorate([
253
- ( __param(1, IInstantiationService)),
254
- ( __param(2, IConfigurationService)),
255
- ( __param(3, IWorkbenchLayoutService)),
256
- ( __param(4, IContextMenuService)),
257
- ( __param(5, ITelemetryService)),
258
- ( __param(6, IExtensionService)),
259
- ( __param(7, IThemeService)),
260
- ( __param(8, IStorageService)),
261
- ( __param(9, IWorkspaceContextService)),
262
- ( __param(10, IViewDescriptorService)),
263
- ( __param(11, ILogService)),
264
- ( __param(12, IProductService)),
265
- ( __param(13, IChatSessionsService))
220
+ ( __param(0, IInstantiationService)),
221
+ ( __param(1, IConfigurationService)),
222
+ ( __param(2, IWorkbenchLayoutService)),
223
+ ( __param(3, IContextMenuService)),
224
+ ( __param(4, ITelemetryService)),
225
+ ( __param(5, IExtensionService)),
226
+ ( __param(6, IThemeService)),
227
+ ( __param(7, IStorageService)),
228
+ ( __param(8, IWorkspaceContextService)),
229
+ ( __param(9, IViewDescriptorService)),
230
+ ( __param(10, ILogService))
266
231
  ], ChatSessionsViewPaneContainer));
267
232
 
268
- export { ChatSessionsView };
233
+ export { ChatSessionsView, ChatSessionsViewContrib };