@codingame/monaco-vscode-chat-service-override 33.0.9 → 34.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 (403) hide show
  1. package/index.js +19 -5
  2. package/package.json +5 -5
  3. package/vscode/src/vs/platform/agentHost/browser/agentHostIpcChannelTransport.d.ts +32 -0
  4. package/vscode/src/vs/platform/agentHost/browser/agentHostIpcChannelTransport.js +77 -0
  5. package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostProtocolClient.d.ts +84 -17
  6. package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostProtocolClient.js +235 -190
  7. package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.d.ts +3 -2
  8. package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.js +23 -4
  9. package/vscode/src/vs/platform/agentHost/common/agentHost.config.contribution.d.ts +1 -0
  10. package/vscode/src/vs/platform/agentHost/common/agentHost.config.contribution.js +22 -0
  11. package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemProvider.d.ts +107 -8
  12. package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemProvider.js +272 -49
  13. package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemService.js +2 -2
  14. package/vscode/src/vs/platform/agentHost/common/{agentHostPermissionService.d.ts → agentHostResourceService.d.ts} +26 -0
  15. package/vscode/src/vs/platform/agentHost/common/{agentHostPermissionService.js → agentHostResourceService.js} +11 -1
  16. package/vscode/src/vs/platform/agentHost/common/agentHostSchema.d.ts +13 -0
  17. package/vscode/src/vs/platform/agentHost/common/agentHostSchema.js +26 -18
  18. package/vscode/src/vs/platform/agentHost/common/agentHostStarter.config.contribution.d.ts +1 -0
  19. package/vscode/src/vs/platform/agentHost/common/agentHostStarter.config.contribution.js +119 -0
  20. package/vscode/src/vs/platform/agentHost/common/agentService.d.ts +135 -19
  21. package/vscode/src/vs/platform/agentHost/common/agentService.js +8 -2
  22. package/vscode/src/vs/platform/agentHost/common/ahpJsonlLogger.d.ts +5 -1
  23. package/vscode/src/vs/platform/agentHost/common/ahpJsonlLogger.js +85 -22
  24. package/vscode/src/vs/platform/agentHost/common/customAgents.d.ts +36 -0
  25. package/vscode/src/vs/platform/agentHost/common/customAgents.js +12 -0
  26. package/vscode/src/vs/platform/agentHost/common/sandboxConfigSchema.d.ts +81 -0
  27. package/vscode/src/vs/platform/agentHost/common/sandboxConfigSchema.js +103 -0
  28. package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.d.ts +86 -10
  29. package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.js +129 -37
  30. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-changeset/reducer.d.ts +12 -0
  31. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-changeset/reducer.js +72 -0
  32. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-root/reducer.d.ts +6 -0
  33. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-root/reducer.js +30 -0
  34. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-session/reducer.d.ts +6 -0
  35. package/vscode/src/vs/platform/agentHost/common/state/protocol/{reducers.js → channels-session/reducer.js} +99 -168
  36. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-terminal/reducer.d.ts +6 -0
  37. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-terminal/reducer.js +110 -0
  38. package/vscode/src/vs/platform/agentHost/common/state/protocol/{errors.d.ts → common/errors.d.ts} +13 -2
  39. package/vscode/src/vs/platform/agentHost/common/state/protocol/{errors.js → common/errors.js} +1 -2
  40. package/vscode/src/vs/platform/agentHost/common/state/protocol/common/reducer-helpers.d.ts +17 -0
  41. package/vscode/src/vs/platform/agentHost/common/state/protocol/common/reducer-helpers.js +9 -0
  42. package/vscode/src/vs/platform/agentHost/common/state/protocol/version/registry.d.ts +33 -8
  43. package/vscode/src/vs/platform/agentHost/common/state/protocol/version/registry.js +2 -3
  44. package/vscode/src/vs/platform/agentHost/common/state/sessionActions.d.ts +36 -5
  45. package/vscode/src/vs/platform/agentHost/common/state/sessionActions.js +6 -3
  46. package/vscode/src/vs/platform/networkFilter/common/domainMatcher.d.ts +50 -0
  47. package/vscode/src/vs/platform/networkFilter/common/domainMatcher.js +138 -0
  48. package/vscode/src/vs/platform/networkFilter/common/networkFilterService.js +3 -3
  49. package/vscode/src/vs/platform/networkFilter/common/settings.d.ts +12 -0
  50. package/vscode/src/vs/platform/networkFilter/common/settings.js +14 -0
  51. package/vscode/src/vs/platform/sandbox/browser/sandboxHelperService.d.ts +4 -1
  52. package/vscode/src/vs/platform/sandbox/browser/sandboxHelperService.js +9 -0
  53. package/vscode/src/vs/platform/sandbox/common/sandboxHelperIpc.d.ts +21 -0
  54. package/vscode/src/vs/platform/sandbox/common/sandboxHelperIpc.js +28 -0
  55. package/vscode/src/vs/platform/sandbox/common/terminalSandboxCommandRules.d.ts +31 -0
  56. package/vscode/src/vs/platform/sandbox/common/terminalSandboxCommandRules.js +49 -0
  57. package/vscode/src/vs/platform/sandbox/common/terminalSandboxEngine.d.ts +182 -0
  58. package/vscode/src/vs/platform/sandbox/common/terminalSandboxEngine.js +784 -0
  59. package/vscode/src/vs/platform/sandbox/common/terminalSandboxReadAllowList.d.ts +18 -0
  60. package/vscode/src/vs/platform/sandbox/common/terminalSandboxReadAllowList.js +305 -0
  61. package/vscode/src/vs/platform/sandbox/common/terminalSandboxRuntimeConfigurationPerOperation.d.ts +7 -0
  62. package/vscode/src/vs/platform/sandbox/common/terminalSandboxRuntimeConfigurationPerOperation.js +120 -0
  63. package/vscode/src/vs/platform/sandbox/common/terminalSandboxService.d.ts +100 -0
  64. package/vscode/src/vs/platform/sandbox/common/terminalSandboxService.js +10 -0
  65. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityService.js +2 -2
  66. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.js +16 -16
  67. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.js +8 -8
  68. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +60 -60
  69. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAgentRecommendationActions.js +1 -1
  70. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +12 -12
  71. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +8 -8
  72. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +7 -7
  73. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +106 -8
  74. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +2 -2
  75. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatForkActions.js +22 -36
  76. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +3 -3
  77. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatLanguageModelActions.js +13 -13
  78. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +6 -6
  79. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatNewActions.js +21 -13
  80. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatOpenAgentDebugPanelAction.js +12 -12
  81. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPluginActions.js +38 -18
  82. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPromptNavigationActions.js +2 -2
  83. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQueueActions.js +11 -11
  84. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +8 -8
  85. package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +18 -18
  86. package/vscode/src/vs/workbench/contrib/chat/browser/actions/createPluginAction.js +20 -20
  87. package/vscode/src/vs/workbench/contrib/chat/browser/actions/exportAgentHostDebugLogsAction.d.ts +3 -2
  88. package/vscode/src/vs/workbench/contrib/chat/browser/actions/exportAgentHostDebugLogsAction.js +9 -9
  89. package/vscode/src/vs/workbench/contrib/chat/browser/actions/openCopilotCliStateFileAction.js +5 -5
  90. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginActions.d.ts +10 -0
  91. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginActions.js +40 -11
  92. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.js +15 -9
  93. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditorInput.js +2 -2
  94. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.d.ts +0 -1
  95. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.js +23 -17
  96. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.js +13 -13
  97. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationSyncProvider.d.ts +24 -0
  98. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationSyncProvider.js +55 -0
  99. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService.d.ts +30 -0
  100. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService.js +119 -0
  101. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCustomizationService.d.ts +13 -0
  102. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCustomizationService.js +32 -0
  103. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLocalCustomizations.d.ts +55 -0
  104. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLocalCustomizations.js +104 -0
  105. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostModeSynchronizer.d.ts +1 -0
  106. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostModeSynchronizer.js +177 -0
  107. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPermissionUiContribution.d.ts +3 -3
  108. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPermissionUiContribution.js +11 -11
  109. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostToolUtils.d.ts +6 -0
  110. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostToolUtils.js +14 -0
  111. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostUntitledProvisionalSessionService.d.ts +3 -0
  112. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostUntitledProvisionalSessionService.js +44 -5
  113. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/syncedCustomizationBundler.d.ts +60 -0
  114. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/syncedCustomizationBundler.js +103 -0
  115. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.js +4 -3
  116. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.js +70 -62
  117. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.js +9 -7
  118. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsQuickAccess.js +1 -1
  119. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjection.js +1 -1
  120. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionActions.js +4 -4
  121. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.js +1 -1
  122. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionsExperiments.contribution.js +6 -5
  123. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.js +38 -28
  124. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccess.js +17 -17
  125. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccessActions.js +4 -4
  126. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.d.ts +4 -4
  127. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.js +22 -31
  128. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.d.ts +2 -2
  129. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.js +15 -16
  130. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemsModel.d.ts +3 -3
  131. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemsModel.js +8 -2
  132. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.js +112 -113
  133. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.contribution.js +62 -68
  134. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.d.ts +3 -2
  135. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.js +149 -145
  136. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.d.ts +3 -1
  137. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.js +6 -1
  138. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePagePromptLaunchers.js +25 -25
  139. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCreatorService.js +2 -0
  140. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.d.ts +2 -0
  141. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.js +5 -3
  142. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedAgentPluginDetail.d.ts +8 -1
  143. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedAgentPluginDetail.js +13 -12
  144. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedMcpServerDetail.d.ts +8 -1
  145. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedMcpServerDetail.js +15 -13
  146. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.d.ts +1 -0
  147. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.js +78 -55
  148. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationManagement.css +140 -67
  149. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationWelcomePromptLaunchers.css +11 -21
  150. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.d.ts +3 -1
  151. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.js +59 -57
  152. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.js +1 -1
  153. package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +2 -0
  154. package/vscode/src/vs/workbench/contrib/chat/browser/chat.shared.contribution.js +440 -357
  155. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.js +32 -32
  156. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheExplorerView.js +99 -99
  157. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugDetailPanel.js +6 -6
  158. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditorInput.js +2 -2
  159. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventDetailRenderer.js +20 -20
  160. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventList.js +7 -7
  161. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFilters.js +4 -4
  162. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowChartView.js +7 -7
  163. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowGraph.js +22 -22
  164. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHomeView.js +13 -13
  165. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHookContentRenderer.js +17 -17
  166. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.js +24 -24
  167. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugMessageContentRenderer.js +8 -8
  168. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugModelTurnContentRenderer.js +23 -23
  169. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugOverviewView.js +33 -33
  170. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugToolCallContentRenderer.js +11 -11
  171. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +1 -1
  172. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorAccessibility.js +1 -1
  173. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +14 -14
  174. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +7 -7
  175. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.js +3 -3
  176. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +12 -12
  177. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +2 -2
  178. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +1 -1
  179. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +1 -1
  180. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +3 -3
  181. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +1 -1
  182. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +1 -1
  183. package/vscode/src/vs/workbench/contrib/chat/browser/chatGoalSummaryService.d.ts +21 -0
  184. package/vscode/src/vs/workbench/contrib/chat/browser/chatGoalSummaryService.js +115 -0
  185. package/vscode/src/vs/workbench/contrib/chat/browser/chatImageCarouselService.js +5 -2
  186. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.js +8 -8
  187. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.js +2 -2
  188. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.d.ts +6 -0
  189. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.js +28 -1
  190. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.d.ts +3 -1
  191. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.js +187 -106
  192. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/media/chatModelsWidget.css +41 -0
  193. package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +4 -4
  194. package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +30 -30
  195. package/vscode/src/vs/workbench/contrib/chat/browser/chatQuotaNotification.d.ts +66 -0
  196. package/vscode/src/vs/workbench/contrib/chat/browser/chatQuotaNotification.js +346 -0
  197. package/vscode/src/vs/workbench/contrib/chat/browser/chatRepoInfo.js +3 -2
  198. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.d.ts +0 -2
  199. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.js +72 -29
  200. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.js +10 -10
  201. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupGrowthSession.js +6 -6
  202. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.js +26 -26
  203. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.js +12 -12
  204. package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.d.ts +5 -1
  205. package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.js +144 -67
  206. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.d.ts +1 -0
  207. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.js +126 -80
  208. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.d.ts +1 -0
  209. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.js +32 -31
  210. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/media/chatStatus.css +4 -0
  211. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipCatalog.d.ts +11 -0
  212. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipCatalog.js +40 -33
  213. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.d.ts +5 -1
  214. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.js +25 -24
  215. package/vscode/src/vs/workbench/contrib/chat/browser/chatWindowNotifier.js +4 -4
  216. package/vscode/src/vs/workbench/contrib/chat/browser/claudePluginRecommendations.js +2 -2
  217. package/vscode/src/vs/workbench/contrib/chat/browser/contextContrib/chatContext.contribution.js +5 -5
  218. package/vscode/src/vs/workbench/contrib/chat/browser/defaultModelContribution.js +5 -5
  219. package/vscode/src/vs/workbench/contrib/chat/browser/enablementActions.js +4 -4
  220. package/vscode/src/vs/workbench/contrib/chat/browser/enablementStatusWidget.js +2 -2
  221. package/vscode/src/vs/workbench/contrib/chat/browser/githubRepoFetcher.js +1 -19
  222. package/vscode/src/vs/workbench/contrib/chat/browser/hasByokModelsContribution.d.ts +12 -22
  223. package/vscode/src/vs/workbench/contrib/chat/browser/hasByokModelsContribution.js +14 -6
  224. package/vscode/src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.d.ts +6 -3
  225. package/vscode/src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.js +56 -18
  226. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorActions.js +4 -4
  227. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorContribution.js +5 -5
  228. package/vscode/src/vs/workbench/contrib/chat/browser/pluginAutoUpdate.d.ts +3 -3
  229. package/vscode/src/vs/workbench/contrib/chat/browser/pluginAutoUpdate.js +5 -6
  230. package/vscode/src/vs/workbench/contrib/chat/browser/pluginGitCommandService.js +3 -3
  231. package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.js +33 -36
  232. package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.d.ts +3 -0
  233. package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.js +31 -16
  234. package/vscode/src/vs/workbench/contrib/chat/browser/pluginUrlHandler.d.ts +4 -4
  235. package/vscode/src/vs/workbench/contrib/chat/browser/pluginUrlHandler.js +16 -13
  236. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +6 -6
  237. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.js +27 -27
  238. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.d.ts +1 -1
  239. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.js +3 -3
  240. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionOverlay.js +2 -2
  241. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js +2 -2
  242. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptUrlHandler.js +8 -8
  243. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.js +7 -7
  244. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.js +3 -3
  245. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/skillActions.js +3 -3
  246. package/vscode/src/vs/workbench/contrib/chat/browser/promptsDebugContribution.js +20 -20
  247. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.js +39 -39
  248. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.js +24 -23
  249. package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.js +5 -5
  250. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolHelpers.d.ts +18 -0
  251. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolHelpers.js +23 -1
  252. package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.js +6 -6
  253. package/vscode/src/vs/workbench/contrib/chat/browser/utilityModelContribution.js +5 -2
  254. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +5 -5
  255. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.js +9 -9
  256. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.js +22 -13
  257. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorContrib.js +2 -2
  258. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorHover.js +1 -1
  259. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/chatQuick.js +1 -1
  260. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditor.js +1 -1
  261. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.d.ts +14 -3
  262. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.js +55 -24
  263. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.js +2 -2
  264. package/vscode/src/vs/workbench/contrib/chat/common/chatSelectedModel.d.ts +38 -0
  265. package/vscode/src/vs/workbench/contrib/chat/common/chatSelectedModel.js +47 -0
  266. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.js +54 -12
  267. package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionOperationLog.js +1 -0
  268. package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.js +6 -6
  269. package/vscode/src/vs/workbench/contrib/chat/common/model/objectMutationLog.d.ts +39 -0
  270. package/vscode/src/vs/workbench/contrib/chat/common/model/objectMutationLog.js +40 -4
  271. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.d.ts +30 -8
  272. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.js +205 -46
  273. package/vscode/src/vs/workbench/contrib/chat/common/plugins/fileBackedInstalledPluginsStore.d.ts +4 -3
  274. package/vscode/src/vs/workbench/contrib/chat/common/plugins/fileBackedInstalledPluginsStore.js +8 -3
  275. package/vscode/src/vs/workbench/contrib/chat/common/plugins/marketplaceReference.d.ts +57 -0
  276. package/vscode/src/vs/workbench/contrib/chat/common/plugins/marketplaceReference.js +153 -38
  277. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.d.ts +12 -7
  278. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.js +70 -37
  279. package/vscode/src/vs/workbench/contrib/chat/common/plugins/workspacePluginSettingsService.js +6 -28
  280. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +18 -18
  281. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.js +5 -5
  282. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +5 -5
  283. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.js +12 -12
  284. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.js +150 -150
  285. package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +1 -1
  286. package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarousel.contribution.js +10 -10
  287. package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarouselEditor.js +10 -10
  288. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +15 -15
  289. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatDefaultModel.js +2 -2
  290. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +4 -4
  291. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.js +14 -14
  292. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.js +1 -1
  293. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +10 -10
  294. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +5 -5
  295. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +1 -1
  296. package/vscode/src/vs/workbench/contrib/remoteCodingAgents/browser/remoteCodingAgents.contribution.js +7 -7
  297. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.js +17 -17
  298. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibleView.js +1 -1
  299. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +21 -21
  300. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatEnabler.js +1 -1
  301. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.d.ts +4 -0
  302. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.js +21 -1
  303. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +2 -2
  304. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/agentHostSandboxForwarder.d.ts +55 -0
  305. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/agentHostSandboxForwarder.js +122 -0
  306. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/alternativeRecommendation.d.ts +2 -0
  307. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/alternativeRecommendation.js +41 -0
  308. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/commandFileWriteParser.d.ts +24 -0
  309. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/sedFileWriteParser.d.ts +26 -0
  310. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/sedFileWriteParser.js +142 -0
  311. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.d.ts +52 -0
  312. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.js +232 -0
  313. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.d.ts +65 -0
  314. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.js +225 -0
  315. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.d.ts +27 -0
  316. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.js +143 -0
  317. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.d.ts +37 -0
  318. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.js +205 -0
  319. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/strategyHelpers.d.ts +40 -0
  320. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/strategyHelpers.js +174 -0
  321. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.d.ts +7 -0
  322. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.js +43 -0
  323. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.d.ts +52 -0
  324. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +260 -0
  325. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.d.ts +44 -0
  326. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.js +98 -0
  327. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.d.ts +1 -1
  328. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.js +3 -3
  329. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +14 -7
  330. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.d.ts +42 -0
  331. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.js +226 -0
  332. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/commandLineAutoApprover.d.ts +31 -0
  333. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/commandLineAutoApprover.js +392 -0
  334. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.d.ts +45 -0
  335. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.js +243 -0
  336. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAnalyzer.d.ts +54 -0
  337. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAnalyzer.js +10 -0
  338. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.d.ts +20 -0
  339. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +310 -0
  340. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.d.ts +27 -0
  341. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +177 -0
  342. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineSandboxAnalyzer.d.ts +11 -0
  343. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineSandboxAnalyzer.js +33 -0
  344. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/commandLinePresenter.d.ts +41 -0
  345. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/nodeCommandLinePresenter.d.ts +19 -0
  346. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/nodeCommandLinePresenter.js +37 -0
  347. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/pythonCommandLinePresenter.d.ts +19 -0
  348. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/pythonCommandLinePresenter.js +37 -0
  349. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/rubyCommandLinePresenter.d.ts +19 -0
  350. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/rubyCommandLinePresenter.js +44 -0
  351. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/sandboxedCommandLinePresenter.d.ts +13 -0
  352. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/sandboxedCommandLinePresenter.js +22 -0
  353. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineBackgroundDetachRewriter.d.ts +42 -0
  354. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineBackgroundDetachRewriter.js +102 -0
  355. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineCdPrefixRewriter.d.ts +5 -0
  356. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineCdPrefixRewriter.js +27 -0
  357. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePreventHistoryRewriter.d.ts +14 -0
  358. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePreventHistoryRewriter.js +29 -0
  359. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePwshChainOperatorRewriter.d.ts +8 -0
  360. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePwshChainOperatorRewriter.js +33 -0
  361. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineRewriter.d.ts +28 -0
  362. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.d.ts +15 -0
  363. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.js +55 -0
  364. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalLastCommandTool.js +3 -3
  365. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.d.ts +3 -0
  366. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +31 -9
  367. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalSelectionTool.js +3 -3
  368. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/killTerminalTool.js +4 -4
  369. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.d.ts +177 -0
  370. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +518 -0
  371. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/types.d.ts +42 -0
  372. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/types.js +23 -0
  373. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/outputAnalyzer.d.ts +9 -0
  374. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.d.ts +1 -1
  375. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +3 -3
  376. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.d.ts +297 -0
  377. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +2961 -0
  378. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.d.ts +29 -0
  379. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.js +63 -0
  380. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sendToTerminalTool.js +14 -14
  381. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/createAndRunTaskTool.js +14 -14
  382. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/getTaskOutputTool.js +7 -7
  383. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/runTaskTool.js +14 -14
  384. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.d.ts +1 -1
  385. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.js +2 -2
  386. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalCommandArtifactCollector.d.ts +17 -0
  387. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalCommandArtifactCollector.js +118 -0
  388. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalToolAutoApprove.d.ts +22 -0
  389. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalToolAutoApprove.js +44 -0
  390. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.d.ts +58 -0
  391. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.js +223 -0
  392. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/sandboxSettingsReader.d.ts +20 -0
  393. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/sandboxSettingsReader.js +81 -0
  394. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.d.ts +63 -0
  395. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +349 -0
  396. package/vscode/src/vs/workbench/services/agentHost/browser/editorRemoteAgentHostServiceClient.d.ts +75 -0
  397. package/vscode/src/vs/workbench/services/agentHost/browser/editorRemoteAgentHostServiceClient.js +192 -0
  398. package/vscode/src/vs/workbench/services/agentHost/common/agentHostResourceService.d.ts +89 -0
  399. package/vscode/src/vs/workbench/services/agentHost/common/{agentHostPermissionService.js → agentHostResourceService.js} +226 -9
  400. package/vscode/src/vs/platform/agentHost/common/state/protocol/reducers.d.ts +0 -30
  401. package/vscode/src/vs/platform/agentPlugins/common/pluginParsers.d.ts +0 -119
  402. package/vscode/src/vs/platform/agentPlugins/common/pluginParsers.js +0 -552
  403. package/vscode/src/vs/workbench/services/agentHost/common/agentHostPermissionService.d.ts +0 -83
