@codingame/monaco-vscode-chat-service-override 29.1.1 → 30.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (258) hide show
  1. package/index.js +5 -2
  2. package/package.json +5 -5
  3. package/vscode/src/vs/platform/agentHost/common/agentService.d.ts +37 -39
  4. package/vscode/src/vs/platform/agentHost/common/agentService.js +3 -1
  5. package/vscode/src/vs/platform/agentHost/common/agentService.service.d.ts +11 -1
  6. package/vscode/src/vs/platform/agentHost/common/state/protocol/action-origin.generated.d.ts +4 -4
  7. package/vscode/src/vs/platform/agentHost/common/state/protocol/actions.d.ts +132 -42
  8. package/vscode/src/vs/platform/agentHost/common/state/protocol/commands.d.ts +54 -0
  9. package/vscode/src/vs/platform/agentHost/common/state/protocol/errors.d.ts +15 -0
  10. package/vscode/src/vs/platform/agentHost/common/state/protocol/messages.d.ts +5 -1
  11. package/vscode/src/vs/platform/agentHost/common/state/protocol/state.d.ts +188 -51
  12. package/vscode/src/vs/platform/agentHost/common/state/sessionActions.d.ts +7 -6
  13. package/vscode/src/vs/platform/agentHost/common/state/sessionProtocol.d.ts +1 -1
  14. package/vscode/src/vs/platform/agentHost/common/state/sessionState.d.ts +7 -2
  15. package/vscode/src/vs/platform/sandbox/browser/sandboxHelperService.d.ts +6 -0
  16. package/vscode/src/vs/platform/sandbox/browser/sandboxHelperService.js +14 -0
  17. package/vscode/src/vs/platform/sandbox/common/sandboxHelperIpc.d.ts +18 -0
  18. package/vscode/src/vs/platform/sandbox/common/sandboxHelperIpc.js +13 -0
  19. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityService.js +2 -2
  20. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.js +37 -16
  21. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.js +8 -8
  22. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +59 -59
  23. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAgentRecommendationActions.js +1 -1
  24. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +12 -12
  25. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +10 -8
  26. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +37 -3
  27. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +4 -4
  28. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +2 -2
  29. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatForkActions.js +6 -6
  30. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +3 -3
  31. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatLanguageModelActions.js +13 -13
  32. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +6 -6
  33. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatNewActions.js +20 -11
  34. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatOpenAgentDebugPanelAction.js +14 -14
  35. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPluginActions.js +18 -13
  36. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPromptNavigationActions.js +2 -2
  37. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQueueActions.js +10 -10
  38. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +8 -8
  39. package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +19 -19
  40. package/vscode/src/vs/workbench/contrib/chat/browser/actions/createPluginAction.d.ts +36 -0
  41. package/vscode/src/vs/workbench/contrib/chat/browser/actions/createPluginAction.js +482 -0
  42. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginActions.js +8 -8
  43. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.js +2 -2
  44. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditorInput.js +2 -2
  45. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.d.ts +10 -2
  46. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.js +43 -10
  47. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.js +13 -13
  48. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.js +3 -3
  49. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.js +74 -76
  50. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.js +5 -5
  51. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsQuickAccess.js +1 -1
  52. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjection.js +1 -1
  53. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionActions.js +4 -4
  54. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.js +1 -1
  55. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionsExperiments.contribution.js +4 -4
  56. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.js +27 -35
  57. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccess.js +17 -17
  58. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccessActions.js +4 -4
  59. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/localAgentSessionsController.d.ts +5 -8
  60. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/localAgentSessionsController.js +86 -80
  61. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.d.ts +3 -2
  62. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.js +38 -4
  63. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.js +14 -14
  64. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.d.ts +38 -18
  65. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.js +427 -167
  66. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.contribution.js +37 -37
  67. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.d.ts +15 -0
  68. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.js +108 -37
  69. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.d.ts +8 -1
  70. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.js +28 -2
  71. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWorkspaceService.d.ts +2 -0
  72. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWorkspaceService.js +11 -1
  73. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.d.ts +1 -3
  74. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.js +3 -20
  75. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.d.ts +4 -0
  76. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.js +65 -68
  77. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationManagement.css +2 -0
  78. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.d.ts +1 -0
  79. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.js +64 -51
  80. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.js +1 -1
  81. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/simpleBrowserEditorOverlay.js +19 -19
  82. package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +288 -195
  83. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.js +21 -21
  84. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugDetailPanel.js +6 -6
  85. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditorInput.js +2 -2
  86. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventDetailRenderer.js +19 -19
  87. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventList.js +7 -7
  88. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFilters.js +4 -4
  89. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowChartView.js +7 -7
  90. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowGraph.js +21 -21
  91. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHomeView.js +12 -12
  92. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHookContentRenderer.js +17 -17
  93. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.js +21 -21
  94. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugMessageContentRenderer.js +8 -8
  95. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugModelTurnContentRenderer.js +23 -23
  96. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugOverviewView.js +28 -28
  97. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugToolCallContentRenderer.js +11 -11
  98. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +1 -1
  99. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingDeletedFileEntry.d.ts +1 -0
  100. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingDeletedFileEntry.js +3 -0
  101. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.js +3 -3
  102. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.d.ts +1 -0
  103. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +5 -2
  104. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.d.ts +1 -0
  105. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +1 -1
  106. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.d.ts +2 -1
  107. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +10 -3
  108. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.d.ts +4 -2
  109. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +19 -7
  110. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.d.ts +3 -2
  111. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +54 -12
  112. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.d.ts +1 -1
  113. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +3 -3
  114. package/vscode/src/vs/workbench/contrib/chat/browser/chatImageCarouselService.js +1 -1
  115. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.js +9 -8
  116. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditor.js +14 -14
  117. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.js +4 -4
  118. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.js +2 -2
  119. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.js +50 -50
  120. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatUsageWidget.js +11 -11
  121. package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +3 -3
  122. package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +30 -30
  123. package/vscode/src/vs/workbench/contrib/chat/browser/chatRepoInfo.js +2 -2
  124. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetup.js +1 -1
  125. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.d.ts +3 -1
  126. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.js +86 -17
  127. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.js +10 -10
  128. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupGrowthSession.js +6 -6
  129. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.js +29 -26
  130. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.js +12 -12
  131. package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.js +19 -19
  132. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.js +65 -65
  133. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.js +24 -16
  134. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipCatalog.js +17 -17
  135. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.js +2 -6
  136. package/vscode/src/vs/workbench/contrib/chat/browser/chatWindowNotifier.js +4 -4
  137. package/vscode/src/vs/workbench/contrib/chat/browser/claudePluginRecommendations.js +2 -2
  138. package/vscode/src/vs/workbench/contrib/chat/browser/defaultModelContribution.js +4 -4
  139. package/vscode/src/vs/workbench/contrib/chat/browser/enablementActions.js +4 -4
  140. package/vscode/src/vs/workbench/contrib/chat/browser/enablementStatusWidget.js +2 -2
  141. package/vscode/src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.js +1 -1
  142. package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.d.ts +3 -6
  143. package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.js +54 -39
  144. package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.js +16 -16
  145. package/vscode/src/vs/workbench/contrib/chat/browser/pluginUrlHandler.d.ts +24 -3
  146. package/vscode/src/vs/workbench/contrib/chat/browser/pluginUrlHandler.js +72 -14
  147. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +6 -6
  148. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.js +26 -26
  149. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.js +3 -3
  150. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionOverlay.js +2 -2
  151. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptFileContributions.js +181 -0
  152. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js +3 -3
  153. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptUrlHandler.js +8 -8
  154. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.js +7 -7
  155. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.js +3 -3
  156. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/skillActions.js +3 -3
  157. package/vscode/src/vs/workbench/contrib/chat/browser/promptsDebugContribution.js +8 -6
  158. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.js +37 -37
  159. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.js +28 -23
  160. package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.js +6 -6
  161. package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.js +7 -7
  162. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +5 -5
  163. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.js +9 -9
  164. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatStatusWidget.js +6 -6
  165. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletionUtils.d.ts +12 -0
  166. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletionUtils.js +62 -0
  167. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.d.ts +1 -10
  168. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.js +148 -88
  169. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorContrib.js +1 -1
  170. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorHover.js +1 -1
  171. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/chatQuick.js +1 -1
  172. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditor.js +1 -1
  173. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.d.ts +1 -0
  174. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.js +16 -9
  175. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.js +2 -2
  176. package/vscode/src/vs/workbench/contrib/chat/common/chatArtifactExtraction.d.ts +8 -0
  177. package/vscode/src/vs/workbench/contrib/chat/common/chatArtifactExtraction.js +158 -0
  178. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.d.ts +8 -3
  179. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.js +155 -76
  180. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceTelemetry.js +1 -2
  181. package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionOperationLog.js +5 -4
  182. package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.d.ts +5 -1
  183. package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.js +7 -6
  184. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.d.ts +31 -1
  185. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.js +228 -1
  186. package/vscode/src/vs/workbench/contrib/chat/common/plugins/fileBackedInstalledPluginsStore.d.ts +66 -0
  187. package/vscode/src/vs/workbench/contrib/chat/common/plugins/fileBackedInstalledPluginsStore.js +190 -0
  188. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.d.ts +25 -3
  189. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.js +130 -107
  190. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.d.ts +1 -0
  191. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +19 -18
  192. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.js +5 -5
  193. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +5 -5
  194. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.js +12 -12
  195. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.d.ts +2 -18
  196. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.js +169 -266
  197. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.d.ts +12 -10
  198. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.js +149 -206
  199. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts +3 -3
  200. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +27 -22
  201. package/vscode/src/vs/workbench/contrib/chat/common/tools/chatArtifactsService.d.ts +20 -8
  202. package/vscode/src/vs/workbench/contrib/chat/common/tools/chatArtifactsService.js +183 -43
  203. package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +1 -1
  204. package/vscode/src/vs/workbench/contrib/chat/common/widget/chatResponseResourceFileSystemProvider.js +1 -1
  205. package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/aiEditTelemetry/aiEditTelemetryServiceImpl.js +2 -3
  206. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +4 -4
  207. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +21 -21
  208. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatDefaultModel.js +2 -2
  209. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +11 -11
  210. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.js +14 -14
  211. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.js +1 -1
  212. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +11 -11
  213. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +6 -6
  214. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +1 -1
  215. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookModifiedCellDecorator.d.ts +1 -1
  216. package/vscode/src/vs/workbench/contrib/remoteCodingAgents/browser/remoteCodingAgents.contribution.js +7 -7
  217. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.js +16 -16
  218. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +20 -20
  219. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.js +2 -2
  220. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +1 -1
  221. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.js +3 -1
  222. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.js +4 -2
  223. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.js +3 -2
  224. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +6 -6
  225. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.d.ts +1 -0
  226. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.js +1 -0
  227. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.d.ts +1 -3
  228. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +26 -23
  229. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/awaitTerminalTool.js +3 -3
  230. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.js +1 -1
  231. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +12 -12
  232. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +2 -2
  233. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.js +4 -9
  234. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalLastCommandTool.js +3 -3
  235. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +16 -6
  236. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalSelectionTool.js +3 -3
  237. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/killTerminalTool.js +3 -3
  238. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +9 -9
  239. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +2 -2
  240. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +150 -50
  241. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.js +2 -2
  242. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/createAndRunTaskTool.js +14 -14
  243. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/getTaskOutputTool.js +7 -7
  244. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/runTaskTool.js +14 -14
  245. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.js +1 -1
  246. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.d.ts +66 -5
  247. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +239 -48
  248. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.d.ts +0 -14
  249. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.js +0 -208
  250. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.d.ts +0 -22
  251. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.js +0 -637
  252. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.d.ts +0 -24
  253. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.js +0 -384
  254. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/internalCustomizations/internalCustomizations.d.ts +0 -33
  255. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/internalCustomizations/internalCustomizations.js +0 -47
  256. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/internalCustomizations/internalSkill.d.ts +0 -30
  257. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/promptFileContributions.js +0 -55
  258. /package/vscode/src/vs/workbench/contrib/chat/{common → browser}/promptSyntax/promptFileContributions.d.ts +0 -0
