@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,380 +0,0 @@
1
-
2
- import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
- import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
4
- import { VSDataTransfer, createStringDataTransferItem } from '@codingame/monaco-vscode-api/vscode/vs/base/common/dataTransfer';
5
- import { HierarchicalKind } from '@codingame/monaco-vscode-api/vscode/vs/base/common/hierarchicalKind';
6
- import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
7
- import { revive } from '@codingame/monaco-vscode-api/vscode/vs/base/common/marshalling';
8
- import { Mimes } from '@codingame/monaco-vscode-api/vscode/vs/base/common/mime';
9
- import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
10
- import { joinPath, basename } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
11
- import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
12
- import { ILanguageFeaturesService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/languageFeatures.service';
13
- import { IModelService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/model.service';
14
- import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
15
- import { IEnvironmentService } from '@codingame/monaco-vscode-api/vscode/vs/platform/environment/common/environment.service';
16
- import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
17
- import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
18
- import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
19
- import { isProposedApiEnabled } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions';
20
- import { IExtensionService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service';
21
- import { IChatVariablesService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatVariables.service';
22
- import { IChatWidgetService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service';
23
- import { ChatDynamicVariableModel } from '@codingame/monaco-vscode-e4d0fd26-1b26-5583-b3f7-582e08d7b389-common/vscode/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables';
24
- import { cleanupOldImages, createFileForMedia, resizeImage, imageToHash } from '@codingame/monaco-vscode-5084de40-f866-5cb5-9d9b-33a10f6f235d-common/vscode/vs/workbench/contrib/chat/browser/imageUtils';
25
-
26
- var CopyAttachmentsProvider_1;
27
- const COPY_MIME_TYPES = 'application/vnd.code.additional-editor-data';
28
- let PasteImageProvider = class PasteImageProvider {
29
- constructor(chatWidgetService, extensionService, fileService, environmentService, logService) {
30
- this.chatWidgetService = chatWidgetService;
31
- this.extensionService = extensionService;
32
- this.fileService = fileService;
33
- this.environmentService = environmentService;
34
- this.logService = logService;
35
- this.kind = ( new HierarchicalKind('chat.attach.image'));
36
- this.providedPasteEditKinds = [this.kind];
37
- this.copyMimeTypes = [];
38
- this.pasteMimeTypes = ['image/*'];
39
- this.imagesFolder = joinPath(this.environmentService.workspaceStorageHome, 'vscode-chat-images');
40
- cleanupOldImages(this.fileService, this.logService, this.imagesFolder);
41
- }
42
- async provideDocumentPasteEdits(model, ranges, dataTransfer, context, token) {
43
- if (!( this.extensionService.extensions.some(ext => isProposedApiEnabled(ext, 'chatReferenceBinaryData')))) {
44
- return;
45
- }
46
- const supportedMimeTypes = [
47
- 'image/png',
48
- 'image/jpeg',
49
- 'image/jpg',
50
- 'image/bmp',
51
- 'image/gif',
52
- 'image/tiff'
53
- ];
54
- let mimeType;
55
- let imageItem;
56
- for (const type of supportedMimeTypes) {
57
- imageItem = dataTransfer.get(type);
58
- if (imageItem) {
59
- mimeType = type;
60
- break;
61
- }
62
- }
63
- if (!imageItem || !mimeType) {
64
- return;
65
- }
66
- const currClipboard = await imageItem.asFile()?.data();
67
- if (token.isCancellationRequested || !currClipboard) {
68
- return;
69
- }
70
- const widget = this.chatWidgetService.getWidgetByInputUri(model.uri);
71
- if (!widget) {
72
- return;
73
- }
74
- const attachedVariables = widget.attachmentModel.attachments;
75
- const displayName = ( localize(5213, 'Pasted Image'));
76
- let tempDisplayName = displayName;
77
- for (let appendValue = 2; ( attachedVariables.some(attachment => attachment.name === tempDisplayName)); appendValue++) {
78
- tempDisplayName = `${displayName} ${appendValue}`;
79
- }
80
- const fileReference = await createFileForMedia(this.fileService, this.imagesFolder, currClipboard, mimeType);
81
- if (token.isCancellationRequested || !fileReference) {
82
- return;
83
- }
84
- const scaledImageData = await resizeImage(currClipboard);
85
- if (token.isCancellationRequested || !scaledImageData) {
86
- return;
87
- }
88
- const scaledImageContext = await getImageAttachContext(scaledImageData, mimeType, token, tempDisplayName, fileReference);
89
- if (token.isCancellationRequested || !scaledImageContext) {
90
- return;
91
- }
92
- widget.attachmentModel.addContext(scaledImageContext);
93
- const currentContextIds = widget.attachmentModel.getAttachmentIDs();
94
- if (( currentContextIds.has(scaledImageContext.id))) {
95
- return;
96
- }
97
- const edit = createCustomPasteEdit(model, [scaledImageContext], mimeType, this.kind, ( localize(5214, 'Pasted Image Attachment')), this.chatWidgetService);
98
- return createEditSession(edit);
99
- }
100
- };
101
- PasteImageProvider = ( __decorate([
102
- ( __param(2, IFileService)),
103
- ( __param(3, IEnvironmentService)),
104
- ( __param(4, ILogService))
105
- ], PasteImageProvider));
106
- async function getImageAttachContext(data, mimeType, token, displayName, resource) {
107
- const imageHash = await imageToHash(data);
108
- if (token.isCancellationRequested) {
109
- return undefined;
110
- }
111
- return {
112
- kind: 'image',
113
- value: data,
114
- id: imageHash,
115
- name: displayName,
116
- icon: Codicon.fileMedia,
117
- mimeType,
118
- isPasted: true,
119
- references: [{ reference: resource, kind: 'reference' }]
120
- };
121
- }
122
- function isImage(array) {
123
- if (array.length < 4) {
124
- return false;
125
- }
126
- const identifier = {
127
- png: [0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A],
128
- jpeg: [0xFF, 0xD8, 0xFF],
129
- bmp: [0x42, 0x4D],
130
- gif: [0x47, 0x49, 0x46, 0x38],
131
- tiff: [0x49, 0x49, 0x2A, 0x00]
132
- };
133
- return ( ( Object.values(identifier)).some((signature) => signature.every((byte, index) => array[index] === byte)));
134
- }
135
- class CopyTextProvider {
136
- constructor() {
137
- this.providedPasteEditKinds = [];
138
- this.copyMimeTypes = [COPY_MIME_TYPES];
139
- this.pasteMimeTypes = [];
140
- }
141
- async prepareDocumentPaste(model, ranges, dataTransfer, token) {
142
- if (model.uri.scheme === Schemas.vscodeChatInput) {
143
- return;
144
- }
145
- const customDataTransfer = ( new VSDataTransfer());
146
- const data = { range: ranges[0], uri: model.uri.toJSON() };
147
- customDataTransfer.append(COPY_MIME_TYPES, createStringDataTransferItem(JSON.stringify(data)));
148
- return customDataTransfer;
149
- }
150
- }
151
- let CopyAttachmentsProvider = class CopyAttachmentsProvider {
152
- static { CopyAttachmentsProvider_1 = this; }
153
- static { this.ATTACHMENT_MIME_TYPE = 'application/vnd.chat.attachment+json'; }
154
- constructor(chatWidgetService, chatVariableService) {
155
- this.chatWidgetService = chatWidgetService;
156
- this.chatVariableService = chatVariableService;
157
- this.kind = ( new HierarchicalKind('chat.attach.attachments'));
158
- this.providedPasteEditKinds = [this.kind];
159
- this.copyMimeTypes = [CopyAttachmentsProvider_1.ATTACHMENT_MIME_TYPE];
160
- this.pasteMimeTypes = [CopyAttachmentsProvider_1.ATTACHMENT_MIME_TYPE];
161
- }
162
- async prepareDocumentPaste(model, _ranges, _dataTransfer, _token) {
163
- const widget = this.chatWidgetService.getWidgetByInputUri(model.uri);
164
- if (!widget || !widget.viewModel) {
165
- return undefined;
166
- }
167
- const attachments = widget.attachmentModel.attachments;
168
- const dynamicVariables = this.chatVariableService.getDynamicVariables(widget.viewModel.sessionId);
169
- if (attachments.length === 0 && dynamicVariables.length === 0) {
170
- return undefined;
171
- }
172
- const result = ( new VSDataTransfer());
173
- result.append(CopyAttachmentsProvider_1.ATTACHMENT_MIME_TYPE, createStringDataTransferItem(JSON.stringify({ attachments, dynamicVariables })));
174
- return result;
175
- }
176
- async provideDocumentPasteEdits(model, _ranges, dataTransfer, _context, token) {
177
- const widget = this.chatWidgetService.getWidgetByInputUri(model.uri);
178
- if (!widget || !widget.viewModel) {
179
- return undefined;
180
- }
181
- const chatDynamicVariable = widget.getContrib(ChatDynamicVariableModel.ID);
182
- if (!chatDynamicVariable) {
183
- return undefined;
184
- }
185
- const text = dataTransfer.get(Mimes.text);
186
- const data = dataTransfer.get(CopyAttachmentsProvider_1.ATTACHMENT_MIME_TYPE);
187
- const rawData = await data?.asString();
188
- const textdata = await text?.asString();
189
- if (textdata === undefined || rawData === undefined) {
190
- return;
191
- }
192
- if (token.isCancellationRequested) {
193
- return;
194
- }
195
- let pastedData;
196
- try {
197
- pastedData = revive(JSON.parse(rawData));
198
- }
199
- catch {
200
- }
201
- if (!Array.isArray(pastedData?.attachments) && !Array.isArray(pastedData?.dynamicVariables)) {
202
- return;
203
- }
204
- const edit = {
205
- insertText: textdata,
206
- title: ( localize(5215, 'Insert Prompt & Attachments')),
207
- kind: this.kind,
208
- handledMimeType: CopyAttachmentsProvider_1.ATTACHMENT_MIME_TYPE,
209
- additionalEdit: {
210
- edits: []
211
- }
212
- };
213
- edit.additionalEdit?.edits.push({
214
- resource: model.uri,
215
- redo: () => {
216
- widget.attachmentModel.addContext(...pastedData.attachments);
217
- for (const dynamicVariable of pastedData.dynamicVariables) {
218
- chatDynamicVariable?.addReference(dynamicVariable);
219
- }
220
- widget.refreshParsedInput();
221
- },
222
- undo: () => {
223
- widget.attachmentModel.delete(...( pastedData.attachments.map(c => c.id)));
224
- widget.refreshParsedInput();
225
- }
226
- });
227
- return createEditSession(edit);
228
- }
229
- };
230
- CopyAttachmentsProvider = CopyAttachmentsProvider_1 = ( __decorate([
231
- ( __param(0, IChatWidgetService)),
232
- ( __param(1, IChatVariablesService))
233
- ], CopyAttachmentsProvider));
234
- class PasteTextProvider {
235
- constructor(chatWidgetService, modelService) {
236
- this.chatWidgetService = chatWidgetService;
237
- this.modelService = modelService;
238
- this.kind = ( new HierarchicalKind('chat.attach.text'));
239
- this.providedPasteEditKinds = [this.kind];
240
- this.copyMimeTypes = [];
241
- this.pasteMimeTypes = [COPY_MIME_TYPES];
242
- }
243
- async provideDocumentPasteEdits(model, ranges, dataTransfer, _context, token) {
244
- if (model.uri.scheme !== Schemas.vscodeChatInput) {
245
- return;
246
- }
247
- const text = dataTransfer.get(Mimes.text);
248
- const editorData = dataTransfer.get('vscode-editor-data');
249
- const additionalEditorData = dataTransfer.get(COPY_MIME_TYPES);
250
- if (!editorData || !text || !additionalEditorData) {
251
- return;
252
- }
253
- const textdata = await text.asString();
254
- const metadata = JSON.parse(await editorData.asString());
255
- const additionalData = JSON.parse(await additionalEditorData.asString());
256
- const widget = this.chatWidgetService.getWidgetByInputUri(model.uri);
257
- if (!widget) {
258
- return;
259
- }
260
- const start = additionalData.range.startLineNumber;
261
- const end = additionalData.range.endLineNumber;
262
- if (start === end) {
263
- const textModel = this.modelService.getModel(URI.revive(additionalData.uri));
264
- if (!textModel) {
265
- return;
266
- }
267
- const lineContent = textModel.getLineContent(start);
268
- if (lineContent !== textdata) {
269
- return;
270
- }
271
- }
272
- const copiedContext = getCopiedContext(textdata, URI.revive(additionalData.uri), metadata.mode, additionalData.range);
273
- if (token.isCancellationRequested || !copiedContext) {
274
- return;
275
- }
276
- const currentContextIds = widget.attachmentModel.getAttachmentIDs();
277
- if (( currentContextIds.has(copiedContext.id))) {
278
- return;
279
- }
280
- const edit = createCustomPasteEdit(model, [copiedContext], Mimes.text, this.kind, ( localize(5216, 'Pasted Code Attachment')), this.chatWidgetService);
281
- edit.yieldTo = [{ kind: HierarchicalKind.Empty.append('text', 'plain') }];
282
- return createEditSession(edit);
283
- }
284
- }
285
- function getCopiedContext(code, file, language, range) {
286
- const fileName = basename(file);
287
- const start = range.startLineNumber;
288
- const end = range.endLineNumber;
289
- const resultText = `Copied Selection of Code: \n\n\n From the file: ${fileName} From lines ${start} to ${end} \n \`\`\`${code}\`\`\``;
290
- const pastedLines = start === end ? ( localize(5217, '1 line')) : ( localize(5218, '{0} lines', end + 1 - start));
291
- return {
292
- kind: 'paste',
293
- value: resultText,
294
- id: `${fileName}${start}${end}${range.startColumn}${range.endColumn}`,
295
- name: `${fileName} ${pastedLines}`,
296
- icon: Codicon.code,
297
- pastedLines,
298
- language,
299
- fileName: ( file.toString()),
300
- copiedFrom: {
301
- uri: file,
302
- range
303
- },
304
- code,
305
- references: [{
306
- reference: file,
307
- kind: 'reference'
308
- }]
309
- };
310
- }
311
- function createCustomPasteEdit(model, context, handledMimeType, kind, title, chatWidgetService) {
312
- const label = context.length === 1
313
- ? context[0].name
314
- : ( localize(5219, '{0} and {1} more', context[0].name, context.length - 1));
315
- const customEdit = {
316
- resource: model.uri,
317
- variable: context,
318
- undo: () => {
319
- const widget = chatWidgetService.getWidgetByInputUri(model.uri);
320
- if (!widget) {
321
- throw ( new Error('No widget found for undo'));
322
- }
323
- widget.attachmentModel.delete(...( context.map(c => c.id)));
324
- },
325
- redo: () => {
326
- const widget = chatWidgetService.getWidgetByInputUri(model.uri);
327
- if (!widget) {
328
- throw ( new Error('No widget found for redo'));
329
- }
330
- widget.attachmentModel.addContext(...context);
331
- },
332
- metadata: {
333
- needsConfirmation: false,
334
- label
335
- }
336
- };
337
- return {
338
- insertText: '',
339
- title,
340
- kind,
341
- handledMimeType,
342
- additionalEdit: {
343
- edits: [customEdit],
344
- }
345
- };
346
- }
347
- function createEditSession(edit) {
348
- return {
349
- edits: [edit],
350
- dispose: () => { },
351
- };
352
- }
353
- let ChatPasteProvidersFeature = class ChatPasteProvidersFeature extends Disposable {
354
- constructor(instaService, languageFeaturesService, chatWidgetService, extensionService, fileService, modelService, environmentService, logService) {
355
- super();
356
- this._register(languageFeaturesService.documentPasteEditProvider.register({ scheme: Schemas.vscodeChatInput, pattern: '*', hasAccessToAllModels: true }, instaService.createInstance(CopyAttachmentsProvider)));
357
- this._register(languageFeaturesService.documentPasteEditProvider.register({ scheme: Schemas.vscodeChatInput, pattern: '*', hasAccessToAllModels: true }, ( new PasteImageProvider(
358
- chatWidgetService,
359
- extensionService,
360
- fileService,
361
- environmentService,
362
- logService
363
- ))));
364
- this._register(languageFeaturesService.documentPasteEditProvider.register({ scheme: Schemas.vscodeChatInput, pattern: '*', hasAccessToAllModels: true }, ( new PasteTextProvider(chatWidgetService, modelService))));
365
- this._register(languageFeaturesService.documentPasteEditProvider.register('*', ( new CopyTextProvider())));
366
- this._register(languageFeaturesService.documentPasteEditProvider.register('*', ( new CopyTextProvider())));
367
- }
368
- };
369
- ChatPasteProvidersFeature = ( __decorate([
370
- ( __param(0, IInstantiationService)),
371
- ( __param(1, ILanguageFeaturesService)),
372
- ( __param(2, IChatWidgetService)),
373
- ( __param(3, IExtensionService)),
374
- ( __param(4, IFileService)),
375
- ( __param(5, IModelService)),
376
- ( __param(6, IEnvironmentService)),
377
- ( __param(7, ILogService))
378
- ], ChatPasteProvidersFeature));
379
-
380
- export { ChatPasteProvidersFeature, CopyTextProvider, PasteImageProvider, PasteTextProvider, isImage };
@@ -1,37 +0,0 @@
1
- import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
2
- import { EditorInput } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor/editorInput";
3
- import { IEditorGroupsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService.service";
4
- import { IChatService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService.service";
5
- import { IChatSessionItem, IChatSessionItemProvider } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService";
6
- import { IChatWidgetService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service";
7
- import { ChatEditorInput } from "@codingame/monaco-vscode-b994942c-360d-5b68-8a33-77d4bde6b714-common/vscode/vs/workbench/contrib/chat/browser/chatEditorInput";
8
- export declare const NEW_CHAT_SESSION_ACTION_ID = "workbench.action.chat.openNewSessionEditor";
9
- export type ChatSessionItemWithProvider = IChatSessionItem & {
10
- readonly provider: IChatSessionItemProvider;
11
- isHistory?: boolean;
12
- relativeTime?: string;
13
- relativeTimeFullWord?: string;
14
- hideRelativeTime?: boolean;
15
- timing?: {
16
- startTime: number;
17
- };
18
- };
19
- export declare function isChatSession(editor?: EditorInput): boolean;
20
- /**
21
- * Returns chat session type from a URI, or 'local' if not specified or cannot be determined.
22
- */
23
- export declare function getChatSessionType(editor: ChatEditorInput): string;
24
- /**
25
- * Find existing chat editors that have the same session URI (for external providers)
26
- */
27
- export declare function findExistingChatEditorByUri(sessionUri: URI, sessionId: string, editorGroupsService: IEditorGroupsService): {
28
- editor: ChatEditorInput;
29
- groupId: number;
30
- } | undefined;
31
- export declare function isLocalChatSessionItem(item: ChatSessionItemWithProvider): boolean;
32
- export declare function extractTimestamp(item: IChatSessionItem): number | undefined;
33
- export declare function processSessionsWithTimeGrouping(sessions: ChatSessionItemWithProvider[]): void;
34
- export declare function getSessionItemContextOverlay(session: ChatSessionItemWithProvider, provider?: IChatSessionItemProvider, chatWidgetService?: IChatWidgetService, chatService?: IChatService, editorGroupsService?: IEditorGroupsService): [
35
- string,
36
- any
37
- ][];
@@ -1,137 +0,0 @@
1
-
2
- import { fromNow } from '@codingame/monaco-vscode-api/vscode/vs/base/common/date';
3
- import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
4
- import { ChatContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
5
- import { ChatSessionUri } from '@codingame/monaco-vscode-b994942c-360d-5b68-8a33-77d4bde6b714-common/vscode/vs/workbench/contrib/chat/common/chatUri';
6
- import { ChatEditorInput } from '@codingame/monaco-vscode-b994942c-360d-5b68-8a33-77d4bde6b714-common/vscode/vs/workbench/contrib/chat/browser/chatEditorInput';
7
-
8
- const NEW_CHAT_SESSION_ACTION_ID = 'workbench.action.chat.openNewSessionEditor';
9
- function isChatSession(editor) {
10
- if (!(editor instanceof ChatEditorInput)) {
11
- return false;
12
- }
13
- if (editor.resource?.scheme !== 'vscode-chat-editor' && editor.resource?.scheme !== 'vscode-chat-session') {
14
- return false;
15
- }
16
- if (editor.options.ignoreInView) {
17
- return false;
18
- }
19
- return true;
20
- }
21
- function getChatSessionType(editor) {
22
- if (!editor.resource) {
23
- return 'local';
24
- }
25
- const { scheme, query } = editor.resource;
26
- if (scheme === Schemas.vscodeChatSession) {
27
- const parsed = ChatSessionUri.parse(editor.resource);
28
- if (parsed) {
29
- return parsed.chatSessionType;
30
- }
31
- }
32
- const sessionTypeFromQuery = ( new URLSearchParams(query)).get('chatSessionType');
33
- if (sessionTypeFromQuery) {
34
- return sessionTypeFromQuery;
35
- }
36
- return 'local';
37
- }
38
- function findExistingChatEditorByUri(sessionUri, sessionId, editorGroupsService) {
39
- if (!sessionUri) {
40
- return undefined;
41
- }
42
- for (const group of editorGroupsService.groups) {
43
- for (const editor of group.editors) {
44
- if (editor instanceof ChatEditorInput && (( editor.resource.toString()) === ( sessionUri.toString()) || editor.sessionId === sessionId)) {
45
- return { editor, groupId: group.id };
46
- }
47
- }
48
- }
49
- return undefined;
50
- }
51
- function isLocalChatSessionItem(item) {
52
- return item.provider.chatSessionType === 'local';
53
- }
54
- function updateRelativeTime(item, lastRelativeTime) {
55
- if (item.timing?.startTime) {
56
- item.relativeTime = fromNow(item.timing.startTime);
57
- item.relativeTimeFullWord = fromNow(item.timing.startTime, false, true);
58
- if (lastRelativeTime === undefined || item.relativeTime !== lastRelativeTime) {
59
- lastRelativeTime = item.relativeTime;
60
- item.hideRelativeTime = false;
61
- }
62
- else {
63
- item.hideRelativeTime = true;
64
- }
65
- }
66
- else {
67
- item.relativeTime = undefined;
68
- item.relativeTimeFullWord = undefined;
69
- item.hideRelativeTime = false;
70
- }
71
- return lastRelativeTime;
72
- }
73
- function extractTimestamp(item) {
74
- if (item.timing?.startTime) {
75
- return item.timing.startTime;
76
- }
77
- if ('timestamp' in item) {
78
- return item.timestamp;
79
- }
80
- return undefined;
81
- }
82
- function sortSessionsByTimestamp(sessions) {
83
- sessions.sort((a, b) => {
84
- const aTime = a.timing?.startTime ?? 0;
85
- const bTime = b.timing?.startTime ?? 0;
86
- return bTime - aTime;
87
- });
88
- }
89
- function applyTimeGrouping(sessions) {
90
- let lastRelativeTime;
91
- sessions.forEach(session => {
92
- lastRelativeTime = updateRelativeTime(session, lastRelativeTime);
93
- });
94
- }
95
- function processSessionsWithTimeGrouping(sessions) {
96
- if (( sessions.some(session => session.timing?.startTime !== undefined))) {
97
- sortSessionsByTimestamp(sessions);
98
- applyTimeGrouping(sessions);
99
- }
100
- }
101
- function getSessionItemContextOverlay(session, provider, chatWidgetService, chatService, editorGroupsService) {
102
- const overlay = [];
103
- if (session.id === 'show-history') {
104
- return overlay;
105
- }
106
- if (provider) {
107
- overlay.push([ChatContextKeys.sessionType.key, provider.chatSessionType]);
108
- }
109
- overlay.push([ChatContextKeys.isHistoryItem.key, session.isHistory]);
110
- let isActiveSession = false;
111
- if (!session.isHistory && provider?.chatSessionType === 'local') {
112
- isActiveSession = true;
113
- }
114
- else if (session.isHistory && chatWidgetService && chatService && editorGroupsService) {
115
- const widget = chatWidgetService.getWidgetBySessionId(session.id);
116
- if (widget) {
117
- isActiveSession = true;
118
- }
119
- else {
120
- for (const group of editorGroupsService.groups) {
121
- for (const editor of group.editors) {
122
- if (editor instanceof ChatEditorInput && editor.sessionId === session.id) {
123
- isActiveSession = true;
124
- break;
125
- }
126
- }
127
- if (isActiveSession) {
128
- break;
129
- }
130
- }
131
- }
132
- }
133
- overlay.push([ChatContextKeys.isActiveSession.key, isActiveSession]);
134
- return overlay;
135
- }
136
-
137
- export { NEW_CHAT_SESSION_ACTION_ID, extractTimestamp, findExistingChatEditorByUri, getChatSessionType, getSessionItemContextOverlay, isChatSession, isLocalChatSessionItem, processSessionsWithTimeGrouping };
@@ -1,44 +0,0 @@
1
- import { IChatWidget } from "@codingame/monaco-vscode-b994942c-360d-5b68-8a33-77d4bde6b714-common/vscode/vs/workbench/contrib/chat/browser/chat";
2
- import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
3
- import { IPromptsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.service";
4
- import { IChatContextPickerItem, IChatContextPicker } from "@codingame/monaco-vscode-51e7513d-a395-525d-b226-639aa8c6cc2d-common/vscode/vs/workbench/contrib/chat/browser/chatContextPickService";
5
- import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
6
- /**
7
- * Options for the {@link AttachInstructionsAction} action.
8
- */
9
- export interface IAttachInstructionsActionOptions {
10
- /**
11
- * Target chat widget reference to attach the instruction to. If the reference is
12
- * provided, the command will attach the instruction as attachment of the widget.
13
- * Otherwise, the command will re-use an existing one.
14
- */
15
- readonly widget?: IChatWidget;
16
- /**
17
- * Instruction resource `URI` to attach to the chat input, if any.
18
- * If provided the resource will be pre-selected in the prompt picker dialog,
19
- * otherwise the dialog will show the prompts list without any pre-selection.
20
- */
21
- readonly resource?: URI;
22
- /**
23
- * Whether to skip the instructions files selection dialog.
24
- *
25
- * Note! if this option is set to `true`, the {@link resource}
26
- * option `must be defined`.
27
- */
28
- readonly skipSelectionDialog?: boolean;
29
- }
30
- /**
31
- * Helper to register the `Attach Prompt` action.
32
- */
33
- export declare function registerAttachPromptActions(): void;
34
- export declare class ChatInstructionsPickerPick implements IChatContextPickerItem {
35
- private readonly promptsService;
36
- private readonly configurationService;
37
- readonly type = "pickerPick";
38
- readonly label: string;
39
- readonly icon: import("@codingame/monaco-vscode-api/vscode/vs/base/common/themables").ThemeIcon;
40
- readonly commandId = "workbench.action.chat.attach.instructions";
41
- constructor(promptsService: IPromptsService, configurationService: IConfigurationService);
42
- isEnabled(widget: IChatWidget): Promise<boolean> | boolean;
43
- asPicker(): IChatContextPicker;
44
- }