@codingame/monaco-vscode-chat-service-override 26.2.2 → 27.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +31 -1
- package/package.json +5 -5
- package/vscode/src/vs/platform/browserElements/common/browserElements.d.ts +15 -0
- package/vscode/src/vs/sessions/contrib/agentFeedback/browser/agentFeedbackService.d.ts +53 -0
- package/vscode/src/vs/sessions/contrib/agentFeedback/browser/agentFeedbackService.js +219 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/aiCustomizationWorkspaceService.d.ts +39 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/aiCustomizationWorkspaceService.js +83 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/newSession.d.ts +123 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/newSession.js +274 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/sessionsConfigurationService.d.ts +71 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/sessionsConfigurationService.js +284 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsManagementService.d.ts +79 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsManagementService.js +378 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityService.d.ts +1 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityService.js +27 -40
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.d.ts +9 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.js +74 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.js +54 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +87 -53
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAgentRecommendationActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +71 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +43 -21
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +22 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatForkActions.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatForkActions.js +154 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +6 -8
- 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 +53 -43
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatOpenAgentDebugPanelAction.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatOpenAgentDebugPanelAction.js +84 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPluginActions.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPluginActions.js +33 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPromptNavigationActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQueueActions.js +15 -29
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.js +16 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +18 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.d.ts +33 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.js +204 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.d.ts +77 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.js +541 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.js +10 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.js +70 -65
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.d.ts +7 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.js +27 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsQuickAccess.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsQuickAccess.js +4 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjection.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionActions.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.js +90 -51
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionsExperiments.contribution.js +20 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.js +43 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/media/agenttitlebarstatuswidget.css +7 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccess.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccess.js +84 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccessActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/{localAgentSessionsProvider.d.ts → localAgentSessionsController.d.ts} +7 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/{localAgentSessionsProvider.js → localAgentSessionsController.js} +24 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.d.ts +23 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.js +171 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.d.ts +48 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.js +19 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.d.ts +181 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.js +943 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.contribution.js +248 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.d.ts +57 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.js +27 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.d.ts +118 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.js +727 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.d.ts +22 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.js +38 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWorkspaceService.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWorkspaceService.js +72 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCreatorService.d.ts +45 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCreatorService.js +165 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.d.ts +75 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.js +623 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationManagement.css +858 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.js +30 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgetRegistry.d.ts +32 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgetRegistry.js +26 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatVariables.js +19 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/simpleBrowserEditorOverlay.js +36 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +529 -363
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.js +419 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCollapsible.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCollapsible.js +46 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugDetailPanel.d.ts +34 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugDetailPanel.js +198 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditor.d.ts +55 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditor.js +305 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditorInput.d.ts +23 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditorInput.js +64 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventDetailRenderer.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventDetailRenderer.js +84 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventList.d.ts +27 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventList.js +110 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFilters.d.ts +34 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFilters.js +111 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowChartView.d.ts +71 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowChartView.js +611 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowGraph.d.ts +125 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowGraph.js +504 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowLayout.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowLayout.js +914 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHomeView.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHomeView.js +128 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.d.ts +58 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.js +429 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugMessageContentRenderer.d.ts +31 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugMessageContentRenderer.js +113 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugModelTurnContentRenderer.d.ts +14 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugModelTurnContentRenderer.js +126 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugOverviewView.d.ts +38 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugOverviewView.js +279 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugToolCallContentRenderer.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugToolCallContentRenderer.js +122 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugTypes.d.ts +45 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugTypes.js +85 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/media/chatDebug.css +781 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.js +5 -22
- 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 +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelChangeService.js +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditor.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditor.js +16 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.js +63 -76
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatUsageWidget.js +26 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/media/chatManagementEditor.css +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +30 -30
- package/vscode/src/vs/workbench/contrib/chat/browser/chatRepoInfo.d.ts +15 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatRepoInfo.js +40 -413
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetup.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetup.js +38 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.d.ts +5 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.js +56 -46
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.js +15 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupGrowthSession.d.ts +52 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupGrowthSession.js +138 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.d.ts +11 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.js +166 -41
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.d.ts +6 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.js +37 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.js +351 -0
- 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 +118 -63
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/media/chatStatus.css +28 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.d.ts +182 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.js +892 -41
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWindowNotifier.d.ts +5 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWindowNotifier.js +55 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/contextContrib/chatContextService.js +28 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/createSlashCommandsUsageTracker.d.ts +14 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/createSlashCommandsUsageTracker.js +62 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/defaultModelContribution.d.ts +36 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/defaultModelContribution.js +110 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/exploreAgentDefaultModel.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/exploreAgentDefaultModel.js +39 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/planAgentDefaultModel.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/planAgentDefaultModel.js +39 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.d.ts +27 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.js +102 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.d.ts +16 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.js +69 -47
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.js +2 -41
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionOverlay.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptUrlHandler.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/skillActions.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/skillActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/promptsDebugContribution.d.ts +22 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptsDebugContribution.js +76 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/sessionResourceMatching.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/sessionResourceMatching.js +30 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.js +43 -31
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.js +67 -42
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.d.ts +31 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.js +242 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolHelpers.d.ts +34 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolHelpers.js +45 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.d.ts +33 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.js +311 -0
- 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 +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidgetService.js +10 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatStatusWidget.js +8 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.js +64 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorContrib.js +4 -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 +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditor.d.ts +15 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditor.js +42 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.d.ts +8 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.js +58 -31
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.js +6 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatViewPane.css +8 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatViewTitleControl.css +15 -6
- package/vscode/src/vs/workbench/contrib/chat/common/aiCustomizationWorkspaceService.d.ts +39 -0
- package/vscode/src/vs/workbench/contrib/chat/common/aiCustomizationWorkspaceService.js +27 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatDebugService.d.ts +190 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatDebugService.js +11 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.d.ts +36 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.js +188 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.d.ts +18 -8
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.js +192 -85
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceTelemetry.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceTelemetry.js +2 -1
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatModelStore.d.ts +5 -6
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatModelStore.js +16 -8
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.d.ts +8 -4
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.js +111 -7
- package/vscode/src/vs/workbench/contrib/chat/common/participants/chatSlashCommands.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.d.ts +52 -0
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.js +29 -0
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.d.ts +73 -0
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.js +622 -0
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.d.ts +64 -0
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.js +478 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +35 -16
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCompatibility.js +1 -30
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCopilotCliCompat.d.ts +0 -5
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCopilotCliCompat.js +2 -8
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/PromptHeaderDefinitionProvider.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.js +23 -22
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.d.ts +44 -14
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.js +345 -113
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts +14 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +34 -24
- package/vscode/src/vs/workbench/contrib/chat/common/tools/chatTodoListService.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/chatTodoListService.js +13 -0
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +11 -5
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.d.ts +23 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +248 -24
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatDefaultModel.d.ts +6 -11
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatDefaultModel.js +18 -81
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.js +2 -3
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +10 -10
- 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 +6 -6
- 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/media/terminalChatWidget.css +6 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.js +16 -16
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +35 -26
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.js +1 -5
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +6 -6
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.d.ts +4 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.js +13 -11
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.js +3 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/awaitTerminalTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +12 -12
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +2 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalLastCommandTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalSelectionTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/killTerminalTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +280 -65
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/types.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/outputAnalyzer.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +2 -10
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +47 -19
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.js +31 -0
- 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/common/terminalSandboxService.d.ts +6 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +38 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCustomizationDiagnosticsAction.d.ts +0 -72
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCustomizationDiagnosticsAction.js +0 -587
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatProgressTypes/chatToolInvocation.d.ts +0 -71
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatProgressTypes/chatToolInvocation.js +0 -293
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/utils.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/utils.js +0 -31
|
@@ -1,11 +1,24 @@
|
|
|
1
1
|
|
|
2
2
|
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
3
|
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
5
|
+
import '@codingame/monaco-vscode-api/vscode/vs/base/common/charCode';
|
|
6
|
+
import '@codingame/monaco-vscode-api/vscode/vs/base/common/diff/diff';
|
|
7
|
+
import '@codingame/monaco-vscode-api/vscode/vs/base/common/arrays';
|
|
8
|
+
import '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
|
|
9
|
+
import '@codingame/monaco-vscode-api/vscode/vs/editor/common/core/ranges/lineRange';
|
|
10
|
+
import '@codingame/monaco-vscode-api/vscode/vs/base/common/strings';
|
|
11
|
+
import '@codingame/monaco-vscode-api/vscode/vs/editor/common/core/text/textLength';
|
|
12
|
+
import '@codingame/monaco-vscode-api/vscode/vs/editor/common/core/text/positionToOffsetImpl';
|
|
13
|
+
import '@codingame/monaco-vscode-api/vscode/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/diffAlgorithm';
|
|
14
|
+
import '@codingame/monaco-vscode-api/vscode/vs/editor/common/diff/defaultLinesDiffComputer/utils';
|
|
15
|
+
import '@codingame/monaco-vscode-api/vscode/vs/base/common/arraysFind';
|
|
16
|
+
import '@codingame/monaco-vscode-api/vscode/vs/base/common/map';
|
|
17
|
+
import '@codingame/monaco-vscode-api/vscode/vs/editor/common/diff/defaultLinesDiffComputer/linesSliceCharSequence';
|
|
6
18
|
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
7
19
|
import { Extensions } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configurationRegistry';
|
|
8
|
-
import
|
|
20
|
+
import '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files';
|
|
21
|
+
import '@codingame/monaco-vscode-api/vscode/vs/workbench/services/textfile/common/encoding';
|
|
9
22
|
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
10
23
|
import { Registry } from '@codingame/monaco-vscode-api/vscode/vs/platform/registry/common/platform';
|
|
11
24
|
import { IChatEntitlementService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/chat/common/chatEntitlementService.service';
|
|
@@ -14,256 +27,7 @@ import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/c
|
|
|
14
27
|
import { ChatConfiguration } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
|
|
15
28
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
16
29
|
|
|
17
|
-
|
|
18
|
-
const MAX_DIFFS_SIZE_BYTES = 900 * 1024;
|
|
19
|
-
const MAX_SESSIONS_WITH_FULL_DIFFS = 5;
|
|
20
|
-
const RemoteMatcher = /^\s*url\s*=\s*(.+\S)\s*$/mg;
|
|
21
|
-
function getRawRemotes(text) {
|
|
22
|
-
const remotes = [];
|
|
23
|
-
let match;
|
|
24
|
-
while (match = RemoteMatcher.exec(text)) {
|
|
25
|
-
remotes.push(match[1]);
|
|
26
|
-
}
|
|
27
|
-
return remotes;
|
|
28
|
-
}
|
|
29
|
-
function getRemoteHost(remoteUrl) {
|
|
30
|
-
try {
|
|
31
|
-
const url = ( new URL(remoteUrl));
|
|
32
|
-
return url.hostname.toLowerCase();
|
|
33
|
-
} catch {
|
|
34
|
-
const atIndex = remoteUrl.lastIndexOf("@");
|
|
35
|
-
const hostAndPath = atIndex !== -1 ? remoteUrl.slice(atIndex + 1) : remoteUrl;
|
|
36
|
-
const colonIndex = hostAndPath.indexOf(":");
|
|
37
|
-
if (colonIndex !== -1) {
|
|
38
|
-
const host = hostAndPath.slice(0, colonIndex);
|
|
39
|
-
return host ? host.toLowerCase() : undefined;
|
|
40
|
-
}
|
|
41
|
-
const slashIndex = hostAndPath.indexOf("/");
|
|
42
|
-
if (slashIndex !== -1) {
|
|
43
|
-
const host = hostAndPath.slice(0, slashIndex);
|
|
44
|
-
return host ? host.toLowerCase() : undefined;
|
|
45
|
-
}
|
|
46
|
-
return undefined;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
function determineChangeType(resource, groupId) {
|
|
50
|
-
const contextValue = resource.contextValue?.toLowerCase() ?? "";
|
|
51
|
-
const groupIdLower = groupId.toLowerCase();
|
|
52
|
-
if (contextValue.includes("untracked") || contextValue.includes("add")) {
|
|
53
|
-
return "added";
|
|
54
|
-
}
|
|
55
|
-
if (contextValue.includes("delete")) {
|
|
56
|
-
return "deleted";
|
|
57
|
-
}
|
|
58
|
-
if (contextValue.includes("rename")) {
|
|
59
|
-
return "renamed";
|
|
60
|
-
}
|
|
61
|
-
if (groupIdLower.includes("untracked")) {
|
|
62
|
-
return "added";
|
|
63
|
-
}
|
|
64
|
-
if (resource.decorations.strikeThrough) {
|
|
65
|
-
return "deleted";
|
|
66
|
-
}
|
|
67
|
-
if (!resource.multiDiffEditorOriginalUri) {
|
|
68
|
-
return "added";
|
|
69
|
-
}
|
|
70
|
-
return "modified";
|
|
71
|
-
}
|
|
72
|
-
async function generateUnifiedDiff(fileService, relPath, originalUri, modifiedUri, changeType) {
|
|
73
|
-
try {
|
|
74
|
-
let originalContent = "";
|
|
75
|
-
let modifiedContent = "";
|
|
76
|
-
if (originalUri && changeType !== "added") {
|
|
77
|
-
try {
|
|
78
|
-
const originalFile = await fileService.readFile(originalUri);
|
|
79
|
-
originalContent = ( originalFile.value.toString());
|
|
80
|
-
} catch {
|
|
81
|
-
if (changeType === "modified") {
|
|
82
|
-
return undefined;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
if (changeType !== "deleted") {
|
|
87
|
-
try {
|
|
88
|
-
const modifiedFile = await fileService.readFile(modifiedUri);
|
|
89
|
-
modifiedContent = ( modifiedFile.value.toString());
|
|
90
|
-
} catch {
|
|
91
|
-
return undefined;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
const originalLines = originalContent.split("\n");
|
|
95
|
-
const modifiedLines = modifiedContent.split("\n");
|
|
96
|
-
const originalEndsWithNewline = originalContent.length > 0 && originalContent.endsWith("\n");
|
|
97
|
-
const modifiedEndsWithNewline = modifiedContent.length > 0 && modifiedContent.endsWith("\n");
|
|
98
|
-
if (originalEndsWithNewline && originalLines.length > 0 && originalLines[originalLines.length - 1] === "") {
|
|
99
|
-
originalLines.pop();
|
|
100
|
-
}
|
|
101
|
-
if (modifiedEndsWithNewline && modifiedLines.length > 0 && modifiedLines[modifiedLines.length - 1] === "") {
|
|
102
|
-
modifiedLines.pop();
|
|
103
|
-
}
|
|
104
|
-
const diffLines = [];
|
|
105
|
-
const aPath = changeType === "added" ? "/dev/null" : `a/${relPath}`;
|
|
106
|
-
const bPath = changeType === "deleted" ? "/dev/null" : `b/${relPath}`;
|
|
107
|
-
diffLines.push(`--- ${aPath}`);
|
|
108
|
-
diffLines.push(`+++ ${bPath}`);
|
|
109
|
-
if (changeType === "added") {
|
|
110
|
-
if (modifiedLines.length > 0) {
|
|
111
|
-
diffLines.push(`@@ -0,0 +1,${modifiedLines.length} @@`);
|
|
112
|
-
for (const line of modifiedLines) {
|
|
113
|
-
diffLines.push(`+${line}`);
|
|
114
|
-
}
|
|
115
|
-
if (!modifiedEndsWithNewline) {
|
|
116
|
-
diffLines.push("\");
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
} else if (changeType === "deleted") {
|
|
120
|
-
if (originalLines.length > 0) {
|
|
121
|
-
diffLines.push(`@@ -1,${originalLines.length} +0,0 @@`);
|
|
122
|
-
for (const line of originalLines) {
|
|
123
|
-
diffLines.push(`-${line}`);
|
|
124
|
-
}
|
|
125
|
-
if (!originalEndsWithNewline) {
|
|
126
|
-
diffLines.push("\");
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
} else {
|
|
130
|
-
const hunks = computeDiffHunks(
|
|
131
|
-
originalLines,
|
|
132
|
-
modifiedLines,
|
|
133
|
-
originalEndsWithNewline,
|
|
134
|
-
modifiedEndsWithNewline
|
|
135
|
-
);
|
|
136
|
-
for (const hunk of hunks) {
|
|
137
|
-
diffLines.push(hunk);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
return diffLines.join("\n");
|
|
141
|
-
} catch {
|
|
142
|
-
return undefined;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
function computeDiffHunks(
|
|
146
|
-
originalLines,
|
|
147
|
-
modifiedLines,
|
|
148
|
-
originalEndsWithNewline,
|
|
149
|
-
modifiedEndsWithNewline
|
|
150
|
-
) {
|
|
151
|
-
const contextSize = 3;
|
|
152
|
-
const result = [];
|
|
153
|
-
const diffComputer = linesDiffComputers.getDefault();
|
|
154
|
-
const diffResult = diffComputer.computeDiff(originalLines, modifiedLines, {
|
|
155
|
-
ignoreTrimWhitespace: false,
|
|
156
|
-
maxComputationTimeMs: 1000,
|
|
157
|
-
computeMoves: false
|
|
158
|
-
});
|
|
159
|
-
if (diffResult.changes.length === 0) {
|
|
160
|
-
return result;
|
|
161
|
-
}
|
|
162
|
-
const hunkGroups = [];
|
|
163
|
-
let currentGroup = [];
|
|
164
|
-
for (const change of diffResult.changes) {
|
|
165
|
-
if (currentGroup.length === 0) {
|
|
166
|
-
currentGroup.push(change);
|
|
167
|
-
} else {
|
|
168
|
-
const lastChange = currentGroup[currentGroup.length - 1];
|
|
169
|
-
const lastContextEnd = lastChange.original.endLineNumberExclusive - 1 + contextSize;
|
|
170
|
-
const currentContextStart = change.original.startLineNumber - contextSize;
|
|
171
|
-
if (currentContextStart <= lastContextEnd + 1) {
|
|
172
|
-
currentGroup.push(change);
|
|
173
|
-
} else {
|
|
174
|
-
hunkGroups.push(currentGroup);
|
|
175
|
-
currentGroup = [change];
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
if (currentGroup.length > 0) {
|
|
180
|
-
hunkGroups.push(currentGroup);
|
|
181
|
-
}
|
|
182
|
-
for (const group of hunkGroups) {
|
|
183
|
-
const firstChange = group[0];
|
|
184
|
-
const lastChange = group[group.length - 1];
|
|
185
|
-
const hunkOrigStart = Math.max(1, firstChange.original.startLineNumber - contextSize);
|
|
186
|
-
const hunkOrigEnd = Math.min(
|
|
187
|
-
originalLines.length,
|
|
188
|
-
lastChange.original.endLineNumberExclusive - 1 + contextSize
|
|
189
|
-
);
|
|
190
|
-
const hunkModStart = Math.max(1, firstChange.modified.startLineNumber - contextSize);
|
|
191
|
-
const hunkLines = [];
|
|
192
|
-
let lastOriginalLineIndex = -1;
|
|
193
|
-
let lastModifiedLineIndex = -1;
|
|
194
|
-
let origLineNum = hunkOrigStart;
|
|
195
|
-
let origCount = 0;
|
|
196
|
-
let modCount = 0;
|
|
197
|
-
for (const change of group) {
|
|
198
|
-
const origStart = change.original.startLineNumber;
|
|
199
|
-
const origEnd = change.original.endLineNumberExclusive;
|
|
200
|
-
const modStart = change.modified.startLineNumber;
|
|
201
|
-
const modEnd = change.modified.endLineNumberExclusive;
|
|
202
|
-
while (origLineNum < origStart) {
|
|
203
|
-
const idx = hunkLines.length;
|
|
204
|
-
hunkLines.push(` ${originalLines[origLineNum - 1]}`);
|
|
205
|
-
if (origLineNum === originalLines.length) {
|
|
206
|
-
lastOriginalLineIndex = idx;
|
|
207
|
-
}
|
|
208
|
-
const modLineNum = hunkModStart + modCount;
|
|
209
|
-
if (modLineNum === modifiedLines.length) {
|
|
210
|
-
lastModifiedLineIndex = idx;
|
|
211
|
-
}
|
|
212
|
-
origLineNum++;
|
|
213
|
-
origCount++;
|
|
214
|
-
modCount++;
|
|
215
|
-
}
|
|
216
|
-
for (let i = origStart; i < origEnd; i++) {
|
|
217
|
-
const idx = hunkLines.length;
|
|
218
|
-
hunkLines.push(`-${originalLines[i - 1]}`);
|
|
219
|
-
if (i === originalLines.length) {
|
|
220
|
-
lastOriginalLineIndex = idx;
|
|
221
|
-
}
|
|
222
|
-
origLineNum++;
|
|
223
|
-
origCount++;
|
|
224
|
-
}
|
|
225
|
-
for (let i = modStart; i < modEnd; i++) {
|
|
226
|
-
const idx = hunkLines.length;
|
|
227
|
-
hunkLines.push(`+${modifiedLines[i - 1]}`);
|
|
228
|
-
if (i === modifiedLines.length) {
|
|
229
|
-
lastModifiedLineIndex = idx;
|
|
230
|
-
}
|
|
231
|
-
modCount++;
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
while (origLineNum <= hunkOrigEnd) {
|
|
235
|
-
const idx = hunkLines.length;
|
|
236
|
-
hunkLines.push(` ${originalLines[origLineNum - 1]}`);
|
|
237
|
-
if (origLineNum === originalLines.length) {
|
|
238
|
-
lastOriginalLineIndex = idx;
|
|
239
|
-
}
|
|
240
|
-
const modLineNum = hunkModStart + modCount;
|
|
241
|
-
if (modLineNum === modifiedLines.length) {
|
|
242
|
-
lastModifiedLineIndex = idx;
|
|
243
|
-
}
|
|
244
|
-
origLineNum++;
|
|
245
|
-
origCount++;
|
|
246
|
-
modCount++;
|
|
247
|
-
}
|
|
248
|
-
result.push(`@@ -${hunkOrigStart},${origCount} +${hunkModStart},${modCount} @@`);
|
|
249
|
-
for (let i = 0; i < hunkLines.length; i++) {
|
|
250
|
-
result.push(hunkLines[i]);
|
|
251
|
-
const isLastOriginal = i === lastOriginalLineIndex;
|
|
252
|
-
const isLastModified = i === lastModifiedLineIndex;
|
|
253
|
-
if (isLastOriginal && isLastModified) {
|
|
254
|
-
if (!originalEndsWithNewline || !modifiedEndsWithNewline) {
|
|
255
|
-
result.push("\");
|
|
256
|
-
}
|
|
257
|
-
} else if (isLastOriginal && !originalEndsWithNewline) {
|
|
258
|
-
result.push("\");
|
|
259
|
-
} else if (isLastModified && !modifiedEndsWithNewline) {
|
|
260
|
-
result.push("\");
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
return result;
|
|
265
|
-
}
|
|
266
|
-
async function captureRepoInfo(scmService, fileService) {
|
|
30
|
+
function captureRepoMetadata(scmService) {
|
|
267
31
|
const repositories = [...scmService.repositories];
|
|
268
32
|
if (repositories.length === 0) {
|
|
269
33
|
return undefined;
|
|
@@ -273,32 +37,6 @@ async function captureRepoInfo(scmService, fileService) {
|
|
|
273
37
|
if (!rootUri) {
|
|
274
38
|
return undefined;
|
|
275
39
|
}
|
|
276
|
-
let hasGit = false;
|
|
277
|
-
try {
|
|
278
|
-
const gitDirUri = rootUri.with({
|
|
279
|
-
path: `${rootUri.path}/.git`
|
|
280
|
-
});
|
|
281
|
-
hasGit = await fileService.exists(gitDirUri);
|
|
282
|
-
} catch {}
|
|
283
|
-
if (!hasGit) {
|
|
284
|
-
return {
|
|
285
|
-
workspaceType: "plain-folder",
|
|
286
|
-
syncStatus: "no-git",
|
|
287
|
-
diffs: undefined
|
|
288
|
-
};
|
|
289
|
-
}
|
|
290
|
-
let remoteUrl;
|
|
291
|
-
try {
|
|
292
|
-
const gitConfigUri = rootUri.with({
|
|
293
|
-
path: `${rootUri.path}/.git/config`
|
|
294
|
-
});
|
|
295
|
-
const exists = await fileService.exists(gitConfigUri);
|
|
296
|
-
if (exists) {
|
|
297
|
-
const content = await fileService.readFile(gitConfigUri);
|
|
298
|
-
const remotes = getRawRemotes(( content.value.toString()));
|
|
299
|
-
remoteUrl = remotes[0];
|
|
300
|
-
}
|
|
301
|
-
} catch {}
|
|
302
40
|
let localBranch;
|
|
303
41
|
let localHeadCommit;
|
|
304
42
|
let remoteTrackingBranch;
|
|
@@ -321,106 +59,28 @@ async function captureRepoInfo(scmService, fileService) {
|
|
|
321
59
|
}
|
|
322
60
|
let workspaceType;
|
|
323
61
|
let syncStatus;
|
|
324
|
-
if (
|
|
325
|
-
workspaceType = "local-git";
|
|
326
|
-
syncStatus = "local-only";
|
|
327
|
-
} else {
|
|
62
|
+
if (remoteTrackingBranch || remoteHeadCommit || remoteBaseBranch) {
|
|
328
63
|
workspaceType = "remote-git";
|
|
329
64
|
if (!remoteTrackingBranch) {
|
|
330
65
|
syncStatus = "unpublished";
|
|
331
|
-
} else if (localHeadCommit === remoteHeadCommit) {
|
|
66
|
+
} else if (localHeadCommit && remoteHeadCommit && localHeadCommit === remoteHeadCommit) {
|
|
332
67
|
syncStatus = "synced";
|
|
333
68
|
} else {
|
|
334
69
|
syncStatus = "unpushed";
|
|
335
70
|
}
|
|
71
|
+
} else {
|
|
72
|
+
workspaceType = "local-git";
|
|
73
|
+
syncStatus = "local-only";
|
|
336
74
|
}
|
|
337
|
-
|
|
338
|
-
if (remoteUrl) {
|
|
339
|
-
const host = getRemoteHost(remoteUrl);
|
|
340
|
-
if (host === "github.com") {
|
|
341
|
-
remoteVendor = "github";
|
|
342
|
-
} else if (host === "dev.azure.com" || (host && host.endsWith(".visualstudio.com"))) {
|
|
343
|
-
remoteVendor = "ado";
|
|
344
|
-
} else {
|
|
345
|
-
remoteVendor = "other";
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
let totalChangeCount = 0;
|
|
349
|
-
for (const group of repository.provider.groups) {
|
|
350
|
-
totalChangeCount += group.resources.length;
|
|
351
|
-
}
|
|
352
|
-
const baseRepoData = {
|
|
75
|
+
return {
|
|
353
76
|
workspaceType,
|
|
354
77
|
syncStatus,
|
|
355
|
-
remoteUrl,
|
|
356
|
-
remoteVendor,
|
|
357
78
|
localBranch,
|
|
358
79
|
remoteTrackingBranch,
|
|
359
80
|
remoteBaseBranch,
|
|
360
81
|
localHeadCommit,
|
|
361
|
-
remoteHeadCommit
|
|
362
|
-
|
|
363
|
-
if (totalChangeCount === 0) {
|
|
364
|
-
return {
|
|
365
|
-
...baseRepoData,
|
|
366
|
-
diffs: undefined,
|
|
367
|
-
diffsStatus: "noChanges",
|
|
368
|
-
changedFileCount: 0
|
|
369
|
-
};
|
|
370
|
-
}
|
|
371
|
-
if (totalChangeCount > MAX_CHANGES) {
|
|
372
|
-
return {
|
|
373
|
-
...baseRepoData,
|
|
374
|
-
diffs: undefined,
|
|
375
|
-
diffsStatus: "tooManyChanges",
|
|
376
|
-
changedFileCount: totalChangeCount
|
|
377
|
-
};
|
|
378
|
-
}
|
|
379
|
-
const diffs = [];
|
|
380
|
-
const diffPromises = [];
|
|
381
|
-
for (const group of repository.provider.groups) {
|
|
382
|
-
for (const resource of group.resources) {
|
|
383
|
-
const relPath = relativePath(rootUri, resource.sourceUri) ?? resource.sourceUri.path;
|
|
384
|
-
const changeType = determineChangeType(resource, group.id);
|
|
385
|
-
const diffPromise = (async () => {
|
|
386
|
-
const unifiedDiff = await generateUnifiedDiff(
|
|
387
|
-
fileService,
|
|
388
|
-
relPath,
|
|
389
|
-
resource.multiDiffEditorOriginalUri,
|
|
390
|
-
resource.sourceUri,
|
|
391
|
-
changeType
|
|
392
|
-
);
|
|
393
|
-
return {
|
|
394
|
-
relativePath: relPath,
|
|
395
|
-
changeType,
|
|
396
|
-
status: group.label || group.id,
|
|
397
|
-
unifiedDiff
|
|
398
|
-
};
|
|
399
|
-
})();
|
|
400
|
-
diffPromises.push(diffPromise);
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
const generatedDiffs = await Promise.all(diffPromises);
|
|
404
|
-
for (const diff of generatedDiffs) {
|
|
405
|
-
if (diff) {
|
|
406
|
-
diffs.push(diff);
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
const diffsJson = JSON.stringify(diffs);
|
|
410
|
-
const diffsSizeBytes = ( new TextEncoder()).encode(diffsJson).length;
|
|
411
|
-
if (diffsSizeBytes > MAX_DIFFS_SIZE_BYTES) {
|
|
412
|
-
return {
|
|
413
|
-
...baseRepoData,
|
|
414
|
-
diffs: undefined,
|
|
415
|
-
diffsStatus: "tooLarge",
|
|
416
|
-
changedFileCount: totalChangeCount
|
|
417
|
-
};
|
|
418
|
-
}
|
|
419
|
-
return {
|
|
420
|
-
...baseRepoData,
|
|
421
|
-
diffs,
|
|
422
|
-
diffsStatus: "included",
|
|
423
|
-
changedFileCount: totalChangeCount
|
|
82
|
+
remoteHeadCommit,
|
|
83
|
+
diffsStatus: "notCaptured"
|
|
424
84
|
};
|
|
425
85
|
}
|
|
426
86
|
let ChatRepoInfoContribution = class ChatRepoInfoContribution extends Disposable {
|
|
@@ -431,7 +91,6 @@ let ChatRepoInfoContribution = class ChatRepoInfoContribution extends Disposable
|
|
|
431
91
|
chatService,
|
|
432
92
|
chatEntitlementService,
|
|
433
93
|
scmService,
|
|
434
|
-
fileService,
|
|
435
94
|
logService,
|
|
436
95
|
configurationService
|
|
437
96
|
) {
|
|
@@ -439,7 +98,6 @@ let ChatRepoInfoContribution = class ChatRepoInfoContribution extends Disposable
|
|
|
439
98
|
this.chatService = chatService;
|
|
440
99
|
this.chatEntitlementService = chatEntitlementService;
|
|
441
100
|
this.scmService = scmService;
|
|
442
|
-
this.fileService = fileService;
|
|
443
101
|
this.logService = logService;
|
|
444
102
|
this.configurationService = configurationService;
|
|
445
103
|
this._configurationRegistered = false;
|
|
@@ -447,7 +105,7 @@ let ChatRepoInfoContribution = class ChatRepoInfoContribution extends Disposable
|
|
|
447
105
|
this._register(this.chatEntitlementService.onDidChangeEntitlement(() => {
|
|
448
106
|
this.registerConfigurationIfInternal();
|
|
449
107
|
}));
|
|
450
|
-
this._register(this.chatService.onDidSubmitRequest(
|
|
108
|
+
this._register(this.chatService.onDidSubmitRequest((
|
|
451
109
|
{
|
|
452
110
|
chatSessionResource
|
|
453
111
|
}
|
|
@@ -456,7 +114,7 @@ let ChatRepoInfoContribution = class ChatRepoInfoContribution extends Disposable
|
|
|
456
114
|
if (!model) {
|
|
457
115
|
return;
|
|
458
116
|
}
|
|
459
|
-
|
|
117
|
+
this.captureAndSetRepoMetadata(model);
|
|
460
118
|
}));
|
|
461
119
|
}
|
|
462
120
|
registerConfigurationIfInternal() {
|
|
@@ -469,23 +127,23 @@ let ChatRepoInfoContribution = class ChatRepoInfoContribution extends Disposable
|
|
|
469
127
|
const registry = ( Registry.as(Extensions.Configuration));
|
|
470
128
|
registry.registerConfiguration({
|
|
471
129
|
id: "chatRepoInfo",
|
|
472
|
-
title: ( localize(
|
|
130
|
+
title: ( localize(5938, "Chat Repository Info")),
|
|
473
131
|
type: "object",
|
|
474
132
|
properties: {
|
|
475
133
|
[ChatConfiguration.RepoInfoEnabled]: {
|
|
476
134
|
type: "boolean",
|
|
477
135
|
description: ( localize(
|
|
478
|
-
|
|
479
|
-
"Controls whether repository
|
|
136
|
+
5939,
|
|
137
|
+
"Controls whether lightweight repository metadata (branch, commit, remotes) is captured when a chat request is submitted for internal diagnostics."
|
|
480
138
|
)),
|
|
481
|
-
default:
|
|
139
|
+
default: false
|
|
482
140
|
}
|
|
483
141
|
}
|
|
484
142
|
});
|
|
485
143
|
this._configurationRegistered = true;
|
|
486
144
|
this.logService.debug("[ChatRepoInfo] Configuration registered for internal user");
|
|
487
145
|
}
|
|
488
|
-
|
|
146
|
+
captureAndSetRepoMetadata(model) {
|
|
489
147
|
if (!this.chatEntitlementService.isInternal) {
|
|
490
148
|
return;
|
|
491
149
|
}
|
|
@@ -496,53 +154,22 @@ let ChatRepoInfoContribution = class ChatRepoInfoContribution extends Disposable
|
|
|
496
154
|
return;
|
|
497
155
|
}
|
|
498
156
|
try {
|
|
499
|
-
const
|
|
500
|
-
if (
|
|
501
|
-
model.setRepoData(
|
|
502
|
-
if (!
|
|
157
|
+
const metadata = captureRepoMetadata(this.scmService);
|
|
158
|
+
if (metadata) {
|
|
159
|
+
model.setRepoData(metadata);
|
|
160
|
+
if (!metadata.localHeadCommit) {
|
|
503
161
|
this.logService.warn(
|
|
504
|
-
"[ChatRepoInfo] Captured repo
|
|
162
|
+
"[ChatRepoInfo] Captured repo metadata without commit hash - git history may not be ready"
|
|
505
163
|
);
|
|
506
164
|
}
|
|
507
|
-
this.trimOldSessionDiffs();
|
|
508
165
|
} else {
|
|
509
166
|
this.logService.debug("[ChatRepoInfo] No SCM repository available for chat session");
|
|
510
167
|
}
|
|
511
168
|
} catch (error) {
|
|
512
|
-
this.logService.warn("[ChatRepoInfo] Failed to capture repo
|
|
513
|
-
}
|
|
514
|
-
}
|
|
515
|
-
trimOldSessionDiffs() {
|
|
516
|
-
try {
|
|
517
|
-
const sessionsWithDiffs = [];
|
|
518
|
-
for (const model of this.chatService.chatModels.get()) {
|
|
519
|
-
if (model.repoData?.diffs && model.repoData.diffs.length > 0 && model.repoData.diffsStatus === "included") {
|
|
520
|
-
sessionsWithDiffs.push({
|
|
521
|
-
model,
|
|
522
|
-
timestamp: model.timestamp
|
|
523
|
-
});
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
sessionsWithDiffs.sort((a, b) => b.timestamp - a.timestamp);
|
|
527
|
-
for (let i = MAX_SESSIONS_WITH_FULL_DIFFS; i < sessionsWithDiffs.length; i++) {
|
|
528
|
-
const {
|
|
529
|
-
model
|
|
530
|
-
} = sessionsWithDiffs[i];
|
|
531
|
-
if (model.repoData) {
|
|
532
|
-
const trimmedRepoData = {
|
|
533
|
-
...model.repoData,
|
|
534
|
-
diffs: undefined,
|
|
535
|
-
diffsStatus: "trimmedForStorage"
|
|
536
|
-
};
|
|
537
|
-
model.setRepoData(trimmedRepoData);
|
|
538
|
-
this.logService.trace(`[ChatRepoInfo] Trimmed diffs from older session: ${( model.sessionResource.toString())}`);
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
} catch (error) {
|
|
542
|
-
this.logService.warn("[ChatRepoInfo] Failed to trim old session diffs:", error);
|
|
169
|
+
this.logService.warn("[ChatRepoInfo] Failed to capture repo metadata:", error);
|
|
543
170
|
}
|
|
544
171
|
}
|
|
545
172
|
};
|
|
546
|
-
ChatRepoInfoContribution = ( __decorate([( __param(0, IChatService)), ( __param(1, IChatEntitlementService)), ( __param(2, ISCMService)), ( __param(3,
|
|
173
|
+
ChatRepoInfoContribution = ( __decorate([( __param(0, IChatService)), ( __param(1, IChatEntitlementService)), ( __param(2, ISCMService)), ( __param(3, ILogService)), ( __param(4, IConfigurationService))], ChatRepoInfoContribution));
|
|
547
174
|
|
|
548
|
-
export { ChatRepoInfoContribution,
|
|
175
|
+
export { ChatRepoInfoContribution, captureRepoMetadata };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { ICommandService } from "@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service";
|
|
2
|
+
import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
|
|
3
|
+
import { IExtensionsWorkbenchService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/extensions/common/extensions.service";
|
|
2
4
|
export type InstallChatClassification = {
|
|
3
5
|
owner: "bpasero";
|
|
4
6
|
comment: "Provides insight into chat installation.";
|
|
@@ -53,3 +55,11 @@ export interface IChatSetupResult {
|
|
|
53
55
|
readonly dialogSkipped: boolean;
|
|
54
56
|
}
|
|
55
57
|
export declare function refreshTokens(commandService: ICommandService): void;
|
|
58
|
+
/**
|
|
59
|
+
* Ensures the authentication provider extension is enabled.
|
|
60
|
+
* If the extension is found locally but disabled, it will be
|
|
61
|
+
* re-enabled and running extensions will be updated.
|
|
62
|
+
*
|
|
63
|
+
* @returns `true` if the extension was re-enabled, `false` otherwise.
|
|
64
|
+
*/
|
|
65
|
+
export declare function maybeEnableAuthExtension(extensionsWorkbenchService: IExtensionsWorkbenchService, logService: ILogService): Promise<boolean>;
|
|
@@ -1,24 +1,28 @@
|
|
|
1
1
|
|
|
2
|
+
import { ExtensionIdentifier } from '@codingame/monaco-vscode-api/vscode/vs/platform/extensions/common/extensions';
|
|
2
3
|
import product from '@codingame/monaco-vscode-api/vscode/vs/platform/product/common/product';
|
|
4
|
+
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
5
|
+
import { EnablementState } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensionManagement/common/extensionManagement';
|
|
3
6
|
|
|
4
7
|
const defaultChat = {
|
|
5
|
-
completionsRefreshTokenCommand: product.defaultChatAgent?.completionsRefreshTokenCommand ??
|
|
6
|
-
chatRefreshTokenCommand: product.defaultChatAgent?.chatRefreshTokenCommand ??
|
|
8
|
+
completionsRefreshTokenCommand: product.defaultChatAgent?.completionsRefreshTokenCommand ?? "",
|
|
9
|
+
chatRefreshTokenCommand: product.defaultChatAgent?.chatRefreshTokenCommand ?? "",
|
|
10
|
+
providerExtensionId: product.defaultChatAgent?.providerExtensionId ?? ""
|
|
7
11
|
};
|
|
8
12
|
var ChatSetupAnonymous;
|
|
9
|
-
(function
|
|
13
|
+
(function(ChatSetupAnonymous) {
|
|
10
14
|
ChatSetupAnonymous[ChatSetupAnonymous["Disabled"] = 0] = "Disabled";
|
|
11
15
|
ChatSetupAnonymous[ChatSetupAnonymous["EnabledWithDialog"] = 1] = "EnabledWithDialog";
|
|
12
16
|
ChatSetupAnonymous[ChatSetupAnonymous["EnabledWithoutDialog"] = 2] = "EnabledWithoutDialog";
|
|
13
17
|
})(ChatSetupAnonymous || (ChatSetupAnonymous = {}));
|
|
14
18
|
var ChatSetupStep;
|
|
15
|
-
(function
|
|
19
|
+
(function(ChatSetupStep) {
|
|
16
20
|
ChatSetupStep[ChatSetupStep["Initial"] = 1] = "Initial";
|
|
17
21
|
ChatSetupStep[ChatSetupStep["SigningIn"] = 2] = "SigningIn";
|
|
18
22
|
ChatSetupStep[ChatSetupStep["Installing"] = 3] = "Installing";
|
|
19
23
|
})(ChatSetupStep || (ChatSetupStep = {}));
|
|
20
24
|
var ChatSetupStrategy;
|
|
21
|
-
(function
|
|
25
|
+
(function(ChatSetupStrategy) {
|
|
22
26
|
ChatSetupStrategy[ChatSetupStrategy["Canceled"] = 0] = "Canceled";
|
|
23
27
|
ChatSetupStrategy[ChatSetupStrategy["DefaultSetup"] = 1] = "DefaultSetup";
|
|
24
28
|
ChatSetupStrategy[ChatSetupStrategy["SetupWithoutEnterpriseProvider"] = 2] = "SetupWithoutEnterpriseProvider";
|
|
@@ -30,5 +34,33 @@ function refreshTokens(commandService) {
|
|
|
30
34
|
commandService.executeCommand(defaultChat.completionsRefreshTokenCommand);
|
|
31
35
|
commandService.executeCommand(defaultChat.chatRefreshTokenCommand);
|
|
32
36
|
}
|
|
37
|
+
async function maybeEnableAuthExtension(extensionsWorkbenchService, logService) {
|
|
38
|
+
if (!defaultChat.providerExtensionId) {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
const providerExtension = extensionsWorkbenchService.local.find(
|
|
42
|
+
e => ExtensionIdentifier.equals(e.identifier.id, defaultChat.providerExtensionId)
|
|
43
|
+
);
|
|
44
|
+
if (!providerExtension) {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
if (providerExtension.enablementState === EnablementState.DisabledGlobally || providerExtension.enablementState === EnablementState.DisabledWorkspace) {
|
|
48
|
+
logService.info(
|
|
49
|
+
`[chat setup] auth provider extension '${defaultChat.providerExtensionId}' is disabled, re-enabling it`
|
|
50
|
+
);
|
|
51
|
+
try {
|
|
52
|
+
await extensionsWorkbenchService.setEnablement([providerExtension], EnablementState.EnabledGlobally);
|
|
53
|
+
await extensionsWorkbenchService.updateRunningExtensions(( localize(5990, "Enabling GitHub Authentication")));
|
|
54
|
+
return true;
|
|
55
|
+
} catch (error) {
|
|
56
|
+
logService.error(
|
|
57
|
+
`[chat setup] failed to re-enable auth provider extension '${defaultChat.providerExtensionId}'`,
|
|
58
|
+
error
|
|
59
|
+
);
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
33
65
|
|
|
34
|
-
export { ChatSetupAnonymous, ChatSetupStep, ChatSetupStrategy, refreshTokens };
|
|
66
|
+
export { ChatSetupAnonymous, ChatSetupStep, ChatSetupStrategy, maybeEnableAuthExtension, refreshTokens };
|
|
@@ -12,6 +12,7 @@ import { IWorkbenchExtensionEnablementService } from "@codingame/monaco-vscode-a
|
|
|
12
12
|
import { IExtensionService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service";
|
|
13
13
|
import { IWorkbenchLayoutService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/layout/browser/layoutService.service";
|
|
14
14
|
import { IExtensionsWorkbenchService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/extensions/common/extensions.service";
|
|
15
|
+
import { IChatSessionsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService.service";
|
|
15
16
|
export declare class ChatSetupContribution extends Disposable implements IWorkbenchContribution {
|
|
16
17
|
private readonly instantiationService;
|
|
17
18
|
private readonly logService;
|
|
@@ -20,9 +21,12 @@ export declare class ChatSetupContribution extends Disposable implements IWorkbe
|
|
|
20
21
|
private readonly extensionsWorkbenchService;
|
|
21
22
|
private readonly extensionService;
|
|
22
23
|
private readonly environmentService;
|
|
24
|
+
private readonly chatSessionsService;
|
|
25
|
+
private readonly configurationService;
|
|
23
26
|
static readonly ID = "workbench.contrib.chatSetup";
|
|
24
|
-
constructor(instantiationService: IInstantiationService, chatEntitlementService: ChatEntitlementService, logService: ILogService, contextKeyService: IContextKeyService, extensionEnablementService: IWorkbenchExtensionEnablementService, extensionsWorkbenchService: IExtensionsWorkbenchService, extensionService: IExtensionService, environmentService: IEnvironmentService);
|
|
27
|
+
constructor(instantiationService: IInstantiationService, chatEntitlementService: ChatEntitlementService, logService: ILogService, contextKeyService: IContextKeyService, extensionEnablementService: IWorkbenchExtensionEnablementService, extensionsWorkbenchService: IExtensionsWorkbenchService, extensionService: IExtensionService, environmentService: IEnvironmentService, chatSessionsService: IChatSessionsService, configurationService: IConfigurationService);
|
|
25
28
|
private registerSetupAgents;
|
|
29
|
+
private registerGrowthSession;
|
|
26
30
|
private registerActions;
|
|
27
31
|
private registerUrlLinkHandler;
|
|
28
32
|
private checkExtensionInstallation;
|