@@ -10,8 +10,8 @@ const GetTerminalOutputToolData = {
10
10
  id: TerminalToolId.GetTerminalOutput,
11
11
  toolReferenceName: "getTerminalOutput",
12
12
  legacyToolReferenceFullNames: ["runCommands/getTerminalOutput"],
13
- displayName: ( localize(13820, "Get Terminal Output")),
14
- modelDescription: `Get the output of a terminal command previously started with ${TerminalToolId.RunInTerminal}`,
13
+ displayName: ( localize(13884, "Get Terminal Output")),
14
+ modelDescription: `Get the output of a background terminal command previously started with ${TerminalToolId.RunInTerminal}. The ID must be the exact opaque value returned by ${TerminalToolId.RunInTerminal} when isBackground=true; terminal names, labels, and integers are not valid IDs.`,
15
15
  icon: Codicon.terminal,
16
16
  source: ToolDataSource.Internal,
17
17
  inputSchema: {
@@ -19,7 +19,8 @@ const GetTerminalOutputToolData = {
19
19
  properties: {
20
20
  id: {
21
21
  type: "string",
22
- description: "The ID of the terminal to check."
22
+ description: `The ID of the background terminal to check (returned by ${TerminalToolId.RunInTerminal} when isBackground=true). This must be the exact opaque ID returned by that tool; terminal names, labels, or integers are invalid.`,
23
+ pattern: "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
23
24
  }
24
25
  },
25
26
  required: ["id"]
@@ -28,16 +29,25 @@ const GetTerminalOutputToolData = {
28
29
  class GetTerminalOutputTool extends Disposable {
29
30
  async prepareToolInvocation(context, token) {
30
31
  return {
31
- invocationMessage: ( localize(13821, "Checking background terminal output")),
32
- pastTenseMessage: ( localize(13822, "Checked background terminal output"))
32
+ invocationMessage: ( localize(13885, "Checking background terminal output")),
33
+ pastTenseMessage: ( localize(13886, "Checked background terminal output"))
33
34
  };
34
35
  }
35
36
  async invoke(invocation, _countTokens, _progress, token) {
36
37
  const args = invocation.parameters;
38
+ const execution = RunInTerminalTool.getExecution(args.id);
39
+ if (!execution) {
40
+ return {
41
+ content: [{
42
+ kind: "text",
43
+ value: `Error: No active terminal execution found with ID ${args.id}. The ID must be the exact value returned by ${TerminalToolId.RunInTerminal} for a background command.`
44
+ }]
45
+ };
46
+ }
37
47
  return {
38
48
  content: [{
39
49
  kind: "text",
40
- value: `Output of terminal ${args.id}:\n${RunInTerminalTool.getBackgroundOutput(args.id)}`
50
+ value: `Output of terminal ${args.id}:\n${execution.getOutput()}`
41
51
  }]
42
52
  };
43
53
  }
@@ -11,7 +11,7 @@ const GetTerminalSelectionToolData = {
11
11
  id: TerminalToolId.TerminalSelection,
12
12
  toolReferenceName: "terminalSelection",
13
13
  legacyToolReferenceFullNames: ["runCommands/terminalSelection"],
14
- displayName: ( localize(13823, "Get Terminal Selection")),
14
+ displayName: ( localize(13887, "Get Terminal Selection")),
15
15
  modelDescription: "Get the current selection in the active terminal.",
16
16
  source: ToolDataSource.Internal,
17
17
  icon: Codicon.terminal
@@ -23,8 +23,8 @@ let GetTerminalSelectionTool = class GetTerminalSelectionTool extends Disposable
23
23
  }
24
24
  async prepareToolInvocation(context, token) {
25
25
  return {
26
- invocationMessage: ( localize(13824, "Reading terminal selection")),
27
- pastTenseMessage: ( localize(13825, "Read terminal selection"))
26
+ invocationMessage: ( localize(13888, "Reading terminal selection")),
27
+ pastTenseMessage: ( localize(13889, "Read terminal selection"))
28
28
  };
29
29
  }
30
30
  async invoke(invocation, _countTokens, _progress, token) {
@@ -9,7 +9,7 @@ import { TerminalToolId } from './toolIds.js';
9
9
  const KillTerminalToolData = {
10
10
  id: TerminalToolId.KillTerminal,
11
11
  toolReferenceName: "killTerminal",
12
- displayName: ( localize(13826, "Kill Terminal")),
12
+ displayName: ( localize(13890, "Kill Terminal")),
13
13
  modelDescription: `Kill a terminal by its ID. Use this to clean up terminals that are no longer needed (e.g., after stopping a server or when a long-running task completes). The terminal ID is returned by ${TerminalToolId.RunInTerminal} when isBackground=true.`,
14
14
  icon: Codicon.terminal,
15
15
  source: ToolDataSource.Internal,
@@ -27,8 +27,8 @@ const KillTerminalToolData = {
27
27
  class KillTerminalTool extends Disposable {
28
28
  async prepareToolInvocation(_context, _token) {
29
29
  return {
30
- invocationMessage: ( localize(13827, "Killing terminal")),
31
- pastTenseMessage: ( localize(13828, "Killed terminal"))
30
+ invocationMessage: ( localize(13891, "Killing terminal")),
31
+ pastTenseMessage: ( localize(13892, "Killed terminal"))
32
32
  };
33
33
  }
34
34
  async invoke(invocation, _countTokens, _progress, _token) {
@@ -683,11 +683,11 @@ let OutputMonitor = class OutputMonitor extends Disposable {
683
683
  const {
684
684
  promise: userPrompt,
685
685
  part
686
- } = this._createElicitationPart(token, execution.sessionResource, ( new MarkdownString(( localize(13829, "The terminal is awaiting input.")))), ( new MarkdownString(( localize(
687
- 13830,
686
+ } = this._createElicitationPart(token, execution.sessionResource, ( new MarkdownString(( localize(13893, "The terminal is awaiting input.")))), ( new MarkdownString(( localize(
687
+ 13894,
688
688
  "{0}\nPlease provide the required input to the terminal.\n\n",
689
689
  confirmationPrompt.prompt
690
- )))), "", ( localize(13831, "Focus terminal")), undefined, () => {
690
+ )))), "", ( localize(13895, "Focus terminal")), undefined, () => {
691
691
  this._showInstance(execution.instance.instanceId);
692
692
  return focusTerminalSelection;
693
693
  });
@@ -740,13 +740,13 @@ let OutputMonitor = class OutputMonitor extends Disposable {
740
740
  const {
741
741
  promise: userPrompt,
742
742
  part
743
- } = this._createElicitationPart(token, execution.sessionResource, ( new MarkdownString(( localize(13832, "The terminal is awaiting input.")))), ( new MarkdownString(( localize(
744
- 13833,
743
+ } = this._createElicitationPart(token, execution.sessionResource, ( new MarkdownString(( localize(13896, "The terminal is awaiting input.")))), ( new MarkdownString(( localize(
744
+ 13897,
745
745
  "{0}\n Do you want to send `{1}`{2} followed by `Enter` to the terminal?",
746
746
  confirmationPrompt.prompt,
747
747
  suggestedOptionValue,
748
748
  isString(suggestedOption) ? "" : suggestedOption.description ? " (" + suggestedOption.description + ")" : ""
749
- )))), "", ( localize(13834, "Allow")), ( localize(13835, "Focus Terminal")), async value => {
749
+ )))), "", ( localize(13898, "Allow")), ( localize(13899, "Focus Terminal")), async value => {
750
750
  let option = undefined;
751
751
  if (value === true) {
752
752
  option = suggestedOptionValue;
@@ -1001,9 +1001,9 @@ function detectsNonInteractiveHelpPattern(cursorLine) {
1001
1001
  ].some(e => e.test(cursorLine)));
1002
1002
  }
1003
1003
  const taskFinishMessages = [(
1004
- localize(13836, "Terminal will be reused by tasks, press any key to close it.")), ( localize(13837, "Terminal will be reused by tasks, press any key to close it.")), (
1005
- localize(13838, "Press any key to close the terminal.")), ( localize(13839, "Press any key to close the terminal.")), (
1006
- localize(13840, "The terminal will be reused by tasks. Press any key to close."))];
1004
+ localize(13900, "Terminal will be reused by tasks, press any key to close it.")), ( localize(13901, "Terminal will be reused by tasks, press any key to close it.")), (
1005
+ localize(13902, "Press any key to close the terminal.")), ( localize(13903, "Press any key to close the terminal.")), (
1006
+ localize(13904, "The terminal will be reused by tasks. Press any key to close."))];
1007
1007
  const normalizedTaskFinishMessages = ( taskFinishMessages.map(msg => msg.replace(/[\s.,:;!?"'`()[\]{}<>\-_/\\]+/g, "").toLowerCase()));
1008
1008
  function detectsVSCodeTaskFinishMessage(cursorLine) {
1009
1009
  const compact = cursorLine.replace(/[\s.,:;!?"'`()[\]{}<>\-_/\\]+/g, "").toLowerCase();
@@ -7,7 +7,7 @@ import { TerminalToolId } from './toolIds.js';
7
7
 
8
8
  const ConfirmTerminalCommandToolData = {
9
9
  id: TerminalToolId.ConfirmTerminalCommand,
10
- displayName: ( localize(13841, "Confirm Terminal Command")),
10
+ displayName: ( localize(13905, "Confirm Terminal Command")),
11
11
  modelDescription: [
12
12
  "This tool allows you to get explicit user confirmation for a terminal command without executing it.",
13
13
  "",
@@ -25,7 +25,7 @@ const ConfirmTerminalCommandToolData = {
25
25
  "",
26
26
  "After confirmation, use a tool to actually execute the command."
27
27
  ].join("\n"),
28
- userDescription: ( localize(13842, "Tool for confirming terminal commands")),
28
+ userDescription: ( localize(13906, "Tool for confirming terminal commands")),
29
29
  source: ToolDataSource.Internal,
30
30
  icon: Codicon.shield,
31
31
  inputSchema: {
@@ -5,7 +5,7 @@ import { CancellationTokenSource } from '@codingame/monaco-vscode-api/vscode/vs/
5
5
  import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
6
6
  import { CancellationError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
7
7
  import { Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
8
- import { MarkdownString, escapeMarkdownSyntaxTokens } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
8
+ import { MarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
9
9
  import { Disposable, MutableDisposable, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
10
10
  import { ResourceMap } from '@codingame/monaco-vscode-api/vscode/vs/base/common/map';
11
11
  import { getMediaMime } from '@codingame/monaco-vscode-api/vscode/vs/base/common/mime';
@@ -65,9 +65,12 @@ import { TerminalChatCommandId } from '@codingame/monaco-vscode-xterm-common/vsc
65
65
  import { clamp } from '@codingame/monaco-vscode-api/vscode/vs/base/common/numbers';
66
66
  import { SandboxOutputAnalyzer } from './sandboxOutputAnalyzer.js';
67
67
  import { IAgentSessionsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.service';
68
+ import { TerminalSandboxPrerequisiteCheck } from '../../common/terminalSandboxService.js';
68
69
  import { ITerminalSandboxService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.service';
70
+ import { LanguageModelPartAudience } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/languageModels';
69
71
 
70
72
  var RunInTerminalTool_1;
73
+ const TERMINAL_SANDBOX_DOCUMENTATION_URL = "https://aka.ms/vscode-sandboxing";
71
74
  const TOOL_REFERENCE_NAME = "runInTerminal";
72
75
  const LEGACY_TOOL_REFERENCE_FULL_NAMES = ["runCommands/runInTerminal"];
73
76
  function createPowerShellModelDescription(shell, isSandboxEnabled, networkDomains) {
@@ -114,7 +117,8 @@ function createPowerShellModelDescription(shell, isSandboxEnabled, networkDomain
114
117
  "- Prefer idiomatic PowerShell like Get-ChildItem instead of dir or ls for file listings",
115
118
  "- Use Test-Path to check file/directory existence",
116
119
  "- Be specific with Select-Object properties to avoid excessive output",
117
- "- Avoid printing credentials unless absolutely required"
120
+ "- Avoid printing credentials unless absolutely required",
121
+ `- NEVER run Start-Sleep or similar wait commands. If you need to wait for a background process, use ${TerminalToolId.AwaitTerminal} or ${TerminalToolId.GetTerminalOutput} instead`
118
122
  );
119
123
  return parts.join("\n");
120
124
  }
@@ -184,7 +188,8 @@ Best Practices:
184
188
  - Quote variables: "$var" instead of $var to handle spaces
185
189
  - Use find with -exec or xargs for file operations
186
190
  - Be specific with commands to avoid excessive output
187
- - Avoid printing credentials unless absolutely required`);
191
+ - Avoid printing credentials unless absolutely required
192
+ - NEVER run sleep or similar wait commands in a terminal. If you need to wait for a background process, use ${TerminalToolId.AwaitTerminal} or ${TerminalToolId.GetTerminalOutput} instead`);
188
193
  return parts.join("");
189
194
  }
190
195
  function createBashModelDescription(isSandboxEnabled, networkDomains) {
@@ -245,9 +250,9 @@ async function createRunInTerminalToolData(accessor) {
245
250
  id: TerminalToolId.RunInTerminal,
246
251
  toolReferenceName: TOOL_REFERENCE_NAME,
247
252
  legacyToolReferenceFullNames: LEGACY_TOOL_REFERENCE_FULL_NAMES,
248
- displayName: ( localize(13843, "Run in Terminal")),
253
+ displayName: ( localize(13907, "Run in Terminal")),
249
254
  modelDescription,
250
- userDescription: ( localize(13844, "Run commands in the terminal")),
255
+ userDescription: ( localize(13908, "Run commands in the terminal")),
251
256
  source: ToolDataSource.Internal,
252
257
  icon: Codicon.terminal,
253
258
  inputSchema: {
@@ -267,7 +272,7 @@ async function createRunInTerminalToolData(accessor) {
267
272
  },
268
273
  isBackground: {
269
274
  type: "boolean",
270
- description: `Whether the command starts a background process.\n\n- If true, a new shell will be spawned where the cwd is the workspace directory and will run asynchronously in the background and you will not see the output.\n\n- If false, a single shell is shared between all non-background terminals where the cwd starts at the workspace directory and is remembered until that terminal is moved to the background, the tool call will block on the command finishing and only then you will get the output.\n\nExamples of background processes: building in watch mode, starting a server. You can check the output of a background process later on by using ${TerminalToolId.GetTerminalOutput}.`
275
+ description: `Whether the command starts a background process.\n\n- If true, a new shell will be spawned where the cwd is the workspace directory and will run asynchronously in the background and you will not see the output.\n\n- If false, a single shell is shared between all non-background terminals where the cwd starts at the workspace directory and is remembered until that terminal is moved to the background, the tool call will block on the command finishing and only then you will get the output.\n\nExamples of background processes: building in watch mode, starting a server. You can check the output of a background process later on by using ${TerminalToolId.GetTerminalOutput}. If unsure whether a command will be long-running, prefer isBackground=true.`
271
276
  },
272
277
  timeout: {
273
278
  type: "number",
@@ -284,7 +289,7 @@ async function createRunInTerminalToolData(accessor) {
284
289
  }
285
290
  } : {})
286
291
  },
287
- required: ["command", "explanation", "goal", "isBackground", "timeout"]
292
+ required: ["command", "explanation", "goal", "isBackground"]
288
293
  }
289
294
  };
290
295
  }
@@ -295,7 +300,7 @@ var TerminalToolStorageKeysInternal;
295
300
  const telemetryIgnoredSequences = [
296
301
  "\u001b[I",
297
302
  "\u001b[O"];
298
- const altBufferMessage = "\n" + ( localize(13845, "The command opened the alternate buffer."));
303
+ const altBufferMessage = "\n" + ( localize(13909, "The command opened the alternate buffer."));
299
304
  let RunInTerminalTool = class RunInTerminalTool extends Disposable {
300
305
  static {
301
306
  RunInTerminalTool_1 = this;
@@ -425,7 +430,7 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
425
430
  this._removeTerminalAssociations(e);
426
431
  }));
427
432
  this._register(this._chatService.onDidDisposeSession(e => {
428
- for (const resource of e.sessionResource) {
433
+ for (const resource of e.sessionResources) {
429
434
  this._cleanupSessionTerminals(resource);
430
435
  }
431
436
  }));
@@ -435,13 +440,13 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
435
440
  if (partialInput && typeof partialInput === "object" && partialInput.command) {
436
441
  const normalizedCommand = normalizeTerminalCommandForDisplay(partialInput.command).replace(/\r\n|\r|\n/g, " ");
437
442
  const truncatedCommand = normalizedCommand.length > 80 ? normalizedCommand.substring(0, 77) + "..." : normalizedCommand;
438
- const invocationMessage = partialInput.isBackground ? ( new MarkdownString(( localize(13846, "Running `{0}` in background", truncatedCommand)))) : ( new MarkdownString(( localize(13847, "Running `{0}`", truncatedCommand))));
443
+ const invocationMessage = partialInput.isBackground ? ( new MarkdownString(( localize(13910, "Running `{0}` in background", truncatedCommand)))) : ( new MarkdownString(( localize(13911, "Running `{0}`", truncatedCommand))));
439
444
  return {
440
445
  invocationMessage
441
446
  };
442
447
  }
443
448
  return {
444
- invocationMessage: ( localize(13848, "Running command"))
449
+ invocationMessage: ( localize(13912, "Running command"))
445
450
  };
446
451
  }
447
452
  async prepareToolInvocation(context, token) {
@@ -454,7 +459,7 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
454
459
  instance = toolTerminal.instance;
455
460
  }
456
461
  }
457
- const [os, shell, cwd, isTerminalSandboxEnabled] = await Promise.all([this._osBackend, this._profileFetcher.getCopilotShell(), (async () => {
462
+ const [os, shell, cwd, sandboxPrereqs] = await Promise.all([this._osBackend, this._profileFetcher.getCopilotShell(), (async () => {
458
463
  let cwd = await instance?.getCwdResource();
459
464
  if (!cwd) {
460
465
  const activeWorkspaceRootUri = this._historyService.getLastActiveWorkspaceRoot();
@@ -462,9 +467,11 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
462
467
  cwd = workspaceFolder?.uri;
463
468
  }
464
469
  return cwd;
465
- })(), this._terminalSandboxService.isEnabled()]);
470
+ })(), this._terminalSandboxService.checkForSandboxingPrereqs()]);
466
471
  const language = os === OperatingSystem.Windows ? "pwsh" : "sh";
472
+ const isTerminalSandboxEnabled = sandboxPrereqs.enabled;
467
473
  const requiresUnsandboxConfirmation = isTerminalSandboxEnabled && args.requestUnsandboxedExecution === true;
474
+ const missingDependencies = sandboxPrereqs.failedCheck === TerminalSandboxPrerequisiteCheck.Dependencies && sandboxPrereqs.missingDependencies?.length ? sandboxPrereqs.missingDependencies : undefined;
468
475
  const terminalToolSessionId = generateUuid();
469
476
  const terminalCommandId = `tool-${generateUuid()}`;
470
477
  let rewrittenCommand = args.command;
@@ -503,8 +510,22 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
503
510
  language,
504
511
  isBackground: args.isBackground,
505
512
  requestUnsandboxedExecution: requiresUnsandboxConfirmation,
506
- requestUnsandboxedExecutionReason: args.requestUnsandboxedExecutionReason
513
+ requestUnsandboxedExecutionReason: args.requestUnsandboxedExecutionReason,
514
+ missingSandboxDependencies: missingDependencies
507
515
  };
516
+ let sandboxConfirmationMessageForMissingDeps = undefined;
517
+ if (missingDependencies) {
518
+ const depsList = missingDependencies.join(", ");
519
+ sandboxConfirmationMessageForMissingDeps = {
520
+ title: ( localize(13913, "Missing Sandbox Dependencies")),
521
+ message: ( new MarkdownString(( localize(
522
+ 13914,
523
+ "The following dependencies required for sandboxed execution are not installed: {0}. Would you like to install them?",
524
+ depsList
525
+ )))),
526
+ customButtons: [( localize(13915, "Install")), ( localize(13916, "Cancel"))]
527
+ };
528
+ }
508
529
  const alternativeRecommendation = getRecommendedToolsOverRunInTerminal(args.command, this._languageModelToolsService);
509
530
  if (alternativeRecommendation) {
510
531
  toolSpecificData.alternativeRecommendation = alternativeRecommendation;
@@ -598,16 +619,16 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
598
619
  cdPrefix
599
620
  };
600
621
  confirmationTitle = args.isBackground ? ( localize(
601
- 13849,
622
+ 13917,
602
623
  "Run `{0}` command in background within `{1}`?",
603
624
  shellType,
604
625
  directoryLabel
605
- )) : ( localize(13850, "Run `{0}` command within `{1}`?", shellType, directoryLabel));
626
+ )) : ( localize(13918, "Run `{0}` command within `{1}`?", shellType, directoryLabel));
606
627
  } else {
607
628
  toolSpecificData.confirmation = {
608
629
  commandLine: commandToDisplay
609
630
  };
610
- confirmationTitle = args.isBackground ? ( localize(13851, "Run `{0}` command in background?", shellType)) : ( localize(13852, "Run `{0}` command?", shellType));
631
+ confirmationTitle = args.isBackground ? ( localize(13919, "Run `{0}` command in background?", shellType)) : ( localize(13920, "Run `{0}` command?", shellType));
611
632
  }
612
633
  const commandForPresenter = extractedCd?.command ?? commandToDisplay;
613
634
  let presenterInput = commandForPresenter;
@@ -626,31 +647,49 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
626
647
  language: presenterResult.language ?? undefined
627
648
  };
628
649
  if (extractedCd && toolSpecificData.confirmation?.cwdLabel) {
629
- confirmationTitle = args.isBackground ? ( localize(
630
- 13853,
631
- "Run `{0}` command in `{1}` in background within `{2}`?",
632
- presenterResult.languageDisplayName,
633
- shellType,
634
- toolSpecificData.confirmation.cwdLabel
635
- )) : ( localize(
636
- 13854,
637
- "Run `{0}` command in `{1}` within `{2}`?",
638
- presenterResult.languageDisplayName,
639
- shellType,
640
- toolSpecificData.confirmation.cwdLabel
641
- ));
650
+ if (presenterResult.languageDisplayName) {
651
+ confirmationTitle = args.isBackground ? ( localize(
652
+ 13921,
653
+ "Run `{0}` command in `{1}` in background within `{2}`?",
654
+ presenterResult.languageDisplayName,
655
+ shellType,
656
+ toolSpecificData.confirmation.cwdLabel
657
+ )) : ( localize(
658
+ 13922,
659
+ "Run `{0}` command in `{1}` within `{2}`?",
660
+ presenterResult.languageDisplayName,
661
+ shellType,
662
+ toolSpecificData.confirmation.cwdLabel
663
+ ));
664
+ } else {
665
+ confirmationTitle = args.isBackground ? ( localize(
666
+ 13923,
667
+ "Run command in `{0}` in background within `{1}`?",
668
+ shellType,
669
+ toolSpecificData.confirmation.cwdLabel
670
+ )) : ( localize(
671
+ 13924,
672
+ "Run command in `{0}` within `{1}`?",
673
+ shellType,
674
+ toolSpecificData.confirmation.cwdLabel
675
+ ));
676
+ }
642
677
  } else {
643
- confirmationTitle = args.isBackground ? ( localize(
644
- 13855,
645
- "Run `{0}` command in `{1}` in background?",
646
- presenterResult.languageDisplayName,
647
- shellType
648
- )) : ( localize(
649
- 13856,
650
- "Run `{0}` command in `{1}`?",
651
- presenterResult.languageDisplayName,
652
- shellType
653
- ));
678
+ if (presenterResult.languageDisplayName) {
679
+ confirmationTitle = args.isBackground ? ( localize(
680
+ 13925,
681
+ "Run `{0}` command in `{1}` in background?",
682
+ presenterResult.languageDisplayName,
683
+ shellType
684
+ )) : ( localize(
685
+ 13926,
686
+ "Run `{0}` command in `{1}`?",
687
+ presenterResult.languageDisplayName,
688
+ shellType
689
+ ));
690
+ } else {
691
+ confirmationTitle = args.isBackground ? ( localize(13927, "Run command in `{0}` in background?", shellType)) : ( localize(13928, "Run command in `{0}`?", shellType));
692
+ }
654
693
  }
655
694
  if (!presenterResult.processOtherPresenters) {
656
695
  break;
@@ -659,16 +698,26 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
659
698
  }
660
699
  }
661
700
  if (requiresUnsandboxConfirmation) {
662
- confirmationTitle = args.isBackground ? ( localize(13857, "Run `{0}` command outside the sandbox in background?", shellType)) : ( localize(13858, "Run `{0}` command outside the sandbox?", shellType));
701
+ confirmationTitle = args.isBackground ? ( localize(
702
+ 13929,
703
+ "Run `{0}` command outside the [sandbox]({1}) in background?",
704
+ shellType,
705
+ TERMINAL_SANDBOX_DOCUMENTATION_URL
706
+ )) : ( localize(
707
+ 13930,
708
+ "Run `{0}` command outside the [sandbox]({1})?",
709
+ shellType,
710
+ TERMINAL_SANDBOX_DOCUMENTATION_URL
711
+ ));
663
712
  }
664
713
  const shouldShowConfirmation = (!isFinalAutoApproved && !isSessionAutoApproved) || context.forceConfirmationReason !== undefined;
665
714
  const confirmationMessage = requiresUnsandboxConfirmation ? ( new MarkdownString(( localize(
666
- 13859,
715
+ 13931,
667
716
  "Explanation: {0}\n\nGoal: {1}\n\nReason for leaving the sandbox: {2}",
668
717
  args.explanation,
669
718
  args.goal,
670
- args.requestUnsandboxedExecutionReason || ( localize(13860, "The model indicated that this command needs unsandboxed access."))
671
- )))) : ( new MarkdownString(( localize(13861, "Explanation: {0}\n\nGoal: {1}", args.explanation, args.goal))));
719
+ args.requestUnsandboxedExecutionReason || ( localize(13932, "The model indicated that this command needs unsandboxed access."))
720
+ )))) : ( new MarkdownString(( localize(13933, "Explanation: {0}\n\nGoal: {1}", args.explanation, args.goal))));
672
721
  const confirmationMessages = shouldShowConfirmation ? {
673
722
  title: confirmationTitle,
674
723
  message: confirmationMessage,
@@ -678,12 +727,11 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
678
727
  } : undefined;
679
728
  const rawDisplayCommand = toolSpecificData.commandLine.forDisplay ?? toolSpecificData.commandLine.toolEdited ?? toolSpecificData.commandLine.original;
680
729
  const displayCommand = rawDisplayCommand.length > 80 ? rawDisplayCommand.substring(0, 77) + "..." : rawDisplayCommand;
681
- const escapedDisplayCommand = escapeMarkdownSyntaxTokens(displayCommand);
682
- const invocationMessage = toolSpecificData.commandLine.isSandboxWrapped ? args.isBackground ? ( new MarkdownString(( localize(13862, "Running `{0}` in sandbox in background", escapedDisplayCommand)))) : ( new MarkdownString(( localize(13863, "Running `{0}` in sandbox", escapedDisplayCommand)))) : args.isBackground ? ( new MarkdownString(( localize(13864, "Running `{0}` in background", escapedDisplayCommand)))) : ( new MarkdownString(( localize(13865, "Running `{0}`", escapedDisplayCommand))));
730
+ const invocationMessage = toolSpecificData.commandLine.isSandboxWrapped ? args.isBackground ? ( new MarkdownString(( localize(13934, "Running `{0}` in sandbox in background", displayCommand)))) : ( new MarkdownString(( localize(13935, "Running `{0}` in sandbox", displayCommand)))) : args.isBackground ? ( new MarkdownString(( localize(13936, "Running `{0}` in background", displayCommand)))) : ( new MarkdownString(( localize(13937, "Running `{0}`", displayCommand))));
683
731
  return {
684
732
  invocationMessage,
685
733
  icon: toolSpecificData.commandLine.isSandboxWrapped ? Codicon.terminalSecure : Codicon.terminal,
686
- confirmationMessages,
734
+ confirmationMessages: sandboxConfirmationMessageForMissingDeps ?? confirmationMessages,
687
735
  toolSpecificData
688
736
  };
689
737
  }
@@ -717,6 +765,56 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
717
765
  }]
718
766
  };
719
767
  }
768
+ if (toolSpecificData.missingSandboxDependencies?.length) {
769
+ const installButton = ( localize(13915, "Install"));
770
+ if (invocation.selectedCustomButton === installButton) {
771
+ const sessionResource = invocation.context.sessionResource;
772
+ const {
773
+ exitCode
774
+ } = await this._terminalSandboxService.installMissingSandboxDependencies(toolSpecificData.missingSandboxDependencies, sessionResource, token, {
775
+ createTerminal: async () => this._terminalService.createTerminal({}),
776
+ focusTerminal: async terminal => {
777
+ this._terminalService.setActiveInstance(terminal);
778
+ await this._terminalService.revealTerminal(terminal, true);
779
+ terminal.focus();
780
+ }
781
+ });
782
+ if (exitCode !== undefined && exitCode !== 0) {
783
+ return {
784
+ content: [{
785
+ kind: "text",
786
+ value: ( localize(
787
+ 13938,
788
+ "Sandbox dependency installation failed (exit code {0}). The command was not executed.",
789
+ exitCode
790
+ ))
791
+ }]
792
+ };
793
+ }
794
+ if (exitCode === undefined) {
795
+ return {
796
+ content: [{
797
+ kind: "text",
798
+ value: ( localize(
799
+ 13939,
800
+ "Could not determine whether sandbox dependency installation succeeded. The command was not executed."
801
+ ))
802
+ }]
803
+ };
804
+ }
805
+ this._logService.info(
806
+ "RunInTerminalTool: Sandbox dependency installation succeeded, proceeding with command execution"
807
+ );
808
+ } else {
809
+ this._logService.info("RunInTerminalTool: User cancelled sandbox dependency installation");
810
+ return {
811
+ content: [{
812
+ kind: "text",
813
+ value: ( localize(13940, "Sandbox dependency installation was cancelled by the user."))
814
+ }]
815
+ };
816
+ }
817
+ }
720
818
  const args = invocation.parameters;
721
819
  this._logService.debug(`RunInTerminalTool: Invoking with options ${JSON.stringify(args)}`);
722
820
  let toolResultMessage;
@@ -1009,6 +1107,7 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
1009
1107
  didUserEditCommand,
1010
1108
  didToolEditCommand,
1011
1109
  isBackground: args.isBackground,
1110
+ isSandboxWrapped: toolSpecificData.commandLine.isSandboxWrapped === true,
1012
1111
  shellIntegrationQuality: toolTerminal.shellIntegrationQuality,
1013
1112
  error,
1014
1113
  isNewSession,
@@ -1052,7 +1151,7 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
1052
1151
  }
1053
1152
  if (didTimeout && timeoutValue !== undefined && timeoutValue > 0) {
1054
1153
  resultText.push(
1055
- `Note: Command timed out after ${timeoutValue}ms. Output collected so far is shown below and the command may still be running in terminal ID ${termId}.\n\n`
1154
+ `Note: Command timed out after ${timeoutValue}ms and was moved to the background. The command may still be running in terminal ID ${termId}. Use ${TerminalToolId.AwaitTerminal} to wait for it to complete or ${TerminalToolId.GetTerminalOutput} to check its current output. Do NOT use sleep or manual polling to wait.\n\n`
1056
1155
  );
1057
1156
  }
1058
1157
  const outputAnalyzerMessage = await this._getOutputAnalyzerMessage(exitCode, terminalResult, command, didSandboxWrapCommand);
@@ -1139,7 +1238,8 @@ let RunInTerminalTool = class RunInTerminalTool extends Disposable {
1139
1238
  value: {
1140
1239
  mimeType,
1141
1240
  data: fileContent.value
1142
- }
1241
+ },
1242
+ audience: [LanguageModelPartAudience.User]
1143
1243
  });
1144
1244
  } catch {}
1145
1245
  }
@@ -20,10 +20,10 @@ let SandboxOutputAnalyzer = class SandboxOutputAnalyzer extends Disposable {
20
20
  return undefined;
21
21
  }
22
22
  const os = await this._sandboxService.getOS();
23
- const fileSystemSetting = os === OperatingSystem.Linux ? TerminalChatAgentToolsSettingId.TerminalSandboxLinuxFileSystem : TerminalChatAgentToolsSettingId.TerminalSandboxMacFileSystem;
23
+ const fileSystemSetting = os === OperatingSystem.Linux ? TerminalChatAgentToolsSettingId.AgentSandboxLinuxFileSystem : TerminalChatAgentToolsSettingId.AgentSandboxMacFileSystem;
24
24
  const prefix = knownFailure ? "Command failed while running in sandboxed mode. If the command failed due to sandboxing:" : "Command ran in sandboxed mode and may have been blocked by the sandbox. If the command failed due to sandboxing:";
25
25
  return `${prefix}
26
- - If it would be reasonable to extend the sandbox rules, work with the user to update allowWrite for file system access problems in ${fileSystemSetting}, or to add required domains to ${TerminalChatAgentToolsSettingId.TerminalSandboxNetworkAllowedDomains}.
26
+ - If it would be reasonable to extend the sandbox rules, work with the user to update allowWrite for file system access problems in ${fileSystemSetting}, or to add required domains to ${TerminalChatAgentToolsSettingId.AgentSandboxNetworkAllowedDomains}.
27
27
  - Otherwise, immediately retry the command with requestUnsandboxedExecution=true. Do NOT ask the user — setting this flag automatically shows a confirmation prompt to the user.
28
28
 
29
29
  Here is the output of the command:\n`;
@@ -79,7 +79,7 @@ let CreateAndRunTaskTool = class CreateAndRunTaskTool {
79
79
  });
80
80
  }
81
81
  _progress.report({
82
- message: ( new MarkdownString(( localize(13866, "Resolving the task"))))
82
+ message: ( new MarkdownString(( localize(13941, "Resolving the task"))))
83
83
  });
84
84
  let task;
85
85
  const start = Date.now();
@@ -96,7 +96,7 @@ let CreateAndRunTaskTool = class CreateAndRunTaskTool {
96
96
  kind: "text",
97
97
  value: `Task not found: ${args.task.label}`
98
98
  }],
