@codingame/monaco-vscode-chat-service-override 28.4.0 → 29.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.
- package/index.js +18 -12
- package/package.json +5 -5
- package/vscode/src/vs/platform/agentHost/common/agentService.d.ts +300 -0
- package/vscode/src/vs/platform/agentHost/common/agentService.js +31 -0
- package/vscode/src/vs/platform/agentHost/common/agentService.service.d.ts +84 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/action-origin.generated.d.ts +16 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/actions.d.ts +488 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/commands.d.ts +424 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/errors.d.ts +50 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/messages.d.ts +202 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/notifications.d.ts +114 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/state.d.ts +723 -0
- package/vscode/src/vs/platform/agentHost/common/state/sessionActions.d.ts +33 -0
- package/vscode/src/vs/platform/agentHost/common/state/sessionProtocol.d.ts +40 -0
- package/vscode/src/vs/platform/agentHost/common/state/sessionState.d.ts +22 -0
- package/vscode/src/vs/platform/browserElements/common/browserElements.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityService.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.js +29 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +59 -59
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAgentRecommendationActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatForkActions.js +76 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatLanguageModelActions.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatNewActions.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatOpenAgentDebugPanelAction.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatOpenAgentDebugPanelAction.js +162 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPluginActions.js +167 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPromptNavigationActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQueueActions.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQueueActions.js +52 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +19 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginActions.d.ts +82 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginActions.js +195 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.d.ts +5 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.js +97 -88
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditorInput.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginItems.d.ts +4 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.d.ts +5 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.js +78 -35
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.d.ts +7 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.js +174 -170
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.js +7 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.js +118 -52
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsQuickAccess.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.d.ts +5 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.js +13 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjection.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionActions.d.ts +0 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionActions.js +5 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionsExperiments.contribution.js +9 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.d.ts +23 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.js +341 -196
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/media/agenttitlebarstatuswidget.css +79 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccess.js +17 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccessActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/localAgentSessionsController.d.ts +5 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/localAgentSessionsController.js +22 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.js +15 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.d.ts +85 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.js +668 -214
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidgetUtils.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidgetUtils.js +18 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.contribution.js +306 -39
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.d.ts +84 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.js +651 -81
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.js +6 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWorkspaceService.d.ts +31 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWorkspaceService.js +9 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCreatorService.d.ts +11 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCreatorService.js +7 -142
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationGroupHeaderRenderer.d.ts +43 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationGroupHeaderRenderer.js +63 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.js +44 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.d.ts +25 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.js +297 -123
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationManagement.css +153 -31
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.d.ts +17 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.js +111 -171
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.d.ts +1 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.js +5 -30
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/simpleBrowserEditorOverlay.js +19 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +277 -186
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.d.ts +4 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.js +31 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCollapsible.d.ts +3 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCollapsible.js +4 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugDetailPanel.d.ts +18 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugDetailPanel.js +112 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditor.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditor.js +16 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditorInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventDetailRenderer.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventDetailRenderer.js +41 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventList.d.ts +7 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventList.js +35 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFilters.d.ts +1 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFilters.js +8 -51
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowChartView.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowChartView.js +13 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowGraph.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowGraph.js +29 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowLayout.js +14 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHomeView.d.ts +5 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHomeView.js +79 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHookContentRenderer.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHookContentRenderer.js +125 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.d.ts +11 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.js +113 -82
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugMessageContentRenderer.d.ts +18 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugMessageContentRenderer.js +54 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugModelTurnContentRenderer.d.ts +8 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugModelTurnContentRenderer.js +103 -28
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugOverviewView.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugOverviewView.js +48 -37
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugToolCallContentRenderer.d.ts +28 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugToolCallContentRenderer.js +62 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/media/chatDebug.css +21 -37
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingDeletedFileEntry.js +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +4 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +17 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.d.ts +4 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +43 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatImageCarouselService.d.ts +59 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatImageCarouselService.js +194 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.js +9 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditor.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.js +8 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.js +81 -50
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatUsageWidget.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +32 -32
- package/vscode/src/vs/workbench/contrib/chat/browser/chatRepoInfo.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetup.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.js +23 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupGrowthSession.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupGrowthSession.js +9 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.js +29 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.js +19 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.d.ts +2 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.js +105 -172
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.js +80 -65
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipCatalog.js +56 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWindowNotifier.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/claudePluginRecommendations.d.ts +16 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/claudePluginRecommendations.js +70 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/defaultModelContribution.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/enablementActions.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/enablementActions.js +40 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/enablementStatusWidget.d.ts +31 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/enablementStatusWidget.js +53 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.js +33 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.d.ts +21 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.js +362 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.d.ts +15 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.js +90 -43
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginUrlHandler.d.ts +35 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginUrlHandler.js +146 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.js +26 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionOverlay.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptUrlHandler.js +10 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/skillActions.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/promptsDebugContribution.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/promptsDebugContribution.js +33 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.js +200 -55
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.js +90 -45
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.d.ts +4 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.js +21 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.js +22 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.d.ts +4 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.js +28 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatStatusWidget.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.js +20 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorContrib.js +68 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorHover.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/chatQuick.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditor.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.js +57 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.d.ts +21 -5
- package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.js +171 -57
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.d.ts +7 -5
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.js +206 -35
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionOperationLog.js +4 -3
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/common/participants/chatSlashCommands.d.ts +7 -1
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.d.ts +11 -3
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.d.ts +44 -22
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.js +450 -301
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/marketplaceReference.d.ts +23 -0
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/marketplaceReference.js +165 -0
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.d.ts +34 -20
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.js +209 -144
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/workspacePluginSettingsService.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/workspacePluginSettingsService.js +205 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +17 -17
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/internalCustomizations/internalCustomizations.d.ts +33 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/internalCustomizations/internalCustomizations.js +47 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/internalCustomizations/internalSkill.d.ts +30 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.js +191 -159
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.d.ts +6 -7
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.js +210 -233
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts +19 -26
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +183 -193
- package/vscode/src/vs/workbench/contrib/chat/common/tools/chatArtifactsService.d.ts +24 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/chatArtifactsService.js +75 -0
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +8 -5
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +97 -35
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatDefaultModel.js +2 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatHistoryService.d.ts +16 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatHistoryService.js +67 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +62 -23
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.js +14 -14
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +10 -10
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +5 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +1 -1
- package/vscode/src/vs/workbench/contrib/remoteCodingAgents/browser/remoteCodingAgents.contribution.js +8 -8
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.js +16 -16
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +20 -20
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +2 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.js +23 -9
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.js +2 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.js +50 -9
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.js +21 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/strategyHelpers.d.ts +20 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/strategyHelpers.js +124 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.js +20 -5
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +10 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.js +46 -31
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.d.ts +18 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +74 -37
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/awaitTerminalTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAnalyzer.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +24 -14
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +2 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineSandboxAnalyzer.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/sandboxedCommandLinePresenter.d.ts +3 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/sandboxedCommandLinePresenter.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineRewriter.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.js +5 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalLastCommandTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalSelectionTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/killTerminalTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.d.ts +1 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +66 -64
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/outputAnalyzer.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +5 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.d.ts +32 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +390 -114
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.d.ts +14 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.js +21 -11
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/createAndRunTaskTool.js +70 -51
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/getTaskOutputTool.js +61 -51
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/runTaskTool.js +94 -76
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.d.ts +19 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +112 -21
- package/vscode/src/vs/sessions/contrib/agentFeedback/browser/agentFeedbackService.d.ts +0 -53
- package/vscode/src/vs/sessions/contrib/agentFeedback/browser/agentFeedbackService.js +0 -219
- package/vscode/src/vs/sessions/contrib/chat/browser/aiCustomizationWorkspaceService.d.ts +0 -89
- package/vscode/src/vs/sessions/contrib/chat/browser/aiCustomizationWorkspaceService.js +0 -251
- package/vscode/src/vs/sessions/contrib/chat/browser/newSession.d.ts +0 -123
- package/vscode/src/vs/sessions/contrib/chat/browser/newSession.js +0 -278
- package/vscode/src/vs/sessions/contrib/chat/browser/sessionsConfigurationService.d.ts +0 -76
- package/vscode/src/vs/sessions/contrib/chat/browser/sessionsConfigurationService.js +0 -299
- package/vscode/src/vs/sessions/contrib/fileTreeView/browser/githubFileSystemProvider.d.ts +0 -67
- package/vscode/src/vs/sessions/contrib/fileTreeView/browser/githubFileSystemProvider.js +0 -263
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsManagementService.d.ts +0 -85
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsManagementService.js +0 -397
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.d.ts +0 -56
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.js +0 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/sessionResourceMatching.d.ts +0 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/sessionResourceMatching.js +0 -30
- package/vscode/src/vs/workbench/contrib/chat/common/aiCustomizationWorkspaceService.d.ts +0 -40
- package/vscode/src/vs/workbench/contrib/chat/common/aiCustomizationWorkspaceService.js +0 -28
- package/vscode/src/vs/workbench/contrib/chat/common/chatDebugService.d.ts +0 -190
- package/vscode/src/vs/workbench/contrib/chat/common/chatDebugService.js +0 -11
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.d.ts +0 -16
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.js +0 -20
|
@@ -47,6 +47,9 @@ function truncateOutputKeepingTail(output, maxLength) {
|
|
|
47
47
|
const endPortion = output.slice(-availableLength);
|
|
48
48
|
return TRUNCATION_MESSAGE + endPortion;
|
|
49
49
|
}
|
|
50
|
+
function normalizeTerminalCommandForDisplay(commandLine) {
|
|
51
|
+
return commandLine.replace(/\\(["'\/])/g, "$1");
|
|
52
|
+
}
|
|
50
53
|
function generateAutoApproveActions(commandLine, subCommands, autoApproveResult) {
|
|
51
54
|
const actions = [];
|
|
52
55
|
const canCreateAutoApproval = (autoApproveResult.subCommandResults.every(e => e.result !== "denied") && autoApproveResult.commandLineResult.result !== "denied");
|
|
@@ -152,7 +155,7 @@ function generateAutoApproveActions(commandLine, subCommands, autoApproveResult)
|
|
|
152
155
|
const firstSubcommandFirstWord = unapprovedSubCommands.length > 0 ? unapprovedSubCommands[0].split(" ")[0] : "";
|
|
153
156
|
if (firstSubcommandFirstWord !== commandLine && !( commandsWithSubcommands.has(commandLine)) && !( commandsWithSubSubCommands.has(commandLine))) {
|
|
154
157
|
actions.push({
|
|
155
|
-
label: ( localize(
|
|
158
|
+
label: ( localize(13792, "Allow Exact Command Line in this Session")),
|
|
156
159
|
data: {
|
|
157
160
|
type: "newRule",
|
|
158
161
|
rule: {
|
|
@@ -166,7 +169,7 @@ function generateAutoApproveActions(commandLine, subCommands, autoApproveResult)
|
|
|
166
169
|
}
|
|
167
170
|
});
|
|
168
171
|
actions.push({
|
|
169
|
-
label: ( localize(
|
|
172
|
+
label: ( localize(13793, "Allow Exact Command Line in this Workspace")),
|
|
170
173
|
data: {
|
|
171
174
|
type: "newRule",
|
|
172
175
|
rule: {
|
|
@@ -180,7 +183,7 @@ function generateAutoApproveActions(commandLine, subCommands, autoApproveResult)
|
|
|
180
183
|
}
|
|
181
184
|
});
|
|
182
185
|
actions.push({
|
|
183
|
-
label: ( localize(
|
|
186
|
+
label: ( localize(13794, "Always Allow Exact Command Line")),
|
|
184
187
|
data: {
|
|
185
188
|
type: "newRule",
|
|
186
189
|
rule: {
|
|
@@ -199,15 +202,15 @@ function generateAutoApproveActions(commandLine, subCommands, autoApproveResult)
|
|
|
199
202
|
actions.push(( new Separator()));
|
|
200
203
|
}
|
|
201
204
|
actions.push({
|
|
202
|
-
label: ( localize(
|
|
203
|
-
tooltip: ( localize(
|
|
205
|
+
label: ( localize(13795, "Allow All Commands in this Session")),
|
|
206
|
+
tooltip: ( localize(13796, "Allow this tool to run in this session without confirmation.")),
|
|
204
207
|
data: {
|
|
205
208
|
type: "sessionApproval"
|
|
206
209
|
}
|
|
207
210
|
});
|
|
208
211
|
actions.push(( new Separator()));
|
|
209
212
|
actions.push({
|
|
210
|
-
label: ( localize(
|
|
213
|
+
label: ( localize(13797, "Configure Auto Approve...")),
|
|
211
214
|
data: {
|
|
212
215
|
type: "configure"
|
|
213
216
|
}
|
|
@@ -243,4 +246,4 @@ function extractCdPrefix(commandLine, shell, os) {
|
|
|
243
246
|
return undefined;
|
|
244
247
|
}
|
|
245
248
|
|
|
246
|
-
export { TRUNCATION_MESSAGE, dedupeRules, extractCdPrefix, generateAutoApproveActions, isBash, isFish, isPowerShell, isWindowsPowerShell, isZsh, truncateOutputKeepingTail };
|
|
249
|
+
export { TRUNCATION_MESSAGE, dedupeRules, extractCdPrefix, generateAutoApproveActions, isBash, isFish, isPowerShell, isWindowsPowerShell, isZsh, normalizeTerminalCommandForDisplay, truncateOutputKeepingTail };
|
package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { Task } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/t
|
|
|
9
9
|
import { ITaskService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/tasks/common/taskService.service";
|
|
10
10
|
import { ITerminalInstance } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal";
|
|
11
11
|
import { IExecution, IPollingResult, OutputMonitorState } from "./tools/monitoring/types.js";
|
|
12
|
+
import type { IMarker as IXtermMarker } from "@xterm/xterm";
|
|
12
13
|
export declare function getTaskDefinition(id: string): {
|
|
13
14
|
taskLabel: string;
|
|
14
15
|
taskType: string;
|
|
@@ -50,7 +51,7 @@ export declare function resolveDependencyTasks(parentTask: Task, workspaceFolder
|
|
|
50
51
|
/**
|
|
51
52
|
* Collects output, polling duration, and idle status for all terminals.
|
|
52
53
|
*/
|
|
53
|
-
export declare function collectTerminalResults(terminals: ITerminalInstance[], task: Task, instantiationService: IInstantiationService, invocationContext: IToolInvocationContext, progress: ToolProgress, token: CancellationToken, disposableStore: DisposableStore, isActive?: (task: Task) => Promise<boolean>, dependencyTasks?: Task[], taskService?: ITaskService): Promise<Array<{
|
|
54
|
+
export declare function collectTerminalResults(terminals: ITerminalInstance[], task: Task, instantiationService: IInstantiationService, invocationContext: IToolInvocationContext, progress: ToolProgress, token: CancellationToken, disposableStore: DisposableStore, isActive?: (task: Task) => Promise<boolean>, dependencyTasks?: Task[], taskService?: ITaskService, startMarkersByTerminalInstanceId?: Map<number, IXtermMarker | undefined>): Promise<Array<{
|
|
54
55
|
name: string;
|
|
55
56
|
output: string;
|
|
56
57
|
resources?: ILinkLocation[];
|
package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.js
CHANGED
|
@@ -133,7 +133,8 @@ async function collectTerminalResults(
|
|
|
133
133
|
disposableStore,
|
|
134
134
|
isActive,
|
|
135
135
|
dependencyTasks,
|
|
136
|
-
taskService
|
|
136
|
+
taskService,
|
|
137
|
+
startMarkersByTerminalInstanceId
|
|
137
138
|
) {
|
|
138
139
|
const results = [];
|
|
139
140
|
if (token.isCancellationRequested) {
|
|
@@ -152,6 +153,7 @@ async function collectTerminalResults(
|
|
|
152
153
|
message: ( new MarkdownString(`Checking output for ${( terminalNames.map(n => `\`${n}\``)).join(", ")}`))
|
|
153
154
|
});
|
|
154
155
|
const terminalPromises = ( terminals.map(async instance => {
|
|
156
|
+
const startMarker = startMarkersByTerminalInstanceId ? startMarkersByTerminalInstanceId.get(instance.instanceId) : instance.registerMarker();
|
|
155
157
|
let terminalTask = task;
|
|
156
158
|
if (dependencyTasks?.length) {
|
|
157
159
|
const reconnectionData = instance.reconnectionProperties?.data;
|
|
@@ -170,7 +172,7 @@ async function collectTerminalResults(
|
|
|
170
172
|
}
|
|
171
173
|
}
|
|
172
174
|
const execution = {
|
|
173
|
-
getOutput:
|
|
175
|
+
getOutput: marker => getOutput(instance, marker ?? startMarker) ?? "",
|
|
174
176
|
task: terminalTask,
|
|
175
177
|
isActive: isActive ? () => isActive(terminalTask) : undefined,
|
|
176
178
|
instance,
|
|
@@ -188,38 +190,51 @@ async function collectTerminalResults(
|
|
|
188
190
|
await timeout(100);
|
|
189
191
|
}
|
|
190
192
|
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
193
|
+
try {
|
|
194
|
+
const hasProblemMatchers = terminalTask.configurationProperties.problemMatchers && terminalTask.configurationProperties.problemMatchers.length > 0;
|
|
195
|
+
const outputMonitor = disposableStore.add(instantiationService.createInstance(
|
|
196
|
+
OutputMonitor,
|
|
197
|
+
execution,
|
|
198
|
+
hasProblemMatchers ? taskProblemPollFn : undefined,
|
|
199
|
+
invocationContext,
|
|
200
|
+
token,
|
|
201
|
+
task._label
|
|
202
|
+
));
|
|
203
|
+
await Promise.race([
|
|
204
|
+
Event.toPromise(outputMonitor.onDidFinishCommand),
|
|
205
|
+
Event.toPromise(token.onCancellationRequested)
|
|
206
|
+
]);
|
|
207
|
+
const pollingResult = outputMonitor.pollingResult;
|
|
208
|
+
return {
|
|
209
|
+
name: instance.shellLaunchConfig.name ?? instance.title ?? "unknown",
|
|
210
|
+
output: pollingResult?.output ?? "",
|
|
211
|
+
pollDurationMs: pollingResult?.pollDurationMs ?? 0,
|
|
212
|
+
resources: pollingResult?.resources,
|
|
213
|
+
state: pollingResult?.state || OutputMonitorState.Idle,
|
|
214
|
+
inputToolManualAcceptCount: outputMonitor.outputMonitorTelemetryCounters.inputToolManualAcceptCount ?? 0,
|
|
215
|
+
inputToolManualRejectCount: outputMonitor.outputMonitorTelemetryCounters.inputToolManualRejectCount ?? 0,
|
|
216
|
+
inputToolManualChars: outputMonitor.outputMonitorTelemetryCounters.inputToolManualChars ?? 0,
|
|
217
|
+
inputToolAutoAcceptCount: outputMonitor.outputMonitorTelemetryCounters.inputToolAutoAcceptCount ?? 0,
|
|
218
|
+
inputToolAutoChars: outputMonitor.outputMonitorTelemetryCounters.inputToolAutoChars ?? 0,
|
|
219
|
+
inputToolManualShownCount: outputMonitor.outputMonitorTelemetryCounters.inputToolManualShownCount ?? 0,
|
|
220
|
+
inputToolFreeFormInputShownCount: outputMonitor.outputMonitorTelemetryCounters.inputToolFreeFormInputShownCount ?? 0,
|
|
221
|
+
inputToolFreeFormInputCount: outputMonitor.outputMonitorTelemetryCounters.inputToolFreeFormInputCount ?? 0
|
|
222
|
+
};
|
|
223
|
+
} finally {
|
|
224
|
+
startMarker?.dispose();
|
|
225
|
+
}
|
|
220
226
|
}));
|
|
221
227
|
const parallelResults = await Promise.all(terminalPromises);
|
|
222
228
|
results.push(...parallelResults);
|
|
229
|
+
if (startMarkersByTerminalInstanceId) {
|
|
230
|
+
const activeInstanceIds = ( new Set(( terminals.map(instance => instance.instanceId))));
|
|
231
|
+
for (const [instanceId, marker] of startMarkersByTerminalInstanceId) {
|
|
232
|
+
if (!( activeInstanceIds.has(instanceId))) {
|
|
233
|
+
marker?.dispose();
|
|
234
|
+
startMarkersByTerminalInstanceId.delete(instanceId);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
223
238
|
return results;
|
|
224
239
|
}
|
|
225
240
|
async function taskProblemPollFn(execution, token, taskService) {
|
|
@@ -1 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
2
|
+
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
3
|
+
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
4
|
+
import { type IWorkbenchContribution } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions";
|
|
5
|
+
import { ILanguageModelToolsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService.service";
|
|
6
|
+
import { ITrustedDomainService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/url/common/trustedDomainService.service";
|
|
7
|
+
export declare class ChatAgentToolsContribution extends Disposable implements IWorkbenchContribution {
|
|
8
|
+
private readonly _instantiationService;
|
|
9
|
+
private readonly _toolsService;
|
|
10
|
+
private readonly _configurationService;
|
|
11
|
+
private readonly _trustedDomainService;
|
|
12
|
+
static readonly ID = "terminal.chatAgentTools";
|
|
13
|
+
private readonly _runInTerminalToolRegistration;
|
|
14
|
+
private _runInTerminalToolRegistrationVersion;
|
|
15
|
+
constructor(_instantiationService: IInstantiationService, _toolsService: ILanguageModelToolsService, _configurationService: IConfigurationService, _trustedDomainService: ITrustedDomainService);
|
|
16
|
+
private _runInTerminalTool;
|
|
17
|
+
private _registerRunInTerminalTool;
|
|
18
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
3
|
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
4
|
-
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
4
|
+
import { Disposable, MutableDisposable, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
5
5
|
import { isNumber } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
6
6
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
7
7
|
import { MenuId } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
|
|
@@ -29,6 +29,7 @@ import { CreateAndRunTaskTool, CreateAndRunTaskToolData } from './tools/task/cre
|
|
|
29
29
|
import { GetTaskOutputTool, GetTaskOutputToolData } from './tools/task/getTaskOutputTool.js';
|
|
30
30
|
import { RunTaskTool, RunTaskToolData } from './tools/task/runTaskTool.js';
|
|
31
31
|
import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/extensions';
|
|
32
|
+
import { ITrustedDomainService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/url/common/trustedDomainService.service';
|
|
32
33
|
import '../common/terminalSandboxService.js';
|
|
33
34
|
|
|
34
35
|
let ShellIntegrationTimeoutMigrationContribution = class ShellIntegrationTimeoutMigrationContribution extends Disposable {
|
|
@@ -75,50 +76,84 @@ let ChatAgentToolsContribution = class ChatAgentToolsContribution extends Dispos
|
|
|
75
76
|
static {
|
|
76
77
|
this.ID = "terminal.chatAgentTools";
|
|
77
78
|
}
|
|
78
|
-
constructor(
|
|
79
|
+
constructor(
|
|
80
|
+
_instantiationService,
|
|
81
|
+
_toolsService,
|
|
82
|
+
_configurationService,
|
|
83
|
+
_trustedDomainService
|
|
84
|
+
) {
|
|
79
85
|
super();
|
|
80
|
-
|
|
86
|
+
this._instantiationService = _instantiationService;
|
|
87
|
+
this._toolsService = _toolsService;
|
|
88
|
+
this._configurationService = _configurationService;
|
|
89
|
+
this._trustedDomainService = _trustedDomainService;
|
|
90
|
+
this._runInTerminalToolRegistration = this._register(( new MutableDisposable()));
|
|
91
|
+
this._runInTerminalToolRegistrationVersion = 0;
|
|
92
|
+
const confirmTerminalCommandTool = _instantiationService.createInstance(ConfirmTerminalCommandTool);
|
|
81
93
|
this._register(
|
|
82
|
-
|
|
94
|
+
_toolsService.registerTool(ConfirmTerminalCommandToolData, confirmTerminalCommandTool)
|
|
83
95
|
);
|
|
84
|
-
const getTerminalOutputTool =
|
|
96
|
+
const getTerminalOutputTool = _instantiationService.createInstance(GetTerminalOutputTool);
|
|
85
97
|
this._register(
|
|
86
|
-
|
|
98
|
+
_toolsService.registerTool(GetTerminalOutputToolData, getTerminalOutputTool)
|
|
87
99
|
);
|
|
88
|
-
this._register(
|
|
89
|
-
const awaitTerminalTool =
|
|
90
|
-
this._register(
|
|
91
|
-
this._register(
|
|
92
|
-
const killTerminalTool =
|
|
93
|
-
this._register(
|
|
94
|
-
this._register(
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
this._register(toolsService.registerTool(runInTerminalToolData, runInTerminalTool));
|
|
98
|
-
this._register(toolsService.executeToolSet.addTool(runInTerminalToolData));
|
|
99
|
-
});
|
|
100
|
-
const getTerminalSelectionTool = instantiationService.createInstance(GetTerminalSelectionTool);
|
|
100
|
+
this._register(_toolsService.executeToolSet.addTool(GetTerminalOutputToolData));
|
|
101
|
+
const awaitTerminalTool = _instantiationService.createInstance(AwaitTerminalTool);
|
|
102
|
+
this._register(_toolsService.registerTool(AwaitTerminalToolData, awaitTerminalTool));
|
|
103
|
+
this._register(_toolsService.executeToolSet.addTool(AwaitTerminalToolData));
|
|
104
|
+
const killTerminalTool = _instantiationService.createInstance(KillTerminalTool);
|
|
105
|
+
this._register(_toolsService.registerTool(KillTerminalToolData, killTerminalTool));
|
|
106
|
+
this._register(_toolsService.executeToolSet.addTool(KillTerminalToolData));
|
|
107
|
+
this._registerRunInTerminalTool();
|
|
108
|
+
const getTerminalSelectionTool = _instantiationService.createInstance(GetTerminalSelectionTool);
|
|
101
109
|
this._register(
|
|
102
|
-
|
|
110
|
+
_toolsService.registerTool(GetTerminalSelectionToolData, getTerminalSelectionTool)
|
|
103
111
|
);
|
|
104
|
-
const getTerminalLastCommandTool =
|
|
112
|
+
const getTerminalLastCommandTool = _instantiationService.createInstance(GetTerminalLastCommandTool);
|
|
105
113
|
this._register(
|
|
106
|
-
|
|
114
|
+
_toolsService.registerTool(GetTerminalLastCommandToolData, getTerminalLastCommandTool)
|
|
107
115
|
);
|
|
108
|
-
this._register(
|
|
109
|
-
this._register(
|
|
110
|
-
const runTaskTool =
|
|
111
|
-
this._register(
|
|
112
|
-
const getTaskOutputTool =
|
|
113
|
-
this._register(
|
|
114
|
-
const createAndRunTaskTool =
|
|
115
|
-
this._register(
|
|
116
|
-
this._register(
|
|
117
|
-
this._register(
|
|
118
|
-
this._register(
|
|
116
|
+
this._register(_toolsService.readToolSet.addTool(GetTerminalSelectionToolData));
|
|
117
|
+
this._register(_toolsService.readToolSet.addTool(GetTerminalLastCommandToolData));
|
|
118
|
+
const runTaskTool = _instantiationService.createInstance(RunTaskTool);
|
|
119
|
+
this._register(_toolsService.registerTool(RunTaskToolData, runTaskTool));
|
|
120
|
+
const getTaskOutputTool = _instantiationService.createInstance(GetTaskOutputTool);
|
|
121
|
+
this._register(_toolsService.registerTool(GetTaskOutputToolData, getTaskOutputTool));
|
|
122
|
+
const createAndRunTaskTool = _instantiationService.createInstance(CreateAndRunTaskTool);
|
|
123
|
+
this._register(_toolsService.registerTool(CreateAndRunTaskToolData, createAndRunTaskTool));
|
|
124
|
+
this._register(_toolsService.executeToolSet.addTool(RunTaskToolData));
|
|
125
|
+
this._register(_toolsService.executeToolSet.addTool(CreateAndRunTaskToolData));
|
|
126
|
+
this._register(_toolsService.readToolSet.addTool(GetTaskOutputToolData));
|
|
127
|
+
this._register(this._configurationService.onDidChangeConfiguration(e => {
|
|
128
|
+
if (e.affectsConfiguration(TerminalChatAgentToolsSettingId.TerminalSandboxEnabled) || e.affectsConfiguration(TerminalChatAgentToolsSettingId.TerminalSandboxNetworkAllowedDomains) || e.affectsConfiguration(TerminalChatAgentToolsSettingId.TerminalSandboxNetworkDeniedDomains) || e.affectsConfiguration(TerminalChatAgentToolsSettingId.TerminalSandboxNetworkAllowTrustedDomains)) {
|
|
129
|
+
this._registerRunInTerminalTool();
|
|
130
|
+
}
|
|
131
|
+
}));
|
|
132
|
+
this._register(this._trustedDomainService.onDidChangeTrustedDomains(() => {
|
|
133
|
+
this._registerRunInTerminalTool();
|
|
134
|
+
}));
|
|
135
|
+
}
|
|
136
|
+
_registerRunInTerminalTool() {
|
|
137
|
+
const version = ++this._runInTerminalToolRegistrationVersion;
|
|
138
|
+
this._instantiationService.invokeFunction(createRunInTerminalToolData).then(runInTerminalToolData => {
|
|
139
|
+
if (this._store.isDisposed || version !== this._runInTerminalToolRegistrationVersion) {
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
if (!this._runInTerminalTool) {
|
|
143
|
+
this._runInTerminalTool = this._register(this._instantiationService.createInstance(RunInTerminalTool));
|
|
144
|
+
}
|
|
145
|
+
this._runInTerminalToolRegistration.value = undefined;
|
|
146
|
+
const store = ( new DisposableStore());
|
|
147
|
+
store.add(this._toolsService.registerToolData(runInTerminalToolData));
|
|
148
|
+
store.add(
|
|
149
|
+
this._toolsService.registerToolImplementation(runInTerminalToolData.id, this._runInTerminalTool)
|
|
150
|
+
);
|
|
151
|
+
store.add(this._toolsService.executeToolSet.addTool(runInTerminalToolData));
|
|
152
|
+
this._runInTerminalToolRegistration.value = store;
|
|
153
|
+
});
|
|
119
154
|
}
|
|
120
155
|
};
|
|
121
|
-
ChatAgentToolsContribution = ( __decorate([( __param(0, IInstantiationService)), ( __param(1, ILanguageModelToolsService))], ChatAgentToolsContribution));
|
|
156
|
+
ChatAgentToolsContribution = ( __decorate([( __param(0, IInstantiationService)), ( __param(1, ILanguageModelToolsService)), ( __param(2, IConfigurationService)), ( __param(3, ITrustedDomainService))], ChatAgentToolsContribution));
|
|
122
157
|
registerWorkbenchContribution2(
|
|
123
158
|
ChatAgentToolsContribution.ID,
|
|
124
159
|
ChatAgentToolsContribution,
|
|
@@ -126,7 +161,7 @@ registerWorkbenchContribution2(
|
|
|
126
161
|
);
|
|
127
162
|
registerActiveInstanceAction({
|
|
128
163
|
id: TerminalChatAgentToolsCommandId.ChatAddTerminalSelection,
|
|
129
|
-
title: ( localize(
|
|
164
|
+
title: ( localize(13798, "Add Terminal Selection to Chat")),
|
|
130
165
|
precondition: ( ContextKeyExpr.and(ChatContextKeys.enabled, sharedWhenClause.terminalAvailable)),
|
|
131
166
|
menu: [{
|
|
132
167
|
id: MenuId.TerminalInstanceContext,
|
|
@@ -147,11 +182,13 @@ registerActiveInstanceAction({
|
|
|
147
182
|
chatView.attachmentModel.addContext({
|
|
148
183
|
id: `terminal-selection-${Date.now()}`,
|
|
149
184
|
kind: "generic",
|
|
150
|
-
name: ( localize(
|
|
151
|
-
fullName: ( localize(
|
|
185
|
+
name: ( localize(13799, "Terminal Selection")),
|
|
186
|
+
fullName: ( localize(13799, "Terminal Selection")),
|
|
152
187
|
value: selection,
|
|
153
188
|
icon: Codicon.terminal
|
|
154
189
|
});
|
|
155
190
|
chatView.focusInput();
|
|
156
191
|
}
|
|
157
192
|
});
|
|
193
|
+
|
|
194
|
+
export { ChatAgentToolsContribution };
|
|
@@ -11,7 +11,7 @@ import { timeout, raceCancellationError } from '@codingame/monaco-vscode-api/vsc
|
|
|
11
11
|
const AwaitTerminalToolData = {
|
|
12
12
|
id: TerminalToolId.AwaitTerminal,
|
|
13
13
|
toolReferenceName: "awaitTerminal",
|
|
14
|
-
displayName: ( localize(
|
|
14
|
+
displayName: ( localize(13800, "Await Terminal")),
|
|
15
15
|
modelDescription: "Wait for a background terminal command to complete. Returns the output, exit code, or timeout status.",
|
|
16
16
|
icon: Codicon.terminal,
|
|
17
17
|
source: ToolDataSource.Internal,
|
|
@@ -33,8 +33,8 @@ const AwaitTerminalToolData = {
|
|
|
33
33
|
class AwaitTerminalTool extends Disposable {
|
|
34
34
|
async prepareToolInvocation(_context, _token) {
|
|
35
35
|
return {
|
|
36
|
-
invocationMessage: ( localize(
|
|
37
|
-
pastTenseMessage: ( localize(
|
|
36
|
+
invocationMessage: ( localize(13801, "Awaiting terminal completion")),
|
|
37
|
+
pastTenseMessage: ( localize(13802, "Awaited terminal completion"))
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
async invoke(invocation, _countTokens, _progress, token) {
|
|
@@ -154,7 +154,7 @@ let NpmScriptAutoApprover = class NpmScriptAutoApprover extends Disposable {
|
|
|
154
154
|
isAutoApproved: true,
|
|
155
155
|
scriptName,
|
|
156
156
|
autoApproveInfo: ( new MarkdownString(( localize(
|
|
157
|
-
|
|
157
|
+
13803,
|
|
158
158
|
"Auto approved as {0} is defined in package.json",
|
|
159
159
|
`\`${scriptName}\``
|
|
160
160
|
))))
|
|
@@ -30,6 +30,7 @@ export interface ICommandLineAnalyzerOptions {
|
|
|
30
30
|
treeSitterLanguage: TreeSitterCommandParserLanguage;
|
|
31
31
|
terminalToolSessionId: string;
|
|
32
32
|
chatSessionResource: URI | undefined;
|
|
33
|
+
requiresUnsandboxConfirmation?: boolean;
|
|
33
34
|
}
|
|
34
35
|
export interface ICommandLineAnalyzerResult {
|
|
35
36
|
/**
|
|
@@ -40,7 +40,8 @@ let CommandLineAutoApproveAnalyzer = class CommandLineAutoApproveAnalyzer extend
|
|
|
40
40
|
this._commandLineAutoApprover = this._register(instantiationService.createInstance(CommandLineAutoApprover));
|
|
41
41
|
}
|
|
42
42
|
async analyze(options) {
|
|
43
|
-
|
|
43
|
+
const isAutoApproveEnabledInSettings = this._configurationService.getValue(TerminalChatAgentToolsSettingId.EnableAutoApprove) === true;
|
|
44
|
+
if (isAutoApproveEnabledInSettings && options.chatSessionResource && this._terminalChatService.hasChatSessionAutoApproval(options.chatSessionResource)) {
|
|
44
45
|
this._log("Session has auto approval enabled, auto approving command");
|
|
45
46
|
const disableUri = createCommandUri(
|
|
46
47
|
TerminalChatCommandId.DisableSessionAutoApproval,
|
|
@@ -55,7 +56,7 @@ let CommandLineAutoApproveAnalyzer = class CommandLineAutoApproveAnalyzer extend
|
|
|
55
56
|
isAutoApproved: true,
|
|
56
57
|
isAutoApproveAllowed: true,
|
|
57
58
|
disclaimers: [],
|
|
58
|
-
autoApproveInfo: ( new MarkdownString(`${( localize(
|
|
59
|
+
autoApproveInfo: ( new MarkdownString(`${( localize(13804, "Auto approved for this session"))} ([${( localize(13805, "Disable"))}](${( disableUri.toString())}))`, mdTrustSettings))
|
|
59
60
|
};
|
|
60
61
|
}
|
|
61
62
|
const trimmedCommandLine = options.commandLine.trimStart();
|
|
@@ -73,7 +74,16 @@ let CommandLineAutoApproveAnalyzer = class CommandLineAutoApproveAnalyzer extend
|
|
|
73
74
|
let isAutoApproved = false;
|
|
74
75
|
let autoApproveInfo;
|
|
75
76
|
let customActions;
|
|
76
|
-
if (!subCommands) {
|
|
77
|
+
if (!subCommands?.length) {
|
|
78
|
+
if (trimmedCommandLine.length === 0) {
|
|
79
|
+
this._log("Command line is empty, auto approving");
|
|
80
|
+
return {
|
|
81
|
+
isAutoApproved: true,
|
|
82
|
+
isAutoApproveAllowed: true,
|
|
83
|
+
disclaimers: []
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
this._log("No sub-commands were parsed, auto approval is not allowed");
|
|
77
87
|
return {
|
|
78
88
|
isAutoApproveAllowed: false,
|
|
79
89
|
disclaimers: []
|
|
@@ -148,7 +158,7 @@ let CommandLineAutoApproveAnalyzer = class CommandLineAutoApproveAnalyzer extend
|
|
|
148
158
|
const subCommandsLowerFirstWordOnly = ( subCommands.map(command => command.split(" ")[0].toLowerCase()));
|
|
149
159
|
if (!isAutoApproved && (( subCommandsLowerFirstWordOnly.some(command => promptInjectionWarningCommandsLower.includes(command))) || (isPowerShell(options.shell, options.os) && ( subCommandsLowerFirstWordOnly.some(command => promptInjectionWarningCommandsLowerPwshOnly.includes(command)))))) {
|
|
150
160
|
disclaimers.push(( localize(
|
|
151
|
-
|
|
161
|
+
13806,
|
|
152
162
|
"Web content may contain malicious code or attempt prompt injection attacks."
|
|
153
163
|
)));
|
|
154
164
|
}
|
|
@@ -189,10 +199,10 @@ let CommandLineAutoApproveAnalyzer = class CommandLineAutoApproveAnalyzer extend
|
|
|
189
199
|
return ( asArray(result).filter(e => isAutoApproveRule(e.rule)).map(e => {
|
|
190
200
|
const escapedSourceText = e.rule.sourceText.replaceAll("$", "\\$");
|
|
191
201
|
if (e.rule.sourceTarget === "session") {
|
|
192
|
-
return localize(
|
|
202
|
+
return localize(13807, "{0} (session)", `\`${escapedSourceText}\``);
|
|
193
203
|
}
|
|
194
204
|
const settingsUri = createCommandUri(TerminalChatCommandId.OpenTerminalSettingsLink, e.rule.sourceTarget);
|
|
195
|
-
const tooltip = ( localize(
|
|
205
|
+
const tooltip = ( localize(13808, "View rule in settings"));
|
|
196
206
|
let label = escapedSourceText;
|
|
197
207
|
switch (e.rule?.sourceTarget) {
|
|
198
208
|
case ConfigurationTarget.DEFAULT:
|
|
@@ -223,9 +233,9 @@ let CommandLineAutoApproveAnalyzer = class CommandLineAutoApproveAnalyzer extend
|
|
|
223
233
|
if (isGlobalAutoApproved) {
|
|
224
234
|
const settingsUri = createCommandUri(TerminalChatCommandId.OpenTerminalSettingsLink, "global");
|
|
225
235
|
return (new MarkdownString(`${( localize(
|
|
226
|
-
|
|
236
|
+
13809,
|
|
227
237
|
"Auto approved by setting {0}",
|
|
228
|
-
`[\`${ChatConfiguration.GlobalAutoApprove}\`](${( settingsUri.toString())} "${( localize(
|
|
238
|
+
`[\`${ChatConfiguration.GlobalAutoApprove}\`](${( settingsUri.toString())} "${( localize(13810, "View settings"))}")`
|
|
229
239
|
))}`, mdTrustSettings));
|
|
230
240
|
}
|
|
231
241
|
if (isAutoApproved) {
|
|
@@ -234,7 +244,7 @@ let CommandLineAutoApproveAnalyzer = class CommandLineAutoApproveAnalyzer extend
|
|
|
234
244
|
{
|
|
235
245
|
if (isAutoApproveRule(commandLineResult.rule)) {
|
|
236
246
|
return (new MarkdownString(
|
|
237
|
-
localize(
|
|
247
|
+
localize(13811, "Auto approved by rule {0}", formatRuleLinks(commandLineResult)),
|
|
238
248
|
mdTrustSettings
|
|
239
249
|
));
|
|
240
250
|
}
|
|
@@ -249,12 +259,12 @@ let CommandLineAutoApproveAnalyzer = class CommandLineAutoApproveAnalyzer extend
|
|
|
249
259
|
const uniqueRules = dedupeRules(subCommandResults);
|
|
250
260
|
if (uniqueRules.length === 1) {
|
|
251
261
|
return (new MarkdownString(
|
|
252
|
-
localize(
|
|
262
|
+
localize(13811, "Auto approved by rule {0}", formatRuleLinks(uniqueRules)),
|
|
253
263
|
mdTrustSettings
|
|
254
264
|
));
|
|
255
265
|
} else if (uniqueRules.length > 1) {
|
|
256
266
|
return (new MarkdownString(
|
|
257
|
-
localize(
|
|
267
|
+
localize(13812, "Auto approved by rules {0}", formatRuleLinks(uniqueRules)),
|
|
258
268
|
mdTrustSettings
|
|
259
269
|
));
|
|
260
270
|
}
|
|
@@ -267,7 +277,7 @@ let CommandLineAutoApproveAnalyzer = class CommandLineAutoApproveAnalyzer extend
|
|
|
267
277
|
{
|
|
268
278
|
if (commandLineResult.rule) {
|
|
269
279
|
return (new MarkdownString(localize(
|
|
270
|
-
|
|
280
|
+
13813,
|
|
271
281
|
"Auto approval denied by rule {0}",
|
|
272
282
|
formatRuleLinks(commandLineResult)
|
|
273
283
|
), mdTrustSettings));
|
|
@@ -279,12 +289,12 @@ let CommandLineAutoApproveAnalyzer = class CommandLineAutoApproveAnalyzer extend
|
|
|
279
289
|
const uniqueRules = dedupeRules(subCommandResults.filter(e => e.result === "denied"));
|
|
280
290
|
if (uniqueRules.length === 1) {
|
|
281
291
|
return (new MarkdownString(
|
|
282
|
-
localize(
|
|
292
|
+
localize(13813, "Auto approval denied by rule {0}", formatRuleLinks(uniqueRules)),
|
|
283
293
|
mdTrustSettings
|
|
284
294
|
));
|
|
285
295
|
} else if (uniqueRules.length > 1) {
|
|
286
296
|
return (new MarkdownString(
|
|
287
|
-
localize(
|
|
297
|
+
localize(13814, "Auto approval denied by rules {0}", formatRuleLinks(uniqueRules)),
|
|
288
298
|
mdTrustSettings
|
|
289
299
|
));
|
|
290
300
|
}
|
|
@@ -149,12 +149,12 @@ let CommandLineFileWriteAnalyzer = class CommandLineFileWriteAnalyzer extends Di
|
|
|
149
149
|
)).join(", ");
|
|
150
150
|
if (!isAutoApproveAllowed) {
|
|
151
151
|
disclaimers.push(( localize(
|
|
152
|
-
|
|
152
|
+
13815,
|
|
153
153
|
"File write operations detected that cannot be auto approved: {0}",
|
|
154
154
|
fileWritesList
|
|
155
155
|
)));
|
|
156
156
|
} else {
|
|
157
|
-
disclaimers.push(( localize(
|
|
157
|
+
disclaimers.push(( localize(13816, "File write operations detected: {0}", fileWritesList)));
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
return {
|
|
@@ -2,8 +2,9 @@ import { ITerminalSandboxService } from "@codingame/monaco-vscode-api/vscode/vs/
|
|
|
2
2
|
import type { ICommandLinePresenter, ICommandLinePresenterOptions, ICommandLinePresenterResult } from "./commandLinePresenter.js";
|
|
3
3
|
/**
|
|
4
4
|
* Command line presenter for sandboxed commands.
|
|
5
|
-
*
|
|
6
|
-
* while the actual sandboxed command runs
|
|
5
|
+
* Returns the display form of the command (provided via {@link ICommandLineRewriterResult.forDisplay}
|
|
6
|
+
* from the rewriter pipeline) for cleaner presentation, while the actual sandboxed command runs
|
|
7
|
+
* unchanged.
|
|
7
8
|
*/
|
|
8
9
|
export declare class SandboxedCommandLinePresenter implements ICommandLinePresenter {
|
|
9
10
|
private readonly _sandboxService;
|
|
@@ -11,7 +11,7 @@ let SandboxedCommandLinePresenter = class SandboxedCommandLinePresenter {
|
|
|
11
11
|
return undefined;
|
|
12
12
|
}
|
|
13
13
|
return {
|
|
14
|
-
commandLine: options.commandLine.
|
|
14
|
+
commandLine: options.commandLine.forDisplay,
|
|
15
15
|
processOtherPresenters: true
|
|
16
16
|
};
|
|
17
17
|
}
|
|
@@ -10,9 +10,11 @@ export interface ICommandLineRewriterOptions {
|
|
|
10
10
|
cwd: URI | undefined;
|
|
11
11
|
shell: string;
|
|
12
12
|
os: OperatingSystem;
|
|
13
|
+
requestUnsandboxedExecution?: boolean;
|
|
13
14
|
}
|
|
14
15
|
export interface ICommandLineRewriterResult {
|
|
15
16
|
rewritten: string;
|
|
16
17
|
reasoning: string;
|
|
17
18
|
forDisplay?: string;
|
|
19
|
+
isSandboxWrapped?: boolean;
|
|
18
20
|
}
|
|
@@ -9,6 +9,9 @@ let CommandLineSandboxRewriter = class CommandLineSandboxRewriter extends Dispos
|
|
|
9
9
|
this._sandboxService = _sandboxService;
|
|
10
10
|
}
|
|
11
11
|
async rewrite(options) {
|
|
12
|
+
if (options.requestUnsandboxedExecution) {
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
12
15
|
if (!(await this._sandboxService.isEnabled())) {
|
|
13
16
|
return undefined;
|
|
14
17
|
}
|
|
@@ -20,7 +23,8 @@ let CommandLineSandboxRewriter = class CommandLineSandboxRewriter extends Dispos
|
|
|
20
23
|
return {
|
|
21
24
|
rewritten: wrappedCommand,
|
|
22
25
|
reasoning: "Wrapped command for sandbox execution",
|
|
23
|
-
forDisplay: options.commandLine
|
|
26
|
+
forDisplay: options.commandLine,
|
|
27
|
+
isSandboxWrapped: true
|
|
24
28
|
};
|
|
25
29
|
}
|
|
26
30
|
};
|
|
@@ -12,7 +12,7 @@ const GetTerminalLastCommandToolData = {
|
|
|
12
12
|
id: TerminalToolId.TerminalLastCommand,
|
|
13
13
|
toolReferenceName: "terminalLastCommand",
|
|
14
14
|
legacyToolReferenceFullNames: ["runCommands/terminalLastCommand"],
|
|
15
|
-
displayName: ( localize(
|
|
15
|
+
displayName: ( localize(13817, "Get Terminal Last Command")),
|
|
16
16
|
modelDescription: "Get the last command run in the active terminal.",
|
|
17
17
|
source: ToolDataSource.Internal,
|
|
18
18
|
icon: Codicon.terminal
|
|
@@ -24,8 +24,8 @@ let GetTerminalLastCommandTool = class GetTerminalLastCommandTool extends Dispos
|
|
|
24
24
|
}
|
|
25
25
|
async prepareToolInvocation(context, token) {
|
|
26
26
|
return {
|
|
27
|
-
invocationMessage: ( localize(
|
|
28
|
-
pastTenseMessage: ( localize(
|
|
27
|
+
invocationMessage: ( localize(13818, "Getting last terminal command")),
|
|
28
|
+
pastTenseMessage: ( localize(13819, "Got last terminal command"))
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
31
|
async invoke(invocation, _countTokens, _progress, token) {
|