@codingame/monaco-vscode-chat-service-override 22.1.9 → 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 (277) hide show
  1. package/index.js +17 -8
  2. package/package.json +43 -40
  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 +19 -19
  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 +34 -33
  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 +13 -15
  184. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibilityHelp.js +1 -1
  185. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibleView.js +2 -2
  186. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.d.ts +20 -32
  187. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +63 -140
  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 +17 -16
  190. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.js +1 -1
  191. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookModifiedCellDecorator.d.ts +1 -1
  192. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookModifiedCellDecorator.js +2 -2
  193. package/vscode/src/vs/workbench/contrib/remoteCodingAgents/browser/remoteCodingAgents.contribution.js +7 -7
  194. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminal.chat.contribution.js +3 -0
  195. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.js +16 -16
  196. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +119 -15
  197. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatController.js +6 -4
  198. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.d.ts +47 -0
  199. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.js +192 -0
  200. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.d.ts +7 -5
  201. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +21 -16
  202. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandLineAutoApprover.js +8 -3
  203. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.d.ts +2 -2
  204. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.js +18 -27
  205. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.d.ts +5 -2
  206. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.js +3 -1
  207. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.d.ts +1 -1
  208. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.js +4 -25
  209. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.d.ts +2 -2
  210. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.js +18 -27
  211. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/strategyHelpers.d.ts +12 -0
  212. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/strategyHelpers.js +31 -0
  213. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.d.ts +3 -0
  214. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +24 -8
  215. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.js +8 -0
  216. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.d.ts +1 -1
  217. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.js +33 -4
  218. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +42 -13
  219. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.js +14 -21
  220. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAnalyzer.d.ts +23 -0
  221. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.d.ts +18 -0
  222. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +227 -0
  223. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.d.ts +17 -0
  224. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +133 -0
  225. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineCdPrefixRewriter.d.ts +5 -0
  226. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineCdPrefixRewriter.js +36 -0
  227. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePwshChainOperatorRewriter.d.ts +8 -0
  228. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePwshChainOperatorRewriter.js +33 -0
  229. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineRewriter.d.ts +17 -0
  230. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalLastCommandTool.js +4 -4
  231. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +3 -3
  232. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalSelectionTool.js +3 -3
  233. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.d.ts +5 -1
  234. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +75 -37
  235. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/types.d.ts +1 -0
  236. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.d.ts +8 -0
  237. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +71 -0
  238. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.d.ts +28 -15
  239. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +366 -363
  240. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/createAndRunTaskTool.js +18 -18
  241. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/getTaskOutputTool.js +9 -9
  242. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/runTaskTool.js +16 -16
  243. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.js +1 -1
  244. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.d.ts +19 -0
  245. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.js +123 -0
  246. package/vscode/src/vs/base/common/yaml.d.ts +0 -74
  247. package/vscode/src/vs/base/common/yaml.js +0 -597
  248. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContext.d.ts +0 -8
  249. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContext.js +0 -239
  250. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTimeline.d.ts +0 -102
  251. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTimeline.js +0 -435
  252. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookDiff.d.ts +0 -14
  253. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookDiff.js +0 -67
  254. package/vscode/src/vs/workbench/contrib/chat/browser/chatPasteProviders.d.ts +0 -49
  255. package/vscode/src/vs/workbench/contrib/chat/browser/chatPasteProviders.js +0 -380
  256. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/common.d.ts +0 -37
  257. package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/common.js +0 -137
  258. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/attachInstructionsAction.d.ts +0 -44
  259. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/attachInstructionsAction.js +0 -176
  260. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/newPromptFileActions.d.ts +0 -4
  261. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/newPromptFileActions.js +0 -206
  262. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/askForPromptName.d.ts +0 -7
  263. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/askForPromptName.js +0 -79
  264. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/askForPromptSourceFolder.d.ts +0 -8
  265. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/askForPromptSourceFolder.js +0 -145
  266. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/promptFilePickers.d.ts +0 -65
  267. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/promptFilePickers.js +0 -306
  268. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveToPromptAction.d.ts +0 -12
  269. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveToPromptAction.js +0 -102
  270. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/newPromptsParser.d.ts +0 -97
  271. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/newPromptsParser.js +0 -247
  272. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.d.ts +0 -118
  273. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.js +0 -10
  274. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandSimplifier.d.ts +0 -10
  275. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandSimplifier.js +0 -55
  276. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/subCommands.d.ts +0 -2
  277. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/subCommands.js +0 -66