@@ -0,0 +1,54 @@
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
+ requiresAllowNetworkConfirmation?: boolean;
35
+ hasSessionAutoApproval?: boolean;
36
+ }
37
+ export interface ICommandLineAnalyzerResult {
38
+ /**
39
+ * Whether auto approval is allowed based on the analysis, when false this
40
+ * will block auto approval.
41
+ */
42
+ readonly isAutoApproveAllowed: boolean;
43
+ /**
44
+ * Whether the command line was explicitly auto approved by this analyzer.
45
+ * - `true`: This analyzer explicitly approves auto-execution
46
+ * - `false`: This analyzer explicitly denies auto-execution
47
+ * - `undefined`: This analyzer does not make an approval/denial decision
48
+ */
49
+ readonly isAutoApproved?: boolean;
50
+ readonly disclaimers?: readonly (string | IMarkdownString)[];
51
+ readonly autoApproveInfo?: IMarkdownString;
52
+ readonly customActions?: ToolConfirmationAction[];
53
+ readonly forceAutoApproval?: boolean;
54
+ }
@@ -0,0 +1,10 @@
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 };
@@ -0,0 +1,20 @@
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
+ }
@@ -0,0 +1,310 @@
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(14639, "Auto approved for this session"))} ([${( localize(14640, "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
+ 14641,
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(14642, "{0} (session)", `\`${escapedSourceText}\``);
203
+ }
204
+ const settingsUri = createCommandUri(TerminalChatCommandId.OpenTerminalSettingsLink, e.rule.sourceTarget);
205
+ const tooltip = ( localize(14643, "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
+ 14644,
237
+ "Auto approved by setting {0}",
238
+ `[\`${ChatConfiguration.GlobalAutoApprove}\`](${( settingsUri.toString())} "${( localize(14645, "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(14646, "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(14646, "Auto approved by rule {0}", formatRuleLinks(uniqueRules)),
263
+ mdTrustSettings
264
+ ));
265
+ } else if (uniqueRules.length > 1) {
266
+ return (new MarkdownString(
267
+ localize(14647, "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
+ 14648,
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(14648, "Auto approval denied by rule {0}", formatRuleLinks(uniqueRules)),
293
+ mdTrustSettings
294
+ ));
295
+ } else if (uniqueRules.length > 1) {
296
+ return (new MarkdownString(
297
+ localize(14649, "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 };
@@ -0,0 +1,27 @@
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
+ /**
20
+ * Returns true if the given URI path points inside an OS temporary directory.
21
+ * On posix systems this matches `/tmp/`. On Windows this matches any `temp`
22
+ * or `tmp` directory segment (case-insensitive), which covers the canonical
23
+ * user temp (`...\AppData\Local\Temp\`), system temp (`C:\Windows\Temp\`),
24
+ * and common dev conventions like `C:\Temp\` and `C:\tmp\`.
25
+ */
26
+ private _isInTempDirectory;
27
+ }
@@ -0,0 +1,177 @@
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, sub-command, or tilde expansion",
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
+ if (options.hasSessionAutoApproval && this._isInTempDirectory(fileUri.path, options.os)) {
130
+ continue;
131
+ }
132
+ isAutoApproveAllowed = false;
133
+ this._log("File write blocked outside workspace", ( fileUri.toString()));
134
+ break;
135
+ }
136
+ }
137
+ } else {
138
+ const hasOnlyNullDevices = fileWrites.every(fw => fw === nullDevice);
139
+ if (!hasOnlyNullDevices) {
140
+ isAutoApproveAllowed = false;
141
+ this._log("File writes blocked - no workspace folders");
142
+ }
143
+ }
144
+ break;
145
+ }
146
+ }
147
+ }
148
+ const disclaimers = [];
149
+ if (fileWrites.length > 0) {
150
+ const fileWritesList = ( fileWrites.map(
151
+ fw => `\`${URI.isUri(fw) ? this._labelService.getUriLabel(fw) : fw === nullDevice ? "/dev/null" : ( fw.toString())}\``
152
+ )).join(", ");
153
+ if (!isAutoApproveAllowed) {
154
+ disclaimers.push(( localize(
155
+ 14650,
156
+ "File write operations detected that cannot be auto approved: {0}",
157
+ fileWritesList
158
+ )));
159
+ } else {
160
+ disclaimers.push(( localize(14651, "File write operations detected: {0}", fileWritesList)));
161
+ }
162
+ }
163
+ return {
164
+ isAutoApproveAllowed,
165
+ disclaimers
166
+ };
167
+ }
168
+ _isInTempDirectory(uriPath, os) {
169
+ if (os === OperatingSystem.Windows) {
170
+ return /[\\/]te?mp[\\/].+/i.test(uriPath);
171
+ }
172
+ return uriPath.startsWith("/tmp/");
173
+ }
174
+ };
175
+ CommandLineFileWriteAnalyzer = ( __decorate([( __param(2, IConfigurationService)), ( __param(3, ILabelService)), ( __param(4, IWorkspaceContextService))], CommandLineFileWriteAnalyzer));
176
+
177
+ export { CommandLineFileWriteAnalyzer };
@@ -0,0 +1,11 @@
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 { ITerminalSandboxService } from "../../../common/terminalSandboxService.js";
4
+ import type { ICommandLineAnalyzer, ICommandLineAnalyzerOptions, ICommandLineAnalyzerResult } from "./commandLineAnalyzer.js";
5
+ export declare class CommandLineSandboxAnalyzer extends Disposable implements ICommandLineAnalyzer {
6
+ private readonly _sandboxService;
7
+ private readonly _configurationService;
8
+ constructor(_sandboxService: ITerminalSandboxService, _configurationService: IConfigurationService);
9
+ private _isAutoApproveEnabled;
10
+ analyze(_options: ICommandLineAnalyzerOptions): Promise<ICommandLineAnalyzerResult>;
11
+ }
@@ -0,0 +1,33 @@
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 { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
5
+ import { TerminalChatAgentToolsSettingId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalChatAgentToolsConfiguration';
6
+ import '../../../common/terminalSandboxService.js';
7
+ import { ITerminalSandboxService } from '@codingame/monaco-vscode-api/vscode/vs/platform/sandbox/common/terminalSandboxService.service';
8
+
9
+ let CommandLineSandboxAnalyzer = class CommandLineSandboxAnalyzer extends Disposable {
10
+ constructor(_sandboxService, _configurationService) {
11
+ super();
12
+ this._sandboxService = _sandboxService;
13
+ this._configurationService = _configurationService;
14
+ }
15
+ _isAutoApproveEnabled() {
16
+ return this._configurationService.getValue(TerminalChatAgentToolsSettingId.EnableAutoApprove) !== false;
17
+ }
18
+ async analyze(_options) {
19
+ const isAutoApproveEnabled = this._isAutoApproveEnabled();
20
+ if (!(await this._sandboxService.isEnabled())) {
21
+ return {
22
+ isAutoApproveAllowed: isAutoApproveEnabled
23
+ };
24
+ }
25
+ return {
26
+ isAutoApproveAllowed: isAutoApproveEnabled,
27
+ forceAutoApproval: !_options.requiresUnsandboxConfirmation && !_options.requiresAllowNetworkConfirmation && isAutoApproveEnabled
28
+ };
29
+ }
30
+ };
31
+ CommandLineSandboxAnalyzer = ( __decorate([( __param(0, ITerminalSandboxService)), ( __param(1, IConfigurationService))], CommandLineSandboxAnalyzer));
32
+
33
+ export { CommandLineSandboxAnalyzer };