@codingame/monaco-vscode-chat-service-override 30.0.0 → 31.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 (377) hide show
  1. package/index.js +21 -3
  2. package/package.json +5 -5
  3. package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostProtocolClient.d.ts +125 -0
  4. package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostProtocolClient.js +393 -0
  5. package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.d.ts +65 -0
  6. package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.js +453 -0
  7. package/vscode/src/vs/platform/agentHost/browser/webSocketClientTransport.d.ts +28 -0
  8. package/vscode/src/vs/platform/agentHost/browser/webSocketClientTransport.js +81 -0
  9. package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemProvider.d.ts +75 -0
  10. package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemProvider.js +180 -0
  11. package/vscode/src/vs/platform/agentHost/common/agentService.d.ts +202 -51
  12. package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.d.ts +182 -0
  13. package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.js +282 -0
  14. package/vscode/src/vs/platform/agentHost/common/state/protocol/commands.d.ts +303 -32
  15. package/vscode/src/vs/platform/agentHost/common/state/protocol/commands.js +14 -0
  16. package/vscode/src/vs/platform/agentHost/common/state/protocol/errors.d.ts +1 -1
  17. package/vscode/src/vs/platform/agentHost/common/state/protocol/errors.js +9 -0
  18. package/vscode/src/vs/platform/agentHost/common/state/protocol/reducers.d.ts +30 -0
  19. package/vscode/src/vs/platform/agentHost/common/state/protocol/reducers.js +662 -0
  20. package/vscode/src/vs/platform/agentHost/common/state/sessionActions.d.ts +12 -5
  21. package/vscode/src/vs/platform/agentHost/common/state/sessionActions.js +9 -0
  22. package/vscode/src/vs/platform/agentHost/common/state/sessionCapabilities.d.ts +17 -0
  23. package/vscode/src/vs/platform/agentHost/common/state/sessionCapabilities.js +5 -0
  24. package/vscode/src/vs/platform/agentHost/common/state/sessionProtocol.d.ts +5 -5
  25. package/vscode/src/vs/platform/agentHost/common/state/sessionProtocol.js +14 -0
  26. package/vscode/src/vs/platform/agentHost/common/state/sessionTransport.d.ts +42 -0
  27. package/vscode/src/vs/platform/agentHost/common/state/sessionTransport.js +7 -0
  28. package/vscode/src/vs/platform/agentPlugins/common/pluginParsers.d.ts +118 -0
  29. package/vscode/src/vs/platform/agentPlugins/common/pluginParsers.js +551 -0
  30. package/vscode/src/vs/platform/networkFilter/common/networkFilterService.d.ts +22 -0
  31. package/vscode/src/vs/platform/networkFilter/common/networkFilterService.js +83 -0
  32. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityService.js +2 -2
  33. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.js +16 -16
  34. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.js +8 -8
  35. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +59 -59
  36. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAgentRecommendationActions.js +1 -1
  37. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +12 -12
  38. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.d.ts +2 -1
  39. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +17 -15
  40. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.d.ts +8 -0
  41. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +113 -9
  42. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +81 -4
  43. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +2 -2
  44. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatForkActions.js +47 -26
  45. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +15 -10
  46. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatLanguageModelActions.js +13 -13
  47. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +6 -6
  48. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatNewActions.js +14 -14
  49. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatOpenAgentDebugPanelAction.js +13 -14
  50. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPluginActions.js +15 -14
  51. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPromptNavigationActions.js +2 -2
  52. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQueueActions.d.ts +5 -0
  53. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQueueActions.js +58 -23
  54. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +8 -8
  55. package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +18 -18
  56. package/vscode/src/vs/workbench/contrib/chat/browser/actions/createPluginAction.d.ts +2 -1
  57. package/vscode/src/vs/workbench/contrib/chat/browser/actions/createPluginAction.js +24 -22
  58. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginActions.js +8 -8
  59. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.js +2 -2
  60. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditorInput.js +2 -2
  61. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.d.ts +3 -1
  62. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.js +29 -20
  63. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.js +16 -16
  64. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectoryResolver.d.ts +9 -0
  65. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectoryResolver.js +23 -0
  66. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.js +3 -3
  67. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.d.ts +2 -2
  68. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.js +65 -55
  69. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.js +5 -5
  70. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsQuickAccess.js +1 -1
  71. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjection.js +1 -1
  72. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionActions.js +4 -4
  73. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.js +1 -1
  74. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionsExperiments.contribution.js +5 -5
  75. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.js +28 -28
  76. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccess.js +17 -17
  77. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccessActions.js +4 -4
  78. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.d.ts +10 -3
  79. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.js +80 -15
  80. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.d.ts +20 -14
  81. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.js +30 -15
  82. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemSource.d.ts +131 -0
  83. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemSource.js +363 -0
  84. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.d.ts +31 -76
  85. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.js +374 -764
  86. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidgetUtils.d.ts +8 -0
  87. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidgetUtils.js +11 -1
  88. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.contribution.js +222 -44
  89. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.d.ts +20 -11
  90. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.js +269 -123
  91. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.js +1 -1
  92. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePage.d.ts +40 -0
  93. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePage.js +40 -0
  94. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePagePromptLaunchers.d.ts +26 -0
  95. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePagePromptLaunchers.js +249 -0
  96. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWorkspaceService.d.ts +3 -0
  97. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWorkspaceService.js +3 -0
  98. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.d.ts +4 -3
  99. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.js +5 -17
  100. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.d.ts +14 -1
  101. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.js +113 -58
  102. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationManagement.css +202 -68
  103. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationWelcomePromptLaunchers.css +246 -0
  104. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.d.ts +15 -1
  105. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.js +162 -50
  106. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/promptsServiceCustomizationItemProvider.d.ts +24 -0
  107. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/promptsServiceCustomizationItemProvider.js +306 -0
  108. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.js +1 -1
  109. package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +581 -257
  110. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.d.ts +15 -1
  111. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.js +245 -26
  112. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugDetailPanel.js +25 -7
  113. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditor.d.ts +1 -1
  114. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditor.js +3 -5
  115. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditorInput.js +2 -2
  116. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventDetailRenderer.js +19 -19
  117. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventList.js +7 -7
  118. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFilters.js +6 -6
  119. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowChartView.js +7 -7
  120. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowGraph.js +103 -28
  121. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowLayout.js +3 -2
  122. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHomeView.d.ts +11 -1
  123. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHomeView.js +80 -29
  124. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHookContentRenderer.js +17 -17
  125. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.d.ts +20 -3
  126. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.js +128 -65
  127. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugMessageContentRenderer.js +8 -8
  128. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugModelTurnContentRenderer.js +23 -23
  129. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugOverviewView.js +28 -28
  130. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugToolCallContentRenderer.js +11 -11
  131. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/media/chatDebug.css +18 -0
  132. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +1 -1
  133. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.js +3 -3
  134. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +2 -2
  135. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +1 -1
  136. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.d.ts +1 -0
  137. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +11 -1
  138. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +3 -3
  139. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +6 -5
  140. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +1 -1
  141. package/vscode/src/vs/workbench/contrib/chat/browser/chatImageCarouselService.js +1 -1
  142. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.js +10 -27
  143. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditor.d.ts +4 -41
  144. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditor.js +4 -310
  145. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.d.ts +0 -12
  146. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.js +3 -30
  147. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.js +2 -2
  148. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.d.ts +1 -0
  149. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.js +61 -53
  150. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/media/chatManagementEditor.css +0 -110
  151. package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +3 -3
  152. package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +31 -31
  153. package/vscode/src/vs/workbench/contrib/chat/browser/chatRepoInfo.js +2 -2
  154. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.js +46 -34
  155. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.d.ts +4 -4
  156. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.js +17 -18
  157. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupGrowthSession.js +6 -6
  158. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.d.ts +1 -0
  159. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.js +96 -82
  160. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.d.ts +2 -1
  161. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.js +21 -14
  162. package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.js +18 -18
  163. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatus.js +1 -1
  164. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.d.ts +15 -8
  165. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.js +315 -263
  166. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.js +14 -14
  167. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/media/chatStatus.css +196 -24
  168. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipCatalog.js +56 -17
  169. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipEligibilityTracker.d.ts +2 -2
  170. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.js +2 -2
  171. package/vscode/src/vs/workbench/contrib/chat/browser/chatWindowNotifier.js +8 -4
  172. package/vscode/src/vs/workbench/contrib/chat/browser/claudePluginRecommendations.js +2 -2
  173. package/vscode/src/vs/workbench/contrib/chat/browser/defaultModelContribution.js +4 -4
  174. package/vscode/src/vs/workbench/contrib/chat/browser/enablementActions.js +4 -4
  175. package/vscode/src/vs/workbench/contrib/chat/browser/enablementStatusWidget.js +2 -2
  176. package/vscode/src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.js +1 -1
  177. package/vscode/src/vs/workbench/contrib/chat/browser/pluginGitCommandService.d.ts +18 -0
  178. package/vscode/src/vs/workbench/contrib/chat/browser/pluginGitCommandService.js +31 -0
  179. package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.js +26 -25
  180. package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.d.ts +3 -1
  181. package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.js +48 -57
  182. package/vscode/src/vs/workbench/contrib/chat/browser/pluginUrlHandler.js +6 -6
  183. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +6 -6
  184. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.js +26 -26
  185. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.d.ts +2 -2
  186. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.js +3 -3
  187. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionOverlay.js +2 -2
  188. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js +2 -2
  189. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptUrlHandler.js +8 -8
  190. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.js +7 -7
  191. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.js +3 -3
  192. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/skillActions.js +3 -3
  193. package/vscode/src/vs/workbench/contrib/chat/browser/promptsDebugContribution.d.ts +11 -6
  194. package/vscode/src/vs/workbench/contrib/chat/browser/promptsDebugContribution.js +226 -36
  195. package/vscode/src/vs/workbench/contrib/chat/browser/telemetry/chatModelCountTelemetry.d.ts +23 -0
  196. package/vscode/src/vs/workbench/contrib/chat/browser/telemetry/chatModelCountTelemetry.js +82 -0
  197. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.d.ts +3 -1
  198. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.js +108 -56
  199. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.js +24 -24
  200. package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.js +6 -6
  201. package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.js +7 -7
  202. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +5 -5
  203. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.js +9 -9
  204. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatStatusWidget.d.ts +3 -4
  205. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatStatusWidget.js +9 -16
  206. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.js +21 -80
  207. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorContrib.js +26 -59
  208. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorHover.js +1 -1
  209. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/chatQuick.js +4 -3
  210. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditor.js +9 -1
  211. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.d.ts +2 -1
  212. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.js +46 -14
  213. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.js +2 -2
  214. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugEvents.d.ts +40 -0
  215. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugEvents.js +60 -0
  216. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.d.ts +32 -5
  217. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.js +152 -26
  218. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.d.ts +5 -9
  219. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.js +265 -261
  220. package/vscode/src/vs/workbench/contrib/chat/common/model/chatModelStore.d.ts +28 -2
  221. package/vscode/src/vs/workbench/contrib/chat/common/model/chatModelStore.js +75 -7
  222. package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionOperationLog.js +9 -1
  223. package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.js +6 -5
  224. package/vscode/src/vs/workbench/contrib/chat/common/model/objectMutationLog.d.ts +18 -0
  225. package/vscode/src/vs/workbench/contrib/chat/common/model/objectMutationLog.js +32 -4
  226. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.d.ts +10 -25
  227. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.d.ts +7 -52
  228. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.js +58 -466
  229. package/vscode/src/vs/workbench/contrib/chat/common/plugins/workspacePluginSettingsService.js +3 -1
  230. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +36 -18
  231. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.js +5 -5
  232. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +5 -5
  233. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.js +12 -12
  234. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.d.ts +0 -1
  235. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.js +168 -182
  236. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.d.ts +49 -29
  237. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.js +491 -462
  238. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts +16 -6
  239. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +18 -12
  240. package/vscode/src/vs/workbench/contrib/chat/common/tools/chatArtifactsService.d.ts +24 -4
  241. package/vscode/src/vs/workbench/contrib/chat/common/tools/chatArtifactsService.js +145 -68
  242. package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +1 -1
  243. package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/aiEditTelemetry/aiEditTelemetryServiceImpl.js +2 -2
  244. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +4 -4
  245. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +25 -25
  246. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatDefaultModel.js +2 -2
  247. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatHistoryService.d.ts +2 -4
  248. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatHistoryService.js +19 -17
  249. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.d.ts +1 -1
  250. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.js +3 -3
  251. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.d.ts +5 -17
  252. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +77 -157
  253. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.js +14 -14
  254. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.js +1 -1
  255. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +10 -10
  256. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +5 -5
  257. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +1 -1
  258. package/vscode/src/vs/workbench/contrib/remoteCodingAgents/browser/remoteCodingAgents.contribution.js +7 -7
  259. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.js +17 -17
  260. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibleView.js +1 -1
  261. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +21 -21
  262. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatEnabler.js +1 -1
  263. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.d.ts +4 -1
  264. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.js +29 -7
  265. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +2 -2
  266. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.d.ts +1 -1
  267. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.js +3 -3
  268. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +12 -14
  269. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalLastCommandTool.js +4 -4
  270. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.d.ts +5 -1
  271. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +49 -12
  272. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalSelectionTool.js +4 -4
  273. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/killTerminalTool.js +9 -8
  274. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.d.ts +2 -2
  275. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +13 -8
  276. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sendToTerminalTool.d.ts +53 -0
  277. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sendToTerminalTool.js +319 -0
  278. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/createAndRunTaskTool.js +15 -15
  279. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/getTaskOutputTool.js +8 -8
  280. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/runTaskTool.js +15 -15
  281. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.d.ts +1 -1
  282. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.js +2 -2
  283. package/vscode/src/vs/workbench/services/agentHost/common/agentHostFileSystemService.d.ts +21 -0
  284. package/vscode/src/vs/workbench/services/agentHost/common/agentHostFileSystemService.js +35 -0
  285. package/vscode/src/vs/platform/agentHost/common/agentService.service.d.ts +0 -94
  286. package/vscode/src/vs/platform/agentHost/common/state/protocol/action-origin.generated.d.ts +0 -16
  287. package/vscode/src/vs/platform/agentHost/common/state/protocol/actions.d.ts +0 -578
  288. package/vscode/src/vs/platform/agentHost/common/state/protocol/messages.d.ts +0 -206
  289. package/vscode/src/vs/platform/agentHost/common/state/protocol/notifications.d.ts +0 -114
  290. package/vscode/src/vs/platform/agentHost/common/state/protocol/state.d.ts +0 -860
  291. package/vscode/src/vs/platform/agentHost/common/state/sessionState.d.ts +0 -27
  292. package/vscode/src/vs/platform/browserElements/common/browserElements.d.ts +0 -58
  293. package/vscode/src/vs/platform/browserElements/common/browserElements.js +0 -16
  294. package/vscode/src/vs/platform/sandbox/common/sandboxHelperIpc.d.ts +0 -18
  295. package/vscode/src/vs/platform/sandbox/common/sandboxHelperIpc.js +0 -13
  296. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/media/simpleBrowserOverlay.css +0 -85
  297. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/simpleBrowserEditorOverlay.d.ts +0 -9
  298. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/simpleBrowserEditorOverlay.js +0 -443
  299. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatUsageWidget.d.ts +0 -17
  300. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatUsageWidget.js +0 -132
  301. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/media/chatUsageWidget.css +0 -69
  302. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetup.d.ts +0 -65
  303. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetup.js +0 -66
  304. package/vscode/src/vs/workbench/contrib/chat/common/chatArtifactExtraction.d.ts +0 -8
  305. package/vscode/src/vs/workbench/contrib/chat/common/chatArtifactExtraction.js +0 -158
  306. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/alternativeRecommendation.d.ts +0 -2
  307. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/alternativeRecommendation.js +0 -41
  308. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/commandFileWriteParser.d.ts +0 -24
  309. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/sedFileWriteParser.d.ts +0 -26
  310. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/sedFileWriteParser.js +0 -142
  311. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.d.ts +0 -45
  312. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.js +0 -164
  313. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.d.ts +0 -50
  314. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.js +0 -163
  315. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.d.ts +0 -27
  316. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.js +0 -142
  317. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.d.ts +0 -29
  318. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.js +0 -137
  319. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/strategyHelpers.d.ts +0 -40
  320. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/strategyHelpers.js +0 -174
  321. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.d.ts +0 -3
  322. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.js +0 -39
  323. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.d.ts +0 -32
  324. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +0 -249
  325. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.d.ts +0 -41
  326. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.js +0 -92
  327. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.d.ts +0 -40
  328. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.js +0 -209
  329. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/awaitTerminalTool.d.ts +0 -12
  330. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/awaitTerminalTool.js +0 -106
  331. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/commandLineAutoApprover.d.ts +0 -31
  332. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/commandLineAutoApprover.js +0 -392
  333. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.d.ts +0 -45
  334. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.js +0 -243
  335. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAnalyzer.d.ts +0 -52
  336. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAnalyzer.js +0 -10
  337. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.d.ts +0 -20
  338. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +0 -310
  339. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.d.ts +0 -19
  340. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +0 -168
  341. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineSandboxAnalyzer.d.ts +0 -8
  342. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineSandboxAnalyzer.js +0 -25
  343. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/commandLinePresenter.d.ts +0 -41
  344. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/nodeCommandLinePresenter.d.ts +0 -19
  345. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/nodeCommandLinePresenter.js +0 -37
  346. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/pythonCommandLinePresenter.d.ts +0 -19
  347. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/pythonCommandLinePresenter.js +0 -37
  348. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/rubyCommandLinePresenter.d.ts +0 -19
  349. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/rubyCommandLinePresenter.js +0 -44
  350. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/sandboxedCommandLinePresenter.d.ts +0 -13
  351. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/sandboxedCommandLinePresenter.js +0 -21
  352. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineCdPrefixRewriter.d.ts +0 -5
  353. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineCdPrefixRewriter.js +0 -27
  354. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePreventHistoryRewriter.d.ts +0 -14
  355. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePreventHistoryRewriter.js +0 -29
  356. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePwshChainOperatorRewriter.d.ts +0 -8
  357. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePwshChainOperatorRewriter.js +0 -33
  358. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineRewriter.d.ts +0 -20
  359. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.d.ts +0 -8
  360. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.js +0 -28
  361. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.d.ts +0 -118
  362. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +0 -1019
  363. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/types.d.ts +0 -49
  364. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/types.js +0 -23
  365. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/outputAnalyzer.d.ts +0 -9
  366. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.d.ts +0 -150
  367. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +0 -1619
  368. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.d.ts +0 -22
  369. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.js +0 -41
  370. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalCommandArtifactCollector.d.ts +0 -17
  371. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalCommandArtifactCollector.js +0 -118
  372. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/toolIds.d.ts +0 -12
  373. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/toolIds.js +0 -17
  374. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.d.ts +0 -25
  375. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.js +0 -130
  376. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.d.ts +0 -122
  377. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +0 -482
