@codingame/monaco-vscode-chat-service-override 33.0.9 → 34.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +19 -5
- package/package.json +5 -5
- package/vscode/src/vs/platform/agentHost/browser/agentHostIpcChannelTransport.d.ts +32 -0
- package/vscode/src/vs/platform/agentHost/browser/agentHostIpcChannelTransport.js +77 -0
- package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostProtocolClient.d.ts +84 -17
- package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostProtocolClient.js +235 -190
- package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.d.ts +3 -2
- package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.js +23 -4
- package/vscode/src/vs/platform/agentHost/common/agentHost.config.contribution.d.ts +1 -0
- package/vscode/src/vs/platform/agentHost/common/agentHost.config.contribution.js +22 -0
- package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemProvider.d.ts +107 -8
- package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemProvider.js +272 -49
- package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemService.js +2 -2
- package/vscode/src/vs/platform/agentHost/common/{agentHostPermissionService.d.ts → agentHostResourceService.d.ts} +26 -0
- package/vscode/src/vs/platform/agentHost/common/{agentHostPermissionService.js → agentHostResourceService.js} +11 -1
- package/vscode/src/vs/platform/agentHost/common/agentHostSchema.d.ts +13 -0
- package/vscode/src/vs/platform/agentHost/common/agentHostSchema.js +26 -18
- package/vscode/src/vs/platform/agentHost/common/agentHostStarter.config.contribution.d.ts +1 -0
- package/vscode/src/vs/platform/agentHost/common/agentHostStarter.config.contribution.js +119 -0
- package/vscode/src/vs/platform/agentHost/common/agentService.d.ts +135 -19
- package/vscode/src/vs/platform/agentHost/common/agentService.js +8 -2
- package/vscode/src/vs/platform/agentHost/common/ahpJsonlLogger.d.ts +5 -1
- package/vscode/src/vs/platform/agentHost/common/ahpJsonlLogger.js +85 -22
- package/vscode/src/vs/platform/agentHost/common/customAgents.d.ts +36 -0
- package/vscode/src/vs/platform/agentHost/common/customAgents.js +12 -0
- package/vscode/src/vs/platform/agentHost/common/sandboxConfigSchema.d.ts +81 -0
- package/vscode/src/vs/platform/agentHost/common/sandboxConfigSchema.js +103 -0
- package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.d.ts +86 -10
- package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.js +129 -37
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-changeset/reducer.d.ts +12 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-changeset/reducer.js +72 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-root/reducer.d.ts +6 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-root/reducer.js +30 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-session/reducer.d.ts +6 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/{reducers.js → channels-session/reducer.js} +99 -168
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-terminal/reducer.d.ts +6 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-terminal/reducer.js +110 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/{errors.d.ts → common/errors.d.ts} +13 -2
- package/vscode/src/vs/platform/agentHost/common/state/protocol/{errors.js → common/errors.js} +1 -2
- package/vscode/src/vs/platform/agentHost/common/state/protocol/common/reducer-helpers.d.ts +17 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/common/reducer-helpers.js +9 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/version/registry.d.ts +33 -8
- package/vscode/src/vs/platform/agentHost/common/state/protocol/version/registry.js +2 -3
- package/vscode/src/vs/platform/agentHost/common/state/sessionActions.d.ts +36 -5
- package/vscode/src/vs/platform/agentHost/common/state/sessionActions.js +6 -3
- package/vscode/src/vs/platform/networkFilter/common/domainMatcher.d.ts +50 -0
- package/vscode/src/vs/platform/networkFilter/common/domainMatcher.js +138 -0
- package/vscode/src/vs/platform/networkFilter/common/networkFilterService.js +3 -3
- package/vscode/src/vs/platform/networkFilter/common/settings.d.ts +12 -0
- package/vscode/src/vs/platform/networkFilter/common/settings.js +14 -0
- package/vscode/src/vs/platform/sandbox/browser/sandboxHelperService.d.ts +4 -1
- package/vscode/src/vs/platform/sandbox/browser/sandboxHelperService.js +9 -0
- package/vscode/src/vs/platform/sandbox/common/sandboxHelperIpc.d.ts +21 -0
- package/vscode/src/vs/platform/sandbox/common/sandboxHelperIpc.js +28 -0
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxCommandRules.d.ts +31 -0
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxCommandRules.js +49 -0
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxEngine.d.ts +182 -0
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxEngine.js +784 -0
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxReadAllowList.d.ts +18 -0
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxReadAllowList.js +305 -0
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxRuntimeConfigurationPerOperation.d.ts +7 -0
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxRuntimeConfigurationPerOperation.js +120 -0
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxService.d.ts +100 -0
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxService.js +10 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityService.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.js +16 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +60 -60
- 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 +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +106 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatForkActions.js +22 -36
- 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 +21 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatOpenAgentDebugPanelAction.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPluginActions.js +38 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPromptNavigationActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQueueActions.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +18 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/createPluginAction.js +20 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/exportAgentHostDebugLogsAction.d.ts +3 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/exportAgentHostDebugLogsAction.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/openCopilotCliStateFileAction.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginActions.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginActions.js +40 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.js +15 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditorInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.js +23 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationSyncProvider.d.ts +24 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationSyncProvider.js +55 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService.d.ts +30 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService.js +119 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCustomizationService.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCustomizationService.js +32 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLocalCustomizations.d.ts +55 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLocalCustomizations.js +104 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostModeSynchronizer.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostModeSynchronizer.js +177 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPermissionUiContribution.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPermissionUiContribution.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostToolUtils.d.ts +6 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostToolUtils.js +14 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostUntitledProvisionalSessionService.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostUntitledProvisionalSessionService.js +44 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/syncedCustomizationBundler.d.ts +60 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/syncedCustomizationBundler.js +103 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.js +4 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.js +70 -62
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.js +9 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsQuickAccess.js +1 -1
- 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.js +4 -4
- 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 +6 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.js +38 -28
- 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/aiCustomization/aiCustomizationDebugPanel.d.ts +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.js +22 -31
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.js +15 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemsModel.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemsModel.js +8 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.js +112 -113
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.contribution.js +62 -68
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.d.ts +3 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.js +149 -145
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.js +6 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePagePromptLaunchers.js +25 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCreatorService.js +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.js +5 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedAgentPluginDetail.d.ts +8 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedAgentPluginDetail.js +13 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedMcpServerDetail.d.ts +8 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedMcpServerDetail.js +15 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.js +78 -55
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationManagement.css +140 -67
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationWelcomePromptLaunchers.css +11 -21
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.js +59 -57
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.shared.contribution.js +440 -357
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.js +32 -32
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheExplorerView.js +99 -99
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugDetailPanel.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditorInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventDetailRenderer.js +20 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventList.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFilters.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowChartView.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowGraph.js +22 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHomeView.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHookContentRenderer.js +17 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.js +24 -24
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugMessageContentRenderer.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugModelTurnContentRenderer.js +23 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugOverviewView.js +33 -33
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugToolCallContentRenderer.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorAccessibility.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatGoalSummaryService.d.ts +21 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatGoalSummaryService.js +115 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatImageCarouselService.js +5 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.d.ts +6 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.js +28 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.js +187 -106
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/media/chatModelsWidget.css +41 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +30 -30
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuotaNotification.d.ts +66 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuotaNotification.js +346 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatRepoInfo.js +3 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.js +72 -29
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupGrowthSession.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.js +26 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.d.ts +5 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.js +144 -67
- 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 +126 -80
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.js +32 -31
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/media/chatStatus.css +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipCatalog.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipCatalog.js +40 -33
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.d.ts +5 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.js +25 -24
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWindowNotifier.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/claudePluginRecommendations.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/contextContrib/chatContext.contribution.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/defaultModelContribution.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/enablementActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/enablementStatusWidget.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/githubRepoFetcher.js +1 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/hasByokModelsContribution.d.ts +12 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/hasByokModelsContribution.js +14 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.d.ts +6 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.js +56 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorContribution.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginAutoUpdate.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginAutoUpdate.js +5 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginGitCommandService.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.js +33 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.js +31 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginUrlHandler.d.ts +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginUrlHandler.js +16 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.js +27 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.d.ts +1 -1
- 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 +8 -8
- 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.js +20 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.js +39 -39
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.js +24 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolHelpers.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolHelpers.js +23 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/utilityModelContribution.js +5 -2
- 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/editor/chatInputCompletions.js +22 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorContrib.js +2 -2
- 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 +14 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.js +55 -24
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatSelectedModel.d.ts +38 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatSelectedModel.js +47 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.js +54 -12
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionOperationLog.js +1 -0
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/common/model/objectMutationLog.d.ts +39 -0
- package/vscode/src/vs/workbench/contrib/chat/common/model/objectMutationLog.js +40 -4
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.d.ts +30 -8
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.js +205 -46
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/fileBackedInstalledPluginsStore.d.ts +4 -3
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/fileBackedInstalledPluginsStore.js +8 -3
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/marketplaceReference.d.ts +57 -0
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/marketplaceReference.js +153 -38
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.d.ts +12 -7
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.js +70 -37
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/workspacePluginSettingsService.js +6 -28
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +18 -18
- 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.js +150 -150
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +1 -1
- package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarousel.contribution.js +10 -10
- package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarouselEditor.js +10 -10
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +15 -15
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatDefaultModel.js +2 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +4 -4
- 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 +7 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.js +17 -17
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibleView.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +21 -21
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatEnabler.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.js +21 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +2 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/agentHostSandboxForwarder.d.ts +55 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/agentHostSandboxForwarder.js +122 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/alternativeRecommendation.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/alternativeRecommendation.js +41 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/commandFileWriteParser.d.ts +24 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/sedFileWriteParser.d.ts +26 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/sedFileWriteParser.js +142 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.d.ts +52 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.js +232 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.d.ts +65 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.js +225 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.d.ts +27 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.js +143 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.d.ts +37 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.js +205 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/strategyHelpers.d.ts +40 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/strategyHelpers.js +174 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.js +43 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.d.ts +52 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +260 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.d.ts +44 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.js +98 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +14 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.d.ts +42 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.js +226 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/commandLineAutoApprover.d.ts +31 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/commandLineAutoApprover.js +392 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.d.ts +45 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.js +243 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAnalyzer.d.ts +54 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAnalyzer.js +10 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +310 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.d.ts +27 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +177 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineSandboxAnalyzer.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineSandboxAnalyzer.js +33 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/commandLinePresenter.d.ts +41 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/nodeCommandLinePresenter.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/nodeCommandLinePresenter.js +37 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/pythonCommandLinePresenter.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/pythonCommandLinePresenter.js +37 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/rubyCommandLinePresenter.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/rubyCommandLinePresenter.js +44 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/sandboxedCommandLinePresenter.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/sandboxedCommandLinePresenter.js +22 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineBackgroundDetachRewriter.d.ts +42 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineBackgroundDetachRewriter.js +102 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineCdPrefixRewriter.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineCdPrefixRewriter.js +27 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePreventHistoryRewriter.d.ts +14 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePreventHistoryRewriter.js +29 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePwshChainOperatorRewriter.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePwshChainOperatorRewriter.js +33 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineRewriter.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.js +55 -0
- 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.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +31 -9
- 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 +4 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.d.ts +177 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +518 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/types.d.ts +42 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/types.js +23 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/outputAnalyzer.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.d.ts +297 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +2961 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.d.ts +29 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.js +63 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sendToTerminalTool.js +14 -14
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/createAndRunTaskTool.js +14 -14
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/getTaskOutputTool.js +7 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/runTaskTool.js +14 -14
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.js +2 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalCommandArtifactCollector.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalCommandArtifactCollector.js +118 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalToolAutoApprove.d.ts +22 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalToolAutoApprove.js +44 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.d.ts +58 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.js +223 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/sandboxSettingsReader.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/sandboxSettingsReader.js +81 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.d.ts +63 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +349 -0
- package/vscode/src/vs/workbench/services/agentHost/browser/editorRemoteAgentHostServiceClient.d.ts +75 -0
- package/vscode/src/vs/workbench/services/agentHost/browser/editorRemoteAgentHostServiceClient.js +192 -0
- package/vscode/src/vs/workbench/services/agentHost/common/agentHostResourceService.d.ts +89 -0
- package/vscode/src/vs/workbench/services/agentHost/common/{agentHostPermissionService.js → agentHostResourceService.js} +226 -9
- package/vscode/src/vs/platform/agentHost/common/state/protocol/reducers.d.ts +0 -30
- package/vscode/src/vs/platform/agentPlugins/common/pluginParsers.d.ts +0 -119
- package/vscode/src/vs/platform/agentPlugins/common/pluginParsers.js +0 -552
- package/vscode/src/vs/workbench/services/agentHost/common/agentHostPermissionService.d.ts +0 -83
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
class SedFileWriteParser {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.commandName = 'sed';
|
|
6
|
+
}
|
|
7
|
+
canHandle(commandText) {
|
|
8
|
+
if (!commandText.match(/^sed\s+/)) {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
const inPlaceRegex = /(?:^|\s)(-[a-zA-Z]*[iI][a-zA-Z]*\S*|--in-place(?:=\S*)?|(-i|-I)\s*'[^']*'|(-i|-I)\s*"[^"]*")(?:\s|$)/;
|
|
12
|
+
return inPlaceRegex.test(commandText);
|
|
13
|
+
}
|
|
14
|
+
extractFileWrites(commandText) {
|
|
15
|
+
const tokens = this._tokenizeCommand(commandText);
|
|
16
|
+
return this._extractFileTargets(tokens);
|
|
17
|
+
}
|
|
18
|
+
_tokenizeCommand(commandText) {
|
|
19
|
+
const tokens = [];
|
|
20
|
+
let current = '';
|
|
21
|
+
let inSingleQuote = false;
|
|
22
|
+
let inDoubleQuote = false;
|
|
23
|
+
let escaped = false;
|
|
24
|
+
for (let i = 0; i < commandText.length; i++) {
|
|
25
|
+
const char = commandText[i];
|
|
26
|
+
if (escaped) {
|
|
27
|
+
current += char;
|
|
28
|
+
escaped = false;
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
if (char === '\\' && !inSingleQuote) {
|
|
32
|
+
escaped = true;
|
|
33
|
+
current += char;
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
if (char === '\'' && !inDoubleQuote) {
|
|
37
|
+
inSingleQuote = !inSingleQuote;
|
|
38
|
+
current += char;
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
if (char === '"' && !inSingleQuote) {
|
|
42
|
+
inDoubleQuote = !inDoubleQuote;
|
|
43
|
+
current += char;
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
if (/\s/.test(char) && !inSingleQuote && !inDoubleQuote) {
|
|
47
|
+
if (current) {
|
|
48
|
+
tokens.push(current);
|
|
49
|
+
current = '';
|
|
50
|
+
}
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
current += char;
|
|
54
|
+
}
|
|
55
|
+
if (current) {
|
|
56
|
+
tokens.push(current);
|
|
57
|
+
}
|
|
58
|
+
return tokens;
|
|
59
|
+
}
|
|
60
|
+
_extractFileTargets(tokens) {
|
|
61
|
+
if (tokens.length === 0 || tokens[0] !== 'sed') {
|
|
62
|
+
return [];
|
|
63
|
+
}
|
|
64
|
+
const files = [];
|
|
65
|
+
let i = 1;
|
|
66
|
+
let foundScript = false;
|
|
67
|
+
while (i < tokens.length) {
|
|
68
|
+
const token = tokens[i];
|
|
69
|
+
if (token.startsWith('--')) {
|
|
70
|
+
if (token === '--in-place' || token.startsWith('--in-place=')) {
|
|
71
|
+
i++;
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
if (token === '--expression' || token === '--file') {
|
|
75
|
+
i += 2;
|
|
76
|
+
foundScript = true;
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
if (token.startsWith('--expression=') || token.startsWith('--file=')) {
|
|
80
|
+
i++;
|
|
81
|
+
foundScript = true;
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
i++;
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
if (token.startsWith('-') && token.length > 1 && token[1] !== '-') {
|
|
88
|
+
const flags = token.slice(1);
|
|
89
|
+
const iIndex = flags.indexOf('i');
|
|
90
|
+
const IIndex = flags.indexOf('I');
|
|
91
|
+
const inPlaceIndex = iIndex >= 0 ? iIndex : IIndex;
|
|
92
|
+
if (inPlaceIndex >= 0 && inPlaceIndex < flags.length - 1) {
|
|
93
|
+
i++;
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
if ((flags.endsWith('i') || flags.endsWith('I')) && i + 1 < tokens.length) {
|
|
97
|
+
const nextToken = tokens[i + 1];
|
|
98
|
+
if (nextToken === '\'\'' || nextToken === '""') {
|
|
99
|
+
i += 2;
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
if ((nextToken.startsWith('\'') && nextToken.endsWith('\'')) || (nextToken.startsWith('"') && nextToken.endsWith('"'))) {
|
|
103
|
+
const unquoted = nextToken.slice(1, -1);
|
|
104
|
+
if (unquoted.startsWith('.') && unquoted.length <= 10 && !unquoted.includes('/')) {
|
|
105
|
+
i += 2;
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
if (flags.includes('e') || flags.includes('f')) {
|
|
111
|
+
const eIndex = flags.indexOf('e');
|
|
112
|
+
const fIndex = flags.indexOf('f');
|
|
113
|
+
const optIndex = eIndex >= 0 ? eIndex : fIndex;
|
|
114
|
+
if (optIndex < flags.length - 1) {
|
|
115
|
+
foundScript = true;
|
|
116
|
+
i++;
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
foundScript = true;
|
|
120
|
+
i += 2;
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
i++;
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
if (!foundScript) {
|
|
127
|
+
foundScript = true;
|
|
128
|
+
i++;
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
let file = token;
|
|
132
|
+
if ((file.startsWith('\'') && file.endsWith('\'')) || (file.startsWith('"') && file.endsWith('"'))) {
|
|
133
|
+
file = file.slice(1, -1);
|
|
134
|
+
}
|
|
135
|
+
files.push(file);
|
|
136
|
+
i++;
|
|
137
|
+
}
|
|
138
|
+
return files;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export { SedFileWriteParser };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { CancellationToken } from "@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation";
|
|
2
|
+
import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
|
|
3
|
+
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
4
|
+
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
5
|
+
import type { ICommandDetectionCapability } from "@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/capabilities/capabilities";
|
|
6
|
+
import { ITerminalLogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/terminal.service";
|
|
7
|
+
import { type ITerminalExecuteStrategy, type ITerminalExecuteStrategyResult } from "./executeStrategy.js";
|
|
8
|
+
import type { IMarker as IXtermMarker } from "@xterm/xterm";
|
|
9
|
+
import { ITerminalInstance } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal";
|
|
10
|
+
/**
|
|
11
|
+
* This strategy is used when shell integration is enabled, but rich command detection was not
|
|
12
|
+
* declared by the shell script. This is the large spectrum between rich command detection and no
|
|
13
|
+
* shell integration, here are some problems that are expected:
|
|
14
|
+
*
|
|
15
|
+
* - `133;C` command executed may not happen.
|
|
16
|
+
* - `633;E` comamnd line reporting will likely not happen, so the command line contained in the
|
|
17
|
+
* execution start and end events will be of low confidence and chances are it will be wrong.
|
|
18
|
+
* - Execution tracking may be incorrect, particularly when `executeCommand` calls are overlapped,
|
|
19
|
+
* such as Python activating the environment at the same time as Copilot executing a command. So
|
|
20
|
+
* the end event for the execution may actually correspond to a different command.
|
|
21
|
+
*
|
|
22
|
+
* This strategy focuses on trying to get the most accurate output given these limitations and
|
|
23
|
+
* unknowns. Basically we cannot fully trust the extension APIs in this case, so polling of the data
|
|
24
|
+
* stream is used to detect idling, and we listen to the terminal's data stream instead of the
|
|
25
|
+
* execution's data stream.
|
|
26
|
+
*
|
|
27
|
+
* This is best effort with the goal being the output is accurate, though it may contain some
|
|
28
|
+
* content above and below the command output, such as prompts or even possibly other command
|
|
29
|
+
* output. We lean on the LLM to be able to differentiate the actual output from prompts and bad
|
|
30
|
+
* output when it's not ideal.
|
|
31
|
+
*/
|
|
32
|
+
export declare class BasicExecuteStrategy extends Disposable implements ITerminalExecuteStrategy {
|
|
33
|
+
private readonly _instance;
|
|
34
|
+
private readonly _hasReceivedUserInput;
|
|
35
|
+
private readonly _commandDetection;
|
|
36
|
+
private readonly _configurationService;
|
|
37
|
+
private readonly _logService;
|
|
38
|
+
readonly type = "basic";
|
|
39
|
+
private readonly _startMarker;
|
|
40
|
+
private readonly _onDidCreateStartMarker;
|
|
41
|
+
onDidCreateStartMarker: Event<IXtermMarker | undefined>;
|
|
42
|
+
/**
|
|
43
|
+
* Tracks per-execute() DisposableStores so they can be cleaned up if the
|
|
44
|
+
* strategy is disposed mid-flight, AND removed from this collection on
|
|
45
|
+
* successful completion to avoid accumulating stale references when
|
|
46
|
+
* execute() is invoked many times on the same strategy instance.
|
|
47
|
+
*/
|
|
48
|
+
private readonly _executionStores;
|
|
49
|
+
constructor(_instance: ITerminalInstance, _hasReceivedUserInput: () => boolean, _commandDetection: ICommandDetectionCapability, _configurationService: IConfigurationService, _logService: ITerminalLogService);
|
|
50
|
+
execute(commandLine: string, token: CancellationToken, commandId?: string, _commandLineForMetadata?: string): Promise<ITerminalExecuteStrategyResult>;
|
|
51
|
+
private _log;
|
|
52
|
+
}
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { CancellationError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
|
|
4
|
+
import { Emitter, Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
5
|
+
import { Disposable, MutableDisposable, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
6
|
+
import { isNumber } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
7
|
+
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
8
|
+
import { ITerminalLogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/terminal.service';
|
|
9
|
+
import { trackIdleOnPrompt, waitForIdle } from './executeStrategy.js';
|
|
10
|
+
import { createAltBufferPromise, setupRecreatingStartMarker, stripCommandEchoAndPrompt } from './strategyHelpers.js';
|
|
11
|
+
import { TerminalChatAgentToolsSettingId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalChatAgentToolsConfiguration';
|
|
12
|
+
import { isMacintosh } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
|
|
13
|
+
import { isMultilineCommand } from '../runInTerminalHelpers.js';
|
|
14
|
+
|
|
15
|
+
function isTerminalLaunchError(value) {
|
|
16
|
+
return typeof value === "object" && value !== null && "message" in value;
|
|
17
|
+
}
|
|
18
|
+
function formatExitCodeOrError(exitCodeOrError) {
|
|
19
|
+
if (isTerminalLaunchError(exitCodeOrError)) {
|
|
20
|
+
return `launch error: ${exitCodeOrError.message}${exitCodeOrError.code !== undefined ? `, code=${exitCodeOrError.code}` : ""}`;
|
|
21
|
+
}
|
|
22
|
+
return `code=${exitCodeOrError}`;
|
|
23
|
+
}
|
|
24
|
+
function extractExitCode(exitCodeOrError) {
|
|
25
|
+
if (isNumber(exitCodeOrError)) {
|
|
26
|
+
return exitCodeOrError;
|
|
27
|
+
}
|
|
28
|
+
if (isTerminalLaunchError(exitCodeOrError)) {
|
|
29
|
+
return exitCodeOrError.code;
|
|
30
|
+
}
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
33
|
+
let BasicExecuteStrategy = class BasicExecuteStrategy extends Disposable {
|
|
34
|
+
constructor(
|
|
35
|
+
_instance,
|
|
36
|
+
_hasReceivedUserInput,
|
|
37
|
+
_commandDetection,
|
|
38
|
+
_configurationService,
|
|
39
|
+
_logService
|
|
40
|
+
) {
|
|
41
|
+
super();
|
|
42
|
+
this._instance = _instance;
|
|
43
|
+
this._hasReceivedUserInput = _hasReceivedUserInput;
|
|
44
|
+
this._commandDetection = _commandDetection;
|
|
45
|
+
this._configurationService = _configurationService;
|
|
46
|
+
this._logService = _logService;
|
|
47
|
+
this.type = "basic";
|
|
48
|
+
this._startMarker = this._register(( new MutableDisposable()));
|
|
49
|
+
this._onDidCreateStartMarker = this._register(( new Emitter()));
|
|
50
|
+
this.onDidCreateStartMarker = this._onDidCreateStartMarker.event;
|
|
51
|
+
this._executionStores = this._register(( new DisposableStore()));
|
|
52
|
+
}
|
|
53
|
+
async execute(commandLine, token, commandId, _commandLineForMetadata) {
|
|
54
|
+
const store = ( new DisposableStore());
|
|
55
|
+
this._executionStores.add(store);
|
|
56
|
+
try {
|
|
57
|
+
if (this._instance.isDisposed) {
|
|
58
|
+
this._log("Terminal already disposed at strategy entry");
|
|
59
|
+
throw ( new Error("The terminal was closed"));
|
|
60
|
+
}
|
|
61
|
+
if (this._instance.exitCode !== undefined) {
|
|
62
|
+
this._log(
|
|
63
|
+
`Terminal pty already exited at strategy entry (code=${this._instance.exitCode})`
|
|
64
|
+
);
|
|
65
|
+
return {
|
|
66
|
+
output: undefined,
|
|
67
|
+
exitCode: this._instance.exitCode,
|
|
68
|
+
additionalInformation: `Command exited with code ${this._instance.exitCode}`
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
const idlePollInterval = this._configurationService.getValue(TerminalChatAgentToolsSettingId.IdlePollInterval) ?? 1000;
|
|
72
|
+
const staleMarker = this._commandDetection.executingCommandObject?.marker;
|
|
73
|
+
const onCommandFinishedFiltered = staleMarker ? Event.filter(
|
|
74
|
+
this._commandDetection.onCommandFinished,
|
|
75
|
+
e => e.marker !== staleMarker,
|
|
76
|
+
store
|
|
77
|
+
) : this._commandDetection.onCommandFinished;
|
|
78
|
+
const idlePromptPromise = trackIdleOnPrompt(
|
|
79
|
+
this._instance,
|
|
80
|
+
idlePollInterval,
|
|
81
|
+
store,
|
|
82
|
+
idlePollInterval,
|
|
83
|
+
this._logService
|
|
84
|
+
);
|
|
85
|
+
const onDone = Promise.race([Event.toPromise(onCommandFinishedFiltered, store).then(e => {
|
|
86
|
+
this._log("onDone 1 of 2 via end event, waiting for short idle prompt");
|
|
87
|
+
return idlePromptPromise.then(() => {
|
|
88
|
+
this._log("onDone 2 of 2 via short idle prompt");
|
|
89
|
+
return {
|
|
90
|
+
"type": "success",
|
|
91
|
+
command: e
|
|
92
|
+
};
|
|
93
|
+
});
|
|
94
|
+
}), Event.toPromise(token.onCancellationRequested, store).then(() => {
|
|
95
|
+
this._log("onDone via cancellation");
|
|
96
|
+
}), Event.toPromise(this._instance.onDisposed, store).then(() => {
|
|
97
|
+
this._log("onDone via terminal disposal");
|
|
98
|
+
return {
|
|
99
|
+
type: "disposal"
|
|
100
|
+
};
|
|
101
|
+
}), Event.toPromise(this._instance.onExit, store).then(exitCodeOrError => {
|
|
102
|
+
this._log(`onDone via process exit (${formatExitCodeOrError(exitCodeOrError)})`);
|
|
103
|
+
return {
|
|
104
|
+
type: "processExit",
|
|
105
|
+
exitCodeOrError
|
|
106
|
+
};
|
|
107
|
+
}),
|
|
108
|
+
trackIdleOnPrompt(
|
|
109
|
+
this._instance,
|
|
110
|
+
idlePollInterval * 3,
|
|
111
|
+
store,
|
|
112
|
+
idlePollInterval,
|
|
113
|
+
this._logService
|
|
114
|
+
).then(() => {
|
|
115
|
+
this._log("onDone long idle prompt");
|
|
116
|
+
})]);
|
|
117
|
+
this._log("Waiting for xterm");
|
|
118
|
+
const xterm = await this._instance.xtermReadyPromise;
|
|
119
|
+
if (!xterm) {
|
|
120
|
+
throw ( new Error("Xterm is not available"));
|
|
121
|
+
}
|
|
122
|
+
const alternateBufferPromise = createAltBufferPromise(xterm, store, this._log.bind(this));
|
|
123
|
+
this._log("Waiting for idle");
|
|
124
|
+
await waitForIdle(this._instance.onData, idlePollInterval);
|
|
125
|
+
const markerRecreation = setupRecreatingStartMarker(
|
|
126
|
+
xterm,
|
|
127
|
+
this._startMarker,
|
|
128
|
+
m => this._onDidCreateStartMarker.fire(m),
|
|
129
|
+
store,
|
|
130
|
+
this._log.bind(this)
|
|
131
|
+
);
|
|
132
|
+
if (this._hasReceivedUserInput()) {
|
|
133
|
+
if (this._commandDetection.executingCommandObject !== undefined) {
|
|
134
|
+
this._log(
|
|
135
|
+
"Previous command still executing with pending input, sending SIGINT before retrying"
|
|
136
|
+
);
|
|
137
|
+
await this._instance.sendText("\u0003", false);
|
|
138
|
+
await waitForIdle(this._instance.onData, 100);
|
|
139
|
+
} else {
|
|
140
|
+
this._log("Prompt is idle; clearing pending input with Ctrl+U instead of SIGINT");
|
|
141
|
+
await this._instance.sendText("\u0015", false);
|
|
142
|
+
await waitForIdle(this._instance.onData, 100);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
if (commandId) {
|
|
146
|
+
this._log(
|
|
147
|
+
`In basic execute strategy: skipping pre-bound command id ${commandId} because basic shell integration executes via sendText`
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
this._log(`Executing command line \`${commandLine}\``);
|
|
151
|
+
markerRecreation.dispose();
|
|
152
|
+
const forceBracketedPasteMode = isMacintosh || isMultilineCommand(commandLine);
|
|
153
|
+
this._instance.sendText(commandLine, true, forceBracketedPasteMode);
|
|
154
|
+
this._log("Waiting for done event");
|
|
155
|
+
const onDoneResult = await Promise.race([onDone, alternateBufferPromise.then(() => ({
|
|
156
|
+
type: "alternateBuffer"
|
|
157
|
+
}))]);
|
|
158
|
+
if (onDoneResult && onDoneResult.type === "disposal") {
|
|
159
|
+
throw ( new Error("The terminal was closed"));
|
|
160
|
+
}
|
|
161
|
+
if (onDoneResult && onDoneResult.type === "alternateBuffer") {
|
|
162
|
+
this._log("Detected alternate buffer entry, skipping output capture");
|
|
163
|
+
return {
|
|
164
|
+
output: undefined,
|
|
165
|
+
exitCode: undefined,
|
|
166
|
+
error: "alternateBuffer",
|
|
167
|
+
didEnterAltBuffer: true
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
const finishedCommand = onDoneResult && onDoneResult.type === "success" ? onDoneResult.command : undefined;
|
|
171
|
+
if (finishedCommand) {
|
|
172
|
+
this._log(
|
|
173
|
+
`Finished command id=${finishedCommand.id ?? "none"} for requested=${commandId ?? "none"}`
|
|
174
|
+
);
|
|
175
|
+
} else if (commandId) {
|
|
176
|
+
this._log(`No finished command surfaced for requested=${commandId}`);
|
|
177
|
+
}
|
|
178
|
+
if (!(onDoneResult && onDoneResult.type === "processExit")) {
|
|
179
|
+
this._log("Waiting for idle");
|
|
180
|
+
await waitForIdle(this._instance.onData, idlePollInterval);
|
|
181
|
+
}
|
|
182
|
+
if (token.isCancellationRequested) {
|
|
183
|
+
throw ( new CancellationError());
|
|
184
|
+
}
|
|
185
|
+
const endMarker = store.add(xterm.raw.registerMarker());
|
|
186
|
+
let output;
|
|
187
|
+
const additionalInformationLines = [];
|
|
188
|
+
if (finishedCommand) {
|
|
189
|
+
const commandOutput = finishedCommand?.getOutput();
|
|
190
|
+
if (commandOutput !== undefined) {
|
|
191
|
+
this._log("Fetched output via finished command");
|
|
192
|
+
output = stripCommandEchoAndPrompt(commandOutput, commandLine, this._log.bind(this));
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
if (output === undefined) {
|
|
196
|
+
try {
|
|
197
|
+
output = xterm.getContentsAsText(this._startMarker.value, endMarker);
|
|
198
|
+
this._log("Fetched output via markers");
|
|
199
|
+
if (output !== undefined) {
|
|
200
|
+
output = stripCommandEchoAndPrompt(output, commandLine, this._log.bind(this));
|
|
201
|
+
}
|
|
202
|
+
} catch {
|
|
203
|
+
this._log("Failed to fetch output via markers");
|
|
204
|
+
additionalInformationLines.push("Failed to retrieve command output");
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
if (output !== undefined && output.trim().length === 0) {
|
|
208
|
+
additionalInformationLines.push("Command produced no output");
|
|
209
|
+
}
|
|
210
|
+
let exitCode = finishedCommand?.exitCode;
|
|
211
|
+
if (exitCode === undefined && onDoneResult && onDoneResult.type === "processExit") {
|
|
212
|
+
exitCode = extractExitCode(onDoneResult.exitCodeOrError);
|
|
213
|
+
}
|
|
214
|
+
if (isNumber(exitCode) && exitCode > 0) {
|
|
215
|
+
additionalInformationLines.push(`Command exited with code ${exitCode}`);
|
|
216
|
+
}
|
|
217
|
+
return {
|
|
218
|
+
output,
|
|
219
|
+
additionalInformation: additionalInformationLines.length > 0 ? additionalInformationLines.join("\n") : undefined,
|
|
220
|
+
exitCode
|
|
221
|
+
};
|
|
222
|
+
} finally {
|
|
223
|
+
this._executionStores.delete(store);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
_log(message) {
|
|
227
|
+
this._logService.debug(`RunInTerminalTool#Basic: ${message}`);
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
BasicExecuteStrategy = ( __decorate([( __param(3, IConfigurationService)), ( __param(4, ITerminalLogService))], BasicExecuteStrategy));
|
|
231
|
+
|
|
232
|
+
export { BasicExecuteStrategy };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { CancellationToken } from "@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation";
|
|
2
|
+
import type { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
|
|
3
|
+
import { DisposableStore, type IDisposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
4
|
+
import { ITerminalLogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/terminal.service";
|
|
5
|
+
import type { ITerminalInstance } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal";
|
|
6
|
+
import type { IMarker as IXtermMarker } from "@xterm/xterm";
|
|
7
|
+
export interface ITerminalExecuteStrategy extends IDisposable {
|
|
8
|
+
readonly type: "rich" | "basic" | "none";
|
|
9
|
+
/**
|
|
10
|
+
* Executes a command line and gets a result designed to be passed directly to an LLM. The
|
|
11
|
+
* result will include information about the exit code.
|
|
12
|
+
* @param commandLine The command line to execute
|
|
13
|
+
* @param token Cancellation token
|
|
14
|
+
* @param commandId Optional predefined command ID to link the command
|
|
15
|
+
* @param commandLineForMetadata Optional command line to report in terminal execution metadata.
|
|
16
|
+
* This can differ from the command line that is sent to the shell, for example when the command
|
|
17
|
+
* is wrapped for sandbox execution.
|
|
18
|
+
*/
|
|
19
|
+
execute(commandLine: string, token: CancellationToken, commandId?: string, commandLineForMetadata?: string): Promise<ITerminalExecuteStrategyResult>;
|
|
20
|
+
readonly onDidCreateStartMarker: Event<IXtermMarker | undefined>;
|
|
21
|
+
}
|
|
22
|
+
export interface ITerminalExecuteStrategyResult {
|
|
23
|
+
output: string | undefined;
|
|
24
|
+
additionalInformation?: string;
|
|
25
|
+
exitCode?: number;
|
|
26
|
+
error?: string;
|
|
27
|
+
didEnterAltBuffer?: boolean;
|
|
28
|
+
}
|
|
29
|
+
export declare function waitForIdle(onData: Event<unknown>, idleDurationMs: number): Promise<void>;
|
|
30
|
+
export interface IPromptDetectionResult {
|
|
31
|
+
/**
|
|
32
|
+
* Whether a prompt was detected.
|
|
33
|
+
*/
|
|
34
|
+
detected: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* The reason for logging.
|
|
37
|
+
*/
|
|
38
|
+
reason?: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Detects if the given text content appears to end with a common prompt pattern.
|
|
42
|
+
*/
|
|
43
|
+
export declare function detectsCommonPromptPattern(cursorLine: string): IPromptDetectionResult;
|
|
44
|
+
/**
|
|
45
|
+
* Enhanced version of {@link waitForIdle} that uses prompt detection heuristics. After the terminal
|
|
46
|
+
* idles for the specified period, checks if the terminal's cursor line looks like a common prompt.
|
|
47
|
+
* If not, extends the timeout to give the command more time to complete.
|
|
48
|
+
*/
|
|
49
|
+
export declare function waitForIdleWithPromptHeuristics(onData: Event<unknown>, instance: ITerminalInstance, idlePollIntervalMs: number, extendedTimeoutMs: number): Promise<IPromptDetectionResult>;
|
|
50
|
+
/**
|
|
51
|
+
* Tracks the terminal for being idle on a prompt input. This must be called before `executeCommand`
|
|
52
|
+
* is called.
|
|
53
|
+
*/
|
|
54
|
+
export interface ITrackIdleOnPromptOptions {
|
|
55
|
+
/**
|
|
56
|
+
* When true, disables all fallback schedulers: the initial prompt fallback,
|
|
57
|
+
* the data-idle executing fallback, and the hard-cap safety net. Use this
|
|
58
|
+
* for sync (foreground) commands that should block until the command truly
|
|
59
|
+
* finishes rather than being abandoned after an idle period. In sync mode
|
|
60
|
+
* the overall chat-request timeout or user-specified timeout is the safety
|
|
61
|
+
* net instead.
|
|
62
|
+
*/
|
|
63
|
+
disableFallbacks?: boolean;
|
|
64
|
+
}
|
|
65
|
+
export declare function trackIdleOnPrompt(instance: ITerminalInstance, idleDurationMs: number, store: DisposableStore, promptFallbackMs?: number, logService?: ITerminalLogService, options?: ITrackIdleOnPromptOptions): Promise<void>;
|