@codingame/monaco-vscode-chat-service-override 34.1.3 → 35.0.1

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 (427) hide show
  1. package/index.js +38 -0
  2. package/package.json +5 -5
  3. package/vscode/src/vs/platform/agentHost/browser/agentHost.config.contribution.d.ts +1 -0
  4. package/vscode/src/vs/platform/agentHost/browser/agentHost.config.contribution.js +40 -0
  5. package/vscode/src/vs/platform/agentHost/browser/agentHostConnectionsService.d.ts +27 -0
  6. package/vscode/src/vs/platform/agentHost/browser/agentHostConnectionsService.js +91 -0
  7. package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostProtocolClient.d.ts +20 -4
  8. package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostProtocolClient.js +148 -15
  9. package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.d.ts +1 -0
  10. package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.js +9 -1
  11. package/vscode/src/vs/platform/agentHost/common/agentHost.config.contribution.js +57 -3
  12. package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemProvider.d.ts +10 -14
  13. package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemProvider.js +29 -8
  14. package/vscode/src/vs/platform/agentHost/common/agentHostSchema.d.ts +109 -2
  15. package/vscode/src/vs/platform/agentHost/common/agentHostSchema.js +207 -21
  16. package/vscode/src/vs/platform/agentHost/common/agentHostStarter.config.contribution.js +362 -37
  17. package/vscode/src/vs/platform/agentHost/common/agentService.d.ts +698 -91
  18. package/vscode/src/vs/platform/agentHost/common/agentService.js +46 -3
  19. package/vscode/src/vs/platform/agentHost/common/customAgents.js +1 -0
  20. package/vscode/src/vs/platform/agentHost/common/resourceReadLogging.d.ts +1 -0
  21. package/vscode/src/vs/platform/agentHost/common/resourceReadLogging.js +26 -0
  22. package/vscode/src/vs/platform/agentHost/common/sandboxConfigSchema.d.ts +5 -5
  23. package/vscode/src/vs/platform/agentHost/common/sandboxConfigSchema.js +17 -17
  24. package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.d.ts +96 -12
  25. package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.js +226 -19
  26. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-annotations/reducer.d.ts +18 -0
  27. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-annotations/reducer.js +89 -0
  28. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-changeset/reducer.js +10 -0
  29. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-chat/reducer.d.ts +6 -0
  30. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-chat/reducer.js +400 -0
  31. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-session/reducer.js +129 -446
  32. package/vscode/src/vs/platform/agentHost/common/state/protocol/common/reducer-helpers.d.ts +2 -2
  33. package/vscode/src/vs/platform/agentHost/common/state/protocol/version/registry.d.ts +1 -1
  34. package/vscode/src/vs/platform/agentHost/common/state/protocol/version/registry.js +1 -1
  35. package/vscode/src/vs/platform/agentHost/common/state/sessionActions.d.ts +35 -25
  36. package/vscode/src/vs/platform/agentHost/common/state/sessionActions.js +7 -1
  37. package/vscode/src/vs/{workbench/contrib → platform}/browserView/common/browserChatToolReferenceNames.d.ts +4 -0
  38. package/vscode/src/vs/platform/networkFilter/common/networkFilterService.js +1 -1
  39. package/vscode/src/vs/platform/sandbox/browser/sandboxHelperService.js +1 -0
  40. package/vscode/src/vs/platform/sandbox/common/terminalSandboxCommandRules.d.ts +0 -6
  41. package/vscode/src/vs/platform/sandbox/common/terminalSandboxCommandRules.js +5 -18
  42. package/vscode/src/vs/platform/sandbox/common/terminalSandboxEngine.d.ts +52 -3
  43. package/vscode/src/vs/platform/sandbox/common/terminalSandboxEngine.js +212 -34
  44. package/vscode/src/vs/platform/sandbox/common/terminalSandboxReadAllowList.js +3 -4
  45. package/vscode/src/vs/platform/sandbox/common/terminalSandboxRuntimeConfigurationPerOperation.js +11 -10
  46. package/vscode/src/vs/platform/sandbox/common/terminalSandboxService.d.ts +13 -6
  47. package/vscode/src/vs/platform/sandbox/common/terminalSandboxService.js +6 -1
  48. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoice.contribution.d.ts +2 -0
  49. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoice.contribution.js +399 -0
  50. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceSessionsPicker.d.ts +20 -0
  51. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceSessionsPicker.js +85 -0
  52. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidget.d.ts +177 -0
  53. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidget.js +898 -0
  54. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidgetBinding.d.ts +24 -0
  55. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidgetBinding.js +204 -0
  56. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWindowService.d.ts +61 -0
  57. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWindowService.js +338 -0
  58. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/confirmationComponent.d.ts +10 -0
  59. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/confirmationComponent.js +57 -0
  60. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/feedbackDialog.d.ts +33 -0
  61. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/feedbackDialog.js +98 -0
  62. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/headerComponent.d.ts +30 -0
  63. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/headerComponent.js +149 -0
  64. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/onboardingComponent.d.ts +12 -0
  65. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/onboardingComponent.js +116 -0
  66. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/sessionListComponent.d.ts +32 -0
  67. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/sessionListComponent.js +226 -0
  68. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/statusRowsComponent.d.ts +18 -0
  69. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/statusRowsComponent.js +138 -0
  70. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/tokens.d.ts +26 -0
  71. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/tokens.js +25 -0
  72. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/transcriptComponent.d.ts +13 -0
  73. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/transcriptComponent.js +108 -0
  74. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/voiceBarComponent.d.ts +13 -0
  75. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/voiceBarComponent.js +63 -0
  76. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscripts.contribution.d.ts +1 -0
  77. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscripts.contribution.js +178 -0
  78. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscriptsView.d.ts +47 -0
  79. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscriptsView.js +322 -0
  80. package/vscode/src/vs/workbench/contrib/agentsVoice/common/agentsVoice.d.ts +15 -0
  81. package/vscode/src/vs/workbench/contrib/agentsVoice/common/agentsVoice.js +15 -0
  82. package/vscode/src/vs/workbench/contrib/agentsVoice/common/agentsVoiceColors.d.ts +2 -0
  83. package/vscode/src/vs/workbench/contrib/agentsVoice/common/agentsVoiceColors.js +26 -0
  84. package/vscode/src/vs/workbench/contrib/agentsVoice/common/voiceTranscriptStore.d.ts +132 -0
  85. package/vscode/src/vs/workbench/contrib/agentsVoice/common/voiceTranscriptStore.js +237 -0
  86. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityService.js +2 -2
  87. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.d.ts +2 -2
  88. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.js +32 -16
  89. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.js +8 -8
  90. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.d.ts +1 -1
  91. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +71 -60
  92. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAgentRecommendationActions.js +1 -1
  93. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClear.js +6 -1
  94. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +15 -15
  95. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +8 -8
  96. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +7 -7
  97. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +19 -24
  98. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +2 -2
  99. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatForkActions.d.ts +9 -0
  100. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatForkActions.js +14 -5
  101. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +3 -3
  102. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatLanguageModelActions.js +13 -13
  103. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +6 -6
  104. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatNewActions.js +14 -14
  105. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatOpenAgentDebugPanelAction.js +13 -13
  106. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPluginActions.js +66 -52
  107. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPromptNavigationActions.js +2 -2
  108. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQueueActions.js +15 -36
  109. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +8 -8
  110. package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +19 -19
  111. package/vscode/src/vs/workbench/contrib/chat/browser/actions/createPluginAction.js +20 -20
  112. package/vscode/src/vs/workbench/contrib/chat/browser/actions/exportAgentHostDebugLogsAction.d.ts +1 -1
  113. package/vscode/src/vs/workbench/contrib/chat/browser/actions/exportAgentHostDebugLogsAction.js +128 -13
  114. package/vscode/src/vs/workbench/contrib/chat/browser/actions/openCopilotCliStateFileAction.js +6 -6
  115. package/vscode/src/vs/workbench/contrib/chat/browser/actions/reviewEdits.js +1 -1
  116. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginActions.js +10 -10
  117. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.js +2 -2
  118. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditorInput.js +2 -2
  119. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.d.ts +1 -0
  120. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.js +58 -9
  121. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.js +13 -13
  122. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService.d.ts +15 -3
  123. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService.js +64 -17
  124. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCustomizationService.d.ts +45 -1
  125. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCustomizationService.js +15 -0
  126. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLocalCustomizations.d.ts +25 -5
  127. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLocalCustomizations.js +143 -20
  128. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostModeSynchronizer.js +7 -31
  129. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostNewSessionFolderService.d.ts +23 -0
  130. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostNewSessionFolderService.js +52 -0
  131. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPermissionUiContribution.js +5 -5
  132. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostToolSetEnablementService.d.ts +47 -0
  133. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostToolSetEnablementService.js +163 -0
  134. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostUntitledProvisionalSessionService.d.ts +26 -3
  135. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostUntitledProvisionalSessionService.js +106 -8
  136. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/syncedCustomizationBundler.d.ts +16 -3
  137. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/syncedCustomizationBundler.js +44 -14
  138. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.js +3 -3
  139. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.js +70 -59
  140. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.js +5 -5
  141. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsQuickAccess.js +1 -1
  142. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjection.js +1 -1
  143. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionActions.js +4 -4
  144. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.js +1 -1
  145. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionsExperiments.contribution.js +4 -4
  146. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.js +22 -22
  147. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccess.js +17 -17
  148. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccessActions.js +4 -4
  149. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/localAgentDisabledInputTipContribution.d.ts +27 -0
  150. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/localAgentDisabledInputTipContribution.js +152 -0
  151. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/localAgentSessionsController.js +11 -5
  152. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.d.ts +1 -1
  153. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.js +9 -36
  154. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.d.ts +8 -0
  155. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.js +17 -15
  156. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemSource.d.ts +143 -0
  157. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemSource.js +30 -0
  158. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemsModel.d.ts +6 -3
  159. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemsModel.js +3 -1
  160. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.d.ts +1 -3
  161. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.js +107 -126
  162. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.contribution.js +46 -46
  163. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.d.ts +19 -22
  164. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.js +244 -190
  165. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.d.ts +2 -0
  166. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.js +13 -1
  167. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePage.d.ts +3 -1
  168. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePage.js +7 -2
  169. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePagePromptLaunchers.d.ts +5 -1
  170. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePagePromptLaunchers.js +47 -28
  171. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWorkspaceService.d.ts +2 -5
  172. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWorkspaceService.js +4 -8
  173. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/automationsListWidget.d.ts +87 -0
  174. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/automationsListWidget.js +772 -0
  175. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCreatorService.d.ts +24 -8
  176. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCreatorService.js +3 -8
  177. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.js +1 -7
  178. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedAgentPluginDetail.js +2 -2
  179. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedExtensionToolsDetail.d.ts +42 -0
  180. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedExtensionToolsDetail.js +130 -0
  181. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedMcpServerDetail.js +3 -3
  182. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/galleryItemRenderer.d.ts +46 -0
  183. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/galleryItemRenderer.js +94 -0
  184. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.d.ts +9 -1
  185. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.js +421 -201
  186. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationManagement.css +1424 -97
  187. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationWelcomePromptLaunchers.css +1 -1
  188. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.d.ts +1 -0
  189. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.js +107 -127
  190. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/promptsServiceCustomizationItemProvider.d.ts +29 -0
  191. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/promptsServiceCustomizationItemProvider.js +331 -0
  192. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/toolsListWidget.d.ts +120 -0
  193. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/toolsListWidget.js +898 -0
  194. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.js +1 -1
  195. package/vscode/src/vs/workbench/contrib/chat/browser/chat.shared.contribution.js +581 -336
  196. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostChatDebugProvider.d.ts +123 -0
  197. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostChatDebugProvider.js +567 -0
  198. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.js +32 -32
  199. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheDiff.js +168 -84
  200. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheExplorerView.d.ts +183 -2
  201. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheExplorerView.js +897 -251
  202. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheInsights.d.ts +213 -0
  203. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheInsights.js +720 -0
  204. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugDetailPanel.js +6 -6
  205. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditorInput.js +2 -2
  206. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventDetailRenderer.js +20 -20
  207. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventList.js +7 -7
  208. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFilters.js +4 -4
  209. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowChartView.js +7 -7
  210. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowGraph.js +22 -22
  211. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHomeView.js +13 -13
  212. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHookContentRenderer.js +17 -17
  213. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.js +24 -24
  214. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugMessageContentRenderer.js +8 -8
  215. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugModelTurnContentRenderer.js +23 -23
  216. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugOverviewView.js +33 -33
  217. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugToolCallContentRenderer.js +11 -11
  218. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/media/chatDebug.css +354 -1
  219. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCheckpointTimelineImpl.js +9 -2
  220. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +1 -1
  221. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingDeletedFileEntry.js +1 -1
  222. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +14 -14
  223. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +7 -7
  224. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.js +3 -3
  225. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +12 -12
  226. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +11 -4
  227. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +1 -1
  228. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +1 -1
  229. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +4 -4
  230. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +3 -3
  231. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelChangeService.js +1 -1
  232. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +1 -1
  233. package/vscode/src/vs/workbench/contrib/chat/browser/chatImageCarouselService.d.ts +9 -3
  234. package/vscode/src/vs/workbench/contrib/chat/browser/chatImageCarouselService.js +55 -8
  235. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.js +8 -8
  236. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.js +2 -2
  237. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.d.ts +18 -1
  238. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.js +192 -87
  239. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/media/chatModelsWidget.css +37 -3
  240. package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +4 -4
  241. package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +30 -30
  242. package/vscode/src/vs/workbench/contrib/chat/browser/chatQuotaNotification.d.ts +40 -1
  243. package/vscode/src/vs/workbench/contrib/chat/browser/chatQuotaNotification.js +230 -41
  244. package/vscode/src/vs/workbench/contrib/chat/browser/chatRepoInfo.js +2 -2
  245. package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseFileChangesService.d.ts +30 -0
  246. package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseFileChangesService.js +29 -0
  247. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.js +23 -25
  248. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.js +10 -10
  249. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupGrowthSession.js +6 -6
  250. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.js +35 -32
  251. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.d.ts +26 -2
  252. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.js +56 -32
  253. package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.js +19 -19
  254. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.d.ts +0 -1
  255. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.js +109 -68
  256. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.d.ts +38 -5
  257. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.js +175 -50
  258. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/media/chatStatus.css +4 -0
  259. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipCatalog.js +19 -19
  260. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.js +2 -2
  261. package/vscode/src/vs/workbench/contrib/chat/browser/chatWindowNotifier.js +4 -4
  262. package/vscode/src/vs/workbench/contrib/chat/browser/claudePluginRecommendations.js +2 -2
  263. package/vscode/src/vs/workbench/contrib/chat/browser/contextContrib/chatContext.contribution.js +5 -5
  264. package/vscode/src/vs/workbench/contrib/chat/browser/defaultModelContribution.js +5 -5
  265. package/vscode/src/vs/workbench/contrib/chat/browser/enablementActions.js +4 -4
  266. package/vscode/src/vs/workbench/contrib/chat/browser/enablementStatusWidget.js +2 -2
  267. package/vscode/src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.js +1 -1
  268. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorActions.js +4 -4
  269. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorContribution.js +5 -5
  270. package/vscode/src/vs/workbench/contrib/chat/browser/pluginAutoUpdate.d.ts +4 -5
  271. package/vscode/src/vs/workbench/contrib/chat/browser/pluginAutoUpdate.js +1 -1
  272. package/vscode/src/vs/workbench/contrib/chat/browser/pluginGitCommandService.js +3 -3
  273. package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.d.ts +32 -3
  274. package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.js +183 -84
  275. package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.js +15 -15
  276. package/vscode/src/vs/workbench/contrib/chat/browser/pluginUrlHandler.d.ts +3 -1
  277. package/vscode/src/vs/workbench/contrib/chat/browser/pluginUrlHandler.js +20 -9
  278. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +6 -6
  279. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.js +27 -27
  280. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.js +3 -3
  281. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionOverlay.js +2 -2
  282. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolSetsCodeLensProvider.d.ts +1 -0
  283. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolSetsCodeLensProvider.js +109 -0
  284. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js +2 -2
  285. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptUrlHandler.js +8 -8
  286. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.js +7 -7
  287. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.js +3 -3
  288. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/skillActions.js +3 -3
  289. package/vscode/src/vs/workbench/contrib/chat/browser/promptsDebugContribution.js +20 -20
  290. package/vscode/src/vs/workbench/contrib/chat/browser/tools/clientToolSetsContribution.d.ts +17 -0
  291. package/vscode/src/vs/workbench/contrib/chat/browser/tools/clientToolSetsContribution.js +117 -0
  292. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.js +39 -39
  293. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.d.ts +40 -4
  294. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.js +169 -34
  295. package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.js +7 -7
  296. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolHelpers.d.ts +5 -1
  297. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolHelpers.js +2 -2
  298. package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.js +8 -8
  299. package/vscode/src/vs/workbench/contrib/chat/browser/utilityModelContribution.js +2 -2
  300. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +5 -5
  301. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/micCaptureService.d.ts +125 -0
  302. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/micCaptureService.js +399 -0
  303. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/ttsPlaybackService.d.ts +34 -0
  304. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/ttsPlaybackService.js +198 -0
  305. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceClientService.d.ts +85 -0
  306. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceClientService.js +504 -0
  307. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceSessionController.d.ts +321 -0
  308. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceSessionController.js +2117 -0
  309. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceToolDispatchService.d.ts +57 -0
  310. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceToolDispatchService.js +367 -0
  311. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.js +16 -12
  312. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletions.d.ts +2 -0
  313. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletions.js +68 -18
  314. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.js +11 -10
  315. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorContrib.js +2 -2
  316. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorHover.js +1 -1
  317. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/chatQuick.js +1 -1
  318. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditor.d.ts +7 -0
  319. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditor.js +13 -2
  320. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.d.ts +23 -5
  321. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.js +320 -40
  322. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.js +2 -2
  323. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatViewPane.css +80 -4
  324. package/vscode/src/vs/workbench/contrib/chat/common/automations/automation.d.ts +78 -0
  325. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationDialogService.d.ts +13 -0
  326. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationDialogService.service.d.ts +11 -0
  327. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationDialogService.service.js +6 -0
  328. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationRunner.service.d.ts +16 -0
  329. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationRunner.service.js +6 -0
  330. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationService.d.ts +46 -0
  331. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationService.service.d.ts +36 -0
  332. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationService.service.js +6 -0
  333. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationsEnabled.d.ts +12 -0
  334. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationsEnabled.js +6 -0
  335. package/vscode/src/vs/workbench/contrib/chat/common/automations/schedule.d.ts +9 -0
  336. package/vscode/src/vs/workbench/contrib/chat/common/automations/schedule.js +6 -0
  337. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.d.ts +2 -0
  338. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.js +7 -1
  339. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.d.ts +28 -0
  340. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.js +226 -88
  341. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceTelemetry.d.ts +6 -0
  342. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceTelemetry.js +8 -3
  343. package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionOperationLog.js +13 -2
  344. package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.js +12 -8
  345. package/vscode/src/vs/workbench/contrib/chat/common/model/objectMutationLog.d.ts +5 -0
  346. package/vscode/src/vs/workbench/contrib/chat/common/model/objectMutationLog.js +5 -2
  347. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginEnablement.d.ts +15 -0
  348. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginEnablement.js +177 -0
  349. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.d.ts +2 -18
  350. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.js +78 -136
  351. package/vscode/src/vs/workbench/contrib/chat/common/plugins/marketplaceReference.d.ts +1 -16
  352. package/vscode/src/vs/workbench/contrib/chat/common/plugins/marketplaceReference.js +1 -17
  353. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.d.ts +2 -0
  354. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.js +16 -5
  355. package/vscode/src/vs/workbench/contrib/chat/common/plugins/strictKnownMarketplaces.d.ts +31 -0
  356. package/vscode/src/vs/workbench/contrib/chat/common/plugins/strictKnownMarketplaces.js +122 -0
  357. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +24 -18
  358. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.d.ts +3 -0
  359. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.js +113 -10
  360. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +5 -5
  361. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.js +12 -12
  362. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.d.ts +10 -0
  363. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.js +227 -152
  364. package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +1 -1
  365. package/vscode/src/vs/workbench/contrib/chat/common/voicePlaybackService.d.ts +26 -0
  366. package/vscode/src/vs/workbench/contrib/chat/common/voicePlaybackService.js +98 -0
  367. package/vscode/src/vs/workbench/contrib/chat/common/workingDirectory.d.ts +5 -0
  368. package/vscode/src/vs/workbench/contrib/chat/common/workingDirectory.js +7 -6
  369. package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarousel.contribution.js +11 -12
  370. package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarouselEditor.js +10 -10
  371. package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarouselEditorInput.d.ts +2 -0
  372. package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarouselEditorInput.js +7 -0
  373. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +15 -15
  374. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatDefaultModel.js +2 -2
  375. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +4 -4
  376. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.js +14 -14
  377. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.js +1 -1
  378. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +10 -10
  379. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +5 -5
  380. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +1 -1
  381. package/vscode/src/vs/workbench/contrib/remoteCodingAgents/browser/remoteCodingAgents.contribution.js +7 -7
  382. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.js +16 -16
  383. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +32 -20
  384. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +1 -1
  385. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/agentHostSandboxForwarder.d.ts +23 -5
  386. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/agentHostSandboxForwarder.js +37 -30
  387. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.js +7 -0
  388. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.js +7 -0
  389. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.js +7 -0
  390. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/largeOutputFileWriter.d.ts +33 -0
  391. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/largeOutputFileWriter.js +71 -0
  392. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.d.ts +19 -0
  393. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.js +29 -9
  394. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +7 -20
  395. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +4 -4
  396. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.js +2 -1
  397. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.js +1 -1
  398. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +12 -12
  399. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +10 -8
  400. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalLastCommandTool.js +3 -3
  401. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +4 -4
  402. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalSelectionTool.js +3 -3
  403. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/killTerminalTool.js +3 -3
  404. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +3 -3
  405. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +26 -2
  406. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.d.ts +32 -3
  407. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +416 -252
  408. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.d.ts +1 -1
  409. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.js +3 -2
  410. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sendToTerminalTool.js +10 -10
  411. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/createAndRunTaskTool.js +14 -14
  412. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/getTaskOutputTool.js +7 -7
  413. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/runTaskTool.js +14 -14
  414. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.js +1 -1
  415. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/sandboxSettingsReader.d.ts +2 -3
  416. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/sandboxSettingsReader.js +5 -5
  417. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.d.ts +6 -2
  418. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +25 -8
  419. package/vscode/src/vs/workbench/services/agentHost/browser/editorRemoteAgentHostServiceClient.d.ts +8 -3
  420. package/vscode/src/vs/workbench/services/agentHost/browser/editorRemoteAgentHostServiceClient.js +15 -0
  421. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelContentProviders.d.ts +0 -20
  422. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelContentProviders.js +0 -77
  423. package/vscode/src/vs/workbench/contrib/chat/browser/copilotCliEventsUri.d.ts +0 -52
  424. package/vscode/src/vs/workbench/contrib/chat/browser/copilotCliEventsUri.js +0 -82
  425. package/vscode/src/vs/workbench/contrib/chat/common/chatSelectedModel.d.ts +0 -38
  426. package/vscode/src/vs/workbench/contrib/chat/common/chatSelectedModel.js +0 -47
  427. /package/vscode/src/vs/{workbench/contrib → platform}/browserView/common/browserChatToolReferenceNames.js +0 -0
