@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
@@ -1,597 +0,0 @@
1
-
2
-
3
- function parse(input, errors = [], options = {}) {
4
- const lines = input.length === 0 ? [] : input.split(/\r\n|\n/);
5
- const parser = ( new YamlParser(lines, errors, options));
6
- return parser.parse();
7
- }
8
- function createPosition(line, character) {
9
- return { line, character };
10
- }
11
- function createStringNode(value, start, end) {
12
- return { type: 'string', value, start, end };
13
- }
14
- function createNumberNode(value, start, end) {
15
- return { type: 'number', value, start, end };
16
- }
17
- function createBooleanNode(value, start, end) {
18
- return { type: 'boolean', value, start, end };
19
- }
20
- function createNullNode(start, end) {
21
- return { type: 'null', value: null, start, end };
22
- }
23
- function createObjectNode(properties, start, end) {
24
- return { type: 'object', start, end, properties };
25
- }
26
- function createArrayNode(items, start, end) {
27
- return { type: 'array', start, end, items };
28
- }
29
- function isWhitespace(char) {
30
- return char === ' ' || char === '\t';
31
- }
32
- function isValidNumber(value) {
33
- return /^-?\d*\.?\d+$/.test(value);
34
- }
35
- class YamlLexer {
36
- constructor(lines) {
37
- this.currentLine = 0;
38
- this.currentChar = 0;
39
- this.lines = lines;
40
- }
41
- getCurrentPosition() {
42
- return createPosition(this.currentLine, this.currentChar);
43
- }
44
- getCurrentLineNumber() {
45
- return this.currentLine;
46
- }
47
- getCurrentCharNumber() {
48
- return this.currentChar;
49
- }
50
- getCurrentLineText() {
51
- return this.currentLine < this.lines.length ? this.lines[this.currentLine] : '';
52
- }
53
- savePosition() {
54
- return { line: this.currentLine, char: this.currentChar };
55
- }
56
- restorePosition(pos) {
57
- this.currentLine = pos.line;
58
- this.currentChar = pos.char;
59
- }
60
- isAtEnd() {
61
- return this.currentLine >= this.lines.length;
62
- }
63
- getCurrentChar() {
64
- if (this.isAtEnd() || this.currentChar >= this.lines[this.currentLine].length) {
65
- return '';
66
- }
67
- return this.lines[this.currentLine][this.currentChar];
68
- }
69
- peek(offset = 1) {
70
- const newChar = this.currentChar + offset;
71
- if (this.currentLine >= this.lines.length || newChar >= this.lines[this.currentLine].length) {
72
- return '';
73
- }
74
- return this.lines[this.currentLine][newChar];
75
- }
76
- advance() {
77
- const char = this.getCurrentChar();
78
- if (this.currentChar >= this.lines[this.currentLine].length && this.currentLine < this.lines.length - 1) {
79
- this.currentLine++;
80
- this.currentChar = 0;
81
- }
82
- else {
83
- this.currentChar++;
84
- }
85
- return char;
86
- }
87
- advanceLine() {
88
- this.currentLine++;
89
- this.currentChar = 0;
90
- }
91
- skipWhitespace() {
92
- while (!this.isAtEnd() && this.currentChar < this.lines[this.currentLine].length && isWhitespace(this.getCurrentChar())) {
93
- this.advance();
94
- }
95
- }
96
- skipToEndOfLine() {
97
- this.currentChar = this.lines[this.currentLine].length;
98
- }
99
- getIndentation() {
100
- if (this.isAtEnd()) {
101
- return 0;
102
- }
103
- let indent = 0;
104
- for (let i = 0; i < this.lines[this.currentLine].length; i++) {
105
- if (this.lines[this.currentLine][i] === ' ') {
106
- indent++;
107
- }
108
- else if (this.lines[this.currentLine][i] === '\t') {
109
- indent += 4;
110
- }
111
- else {
112
- break;
113
- }
114
- }
115
- return indent;
116
- }
117
- moveToNextNonEmptyLine() {
118
- while (this.currentLine < this.lines.length) {
119
- if (this.currentChar < this.lines[this.currentLine].length) {
120
- const remainingLine = this.lines[this.currentLine].substring(this.currentChar).trim();
121
- if (remainingLine.length > 0 && !remainingLine.startsWith('#')) {
122
- this.skipWhitespace();
123
- return;
124
- }
125
- }
126
- this.currentLine++;
127
- this.currentChar = 0;
128
- if (this.currentLine < this.lines.length) {
129
- const line = this.lines[this.currentLine].trim();
130
- if (line.length > 0 && !line.startsWith('#')) {
131
- this.skipWhitespace();
132
- return;
133
- }
134
- }
135
- }
136
- }
137
- }
138
- class YamlParser {
139
- constructor(lines, errors, options) {
140
- this.flowLevel = 0;
141
- this.lexer = ( new YamlLexer(lines));
142
- this.errors = errors;
143
- this.options = options;
144
- }
145
- addError(message, code, start, end) {
146
- this.errors.push({ message, code, start, end });
147
- }
148
- parseValue(expectedIndent) {
149
- this.lexer.skipWhitespace();
150
- if (this.lexer.isAtEnd()) {
151
- const pos = this.lexer.getCurrentPosition();
152
- return createStringNode('', pos, pos);
153
- }
154
- const char = this.lexer.getCurrentChar();
155
- if (char === '"' || char === `'`) {
156
- return this.parseQuotedString(char);
157
- }
158
- if (char === '[') {
159
- return this.parseInlineArray();
160
- }
161
- if (char === '{') {
162
- return this.parseInlineObject();
163
- }
164
- return this.parseUnquotedValue();
165
- }
166
- parseQuotedString(quote) {
167
- const start = this.lexer.getCurrentPosition();
168
- this.lexer.advance();
169
- let value = '';
170
- while (!this.lexer.isAtEnd() && this.lexer.getCurrentChar() !== '' && this.lexer.getCurrentChar() !== quote) {
171
- value += this.lexer.advance();
172
- }
173
- if (this.lexer.getCurrentChar() === quote) {
174
- this.lexer.advance();
175
- }
176
- const end = this.lexer.getCurrentPosition();
177
- return createStringNode(value, start, end);
178
- }
179
- parseUnquotedValue() {
180
- const start = this.lexer.getCurrentPosition();
181
- let value = '';
182
- let endPos = start;
183
- const isTerminator = (char) => {
184
- if (char === '#') {
185
- return true;
186
- }
187
- if (this.flowLevel > 0 && (char === ',' || char === ']' || char === '}')) {
188
- return true;
189
- }
190
- return false;
191
- };
192
- const firstChar = this.lexer.getCurrentChar();
193
- if (firstChar === '"' || firstChar === `'`) {
194
- value += this.lexer.advance();
195
- endPos = this.lexer.getCurrentPosition();
196
- while (!this.lexer.isAtEnd() && this.lexer.getCurrentChar() !== '') {
197
- const char = this.lexer.getCurrentChar();
198
- if (char === firstChar || isTerminator(char)) {
199
- break;
200
- }
201
- value += this.lexer.advance();
202
- endPos = this.lexer.getCurrentPosition();
203
- }
204
- }
205
- else {
206
- while (!this.lexer.isAtEnd() && this.lexer.getCurrentChar() !== '') {
207
- const char = this.lexer.getCurrentChar();
208
- if (isTerminator(char)) {
209
- break;
210
- }
211
- value += this.lexer.advance();
212
- endPos = this.lexer.getCurrentPosition();
213
- }
214
- }
215
- const trimmed = value.trimEnd();
216
- const diff = value.length - trimmed.length;
217
- if (diff) {
218
- endPos = createPosition(start.line, endPos.character - diff);
219
- }
220
- const finalValue = (firstChar === '"' || firstChar === `'`) ? trimmed.substring(1) : trimmed;
221
- return this.createValueNode(finalValue, start, endPos);
222
- }
223
- createValueNode(value, start, end) {
224
- if (value === '') {
225
- return createStringNode('', start, start);
226
- }
227
- if (value === 'true') {
228
- return createBooleanNode(true, start, end);
229
- }
230
- if (value === 'false') {
231
- return createBooleanNode(false, start, end);
232
- }
233
- if (value === 'null' || value === '~') {
234
- return createNullNode(start, end);
235
- }
236
- const numberValue = Number(value);
237
- if (!isNaN(numberValue) && isFinite(numberValue) && isValidNumber(value)) {
238
- return createNumberNode(numberValue, start, end);
239
- }
240
- return createStringNode(value, start, end);
241
- }
242
- parseInlineArray() {
243
- const start = this.lexer.getCurrentPosition();
244
- this.lexer.advance();
245
- this.flowLevel++;
246
- const items = [];
247
- while (!this.lexer.isAtEnd()) {
248
- this.lexer.skipWhitespace();
249
- if (this.lexer.getCurrentChar() === ']') {
250
- this.lexer.advance();
251
- break;
252
- }
253
- if (this.lexer.getCurrentChar() === '') {
254
- this.lexer.advanceLine();
255
- continue;
256
- }
257
- if (this.lexer.getCurrentChar() === '#') {
258
- this.lexer.skipToEndOfLine();
259
- this.lexer.advanceLine();
260
- continue;
261
- }
262
- const positionBefore = this.lexer.savePosition();
263
- const item = this.parseValue();
264
- if (!(item.type === 'string' && item.value === '' && item.start.line === item.end.line && item.start.character === item.end.character)) {
265
- items.push(item);
266
- }
267
- const positionAfter = this.lexer.savePosition();
268
- if (positionBefore.line === positionAfter.line && positionBefore.char === positionAfter.char) {
269
- if (!this.lexer.isAtEnd() && this.lexer.getCurrentChar() !== '') {
270
- this.lexer.advance();
271
- }
272
- else {
273
- break;
274
- }
275
- }
276
- this.lexer.skipWhitespace();
277
- if (this.lexer.getCurrentChar() === ',') {
278
- this.lexer.advance();
279
- }
280
- }
281
- const end = this.lexer.getCurrentPosition();
282
- this.flowLevel--;
283
- return createArrayNode(items, start, end);
284
- }
285
- parseInlineObject() {
286
- const start = this.lexer.getCurrentPosition();
287
- this.lexer.advance();
288
- this.flowLevel++;
289
- const properties = [];
290
- while (!this.lexer.isAtEnd()) {
291
- this.lexer.skipWhitespace();
292
- if (this.lexer.getCurrentChar() === '}') {
293
- this.lexer.advance();
294
- break;
295
- }
296
- if (this.lexer.getCurrentChar() === '#') {
297
- this.lexer.skipToEndOfLine();
298
- this.lexer.advanceLine();
299
- continue;
300
- }
301
- const positionBefore = this.lexer.savePosition();
302
- const keyStart = this.lexer.getCurrentPosition();
303
- let keyValue = '';
304
- if (this.lexer.getCurrentChar() === '"' || this.lexer.getCurrentChar() === `'`) {
305
- const quote = this.lexer.getCurrentChar();
306
- this.lexer.advance();
307
- while (!this.lexer.isAtEnd() && this.lexer.getCurrentChar() !== '' && this.lexer.getCurrentChar() !== quote) {
308
- keyValue += this.lexer.advance();
309
- }
310
- if (this.lexer.getCurrentChar() === quote) {
311
- this.lexer.advance();
312
- }
313
- }
314
- else {
315
- while (!this.lexer.isAtEnd() && this.lexer.getCurrentChar() !== '' && this.lexer.getCurrentChar() !== ':') {
316
- keyValue += this.lexer.advance();
317
- }
318
- }
319
- keyValue = keyValue.trim();
320
- const keyEnd = this.lexer.getCurrentPosition();
321
- const key = createStringNode(keyValue, keyStart, keyEnd);
322
- this.lexer.skipWhitespace();
323
- if (this.lexer.getCurrentChar() === ':') {
324
- this.lexer.advance();
325
- }
326
- this.lexer.skipWhitespace();
327
- const value = this.parseValue();
328
- properties.push({ key, value });
329
- const positionAfter = this.lexer.savePosition();
330
- if (positionBefore.line === positionAfter.line && positionBefore.char === positionAfter.char) {
331
- if (!this.lexer.isAtEnd() && this.lexer.getCurrentChar() !== '') {
332
- this.lexer.advance();
333
- }
334
- else {
335
- break;
336
- }
337
- }
338
- this.lexer.skipWhitespace();
339
- if (this.lexer.getCurrentChar() === ',') {
340
- this.lexer.advance();
341
- }
342
- }
343
- const end = this.lexer.getCurrentPosition();
344
- this.flowLevel--;
345
- return createObjectNode(properties, start, end);
346
- }
347
- parseBlockArray(baseIndent) {
348
- const start = this.lexer.getCurrentPosition();
349
- const items = [];
350
- while (!this.lexer.isAtEnd()) {
351
- this.lexer.moveToNextNonEmptyLine();
352
- if (this.lexer.isAtEnd()) {
353
- break;
354
- }
355
- const currentIndent = this.lexer.getIndentation();
356
- if (currentIndent < baseIndent) {
357
- break;
358
- }
359
- this.lexer.skipWhitespace();
360
- if (this.lexer.getCurrentChar() === '-') {
361
- this.lexer.advance();
362
- this.lexer.skipWhitespace();
363
- const itemStart = this.lexer.getCurrentPosition();
364
- if (this.lexer.getCurrentChar() === '' || this.lexer.getCurrentChar() === '#') {
365
- this.lexer.advanceLine();
366
- if (!this.lexer.isAtEnd()) {
367
- const nextIndent = this.lexer.getIndentation();
368
- if (nextIndent > currentIndent) {
369
- this.lexer.skipWhitespace();
370
- if (this.lexer.getCurrentChar() === '-') {
371
- const nestedArray = this.parseBlockArray(nextIndent);
372
- items.push(nestedArray);
373
- }
374
- else {
375
- const currentLine = this.lexer.getCurrentLineText();
376
- const currentPos = this.lexer.getCurrentCharNumber();
377
- const remainingLine = currentLine.substring(currentPos);
378
- if (remainingLine.includes(':') && !remainingLine.trim().startsWith('#')) {
379
- const nestedObject = this.parseBlockObject(nextIndent, this.lexer.getCurrentCharNumber());
380
- items.push(nestedObject);
381
- }
382
- else {
383
- items.push(createStringNode('', itemStart, itemStart));
384
- }
385
- }
386
- }
387
- else {
388
- items.push(createStringNode('', itemStart, itemStart));
389
- }
390
- }
391
- else {
392
- items.push(createStringNode('', itemStart, itemStart));
393
- }
394
- }
395
- else {
396
- const currentLine = this.lexer.getCurrentLineText();
397
- const currentPos = this.lexer.getCurrentCharNumber();
398
- const remainingLine = currentLine.substring(currentPos);
399
- const hasColon = remainingLine.includes(':');
400
- if (hasColon) {
401
- const item = this.parseBlockObject(itemStart.character, itemStart.character);
402
- items.push(item);
403
- }
404
- else {
405
- const item = this.parseValue();
406
- items.push(item);
407
- while (!this.lexer.isAtEnd() && this.lexer.getCurrentChar() !== '' && this.lexer.getCurrentChar() !== '#') {
408
- this.lexer.advance();
409
- }
410
- this.lexer.advanceLine();
411
- }
412
- }
413
- }
414
- else {
415
- break;
416
- }
417
- }
418
- let end = start;
419
- if (items.length > 0) {
420
- const lastItem = items[items.length - 1];
421
- end = lastItem.end;
422
- }
423
- else {
424
- end = createPosition(start.line, start.character + 1);
425
- }
426
- return createArrayNode(items, start, end);
427
- }
428
- parseBlockObject(baseIndent, baseCharPosition) {
429
- const start = this.lexer.getCurrentPosition();
430
- const properties = [];
431
- const localKeysSeen = ( new Set());
432
- const fromCurrentPosition = baseCharPosition !== undefined;
433
- let firstIteration = true;
434
- while (!this.lexer.isAtEnd()) {
435
- if (!firstIteration || !fromCurrentPosition) {
436
- this.lexer.moveToNextNonEmptyLine();
437
- }
438
- firstIteration = false;
439
- if (this.lexer.isAtEnd()) {
440
- break;
441
- }
442
- const currentIndent = this.lexer.getIndentation();
443
- if (fromCurrentPosition) {
444
- this.lexer.skipWhitespace();
445
- const currentCharPosition = this.lexer.getCurrentCharNumber();
446
- if (currentCharPosition < baseCharPosition) {
447
- break;
448
- }
449
- }
450
- else {
451
- if (currentIndent < baseIndent) {
452
- break;
453
- }
454
- if (currentIndent > baseIndent) {
455
- const lineStart = createPosition(this.lexer.getCurrentLineNumber(), 0);
456
- const lineEnd = createPosition(this.lexer.getCurrentLineNumber(), this.lexer.getCurrentLineText().length);
457
- this.addError('Unexpected indentation', 'indentation', lineStart, lineEnd);
458
- this.lexer.skipWhitespace();
459
- }
460
- else {
461
- this.lexer.skipWhitespace();
462
- }
463
- }
464
- const keyStart = this.lexer.getCurrentPosition();
465
- let keyValue = '';
466
- while (!this.lexer.isAtEnd() && this.lexer.getCurrentChar() !== '' && this.lexer.getCurrentChar() !== ':') {
467
- keyValue += this.lexer.advance();
468
- }
469
- keyValue = keyValue.trim();
470
- const keyEnd = this.lexer.getCurrentPosition();
471
- const key = createStringNode(keyValue, keyStart, keyEnd);
472
- if (!this.options.allowDuplicateKeys && ( localKeysSeen.has(keyValue))) {
473
- this.addError(`Duplicate key '${keyValue}'`, 'duplicateKey', keyStart, keyEnd);
474
- }
475
- localKeysSeen.add(keyValue);
476
- if (this.lexer.getCurrentChar() === ':') {
477
- this.lexer.advance();
478
- }
479
- this.lexer.skipWhitespace();
480
- let value;
481
- const valueStart = this.lexer.getCurrentPosition();
482
- if (this.lexer.getCurrentChar() === '' || this.lexer.getCurrentChar() === '#') {
483
- this.lexer.advanceLine();
484
- if (!this.lexer.isAtEnd()) {
485
- const nextIndent = this.lexer.getIndentation();
486
- if (nextIndent > currentIndent) {
487
- this.lexer.skipWhitespace();
488
- if (this.lexer.getCurrentChar() === '-') {
489
- value = this.parseBlockArray(nextIndent);
490
- }
491
- else {
492
- value = this.parseBlockObject(nextIndent);
493
- }
494
- }
495
- else if (!fromCurrentPosition && nextIndent === currentIndent) {
496
- this.lexer.skipWhitespace();
497
- if (this.lexer.getCurrentChar() === '-') {
498
- value = this.parseBlockArray(currentIndent);
499
- }
500
- else {
501
- value = createStringNode('', valueStart, valueStart);
502
- }
503
- }
504
- else {
505
- value = createStringNode('', valueStart, valueStart);
506
- }
507
- }
508
- else {
509
- value = createStringNode('', valueStart, valueStart);
510
- }
511
- }
512
- else {
513
- value = this.parseValue();
514
- while (!this.lexer.isAtEnd() && this.lexer.getCurrentChar() !== '' && this.lexer.getCurrentChar() !== '#') {
515
- if (isWhitespace(this.lexer.getCurrentChar())) {
516
- this.lexer.advance();
517
- }
518
- else {
519
- break;
520
- }
521
- }
522
- if (this.lexer.getCurrentChar() === '#') {
523
- this.lexer.skipToEndOfLine();
524
- }
525
- if (!this.lexer.isAtEnd() && this.lexer.getCurrentChar() === '') {
526
- this.lexer.advanceLine();
527
- }
528
- }
529
- properties.push({ key, value });
530
- }
531
- let end = start;
532
- if (properties.length > 0) {
533
- const lastProperty = properties[properties.length - 1];
534
- end = lastProperty.value.end;
535
- }
536
- return createObjectNode(properties, start, end);
537
- }
538
- parse() {
539
- if (this.lexer.isAtEnd()) {
540
- return undefined;
541
- }
542
- this.lexer.moveToNextNonEmptyLine();
543
- if (this.lexer.isAtEnd()) {
544
- return undefined;
545
- }
546
- this.lexer.skipWhitespace();
547
- if (this.lexer.getCurrentChar() === '-') {
548
- const nextChar = this.lexer.peek();
549
- if (nextChar === ' ' || nextChar === '\t' || nextChar === '' || nextChar === '#') {
550
- return this.parseBlockArray(0);
551
- }
552
- else {
553
- return this.parseValue();
554
- }
555
- }
556
- else if (this.lexer.getCurrentChar() === '[') {
557
- return this.parseInlineArray();
558
- }
559
- else if (this.lexer.getCurrentChar() === '{') {
560
- return this.parseInlineObject();
561
- }
562
- else {
563
- const currentLine = this.lexer.getCurrentLineText();
564
- const currentPos = this.lexer.getCurrentCharNumber();
565
- const remainingLine = currentLine.substring(currentPos);
566
- let hasColon = false;
567
- let inQuotes = false;
568
- let quoteChar = '';
569
- for (let i = 0; i < remainingLine.length; i++) {
570
- const char = remainingLine[i];
571
- if (!inQuotes && (char === '"' || char === `'`)) {
572
- inQuotes = true;
573
- quoteChar = char;
574
- }
575
- else if (inQuotes && char === quoteChar) {
576
- inQuotes = false;
577
- quoteChar = '';
578
- }
579
- else if (!inQuotes && char === ':') {
580
- hasColon = true;
581
- break;
582
- }
583
- else if (!inQuotes && char === '#') {
584
- break;
585
- }
586
- }
587
- if (hasColon) {
588
- return this.parseBlockObject(0);
589
- }
590
- else {
591
- return this.parseValue();
592
- }
593
- }
594
- }
595
- }
596
-
597
- export { parse };
@@ -1,8 +0,0 @@
1
- import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
2
- import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
3
- import { IWorkbenchContribution } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions";
4
- import { IChatContextPickService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chatContextPickService.service";
5
- export declare class ChatContextContributions extends Disposable implements IWorkbenchContribution {
6
- static readonly ID = "chat.contextContributions";
7
- constructor(instantiationService: IInstantiationService, contextPickService: IChatContextPickService);
8
- }