@codingame/monaco-vscode-chat-service-override 26.2.2 → 28.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 +35 -2
- 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 +89 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/aiCustomizationWorkspaceService.js +251 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/newSession.d.ts +123 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/newSession.js +278 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/sessionsConfigurationService.d.ts +76 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/sessionsConfigurationService.js +299 -0
- package/vscode/src/vs/sessions/contrib/fileTreeView/browser/githubFileSystemProvider.d.ts +67 -0
- package/vscode/src/vs/sessions/contrib/fileTreeView/browser/githubFileSystemProvider.js +263 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsManagementService.d.ts +85 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsManagementService.js +397 -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 +13 -5
- 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 +85 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPluginActions.d.ts +8 -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 +18 -32
- 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 +17 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.js +49 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +18 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.d.ts +58 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.js +537 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditorInput.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditorInput.js +55 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginItems.d.ts +26 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginItems.js +9 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/media/agentPluginEditor.css +32 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.d.ts +48 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.js +282 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.d.ts +55 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.js +634 -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 +74 -67
- 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 +52 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.js +20 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.d.ts +179 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.js +987 -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 +246 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.d.ts +56 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.js +26 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.d.ts +130 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.js +878 -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 +83 -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 +692 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationManagement.css +936 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.d.ts +62 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.js +702 -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/simpleBrowserEditorOverlay.js +36 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +622 -391
- 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 +314 -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 +46 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFilters.js +170 -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 +61 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.js +467 -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 +47 -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 +788 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCheckpointTimelineImpl.d.ts +2 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCheckpointTimelineImpl.js +32 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.js +6 -24
- 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/media/chatEditorController.css +2 -2
- 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 +24 -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 +17 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.js +394 -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/chatTipCatalog.d.ts +66 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipCatalog.js +245 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipEligibilityTracker.d.ts +78 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipEligibilityTracker.js +234 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.d.ts +88 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.js +624 -68
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipStorageKeys.d.ts +41 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipStorageKeys.js +22 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWindowNotifier.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWindowNotifier.js +88 -24
- 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 +26 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.js +175 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.d.ts +99 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.js +489 -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 +19 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.js +364 -279
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.d.ts +18 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.js +69 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionOverlay.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js +9 -9
- 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.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.js +67 -38
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.d.ts +20 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.js +187 -74
- 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.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.js +29 -14
- 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 +126 -30
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorContrib.js +9 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorHover.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/chatQuick.js +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 +46 -9
- 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 +65 -37
- 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 +16 -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 +40 -0
- package/vscode/src/vs/workbench/contrib/chat/common/aiCustomizationWorkspaceService.js +28 -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 +44 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.js +208 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.d.ts +19 -9
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.js +261 -105
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceTelemetry.d.ts +21 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceTelemetry.js +7 -2
- 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 +13 -4
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.js +144 -11
- package/vscode/src/vs/workbench/contrib/chat/common/model/objectMutationLog.js +36 -3
- 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 +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.d.ts +57 -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 +119 -0
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.js +748 -0
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.d.ts +146 -0
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.js +672 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +35 -16
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookClaudeCompat.d.ts +3 -16
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookClaudeCompat.js +7 -50
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCompatibility.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCompatibility.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCopilotCliCompat.d.ts +1 -6
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCopilotCliCompat.js +4 -8
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/PromptHeaderDefinitionProvider.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.js +10 -9
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptDocumentSemanticTokensProvider.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.d.ts +26 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +293 -94
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.d.ts +10 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.js +86 -30
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.d.ts +121 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.js +1422 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/promptFileContributions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.d.ts +48 -14
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.js +404 -132
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts +17 -2
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +40 -28
- 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/chat/common/widget/chatResponseResourceFileSystemProvider.d.ts +14 -2
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatResponseResourceFileSystemProvider.js +54 -5
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +12 -5
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.d.ts +27 -4
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +265 -25
- 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 +17 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +302 -69
- 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 +7 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +63 -21
- 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 +7 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +46 -17
- 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/browser/attachments/chatVariables.d.ts +0 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatVariables.js +0 -51
- 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
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
4
|
+
import { joinPath, relativePath } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
5
|
+
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
6
|
+
import { AICustomizationManagementSection, applyStorageSourceFilter } from '../../../../workbench/contrib/chat/common/aiCustomizationWorkspaceService.js';
|
|
7
|
+
import { PromptsStorage } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService';
|
|
8
|
+
import { IPromptsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.service';
|
|
9
|
+
import { ISessionsManagementService } from '@codingame/monaco-vscode-api/vscode/vs/sessions/contrib/sessions/browser/sessionsManagementService.service';
|
|
10
|
+
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
11
|
+
import { CustomizationCreatorService } from '../../../../workbench/contrib/chat/browser/aiCustomization/customizationCreatorService.js';
|
|
12
|
+
import { PromptsType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/promptTypes';
|
|
13
|
+
import { IPathService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/path/common/pathService.service';
|
|
14
|
+
import { ICommandService } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service';
|
|
15
|
+
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
16
|
+
import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
|
|
17
|
+
import '@codingame/monaco-vscode-api/vscode/vs/platform/notification/common/notification';
|
|
18
|
+
import { INotificationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/notification/common/notification.service';
|
|
19
|
+
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
20
|
+
import Severity from '@codingame/monaco-vscode-api/vscode/vs/base/common/severity';
|
|
21
|
+
import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableValue';
|
|
22
|
+
import { derived } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/derived';
|
|
23
|
+
|
|
24
|
+
var SessionsAICustomizationWorkspaceService_1;
|
|
25
|
+
let SessionsAICustomizationWorkspaceService = class SessionsAICustomizationWorkspaceService {
|
|
26
|
+
static {
|
|
27
|
+
SessionsAICustomizationWorkspaceService_1 = this;
|
|
28
|
+
}
|
|
29
|
+
constructor(
|
|
30
|
+
sessionsService,
|
|
31
|
+
instantiationService,
|
|
32
|
+
promptsService,
|
|
33
|
+
pathService,
|
|
34
|
+
commandService,
|
|
35
|
+
logService,
|
|
36
|
+
fileService,
|
|
37
|
+
notificationService
|
|
38
|
+
) {
|
|
39
|
+
this.sessionsService = sessionsService;
|
|
40
|
+
this.instantiationService = instantiationService;
|
|
41
|
+
this.promptsService = promptsService;
|
|
42
|
+
this.commandService = commandService;
|
|
43
|
+
this.logService = logService;
|
|
44
|
+
this.fileService = fileService;
|
|
45
|
+
this.notificationService = notificationService;
|
|
46
|
+
this.managementSections = [
|
|
47
|
+
AICustomizationManagementSection.Agents,
|
|
48
|
+
AICustomizationManagementSection.Skills,
|
|
49
|
+
AICustomizationManagementSection.Instructions,
|
|
50
|
+
AICustomizationManagementSection.Prompts,
|
|
51
|
+
AICustomizationManagementSection.Hooks,
|
|
52
|
+
AICustomizationManagementSection.McpServers,
|
|
53
|
+
AICustomizationManagementSection.Plugins
|
|
54
|
+
];
|
|
55
|
+
this.isSessionsWindow = true;
|
|
56
|
+
const userHome = pathService.userHome({
|
|
57
|
+
preferLocal: true
|
|
58
|
+
});
|
|
59
|
+
this._cliUserRoots = [
|
|
60
|
+
joinPath(userHome, ".copilot"),
|
|
61
|
+
joinPath(userHome, ".claude"),
|
|
62
|
+
joinPath(userHome, ".agents")
|
|
63
|
+
];
|
|
64
|
+
this._cliUserFilter = {
|
|
65
|
+
sources: [PromptsStorage.local, PromptsStorage.user, PromptsStorage.plugin],
|
|
66
|
+
includedUserFileRoots: this._cliUserRoots
|
|
67
|
+
};
|
|
68
|
+
this._overrideRoot = observableValue(this, undefined);
|
|
69
|
+
this.activeProjectRoot = derived(reader => {
|
|
70
|
+
const override = this._overrideRoot.read(reader);
|
|
71
|
+
if (override) {
|
|
72
|
+
return override;
|
|
73
|
+
}
|
|
74
|
+
const session = this.sessionsService.activeSession.read(reader);
|
|
75
|
+
return session?.worktree ?? session?.repository;
|
|
76
|
+
});
|
|
77
|
+
this.hasOverrideProjectRoot = derived(reader => {
|
|
78
|
+
return this._overrideRoot.read(reader) !== undefined;
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
getActiveProjectRoot() {
|
|
82
|
+
const override = this._overrideRoot.get();
|
|
83
|
+
if (override) {
|
|
84
|
+
return override;
|
|
85
|
+
}
|
|
86
|
+
const session = this.sessionsService.getActiveSession();
|
|
87
|
+
return session?.worktree ?? session?.repository;
|
|
88
|
+
}
|
|
89
|
+
setOverrideProjectRoot(root) {
|
|
90
|
+
this._overrideRoot.set(root, undefined);
|
|
91
|
+
}
|
|
92
|
+
clearOverrideProjectRoot() {
|
|
93
|
+
this._overrideRoot.set(undefined, undefined);
|
|
94
|
+
}
|
|
95
|
+
static {
|
|
96
|
+
this._hooksFilter = {
|
|
97
|
+
sources: [PromptsStorage.local, PromptsStorage.plugin]
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
static {
|
|
101
|
+
this._allUserRootsFilter = {
|
|
102
|
+
sources: [PromptsStorage.local, PromptsStorage.user, PromptsStorage.plugin]
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
getStorageSourceFilter(type) {
|
|
106
|
+
if (type === PromptsType.hook) {
|
|
107
|
+
return SessionsAICustomizationWorkspaceService_1._hooksFilter;
|
|
108
|
+
}
|
|
109
|
+
if (type === PromptsType.prompt) {
|
|
110
|
+
return SessionsAICustomizationWorkspaceService_1._allUserRootsFilter;
|
|
111
|
+
}
|
|
112
|
+
return this._cliUserFilter;
|
|
113
|
+
}
|
|
114
|
+
async commitFiles(_projectRoot, fileUris) {
|
|
115
|
+
const session = this.sessionsService.getActiveSession();
|
|
116
|
+
if (!session?.repository) {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
for (const fileUri of fileUris) {
|
|
120
|
+
await this.commitFileToRepos(fileUri, session.repository, session.worktree);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
async deleteFiles(_projectRoot, fileUris) {
|
|
124
|
+
const session = this.sessionsService.getActiveSession();
|
|
125
|
+
if (!session?.repository) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
for (const fileUri of fileUris) {
|
|
129
|
+
await this.commitDeletionToRepos(fileUri, session.repository, session.worktree);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
getRelativePath(fileUri, repositoryUri, worktreeUri) {
|
|
133
|
+
if (worktreeUri) {
|
|
134
|
+
const rel = relativePath(worktreeUri, fileUri);
|
|
135
|
+
if (rel) {
|
|
136
|
+
return rel;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return relativePath(repositoryUri, fileUri);
|
|
140
|
+
}
|
|
141
|
+
async commitFileToRepos(fileUri, repositoryUri, worktreeUri) {
|
|
142
|
+
const relPath = this.getRelativePath(fileUri, repositoryUri, worktreeUri);
|
|
143
|
+
if (!relPath) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
const repoFileUri = URI.joinPath(repositoryUri, relPath);
|
|
147
|
+
try {
|
|
148
|
+
if (( repoFileUri.toString()) !== ( fileUri.toString())) {
|
|
149
|
+
const content = await this.fileService.readFile(fileUri);
|
|
150
|
+
await this.fileService.writeFile(repoFileUri, content.value);
|
|
151
|
+
}
|
|
152
|
+
await this.commandService.executeCommand("github.copilot.cli.sessions.commitToRepository", {
|
|
153
|
+
repositoryUri,
|
|
154
|
+
fileUri: repoFileUri
|
|
155
|
+
});
|
|
156
|
+
} catch (error) {
|
|
157
|
+
this.logService.error(
|
|
158
|
+
"[SessionsAICustomizationWorkspaceService] Failed to commit to repository:",
|
|
159
|
+
error
|
|
160
|
+
);
|
|
161
|
+
if (worktreeUri) {
|
|
162
|
+
this.notificationService.notify({
|
|
163
|
+
severity: Severity.Warning,
|
|
164
|
+
message: ( localize(
|
|
165
|
+
2517,
|
|
166
|
+
"Your customization was saved to this session's worktree, but we couldn't apply it to the default branch. You may need to apply it manually."
|
|
167
|
+
))
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
if (worktreeUri) {
|
|
172
|
+
const worktreeFileUri = URI.joinPath(worktreeUri, relPath);
|
|
173
|
+
try {
|
|
174
|
+
if (( worktreeFileUri.toString()) !== ( fileUri.toString())) {
|
|
175
|
+
const content = await this.fileService.readFile(fileUri);
|
|
176
|
+
await this.fileService.writeFile(worktreeFileUri, content.value);
|
|
177
|
+
}
|
|
178
|
+
await this.commandService.executeCommand("github.copilot.cli.sessions.commitToWorktree", {
|
|
179
|
+
worktreeUri,
|
|
180
|
+
fileUri: worktreeFileUri
|
|
181
|
+
});
|
|
182
|
+
} catch (error) {
|
|
183
|
+
this.logService.error(
|
|
184
|
+
"[SessionsAICustomizationWorkspaceService] Failed to commit to worktree:",
|
|
185
|
+
error
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
async commitDeletionToRepos(fileUri, repositoryUri, worktreeUri) {
|
|
191
|
+
const relPath = this.getRelativePath(fileUri, repositoryUri, worktreeUri);
|
|
192
|
+
if (!relPath) {
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
const repoFileUri = URI.joinPath(repositoryUri, relPath);
|
|
196
|
+
try {
|
|
197
|
+
if (await this.fileService.exists(repoFileUri)) {
|
|
198
|
+
await this.fileService.del(repoFileUri, {
|
|
199
|
+
useTrash: true,
|
|
200
|
+
recursive: true
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
await this.commandService.executeCommand("github.copilot.cli.sessions.commitToRepository", {
|
|
204
|
+
repositoryUri,
|
|
205
|
+
fileUri: repoFileUri
|
|
206
|
+
});
|
|
207
|
+
} catch (error) {
|
|
208
|
+
this.logService.error(
|
|
209
|
+
"[SessionsAICustomizationWorkspaceService] Failed to commit deletion to repository:",
|
|
210
|
+
error
|
|
211
|
+
);
|
|
212
|
+
if (worktreeUri) {
|
|
213
|
+
this.notificationService.notify({
|
|
214
|
+
severity: Severity.Warning,
|
|
215
|
+
message: ( localize(
|
|
216
|
+
2518,
|
|
217
|
+
"Your customization was removed from this session's worktree, but we couldn't apply the change to the default branch. You may need to remove it manually."
|
|
218
|
+
))
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
if (worktreeUri) {
|
|
223
|
+
const worktreeFileUri = URI.joinPath(worktreeUri, relPath);
|
|
224
|
+
try {
|
|
225
|
+
await this.commandService.executeCommand("github.copilot.cli.sessions.commitToWorktree", {
|
|
226
|
+
worktreeUri,
|
|
227
|
+
fileUri: worktreeFileUri
|
|
228
|
+
});
|
|
229
|
+
} catch (error) {
|
|
230
|
+
this.logService.error(
|
|
231
|
+
"[SessionsAICustomizationWorkspaceService] Failed to commit deletion to worktree:",
|
|
232
|
+
error
|
|
233
|
+
);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
async generateCustomization(type) {
|
|
238
|
+
const creator = this.instantiationService.createInstance(CustomizationCreatorService);
|
|
239
|
+
await creator.createWithAI(type);
|
|
240
|
+
}
|
|
241
|
+
async getFilteredPromptSlashCommands(token) {
|
|
242
|
+
const allCommands = await this.promptsService.getPromptSlashCommands(token);
|
|
243
|
+
return allCommands.filter(cmd => {
|
|
244
|
+
const filter = this.getStorageSourceFilter(cmd.promptPath.type);
|
|
245
|
+
return applyStorageSourceFilter([cmd.promptPath], filter).length > 0;
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
SessionsAICustomizationWorkspaceService = SessionsAICustomizationWorkspaceService_1 = ( __decorate([( __param(0, ISessionsManagementService)), ( __param(1, IInstantiationService)), ( __param(2, IPromptsService)), ( __param(3, IPathService)), ( __param(4, ICommandService)), ( __param(5, ILogService)), ( __param(6, IFileService)), ( __param(7, INotificationService))], SessionsAICustomizationWorkspaceService));
|
|
250
|
+
|
|
251
|
+
export { SessionsAICustomizationWorkspaceService };
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
|
|
2
|
+
import { Disposable, IDisposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
3
|
+
import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
4
|
+
import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
|
|
5
|
+
import { IChatSessionProviderOptionGroup, IChatSessionProviderOptionItem } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService";
|
|
6
|
+
import { IChatSessionsService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService.service";
|
|
7
|
+
import { IsolationMode } from "@codingame/monaco-vscode-api/vscode/vs/sessions/contrib/chat/browser/sessionTargetPicker";
|
|
8
|
+
import { AgentSessionProviders } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessions";
|
|
9
|
+
import { IContextKeyService } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service";
|
|
10
|
+
import { IChatRequestVariableEntry } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/attachments/chatVariableEntries";
|
|
11
|
+
export type NewSessionChangeType = "repoUri" | "isolationMode" | "branch" | "options" | "disabled";
|
|
12
|
+
/**
|
|
13
|
+
* Represents a resolved option group with its current selected value.
|
|
14
|
+
*/
|
|
15
|
+
export interface ISessionOptionGroup {
|
|
16
|
+
readonly group: IChatSessionProviderOptionGroup;
|
|
17
|
+
readonly value: IChatSessionProviderOptionItem | undefined;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A new session represents a session being configured before the first
|
|
21
|
+
* request is sent. It holds the user's selections (repoUri, isolationMode)
|
|
22
|
+
* and fires a single event when any property changes.
|
|
23
|
+
*/
|
|
24
|
+
export interface INewSession extends IDisposable {
|
|
25
|
+
readonly resource: URI;
|
|
26
|
+
readonly target: AgentSessionProviders;
|
|
27
|
+
readonly repoUri: URI | undefined;
|
|
28
|
+
readonly isolationMode: IsolationMode;
|
|
29
|
+
readonly branch: string | undefined;
|
|
30
|
+
readonly modelId: string | undefined;
|
|
31
|
+
readonly query: string | undefined;
|
|
32
|
+
readonly attachedContext: IChatRequestVariableEntry[] | undefined;
|
|
33
|
+
readonly selectedOptions: ReadonlyMap<string, IChatSessionProviderOptionItem>;
|
|
34
|
+
readonly disabled: boolean;
|
|
35
|
+
readonly onDidChange: Event<NewSessionChangeType>;
|
|
36
|
+
setRepoUri(uri: URI): void;
|
|
37
|
+
setIsolationMode(mode: IsolationMode): void;
|
|
38
|
+
setBranch(branch: string | undefined): void;
|
|
39
|
+
setModelId(modelId: string | undefined): void;
|
|
40
|
+
setQuery(query: string): void;
|
|
41
|
+
setAttachedContext(context: IChatRequestVariableEntry[] | undefined): void;
|
|
42
|
+
setOption(optionId: string, value: IChatSessionProviderOptionItem | string): void;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Local new session for Background agent sessions.
|
|
46
|
+
* Fires `onDidChange` for both `repoUri` and `isolationMode` changes.
|
|
47
|
+
* Notifies the extension service with session options for each property change.
|
|
48
|
+
*/
|
|
49
|
+
export declare class LocalNewSession extends Disposable implements INewSession {
|
|
50
|
+
readonly resource: URI;
|
|
51
|
+
private readonly chatSessionsService;
|
|
52
|
+
private readonly logService;
|
|
53
|
+
private _repoUri;
|
|
54
|
+
private _isolationMode;
|
|
55
|
+
private _branch;
|
|
56
|
+
private _modelId;
|
|
57
|
+
private _query;
|
|
58
|
+
private _attachedContext;
|
|
59
|
+
private readonly _onDidChange;
|
|
60
|
+
readonly onDidChange: Event<NewSessionChangeType>;
|
|
61
|
+
readonly target = AgentSessionProviders.Background;
|
|
62
|
+
readonly selectedOptions: Map<string, IChatSessionProviderOptionItem>;
|
|
63
|
+
get repoUri(): URI | undefined;
|
|
64
|
+
get isolationMode(): IsolationMode;
|
|
65
|
+
get branch(): string | undefined;
|
|
66
|
+
get modelId(): string | undefined;
|
|
67
|
+
get query(): string | undefined;
|
|
68
|
+
get attachedContext(): IChatRequestVariableEntry[] | undefined;
|
|
69
|
+
get disabled(): boolean;
|
|
70
|
+
constructor(resource: URI, defaultRepoUri: URI | undefined, chatSessionsService: IChatSessionsService, logService: ILogService);
|
|
71
|
+
setRepoUri(uri: URI): void;
|
|
72
|
+
setIsolationMode(mode: IsolationMode): void;
|
|
73
|
+
setBranch(branch: string | undefined): void;
|
|
74
|
+
setModelId(modelId: string | undefined): void;
|
|
75
|
+
setQuery(query: string): void;
|
|
76
|
+
setAttachedContext(context: IChatRequestVariableEntry[] | undefined): void;
|
|
77
|
+
setOption(optionId: string, value: IChatSessionProviderOptionItem | string): void;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Remote new session for Cloud agent sessions.
|
|
81
|
+
* Manages extension-driven option groups (models, etc.) and their values.
|
|
82
|
+
* Fires events for option group changes.
|
|
83
|
+
*/
|
|
84
|
+
export declare class RemoteNewSession extends Disposable implements INewSession {
|
|
85
|
+
readonly resource: URI;
|
|
86
|
+
readonly target: AgentSessionProviders;
|
|
87
|
+
private readonly chatSessionsService;
|
|
88
|
+
private readonly contextKeyService;
|
|
89
|
+
private readonly logService;
|
|
90
|
+
private _repoUri;
|
|
91
|
+
private _modelId;
|
|
92
|
+
private _query;
|
|
93
|
+
private _attachedContext;
|
|
94
|
+
private readonly _onDidChange;
|
|
95
|
+
readonly onDidChange: Event<NewSessionChangeType>;
|
|
96
|
+
private readonly _onDidChangeOptionGroups;
|
|
97
|
+
readonly onDidChangeOptionGroups: Event<void>;
|
|
98
|
+
readonly selectedOptions: Map<string, IChatSessionProviderOptionItem>;
|
|
99
|
+
get repoUri(): URI | undefined;
|
|
100
|
+
get isolationMode(): IsolationMode;
|
|
101
|
+
get branch(): string | undefined;
|
|
102
|
+
get modelId(): string | undefined;
|
|
103
|
+
get query(): string | undefined;
|
|
104
|
+
get attachedContext(): IChatRequestVariableEntry[] | undefined;
|
|
105
|
+
get disabled(): boolean;
|
|
106
|
+
private readonly _whenClauseKeys;
|
|
107
|
+
constructor(resource: URI, target: AgentSessionProviders, chatSessionsService: IChatSessionsService, contextKeyService: IContextKeyService, logService: ILogService);
|
|
108
|
+
setRepoUri(uri: URI): void;
|
|
109
|
+
setIsolationMode(_mode: IsolationMode): void;
|
|
110
|
+
setBranch(_branch: string | undefined): void;
|
|
111
|
+
setModelId(modelId: string | undefined): void;
|
|
112
|
+
setQuery(query: string): void;
|
|
113
|
+
setAttachedContext(context: IChatRequestVariableEntry[] | undefined): void;
|
|
114
|
+
setOption(optionId: string, value: IChatSessionProviderOptionItem | string): void;
|
|
115
|
+
getModelOptionGroup(): ISessionOptionGroup | undefined;
|
|
116
|
+
getOtherOptionGroups(): ISessionOptionGroup[];
|
|
117
|
+
getOptionValue(groupId: string): IChatSessionProviderOptionItem | undefined;
|
|
118
|
+
setOptionValue(groupId: string, value: IChatSessionProviderOptionItem): void;
|
|
119
|
+
private _getOptionGroups;
|
|
120
|
+
private _isOptionGroupVisible;
|
|
121
|
+
private _updateWhenClauseKeys;
|
|
122
|
+
private _getValueForGroup;
|
|
123
|
+
}
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
4
|
+
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
5
|
+
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
6
|
+
import { IChatSessionsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService.service';
|
|
7
|
+
import { AgentSessionProviders } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessions';
|
|
8
|
+
import { ContextKeyExpr } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
|
|
9
|
+
import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
10
|
+
|
|
11
|
+
const REPOSITORY_OPTION_ID = "repository";
|
|
12
|
+
const BRANCH_OPTION_ID = "branch";
|
|
13
|
+
const ISOLATION_OPTION_ID = "isolation";
|
|
14
|
+
let LocalNewSession = class LocalNewSession extends Disposable {
|
|
15
|
+
get repoUri() {
|
|
16
|
+
return this._repoUri;
|
|
17
|
+
}
|
|
18
|
+
get isolationMode() {
|
|
19
|
+
return this._isolationMode;
|
|
20
|
+
}
|
|
21
|
+
get branch() {
|
|
22
|
+
return this._branch;
|
|
23
|
+
}
|
|
24
|
+
get modelId() {
|
|
25
|
+
return this._modelId;
|
|
26
|
+
}
|
|
27
|
+
get query() {
|
|
28
|
+
return this._query;
|
|
29
|
+
}
|
|
30
|
+
get attachedContext() {
|
|
31
|
+
return this._attachedContext;
|
|
32
|
+
}
|
|
33
|
+
get disabled() {
|
|
34
|
+
if (!this._repoUri) {
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
if (this._isolationMode === "worktree" && !this._branch) {
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
constructor(resource, defaultRepoUri, chatSessionsService, logService) {
|
|
43
|
+
super();
|
|
44
|
+
this.resource = resource;
|
|
45
|
+
this.chatSessionsService = chatSessionsService;
|
|
46
|
+
this.logService = logService;
|
|
47
|
+
this._isolationMode = "worktree";
|
|
48
|
+
this._onDidChange = this._register(( new Emitter()));
|
|
49
|
+
this.onDidChange = this._onDidChange.event;
|
|
50
|
+
this.target = AgentSessionProviders.Background;
|
|
51
|
+
this.selectedOptions = ( new Map());
|
|
52
|
+
if (defaultRepoUri) {
|
|
53
|
+
this._repoUri = defaultRepoUri;
|
|
54
|
+
this.setOption(REPOSITORY_OPTION_ID, defaultRepoUri.fsPath);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
setRepoUri(uri) {
|
|
58
|
+
this._repoUri = uri;
|
|
59
|
+
this._isolationMode = "workspace";
|
|
60
|
+
this._branch = undefined;
|
|
61
|
+
this._onDidChange.fire("repoUri");
|
|
62
|
+
this._onDidChange.fire("disabled");
|
|
63
|
+
this.setOption(REPOSITORY_OPTION_ID, uri.fsPath);
|
|
64
|
+
}
|
|
65
|
+
setIsolationMode(mode) {
|
|
66
|
+
if (this._isolationMode !== mode) {
|
|
67
|
+
this._isolationMode = mode;
|
|
68
|
+
this._onDidChange.fire("isolationMode");
|
|
69
|
+
this._onDidChange.fire("disabled");
|
|
70
|
+
this.setOption(ISOLATION_OPTION_ID, mode);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
setBranch(branch) {
|
|
74
|
+
if (this._branch !== branch) {
|
|
75
|
+
this._branch = branch;
|
|
76
|
+
this._onDidChange.fire("branch");
|
|
77
|
+
this._onDidChange.fire("disabled");
|
|
78
|
+
this.setOption(BRANCH_OPTION_ID, branch ?? "");
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
setModelId(modelId) {
|
|
82
|
+
this._modelId = modelId;
|
|
83
|
+
}
|
|
84
|
+
setQuery(query) {
|
|
85
|
+
this._query = query;
|
|
86
|
+
}
|
|
87
|
+
setAttachedContext(context) {
|
|
88
|
+
this._attachedContext = context;
|
|
89
|
+
}
|
|
90
|
+
setOption(optionId, value) {
|
|
91
|
+
if (typeof value === "string") {
|
|
92
|
+
this.selectedOptions.set(optionId, {
|
|
93
|
+
id: value,
|
|
94
|
+
name: value
|
|
95
|
+
});
|
|
96
|
+
} else {
|
|
97
|
+
this.selectedOptions.set(optionId, value);
|
|
98
|
+
}
|
|
99
|
+
this.chatSessionsService.notifySessionOptionsChange(this.resource, [{
|
|
100
|
+
optionId,
|
|
101
|
+
value
|
|
102
|
+
}]).catch(
|
|
103
|
+
err => this.logService.error(`Failed to notify session option ${optionId} change:`, err)
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
LocalNewSession = ( __decorate([( __param(2, IChatSessionsService)), ( __param(3, ILogService))], LocalNewSession));
|
|
108
|
+
let RemoteNewSession = class RemoteNewSession extends Disposable {
|
|
109
|
+
get repoUri() {
|
|
110
|
+
return this._repoUri;
|
|
111
|
+
}
|
|
112
|
+
get isolationMode() {
|
|
113
|
+
return "worktree";
|
|
114
|
+
}
|
|
115
|
+
get branch() {
|
|
116
|
+
return undefined;
|
|
117
|
+
}
|
|
118
|
+
get modelId() {
|
|
119
|
+
return this._modelId;
|
|
120
|
+
}
|
|
121
|
+
get query() {
|
|
122
|
+
return this._query;
|
|
123
|
+
}
|
|
124
|
+
get attachedContext() {
|
|
125
|
+
return this._attachedContext;
|
|
126
|
+
}
|
|
127
|
+
get disabled() {
|
|
128
|
+
return !this._repoUri && !( this.selectedOptions.has("repositories"));
|
|
129
|
+
}
|
|
130
|
+
constructor(resource, target, chatSessionsService, contextKeyService, logService) {
|
|
131
|
+
super();
|
|
132
|
+
this.resource = resource;
|
|
133
|
+
this.target = target;
|
|
134
|
+
this.chatSessionsService = chatSessionsService;
|
|
135
|
+
this.contextKeyService = contextKeyService;
|
|
136
|
+
this.logService = logService;
|
|
137
|
+
this._onDidChange = this._register(( new Emitter()));
|
|
138
|
+
this.onDidChange = this._onDidChange.event;
|
|
139
|
+
this._onDidChangeOptionGroups = this._register(( new Emitter()));
|
|
140
|
+
this.onDidChangeOptionGroups = this._onDidChangeOptionGroups.event;
|
|
141
|
+
this.selectedOptions = ( new Map());
|
|
142
|
+
this._whenClauseKeys = ( new Set());
|
|
143
|
+
this._updateWhenClauseKeys();
|
|
144
|
+
this._register(this.chatSessionsService.onDidChangeOptionGroups(() => {
|
|
145
|
+
this._updateWhenClauseKeys();
|
|
146
|
+
this._onDidChangeOptionGroups.fire();
|
|
147
|
+
this._onDidChange.fire("options");
|
|
148
|
+
}));
|
|
149
|
+
this._register(this.contextKeyService.onDidChangeContext(e => {
|
|
150
|
+
if (this._whenClauseKeys.size > 0 && e.affectsSome(this._whenClauseKeys)) {
|
|
151
|
+
this._onDidChangeOptionGroups.fire();
|
|
152
|
+
}
|
|
153
|
+
}));
|
|
154
|
+
}
|
|
155
|
+
setRepoUri(uri) {
|
|
156
|
+
this._repoUri = uri;
|
|
157
|
+
this._onDidChange.fire("repoUri");
|
|
158
|
+
this._onDidChange.fire("disabled");
|
|
159
|
+
const id = uri.path.substring(1);
|
|
160
|
+
this.setOption("repositories", {
|
|
161
|
+
id,
|
|
162
|
+
name: id
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
setIsolationMode(_mode) {}
|
|
166
|
+
setBranch(_branch) {}
|
|
167
|
+
setModelId(modelId) {
|
|
168
|
+
this._modelId = modelId;
|
|
169
|
+
}
|
|
170
|
+
setQuery(query) {
|
|
171
|
+
this._query = query;
|
|
172
|
+
}
|
|
173
|
+
setAttachedContext(context) {
|
|
174
|
+
this._attachedContext = context;
|
|
175
|
+
}
|
|
176
|
+
setOption(optionId, value) {
|
|
177
|
+
if (typeof value !== "string") {
|
|
178
|
+
this.selectedOptions.set(optionId, value);
|
|
179
|
+
}
|
|
180
|
+
this._onDidChange.fire("options");
|
|
181
|
+
this._onDidChange.fire("disabled");
|
|
182
|
+
this.chatSessionsService.notifySessionOptionsChange(this.resource, [{
|
|
183
|
+
optionId,
|
|
184
|
+
value
|
|
185
|
+
}]).catch(
|
|
186
|
+
err => this.logService.error(`Failed to notify extension of ${optionId} change:`, err)
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
getModelOptionGroup() {
|
|
190
|
+
const groups = this._getOptionGroups();
|
|
191
|
+
if (!groups) {
|
|
192
|
+
return undefined;
|
|
193
|
+
}
|
|
194
|
+
const group = groups.find(g => isModelOptionGroup(g));
|
|
195
|
+
if (!group) {
|
|
196
|
+
return undefined;
|
|
197
|
+
}
|
|
198
|
+
return {
|
|
199
|
+
group,
|
|
200
|
+
value: this._getValueForGroup(group)
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
getOtherOptionGroups() {
|
|
204
|
+
const groups = this._getOptionGroups();
|
|
205
|
+
if (!groups) {
|
|
206
|
+
return [];
|
|
207
|
+
}
|
|
208
|
+
return ( groups.filter(
|
|
209
|
+
g => !isModelOptionGroup(g) && !isRepositoriesOptionGroup(g) && this._isOptionGroupVisible(g)
|
|
210
|
+
).map(g => ({
|
|
211
|
+
group: g,
|
|
212
|
+
value: this._getValueForGroup(g)
|
|
213
|
+
})));
|
|
214
|
+
}
|
|
215
|
+
getOptionValue(groupId) {
|
|
216
|
+
return this.selectedOptions.get(groupId);
|
|
217
|
+
}
|
|
218
|
+
setOptionValue(groupId, value) {
|
|
219
|
+
this.setOption(groupId, value);
|
|
220
|
+
}
|
|
221
|
+
_getOptionGroups() {
|
|
222
|
+
return this.chatSessionsService.getOptionGroupsForSessionType(this.target);
|
|
223
|
+
}
|
|
224
|
+
_isOptionGroupVisible(group) {
|
|
225
|
+
if (!group.when) {
|
|
226
|
+
return true;
|
|
227
|
+
}
|
|
228
|
+
const expr = ContextKeyExpr.deserialize(group.when);
|
|
229
|
+
return !expr || this.contextKeyService.contextMatchesRules(expr);
|
|
230
|
+
}
|
|
231
|
+
_updateWhenClauseKeys() {
|
|
232
|
+
this._whenClauseKeys.clear();
|
|
233
|
+
const groups = this._getOptionGroups();
|
|
234
|
+
if (!groups) {
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
for (const group of groups) {
|
|
238
|
+
if (group.when) {
|
|
239
|
+
const expr = ContextKeyExpr.deserialize(group.when);
|
|
240
|
+
if (expr) {
|
|
241
|
+
for (const key of ( expr.keys())) {
|
|
242
|
+
this._whenClauseKeys.add(key);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
_getValueForGroup(group) {
|
|
249
|
+
const selected = this.selectedOptions.get(group.id);
|
|
250
|
+
if (selected) {
|
|
251
|
+
return selected;
|
|
252
|
+
}
|
|
253
|
+
const sessionOption = this.chatSessionsService.getSessionOption(this.resource, group.id);
|
|
254
|
+
if (sessionOption && typeof sessionOption !== "string") {
|
|
255
|
+
return sessionOption;
|
|
256
|
+
}
|
|
257
|
+
if (typeof sessionOption === "string") {
|
|
258
|
+
const item = group.items.find(i => i.id === sessionOption.trim());
|
|
259
|
+
if (item) {
|
|
260
|
+
return item;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
return group.items.find(i => i.default === true) ?? group.items[0];
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
RemoteNewSession = ( __decorate([( __param(2, IChatSessionsService)), ( __param(3, IContextKeyService)), ( __param(4, ILogService))], RemoteNewSession));
|
|
267
|
+
function isModelOptionGroup(group) {
|
|
268
|
+
if (group.id === "models") {
|
|
269
|
+
return true;
|
|
270
|
+
}
|
|
271
|
+
const nameLower = group.name.toLowerCase();
|
|
272
|
+
return nameLower === "model" || nameLower === "models";
|
|
273
|
+
}
|
|
274
|
+
function isRepositoriesOptionGroup(group) {
|
|
275
|
+
return group.id === "repositories";
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
export { LocalNewSession, RemoteNewSession };
|