@@ -0,0 +1,117 @@
1
+ import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
2
+ import { TextEdit } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/languages";
3
+ import { ICellEditOperation } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon";
4
+ import { IModifiedEntryTelemetryInfo } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatEditingService";
5
+ export declare enum FileOperationType {
6
+ Create = "create",
7
+ Delete = "delete",
8
+ Rename = "rename",
9
+ TextEdit = "textEdit",
10
+ NotebookEdit = "notebookEdit"
11
+ }
12
+ /**
13
+ * Base interface for all file operations in the checkpoint timeline
14
+ */
15
+ export interface IFileOperation {
16
+ readonly type: FileOperationType;
17
+ readonly uri: URI;
18
+ readonly requestId: string;
19
+ readonly epoch: number;
20
+ }
21
+ /**
22
+ * Operation representing the creation of a new file
23
+ */
24
+ export interface IFileCreateOperation extends IFileOperation {
25
+ readonly type: FileOperationType.Create;
26
+ readonly initialContent: string;
27
+ readonly notebookViewType?: string;
28
+ readonly telemetryInfo: IModifiedEntryTelemetryInfo;
29
+ }
30
+ /**
31
+ * Operation representing the deletion of a file
32
+ */
33
+ export interface IFileDeleteOperation extends IFileOperation {
34
+ readonly type: FileOperationType.Delete;
35
+ readonly finalContent: string;
36
+ }
37
+ /**
38
+ * Operation representing the renaming/moving of a file
39
+ */
40
+ export interface IFileRenameOperation extends IFileOperation {
41
+ readonly type: FileOperationType.Rename;
42
+ readonly oldUri: URI;
43
+ readonly newUri: URI;
44
+ }
45
+ /**
46
+ * Operation representing text edits applied to a file
47
+ */
48
+ export interface ITextEditOperation extends IFileOperation {
49
+ readonly type: FileOperationType.TextEdit;
50
+ readonly edits: readonly TextEdit[];
51
+ /**
52
+ * For cell URIs, the cell index that was edited. Needed because the original
53
+ * edit URI only contains the `handle` which is not portable between notebooks.
54
+ */
55
+ readonly cellIndex?: number;
56
+ }
57
+ /**
58
+ * Operation representing notebook cell edits applied to a notebook
59
+ */
60
+ export interface INotebookEditOperation extends IFileOperation {
61
+ readonly type: FileOperationType.NotebookEdit;
62
+ readonly cellEdits: readonly ICellEditOperation[];
63
+ }
64
+ /**
65
+ * Union type of all possible file operations
66
+ */
67
+ export type FileOperation = IFileCreateOperation | IFileDeleteOperation | IFileRenameOperation | ITextEditOperation | INotebookEditOperation;
68
+ /**
69
+ * File baseline represents the initial state of a file when first edited in a request
70
+ */
71
+ export interface IFileBaseline {
72
+ readonly uri: URI;
73
+ readonly requestId: string;
74
+ readonly content: string;
75
+ readonly epoch: number;
76
+ readonly telemetryInfo: IModifiedEntryTelemetryInfo;
77
+ readonly notebookViewType?: string;
78
+ }
79
+ export interface IReconstructedFileExistsState {
80
+ readonly exists: true;
81
+ readonly content: string;
82
+ readonly uri: URI;
83
+ readonly telemetryInfo: IModifiedEntryTelemetryInfo;
84
+ readonly notebookViewType?: string;
85
+ }
86
+ export interface IReconstructedFileNotExistsState {
87
+ readonly exists: false;
88
+ readonly uri: URI;
89
+ }
90
+ /**
91
+ * The reconstructed state of a file at a specific checkpoint
92
+ */
93
+ export type IReconstructedFileState = IReconstructedFileNotExistsState | IReconstructedFileExistsState;
94
+ /**
95
+ * Checkpoint represents a stable state that can be navigated to
96
+ */
97
+ export interface ICheckpoint {
98
+ readonly checkpointId: string;
99
+ readonly requestId: string | undefined;
100
+ readonly undoStopId: string | undefined;
101
+ readonly epoch: number;
102
+ readonly label: string;
103
+ readonly description?: string;
104
+ }
105
+ /**
106
+ * State that can be persisted and restored for the checkpoint timeline
107
+ */
108
+ export interface IChatEditingTimelineState {
109
+ readonly checkpoints: readonly ICheckpoint[];
110
+ readonly fileBaselines: [
111
+ string,
112
+ IFileBaseline
113
+ ][];
114
+ readonly operations: readonly FileOperation[];
115
+ readonly currentEpoch: number;
116
+ readonly epochCounter: number;
117
+ }
@@ -0,0 +1,12 @@
1
+
2
+
3
+ var FileOperationType;
4
+ (function (FileOperationType) {
5
+ FileOperationType["Create"] = "create";
6
+ FileOperationType["Delete"] = "delete";
7
+ FileOperationType["Rename"] = "rename";
8
+ FileOperationType["TextEdit"] = "textEdit";
9
+ FileOperationType["NotebookEdit"] = "notebookEdit";
10
+ })(FileOperationType || (FileOperationType = {}));
11
+
12
+ export { FileOperationType };
@@ -14,12 +14,12 @@ import { IDecorationsService } from "@codingame/monaco-vscode-api/vscode/vs/work
14
14
  import { IEditorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service";
15
15
  import { IExtensionService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service";
16
16
  import { ILifecycleService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/lifecycle/common/lifecycle.service";
17
- import { IMultiDiffSourceResolver, IResolvedMultiDiffSource } from "@codingame/monaco-vscode-7969284a-1a12-5148-9750-fcf9656a693f-common/vscode/vs/workbench/contrib/multiDiffEditor/browser/multiDiffSourceResolverService";
17
+ import { IMultiDiffSourceResolver, IResolvedMultiDiffSource } from "@codingame/monaco-vscode-aac7027b-326c-513a-95a9-e4eedd151b38-common/vscode/vs/workbench/contrib/multiDiffEditor/browser/multiDiffSourceResolverService";
18
18
  import { IMultiDiffSourceResolverService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/multiDiffEditor/browser/multiDiffSourceResolverService.service";
19
19
  import { INotebookService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookService.service";
20
20
  import { IChatEditingSession, IChatRelatedFile, IChatRelatedFilesProvider } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatEditingService";
21
21
  import { IChatEditingService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatEditingService.service";
22
- import { ChatModel } from "@codingame/monaco-vscode-c2deffc4-ad68-5e63-8f95-9b89e0fc6898-common/vscode/vs/workbench/contrib/chat/common/chatModel";
22
+ import { ChatModel } from "@codingame/monaco-vscode-2339d6ac-d6bb-53cd-95ee-81911735d1c7-common/vscode/vs/workbench/contrib/chat/common/chatModel";
23
23
  import { IChatService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService.service";
24
24
  export declare class ChatEditingService extends Disposable implements IChatEditingService {
25
25
  private readonly _instantiationService;
@@ -38,13 +38,15 @@ export declare class ChatEditingService extends Disposable implements IChatEditi
38
38
  dispose(): void;
39
39
  startOrContinueGlobalEditingSession(chatModel: ChatModel, waitForRestore?: boolean): Promise<IChatEditingSession>;
40
40
  private _lookupEntry;
41
- getEditingSession(chatSessionId: string): IChatEditingSession | undefined;
41
+ getEditingSession(chatSessionResource: URI): IChatEditingSession | undefined;
42
42
  createEditingSession(chatModel: ChatModel, global?: boolean): Promise<IChatEditingSession>;
43
+ transferEditingSession(chatModel: ChatModel, session: IChatEditingSession): Promise<IChatEditingSession>;
44
+ private _createEditingSession;
43
45
  private installAutoApplyObserver;
44
46
  private observerEditsInResponse;
45
47
  hasRelatedFilesProviders(): boolean;
46
48
  registerRelatedFilesProvider(handle: number, provider: IChatRelatedFilesProvider): IDisposable;
47
- getRelatedFiles(chatSessionId: string, prompt: string, files: URI[], token: CancellationToken): Promise<{
49
+ getRelatedFiles(chatSessionResource: URI, prompt: string, files: URI[], token: CancellationToken): Promise<{
48
50
  group: string;
49
51
  files: IChatRelatedFile[];
50
52
  }[] | undefined>;
@@ -2,6 +2,7 @@
2
2
  import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
3
  import { coalesce, delta, compareBy } from '@codingame/monaco-vscode-api/vscode/vs/base/common/arrays';
4
4
  import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
5
+ import { groupBy } from '@codingame/monaco-vscode-api/vscode/vs/base/common/collections';
5
6
  import { ErrorNoTelemetry } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
6
7
  import { Event, Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
7
8
  import { Iterable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/iterator';
@@ -28,16 +29,14 @@ import { IDecorationsService } from '@codingame/monaco-vscode-api/vscode/vs/work
28
29
  import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
29
30
  import { IExtensionService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service';
30
31
  import { ILifecycleService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/lifecycle/common/lifecycle.service';
31
- import { MultiDiffEditorItem } from '@codingame/monaco-vscode-7969284a-1a12-5148-9750-fcf9656a693f-common/vscode/vs/workbench/contrib/multiDiffEditor/browser/multiDiffSourceResolverService';
32
+ import { MultiDiffEditorItem } from '@codingame/monaco-vscode-aac7027b-326c-513a-95a9-e4eedd151b38-common/vscode/vs/workbench/contrib/multiDiffEditor/browser/multiDiffSourceResolverService';
32
33
  import { IMultiDiffSourceResolverService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/multiDiffEditor/browser/multiDiffSourceResolverService.service';
33
34
  import { CellUri } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
34
35
  import { INotebookService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookService.service';
35
- import { IChatAgentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatAgents.service';
36
36
  import { chatEditingAgentSupportsReadonlyReferencesContextKey, ChatEditingSessionState, ModifiedFileEntryState, CHAT_EDITING_MULTI_DIFF_SOURCE_RESOLVER_SCHEME, parseChatMultiDiffUri, chatEditingResourceContextKey, inChatEditingSessionContextKey } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatEditingService';
37
- import { isCellTextEditOperation } from '@codingame/monaco-vscode-c2deffc4-ad68-5e63-8f95-9b89e0fc6898-common/vscode/vs/workbench/contrib/chat/common/chatModel';
37
+ import { isCellTextEditOperationArray } from '@codingame/monaco-vscode-2339d6ac-d6bb-53cd-95ee-81911735d1c7-common/vscode/vs/workbench/contrib/chat/common/chatModel';
38
38
  import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService.service';
39
- import { ChatAgentLocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
40
- import { ChatEditorInput } from '@codingame/monaco-vscode-b994942c-360d-5b68-8a33-77d4bde6b714-common/vscode/vs/workbench/contrib/chat/browser/chatEditorInput';
39
+ import { ChatEditorInput } from '@codingame/monaco-vscode-aac7027b-326c-513a-95a9-e4eedd151b38-common/vscode/vs/workbench/contrib/chat/browser/chatEditorInput';
41
40
  import { AbstractChatEditingModifiedFileEntry } from './chatEditingModifiedFileEntry.js';
42
41
  import { ChatEditingSession } from './chatEditingSession.js';
43
42
  import { ChatEditingTextModelContentProvider, ChatEditingSnapshotTextModelContentProvider } from './chatEditingTextModelContentProviders.js';
@@ -68,7 +67,7 @@ let ChatEditingService = class ChatEditingService extends Disposable {
68
67
  this._register(textModelService.registerTextModelContentProvider(Schemas.chatEditingSnapshotScheme, _instantiationService.createInstance(ChatEditingSnapshotTextModelContentProvider, this)));
69
68
  this._register(this._chatService.onDidDisposeSession((e) => {
70
69
  if (e.reason === 'cleared') {
71
- this.getEditingSession(e.sessionId)?.stop();
70
+ this.getEditingSession(e.sessionResource)?.stop();
72
71
  }
73
72
  }));
74
73
  const readonlyEnabledContextKey = chatEditingAgentSupportsReadonlyReferencesContextKey.bindTo(contextKeyService);
@@ -98,7 +97,7 @@ let ChatEditingService = class ChatEditingService extends Disposable {
98
97
  }
99
98
  e.join(storageTask, {
100
99
  id: 'join.chatEditingSession',
101
- label: ( localize(5104, "Saving chat edits history"))
100
+ label: ( localize(5181, "Saving chat edits history"))
102
101
  });
103
102
  }));
104
103
  }
@@ -110,7 +109,7 @@ let ChatEditingService = class ChatEditingService extends Disposable {
110
109
  if (waitForRestore) {
111
110
  await this._restoringEditingSession;
112
111
  }
113
- const session = this.getEditingSession(chatModel.sessionId);
112
+ const session = this.getEditingSession(chatModel.sessionResource);
114
113
  if (session) {
115
114
  return session;
116
115
  }
@@ -126,14 +125,20 @@ let ChatEditingService = class ChatEditingService extends Disposable {
126
125
  }
127
126
  return undefined;
128
127
  }
129
- getEditingSession(chatSessionId) {
128
+ getEditingSession(chatSessionResource) {
130
129
  return this.editingSessionsObs.get()
131
- .find(candidate => candidate.chatSessionId === chatSessionId);
130
+ .find(candidate => isEqual(candidate.chatSessionResource, chatSessionResource));
132
131
  }
133
132
  async createEditingSession(chatModel, global = false) {
134
- assertType(this.getEditingSession(chatModel.sessionId) === undefined, 'CANNOT have more than one editing session per chat session');
135
- const session = this._instantiationService.createInstance(ChatEditingSession, chatModel.sessionId, global, this._lookupEntry.bind(this));
136
- await session.init();
133
+ return this._createEditingSession(chatModel, global, undefined);
134
+ }
135
+ async transferEditingSession(chatModel, session) {
136
+ return this._createEditingSession(chatModel, session.isGlobalEditingSession, session);
137
+ }
138
+ async _createEditingSession(chatModel, global, initFrom) {
139
+ assertType(this.getEditingSession(chatModel.sessionResource) === undefined, 'CANNOT have more than one editing session per chat session');
140
+ const session = this._instantiationService.createInstance(ChatEditingSession, chatModel.sessionId, chatModel.sessionResource, global, this._lookupEntry.bind(this));
141
+ await session.init(initFrom);
137
142
  const list = this._sessionsObs.get();
138
143
  const removeSession = list.unshift(session);
139
144
  const store = ( new DisposableStore());
@@ -173,32 +178,29 @@ let ChatEditingService = class ChatEditingService extends Disposable {
173
178
  const editorListener = Event.once(this._editorService.onDidActiveEditorChange)(() => {
174
179
  editorDidChange = true;
175
180
  });
176
- const editedFilesExist = ( new ResourceMap());
181
+ const editorOpenPromises = ( new ResourceMap());
182
+ const openChatEditedFiles = this._configurationService.getValue('accessibility.openChatEditedFiles');
177
183
  const ensureEditorOpen = (partUri) => {
178
184
  const uri = CellUri.parse(partUri)?.notebook ?? partUri;
179
- if (( editedFilesExist.has(uri))) {
185
+ if (( editorOpenPromises.has(uri))) {
180
186
  return;
181
187
  }
182
- const fileExists = this.notebookService.getNotebookTextModel(uri) ? Promise.resolve(true) : this._fileService.exists(uri);
183
- editedFilesExist.set(uri, fileExists.then((e) => {
184
- if (!e) {
185
- return;
186
- }
187
- const activeUri = this._editorService.activeEditorPane?.input.resource;
188
- const inactive = editorDidChange
189
- || this._editorService.activeEditorPane?.input instanceof ChatEditorInput && this._editorService.activeEditorPane.input.sessionId === session.chatSessionId
190
- || Boolean(activeUri && session.entries.get().find(entry => isEqual(activeUri, entry.modifiedURI)));
191
- if (this._configurationService.getValue('accessibility.openChatEditedFiles')) {
188
+ editorOpenPromises.set(uri, (async () => {
189
+ if (this.notebookService.getNotebookTextModel(uri) || uri.scheme === Schemas.untitled || (await this._fileService.exists(uri).catch(() => false))) {
190
+ const activeUri = this._editorService.activeEditorPane?.input.resource;
191
+ const inactive = editorDidChange
192
+ || this._editorService.activeEditorPane?.input instanceof ChatEditorInput && this._editorService.activeEditorPane.input.sessionId === session.chatSessionId
193
+ || Boolean(activeUri && session.entries.get().find(entry => isEqual(activeUri, entry.modifiedURI)));
192
194
  this._editorService.openEditor({ resource: uri, options: { inactive, preserveFocus: true, pinned: true } });
193
195
  }
194
- }));
196
+ })());
195
197
  };
196
198
  const onResponseComplete = () => {
197
199
  for (const remaining of editsSeen) {
198
200
  remaining?.streaming.complete();
199
201
  }
200
202
  editsSeen.length = 0;
201
- editedFilesExist.clear();
203
+ editorOpenPromises.clear();
202
204
  editorListener.dispose();
203
205
  };
204
206
  const handleResponseParts = async () => {
@@ -215,32 +217,37 @@ let ChatEditingService = class ChatEditingService extends Disposable {
215
217
  if (part.kind !== 'textEditGroup' && part.kind !== 'notebookEditGroup') {
216
218
  continue;
217
219
  }
218
- ensureEditorOpen(part.uri);
220
+ if (part.isExternalEdit) {
221
+ continue;
222
+ }
223
+ if (openChatEditedFiles) {
224
+ ensureEditorOpen(part.uri);
225
+ }
219
226
  let entry = editsSeen[i];
220
227
  if (!entry) {
221
228
  entry = { seen: 0, streaming: session.startStreamingEdits(CellUri.parse(part.uri)?.notebook ?? part.uri, responseModel, undoStop) };
222
229
  editsSeen[i] = entry;
223
230
  }
224
231
  const isFirst = entry.seen === 0;
225
- const newEdits = part.edits.slice(entry.seen).flat();
232
+ const newEdits = part.edits.slice(entry.seen);
226
233
  entry.seen = part.edits.length;
227
234
  if (newEdits.length > 0 || isFirst) {
228
- if (part.kind === 'notebookEditGroup') {
229
- newEdits.forEach((edit, idx) => {
230
- const done = part.done ? idx === newEdits.length - 1 : false;
231
- if (TextEdit.isTextEdit(edit)) {
232
- return;
233
- }
234
- else if (isCellTextEditOperation(edit)) {
235
- entry.streaming.pushNotebookCellText(edit.uri, [edit.edit], done);
236
- }
237
- else {
238
- entry.streaming.pushNotebook([edit], done);
235
+ for (let i = 0; i < newEdits.length; i++) {
236
+ const edit = newEdits[i];
237
+ const done = part.done ? i === newEdits.length - 1 : false;
238
+ if (isTextEditOperationArray(edit)) {
239
+ entry.streaming.pushText(edit, done);
240
+ }
241
+ else if (isCellTextEditOperationArray(edit)) {
242
+ for (const edits of ( Object.values(groupBy(edit, e => ( e.uri.toString()))))) {
243
+ if (edits) {
244
+ entry.streaming.pushNotebookCellText(edits[0].uri, ( edits.map(e => e.edit)), done);
245
+ }
239
246
  }
240
- });
241
- }
242
- else if (part.kind === 'textEditGroup') {
243
- entry.streaming.pushText(newEdits, part.done ?? false);
247
+ }
248
+ else {
249
+ entry.streaming.pushNotebook(edit, done);
250
+ }
244
251
  }
245
252
  }
246
253
  if (part.done) {
@@ -278,7 +285,7 @@ let ChatEditingService = class ChatEditingService extends Disposable {
278
285
  this._chatRelatedFilesProviders.delete(handle);
279
286
  });
280
287
  }
281
- async getRelatedFiles(chatSessionId, prompt, files, token) {
288
+ async getRelatedFiles(chatSessionResource, prompt, files, token) {
282
289
  const providers = Array.from(( this._chatRelatedFilesProviders.values()));
283
290
  const result = await Promise.all(( providers.map(async (provider) => {
284
291
  try {
@@ -321,12 +328,11 @@ function observeArrayChanges(obs, compare, store) {
321
328
  }));
322
329
  return emitter.event;
323
330
  }
324
- let ChatDecorationsProvider = class ChatDecorationsProvider extends Disposable {
325
- constructor(_sessions, _chatAgentService) {
331
+ class ChatDecorationsProvider extends Disposable {
332
+ constructor(_sessions) {
326
333
  super();
327
334
  this._sessions = _sessions;
328
- this._chatAgentService = _chatAgentService;
329
- this.label = ( localize(5105, "Chat Editing"));
335
+ this.label = ( localize(5182, "Chat Editing"));
330
336
  this._currentEntries = derived(this, (r) => {
331
337
  const sessions = this._sessions.read(r);
332
338
  if (!sessions) {
@@ -362,20 +368,16 @@ let ChatDecorationsProvider = class ChatDecorationsProvider extends Disposable {
362
368
  }
363
369
  const isModified = ( this._modifiedUris.get().some(e => ( e.toString()) === ( uri.toString())));
364
370
  if (isModified) {
365
- const defaultAgentName = this._chatAgentService.getDefaultAgent(ChatAgentLocation.Chat)?.fullName;
366
371
  return {
367
372
  weight: 1000,
368
373
  letter: Codicon.diffModified,
369
- tooltip: defaultAgentName ? ( localize(5106, "Pending changes from {0}", defaultAgentName)) : ( localize(5107, "Pending changes from chat")),
374
+ tooltip: ( localize(5183, "Pending changes from chat")),
370
375
  bubble: true
371
376
  };
372
377
  }
373
378
  return undefined;
374
379
  }
375
- };
376
- ChatDecorationsProvider = ( __decorate([
377
- ( __param(1, IChatAgentService))
378
- ], ChatDecorationsProvider));
380
+ }
379
381
  let ChatEditingMultiDiffSourceResolver = class ChatEditingMultiDiffSourceResolver {
380
382
  constructor(_editingSessionsObs, _instantiationService) {
381
383
  this._editingSessionsObs = _editingSessionsObs;
@@ -426,5 +428,8 @@ class ChatEditingMultiDiffSource {
426
428
  };
427
429
  }
428
430
  }
431
+ function isTextEditOperationArray(value) {
432
+ return ( value.some(e => TextEdit.isTextEdit(e)));
433
+ }
429
434
 
430
435
  export { ChatEditingMultiDiffSourceResolver, ChatEditingService };
@@ -1,3 +1,4 @@
1
+ import { VSBuffer } from "@codingame/monaco-vscode-api/vscode/vs/base/common/buffer";
1
2
  import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
2
3
  import { IObservable, IReader } from "@codingame/monaco-vscode-api/vscode/vs/base/common/observable";
3
4
  import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
@@ -7,16 +8,20 @@ import { ITextModel } from "@codingame/monaco-vscode-api/vscode/vs/editor/common
7
8
  import { IModelService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/model.service";
8
9
  import { ITextModelService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/resolverService.service";
9
10
  import { IAccessibilitySignalService } from "@codingame/monaco-vscode-api/vscode/vs/platform/accessibilitySignal/browser/accessibilitySignalService.service";
11
+ import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
10
12
  import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
13
+ import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
11
14
  import { IEditorGroupsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService.service";
12
15
  import { IEditorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service";
13
16
  import { INotebookService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookService.service";
14
- import { ChatEditingSessionState, IChatEditingSession, IModifiedFileEntry, ISnapshotEntry, IStreamingEdits } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatEditingService";
15
- import { IChatResponseModel } from "@codingame/monaco-vscode-c2deffc4-ad68-5e63-8f95-9b89e0fc6898-common/vscode/vs/workbench/contrib/chat/common/chatModel";
17
+ import { ChatEditingSessionState, IChatEditingSession, IModifiedFileEntry, IStreamingEdits } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatEditingService";
18
+ import { IChatResponseModel } from "@codingame/monaco-vscode-2339d6ac-d6bb-53cd-95ee-81911735d1c7-common/vscode/vs/workbench/contrib/chat/common/chatModel";
19
+ import { IChatProgress } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService";
16
20
  import { IChatService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService.service";
17
21
  import { AbstractChatEditingModifiedFileEntry } from "./chatEditingModifiedFileEntry.js";
18
22
  export declare class ChatEditingSession extends Disposable implements IChatEditingSession {
19
23
  readonly chatSessionId: string;
24
+ readonly chatSessionResource: URI;
20
25
  readonly isGlobalEditingSession: boolean;
21
26
  private _lookupExternalEntry;
22
27
  private readonly _instantiationService;
@@ -29,12 +34,21 @@ export declare class ChatEditingSession extends Disposable implements IChatEditi
29
34
  private readonly _chatService;
30
35
  private readonly _notebookService;
31
36
  private readonly _accessibilitySignalService;
37
+ private readonly _logService;
38
+ private readonly configurationService;
32
39
  private readonly _state;
33
40
  private readonly _timeline;
34
41
  /**
35
42
  * Contains the contents of a file when the AI first began doing edits to it.
36
43
  */
37
44
  private readonly _initialFileContents;
45
+ private readonly _baselineCreationLocks;
46
+ private readonly _streamingEditLocks;
47
+ /**
48
+ * Tracks active external edit operations.
49
+ * Key is operationId, value contains the operation state.
50
+ */
51
+ private readonly _externalEditOperations;
38
52
  private readonly _entriesObs;
39
53
  get entries(): IObservable<readonly IModifiedFileEntry[]>;
40
54
  private _editorPane;
@@ -43,26 +57,21 @@ export declare class ChatEditingSession extends Disposable implements IChatEditi
43
57
  readonly canRedo: IObservable<boolean>;
44
58
  private readonly _onDidDispose;
45
59
  get onDidDispose(): import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event<void>;
46
- constructor(chatSessionId: string, isGlobalEditingSession: boolean, _lookupExternalEntry: (uri: URI) => AbstractChatEditingModifiedFileEntry | undefined, _instantiationService: IInstantiationService, _modelService: IModelService, _languageService: ILanguageService, _textModelService: ITextModelService, _bulkEditService: IBulkEditService, _editorGroupsService: IEditorGroupsService, _editorService: IEditorService, _chatService: IChatService, _notebookService: INotebookService, _accessibilitySignalService: IAccessibilitySignalService);
47
- init(): Promise<void>;
60
+ constructor(chatSessionId: string, chatSessionResource: URI, isGlobalEditingSession: boolean, _lookupExternalEntry: (uri: URI) => AbstractChatEditingModifiedFileEntry | undefined, _instantiationService: IInstantiationService, _modelService: IModelService, _languageService: ILanguageService, _textModelService: ITextModelService, _bulkEditService: IBulkEditService, _editorGroupsService: IEditorGroupsService, _editorService: IEditorService, _chatService: IChatService, _notebookService: INotebookService, _accessibilitySignalService: IAccessibilitySignalService, _logService: ILogService, configurationService: IConfigurationService);
61
+ private _getTimelineDelegate;
62
+ init(transferFrom?: IChatEditingSession): Promise<void>;
48
63
  private _getEntry;
49
64
  getEntry(uri: URI): IModifiedFileEntry | undefined;
50
65
  readEntry(uri: URI, reader: IReader | undefined): IModifiedFileEntry | undefined;
51
66
  storeState(): Promise<void>;
52
- private _ensurePendingSnapshot;
53
- getEntryDiffBetweenStops(uri: URI, requestId: string | undefined, stopId: string | undefined): IObservable<import("@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatEditingService").IEditSessionEntryDiff | undefined>;
67
+ private _getStoredState;
68
+ getEntryDiffBetweenStops(uri: URI, requestId: string | undefined, stopId: string | undefined): IObservable<import("@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatEditingService").IEditSessionEntryDiff | undefined> | undefined;
54
69
  getEntryDiffBetweenRequests(uri: URI, startRequestId: string, stopRequestId: string): IObservable<import("@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatEditingService").IEditSessionEntryDiff | undefined>;
55
- createSnapshot(requestId: string, undoStop: string | undefined, makeEmpty?: boolean): void;
56
- private _createSnapshot;
57
- getSnapshot(requestId: string, undoStop: string | undefined, snapshotUri: URI): ISnapshotEntry | undefined;
70
+ createSnapshot(requestId: string, undoStop: string | undefined): void;
71
+ getSnapshotContents(requestId: string, uri: URI, stopId: string | undefined): Promise<VSBuffer | undefined>;
58
72
  getSnapshotModel(requestId: string, undoStop: string | undefined, snapshotUri: URI): Promise<ITextModel | null>;
59
73
  getSnapshotUri(requestId: string, uri: URI, stopId: string | undefined): URI | undefined;
60
- /**
61
- * A snapshot representing the state of the working set before a new request has been sent
62
- */
63
- private _pendingSnapshot;
64
- restoreSnapshot(requestId: string | undefined, stopId: string | undefined): Promise<void>;
65
- private _restoreSnapshot;
74
+ restoreSnapshot(requestId: string, stopId: string | undefined): Promise<void>;
66
75
  private _assertNotDisposed;
67
76
  accept(...uris: URI[]): Promise<void>;
68
77
  reject(...uris: URI[]): Promise<void>;
@@ -72,12 +81,16 @@ export declare class ChatEditingSession extends Disposable implements IChatEditi
72
81
  stop(clearState?: boolean): Promise<void>;
73
82
  private _performStop;
74
83
  dispose(): void;
75
- private _streamingEditLocks;
76
84
  private get isDisposed();
77
85
  startStreamingEdits(resource: URI, responseModel: IChatResponseModel, inUndoStop: string | undefined): IStreamingEdits;
86
+ startExternalEdits(responseModel: IChatResponseModel, operationId: number, resources: URI[]): Promise<IChatProgress[]>;
87
+ stopExternalEdits(responseModel: IChatResponseModel, operationId: number): Promise<IChatProgress[]>;
78
88
  undoInteraction(): Promise<void>;
79
89
  redoInteraction(): Promise<void>;
90
+ private _recordEditOperations;
91
+ private _getCurrentTextOrNotebookSnapshot;
80
92
  private _acceptStreamingEditsStart;
93
+ private _initEntries;
81
94
  private _acceptEdits;
82
95
  private _getTelemetryInfoForModel;
83
96
  private _resolve;