99
- toolResultMessage: ( new MarkdownString(( localize(13867, "Task not found: `{0}`", args.task.label))))
99
+ toolResultMessage: ( new MarkdownString(( localize(13942, "Task not found: `{0}`", args.task.label))))
100
100
  };
101
101
  }
102
102
  const preRunMarkersStore = ( new DisposableStore());
@@ -113,7 +113,7 @@ let CreateAndRunTaskTool = class CreateAndRunTaskTool {
113
113
  }
114
114
  }
115
115
  _progress.report({
116
- message: ( new MarkdownString(( localize(13868, "Running task `{0}`", args.task.label))))
116
+ message: ( new MarkdownString(( localize(13943, "Running task `{0}`", args.task.label))))
117
117
  });
118
118
  const raceResult = await Promise.race([
119
119
  this._tasksService.run(task, undefined, TaskRunSource.ChatAgent),
@@ -131,7 +131,7 @@ let CreateAndRunTaskTool = class CreateAndRunTaskTool {
131
131
  value: `Task started but no terminal was found for: ${args.task.label}`
132
132
  }],
133
133
  toolResultMessage: ( new MarkdownString(( localize(
134
- 13869,
134
+ 13944,
135
135
  "Task started but no terminal was found for: `{0}`",
136
136
  args.task.label
137
137
  ))))
@@ -201,26 +201,26 @@ let CreateAndRunTaskTool = class CreateAndRunTaskTool {
201
201
  const allTasks = await this._tasksService.tasks();
202
202
  if (allTasks?.find(t => t._label === task.label)) {
203
203
  return {
204
- invocationMessage: ( new MarkdownString(( localize(13870, "Task `{0}` already exists.", task.label)))),
205
- pastTenseMessage: ( new MarkdownString(( localize(13871, "Task `{0}` already exists.", task.label)))),
204
+ invocationMessage: ( new MarkdownString(( localize(13945, "Task `{0}` already exists.", task.label)))),
205
+ pastTenseMessage: ( new MarkdownString(( localize(13946, "Task `{0}` already exists.", task.label)))),
206
206
  confirmationMessages: undefined
207
207
  };
208
208
  }
209
209
  const activeTasks = await this._tasksService.getActiveTasks();
210
210
  if (activeTasks.find(t => t._label === task.label)) {
211
211
  return {
212
- invocationMessage: ( new MarkdownString(( localize(13872, "Task `{0}` is already running.", task.label)))),
213
- pastTenseMessage: ( new MarkdownString(( localize(13872, "Task `{0}` is already running.", task.label)))),
212
+ invocationMessage: ( new MarkdownString(( localize(13947, "Task `{0}` is already running.", task.label)))),
213
+ pastTenseMessage: ( new MarkdownString(( localize(13947, "Task `{0}` is already running.", task.label)))),
214
214
  confirmationMessages: undefined
215
215
  };
216
216
  }
217
217
  return {
218
- invocationMessage: ( new MarkdownString(( localize(13873, "Created task `{0}`", task.label)))),
219
- pastTenseMessage: ( new MarkdownString(( localize(13874, "Created task `{0}`", task.label)))),
218
+ invocationMessage: ( new MarkdownString(( localize(13948, "Created task `{0}`", task.label)))),
219
+ pastTenseMessage: ( new MarkdownString(( localize(13949, "Created task `{0}`", task.label)))),
220
220
  confirmationMessages: {
221
- title: ( localize(13875, "Allow task creation and execution?")),
221
+ title: ( localize(13950, "Allow task creation and execution?")),
222
222
  message: ( new MarkdownString(( localize(
223
- 13876,
223
+ 13951,
224
224
  "A task `{0}` with command `{1}`{2} will be created.",
225
225
  task.label,
226
226
  task.command,
@@ -235,9 +235,9 @@ const CreateAndRunTaskToolData = {
235
235
  id: TerminalToolId.CreateAndRunTask,
236
236
  toolReferenceName: "createAndRunTask",
237
237
  legacyToolReferenceFullNames: ["runTasks/createAndRunTask"],
238
- displayName: ( localize(13877, "Create and run Task")),
238
+ displayName: ( localize(13952, "Create and run Task")),
239
239
  modelDescription: "Creates and runs a build, run, or custom task for the workspace by generating or adding to a tasks.json file based on the project structure (such as package.json or README.md). If the user asks to build, run, launch and they have no tasks.json file, use this tool. If they ask to create or add a task, use this tool.",
240
- userDescription: ( localize(13878, "Create and run a task in the workspace")),
240
+ userDescription: ( localize(13953, "Create and run a task in the workspace")),
241
241
  source: ToolDataSource.Internal,
242
242
  inputSchema: {
243
243
  "type": "object",