@@ -19,7 +19,8 @@ import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
19
19
  import { generateUuid } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uuid';
20
20
  import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
21
21
  import '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-root/state';
22
- import { ConfirmationOptionKind } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-session/state';
22
+ import '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-session/state';
23
+ import { ConfirmationOptionKind } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-chat/state';
23
24
  import '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-terminal/state';
24
25
  import '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-changeset/state';
25
26
  import '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-resource-watch/state';
@@ -53,12 +54,13 @@ import { ILanguageModelToolsService } from '@codingame/monaco-vscode-api/vscode/
53
54
  import { ITerminalChatService, ITerminalService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal.service';
54
55
  import { ITerminalProfileResolverService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/common/terminal.service';
55
56
  import { TerminalChatCommandId } from '@codingame/monaco-vscode-xterm-common/vscode/vs/workbench/contrib/terminalContrib/chat/browser/terminalChat';
56
- import { TerminalChatAgentToolsSettingId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalChatAgentToolsConfiguration';
57
+ import { TerminalChatAgentToolsSettingId, DEFAULT_IDLE_SILENCE_TIMEOUT_MS } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalChatAgentToolsConfiguration';
57
58
  import '../../common/terminalSandboxService.js';
58
59
  import { getRecommendedToolsOverRunInTerminal } from '../alternativeRecommendation.js';
59
60
  import { BasicExecuteStrategy } from '../executeStrategy/basicExecuteStrategy.js';
60
61
  import { NoneExecuteStrategy } from '../executeStrategy/noneExecuteStrategy.js';
61
62
  import { RichExecuteStrategy } from '../executeStrategy/richExecuteStrategy.js';
63
+ import { LargeOutputFileWriter } from '../largeOutputFileWriter.js';
62
64
  import { getOutput } from '../outputHelpers.js';
63
65
  import { isWindowsPowerShell, isPowerShell, isZsh, isFish, normalizeTerminalCommandForDisplay, buildCommandDisplayText, extractCdPrefix } from '../runInTerminalHelpers.js';
64
66
  import { RunInTerminalToolTelemetry } from '../runInTerminalToolTelemetry.js';
@@ -82,23 +84,17 @@ import { outputLooksSandboxBlocked, outputLooksSandboxNetworkBlocked, SandboxOut
82
84
  import { TerminalCommandArtifactCollector } from './terminalCommandArtifactCollector.js';
83
85
  import { isToolEligibleForTerminalAutoApproval, isTerminalAutoApproveAllowed, isSessionAutoApproveLevel } from './terminalToolAutoApprove.js';
84
86
  import { TerminalToolId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/terminalToolIds';
85
- import { TerminalSandboxPrerequisiteCheck } from '../../../../../../platform/sandbox/common/terminalSandboxService.js';
87
+ import { TerminalSandboxPrerequisiteCheck, TerminalSandboxPreCheckRemediation } from '../../../../../../platform/sandbox/common/terminalSandboxService.js';
86
88
  import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
87
89
  import { ITerminalSandboxService } from '@codingame/monaco-vscode-api/vscode/vs/platform/sandbox/common/terminalSandboxService.service';
88
90
  import { constObservable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/constObservable';
89
91
 
90
- var RunInTerminalTool_1;
92
+ var RunInTerminalTool_1, TerminalProfileFetcher_1;
91
93
  const TERMINAL_SANDBOX_DOCUMENTATION_URL = "https://aka.ms/vscode-sandboxing";
92
94
  const TOOL_REFERENCE_NAME = "runInTerminal";
93
95
  const LEGACY_TOOL_REFERENCE_FULL_NAMES = ["runCommands/runInTerminal"];
94
96
  const INPUT_NEEDED_NOTIFICATION_THROTTLE_MS = 5000;
95
- function createPowerShellModelDescription(
96
- shell,
97
- isSandboxEnabled,
98
- allowToRunUnsandboxedCommands,
99
- retryWithAllowNetworkRequests,
100
- networkDomains
101
- ) {
97
+ function createPowerShellModelDescription(shell, sandboxingOptions) {
102
98
  const isWinPwsh = isWindowsPowerShell(shell);
103
99
  const parts = [
104
100
  `This tool allows you to execute ${isWinPwsh ? "Windows PowerShell 5.1" : "PowerShell"} commands in a persistent terminal session, preserving environment variables, working directory, and other context across multiple commands.`,
@@ -119,25 +115,22 @@ function createPowerShellModelDescription(
119
115
  "- Install modules via Install-Module, Install-Package",
120
116
  "- Use Get-Command to verify cmdlet/function availability",
121
117
  "",
122
- "Async Mode:",
123
- "- Use mode=async ONLY for processes that should keep running while you do other work (servers, watchers, dev daemons)",
124
- "- For one-shot long-running commands where you have nothing to do until they finish (package installs, builds, downloads, test suites), use mode=sync with a generous timeout (e.g. 600000 / 10 min for installs, longer for big builds) so the command can complete before your turn ends",
118
+ "Execution Mode:",
119
+ "- For ALL one-shot commands (builds, tests, installs, compilation, linting, downloads, scripts), use mode=sync and omit timeout. The tool waits for the command to complete and returns full output inline. This is the default and strongly preferred mode.",
120
+ `- Use mode=async ONLY for processes that must keep running indefinitely while you do other work (servers, watchers, dev daemons). Async waits for an initial idle/output signal, then returns a terminal ID and output snapshot while the process continues running.`,
121
+ `- In sync mode, the full output is returned when the command completes — you do NOT need to call ${TerminalToolId.GetTerminalOutput} afterward. Only use ${TerminalToolId.GetTerminalOutput} if the tool result explicitly says the command was moved to background, timed out, or needs input.`,
125
122
  "- Returns a terminal ID for checking status and runtime later",
126
123
  "- Use Start-Job for background PowerShell jobs",
127
124
  "",
128
125
  `Use ${TerminalToolId.SendToTerminal} to send commands or input to a terminal session.`
129
126
  ];
130
- if (isSandboxEnabled) {
131
- parts.push(...createSandboxLines(
132
- allowToRunUnsandboxedCommands,
133
- retryWithAllowNetworkRequests,
134
- networkDomains
135
- ));
127
+ if (sandboxingOptions.sandboxMode !== "off") {
128
+ parts.push(...createSandboxLines(sandboxingOptions));
136
129
  }
137
130
  parts.push(
138
131
  "",
139
132
  "Output Management:",
140
- "- Output is automatically truncated if longer than 60KB to prevent context overflow",
133
+ "- Output exceeding 20KB is saved to a temp file; the result includes the file path so you can read the full output with readFile or search it with grep",
141
134
  "- Use Select-Object, Where-Object, Format-Table to filter output",
142
135
  "- Use -First/-Last parameters to limit results",
143
136
  "- For pager commands, add | Out-String or | Format-List",
@@ -151,6 +144,7 @@ function createPowerShellModelDescription(
151
144
  "- Be specific with Select-Object properties to avoid excessive output",
152
145
  "- Avoid printing credentials unless absolutely required",
153
146
  `- NEVER run Start-Sleep or similar wait commands. You will be automatically notified on your next turn when async terminal commands or timed-out sync commands complete or need input. Do NOT poll for completion.`,
147
+ "- NEVER pipe interactive commands through Select-Object, Where-Object, or other filters — this hides prompts and prevents the terminal from detecting when input is needed. Run interactive commands without pipes.",
154
148
  "",
155
149
  "Interactive Input Handling:",
156
150
  "- When a terminal command is waiting for interactive input, do NOT suggest alternatives or ask the user whether to proceed. Instead, use the vscode_askQuestions tool to collect the needed values from the user, then send them.",
@@ -161,60 +155,97 @@ function createPowerShellModelDescription(
161
155
  );
162
156
  return parts.join("\n");
163
157
  }
164
- function createSandboxLines(
165
- allowToRunUnsandboxedCommands,
166
- retryWithAllowNetworkRequests,
167
- networkDomains
168
- ) {
158
+ function createSandboxLines(sandboxingOptions) {
159
+ const isNetworkAvailable = sandboxingOptions.sandboxMode === "on-network-available";
169
160
  const lines = [
170
161
  "",
171
162
  "Sandboxing:",
172
- "- ATTENTION: Terminal sandboxing is enabled, commands run in a sandbox by default",
173
- "- When executing commands within the sandboxed environment, all operations requiring a temporary directory must utilize the $TMPDIR environment variable. The /tmp directory is not guaranteed to be accessible or writable and must be avoided",
174
- "- Tools and scripts should respect the TMPDIR environment variable, which is automatically set to an appropriate path within the sandbox"
163
+ isNetworkAvailable ? "- Commands run inside a sandbox by default. The sandbox keeps the filesystem mostly read-only." : "- Commands run inside a sandbox by default. The sandbox restricts two things independently: the filesystem and the network.",
164
+ "- Filesystem: read-only outside the workspace and $TMPDIR, which stay read-write. Parts of $HOME are hidden for privacy, but common developer tools (git, package managers, language toolchains) still work because their $HOME config and cache paths are automatically made readable.",
165
+ "- Use $TMPDIR for temporary files; /tmp may not be writable. On macOS and Linux the TMPDIR env var is set to a writable path.",
166
+ "- If a command needs sandboxed write access to specific file paths outside workspace, pass requestFileValidationCheck with those paths. VS Code checks sandbox access before execution and returns Access Denied without running the command when access is unavailable."
175
167
  ];
176
- if (retryWithAllowNetworkRequests) {
177
- lines.push(
178
- "- When a command fails due to network access being blocked by the sandbox, immediately re-run it with requestAllowNetwork=true and provide requestAllowNetworkReason. This keeps the command in the sandbox with unrestricted network access and automatically shows a confirmation prompt to the user",
179
- "- Only set requestAllowNetwork=true when there is evidence of network failures caused by the sandbox, e.g. 'Network request failed' errors, API call failures, or other indications of blocked network access in the command output",
180
- "- When setting requestAllowNetwork=true, also provide requestAllowNetworkReason explaining why the command needs network access"
181
- );
168
+ if (!isNetworkAvailable) {
169
+ const deniedDomains = sandboxingOptions.networkDomains?.deniedDomains ?? [];
170
+ const allowedDomains = sandboxingOptions.networkDomains?.allowedDomains ?? [];
171
+ const deniedSet = ( new Set(deniedDomains));
172
+ const effectiveAllowed = allowedDomains.filter(d => !( deniedSet.has(d)));
173
+ const retrySuffix = sandboxingOptions.retryWithAllowNetworkRequests ? " unless requestAllowNetwork=true is set" : "";
174
+ if (effectiveAllowed.length === 0) {
175
+ lines.push(
176
+ `- Network: blocked in the sandbox; commands that need the network fail${retrySuffix}.`
177
+ );
178
+ } else {
179
+ lines.push(
180
+ `- Network: only these domains are reachable in the sandbox: ${effectiveAllowed.join(", ")}. Other domains fail${retrySuffix}.`
181
+ );
182
+ }
183
+ if (deniedDomains.length > 0) {
184
+ lines.push(
185
+ `- These domains are explicitly blocked in the sandbox: ${deniedDomains.join(", ")}`
186
+ );
187
+ }
182
188
  }
183
- if (allowToRunUnsandboxedCommands) {
189
+ if (sandboxingOptions.retryWithAllowNetworkRequests || sandboxingOptions.allowToRunUnsandboxedCommands) {
184
190
  lines.push(
185
- "- When a command fails due to sandbox restrictions, immediately re-run it with requestUnsandboxedExecution=true. Do NOT ask the user for permission — setting this flag automatically shows a confirmation prompt to the user",
186
- "- Only set requestUnsandboxedExecution=true when there is evidence of failures caused by the sandbox, e.g. 'Operation not permitted' errors, network failures, or file access errors, etc",
187
- "- When setting requestUnsandboxedExecution=true, also provide requestUnsandboxedExecutionReason explaining why the command needs unsandboxed access"
191
+ "- To get more access (each prompts the user never ask the user for permission yourself):"
188
192
  );
189
- } else {
190
- lines.push(
191
- "- Running commands outside the sandbox is disabled by the current chat.agent.sandbox.allowUnsandboxedCommands setting. Do not set requestUnsandboxedExecution=true."
192
- );
193
- }
194
- if (networkDomains) {
195
- const deniedSet = ( new Set(networkDomains.deniedDomains));
196
- const effectiveAllowed = networkDomains.allowedDomains.filter(d => !( deniedSet.has(d)));
197
- if (effectiveAllowed.length === 0) {
198
- lines.push("- All network access is blocked in the sandbox");
199
- } else {
193
+ if (sandboxingOptions.retryWithAllowNetworkRequests) {
200
194
  lines.push(
201
- `- Only the following domains are accessible in the sandbox (all other network access is blocked): ${effectiveAllowed.join(", ")}`
195
+ " - Need a blocked domain? Set requestAllowNetwork=true and provide requestAllowNetworkReason. This keeps the filesystem sandbox in place and only relaxes the network, so prefer it for network-only needs. Do this proactively when network use is obvious (git fetch/pull/push/clone; npm/yarn/pnpm/pip/cargo/go/brew installs; curl; wget), or reactively after a network failure (e.g. 'Network request failed', HTTP code 403)."
202
196
  );
203
197
  }
204
- if (networkDomains.deniedDomains.length > 0) {
198
+ if (sandboxingOptions.allowToRunUnsandboxedCommands) {
199
+ const removesAllClause = sandboxingOptions.retryWithAllowNetworkRequests ? "This grants full filesystem AND network access by removing all sandbox protection, so for network-only needs prefer requestAllowNetwork and use this only when filesystem (or other non-network) access is also blocked." : "This grants full filesystem and network access by removing all sandbox protection, so use it only when the command truly needs it.";
205
200
  lines.push(
206
- `- The following domains are explicitly blocked in the sandbox: ${networkDomains.deniedDomains.join(", ")}`
201
+ ` - Need filesystem or other access the sandbox blocks? Set requestUnsandboxedExecution=true and provide requestUnsandboxedExecutionReason. ${removesAllClause} Do this proactively when it clearly needs it (writing/deleting files outside the workspace and $TMPDIR like $HOME, /usr, /etc; installing to system locations; elevated privileges), or reactively after a sandbox failure (e.g. \'Operation not permitted\').`
207
202
  );
208
203
  }
209
204
  }
205
+ if (!sandboxingOptions.allowToRunUnsandboxedCommands) {
206
+ lines.push(
207
+ "- Running commands outside the sandbox is disabled by chat.agent.sandbox.allowUnsandboxedCommands. Do not set requestUnsandboxedExecution=true."
208
+ );
209
+ }
210
210
  return lines;
211
211
  }
212
- function createGenericDescription(
213
- isSandboxEnabled,
214
- allowToRunUnsandboxedCommands,
215
- retryWithAllowNetworkRequests,
216
- networkDomains
217
- ) {
212
+ function createSandboxProperties(sandboxingOptions) {
213
+ const isNetworkAvailable = sandboxingOptions.sandboxMode === "on-network-available";
214
+ return {
215
+ ...(sandboxingOptions.allowToRunUnsandboxedCommands ? {
216
+ requestUnsandboxedExecution: {
217
+ type: "boolean",
218
+ description: "Request that this command run outside the terminal sandbox. Only set this when the command clearly needs unsandboxed access. The user will be prompted before the command runs unsandboxed."
219
+ },
220
+ requestUnsandboxedExecutionReason: {
221
+ type: "string",
222
+ description: "A short explanation of why this command must run outside the terminal sandbox. Only provide this when requestUnsandboxedExecution is true."
223
+ }
224
+ } : {}),
225
+ ...(isNetworkAvailable || !sandboxingOptions.retryWithAllowNetworkRequests ? {} : {
226
+ requestAllowNetwork: {
227
+ type: "boolean",
228
+ description: "Request that this command remain in the terminal sandbox but run with unrestricted network access. Only set this when the command clearly needs network access but the required network access was blocked. The user will be prompted before network restrictions are relaxed."
229
+ },
230
+ requestAllowNetworkReason: {
231
+ type: "string",
232
+ description: "A short explanation of why this sandboxed command needs unrestricted network access. Only provide this when requestAllowNetwork is true."
233
+ }
234
+ }),
235
+ requestFileValidationCheck: {
236
+ type: "array",
237
+ description: "Sandbox write access checks to perform before running the command. Provide the file paths that the command needs to write.",
238
+ items: {
239
+ type: "string"
240
+ }
241
+ },
242
+ requestFileValidationCheckReason: {
243
+ type: "string",
244
+ description: "A short explanation of why this sandboxed command needs these file paths. Only provide this when requestFileValidationCheck is not empty."
245
+ }
246
+ };
247
+ }
248
+ function createGenericDescription(sandboxingOptions) {
218
249
  const parts = [`
219
250
  Command Execution:
220
251
  - Use && to chain simple commands on one line
@@ -233,23 +264,19 @@ Program Execution:
233
264
  - Install packages via package managers (brew, apt, etc.)
234
265
  - Use which or command -v to verify command availability
235
266
 
236
- Async Mode:
237
- - Use mode=async ONLY for processes that should keep running while you do other work (servers, watchers, dev daemons)
238
- - For one-shot long-running commands where you have nothing to do until they finish (package installs, builds, downloads, test suites), use mode=sync with a generous timeout (e.g. 600000 / 10 min for installs, longer for big builds) so the command can complete before your turn ends
239
- - Returns a terminal ID for checking status and runtime later
267
+ Execution Mode:
268
+ - For ALL one-shot commands (builds, tests, installs, compilation, linting, downloads, scripts), use mode='sync' and omit timeout. The tool waits for the command to complete and returns full output inline. This is the default and strongly preferred mode.
269
+ - Use mode='async' ONLY for processes that must keep running indefinitely while you do other work (servers, watchers, dev daemons). Async waits for an initial idle/output signal, then returns a terminal ID and output snapshot while the process continues running.
270
+ - In sync mode, the full output is returned when the command completes — you do NOT need to call ${TerminalToolId.GetTerminalOutput} afterward. Only use ${TerminalToolId.GetTerminalOutput} if the tool result explicitly says the command was moved to background, timed out, or needs input.
240
271
 
241
272
  Use ${TerminalToolId.SendToTerminal} to send commands or input to a terminal session.`];
242
- if (isSandboxEnabled) {
243
- parts.push(createSandboxLines(
244
- allowToRunUnsandboxedCommands,
245
- retryWithAllowNetworkRequests,
246
- networkDomains
247
- ).join("\n"));
273
+ if (sandboxingOptions.sandboxMode !== "off") {
274
+ parts.push(createSandboxLines(sandboxingOptions).join("\n"));
248
275
  }
249
276
  parts.push(`
250
277
 
251
278
  Output Management:
252
- - Output is automatically truncated if longer than 60KB to prevent context overflow
279
+ - Output exceeding 20KB is saved to a temp file; the result includes the file path so you can read the full output with readFile or search it with grep
253
280
  - Use head, tail, grep, awk to filter and limit output size
254
281
  - For pager commands, disable paging: git --no-pager or add | cat
255
282
  - Use wc -l to count lines before displaying large outputs
@@ -260,6 +287,7 @@ Best Practices:
260
287
  - Be specific with commands to avoid excessive output
261
288
  - Avoid printing credentials unless absolutely required
262
289
  - NEVER run sleep or similar wait commands in a terminal. You will be automatically notified on your next turn when async terminal commands or timed-out sync commands complete or need input. Do NOT poll for completion.
290
+ - NEVER pipe interactive commands through tail, head, grep, or other filters — this hides prompts and prevents the terminal from detecting when input is needed. Run interactive commands without pipes.
263
291
 
264
292
  Interactive Input Handling:
265
293
  - When a terminal command is waiting for interactive input, do NOT suggest alternatives or ask the user whether to proceed. Instead, use the vscode_askQuestions tool to collect the needed values from the user, then send them.
@@ -269,38 +297,18 @@ Interactive Input Handling:
269
297
  - Continue one prompt at a time until the command finishes.`);
270
298
  return parts.join("");
271
299
  }
272
- function createBashModelDescription(
273
- isSandboxEnabled,
274
- allowToRunUnsandboxedCommands,
275
- retryWithAllowNetworkRequests,
276
- networkDomains
277
- ) {
300
+ function createBashModelDescription(sandboxingOptions) {
278
301
  return [
279
302
  "This tool allows you to execute shell commands in a persistent bash terminal session, preserving environment variables, working directory, and other context across multiple commands.",
280
- createGenericDescription(
281
- isSandboxEnabled,
282
- allowToRunUnsandboxedCommands,
283
- retryWithAllowNetworkRequests,
284
- networkDomains
285
- ),
303
+ createGenericDescription(sandboxingOptions),
286
304
  "- Use [[ ]] for conditional tests instead of [ ]",
287
305
  "- Prefer $() over backticks for command substitution"
288
306
  ].join("\n");
289
307
  }
290
- function createZshModelDescription(
291
- isSandboxEnabled,
292
- allowToRunUnsandboxedCommands,
293
- retryWithAllowNetworkRequests,
294
- networkDomains
295
- ) {
308
+ function createZshModelDescription(sandboxingOptions) {
296
309
  return [
297
310
  "This tool allows you to execute shell commands in a persistent zsh terminal session, preserving environment variables, working directory, and other context across multiple commands.",
298
- createGenericDescription(
299
- isSandboxEnabled,
300
- allowToRunUnsandboxedCommands,
301
- retryWithAllowNetworkRequests,
302
- networkDomains
303
- ),
311
+ createGenericDescription(sandboxingOptions),
304
312
  "- Use type to check command type (builtin, function, alias)",
305
313
  "- Use jobs, fg, bg for job control",
306
314
  "- Use [[ ]] for conditional tests instead of [ ]",
@@ -312,20 +320,10 @@ function createZshModelDescription(
312
320
  "- NEVER use status as a variable name (it is read-only in zsh). Use exit_code or ret instead"
313
321
  ].join("\n");
314
322
  }
315
- function createFishModelDescription(
316
- isSandboxEnabled,
317
- allowToRunUnsandboxedCommands,
318
- retryWithAllowNetworkRequests,
319
- networkDomains
320
- ) {
323
+ function createFishModelDescription(sandboxingOptions) {
321
324
  return [
322
325
  "This tool allows you to execute shell commands in a persistent fish terminal session, preserving environment variables, working directory, and other context across multiple commands.",
323
- createGenericDescription(
324
- isSandboxEnabled,
325
- allowToRunUnsandboxedCommands,
326
- retryWithAllowNetworkRequests,
327
- networkDomains
328
- ),
326
+ createGenericDescription(sandboxingOptions),
329
327
  "- Use type to check command type (builtin, function, alias)",
330
328
  "- Use jobs, fg, bg for job control",
331
329
  "- Use test expressions for conditionals (no [[ ]] syntax)",
@@ -347,38 +345,28 @@ async function createRunInTerminalToolData(accessor) {
347
345
  terminalSandboxService.isEnabled(),
348
346
  terminalSandboxService.isSandboxAllowNetworkEnabled()
349
347
  ]);
350
- const retryWithAllowNetworkRequests = isSandboxEnabled && !isSandboxAllowNetworkEnabled && retryWithAllowNetworkRequestsSetting;
351
- const networkDomains = isSandboxEnabled && !isSandboxAllowNetworkEnabled ? terminalSandboxService.getResolvedNetworkDomains() : undefined;
348
+ const sandboxingOptions = (isSandboxEnabled ? (isSandboxAllowNetworkEnabled ? {
349
+ sandboxMode: "on-network-available",
350
+ allowToRunUnsandboxedCommands,
351
+ retryWithAllowNetworkRequests: false,
352
+ networkDomains: undefined
353
+ } : {
354
+ sandboxMode: "on-network-restricted",
355
+ allowToRunUnsandboxedCommands,
356
+ retryWithAllowNetworkRequests: retryWithAllowNetworkRequestsSetting,
357
+ networkDomains: terminalSandboxService.getResolvedNetworkDomains()
358
+ }) : {
359
+ sandboxMode: "off"
360
+ });
352
361
  let modelDescription;
353
362
  if (shell && os && isPowerShell(shell, os)) {
354
- modelDescription = createPowerShellModelDescription(
355
- shell,
356
- isSandboxEnabled,
357
- allowToRunUnsandboxedCommands,
358
- retryWithAllowNetworkRequests,
359
- networkDomains
360
- );
363
+ modelDescription = createPowerShellModelDescription(shell, sandboxingOptions);
361
364
  } else if (shell && os && isZsh(shell, os)) {
362
- modelDescription = createZshModelDescription(
363
- isSandboxEnabled,
364
- allowToRunUnsandboxedCommands,
365
- retryWithAllowNetworkRequests,
366
- networkDomains
367
- );
365
+ modelDescription = createZshModelDescription(sandboxingOptions);
368
366
  } else if (shell && os && isFish(shell, os)) {
369
- modelDescription = createFishModelDescription(
370
- isSandboxEnabled,
371
- allowToRunUnsandboxedCommands,
372
- retryWithAllowNetworkRequests,
373
- networkDomains
374
- );
367
+ modelDescription = createFishModelDescription(sandboxingOptions);
375
368
  } else {
376
- modelDescription = createBashModelDescription(
377
- isSandboxEnabled,
378
- allowToRunUnsandboxedCommands,
379
- retryWithAllowNetworkRequests,
380
- networkDomains
381
- );
369
+ modelDescription = createBashModelDescription(sandboxingOptions);
382
370
  }
383
371
  const sharedProperties = {
384
372
  command: {
@@ -394,37 +382,14 @@ async function createRunInTerminalToolData(accessor) {
394
382
  description: "A short description of the goal or purpose of the command (e.g., \"Install dependencies\", \"Start development server\")."
395
383
  }
396
384
  };
397
- const sandboxProperties = isSandboxEnabled ? {
398
- allowToRunUnsandboxedCommands: {
399
- type: "boolean",
400
- const: allowToRunUnsandboxedCommands,
401
- default: allowToRunUnsandboxedCommands,
402
- description: "Whether this tool invocation is allowed to run commands outside the terminal sandbox. This value is set by VS Code based on chat.agent.sandbox.allowUnsandboxedCommands."
403
- },
404
- requestUnsandboxedExecution: {
405
- type: "boolean",
406
- description: "Request that this command run outside the terminal sandbox. Only set this when the command clearly needs unsandboxed access. The user will be prompted before the command runs unsandboxed."
407
- },
408
- requestUnsandboxedExecutionReason: {
409
- type: "string",
410
- description: "A short explanation of why this command must run outside the terminal sandbox. Only provide this when requestUnsandboxedExecution is true."
411
- },
412
- requestAllowNetwork: {
413
- type: "boolean",
414
- description: "Request that this command remain in the terminal sandbox but run with unrestricted network access. Only set this when the command clearly needs network access but the required network access was blocked. The user will be prompted before network restrictions are relaxed."
415
- },
416
- requestAllowNetworkReason: {
417
- type: "string",
418
- description: "A short explanation of why this sandboxed command needs unrestricted network access. Only provide this when requestAllowNetwork is true."
419
- }
420
- } : {};
385
+ const sandboxProperties = sandboxingOptions.sandboxMode === "off" ? {} : createSandboxProperties(sandboxingOptions);
421
386
  return {
422
387
  id: TerminalToolId.RunInTerminal,
423
388
  toolReferenceName: TOOL_REFERENCE_NAME,
424
389
  legacyToolReferenceFullNames: LEGACY_TOOL_REFERENCE_FULL_NAMES,
425
- displayName: ( localize(14671, "Run in Terminal")),
426
- modelDescription: `${modelDescription}\n\nExecution mode:\n- mode='sync': wait for completion (optionally capped by timeout); if still running when timeout elapses, return with a terminal ID.\n- mode='async': wait for an initial idle/output signal, then return with terminal output snapshot and ID. Timeout caps how long to wait for the initial idle/output signal.\n- Prefer mode='sync' for commands that will prompt for interactive input (e.g., npm init, interactive installers, configuration wizards).\n\nTimeout parameter: For one-shot long-running commands, set a generous timeout as a safety net (e.g. 600000 for installs, longer for big builds). Omit timeout only for processes that should run indefinitely (servers, daemons). If the timeout elapses, you get a terminal ID and can check output later.\n\nTerminal notifications: When an async command finishes or a sync command times out, you will be automatically notified on your next turn with the exit code and terminal output. You will also be notified if the terminal needs input. Do NOT poll or sleep to wait for completion.`,
427
- userDescription: ( localize(14672, "Run commands in the terminal")),
390
+ displayName: ( localize(15318, "Run in Terminal")),
391
+ modelDescription: `${modelDescription}\n\nExecution mode:\n- mode='sync' (strongly preferred): waits for the command to complete and returns full output inline. Use for ALL one-shot commands (builds, tests, installs, compilation, scripts). Omit timeout to let the command run to completion the tool handles idle detection and input prompts automatically.\n- mode='async': waits for an initial idle/output signal from the command, then returns a terminal ID and output snapshot while the process continues running. Use ONLY for processes that must keep running indefinitely (servers, watchers, daemons). Timeout caps how long to wait for the initial idle/output signal.\n\nTimeout parameter: Usually omit timeout entirely for sync commands the tool returns automatically on completion, input-needed, or cancellation. Only set a timeout as a safety net for commands you suspect might hang. Use 0 to explicitly indicate no timeout.\n\nSync output is final: When a sync command completes, the full output is returned inline do NOT call ${TerminalToolId.GetTerminalOutput} afterward. Only use ${TerminalToolId.GetTerminalOutput} if the tool result explicitly indicates the command was moved to background, timed out, or needs input. Do NOT tell the user to check the terminal panel all command output is already included in the tool result.\n\nTerminal notifications: When an async command finishes or a sync command times out, you will be automatically notified on your next turn with the exit code and terminal output. You will also be notified if the terminal needs input. Do NOT poll or sleep to wait for completion.`,
392
+ userDescription: ( localize(15319, "Run commands in the terminal")),
428
393
  source: ToolDataSource.Internal,
429
394
  icon: Codicon.terminal,
430
395
  inputSchema: {
@@ -436,10 +401,10 @@ async function createRunInTerminalToolData(accessor) {
436
401
  type: "string",
437
402
  enum: ["sync", "async"],
438
403
  enumDescriptions: [
439
- "Wait for completion up to timeout, then return with collected output. If still running at timeout, the terminal session continues in the background.",
440
- "Wait for an initial idle/output signal, then return with a terminal ID and output snapshot while the session may continue running."
404
+ "Wait for command completion and return full output inline. Strongly preferred for all one-shot commands (builds, tests, installs, scripts).",
405
+ "Wait for an initial idle/output signal, then return a terminal ID and output snapshot while the process continues running. Timeout caps how long to wait for the initial signal. Use ONLY for processes that must keep running indefinitely (servers, watchers, daemons)."
441
406
  ],
442
- description: "Execution mode for this command."
407
+ description: "Execution mode for this command. Use sync (default) for nearly all commands."
443
408
  },
444
409
  isBackground: {
445
410
  type: "boolean",
@@ -447,7 +412,7 @@ async function createRunInTerminalToolData(accessor) {
447
412
  },
448
413
  timeout: {
449
414
  type: "number",
450
- description: "Optional. Hard cap in milliseconds before the tool returns. If you set a timeout, use a generous value (e.g. 600000 = 10 min for installs, 900000 = 15 min for big builds). Too-short timeouts cause the command to continue in the background, which wastes turns on unnecessary polling. Omit entirely to let the command run to completion. Use 0 to explicitly indicate no timeout."
415
+ description: "Optional. Usually omit entirely for sync commands — the tool waits for completion automatically. Only set a timeout (in milliseconds) as a safety net if you suspect the command might hang. If the timeout elapses, the command continues in the background and you get a terminal ID to check output later. Use 0 to explicitly indicate no timeout."
451
416
  }
452
417
  },
453
418
  required: ["command", "explanation", "goal", "mode"]
@@ -490,7 +455,7 @@ function shouldAutomaticallyRetryAllowNetworkInSandboxed(options) {
490
455
  const telemetryIgnoredSequences = [
491
456
  "\u001b[I",
492
457
  "\u001b[O"];
493
- const altBufferMessage = "\n" + ( localize(14673, "The command opened the alternate buffer."));
458
+ const altBufferMessage = "\n" + ( localize(15320, "The command opened the alternate buffer."));
494
459
  function buildCompletionNotificationCommand(command) {
495
460
  const firstNewline = command.search(/\r|\n/);
496
461
  const hasMoreLines = firstNewline !== -1;
@@ -565,9 +530,6 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
565
530
  get _allowUnsandboxedCommands() {
566
531
  return this._configurationService.getValue(AgentSandboxSettingId.AgentSandboxAllowUnsandboxedCommands) === true;
567
532
  }
568
- get _autoApproveUnsandboxedCommands() {
569
- return this._allowUnsandboxedCommands && this._configurationService.getValue(AgentSandboxSettingId.AgentSandboxAutoApproveUnsandboxedCommands) === true;
570
- }
571
533
  get _retryWithAllowNetworkRequests() {
572
534
  return this._configurationService.getValue(AgentSandboxSettingId.AgentSandboxRetryWithAllowNetworkRequests) === true;
573
535
  }
@@ -585,16 +547,31 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
585
547
  }
586
548
  _getUnsandboxedExecutionDisabledMessage() {
587
549
  return localize(
588
- 14674,
550
+ 15321,
589
551
  "The command was not executed because it requested to run outside the terminal sandbox, but running commands outside the sandbox is disabled by chat.agent.sandbox.allowUnsandboxedCommands. Run the command in the sandbox instead, or enable the setting to allow unsandboxed execution."
590
552
  );
591
553
  }
592
554
  _getAllowNetworkRequestDisabledMessage() {
593
555
  return localize(
594
- 14675,
556
+ 15322,
595
557
  "The command was not executed because it requested unrestricted network access in the terminal sandbox, but per-command network access is disabled by chat.agent.sandbox.retryWithAllowNetworkRequests. Run the command with restricted network access instead, or enable the setting to allow network access requests."
596
558
  );
597
559
  }
560
+ async _getDeniedSandboxFileAccess(paths, sandboxPrecheckInputs) {
561
+ if (!paths?.length) {
562
+ return [];
563
+ }
564
+ const result = await this._terminalSandboxService.checkFileAccess("write", paths, sandboxPrecheckInputs);
565
+ return result.denied;
566
+ }
567
+ _buildSandboxFileAccessDeniedMessage(deniedPaths) {
568
+ const deniedPathsMessage = ( deniedPaths.map(path => `write: ${path}`)).join("\n");
569
+ return localize(
570
+ 15323,
571
+ "Access Denied: The command was not executed because the terminal sandbox does not allow access to the requested file paths:\n{0}",
572
+ deniedPathsMessage
573
+ );
574
+ }
598
575
  get _enableCommandLineSandboxRewriting() {
599
576
  return true;
600
577
  }
@@ -650,6 +627,7 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
650
627
  this._telemetry = this._instantiationService.createInstance(RunInTerminalToolTelemetry);
651
628
  this._commandArtifactCollector = this._instantiationService.createInstance(TerminalCommandArtifactCollector);
652
629
  this._profileFetcher = this._instantiationService.createInstance(TerminalProfileFetcher);
630
+ this._largeOutputFileWriter = this._register(this._instantiationService.createInstance(LargeOutputFileWriter));
653
631
  this._commandLineRewriters = [
654
632
  this._register(this._instantiationService.createInstance(CommandLineCdPrefixRewriter)),
655
633
  this._register(
@@ -711,19 +689,20 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
711
689
  for (const resource of e.sessionResources) {
712
690
  this._cleanupSessionTerminals(resource);
713
691
  }
692
+ this._largeOutputFileWriter.cleanup();
714
693
  }));
715
694
  }
716
695
  async handleToolStream(context, _token) {
717
696
  const partialInput = context.rawInput;
718
697
  if (partialInput && typeof partialInput === "object" && partialInput.command) {
719
698
  const truncatedCommand = buildCommandDisplayText(partialInput.command);
720
- const invocationMessage = ( new MarkdownString(( localize(14676, "Running `{0}`", escapeMarkdownSyntaxTokens(truncatedCommand)))));
699
+ const invocationMessage = ( new MarkdownString(( localize(15324, "Running `{0}`", escapeMarkdownSyntaxTokens(truncatedCommand)))));
721
700
  return {
722
701
  invocationMessage
723
702
  };
724
703
  }
725
704
  return {
726
- invocationMessage: ( localize(14677, "Running command"))
705
+ invocationMessage: ( localize(15325, "Running command"))
727
706
  };
728
707
  }
729
708
  async prepareToolInvocation(context, token) {
@@ -763,13 +742,18 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
763
742
  let requiresAllowNetworkConfirmation = explicitAllowNetworkRequest;
764
743
  let requestAllowNetworkReason = explicitAllowNetworkRequest ? args.requestAllowNetworkReason : undefined;
765
744
  const missingDependencies = sandboxPrereqs.failedCheck === TerminalSandboxPrerequisiteCheck.Dependencies && sandboxPrereqs.missingDependencies?.length ? sandboxPrereqs.missingDependencies : undefined;
745
+ const sandboxRemediations = sandboxPrereqs.failedCheck === TerminalSandboxPrerequisiteCheck.Bubblewrap && sandboxPrereqs.remediations?.length ? [...sandboxPrereqs.remediations] : undefined;
746
+ const sandboxPrerequisiteFailure = sandboxPrereqs.failedCheck === TerminalSandboxPrerequisiteCheck.Bubblewrap && !sandboxRemediations ? ( localize(
747
+ 15326,
748
+ "Bubblewrap is installed but cannot create the required sandbox namespace on this system. The command was not executed."
749
+ )) : undefined;
766
750
  const terminalToolSessionId = generateUuid();
767
751
  const terminalCommandId = `tool-${generateUuid()}`;
768
752
  if (this._shouldRejectUnsandboxedExecutionRequest(isSandboxEnabled, allowUnsandboxedCommands, args)) {
769
753
  const commandToDisplay = normalizeTerminalCommandForDisplay(args.command);
770
754
  return {
771
755
  invocationMessage: ( new MarkdownString(( localize(
772
- 14678,
756
+ 15327,
773
757
  "Not running `{0}` because unsandboxed execution is disabled",
774
758
  escapeMarkdownSyntaxTokens(buildCommandDisplayText(commandToDisplay))
775
759
  )))),
@@ -795,7 +779,7 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
795
779
  const commandToDisplay = normalizeTerminalCommandForDisplay(args.command);
796
780
  return {
797
781
  invocationMessage: ( new MarkdownString(( localize(
798
- 14679,
782
+ 15328,
799
783
  "Not running `{0}` because unrestricted network access in the sandbox is disabled",
800
784
  escapeMarkdownSyntaxTokens(buildCommandDisplayText(commandToDisplay))
801
785
  )))),
@@ -853,28 +837,51 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
853
837
  requestUnsandboxedExecutionReason,
854
838
  requestAllowNetwork: requiresAllowNetworkConfirmation,
855
839
  requestAllowNetworkReason,
856
- missingSandboxDependencies: missingDependencies
840
+ missingSandboxDependencies: missingDependencies,
841
+ sandboxRemediations,
842
+ sandboxPrerequisiteFailure
857
843
  };
858
- let sandboxConfirmationMessageForMissingDeps = undefined;
844
+ let sandboxPrerequisiteConfirmation = undefined;
859
845
  if (missingDependencies) {
860
846
  const depsList = missingDependencies.join(", ");
861
- sandboxConfirmationMessageForMissingDeps = {
862
- title: ( localize(14680, "Missing Sandbox Dependencies")),
847
+ sandboxPrerequisiteConfirmation = {
848
+ title: ( localize(15329, "Missing Sandbox Dependencies")),
863
849
  message: ( new MarkdownString(( localize(
864
- 14681,
850
+ 15330,
865
851
  "The following dependencies required for sandboxed execution are not installed: {0}. Would you like to install them?",
866
852
  depsList
867
853
  )))),
868
854
  customOptions: [{
869
855
  id: "install",
870
- label: ( localize(14682, "Install")),
856
+ label: ( localize(15331, "Install")),
871
857
  kind: ConfirmationOptionKind.Approve
872
858
  }, {
873
859
  id: "cancel",
874
- label: ( localize(14683, "Cancel")),
860
+ label: ( localize(15332, "Cancel")),
875
861
  kind: ConfirmationOptionKind.Deny
876
862
  }]
877
863
  };
864
+ } else if (sandboxRemediations) {
865
+ const customOptions = [];
866
+ if (sandboxRemediations.includes(
867
+ TerminalSandboxPreCheckRemediation.DisableUnprivilagedusernamespaceRestriction
868
+ )) {
869
+ customOptions.push({
870
+ id: TerminalSandboxPreCheckRemediation.DisableUnprivilagedusernamespaceRestriction,
871
+ label: ( localize(15333, "Apply Fix and Retry")),
872
+ kind: ConfirmationOptionKind.Approve
873
+ });
874
+ }
875
+ customOptions.push({
876
+ id: "cancel",
877
+ label: ( localize(15334, "Cancel")),
878
+ kind: ConfirmationOptionKind.Deny
879
+ });
880
+ sandboxPrerequisiteConfirmation = {
881
+ title: ( localize(15335, "Repair Bubblewrap Sandbox")),
882
+ message: ( new MarkdownString(( localize(15336, "Bubblewrap cannot create the sandbox environment.")))),
883
+ customOptions
884
+ };
878
885
  }
879
886
  const alternativeRecommendation = getRecommendedToolsOverRunInTerminal(args.command, this._languageModelToolsService);
880
887
  if (alternativeRecommendation) {
@@ -946,9 +953,8 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
946
953
  const isAutoApprovedByRules =
947
954
  (isAutoApproveAllowed &&
948
955
  wouldBeAutoApproved);
949
- const isUnsandboxedAutoApproved = isSandboxEnabled && requiresUnsandboxConfirmation === true && this._autoApproveUnsandboxedCommands;
950
956
  const isSandboxAutoApproved = isSandboxEnabled && toolSpecificData.commandLine.isSandboxWrapped === true && !requiresAllowNetworkConfirmation && this._allowSandboxAutoApprove;
951
- const isFinalAutoApproved = isUnsandboxedAutoApproved || isSandboxAutoApproved || isAutoApprovedByRules || ( commandLineAnalyzerResults.some(e => e.forceAutoApproval));
957
+ const isFinalAutoApproved = isSandboxAutoApproved || isAutoApprovedByRules || ( commandLineAnalyzerResults.some(e => e.forceAutoApproval));
952
958
  if (isFinalAutoApproved || (isAutoApproveEnabled && ( commandLineAnalyzerResults.some(e => e.autoApproveInfo)))) {
953
959
  toolSpecificData.autoApproveInfo = commandLineAnalyzerResults.find(e => e.autoApproveInfo)?.autoApproveInfo;
954
960
  }
@@ -969,12 +975,12 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
969
975
  cwdLabel: directoryLabel,
970
976
  cdPrefix
971
977
  };
972
- confirmationTitle = ( localize(14684, "Run `{0}` command within `{1}`?", shellType, directoryLabel));
978
+ confirmationTitle = ( localize(15337, "Run `{0}` command within `{1}`?", shellType, directoryLabel));
973
979
  } else {
974
980
  toolSpecificData.confirmation = {
975
981
  commandLine: commandToDisplay
976
982
  };
977
- confirmationTitle = ( localize(14685, "Run `{0}` command?", shellType));
983
+ confirmationTitle = ( localize(15338, "Run `{0}` command?", shellType));
978
984
  }
979
985
  const commandForPresenter = extractedCd?.command ?? commandToDisplay;
980
986
  let presenterInput = commandForPresenter;
@@ -995,7 +1001,7 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
995
1001
  if (extractedCd && toolSpecificData.confirmation?.cwdLabel) {
996
1002
  if (presenterResult.languageDisplayName) {
997
1003
  confirmationTitle = ( localize(
998
- 14686,
1004
+ 15339,
999
1005
  "Run `{0}` command in `{1}` within `{2}`?",
1000
1006
  presenterResult.languageDisplayName,
1001
1007
  shellType,
@@ -1003,7 +1009,7 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
1003
1009
  ));
1004
1010
  } else {
1005
1011
  confirmationTitle = ( localize(
1006
- 14687,
1012
+ 15340,
1007
1013
  "Run command in `{0}` within `{1}`?",
1008
1014
  shellType,
1009
1015
  toolSpecificData.confirmation.cwdLabel
@@ -1012,13 +1018,13 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
1012
1018
  } else {
1013
1019
  if (presenterResult.languageDisplayName) {
1014
1020
  confirmationTitle = ( localize(
1015
- 14688,
1021
+ 15341,
1016
1022
  "Run `{0}` command in `{1}`?",
1017
1023
  presenterResult.languageDisplayName,
1018
1024
  shellType
1019
1025
  ));
1020
1026
  } else {
1021
- confirmationTitle = ( localize(14689, "Run command in `{0}`?", shellType));
1027
+ confirmationTitle = ( localize(15342, "Run command in `{0}`?", shellType));
1022
1028
  }
1023
1029
  }
1024
1030
  if (!presenterResult.processOtherPresenters) {
@@ -1029,43 +1035,43 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
1029
1035
  }
1030
1036
  if (requiresUnsandboxConfirmation) {
1031
1037
  confirmationTitle = blockedDomains?.length ? ( localize(
1032
- 14690,
1038
+ 15343,
1033
1039
  "Run `{0}` command outside the [sandbox]({1}) to access {2}?",
1034
1040
  shellType,
1035
1041
  TERMINAL_SANDBOX_DOCUMENTATION_URL,
1036
1042
  this._formatBlockedDomainsForTitle(blockedDomains)
1037
1043
  )) : ( localize(
1038
- 14691,
1044
+ 15344,
1039
1045
  "Run `{0}` command outside the [sandbox]({1})?",
1040
1046
  shellType,
1041
1047
  TERMINAL_SANDBOX_DOCUMENTATION_URL
1042
1048
  ));
1043
1049
  } else if (requiresAllowNetworkConfirmation) {
1044
1050
  confirmationTitle = ( localize(
1045
- 14692,
1051
+ 15345,
1046
1052
  "Allow the sandbox to run `{0}` command with unrestricted network access.",
1047
1053
  shellType
1048
1054
  ));
1049
1055
  }
1050
1056
  const shouldShowConfirmation = (!isFinalAutoApproved && (!isSessionAutoApproved || requiresAllowNetworkConfirmation)) || context.forceConfirmationReason !== undefined;
1051
- const explanation = args.explanation || ( localize(14693, "No explanation provided"));
1052
- const goal = args.goal || ( localize(14694, "No goal provided"));
1057
+ const explanation = args.explanation || ( localize(15346, "No explanation provided"));
1058
+ const goal = args.goal || ( localize(15347, "No goal provided"));
1053
1059
  const confirmationMessage = requiresUnsandboxConfirmation ? ( new MarkdownString(( localize(
1054
- 14695,
1060
+ 15348,
1055
1061
  "Explanation: {0}\n\nGoal: {1}\n\nReason for leaving the sandbox: {2}",
1056
1062
  explanation,
1057
1063
  goal,
1058
- requestUnsandboxedExecutionReason || ( localize(14696, "The model indicated that this command needs unsandboxed access."))
1064
+ requestUnsandboxedExecutionReason || ( localize(15349, "The model indicated that this command needs unsandboxed access."))
1059
1065
  )))) : requiresAllowNetworkConfirmation ? ( new MarkdownString(( localize(
1060
- 14697,
1066
+ 15350,
1061
1067
  "Explanation: {0}\n\nGoal: {1}\n\nReason for allowing unrestricted network access in the sandbox: {2}",
1062
1068
  explanation,
1063
1069
  goal,
1064
1070
  requestAllowNetworkReason || ( localize(
1065
- 14698,
1071
+ 15351,
1066
1072
  "The model indicated that this sandboxed command needs unrestricted network access."
1067
1073
  ))
1068
- )))) : ( new MarkdownString(( localize(14699, "Explanation: {0}\n\nGoal: {1}", explanation, goal))));
1074
+ )))) : ( new MarkdownString(( localize(15352, "Explanation: {0}\n\nGoal: {1}", explanation, goal))));
1069
1075
  const confirmationMessages = shouldShowConfirmation ? {
1070
1076
  title: confirmationTitle,
1071
1077
  message: confirmationMessage,
@@ -1076,14 +1082,14 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
1076
1082
  const rawDisplayCommand = toolSpecificData.commandLine.forDisplay ?? toolSpecificData.commandLine.toolEdited ?? toolSpecificData.commandLine.original;
1077
1083
  const displayCommand = rawDisplayCommand.length > 80 ? rawDisplayCommand.substring(0, 77) + "..." : rawDisplayCommand;
1078
1084
  const invocationMessage = toolSpecificData.commandLine.isSandboxWrapped ? ( new MarkdownString(( localize(
1079
- 14700,
1085
+ 15353,
1080
1086
  "Running `{0}` in sandbox",
1081
1087
  escapeMarkdownSyntaxTokens(displayCommand)
1082
- )))) : ( new MarkdownString(( localize(14701, "Running `{0}`", escapeMarkdownSyntaxTokens(displayCommand)))));
1088
+ )))) : ( new MarkdownString(( localize(15354, "Running `{0}`", escapeMarkdownSyntaxTokens(displayCommand)))));
1083
1089
  return {
1084
1090
  invocationMessage,
1085
1091
  icon: toolSpecificData.commandLine.isSandboxWrapped ? Codicon.terminalSecure : Codicon.terminal,
1086
- confirmationMessages: sandboxConfirmationMessageForMissingDeps ?? confirmationMessages,
1092
+ confirmationMessages: sandboxPrerequisiteConfirmation ?? confirmationMessages,
1087
1093
  toolSpecificData
1088
1094
  };
1089
1095
  }
@@ -1092,7 +1098,7 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
1092
1098
  return `\`${blockedDomains[0]}\``;
1093
1099
  }
1094
1100
  return localize(
1095
- 14702,
1101
+ 15355,
1096
1102
  "`{0}` and {1} more domains",
1097
1103
  blockedDomains[0],
1098
1104
  blockedDomains.length - 1
@@ -1102,13 +1108,13 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
1102
1108
  if (deniedDomains.length === blockedDomains.length && deniedDomains.length > 0) {
1103
1109
  if (blockedDomains.length === 1) {
1104
1110
  return localize(
1105
- 14703,
1111
+ 15356,
1106
1112
  "This command accesses {0}, which is blocked by chat.agent.deniedNetworkDomains.",
1107
1113
  blockedDomains[0]
1108
1114
  );
1109
1115
  }
1110
1116
  return localize(
1111
- 14704,
1117
+ 15357,
1112
1118
  "This command accesses {0} and {1} more domains that are blocked by chat.agent.deniedNetworkDomains.",
1113
1119
  blockedDomains[0],
1114
1120
  blockedDomains.length - 1
@@ -1117,13 +1123,13 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
1117
1123
  if (deniedDomains.length > 0) {
1118
1124
  if (blockedDomains.length === 1) {
1119
1125
  return localize(
1120
- 14705,
1126
+ 15358,
1121
1127
  "This command accesses {0}, which is blocked by chat.agent.deniedNetworkDomains or not added to chat.agent.allowedNetworkDomains.",
1122
1128
  blockedDomains[0]
1123
1129
  );
1124
1130
  }
1125
1131
  return localize(
1126
- 14706,
1132
+ 15359,
1127
1133
  "This command accesses {0} and {1} more domains that are blocked by chat.agent.deniedNetworkDomains or not added to chat.agent.allowedNetworkDomains.",
1128
1134
  blockedDomains[0],
1129
1135
  blockedDomains.length - 1
@@ -1131,13 +1137,13 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
1131
1137
  }
1132
1138
  if (blockedDomains.length === 1) {
1133
1139
  return localize(
1134
- 14707,
1140
+ 15360,
1135
1141
  "This command accesses {0}, which is not permitted by the current chat.agent.sandbox configuration.",
1136
1142
  blockedDomains[0]
1137
1143
  );
1138
1144
  }
1139
1145
  return localize(
1140
- 14708,
1146
+ 15361,
1141
1147
  "This command accesses {0} and {1} more domains that are not permitted by the current chat.agent.sandbox configuration.",
1142
1148
  blockedDomains[0],
1143
1149
  blockedDomains.length - 1
@@ -1219,9 +1225,6 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
1219
1225
  riskAssessment,
1220
1226
  token
1221
1227
  ) {
1222
- if (retryKind === "unsandboxed" && this._autoApproveUnsandboxedCommands) {
1223
- return true;
1224
- }
1225
1228
  const chatModel = sessionResource && this._chatService.getSession(sessionResource);
1226
1229
  if (!(chatModel instanceof ChatModel)) {
1227
1230
  return false;
@@ -1254,11 +1257,11 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
1254
1257
  resolve(value);
1255
1258
  };
1256
1259
  const confirmationMessage = retryKind === "allowNetwork" ? ( new MarkdownString(( localize(
1257
- 14709,
1260
+ 15362,
1258
1261
  "`{0}`",
1259
1262
  escapeMarkdownSyntaxTokens(buildCommandDisplayText(command))
1260
1263
  )))) : ( new MarkdownString(( localize(
1261
- 14710,
1264
+ 15363,
1262
1265
  "`{0}`",
1263
1266
  escapeMarkdownSyntaxTokens(buildCommandDisplayText(command))
1264
1267
  ))));
@@ -1266,8 +1269,8 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
1266
1269
  this._getAutomaticSandboxRetryTitle(retryKind, shellType, blockedDomains),
1267
1270
  confirmationMessage,
1268
1271
  "",
1269
- ( localize(14711, "Allow")),
1270
- ( localize(14712, "Skip")),
1272
+ ( localize(15364, "Allow")),
1273
+ ( localize(15365, "Skip")),
1271
1274
  async () => {
1272
1275
  resolveOnce(true);
1273
1276
  part.hide();
@@ -1293,22 +1296,22 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
1293
1296
  _getAutomaticSandboxRetryTitle(retryKind, shellType, blockedDomains) {
1294
1297
  if (retryKind === "allowNetwork") {
1295
1298
  return blockedDomains?.length ? ( new MarkdownString(( localize(
1296
- 14713,
1299
+ 15366,
1297
1300
  "Retry `{0}` command in the sandbox by allowing network access to {1}?",
1298
1301
  shellType,
1299
1302
  this._formatBlockedDomainsForTitle(blockedDomains)
1300
1303
  )))) : ( new MarkdownString(( localize(
1301
- 14714,
1304
+ 15367,
1302
1305
  "Retry `{0}` command in the sandbox by allowing network access?",
1303
1306
  shellType
1304
1307
  ))));
1305
1308
  }
1306
1309
  return blockedDomains?.length ? ( new MarkdownString(( localize(
1307
- 14715,
1310
+ 15368,
1308
1311
  "Run `{0}` command outside the sandbox to access {1}?",
1309
1312
  shellType,
1310
1313
  this._formatBlockedDomainsForTitle(blockedDomains)
1311
- )))) : ( new MarkdownString(( localize(14716, "Run `{0}` command outside the sandbox?", shellType))));
1314
+ )))) : ( new MarkdownString(( localize(15369, "Run `{0}` command outside the sandbox?", shellType))));
1312
1315
  }
1313
1316
  _registerSensitiveInputElicitation(
1314
1317
  chatSessionResource,
@@ -1336,10 +1339,10 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
1336
1339
  if (chatModel instanceof ChatModel) {
1337
1340
  const request = chatModel.getRequests().at(-1);
1338
1341
  if (request) {
1339
- const infoPart = ( new ChatElicitationRequestPart(( new MarkdownString(( localize(14717, "Terminal command cancelled — sensitive input required")))), ( new MarkdownString(( localize(
1340
- 14718,
1342
+ const infoPart = ( new ChatElicitationRequestPart(( new MarkdownString(( localize(15370, "Terminal command cancelled — sensitive input required")))), ( new MarkdownString(( localize(
1343
+ 15371,
1341
1344
  "The terminal command was prompting for a password or other secret. Auto-approve / autopilot mode cannot safely supply secrets, so the command was cancelled. Run the command interactively if you want to provide the secret."
1342
- )))), "", ( localize(14719, "Dismiss")), "", async () => {
1345
+ )))), "", ( localize(15372, "Dismiss")), "", async () => {
1343
1346
  infoPart.hide();
1344
1347
  return ElicitationState.Accepted;
1345
1348
  }, async () => {
@@ -1363,10 +1366,10 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
1363
1366
  if (!request) {
1364
1367
  return;
1365
1368
  }
1366
- const part = ( new ChatElicitationRequestPart(( new MarkdownString(( localize(14720, "Terminal is waiting for sensitive input")))), ( new MarkdownString(( localize(
1367
- 14721,
1369
+ const part = ( new ChatElicitationRequestPart(( new MarkdownString(( localize(15373, "Terminal is waiting for sensitive input")))), ( new MarkdownString(( localize(
1370
+ 15374,
1368
1371
  "The terminal command appears to be prompting for a password or other sensitive value. Focus the terminal to type it directly — secrets must not be sent through chat."
1369
- )))), "", ( localize(14722, "Focus Terminal")), ( localize(14723, "Cancel Command")), async () => {
1372
+ )))), "", ( localize(15375, "Focus Terminal")), ( localize(15376, "Cancel Command")), async () => {
1370
1373
  pending = undefined;
1371
1374
  part.hide();
1372
1375
  try {
@@ -1412,14 +1415,14 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
1412
1415
  const progress = {
1413
1416
  kind: "externalToolInvocationUpdate",
1414
1417
  toolCallId,
1415
- toolName: ( localize(14671, "Run in Terminal")),
1418
+ toolName: ( localize(15318, "Run in Terminal")),
1416
1419
  isComplete,
1417
1420
  invocationMessage: retryKind === "allowNetwork" ? ( new MarkdownString(( localize(
1418
- 14724,
1421
+ 15377,
1419
1422
  "Running `{0}` in the sandbox with unrestricted network access",
1420
1423
  escapeMarkdownSyntaxTokens(displayCommand)
1421
1424
  )))) : ( new MarkdownString(( localize(
1422
- 14725,
1425
+ 15378,
1423
1426
  "Running `{0}` outside the sandbox",
1424
1427
  escapeMarkdownSyntaxTokens(displayCommand)
1425
1428
  )))),
@@ -1545,6 +1548,22 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
1545
1548
  }]
1546
1549
  };
1547
1550
  }
1551
+ const sandboxPrerequisiteTerminalOptions = {
1552
+ createTerminal: async () => this._terminalService.createTerminal({}),
1553
+ focusTerminal: async terminal => {
1554
+ this._terminalService.setActiveInstance(terminal);
1555
+ await this._terminalService.revealTerminal(terminal, true);
1556
+ terminal.focus();
1557
+ }
1558
+ };
1559
+ if (toolSpecificData.sandboxPrerequisiteFailure) {
1560
+ return {
1561
+ content: [{
1562
+ kind: "text",
1563
+ value: toolSpecificData.sandboxPrerequisiteFailure
1564
+ }]
1565
+ };
1566
+ }
1548
1567
  const isSandboxAllowNetworkEnabled = isSandboxEnabled && (await this._terminalSandboxService.isSandboxAllowNetworkEnabled());
1549
1568
  if (this._shouldRejectAllowNetworkRequest(isSandboxEnabled, isSandboxAllowNetworkEnabled, args)) {
1550
1569
  const message = this._getAllowNetworkRequestDisabledMessage();
@@ -1570,20 +1589,18 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
1570
1589
  const sessionResource = invocation.context.sessionResource;
1571
1590
  const {
1572
1591
  exitCode
1573
- } = await this._terminalSandboxService.installMissingSandboxDependencies(toolSpecificData.missingSandboxDependencies, sessionResource, token, {
1574
- createTerminal: async () => this._terminalService.createTerminal({}),
1575
- focusTerminal: async terminal => {
1576
- this._terminalService.setActiveInstance(terminal);
1577
- await this._terminalService.revealTerminal(terminal, true);
1578
- terminal.focus();
1579
- }
1580
- });
1592
+ } = await this._terminalSandboxService.installMissingSandboxDependencies(
1593
+ toolSpecificData.missingSandboxDependencies,
1594
+ sessionResource,
1595
+ token,
1596
+ sandboxPrerequisiteTerminalOptions
1597
+ );
1581
1598
  if (exitCode !== undefined && exitCode !== 0) {
1582
1599
  return {
1583
1600
  content: [{
1584
1601
  kind: "text",
1585
1602
  value: ( localize(
1586
- 14726,
1603
+ 15379,
1587
1604
  "Sandbox dependency installation failed (exit code {0}). The command was not executed.",
1588
1605
  exitCode
1589
1606
  ))
@@ -1595,12 +1612,30 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
1595
1612
  content: [{
1596
1613
  kind: "text",
1597
1614
  value: ( localize(
1598
- 14727,
1615
+ 15380,
1599
1616
  "Could not determine whether sandbox dependency installation succeeded. The command was not executed."
1600
1617
  ))
1601
1618
  }]
1602
1619
  };
1603
1620
  }
1621
+ const refreshedPrereqs = await this._terminalSandboxService.checkForSandboxingPrereqs(true, sandboxPrecheckInputs);
1622
+ if (refreshedPrereqs.failedCheck !== undefined) {
1623
+ return {
1624
+ content: [{
1625
+ kind: "text",
1626
+ value: refreshedPrereqs.failedCheck === TerminalSandboxPrerequisiteCheck.Bubblewrap && refreshedPrereqs.remediations?.length ? ( localize(
1627
+ 15381,
1628
+ "Sandbox dependencies were installed, but bubblewrap cannot create the required sandbox namespace. Run the command again to choose an available repair option."
1629
+ )) : refreshedPrereqs.failedCheck === TerminalSandboxPrerequisiteCheck.Bubblewrap ? ( localize(
1630
+ 15382,
1631
+ "Sandbox dependencies were installed, but bubblewrap cannot create the required sandbox namespace on this system. The command was not executed."
1632
+ )) : ( localize(
1633
+ 15383,
1634
+ "Sandbox prerequisites are still not satisfied after installation. The command was not executed."
1635
+ ))
1636
+ }]
1637
+ };
1638
+ }
1604
1639
  this._logService.info(
1605
1640
  "RunInTerminalTool: Sandbox dependency installation succeeded, proceeding with command execution"
1606
1641
  );
@@ -1609,11 +1644,60 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
1609
1644
  return {
1610
1645
  content: [{
1611
1646
  kind: "text",
1612
- value: ( localize(14728, "Sandbox dependency installation was cancelled by the user."))
1647
+ value: ( localize(15384, "Sandbox dependency installation was cancelled by the user."))
1613
1648
  }]
1614
1649
  };
1615
1650
  }
1616
1651
  }
1652
+ if (toolSpecificData.sandboxRemediations?.length) {
1653
+ const selectedRemediation = invocation.selectedCustomButton;
1654
+ if (!selectedRemediation || !toolSpecificData.sandboxRemediations.includes(selectedRemediation)) {
1655
+ return {
1656
+ content: [{
1657
+ kind: "text",
1658
+ value: ( localize(15385, "Bubblewrap sandbox repair was cancelled by the user."))
1659
+ }]
1660
+ };
1661
+ }
1662
+ const {
1663
+ exitCode
1664
+ } = await this._terminalSandboxService.runSandboxRemediation(
1665
+ selectedRemediation,
1666
+ invocation.context.sessionResource,
1667
+ token,
1668
+ sandboxPrerequisiteTerminalOptions
1669
+ );
1670
+ if (exitCode !== 0) {
1671
+ return {
1672
+ content: [{
1673
+ kind: "text",
1674
+ value: exitCode === undefined ? ( localize(
1675
+ 15386,
1676
+ "Could not determine whether the bubblewrap repair succeeded. The command was not executed."
1677
+ )) : ( localize(
1678
+ 15387,
1679
+ "Bubblewrap repair failed (exit code {0}). The command was not executed.",
1680
+ exitCode
1681
+ ))
1682
+ }]
1683
+ };
1684
+ }
1685
+ const refreshedPrereqs = await this._terminalSandboxService.checkForSandboxingPrereqs(true, sandboxPrecheckInputs);
1686
+ if (refreshedPrereqs.failedCheck !== undefined) {
1687
+ return {
1688
+ content: [{
1689
+ kind: "text",
1690
+ value: ( localize(
1691
+ 15388,
1692
+ "Bubblewrap still cannot create the required sandbox namespace after remediation. The command was not executed."
1693
+ ))
1694
+ }]
1695
+ };
1696
+ }
1697
+ this._logService.info(
1698
+ "RunInTerminalTool: Bubblewrap remediation succeeded, proceeding with command execution"
1699
+ );
1700
+ }
1617
1701
  const executionOptions = this._resolveExecutionOptions(args);
1618
1702
  this._logService.debug(`RunInTerminalTool: Invoking with options ${JSON.stringify(args)}`);
1619
1703
  let toolResultMessage;
@@ -1639,13 +1723,35 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
1639
1723
  if (token.isCancellationRequested) {
1640
1724
  throw ( new CancellationError());
1641
1725
  }
1726
+ if (didSandboxWrapCommand) {
1727
+ const deniedAccess = await this._getDeniedSandboxFileAccess(args.requestFileValidationCheck, sandboxPrecheckInputs);
1728
+ if (deniedAccess.length > 0) {
1729
+ const message = this._buildSandboxFileAccessDeniedMessage(deniedAccess);
1730
+ return {
1731
+ toolResultError: message,
1732
+ toolResultDetails: {
1733
+ input: args.command,
1734
+ output: [{
1735
+ type: "embed",
1736
+ isText: true,
1737
+ value: message
1738
+ }],
1739
+ isError: true
1740
+ },
1741
+ content: [{
1742
+ kind: "text",
1743
+ value: message
1744
+ }]
1745
+ };
1746
+ }
1747
+ }
1642
1748
  let error;
1643
1749
  const automaticUnsandboxRetryReason = ( localize(
1644
- 14729,
1750
+ 15389,
1645
1751
  "The sandboxed execution output indicated the sandbox blocked the command."
1646
1752
  ));
1647
1753
  const automaticAllowNetworkRetryReason = ( localize(
1648
- 14730,
1754
+ 15390,
1649
1755
  "The sandboxed execution output indicated the sandbox blocked required network access."
1650
1756
  ));
1651
1757
  const isNewSession = !executionOptions.persistentSession && !( this._sessionTerminalAssociations.has(chatSessionResource));
@@ -1847,7 +1953,7 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
1847
1953
  if (timeoutRacePromise) {
1848
1954
  raceCandidates.push(timeoutRacePromise);
1849
1955
  }
1850
- const idleSilenceMs = this._configurationService.getValue(TerminalChatAgentToolsSettingId.IdleSilenceTimeoutMs) ?? 60000;
1956
+ const idleSilenceMs = this._configurationService.getValue(TerminalChatAgentToolsSettingId.IdleSilenceTimeoutMs) ?? DEFAULT_IDLE_SILENCE_TIMEOUT_MS;
1851
1957
  if (idleSilenceMs > 0) {
1852
1958
  const idleSilenceDeferred = ( new DeferredPromise());
1853
1959
  const idleSilenceScheduler = raceCleanup.add(( new RunOnceScheduler(() => idleSilenceDeferred.complete({
@@ -2158,7 +2264,8 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
2158
2264
  if (outputAnalyzerMessage) {
2159
2265
  resultText.push(`${outputAnalyzerMessage}\n`);
2160
2266
  }
2161
- resultText.push(terminalResult);
2267
+ const processedOutput = await this._largeOutputFileWriter.processOutput(terminalResult);
2268
+ resultText.push(processedOutput);
2162
2269
  const isError = exitCode !== undefined && exitCode !== 0;
2163
2270
  const endCwd = await toolTerminal.instance.getCwdResource();
2164
2271
  const imageContent = await this._extractImagesFromOutput(terminalResult, endCwd);
@@ -2459,18 +2566,28 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
2459
2566
  if (!terminalsToDispose || terminalsToDispose.size === 0) {
2460
2567
  return;
2461
2568
  }
2569
+ const shouldPreserveTerminalsForOutputLocation = this._configurationService.getValue(TerminalChatAgentToolsSettingId.OutputLocation) === "terminal";
2462
2570
  this._logService.debug(
2463
2571
  `RunInTerminalTool: Cleaning up ${terminalsToDispose.size} terminal(s) for ended chat session ${chatSessionResource}`
2464
2572
  );
2465
2573
  this._sessionTerminalAssociations.delete(chatSessionResource);
2466
2574
  this._sessionTerminalInstances.delete(chatSessionResource);
2467
2575
  for (const terminal of terminalsToDispose) {
2576
+ if (this._terminalService.foregroundInstances.includes(terminal) || shouldPreserveTerminalsForOutputLocation) {
2577
+ this._logService.debug(
2578
+ `RunInTerminalTool: Skipping disposal of preserved terminal ${terminal.instanceId} for session ${chatSessionResource}`
2579
+ );
2580
+ continue;
2581
+ }
2468
2582
  this._terminalsBeingDisposedBySessionCleanup.add(terminal);
2469
2583
  terminal.dispose();
2470
2584
  }
2471
2585
  const terminalToRemove = [];
2472
2586
  for (const [termId, execution] of RunInTerminalTool_1._activeExecutions.entries()) {
2473
2587
  if (( terminalsToDispose.has(execution.instance))) {
2588
+ if (this._terminalService.foregroundInstances.includes(execution.instance) || shouldPreserveTerminalsForOutputLocation) {
2589
+ continue;
2590
+ }
2474
2591
  execution.dispose();
2475
2592
  terminalToRemove.push(termId);
2476
2593
  }
@@ -2642,7 +2759,7 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
2642
2759
  ...sendOptions,
2643
2760
  queue: ChatRequestQueueKind.Steering,
2644
2761
  isSystemInitiated: true,
2645
- systemInitiatedLabel: ( localize(14731, "{0} may need input", commandDisplay)),
2762
+ systemInitiatedLabel: ( localize(15391, "{0} may need input", commandDisplay)),
2646
2763
  terminalExecutionId: termId
2647
2764
  }).catch(e => {
2648
2765
  this._logService.warn(
@@ -2671,7 +2788,7 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
2671
2788
  }
2672
2789
  disposeNotification();
2673
2790
  const exitCode = command.exitCode;
2674
- const exitCodeText = exitCode !== undefined ? ` with exit code ${exitCode}` : "";
2791
+ const exitCodeText = exitCode !== undefined && exitCode !== 0 ? ` with exit code ${exitCode}` : "";
2675
2792
  const currentOutput = execution.getOutput();
2676
2793
  const isUserVisible = this._terminalService.foregroundInstances.includes(terminalInstance);
2677
2794
  const message = isUserVisible ? `[Terminal ${termId} notification: command completed${exitCodeText}. Use send_to_terminal to send another command or kill_terminal to stop it.]\nTerminal output:\n${currentOutput}` : `[Terminal ${termId} notification: command completed${exitCodeText}. The terminal has been cleaned up.]\nTerminal output:\n${currentOutput}`;
@@ -2682,7 +2799,7 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
2682
2799
  ...sendOptions,
2683
2800
  queue: ChatRequestQueueKind.Steering,
2684
2801
  isSystemInitiated: true,
2685
- systemInitiatedLabel: ( localize(14732, "{0} completed", commandDisplay)),
2802
+ systemInitiatedLabel: ( localize(15392, "{0} completed", commandDisplay)),
2686
2803
  terminalExecutionId: termId
2687
2804
  }).catch(e => {
2688
2805
  this._logService.warn(
@@ -2726,7 +2843,7 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
2726
2843
  }
2727
2844
  const currentOutput = executionForDisposal?.getOutput() ?? "";
2728
2845
  const exitCode = terminalInstance.exitCode;
2729
- const exitCodeText = exitCode !== undefined ? ` with exit code ${exitCode}` : "";
2846
+ const exitCodeText = exitCode !== undefined && exitCode !== 0 ? ` with exit code ${exitCode}` : "";
2730
2847
  disposeNotification();
2731
2848
  const message = `[Terminal ${termId} notification: terminal exited${exitCodeText}. The terminal process ended before the command could complete normally; further commands cannot be sent to this terminal ID.]\nTerminal output:\n${currentOutput}`;
2732
2849
  this._logService.debug(
@@ -2736,7 +2853,7 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
2736
2853
  ...sendOptions,
2737
2854
  queue: ChatRequestQueueKind.Steering,
2738
2855
  isSystemInitiated: true,
2739
- systemInitiatedLabel: ( localize(14733, "{0} terminal exited", commandDisplay)),
2856
+ systemInitiatedLabel: ( localize(15393, "{0} terminal exited", commandDisplay)),
2740
2857
  terminalExecutionId: termId
2741
2858
  }).catch(e => {
2742
2859
  this._logService.warn(
@@ -2884,14 +3001,24 @@ class RestoredTerminalExecution extends Disposable {
2884
3001
  }
2885
3002
  }
2886
3003
  let TerminalProfileFetcher = class TerminalProfileFetcher {
3004
+ static {
3005
+ TerminalProfileFetcher_1 = this;
3006
+ }
3007
+ static {
3008
+ this._posixShellFallbacks = ["/bin/bash", "/usr/bin/bash", "/bin/sh"];
3009
+ }
2887
3010
  constructor(
2888
3011
  _configurationService,
2889
3012
  _terminalProfileResolverService,
2890
- _remoteAgentService
3013
+ _remoteAgentService,
3014
+ _fileService,
3015
+ _logService
2891
3016
  ) {
2892
3017
  this._configurationService = _configurationService;
2893
3018
  this._terminalProfileResolverService = _terminalProfileResolverService;
2894
3019
  this._remoteAgentService = _remoteAgentService;
3020
+ this._fileService = _fileService;
3021
+ this._logService = _logService;
2895
3022
  this.osBackend = this._remoteAgentService.getEnvironment().then(remoteEnv => remoteEnv?.os ?? OS);
2896
3023
  }
2897
3024
  async getCopilotProfile() {
@@ -2918,11 +3045,48 @@ let TerminalProfileFetcher = class TerminalProfileFetcher {
2918
3045
  profileName: "bash"
2919
3046
  };
2920
3047
  }
3048
+ if (os !== OperatingSystem.Windows) {
3049
+ const shellExists = await this._shellExists(defaultProfile.path);
3050
+ if (!shellExists) {
3051
+ const fallbackPath = await this._findFallbackShell();
3052
+ if (fallbackPath) {
3053
+ this._logService.warn(
3054
+ `TerminalProfileFetcher: resolved shell "${defaultProfile.path}" does not exist, falling back to "${fallbackPath}"`
3055
+ );
3056
+ return {
3057
+ ...defaultProfile,
3058
+ path: fallbackPath,
3059
+ profileName: basename(fallbackPath),
3060
+ icon: undefined
3061
+ };
3062
+ }
3063
+ }
3064
+ }
2921
3065
  return {
2922
3066
  ...defaultProfile,
2923
3067
  icon: undefined
2924
3068
  };
2925
3069
  }
3070
+ async _shellExists(shellPath) {
3071
+ try {
3072
+ const remoteAuthority = this._remoteAgentService.getConnection()?.remoteAuthority;
3073
+ const resource = remoteAuthority ? URI.file(shellPath).with({
3074
+ scheme: "vscode-remote",
3075
+ authority: remoteAuthority
3076
+ }) : URI.file(shellPath);
3077
+ return await this._fileService.exists(resource);
3078
+ } catch {
3079
+ return false;
3080
+ }
3081
+ }
3082
+ async _findFallbackShell() {
3083
+ for (const candidate of TerminalProfileFetcher_1._posixShellFallbacks) {
3084
+ if (await this._shellExists(candidate)) {
3085
+ return candidate;
3086
+ }
3087
+ }
3088
+ return undefined;
3089
+ }
2926
3090
  async getCopilotShell() {
2927
3091
  return (await this.getCopilotProfile()).path;
2928
3092
  }
@@ -2956,6 +3120,6 @@ let TerminalProfileFetcher = class TerminalProfileFetcher {
2956
3120
  return false;
2957
3121
  }
2958
3122
  };
2959
- TerminalProfileFetcher = ( __decorate([( __param(0, IConfigurationService)), ( __param(1, ITerminalProfileResolverService)), ( __param(2, IRemoteAgentService))], TerminalProfileFetcher));
3123
+ TerminalProfileFetcher = TerminalProfileFetcher_1 = ( __decorate([( __param(0, IConfigurationService)), ( __param(1, ITerminalProfileResolverService)), ( __param(2, IRemoteAgentService)), ( __param(3, IFileService)), ( __param(4, ITerminalLogService))], TerminalProfileFetcher));
2960
3124
 
2961
- export { RunInTerminalTool, TerminalProfileFetcher, buildCompletionNotificationCommand, createRunInTerminalToolData, shouldAutomaticallyRetryAllowNetworkInSandboxed, shouldAutomaticallyRetryUnsandboxed };
3125
+ export { RunInTerminalTool, TerminalProfileFetcher, buildCompletionNotificationCommand, createRunInTerminalToolData, createSandboxLines, createSandboxProperties, shouldAutomaticallyRetryAllowNetworkInSandboxed, shouldAutomaticallyRetryUnsandboxed };