@codingame/monaco-vscode-chat-service-override 31.0.0 → 32.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.d.ts +1 -1
- package/index.js +21 -5
- package/package.json +5 -5
- package/vscode/src/vs/base/common/defaultAccount.d.ts +69 -0
- package/vscode/src/vs/base/common/defaultAccount.js +12 -0
- package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostProtocolClient.d.ts +91 -22
- package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostProtocolClient.js +301 -68
- package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.d.ts +24 -5
- package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.js +89 -16
- package/vscode/src/vs/platform/agentHost/browser/webSocketClientTransport.d.ts +17 -5
- package/vscode/src/vs/platform/agentHost/browser/webSocketClientTransport.js +73 -10
- package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemProvider.d.ts +32 -6
- package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemProvider.js +32 -20
- package/vscode/src/vs/platform/agentHost/common/agentHostPermissionService.d.ts +37 -0
- package/vscode/src/vs/platform/agentHost/common/agentHostPermissionService.js +15 -0
- package/vscode/src/vs/platform/agentHost/common/agentService.d.ts +242 -201
- package/vscode/src/vs/platform/agentHost/common/agentService.js +3 -1
- package/vscode/src/vs/platform/agentHost/common/ahpJsonlLogger.d.ts +35 -0
- package/vscode/src/vs/platform/agentHost/common/ahpJsonlLogger.js +106 -0
- package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.d.ts +38 -30
- package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.js +2 -1
- package/vscode/src/vs/platform/agentHost/common/state/protocol/errors.d.ts +114 -4
- package/vscode/src/vs/platform/agentHost/common/state/protocol/reducers.d.ts +10 -10
- package/vscode/src/vs/platform/agentHost/common/state/protocol/reducers.js +52 -19
- package/vscode/src/vs/platform/agentHost/common/state/protocol/version/registry.d.ts +42 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/version/registry.js +7 -0
- package/vscode/src/vs/platform/agentHost/common/state/sessionActions.d.ts +42 -41
- package/vscode/src/vs/platform/agentHost/common/state/sessionTransport.d.ts +6 -6
- package/vscode/src/vs/platform/agentHost/common/transportConstants.d.ts +15 -0
- package/vscode/src/vs/platform/agentHost/common/transportConstants.js +6 -0
- package/vscode/src/vs/platform/agentPlugins/common/pluginParsers.d.ts +4 -3
- package/vscode/src/vs/platform/agentPlugins/common/pluginParsers.js +4 -3
- package/vscode/src/vs/platform/networkFilter/common/networkFilterService.d.ts +4 -2
- package/vscode/src/vs/platform/networkFilter/common/networkFilterService.js +15 -7
- package/vscode/src/vs/workbench/contrib/browserView/common/browserChatToolReferenceNames.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/browserView/common/browserChatToolReferenceNames.js +17 -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 +16 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.js +14 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +64 -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 +31 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +18 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.d.ts +16 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +30 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatForkActions.js +8 -7
- 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 +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatOpenAgentDebugPanelAction.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPluginActions.js +27 -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 +21 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/createPluginAction.js +22 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/reviewEdits.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/reviewEdits.js +171 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginActions.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditorInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginItems.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.d.ts +3 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.js +12 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPermissionUiContribution.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPermissionUiContribution.js +99 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectoryResolver.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectoryResolver.js +11 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.js +9 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.js +63 -53
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.js +10 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsQuickAccess.js +3 -3
- 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 +5 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.js +25 -48
- 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.js +5 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.d.ts +8 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.js +99 -39
- 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 +17 -30
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemsModel.d.ts +78 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemsModel.js +38 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.d.ts +35 -37
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.js +347 -326
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidgetUtils.d.ts +6 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidgetUtils.js +1 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.contribution.js +113 -109
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.d.ts +37 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.js +436 -134
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePagePromptLaunchers.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePagePromptLaunchers.js +52 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCreatorService.js +7 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.js +13 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedAgentPluginDetail.d.ts +23 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedAgentPluginDetail.js +60 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedMcpServerDetail.d.ts +25 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedMcpServerDetail.js +93 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.d.ts +9 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.js +73 -104
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationManagement.css +272 -41
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationWelcomePromptLaunchers.css +12 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.d.ts +30 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.js +430 -185
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.d.ts +5 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.js +44 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +480 -279
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.js +32 -32
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheDiff.d.ts +138 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheDiff.js +221 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheExplorerView.d.ts +84 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheExplorerView.js +1216 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugDetailPanel.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditor.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditor.js +32 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditorInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventDetailRenderer.js +26 -19
- 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 +28 -25
- 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 +25 -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.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugOverviewView.js +68 -33
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugToolCallContentRenderer.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugTypes.d.ts +3 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugTypes.js +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/media/chatDebug.css +650 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.d.ts +46 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +533 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.d.ts +29 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +390 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.d.ts +101 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +509 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +18 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +3 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditingEditorOverlay.css +130 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditingExplanationWidget.css +276 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatImageCarouselService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.js +8 -7
- 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 +1 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.js +6 -87
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.js +116 -182
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/media/chatModelsWidget.css +12 -39
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +31 -31
- package/vscode/src/vs/workbench/contrib/chat/browser/chatRepoInfo.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.js +61 -41
- 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 +27 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.js +16 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.js +106 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.d.ts +25 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.js +629 -425
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.d.ts +9 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.js +105 -29
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusItemService.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/media/chatStatus.css +175 -148
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipCatalog.js +20 -33
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.js +9 -2
- 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/defaultModelContribution.js +4 -4
- 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.d.ts +58 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/githubRepoFetcher.js +339 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/media/planReviewFeedback.css +160 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorActions.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorActions.js +123 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorContribution.d.ts +37 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorContribution.js +572 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackService.d.ts +36 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackService.js +167 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginGitCommandService.d.ts +49 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginGitCommandService.js +315 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.js +45 -24
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.js +15 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginUrlHandler.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.js +44 -40
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionOverlay.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptFileContributions.js +4 -1
- 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.d.ts +9 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.js +111 -52
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.d.ts +3 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.js +13 -47
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolHelpers.d.ts +3 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolHelpers.js +4 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolResultCompressorService.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolResultCompressorService.js +56 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.d.ts +3 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.js +14 -52
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidgetService.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidgetService.js +17 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.js +23 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletions.d.ts +39 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletions.js +136 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletionsBase.d.ts +72 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletionsBase.js +56 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletionUtils.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletionUtils.js +14 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.js +41 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorContrib.js +30 -12
- 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 +2 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.js +25 -6
- 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 +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.js +5 -4
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.js +108 -45
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceTelemetry.js +7 -3
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionOperationLog.js +3 -1
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.d.ts +20 -1
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.js +65 -26
- package/vscode/src/vs/workbench/contrib/chat/common/participants/chatSlashCommands.d.ts +5 -3
- package/vscode/src/vs/workbench/contrib/chat/common/participants/chatSlashCommands.js +38 -11
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.d.ts +17 -1
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.js +165 -16
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.js +62 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +18 -18
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/PromptHeaderDefinitionProvider.js +2 -1
- 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.d.ts +1 -3
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +15 -21
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.d.ts +1 -3
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.js +18 -24
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.d.ts +4 -2
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.js +203 -180
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/workingDirectory.d.ts +30 -0
- package/vscode/src/vs/workbench/contrib/chat/common/workingDirectory.js +35 -0
- package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/aiEditTelemetry/aiEditTelemetryServiceImpl.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/aiEditTelemetry/aiEditTelemetryServiceImpl.js +27 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +14 -49
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.d.ts +0 -16
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +35 -177
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatDefaultModel.js +2 -8
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.d.ts +1 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.js +2 -3
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.d.ts +4 -4
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +11 -11
- 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 +13 -13
- 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 +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.d.ts +29 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +129 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.js +3 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +14 -6
- 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 +1 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +12 -38
- 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/runInTerminalConfirmationTool.js +2 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sendToTerminalTool.d.ts +12 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sendToTerminalTool.js +77 -70
- 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.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalOutputCompressor.d.ts +32 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalOutputCompressor.js +232 -0
- package/vscode/src/vs/workbench/services/agentHost/common/agentHostPermissionService.d.ts +83 -0
- package/vscode/src/vs/workbench/services/agentHost/common/agentHostPermissionService.js +243 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/commands.d.ts +0 -749
- package/vscode/src/vs/platform/agentHost/common/state/protocol/commands.js +0 -14
- package/vscode/src/vs/platform/agentHost/common/state/sessionCapabilities.d.ts +0 -17
- package/vscode/src/vs/platform/agentHost/common/state/sessionCapabilities.js +0 -5
- package/vscode/src/vs/platform/agentHost/common/state/sessionProtocol.d.ts +0 -40
- package/vscode/src/vs/platform/agentHost/common/state/sessionProtocol.js +0 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.d.ts +0 -61
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.js +0 -638
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemSource.d.ts +0 -131
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemSource.js +0 -363
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/promptsServiceCustomizationItemProvider.d.ts +0 -24
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/promptsServiceCustomizationItemProvider.js +0 -306
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatStatusWidget.d.ts +0 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatStatusWidget.js +0 -97
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/media/chatStatusWidget.css +0 -57
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.d.ts +0 -50
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.js +0 -29
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookClaudeCompat.d.ts +0 -50
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookClaudeCompat.js +0 -78
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCompatibility.d.ts +0 -77
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCompatibility.js +0 -120
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCopilotCliCompat.d.ts +0 -10
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCopilotCliCompat.js +0 -23
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.d.ts +0 -242
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.js +0 -1701
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts +0 -191
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +0 -728
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatHistoryService.d.ts +0 -14
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatHistoryService.js +0 -69
|
@@ -23,6 +23,7 @@ import { ILanguageModelChatMetadata } from "@codingame/monaco-vscode-api/vscode/
|
|
|
23
23
|
import { ILanguageModelToolsConfirmationService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsConfirmationService.service";
|
|
24
24
|
import { CountTokensCallback, IBeginToolCallOptions, IToolAndToolSetEnablementMap, IToolData, IToolImpl, IToolInvocation, IToolInvokedEvent, IToolResult, IToolSet, ToolDataSource, ToolSet } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService";
|
|
25
25
|
import { ILanguageModelToolsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService.service";
|
|
26
|
+
import { IToolResultCompressor } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/toolResultCompressor.service";
|
|
26
27
|
import { IChatWidgetService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service";
|
|
27
28
|
export declare enum AutoApproveStorageKeys {
|
|
28
29
|
GlobalAutoApproveOptIn = "chat.tools.global.autoApprove.optIn"
|
|
@@ -43,6 +44,7 @@ export declare class LanguageModelToolsService extends Disposable implements ILa
|
|
|
43
44
|
private readonly _confirmationService;
|
|
44
45
|
private readonly _commandService;
|
|
45
46
|
private readonly _chatWidgetService;
|
|
47
|
+
private readonly _toolResultCompressor;
|
|
46
48
|
_serviceBrand: undefined;
|
|
47
49
|
readonly vscodeToolSet: ToolSet;
|
|
48
50
|
readonly executeToolSet: ToolSet;
|
|
@@ -68,7 +70,7 @@ export declare class LanguageModelToolsService extends Disposable implements ILa
|
|
|
68
70
|
/** Deduplicates _checkGlobalAutoApprove calls within this window */
|
|
69
71
|
private _pendingGlobalAutoApproveCheck;
|
|
70
72
|
private readonly _isAgentModeEnabled;
|
|
71
|
-
constructor(_instantiationService: IInstantiationService, _extensionService: IExtensionService, _contextKeyService: IContextKeyService, _chatService: IChatService, _dialogService: IDialogService, _telemetryService: ITelemetryService, _logService: ILogService, _configurationService: IConfigurationService, _accessibilityService: IAccessibilityService, _accessibilitySignalService: IAccessibilitySignalService, _storageService: IStorageService, _confirmationService: ILanguageModelToolsConfirmationService, _commandService: ICommandService, _chatWidgetService: IChatWidgetService);
|
|
73
|
+
constructor(_instantiationService: IInstantiationService, _extensionService: IExtensionService, _contextKeyService: IContextKeyService, _chatService: IChatService, _dialogService: IDialogService, _telemetryService: ITelemetryService, _logService: ILogService, _configurationService: IConfigurationService, _accessibilityService: IAccessibilityService, _accessibilitySignalService: IAccessibilitySignalService, _storageService: IStorageService, _confirmationService: ILanguageModelToolsConfirmationService, _commandService: ICommandService, _chatWidgetService: IChatWidgetService, _toolResultCompressor: IToolResultCompressor);
|
|
72
74
|
/**
|
|
73
75
|
* Returns if the given tool or toolset is permitted in the current context.
|
|
74
76
|
* When agent mode is enabled, all tools are permitted (no restriction)
|
|
@@ -95,6 +97,7 @@ export declare class LanguageModelToolsService extends Disposable implements ILa
|
|
|
95
97
|
private _validateUpdatedInput;
|
|
96
98
|
invokeTool(dto: IToolInvocation, countTokens: CountTokensCallback, token: CancellationToken): Promise<IToolResult>;
|
|
97
99
|
private prepareToolInvocationWithHookResult;
|
|
100
|
+
private _logToolApprovalTelemetry;
|
|
98
101
|
/**
|
|
99
102
|
* Determines the auto-confirm decision based on a preToolUse hook result.
|
|
100
103
|
* If the hook returned 'allow', auto-approves. If 'ask', forces confirmation
|
|
@@ -131,6 +134,11 @@ export declare class LanguageModelToolsService extends Disposable implements ILa
|
|
|
131
134
|
* so switching to Autopilot mid-session takes effect immediately.
|
|
132
135
|
*/
|
|
133
136
|
private _isSessionLiveAutoApproveLevel;
|
|
137
|
+
/**
|
|
138
|
+
* True if the session is in an auto-approve level (Auto-Approve / Autopilot),
|
|
139
|
+
* via either the last request's stamped level or the live picker level.
|
|
140
|
+
*/
|
|
141
|
+
private _isSessionInAutoApproveLevel;
|
|
134
142
|
private getEligibleForAutoApprovalSpecialCase;
|
|
135
143
|
private isToolEligibleForAutoApproval;
|
|
136
144
|
private shouldAutoConfirm;
|
|
@@ -47,6 +47,7 @@ import { chatSessionResourceToId, getChatSessionType } from '@codingame/monaco-v
|
|
|
47
47
|
import { HookType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/hookTypes';
|
|
48
48
|
import { ILanguageModelToolsConfirmationService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsConfirmationService.service';
|
|
49
49
|
import { ToolDataSource, VSCodeToolReference, SpecedToolAliases, isToolSet, createToolSchemaUri, toolMatchesModel, ToolInvocationPresentation, stringifyPromptTsxPart, ToolSetForModel, ToolSet } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService';
|
|
50
|
+
import { IToolResultCompressor } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/toolResultCompressor.service';
|
|
50
51
|
import { getToolConfirmationAlert } from '@codingame/monaco-vscode-katex-common/vscode/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityProvider';
|
|
51
52
|
import { IChatWidgetService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service';
|
|
52
53
|
import { ObservableSet } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/set';
|
|
@@ -67,7 +68,7 @@ const toolIdsThatCannotBeAutoApproved = ( new Set([
|
|
|
67
68
|
"vscode_get_modified_files_confirmation"
|
|
68
69
|
]));
|
|
69
70
|
const globalAutoApproveDescription = ( localize2(
|
|
70
|
-
|
|
71
|
+
6987,
|
|
71
72
|
"Global auto approve also known as \"YOLO mode\" disables manual approval completely for _all tools in all workspaces_, allowing the agent to act fully autonomously. This is extremely dangerous and is *never* recommended, even containerized environments like [Codespaces](https://github.com/features/codespaces) and [Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) have user keys forwarded into the container that could be compromised.\n\n**This feature disables [critical security protections](https://code.visualstudio.com/docs/copilot/security) and makes it much easier for an attacker to compromise the machine.**\n\nNote: This setting only controls tool approval and does not prevent the agent from asking questions. To automatically answer agent questions, use the [`chat.autoReply`](command:workbench.action.openSettings?%5B%22chat.autoReply%22%5D) setting."
|
|
72
73
|
));
|
|
73
74
|
let LanguageModelToolsService = class LanguageModelToolsService extends Disposable {
|
|
@@ -88,7 +89,8 @@ let LanguageModelToolsService = class LanguageModelToolsService extends Disposab
|
|
|
88
89
|
_storageService,
|
|
89
90
|
_confirmationService,
|
|
90
91
|
_commandService,
|
|
91
|
-
_chatWidgetService
|
|
92
|
+
_chatWidgetService,
|
|
93
|
+
_toolResultCompressor
|
|
92
94
|
) {
|
|
93
95
|
super();
|
|
94
96
|
this._instantiationService = _instantiationService;
|
|
@@ -105,6 +107,7 @@ let LanguageModelToolsService = class LanguageModelToolsService extends Disposab
|
|
|
105
107
|
this._confirmationService = _confirmationService;
|
|
106
108
|
this._commandService = _commandService;
|
|
107
109
|
this._chatWidgetService = _chatWidgetService;
|
|
110
|
+
this._toolResultCompressor = _toolResultCompressor;
|
|
108
111
|
this._onDidChangeTools = this._register(( new Emitter()));
|
|
109
112
|
this.onDidChangeTools = this._onDidChangeTools.event;
|
|
110
113
|
this._onDidPrepareToolCallBecomeUnresponsive = this._register(( new Emitter()));
|
|
@@ -170,25 +173,25 @@ let LanguageModelToolsService = class LanguageModelToolsService extends Disposab
|
|
|
170
173
|
this.vscodeToolSet = this._register(
|
|
171
174
|
this.createToolSet(ToolDataSource.Internal, "vscode", VSCodeToolReference.vscode, {
|
|
172
175
|
icon: ThemeIcon.fromId(Codicon.vscode.id),
|
|
173
|
-
description: ( localize(
|
|
176
|
+
description: ( localize(6988, "Use VS Code features"))
|
|
174
177
|
})
|
|
175
178
|
);
|
|
176
179
|
this.executeToolSet = this._register(
|
|
177
180
|
this.createToolSet(ToolDataSource.Internal, "execute", SpecedToolAliases.execute, {
|
|
178
181
|
icon: ThemeIcon.fromId(Codicon.terminal.id),
|
|
179
|
-
description: ( localize(
|
|
182
|
+
description: ( localize(6989, "Execute code and applications on your machine"))
|
|
180
183
|
})
|
|
181
184
|
);
|
|
182
185
|
this.readToolSet = this._register(
|
|
183
186
|
this.createToolSet(ToolDataSource.Internal, "read", SpecedToolAliases.read, {
|
|
184
187
|
icon: ThemeIcon.fromId(Codicon.book.id),
|
|
185
|
-
description: ( localize(
|
|
188
|
+
description: ( localize(6990, "Read files in your workspace"))
|
|
186
189
|
})
|
|
187
190
|
);
|
|
188
191
|
this.agentToolSet = this._register(
|
|
189
192
|
this.createToolSet(ToolDataSource.Internal, "agent", SpecedToolAliases.agent, {
|
|
190
193
|
icon: ThemeIcon.fromId(Codicon.agent.id),
|
|
191
|
-
description: ( localize(
|
|
194
|
+
description: ( localize(6991, "Delegate tasks to other agents"))
|
|
192
195
|
})
|
|
193
196
|
);
|
|
194
197
|
}
|
|
@@ -342,8 +345,8 @@ let LanguageModelToolsService = class LanguageModelToolsService extends Disposab
|
|
|
342
345
|
return undefined;
|
|
343
346
|
}
|
|
344
347
|
_handlePreToolUseDenial(dto, hookResult, toolData, pendingInvocation, request) {
|
|
345
|
-
const hookReason = hookResult.permissionDecisionReason ?? ( localize(
|
|
346
|
-
const reason = ( localize(
|
|
348
|
+
const hookReason = hookResult.permissionDecisionReason ?? ( localize(6992, "Hook denied tool execution"));
|
|
349
|
+
const reason = ( localize(6993, "Denied by {0} hook: {1}", HookType.PreToolUse, hookReason));
|
|
347
350
|
this._logService.debug(
|
|
348
351
|
`[LanguageModelToolsService#invokeTool] Tool ${dto.toolId} denied by preToolUse hook: ${hookReason}`
|
|
349
352
|
);
|
|
@@ -405,6 +408,15 @@ let LanguageModelToolsService = class LanguageModelToolsService extends Disposab
|
|
|
405
408
|
);
|
|
406
409
|
throw ( new CancellationError());
|
|
407
410
|
}
|
|
411
|
+
if (model?.workingDirectory && !dto.context.workingDirectory) {
|
|
412
|
+
dto = {
|
|
413
|
+
...dto,
|
|
414
|
+
context: {
|
|
415
|
+
...dto.context,
|
|
416
|
+
workingDirectory: model.workingDirectory
|
|
417
|
+
}
|
|
418
|
+
};
|
|
419
|
+
}
|
|
408
420
|
}
|
|
409
421
|
let pendingToolCallKey;
|
|
410
422
|
let toolInvocation;
|
|
@@ -537,6 +549,7 @@ let LanguageModelToolsService = class LanguageModelToolsService extends Disposab
|
|
|
537
549
|
this.playAccessibilitySignal([toolInvocation], dto.context?.sessionResource);
|
|
538
550
|
}
|
|
539
551
|
const userConfirmed = await IChatToolInvocation.awaitConfirmation(toolInvocation, token);
|
|
552
|
+
this._logToolApprovalTelemetry(tool, dto, userConfirmed);
|
|
540
553
|
if (userConfirmed.type === ToolConfirmKind.Denied) {
|
|
541
554
|
throw ( new CancellationError());
|
|
542
555
|
}
|
|
@@ -556,6 +569,10 @@ let LanguageModelToolsService = class LanguageModelToolsService extends Disposab
|
|
|
556
569
|
dto.parameters = dto.toolSpecificData.rawInput;
|
|
557
570
|
dto.toolSpecificData = undefined;
|
|
558
571
|
}
|
|
572
|
+
} else {
|
|
573
|
+
this._logToolApprovalTelemetry(tool, dto, autoConfirmed ?? {
|
|
574
|
+
type: ToolConfirmKind.ConfirmationNotNeeded
|
|
575
|
+
});
|
|
559
576
|
}
|
|
560
577
|
} else {
|
|
561
578
|
prepareTimeWatch = StopWatch.create(true);
|
|
@@ -587,6 +604,10 @@ let LanguageModelToolsService = class LanguageModelToolsService extends Disposab
|
|
|
587
604
|
}
|
|
588
605
|
}, token);
|
|
589
606
|
invocationTimeWatch.stop();
|
|
607
|
+
const compressed = this._toolResultCompressor.maybeCompress(tool.data.id, dto.parameters, toolResult);
|
|
608
|
+
if (compressed) {
|
|
609
|
+
toolResult = compressed;
|
|
610
|
+
}
|
|
590
611
|
this.ensureToolDetails(dto, toolResult, tool.data, toolInvocation);
|
|
591
612
|
const afterExecuteState = await toolInvocation?.didExecuteTool(toolResult, undefined, () => this.shouldAutoConfirmPostExecution(
|
|
592
613
|
tool.data.id,
|
|
@@ -594,7 +615,8 @@ let LanguageModelToolsService = class LanguageModelToolsService extends Disposab
|
|
|
594
615
|
tool.data.source,
|
|
595
616
|
dto.parameters,
|
|
596
617
|
dto.context?.sessionResource,
|
|
597
|
-
dto.chatRequestId
|
|
618
|
+
dto.chatRequestId,
|
|
619
|
+
dto.context?.workingDirectory
|
|
598
620
|
));
|
|
599
621
|
if (toolInvocation && afterExecuteState?.type === IChatToolInvocation.StateKind.WaitingForPostApproval) {
|
|
600
622
|
const postConfirm = await IChatToolInvocation.awaitPostConfirmation(toolInvocation, token);
|
|
@@ -662,11 +684,41 @@ let LanguageModelToolsService = class LanguageModelToolsService extends Disposab
|
|
|
662
684
|
async prepareToolInvocationWithHookResult(tool, dto, hookResult, token) {
|
|
663
685
|
let forceConfirmationReason;
|
|
664
686
|
if (hookResult?.permissionDecision === "ask") {
|
|
665
|
-
const hookMessage = ( localize(
|
|
687
|
+
const hookMessage = ( localize(6994, "{0} required confirmation", HookType.PreToolUse));
|
|
666
688
|
forceConfirmationReason = hookResult.permissionDecisionReason ? `${hookMessage}: ${hookResult.permissionDecisionReason}` : hookMessage;
|
|
667
689
|
}
|
|
668
690
|
return this.prepareToolInvocation(tool, dto, forceConfirmationReason, token);
|
|
669
691
|
}
|
|
692
|
+
_logToolApprovalTelemetry(tool, dto, reason) {
|
|
693
|
+
const confirmKindNames = {
|
|
694
|
+
[ToolConfirmKind.Denied]: "denied",
|
|
695
|
+
[ToolConfirmKind.ConfirmationNotNeeded]: "confirmationNotNeeded",
|
|
696
|
+
[ToolConfirmKind.Setting]: "setting",
|
|
697
|
+
[ToolConfirmKind.LmServicePerTool]: "lmServicePerTool",
|
|
698
|
+
[ToolConfirmKind.UserAction]: "userAction",
|
|
699
|
+
[ToolConfirmKind.Skipped]: "skipped"
|
|
700
|
+
};
|
|
701
|
+
const allowedConfirmationNotNeededReasons = ( new Set(["auto-approve-all", "inlineChat"]));
|
|
702
|
+
let confirmationNotNeededReason;
|
|
703
|
+
if (reason.type === ToolConfirmKind.ConfirmationNotNeeded && reason.reason) {
|
|
704
|
+
const raw = typeof reason.reason === "string" ? reason.reason : reason.reason.value;
|
|
705
|
+
confirmationNotNeededReason = ( allowedConfirmationNotNeededReasons.has(raw)) ? raw : "other";
|
|
706
|
+
}
|
|
707
|
+
const terminalData = dto.toolSpecificData?.kind === "terminal" ? dto.toolSpecificData : undefined;
|
|
708
|
+
this._telemetryService.publicLog2("chat.toolApproval", {
|
|
709
|
+
confirmKind: confirmKindNames[reason.type],
|
|
710
|
+
settingId: reason.type === ToolConfirmKind.Setting ? reason.id : undefined,
|
|
711
|
+
lmServiceScope: reason.type === ToolConfirmKind.LmServicePerTool ? reason.scope : undefined,
|
|
712
|
+
customButtonKind: reason.type === ToolConfirmKind.UserAction ? reason.selectedButtonKind : undefined,
|
|
713
|
+
confirmationNotNeededReason,
|
|
714
|
+
sandboxWrapped: terminalData?.commandLine.isSandboxWrapped,
|
|
715
|
+
requestUnsandboxedExecution: terminalData?.requestUnsandboxedExecution,
|
|
716
|
+
chatSessionId: dto.context?.sessionResource ? chatSessionResourceToId(dto.context.sessionResource) : undefined,
|
|
717
|
+
toolId: tool.data.id,
|
|
718
|
+
toolExtensionId: tool.data.source.type === "extension" ? tool.data.source.extensionId.value : undefined,
|
|
719
|
+
toolSourceKind: tool.data.source.type
|
|
720
|
+
});
|
|
721
|
+
}
|
|
670
722
|
async resolveAutoConfirmFromHook(hookResult, tool, dto, preparedInvocation, sessionResource) {
|
|
671
723
|
if (hookResult?.permissionDecision === "allow") {
|
|
672
724
|
this._logService.debug(
|
|
@@ -675,7 +727,7 @@ let LanguageModelToolsService = class LanguageModelToolsService extends Disposab
|
|
|
675
727
|
return {
|
|
676
728
|
autoConfirmed: {
|
|
677
729
|
type: ToolConfirmKind.ConfirmationNotNeeded,
|
|
678
|
-
reason: ( localize(
|
|
730
|
+
reason: ( localize(6995, "Allowed by hook"))
|
|
679
731
|
},
|
|
680
732
|
preparedInvocation
|
|
681
733
|
};
|
|
@@ -691,14 +743,14 @@ let LanguageModelToolsService = class LanguageModelToolsService extends Disposab
|
|
|
691
743
|
const fullReferenceName = getToolFullReferenceName(tool.data);
|
|
692
744
|
const hookReason = hookResult.permissionDecisionReason;
|
|
693
745
|
const hookNote = hookReason ? ( localize(
|
|
694
|
-
|
|
746
|
+
6996,
|
|
695
747
|
"{0} hook required confirmation: {1}",
|
|
696
748
|
HookType.PreToolUse,
|
|
697
749
|
hookReason
|
|
698
|
-
)) : ( localize(
|
|
750
|
+
)) : ( localize(6997, "{0} hook required confirmation", HookType.PreToolUse));
|
|
699
751
|
preparedInvocation.confirmationMessages = {
|
|
700
752
|
...preparedInvocation.confirmationMessages,
|
|
701
|
-
title: ( localize(
|
|
753
|
+
title: ( localize(6998, "Use the '{0}' tool?", fullReferenceName)),
|
|
702
754
|
message: ( new MarkdownString(`_${hookNote}_`)),
|
|
703
755
|
allowAutoConfirm: false
|
|
704
756
|
};
|
|
@@ -709,11 +761,11 @@ let LanguageModelToolsService = class LanguageModelToolsService extends Disposab
|
|
|
709
761
|
} else {
|
|
710
762
|
const hookReason = hookResult.permissionDecisionReason;
|
|
711
763
|
const hookNote = hookReason ? ( localize(
|
|
712
|
-
|
|
764
|
+
6999,
|
|
713
765
|
"{0} hook required confirmation: {1}",
|
|
714
766
|
HookType.PreToolUse,
|
|
715
767
|
hookReason
|
|
716
|
-
)) : ( localize(
|
|
768
|
+
)) : ( localize(7000, "{0} hook required confirmation", HookType.PreToolUse));
|
|
717
769
|
const existing = preparedInvocation.confirmationMessages;
|
|
718
770
|
if (preparedInvocation.toolSpecificData?.kind === "terminal") {
|
|
719
771
|
const existingDisclaimerText = existing.disclaimer ? (typeof existing.disclaimer === "string" ? existing.disclaimer : existing.disclaimer.value) : undefined;
|
|
@@ -752,7 +804,8 @@ let LanguageModelToolsService = class LanguageModelToolsService extends Disposab
|
|
|
752
804
|
dto.parameters,
|
|
753
805
|
sessionResource,
|
|
754
806
|
dto.chatRequestId,
|
|
755
|
-
combination
|
|
807
|
+
combination,
|
|
808
|
+
dto.context?.workingDirectory
|
|
756
809
|
);
|
|
757
810
|
return {
|
|
758
811
|
autoConfirmed,
|
|
@@ -769,7 +822,8 @@ let LanguageModelToolsService = class LanguageModelToolsService extends Disposab
|
|
|
769
822
|
chatSessionResource: dto.context?.sessionResource,
|
|
770
823
|
chatInteractionId: dto.chatInteractionId,
|
|
771
824
|
modelId: dto.modelId,
|
|
772
|
-
forceConfirmationReason: forceConfirmationReason
|
|
825
|
+
forceConfirmationReason: forceConfirmationReason,
|
|
826
|
+
workingDirectory: dto.context?.workingDirectory
|
|
773
827
|
}, token);
|
|
774
828
|
const raceResult = await Promise.race([timeout(3000, token).then(() => "timeout"), preparePromise]);
|
|
775
829
|
if (raceResult === "timeout" && dto.context) {
|
|
@@ -788,17 +842,17 @@ let LanguageModelToolsService = class LanguageModelToolsService extends Disposab
|
|
|
788
842
|
const fullReferenceName = getToolFullReferenceName(tool.data);
|
|
789
843
|
prepared.confirmationMessages = {
|
|
790
844
|
...prepared.confirmationMessages,
|
|
791
|
-
title: ( localize(
|
|
792
|
-
message: ( localize(
|
|
845
|
+
title: ( localize(7001, "Confirm tool execution")),
|
|
846
|
+
message: ( localize(7002, "Run the '{0}' tool?", fullReferenceName)),
|
|
793
847
|
disclaimer: ( toolIdsThatCannotBeAutoApproved.has(tool.data.id)) ? undefined : ( new MarkdownString(( localize(
|
|
794
|
-
|
|
848
|
+
7003,
|
|
795
849
|
"Auto approval for '{0}' is restricted via {1}.",
|
|
796
850
|
getToolFullReferenceName(tool.data),
|
|
797
851
|
createMarkdownCommandLink({
|
|
798
852
|
text: "`" + ChatConfiguration.EligibleForAutoApproval + "`",
|
|
799
853
|
id: "workbench.action.openSettings",
|
|
800
854
|
arguments: [ChatConfiguration.EligibleForAutoApproval],
|
|
801
|
-
tooltip: ( localize(
|
|
855
|
+
tooltip: ( localize(7004, "Open settings to configure auto-approval"))
|
|
802
856
|
}, false)
|
|
803
857
|
)), {
|
|
804
858
|
isTrusted: true
|
|
@@ -808,14 +862,14 @@ let LanguageModelToolsService = class LanguageModelToolsService extends Disposab
|
|
|
808
862
|
}
|
|
809
863
|
if (!isEligibleForAutoApproval && prepared?.confirmationMessages?.title) {
|
|
810
864
|
prepared.confirmationMessages.disclaimer = ( toolIdsThatCannotBeAutoApproved.has(tool.data.id)) ? undefined : ( new MarkdownString(( localize(
|
|
811
|
-
|
|
865
|
+
7003,
|
|
812
866
|
"Auto approval for '{0}' is restricted via {1}.",
|
|
813
867
|
getToolFullReferenceName(tool.data),
|
|
814
868
|
createMarkdownCommandLink({
|
|
815
869
|
text: "`" + ChatConfiguration.EligibleForAutoApproval + "`",
|
|
816
870
|
id: "workbench.action.openSettings",
|
|
817
871
|
arguments: [ChatConfiguration.EligibleForAutoApproval],
|
|
818
|
-
tooltip: ( localize(
|
|
872
|
+
tooltip: ( localize(7004, "Open settings to configure auto-approval"))
|
|
819
873
|
}, false)
|
|
820
874
|
)), {
|
|
821
875
|
isTrusted: true
|
|
@@ -995,6 +1049,14 @@ let LanguageModelToolsService = class LanguageModelToolsService extends Disposab
|
|
|
995
1049
|
const widget = this._chatWidgetService.getWidgetBySessionResource(chatSessionResource) ?? this._chatWidgetService.lastFocusedWidget;
|
|
996
1050
|
return !!widget && isAutoApproveLevel(widget.input.currentModeInfo.permissionLevel);
|
|
997
1051
|
}
|
|
1052
|
+
_isSessionInAutoApproveLevel(chatSessionResource) {
|
|
1053
|
+
if (!chatSessionResource) {
|
|
1054
|
+
return false;
|
|
1055
|
+
}
|
|
1056
|
+
const model = this._chatService.getSession(chatSessionResource);
|
|
1057
|
+
const request = model?.getRequests().at(-1);
|
|
1058
|
+
return isAutoApproveLevel(request?.modeInfo?.permissionLevel) || this._isSessionLiveAutoApproveLevel(chatSessionResource);
|
|
1059
|
+
}
|
|
998
1060
|
getEligibleForAutoApprovalSpecialCase(toolData) {
|
|
999
1061
|
if (toolData.id === "vscode_fetchWebPage_internal") {
|
|
1000
1062
|
return "fetch";
|
|
@@ -1037,22 +1099,19 @@ let LanguageModelToolsService = class LanguageModelToolsService extends Disposab
|
|
|
1037
1099
|
parameters,
|
|
1038
1100
|
chatSessionResource,
|
|
1039
1101
|
chatRequestId,
|
|
1040
|
-
combination
|
|
1102
|
+
combination,
|
|
1103
|
+
workingDirectory
|
|
1041
1104
|
) {
|
|
1042
1105
|
const tool = this._tools.get(toolId);
|
|
1043
1106
|
if (!tool) {
|
|
1044
1107
|
return undefined;
|
|
1045
1108
|
}
|
|
1046
|
-
if (chatSessionResource && !this._isAutoApprovePolicyRestricted()) {
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
type: ToolConfirmKind.ConfirmationNotNeeded,
|
|
1053
|
-
reason: "auto-approve-all"
|
|
1054
|
-
};
|
|
1055
|
-
}
|
|
1109
|
+
if (chatSessionResource && !this._isAutoApprovePolicyRestricted() && this._isSessionInAutoApproveLevel(chatSessionResource)) {
|
|
1110
|
+
if (!(( toolIdsThatCannotBeAutoApproved.has(tool.data.id)) && getChatSessionType(chatSessionResource) !== localChatSessionType)) {
|
|
1111
|
+
return {
|
|
1112
|
+
type: ToolConfirmKind.ConfirmationNotNeeded,
|
|
1113
|
+
reason: "auto-approve-all"
|
|
1114
|
+
};
|
|
1056
1115
|
}
|
|
1057
1116
|
}
|
|
1058
1117
|
if (!this.isToolEligibleForAutoApproval(tool.data)) {
|
|
@@ -1063,6 +1122,7 @@ let LanguageModelToolsService = class LanguageModelToolsService extends Disposab
|
|
|
1063
1122
|
source,
|
|
1064
1123
|
parameters,
|
|
1065
1124
|
chatSessionResource,
|
|
1125
|
+
workingDirectory,
|
|
1066
1126
|
combination
|
|
1067
1127
|
});
|
|
1068
1128
|
if (reason) {
|
|
@@ -1093,21 +1153,19 @@ let LanguageModelToolsService = class LanguageModelToolsService extends Disposab
|
|
|
1093
1153
|
source,
|
|
1094
1154
|
parameters,
|
|
1095
1155
|
chatSessionResource,
|
|
1096
|
-
chatRequestId
|
|
1156
|
+
chatRequestId,
|
|
1157
|
+
workingDirectory
|
|
1097
1158
|
) {
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
reason: "auto-approve-all"
|
|
1106
|
-
};
|
|
1107
|
-
}
|
|
1159
|
+
const sessionAutoApprove = chatSessionResource && !this._isAutoApprovePolicyRestricted() && this._isSessionInAutoApproveLevel(chatSessionResource);
|
|
1160
|
+
if (sessionAutoApprove) {
|
|
1161
|
+
if (!(( toolIdsThatCannotBeAutoApproved.has(toolId)) && getChatSessionType(chatSessionResource) !== localChatSessionType)) {
|
|
1162
|
+
return {
|
|
1163
|
+
type: ToolConfirmKind.ConfirmationNotNeeded,
|
|
1164
|
+
reason: "auto-approve-all"
|
|
1165
|
+
};
|
|
1108
1166
|
}
|
|
1109
1167
|
}
|
|
1110
|
-
if (this._configurationService.getValue(ChatConfiguration.GlobalAutoApprove) && (await this._checkGlobalAutoApprove())) {
|
|
1168
|
+
if (this._configurationService.getValue(ChatConfiguration.GlobalAutoApprove) && !sessionAutoApprove && (await this._checkGlobalAutoApprove())) {
|
|
1111
1169
|
return {
|
|
1112
1170
|
type: ToolConfirmKind.Setting,
|
|
1113
1171
|
id: ChatConfiguration.GlobalAutoApprove
|
|
@@ -1117,7 +1175,8 @@ let LanguageModelToolsService = class LanguageModelToolsService extends Disposab
|
|
|
1117
1175
|
toolId,
|
|
1118
1176
|
source,
|
|
1119
1177
|
parameters,
|
|
1120
|
-
chatSessionResource
|
|
1178
|
+
chatSessionResource,
|
|
1179
|
+
workingDirectory
|
|
1121
1180
|
});
|
|
1122
1181
|
}
|
|
1123
1182
|
async _checkGlobalAutoApprove() {
|
|
@@ -1162,12 +1221,12 @@ let LanguageModelToolsService = class LanguageModelToolsService extends Disposab
|
|
|
1162
1221
|
}));
|
|
1163
1222
|
const promptResult = await this._dialogService.prompt({
|
|
1164
1223
|
type: Severity.Warning,
|
|
1165
|
-
message: ( localize(
|
|
1224
|
+
message: ( localize(7005, "Enable global auto approve?")),
|
|
1166
1225
|
buttons: [{
|
|
1167
|
-
label: ( localize(
|
|
1226
|
+
label: ( localize(7006, "Enable")),
|
|
1168
1227
|
run: () => true
|
|
1169
1228
|
}, {
|
|
1170
|
-
label: ( localize(
|
|
1229
|
+
label: ( localize(7007, "Disable")),
|
|
1171
1230
|
run: () => false
|
|
1172
1231
|
}],
|
|
1173
1232
|
custom: {
|
|
@@ -1498,7 +1557,7 @@ let LanguageModelToolsService = class LanguageModelToolsService extends Disposab
|
|
|
1498
1557
|
return getToolFullReferenceName(tool, toolSet);
|
|
1499
1558
|
}
|
|
1500
1559
|
};
|
|
1501
|
-
LanguageModelToolsService = LanguageModelToolsService_1 = ( __decorate([( __param(0, IInstantiationService)), ( __param(1, IExtensionService)), ( __param(2, IContextKeyService)), ( __param(3, IChatService)), ( __param(4, IDialogService)), ( __param(5, ITelemetryService)), ( __param(6, ILogService)), ( __param(7, IConfigurationService)), ( __param(8, IAccessibilityService)), ( __param(9, IAccessibilitySignalService)), ( __param(10, IStorageService)), ( __param(11, ILanguageModelToolsConfirmationService)), ( __param(12, ICommandService)), ( __param(13, IChatWidgetService))], LanguageModelToolsService));
|
|
1560
|
+
LanguageModelToolsService = LanguageModelToolsService_1 = ( __decorate([( __param(0, IInstantiationService)), ( __param(1, IExtensionService)), ( __param(2, IContextKeyService)), ( __param(3, IChatService)), ( __param(4, IDialogService)), ( __param(5, ITelemetryService)), ( __param(6, ILogService)), ( __param(7, IConfigurationService)), ( __param(8, IAccessibilityService)), ( __param(9, IAccessibilitySignalService)), ( __param(10, IStorageService)), ( __param(11, ILanguageModelToolsConfirmationService)), ( __param(12, ICommandService)), ( __param(13, IChatWidgetService)), ( __param(14, IToolResultCompressor))], LanguageModelToolsService));
|
|
1502
1561
|
function getToolFullReferenceName(tool, toolSet) {
|
|
1503
1562
|
const toolName = tool.toolReferenceName ?? tool.displayName;
|
|
1504
1563
|
if (toolSet) {
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { 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
2
|
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
4
3
|
import { IBulkEditService } from "@codingame/monaco-vscode-api/vscode/vs/editor/browser/services/bulkEditService.service";
|
|
5
4
|
import { ILanguageFeaturesService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/languageFeatures.service";
|
|
6
5
|
import { ITextModelService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/resolverService.service";
|
|
7
|
-
import { ILanguageService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/language.service";
|
|
8
6
|
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
9
7
|
import { IWorkspaceContextService } from "@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service";
|
|
10
8
|
import { IWorkbenchContribution } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions";
|
|
@@ -14,15 +12,13 @@ import { ILanguageModelToolsService } from "@codingame/monaco-vscode-api/vscode/
|
|
|
14
12
|
export declare const RenameToolId = "vscode_renameSymbol";
|
|
15
13
|
export declare class RenameTool extends Disposable implements IToolImpl {
|
|
16
14
|
private readonly _languageFeaturesService;
|
|
17
|
-
private readonly _languageService;
|
|
18
15
|
private readonly _textModelService;
|
|
19
16
|
private readonly _workspaceContextService;
|
|
20
17
|
private readonly _chatService;
|
|
21
18
|
private readonly _bulkEditService;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
getToolData(): IToolData | undefined;
|
|
19
|
+
constructor(_languageFeaturesService: ILanguageFeaturesService, _textModelService: ITextModelService, _workspaceContextService: IWorkspaceContextService, _chatService: IChatService, _bulkEditService: IBulkEditService);
|
|
20
|
+
getToolData(): IToolData;
|
|
21
|
+
private _buildToolData;
|
|
26
22
|
prepareToolInvocation(context: IToolInvocationPreparationContext, _token: CancellationToken): Promise<IPreparedToolInvocation | undefined>;
|
|
27
23
|
invoke(invocation: IToolInvocation, _countTokens: CountTokensCallback, _progress: ToolProgress, token: CancellationToken): Promise<IToolResult>;
|
|
28
24
|
private _successResult;
|
|
@@ -1,7 +1,6 @@
|
|
|
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 { Emitter, Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
5
4
|
import { MarkdownString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/htmlContent';
|
|
6
5
|
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
7
6
|
import { ResourceMap, ResourceSet } from '@codingame/monaco-vscode-api/vscode/vs/base/common/map';
|
|
@@ -11,7 +10,6 @@ import { ResourceTextEdit } from '@codingame/monaco-vscode-api/vscode/vs/editor/
|
|
|
11
10
|
import { IBulkEditService } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/services/bulkEditService.service';
|
|
12
11
|
import { ILanguageFeaturesService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/languageFeatures.service';
|
|
13
12
|
import { ITextModelService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/resolverService.service';
|
|
14
|
-
import { ILanguageService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/language.service';
|
|
15
13
|
import { rename } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/rename/browser/rename';
|
|
16
14
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
17
15
|
import { ContextKeyExpr } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
|
|
@@ -36,10 +34,12 @@ Input:
|
|
|
36
34
|
IMPORTANT: The file and line do NOT need to be the definition of the symbol. Any occurrence works - a usage, an import, a call site, etc. You can pick whichever occurrence is most convenient.
|
|
37
35
|
|
|
38
36
|
If the tool returns an error, retry with corrected input - ensure the file path is correct, the line content matches the actual file content, and the symbol name appears in that line.`;
|
|
37
|
+
const StaticModelDescription = BaseModelDescription + `
|
|
38
|
+
|
|
39
|
+
If the file's language has no rename provider registered, the tool returns an error.`;
|
|
39
40
|
let RenameTool = class RenameTool extends Disposable {
|
|
40
41
|
constructor(
|
|
41
42
|
_languageFeaturesService,
|
|
42
|
-
_languageService,
|
|
43
43
|
_textModelService,
|
|
44
44
|
_workspaceContextService,
|
|
45
45
|
_chatService,
|
|
@@ -47,39 +47,21 @@ let RenameTool = class RenameTool extends Disposable {
|
|
|
47
47
|
) {
|
|
48
48
|
super();
|
|
49
49
|
this._languageFeaturesService = _languageFeaturesService;
|
|
50
|
-
this._languageService = _languageService;
|
|
51
50
|
this._textModelService = _textModelService;
|
|
52
51
|
this._workspaceContextService = _workspaceContextService;
|
|
53
52
|
this._chatService = _chatService;
|
|
54
53
|
this._bulkEditService = _bulkEditService;
|
|
55
|
-
this._onDidUpdateToolData = this._store.add(( new Emitter()));
|
|
56
|
-
this.onDidUpdateToolData = this._onDidUpdateToolData.event;
|
|
57
|
-
this._store.add(
|
|
58
|
-
Event.debounce(this._languageFeaturesService.renameProvider.onDidChange, () => {}, 2000)((() => this._onDidUpdateToolData.fire()))
|
|
59
|
-
);
|
|
60
54
|
}
|
|
61
55
|
getToolData() {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
let modelDescription = BaseModelDescription;
|
|
67
|
-
let userDescription;
|
|
68
|
-
if (( languageIds.has("*"))) {
|
|
69
|
-
modelDescription += "\n\nSupported for all languages.";
|
|
70
|
-
userDescription = ( localize(6760, "Rename a symbol across the workspace"));
|
|
71
|
-
} else {
|
|
72
|
-
const sorted = [...languageIds].sort();
|
|
73
|
-
modelDescription += `\n\nCurrently supported for: ${sorted.join(", ")}.`;
|
|
74
|
-
const niceNames = ( sorted.map(id => this._languageService.getLanguageName(id) ?? id));
|
|
75
|
-
userDescription = ( localize(6761, "Rename a symbol across the workspace ({0})", niceNames.join(", ")));
|
|
76
|
-
}
|
|
56
|
+
return this._buildToolData(StaticModelDescription, ( localize(7008, "Rename a symbol across the workspace")));
|
|
57
|
+
}
|
|
58
|
+
_buildToolData(modelDescription, userDescription) {
|
|
77
59
|
return {
|
|
78
60
|
id: RenameToolId,
|
|
79
61
|
toolReferenceName: "rename",
|
|
80
62
|
canBeReferencedInPrompt: false,
|
|
81
63
|
icon: ThemeIcon.fromId(Codicon.rename.id),
|
|
82
|
-
displayName: ( localize(
|
|
64
|
+
displayName: ( localize(7009, "Rename Symbol")),
|
|
83
65
|
userDescription,
|
|
84
66
|
modelDescription,
|
|
85
67
|
source: ToolDataSource.Internal,
|
|
@@ -115,12 +97,12 @@ let RenameTool = class RenameTool extends Disposable {
|
|
|
115
97
|
async prepareToolInvocation(context, _token) {
|
|
116
98
|
const input = context.parameters;
|
|
117
99
|
return {
|
|
118
|
-
invocationMessage: ( localize(
|
|
100
|
+
invocationMessage: ( localize(7010, "Renaming `{0}` to `{1}`", input.symbol, input.newName))
|
|
119
101
|
};
|
|
120
102
|
}
|
|
121
103
|
async invoke(invocation, _countTokens, _progress, token) {
|
|
122
104
|
const input = invocation.parameters;
|
|
123
|
-
const uri = resolveToolUri(input, this._workspaceContextService);
|
|
105
|
+
const uri = resolveToolUri(input, this._workspaceContextService, invocation.context?.workingDirectory);
|
|
124
106
|
if (!uri) {
|
|
125
107
|
return errorResult(
|
|
126
108
|
"Provide either \"uri\" (a full URI) or \"filePath\" (a workspace-relative path) to identify the file."
|
|
@@ -203,13 +185,13 @@ let RenameTool = class RenameTool extends Disposable {
|
|
|
203
185
|
}
|
|
204
186
|
_successResult(input, fileCount, editCount) {
|
|
205
187
|
const text = editCount === 1 ? ( localize(
|
|
206
|
-
|
|
188
|
+
7011,
|
|
207
189
|
"Renamed `{0}` to `{1}` - 1 edit in {2} file.",
|
|
208
190
|
input.symbol,
|
|
209
191
|
input.newName,
|
|
210
192
|
fileCount
|
|
211
193
|
)) : ( localize(
|
|
212
|
-
|
|
194
|
+
7012,
|
|
213
195
|
"Renamed `{0}` to `{1}` - {2} edits across {3} files.",
|
|
214
196
|
input.symbol,
|
|
215
197
|
input.newName,
|
|
@@ -221,7 +203,7 @@ let RenameTool = class RenameTool extends Disposable {
|
|
|
221
203
|
return result;
|
|
222
204
|
}
|
|
223
205
|
};
|
|
224
|
-
RenameTool = ( __decorate([( __param(0, ILanguageFeaturesService)), ( __param(1,
|
|
206
|
+
RenameTool = ( __decorate([( __param(0, ILanguageFeaturesService)), ( __param(1, ITextModelService)), ( __param(2, IWorkspaceContextService)), ( __param(3, IChatService)), ( __param(4, IBulkEditService))], RenameTool));
|
|
225
207
|
let RenameToolContribution = class RenameToolContribution extends Disposable {
|
|
226
208
|
static {
|
|
227
209
|
this.ID = "chat.renameTool";
|
|
@@ -229,23 +211,7 @@ let RenameToolContribution = class RenameToolContribution extends Disposable {
|
|
|
229
211
|
constructor(toolsService, instantiationService) {
|
|
230
212
|
super();
|
|
231
213
|
const renameTool = this._store.add(instantiationService.createInstance(RenameTool));
|
|
232
|
-
|
|
233
|
-
const registerRenameTool = () => {
|
|
234
|
-
registration?.dispose();
|
|
235
|
-
registration = undefined;
|
|
236
|
-
toolsService.flushToolUpdates();
|
|
237
|
-
const toolData = renameTool.getToolData();
|
|
238
|
-
if (toolData) {
|
|
239
|
-
registration = toolsService.registerTool(toolData, renameTool);
|
|
240
|
-
}
|
|
241
|
-
};
|
|
242
|
-
registerRenameTool();
|
|
243
|
-
this._store.add(renameTool.onDidUpdateToolData(registerRenameTool));
|
|
244
|
-
this._store.add({
|
|
245
|
-
dispose: () => {
|
|
246
|
-
registration?.dispose();
|
|
247
|
-
}
|
|
248
|
-
});
|
|
214
|
+
this._store.add(toolsService.registerTool(renameTool.getToolData(), renameTool));
|
|
249
215
|
}
|
|
250
216
|
};
|
|
251
217
|
RenameToolContribution = ( __decorate([( __param(0, ILanguageModelToolsService)), ( __param(1, IInstantiationService))], RenameToolContribution));
|
|
@@ -10,9 +10,10 @@ export interface ISymbolToolInput {
|
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
12
|
* Resolves a URI from tool input. Accepts either a full URI string or a
|
|
13
|
-
* workspace-relative file path.
|
|
13
|
+
* workspace-relative file path. When a {@link workingDirectory} is provided
|
|
14
|
+
* (agents window), relative paths are resolved against it first.
|
|
14
15
|
*/
|
|
15
|
-
export declare function resolveToolUri(input: ISymbolToolInput, workspaceContextService: IWorkspaceContextService): URI | undefined;
|
|
16
|
+
export declare function resolveToolUri(input: ISymbolToolInput, workspaceContextService: IWorkspaceContextService, workingDirectory?: URI): URI | undefined;
|
|
16
17
|
/**
|
|
17
18
|
* Finds the line number in the model that matches the given line content.
|
|
18
19
|
* Whitespace is normalized so that extra spaces in the input still match.
|