@@ -1,52 +0,0 @@
1
- import type { IMarkdownString } from "@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent";
2
- import type { IDisposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
3
- import type { OperatingSystem } from "@codingame/monaco-vscode-api/vscode/vs/base/common/platform";
4
- import type { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
5
- import type { ConfigurationTarget } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration";
6
- import type { ToolConfirmationAction } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService";
7
- import type { INpmScriptAutoApproveResult } from "./autoApprove/npmScriptAutoApprover.js";
8
- import type { TreeSitterCommandParserLanguage } from "../../treeSitterCommandParser.js";
9
- export interface IAutoApproveRule {
10
- regex: RegExp;
11
- regexCaseInsensitive: RegExp;
12
- sourceText: string;
13
- sourceTarget: ConfigurationTarget | "session";
14
- isDefaultRule: boolean;
15
- }
16
- export interface INpmScriptAutoApproveRule {
17
- type: "npmScript";
18
- npmScriptResult: INpmScriptAutoApproveResult;
19
- }
20
- export declare function isAutoApproveRule(rule: IAutoApproveRule | INpmScriptAutoApproveRule | undefined): rule is IAutoApproveRule;
21
- export declare function isNpmScriptAutoApproveRule(rule: IAutoApproveRule | INpmScriptAutoApproveRule | undefined): rule is INpmScriptAutoApproveRule;
22
- export interface ICommandLineAnalyzer extends IDisposable {
23
- analyze(options: ICommandLineAnalyzerOptions): Promise<ICommandLineAnalyzerResult>;
24
- }
25
- export interface ICommandLineAnalyzerOptions {
26
- commandLine: string;
27
- cwd: URI | undefined;
28
- shell: string;
29
- os: OperatingSystem;
30
- treeSitterLanguage: TreeSitterCommandParserLanguage;
31
- terminalToolSessionId: string;
32
- chatSessionResource: URI | undefined;
33
- requiresUnsandboxConfirmation?: boolean;
34
- }
35
- export interface ICommandLineAnalyzerResult {
36
- /**
37
- * Whether auto approval is allowed based on the analysis, when false this
38
- * will block auto approval.
39
- */
40
- readonly isAutoApproveAllowed: boolean;
41
- /**
42
- * Whether the command line was explicitly auto approved by this analyzer.
43
- * - `true`: This analyzer explicitly approves auto-execution
44
- * - `false`: This analyzer explicitly denies auto-execution
45
- * - `undefined`: This analyzer does not make an approval/denial decision
46
- */
47
- readonly isAutoApproved?: boolean;
48
- readonly disclaimers?: readonly (string | IMarkdownString)[];
49
- readonly autoApproveInfo?: IMarkdownString;
50
- readonly customActions?: ToolConfirmationAction[];
51
- readonly forceAutoApproval?: boolean;
52
- }
@@ -1,10 +0,0 @@
1
-
2
-
3
- function isAutoApproveRule(rule) {
4
- return !!rule && 'sourceText' in rule;
5
- }
6
- function isNpmScriptAutoApproveRule(rule) {
7
- return !!rule && 'type' in rule && rule.type === 'npmScript';
8
- }
9
-
10
- export { isAutoApproveRule, isNpmScriptAutoApproveRule };
@@ -1,20 +0,0 @@
1
- import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
2
- import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
3
- import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
4
- import { ITerminalChatService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal.service";
5
- import { IStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service";
6
- import type { RunInTerminalToolTelemetry } from "../../runInTerminalToolTelemetry.js";
7
- import { type TreeSitterCommandParser } from "../../treeSitterCommandParser.js";
8
- import { type ICommandLineAnalyzer, type ICommandLineAnalyzerOptions, type ICommandLineAnalyzerResult } from "./commandLineAnalyzer.js";
9
- export declare class CommandLineAutoApproveAnalyzer extends Disposable implements ICommandLineAnalyzer {
10
- private readonly _treeSitterCommandParser;
11
- private readonly _telemetry;
12
- private readonly _log;
13
- private readonly _configurationService;
14
- private readonly _storageService;
15
- private readonly _terminalChatService;
16
- private readonly _commandLineAutoApprover;
17
- constructor(_treeSitterCommandParser: TreeSitterCommandParser, _telemetry: RunInTerminalToolTelemetry, _log: (message: string, ...args: unknown[]) => void, _configurationService: IConfigurationService, instantiationService: IInstantiationService, _storageService: IStorageService, _terminalChatService: ITerminalChatService);
18
- analyze(options: ICommandLineAnalyzerOptions): Promise<ICommandLineAnalyzerResult>;
19
- private _createAutoApproveInfo;
20
- }
@@ -1,310 +0,0 @@
1
-
2
- import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
- import { asArray } from '@codingame/monaco-vscode-api/vscode/vs/base/common/arrays';
4
- import { createCommandUri, MarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
5
- import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
6
- import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
7
- import { ConfigurationTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration';
8
- import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
9
- import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
10
- import { ITerminalChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal.service';
11
- import { StorageScope } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
12
- import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
13
- import { TerminalToolConfirmationStorageKeys } from '@codingame/monaco-vscode-katex-common/vscode/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart';
14
- import { ChatConfiguration } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
15
- import { TerminalChatAgentToolsSettingId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalChatAgentToolsConfiguration';
16
- import { isPowerShell, generateAutoApproveActions, dedupeRules } from '../../runInTerminalHelpers.js';
17
- import { isAutoApproveRule, isNpmScriptAutoApproveRule } from './commandLineAnalyzer.js';
18
- import { TerminalChatCommandId } from '@codingame/monaco-vscode-xterm-common/vscode/vs/workbench/contrib/terminalContrib/chat/browser/terminalChat';
19
- import { CommandLineAutoApprover } from './autoApprove/commandLineAutoApprover.js';
20
-
21
- const promptInjectionWarningCommandsLower = ["curl", "wget"];
22
- const promptInjectionWarningCommandsLowerPwshOnly = ["invoke-restmethod", "invoke-webrequest", "irm", "iwr"];
23
- let CommandLineAutoApproveAnalyzer = class CommandLineAutoApproveAnalyzer extends Disposable {
24
- constructor(
25
- _treeSitterCommandParser,
26
- _telemetry,
27
- _log,
28
- _configurationService,
29
- instantiationService,
30
- _storageService,
31
- _terminalChatService
32
- ) {
33
- super();
34
- this._treeSitterCommandParser = _treeSitterCommandParser;
35
- this._telemetry = _telemetry;
36
- this._log = _log;
37
- this._configurationService = _configurationService;
38
- this._storageService = _storageService;
39
- this._terminalChatService = _terminalChatService;
40
- this._commandLineAutoApprover = this._register(instantiationService.createInstance(CommandLineAutoApprover));
41
- }
42
- async analyze(options) {
43
- const isAutoApproveEnabledInSettings = this._configurationService.getValue(TerminalChatAgentToolsSettingId.EnableAutoApprove) === true;
44
- if (isAutoApproveEnabledInSettings && options.chatSessionResource && this._terminalChatService.hasChatSessionAutoApproval(options.chatSessionResource)) {
45
- this._log("Session has auto approval enabled, auto approving command");
46
- const disableUri = createCommandUri(
47
- TerminalChatCommandId.DisableSessionAutoApproval,
48
- options.chatSessionResource
49
- );
50
- const mdTrustSettings = {
51
- isTrusted: {
52
- enabledCommands: [TerminalChatCommandId.DisableSessionAutoApproval]
53
- }
54
- };
55
- return {
56
- isAutoApproved: true,
57
- isAutoApproveAllowed: true,
58
- disclaimers: [],
59
- autoApproveInfo: ( new MarkdownString(`${( localize(13868, "Auto approved for this session"))} ([${( localize(13869, "Disable"))}](${( disableUri.toString())}))`, mdTrustSettings))
60
- };
61
- }
62
- const trimmedCommandLine = options.commandLine.trimStart();
63
- let subCommands;
64
- try {
65
- subCommands = await this._treeSitterCommandParser.extractSubCommands(options.treeSitterLanguage, trimmedCommandLine);
66
- this._log(
67
- `Parsed sub-commands via ${options.treeSitterLanguage} grammar`,
68
- subCommands
69
- );
70
- } catch (e) {
71
- console.error(e);
72
- this._log(`Failed to parse sub-commands via ${options.treeSitterLanguage} grammar`);
73
- }
74
- let isAutoApproved = false;
75
- let autoApproveInfo;
76
- let customActions;
77
- if (!subCommands?.length) {
78
- if (trimmedCommandLine.length === 0) {
79
- this._log("Command line is empty, auto approving");
80
- return {
81
- isAutoApproved: true,
82
- isAutoApproveAllowed: true,
83
- disclaimers: []
84
- };
85
- }
86
- this._log("No sub-commands were parsed, auto approval is not allowed");
87
- return {
88
- isAutoApproveAllowed: false,
89
- disclaimers: []
90
- };
91
- }
92
- const subCommandResults = await Promise.all(( subCommands.map(
93
- e => this._commandLineAutoApprover.isCommandAutoApproved(e, options.shell, options.os, options.cwd, options.chatSessionResource)
94
- )));
95
- const commandLineResult = this._commandLineAutoApprover.isCommandLineAutoApproved(trimmedCommandLine, options.chatSessionResource);
96
- const autoApproveReasons = [...( subCommandResults.map(e => e.reason)), commandLineResult.reason];
97
- let isDenied = false;
98
- let autoApproveReason;
99
- let autoApproveDefault;
100
- const deniedSubCommandResult = subCommandResults.find(e => e.result === "denied");
101
- if (deniedSubCommandResult) {
102
- this._log("Sub-command DENIED auto approval");
103
- isDenied = true;
104
- autoApproveDefault = isAutoApproveRule(deniedSubCommandResult.rule) ? deniedSubCommandResult.rule.isDefaultRule : undefined;
105
- autoApproveReason = "subCommand";
106
- } else if (commandLineResult.result === "denied") {
107
- this._log("Command line DENIED auto approval");
108
- isDenied = true;
109
- autoApproveDefault = isAutoApproveRule(commandLineResult.rule) ? commandLineResult.rule.isDefaultRule : undefined;
110
- autoApproveReason = "commandLine";
111
- } else {
112
- if (subCommandResults.every(e => e.result === "approved")) {
113
- this._log("All sub-commands auto-approved");
114
- isAutoApproved = true;
115
- autoApproveReason = "subCommand";
116
- autoApproveDefault = subCommandResults.every(e => isAutoApproveRule(e.rule) && e.rule.isDefaultRule);
117
- } else {
118
- this._log("All sub-commands NOT auto-approved");
119
- if (commandLineResult.result === "approved") {
120
- this._log("Command line auto-approved");
121
- autoApproveReason = "commandLine";
122
- isAutoApproved = true;
123
- autoApproveDefault = isAutoApproveRule(commandLineResult.rule) ? commandLineResult.rule.isDefaultRule : undefined;
124
- } else {
125
- this._log("Command line NOT auto-approved");
126
- }
127
- }
128
- }
129
- for (const reason of autoApproveReasons) {
130
- this._log(`- ${reason}`);
131
- }
132
- const isAutoApproveEnabled = this._configurationService.getValue(TerminalChatAgentToolsSettingId.EnableAutoApprove) === true;
133
- const isAutoApproveWarningAccepted = this._storageService.getBoolean(
134
- TerminalToolConfirmationStorageKeys.TerminalAutoApproveWarningAccepted,
135
- StorageScope.APPLICATION,
136
- false
137
- );
138
- if (isAutoApproveEnabled && isAutoApproved) {
139
- autoApproveInfo = this._createAutoApproveInfo(
140
- isAutoApproved,
141
- isDenied,
142
- autoApproveReason,
143
- subCommandResults,
144
- commandLineResult
145
- );
146
- } else {
147
- isAutoApproved = false;
148
- }
149
- this._telemetry.logPrepare({
150
- terminalToolSessionId: options.terminalToolSessionId,
151
- subCommands,
152
- autoApproveAllowed: !isAutoApproveEnabled ? "off" : isAutoApproveWarningAccepted ? "allowed" : "needsOptIn",
153
- autoApproveResult: isAutoApproved ? "approved" : isDenied ? "denied" : "manual",
154
- autoApproveReason,
155
- autoApproveDefault
156
- });
157
- const disclaimers = [];
158
- const subCommandsLowerFirstWordOnly = ( subCommands.map(command => command.split(" ")[0].toLowerCase()));
159
- if (!isAutoApproved && (( subCommandsLowerFirstWordOnly.some(command => promptInjectionWarningCommandsLower.includes(command))) || (isPowerShell(options.shell, options.os) && ( subCommandsLowerFirstWordOnly.some(command => promptInjectionWarningCommandsLowerPwshOnly.includes(command)))))) {
160
- disclaimers.push(( localize(
161
- 13870,
162
- "Web content may contain malicious code or attempt prompt injection attacks."
163
- )));
164
- }
165
- if (isAutoApproveEnabled && isDenied) {
166
- const denialInfo = this._createAutoApproveInfo(
167
- isAutoApproved,
168
- isDenied,
169
- autoApproveReason,
170
- subCommandResults,
171
- commandLineResult
172
- );
173
- if (denialInfo) {
174
- disclaimers.push(denialInfo);
175
- }
176
- }
177
- if (!isAutoApproved && isAutoApproveEnabled) {
178
- customActions = generateAutoApproveActions(trimmedCommandLine, subCommands, {
179
- subCommandResults,
180
- commandLineResult
181
- });
182
- }
183
- return {
184
- isAutoApproved,
185
- isAutoApproveAllowed: true,
186
- disclaimers,
187
- autoApproveInfo,
188
- customActions
189
- };
190
- }
191
- _createAutoApproveInfo(
192
- isAutoApproved,
193
- isDenied,
194
- autoApproveReason,
195
- subCommandResults,
196
- commandLineResult
197
- ) {
198
- const formatRuleLinks = result => {
199
- return ( asArray(result).filter(e => isAutoApproveRule(e.rule)).map(e => {
200
- const escapedSourceText = e.rule.sourceText.replaceAll("$", "\\$");
201
- if (e.rule.sourceTarget === "session") {
202
- return localize(13871, "{0} (session)", `\`${escapedSourceText}\``);
203
- }
204
- const settingsUri = createCommandUri(TerminalChatCommandId.OpenTerminalSettingsLink, e.rule.sourceTarget);
205
- const tooltip = ( localize(13872, "View rule in settings"));
206
- let label = escapedSourceText;
207
- switch (e.rule?.sourceTarget) {
208
- case ConfigurationTarget.DEFAULT:
209
- label = `${label} (default)`;
210
- break;
211
- case ConfigurationTarget.USER:
212
- case ConfigurationTarget.USER_LOCAL:
213
- label = `${label} (user)`;
214
- break;
215
- case ConfigurationTarget.USER_REMOTE:
216
- label = `${label} (remote)`;
217
- break;
218
- case ConfigurationTarget.WORKSPACE:
219
- case ConfigurationTarget.WORKSPACE_FOLDER:
220
- label = `${label} (workspace)`;
221
- break;
222
- }
223
- return `[\`${label}\`](${( settingsUri.toString())} "${tooltip}")`;
224
- })).join(", ");
225
- };
226
- const mdTrustSettings = {
227
- isTrusted: {
228
- enabledCommands: [TerminalChatCommandId.OpenTerminalSettingsLink]
229
- }
230
- };
231
- const config = this._configurationService.inspect(ChatConfiguration.GlobalAutoApprove);
232
- const isGlobalAutoApproved = config?.value ?? config.defaultValue;
233
- if (isGlobalAutoApproved) {
234
- const settingsUri = createCommandUri(TerminalChatCommandId.OpenTerminalSettingsLink, "global");
235
- return (new MarkdownString(`${( localize(
236
- 13873,
237
- "Auto approved by setting {0}",
238
- `[\`${ChatConfiguration.GlobalAutoApprove}\`](${( settingsUri.toString())} "${( localize(13874, "View settings"))}")`
239
- ))}`, mdTrustSettings));
240
- }
241
- if (isAutoApproved) {
242
- switch (autoApproveReason) {
243
- case "commandLine":
244
- {
245
- if (isAutoApproveRule(commandLineResult.rule)) {
246
- return (new MarkdownString(
247
- localize(13875, "Auto approved by rule {0}", formatRuleLinks(commandLineResult)),
248
- mdTrustSettings
249
- ));
250
- }
251
- break;
252
- }
253
- case "subCommand":
254
- {
255
- const npmScriptApproval = subCommandResults.find(e => isNpmScriptAutoApproveRule(e.rule));
256
- if (npmScriptApproval && isNpmScriptAutoApproveRule(npmScriptApproval.rule) && npmScriptApproval.rule.npmScriptResult.autoApproveInfo) {
257
- return npmScriptApproval.rule.npmScriptResult.autoApproveInfo;
258
- }
259
- const uniqueRules = dedupeRules(subCommandResults);
260
- if (uniqueRules.length === 1) {
261
- return (new MarkdownString(
262
- localize(13875, "Auto approved by rule {0}", formatRuleLinks(uniqueRules)),
263
- mdTrustSettings
264
- ));
265
- } else if (uniqueRules.length > 1) {
266
- return (new MarkdownString(
267
- localize(13876, "Auto approved by rules {0}", formatRuleLinks(uniqueRules)),
268
- mdTrustSettings
269
- ));
270
- }
271
- break;
272
- }
273
- }
274
- } else if (isDenied) {
275
- switch (autoApproveReason) {
276
- case "commandLine":
277
- {
278
- if (commandLineResult.rule) {
279
- return (new MarkdownString(localize(
280
- 13877,
281
- "Auto approval denied by rule {0}",
282
- formatRuleLinks(commandLineResult)
283
- ), mdTrustSettings));
284
- }
285
- break;
286
- }
287
- case "subCommand":
288
- {
289
- const uniqueRules = dedupeRules(subCommandResults.filter(e => e.result === "denied"));
290
- if (uniqueRules.length === 1) {
291
- return (new MarkdownString(
292
- localize(13877, "Auto approval denied by rule {0}", formatRuleLinks(uniqueRules)),
293
- mdTrustSettings
294
- ));
295
- } else if (uniqueRules.length > 1) {
296
- return (new MarkdownString(
297
- localize(13878, "Auto approval denied by rules {0}", formatRuleLinks(uniqueRules)),
298
- mdTrustSettings
299
- ));
300
- }
301
- break;
302
- }
303
- }
304
- }
305
- return undefined;
306
- }
307
- };
308
- CommandLineAutoApproveAnalyzer = ( __decorate([( __param(3, IConfigurationService)), ( __param(4, IInstantiationService)), ( __param(5, IStorageService)), ( __param(6, ITerminalChatService))], CommandLineAutoApproveAnalyzer));
309
-
310
- export { CommandLineAutoApproveAnalyzer };
@@ -1,19 +0,0 @@
1
- import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
2
- import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
3
- import { IWorkspaceContextService } from "@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service";
4
- import { type TreeSitterCommandParser } from "../../treeSitterCommandParser.js";
5
- import type { ICommandLineAnalyzer, ICommandLineAnalyzerOptions, ICommandLineAnalyzerResult } from "./commandLineAnalyzer.js";
6
- import { ILabelService } from "@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service";
7
- export declare class CommandLineFileWriteAnalyzer extends Disposable implements ICommandLineAnalyzer {
8
- private readonly _treeSitterCommandParser;
9
- private readonly _log;
10
- private readonly _configurationService;
11
- private readonly _labelService;
12
- private readonly _workspaceContextService;
13
- constructor(_treeSitterCommandParser: TreeSitterCommandParser, _log: (message: string, ...args: unknown[]) => void, _configurationService: IConfigurationService, _labelService: ILabelService, _workspaceContextService: IWorkspaceContextService);
14
- analyze(options: ICommandLineAnalyzerOptions): Promise<ICommandLineAnalyzerResult>;
15
- private _getFileWrites;
16
- private _stripSurroundingQuotes;
17
- private _mapNullDevice;
18
- private _getResult;
19
- }
@@ -1,168 +0,0 @@
1
-
2
- import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
- import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
4
- import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
5
- import { win32, posix } from '@codingame/monaco-vscode-api/vscode/vs/base/common/path';
6
- import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
7
- import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
8
- import { IWorkspaceContextService } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service';
9
- import { TerminalChatAgentToolsSettingId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalChatAgentToolsConfiguration';
10
- import { TreeSitterCommandParserLanguage } from '../../treeSitterCommandParser.js';
11
- import { OperatingSystem } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
12
- import { isString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
13
- import { ILabelService } from '@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service';
14
-
15
- const nullDevice = Symbol("null device");
16
- let CommandLineFileWriteAnalyzer = class CommandLineFileWriteAnalyzer extends Disposable {
17
- constructor(
18
- _treeSitterCommandParser,
19
- _log,
20
- _configurationService,
21
- _labelService,
22
- _workspaceContextService
23
- ) {
24
- super();
25
- this._treeSitterCommandParser = _treeSitterCommandParser;
26
- this._log = _log;
27
- this._configurationService = _configurationService;
28
- this._labelService = _labelService;
29
- this._workspaceContextService = _workspaceContextService;
30
- }
31
- async analyze(options) {
32
- let fileWrites;
33
- try {
34
- fileWrites = await this._getFileWrites(options);
35
- } catch (e) {
36
- console.error(e);
37
- this._log("Failed to get file writes via grammar", options.treeSitterLanguage);
38
- return {
39
- isAutoApproveAllowed: false
40
- };
41
- }
42
- return this._getResult(options, fileWrites);
43
- }
44
- async _getFileWrites(options) {
45
- let fileWrites = [];
46
- const capturedFileWrites = ( (await this._treeSitterCommandParser.getFileWrites(options.treeSitterLanguage, options.commandLine)).map(this._mapNullDevice.bind(this, options)));
47
- const commandFileWrites = ( (await this._treeSitterCommandParser.getCommandFileWrites(options.treeSitterLanguage, options.commandLine)).map(this._mapNullDevice.bind(this, options)));
48
- const allCapturedFileWrites = [...capturedFileWrites, ...commandFileWrites];
49
- if (allCapturedFileWrites.length) {
50
- const cwd = options.cwd;
51
- if (cwd) {
52
- this._log("Detected cwd", ( cwd.toString()));
53
- fileWrites = ( allCapturedFileWrites.map(e => {
54
- if (e === nullDevice) {
55
- return e;
56
- }
57
- if (/^['"].*['"]$/.test(e)) {
58
- e = this._stripSurroundingQuotes(e);
59
- }
60
- const isAbsolute = options.os === OperatingSystem.Windows ? win32.isAbsolute(e) : posix.isAbsolute(e);
61
- if (isAbsolute) {
62
- return cwd.with({
63
- path: e
64
- });
65
- }
66
- return URI.joinPath(cwd, e);
67
- }));
68
- } else {
69
- this._log("Cwd could not be detected");
70
- fileWrites = allCapturedFileWrites;
71
- }
72
- }
73
- this._log("File writes detected", ( fileWrites.map(e => ( e.toString()))));
74
- return fileWrites;
75
- }
76
- _stripSurroundingQuotes(text) {
77
- if ((text.startsWith("\"") && text.endsWith("\"")) || (text.startsWith("'") && text.endsWith("'"))) {
78
- return text.slice(1, -1);
79
- }
80
- return text;
81
- }
82
- _mapNullDevice(options, rawFileWrite) {
83
- if (options.treeSitterLanguage === TreeSitterCommandParserLanguage.PowerShell) {
84
- return rawFileWrite === "$null" ? nullDevice : rawFileWrite;
85
- }
86
- return rawFileWrite === "/dev/null" ? nullDevice : rawFileWrite;
87
- }
88
- _getResult(options, fileWrites) {
89
- let isAutoApproveAllowed = true;
90
- if (fileWrites.length > 0) {
91
- const blockDetectedFileWrites = this._configurationService.getValue(TerminalChatAgentToolsSettingId.BlockDetectedFileWrites);
92
- switch (blockDetectedFileWrites) {
93
- case "all":
94
- {
95
- isAutoApproveAllowed = false;
96
- this._log("File writes blocked due to \"all\" setting");
97
- break;
98
- }
99
- case "outsideWorkspace":
100
- {
101
- const workspaceFolders = this._workspaceContextService.getWorkspace().folders;
102
- if (workspaceFolders.length > 0) {
103
- for (const fileWrite of fileWrites) {
104
- if (fileWrite === nullDevice) {
105
- this._log("File write to null device allowed", URI.isUri(fileWrite) ? ( fileWrite.toString()) : fileWrite);
106
- continue;
107
- }
108
- if (isString(fileWrite)) {
109
- const isAbsolute = options.os === OperatingSystem.Windows ? win32.isAbsolute(fileWrite) : posix.isAbsolute(fileWrite);
110
- if (!isAbsolute) {
111
- isAutoApproveAllowed = false;
112
- this._log("File write blocked due to unknown terminal cwd", fileWrite);
113
- break;
114
- }
115
- }
116
- const fileUri = URI.isUri(fileWrite) ? fileWrite : URI.file(fileWrite);
117
- if (fileUri.fsPath.match(/[$\(\){}`]/)) {
118
- isAutoApproveAllowed = false;
119
- this._log(
120
- "File write blocked due to likely containing a variable or sub-command",
121
- ( fileUri.toString())
122
- );
123
- break;
124
- }
125
- const isInsideWorkspace = ( workspaceFolders.some(
126
- folder => folder.uri.scheme === fileUri.scheme && (fileUri.path.startsWith(folder.uri.path + "/") || fileUri.path === folder.uri.path)
127
- ));
128
- if (!isInsideWorkspace) {
129
- isAutoApproveAllowed = false;
130
- this._log("File write blocked outside workspace", ( fileUri.toString()));
131
- break;
132
- }
133
- }
134
- } else {
135
- const hasOnlyNullDevices = fileWrites.every(fw => fw === nullDevice);
136
- if (!hasOnlyNullDevices) {
137
- isAutoApproveAllowed = false;
138
- this._log("File writes blocked - no workspace folders");
139
- }
140
- }
141
- break;
142
- }
143
- }
144
- }
145
- const disclaimers = [];
146
- if (fileWrites.length > 0) {
147
- const fileWritesList = ( fileWrites.map(
148
- fw => `\`${URI.isUri(fw) ? this._labelService.getUriLabel(fw) : fw === nullDevice ? "/dev/null" : ( fw.toString())}\``
149
- )).join(", ");
150
- if (!isAutoApproveAllowed) {
151
- disclaimers.push(( localize(
152
- 13879,
153
- "File write operations detected that cannot be auto approved: {0}",
154
- fileWritesList
155
- )));
156
- } else {
157
- disclaimers.push(( localize(13880, "File write operations detected: {0}", fileWritesList)));
158
- }
159
- }
160
- return {
161
- isAutoApproveAllowed,
162
- disclaimers
163
- };
164
- }
165
- };
166
- CommandLineFileWriteAnalyzer = ( __decorate([( __param(2, IConfigurationService)), ( __param(3, ILabelService)), ( __param(4, IWorkspaceContextService))], CommandLineFileWriteAnalyzer));
167
-
168
- export { CommandLineFileWriteAnalyzer };
@@ -1,8 +0,0 @@
1
- import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
2
- import { ITerminalSandboxService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.service";
3
- import type { ICommandLineAnalyzer, ICommandLineAnalyzerOptions, ICommandLineAnalyzerResult } from "./commandLineAnalyzer.js";
4
- export declare class CommandLineSandboxAnalyzer extends Disposable implements ICommandLineAnalyzer {
5
- private readonly _sandboxService;
6
- constructor(_sandboxService: ITerminalSandboxService);
7
- analyze(_options: ICommandLineAnalyzerOptions): Promise<ICommandLineAnalyzerResult>;
8
- }
@@ -1,25 +0,0 @@
1
-
2
- import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
- import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
4
- import { ITerminalSandboxService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.service';
5
-
6
- let CommandLineSandboxAnalyzer = class CommandLineSandboxAnalyzer extends Disposable {
7
- constructor(_sandboxService) {
8
- super();
9
- this._sandboxService = _sandboxService;
10
- }
11
- async analyze(_options) {
12
- if (!(await this._sandboxService.isEnabled())) {
13
- return {
14
- isAutoApproveAllowed: true
15
- };
16
- }
17
- return {
18
- isAutoApproveAllowed: true,
19
- forceAutoApproval: _options.requiresUnsandboxConfirmation ? false : true
20
- };
21
- }
22
- };
23
- CommandLineSandboxAnalyzer = ( __decorate([( __param(0, ITerminalSandboxService))], CommandLineSandboxAnalyzer));
24
-
25
- export { CommandLineSandboxAnalyzer };
@@ -1,41 +0,0 @@
1
- import type { MaybePromise } from "@codingame/monaco-vscode-api/vscode/vs/base/common/async";
2
- import type { OperatingSystem } from "@codingame/monaco-vscode-api/vscode/vs/base/common/platform";
3
- export interface ICommandLinePresenter {
4
- /**
5
- * Attempts to create a presentation for the given command line.
6
- * Command line presenters allow displaying an extracted/transformed version
7
- * of a command (e.g., Python code from `python -c "..."`) with appropriate
8
- * syntax highlighting, while the actual command remains unchanged.
9
- *
10
- * @returns The presentation result if this presenter handles the command, undefined otherwise.
11
- */
12
- present(options: ICommandLinePresenterOptions): MaybePromise<ICommandLinePresenterResult | undefined>;
13
- }
14
- export interface ICommandLinePresenterOptions {
15
- commandLine: ICommandLinePresentationInput;
16
- shell: string;
17
- os: OperatingSystem;
18
- }
19
- export interface ICommandLinePresentationInput {
20
- original?: string;
21
- forDisplay: string;
22
- }
23
- export interface ICommandLinePresenterResult {
24
- /**
25
- * The extracted/transformed command to display (e.g., the Python code).
26
- */
27
- commandLine: string;
28
- /**
29
- * The language ID for syntax highlighting (e.g., 'python').
30
- */
31
- language?: string;
32
- /**
33
- * A human-readable name for the language (e.g., 'Python') used in UI labels.
34
- */
35
- languageDisplayName?: string;
36
- /**
37
- * Whether other presenters should still process the command line.
38
- * Defaults to false - once a presenter handles a command, no further processing is done.
39
- */
40
- processOtherPresenters?: boolean;
41
- }