@codingame/monaco-vscode-workbench-service-override 37.1.0 → 37.3.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/common.d.ts +3 -0
- package/common.js +29 -0
- package/index.d.ts +1 -1
- package/index.js +25 -32
- package/package.json +18 -8
- package/session.d.ts +4 -0
- package/session.js +260 -0
- package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostLocationPreferenceService.d.ts +24 -0
- package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostLocationPreferenceService.js +71 -0
- package/vscode/src/vs/platform/agentHost/common/remoteAgentHostLocationPreference.d.ts +7 -0
- package/vscode/src/vs/platform/agentHost/common/remoteAgentHostLocationPreference.js +7 -0
- package/vscode/src/vs/sessions/browser/dockedAuxiliaryBarController.d.ts +50 -0
- package/vscode/src/vs/sessions/browser/dockedAuxiliaryBarController.js +120 -0
- package/vscode/src/vs/sessions/browser/media/sessions-logo-dark.svg +6 -0
- package/vscode/src/vs/sessions/browser/media/sessions-logo-light.svg +6 -0
- package/vscode/src/vs/sessions/browser/media/sessionsSetUp.css +72 -0
- package/vscode/src/vs/sessions/browser/parts/chatCompositeBar.d.ts +116 -0
- package/vscode/src/vs/sessions/browser/parts/chatCompositeBar.js +566 -0
- package/vscode/src/vs/sessions/browser/parts/chatGroupDropTarget.d.ts +43 -0
- package/vscode/src/vs/sessions/browser/parts/chatGroupDropTarget.js +308 -0
- package/vscode/src/vs/sessions/browser/parts/chatGroupView.d.ts +108 -0
- package/vscode/src/vs/sessions/browser/parts/chatGroupView.js +324 -0
- package/vscode/src/vs/sessions/browser/parts/chatGroupsView.d.ts +136 -0
- package/vscode/src/vs/sessions/browser/parts/chatGroupsView.js +771 -0
- package/vscode/src/vs/sessions/browser/parts/customViewGridPart.d.ts +43 -0
- package/vscode/src/vs/sessions/browser/parts/customViewGridPart.js +113 -0
- package/vscode/src/vs/sessions/browser/parts/customViewGridParts.d.ts +17 -0
- package/vscode/src/vs/sessions/browser/parts/customViewGridParts.js +31 -0
- package/vscode/src/vs/sessions/browser/parts/customViewNode.d.ts +24 -0
- package/vscode/src/vs/sessions/browser/parts/customViewNode.js +131 -0
- package/vscode/src/vs/sessions/browser/parts/editorPart.d.ts +11 -0
- package/vscode/src/vs/sessions/browser/parts/editorPart.js +36 -0
- package/vscode/src/vs/sessions/browser/parts/editorParts.d.ts +12 -0
- package/vscode/src/vs/sessions/browser/parts/editorParts.js +45 -0
- package/vscode/src/vs/sessions/browser/parts/media/chatCompositeBar.css +559 -0
- package/vscode/src/vs/sessions/browser/parts/media/chatGroupDropTarget.css +27 -0
- package/vscode/src/vs/sessions/browser/parts/media/chatGroupsView.css +60 -0
- package/vscode/src/vs/sessions/browser/parts/media/customViewGridPart.css +108 -0
- package/vscode/src/vs/sessions/browser/parts/media/editorPart.css +210 -0
- package/vscode/src/vs/sessions/browser/parts/media/remoteHostUnavailableEmptyState.css +81 -0
- package/vscode/src/vs/sessions/browser/parts/media/sessionDropTarget.css +31 -0
- package/vscode/src/vs/sessions/browser/parts/media/sessionReadOnlyBanner.css +87 -0
- package/vscode/src/vs/sessions/browser/parts/media/sessionView.css +107 -0
- package/vscode/src/vs/sessions/browser/parts/media/sessionsPart.css +134 -0
- package/vscode/src/vs/sessions/browser/parts/menubar.contribution.d.ts +1 -0
- package/vscode/src/vs/sessions/browser/parts/menubar.contribution.js +79 -0
- package/vscode/src/vs/sessions/browser/parts/mobile/mobileCustomViewGridPart.d.ts +13 -0
- package/vscode/src/vs/sessions/browser/parts/mobile/mobileCustomViewGridPart.js +33 -0
- package/vscode/src/vs/sessions/browser/parts/mobile/mobileSessionsPart.d.ts +14 -0
- package/vscode/src/vs/sessions/browser/parts/mobile/mobileSessionsPart.js +34 -0
- package/vscode/src/vs/sessions/browser/parts/remoteHostUnavailableEmptyState.d.ts +39 -0
- package/vscode/src/vs/sessions/browser/parts/remoteHostUnavailableEmptyState.js +136 -0
- package/vscode/src/vs/sessions/browser/parts/sessionBarStyles.d.ts +9 -0
- package/vscode/src/vs/sessions/browser/parts/sessionBarStyles.js +62 -0
- package/vscode/src/vs/sessions/browser/parts/sessionDropTarget.d.ts +39 -0
- package/vscode/src/vs/sessions/browser/parts/sessionDropTarget.js +261 -0
- package/vscode/src/vs/sessions/browser/parts/sessionHeader.d.ts +97 -0
- package/vscode/src/vs/sessions/browser/parts/sessionHeader.js +345 -0
- package/vscode/src/vs/sessions/browser/parts/sessionReadOnlyBanner.d.ts +43 -0
- package/vscode/src/vs/sessions/browser/parts/sessionReadOnlyBanner.js +69 -0
- package/vscode/src/vs/sessions/browser/parts/sessionRemoteConnection.d.ts +79 -0
- package/vscode/src/vs/sessions/browser/parts/sessionRemoteConnection.js +363 -0
- package/vscode/src/vs/sessions/browser/parts/sessionView.d.ts +125 -0
- package/vscode/src/vs/sessions/browser/parts/sessionView.js +300 -0
- package/vscode/src/vs/sessions/browser/parts/sessionsPart.d.ts +124 -0
- package/vscode/src/vs/sessions/browser/parts/sessionsPart.js +336 -0
- package/vscode/src/vs/sessions/browser/parts/sessionsParts.d.ts +33 -0
- package/vscode/src/vs/sessions/browser/parts/sessionsParts.js +62 -0
- package/vscode/src/vs/sessions/browser/parts/singlePaneAuxiliaryBarPart.d.ts +13 -0
- package/vscode/src/vs/sessions/browser/parts/singlePaneAuxiliaryBarPart.js +36 -0
- package/vscode/src/vs/sessions/browser/parts/singlePaneEditorPart.d.ts +65 -0
- package/vscode/src/vs/sessions/browser/parts/singlePaneEditorPart.js +178 -0
- package/vscode/src/vs/sessions/browser/sessionWorkspace.d.ts +12 -0
- package/vscode/src/vs/sessions/browser/sessionWorkspace.js +19 -0
- package/vscode/src/vs/sessions/browser/sessionsSetUpService.d.ts +24 -0
- package/vscode/src/vs/sessions/browser/sessionsSetUpService.js +598 -0
- package/vscode/src/vs/sessions/browser/sessionsSignInDialog.d.ts +25 -0
- package/vscode/src/vs/sessions/browser/sessionsSignInDialog.js +91 -0
- package/vscode/src/vs/sessions/common/welcome.d.ts +1 -0
- package/vscode/src/vs/sessions/common/welcome.js +5 -0
- package/vscode/src/vs/sessions/contrib/accountMenu/browser/account.contribution.d.ts +11 -0
- package/vscode/src/vs/sessions/contrib/accountMenu/browser/account.contribution.js +1052 -0
- package/vscode/src/vs/sessions/contrib/accountMenu/browser/chatPetAchievementBadges.d.ts +23 -0
- package/vscode/src/vs/sessions/contrib/accountMenu/browser/chatPetAchievementBadges.js +168 -0
- package/vscode/src/vs/sessions/contrib/accountMenu/browser/media/accountTitleBarWidget.css +646 -0
- package/vscode/src/vs/sessions/contrib/accountMenu/browser/media/accountWidget.css +231 -0
- package/vscode/src/vs/sessions/contrib/accountMenu/browser/media/chatPetAchievementBadges.css +120 -0
- package/vscode/src/vs/sessions/contrib/agentFeedback/browser/nullAgentFeedbackService.contribution.d.ts +53 -0
- package/vscode/src/vs/sessions/contrib/agentFeedback/browser/nullAgentFeedbackService.contribution.js +99 -0
- package/vscode/src/vs/sessions/contrib/aiCustomizationTreeView/browser/aiCustomizationTreeView.contribution.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/aiCustomizationTreeView/browser/aiCustomizationTreeView.contribution.js +270 -0
- package/vscode/src/vs/sessions/contrib/aiCustomizationTreeView/browser/aiCustomizationTreeViewViews.d.ts +62 -0
- package/vscode/src/vs/sessions/contrib/aiCustomizationTreeView/browser/aiCustomizationTreeViewViews.js +606 -0
- package/vscode/src/vs/sessions/contrib/aiCustomizationTreeView/browser/media/aiCustomizationTreeView.css +116 -0
- package/vscode/src/vs/sessions/contrib/aquarium/browser/aquarium.contribution.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/aquarium/browser/aquarium.contribution.js +97 -0
- package/vscode/src/vs/sessions/contrib/aquarium/browser/aquariumOverlay.d.ts +72 -0
- package/vscode/src/vs/sessions/contrib/aquarium/browser/aquariumOverlay.js +776 -0
- package/vscode/src/vs/sessions/contrib/aquarium/browser/fish.d.ts +68 -0
- package/vscode/src/vs/sessions/contrib/aquarium/browser/fish.js +153 -0
- package/vscode/src/vs/sessions/contrib/aquarium/browser/fishFeedingStreak.d.ts +58 -0
- package/vscode/src/vs/sessions/contrib/aquarium/browser/fishFeedingStreak.js +172 -0
- package/vscode/src/vs/sessions/contrib/aquarium/browser/media/aquarium.css +316 -0
- package/vscode/src/vs/sessions/contrib/aquarium/browser/vscodeLogoPath.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/aquarium/browser/vscodeLogoPath.js +5 -0
- package/vscode/src/vs/sessions/contrib/automations/browser/automationDialog.d.ts +173 -0
- package/vscode/src/vs/sessions/contrib/automations/browser/automationDialog.js +1589 -0
- package/vscode/src/vs/sessions/contrib/automations/browser/automationDialogService.d.ts +32 -0
- package/vscode/src/vs/sessions/contrib/automations/browser/automationDialogService.js +396 -0
- package/vscode/src/vs/sessions/contrib/automations/browser/automationInputCompletions.d.ts +33 -0
- package/vscode/src/vs/sessions/contrib/automations/browser/automationInputCompletions.js +216 -0
- package/vscode/src/vs/sessions/contrib/automations/browser/automationLeaderElection.d.ts +37 -0
- package/vscode/src/vs/sessions/contrib/automations/browser/automationLeaderElection.js +126 -0
- package/vscode/src/vs/sessions/contrib/automations/browser/automationRunner.d.ts +21 -0
- package/vscode/src/vs/sessions/contrib/automations/browser/automationRunner.js +294 -0
- package/vscode/src/vs/sessions/contrib/automations/browser/automationScheduler.d.ts +59 -0
- package/vscode/src/vs/sessions/contrib/automations/browser/automationScheduler.js +232 -0
- package/vscode/src/vs/sessions/contrib/automations/browser/automationStorageService.d.ts +13 -0
- package/vscode/src/vs/sessions/contrib/automations/browser/automationStorageService.js +22 -0
- package/vscode/src/vs/sessions/contrib/automations/browser/automationTools.d.ts +60 -0
- package/vscode/src/vs/sessions/contrib/automations/browser/automationTools.js +1256 -0
- package/vscode/src/vs/sessions/contrib/automations/browser/automations.contribution.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/automations/browser/automations.contribution.js +88 -0
- package/vscode/src/vs/sessions/contrib/automations/browser/media/automationDialog.css +746 -0
- package/vscode/src/vs/sessions/contrib/automations/browser/providerAutomationService.d.ts +62 -0
- package/vscode/src/vs/sessions/contrib/automations/browser/providerAutomationService.js +493 -0
- package/vscode/src/vs/sessions/contrib/automations/common/isolationGroupModel.d.ts +38 -0
- package/vscode/src/vs/sessions/contrib/automations/common/isolationGroupModel.js +123 -0
- package/vscode/src/vs/sessions/contrib/blockedSessions/browser/blockedSessions.d.ts +45 -0
- package/vscode/src/vs/sessions/contrib/blockedSessions/browser/blockedSessions.js +110 -0
- package/vscode/src/vs/sessions/contrib/browserView/browser/sessionBrowserView.contribution.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/browserView/browser/sessionBrowserView.contribution.js +5 -0
- package/vscode/src/vs/sessions/contrib/browserView/browser/sessionBrowserView.d.ts +31 -0
- package/vscode/src/vs/sessions/contrib/browserView/browser/sessionBrowserView.js +137 -0
- package/vscode/src/vs/sessions/contrib/changes/browser/changes.contribution.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/changes/browser/changes.contribution.js +130 -0
- package/vscode/src/vs/sessions/contrib/changes/browser/changesActions.d.ts +8 -0
- package/vscode/src/vs/sessions/contrib/changes/browser/changesActions.js +385 -0
- package/vscode/src/vs/sessions/contrib/changes/browser/changesMultiDiffSourceResolver.d.ts +28 -0
- package/vscode/src/vs/sessions/contrib/changes/browser/changesMultiDiffSourceResolver.js +76 -0
- package/vscode/src/vs/sessions/contrib/changes/browser/changesViewActions.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/changes/browser/changesViewActions.js +509 -0
- package/vscode/src/vs/sessions/contrib/changes/browser/changesetReviewActions.d.ts +6 -0
- package/vscode/src/vs/sessions/contrib/changes/browser/changesetReviewActions.js +58 -0
- package/vscode/src/vs/sessions/contrib/changes/browser/media/changesActions.css +11 -0
- package/vscode/src/vs/sessions/contrib/changes/browser/sessionSyncChanges.d.ts +24 -0
- package/vscode/src/vs/sessions/contrib/changes/browser/sessionSyncChanges.js +188 -0
- package/vscode/src/vs/sessions/contrib/changes/browser/sessionsChangesAccessibilityHelp.d.ts +15 -0
- package/vscode/src/vs/sessions/contrib/changes/browser/sessionsChangesAccessibilityHelp.js +100 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/chatViewStateService.d.ts +9 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/chatViewStateService.js +18 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/media/sessionChatInputToolbarDebug.css +59 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/sessionChatInputToolbarDebug.d.ts +47 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/sessionChatInputToolbarDebug.js +306 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/sessionTaskRunner.d.ts +41 -0
- package/vscode/src/vs/sessions/contrib/chat/browser/sessionTaskRunner.js +31 -0
- package/vscode/src/vs/sessions/contrib/chatDebug/browser/chatDebug.contribution.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/chatDebug/browser/chatDebug.contribution.js +84 -0
- package/vscode/src/vs/sessions/contrib/customViewTest/browser/customViewTest.contribution.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/customViewTest/browser/customViewTest.contribution.js +111 -0
- package/vscode/src/vs/sessions/contrib/customViewTest/browser/media/customViewTest.css +9 -0
- package/vscode/src/vs/sessions/contrib/editor/browser/addTabActions.d.ts +21 -0
- package/vscode/src/vs/sessions/contrib/editor/browser/addTabActions.js +170 -0
- package/vscode/src/vs/sessions/contrib/editor/browser/editor.contribution.d.ts +14 -0
- package/vscode/src/vs/sessions/contrib/editor/browser/editor.contribution.js +425 -0
- package/vscode/src/vs/sessions/contrib/editor/browser/emptyFileEditor.contribution.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/editor/browser/emptyFileEditor.contribution.js +35 -0
- package/vscode/src/vs/sessions/contrib/editor/browser/emptyFileEditor.d.ts +18 -0
- package/vscode/src/vs/sessions/contrib/editor/browser/emptyFileEditor.js +85 -0
- package/vscode/src/vs/sessions/contrib/editor/browser/emptyFileEditorInput.d.ts +31 -0
- package/vscode/src/vs/sessions/contrib/editor/browser/emptyFileEditorInput.js +125 -0
- package/vscode/src/vs/sessions/contrib/editor/browser/media/editorBreadcrumbs.css +66 -0
- package/vscode/src/vs/sessions/contrib/editor/browser/media/editorHeader.css +113 -0
- package/vscode/src/vs/sessions/contrib/editor/browser/media/emptyFileEditor.css +30 -0
- package/vscode/src/vs/sessions/contrib/fileTreeView/browser/fileTreeView.contribution.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/fileTreeView/browser/fileTreeView.contribution.js +25 -0
- package/vscode/src/vs/sessions/contrib/fileTreeView/browser/githubFileSystemProvider.d.ts +66 -0
- package/vscode/src/vs/sessions/contrib/fileTreeView/browser/githubFileSystemProvider.js +274 -0
- package/vscode/src/vs/sessions/contrib/files/browser/files.contribution.d.ts +6 -0
- package/vscode/src/vs/sessions/contrib/files/browser/files.contribution.js +100 -0
- package/vscode/src/vs/sessions/contrib/files/browser/filesView.d.ts +21 -0
- package/vscode/src/vs/sessions/contrib/files/browser/filesView.js +76 -0
- package/vscode/src/vs/sessions/contrib/files/browser/media/filesView.css +29 -0
- package/vscode/src/vs/sessions/contrib/layout/browser/baseSessionLayoutController.d.ts +211 -0
- package/vscode/src/vs/sessions/contrib/layout/browser/baseSessionLayoutController.js +587 -0
- package/vscode/src/vs/sessions/contrib/layout/browser/desktopSessionLayoutController.d.ts +112 -0
- package/vscode/src/vs/sessions/contrib/layout/browser/desktopSessionLayoutController.js +444 -0
- package/vscode/src/vs/sessions/contrib/layout/browser/mobileSessionLayoutController.d.ts +13 -0
- package/vscode/src/vs/sessions/contrib/layout/browser/mobileSessionLayoutController.js +8 -0
- package/vscode/src/vs/sessions/contrib/layout/browser/sessions.layout.contribution.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/layout/browser/sessions.layout.contribution.js +68 -0
- package/vscode/src/vs/sessions/contrib/layout/browser/singlePane/singlePaneDetailPanelCoordinator.d.ts +32 -0
- package/vscode/src/vs/sessions/contrib/layout/browser/singlePane/singlePaneDetailPanelCoordinator.js +81 -0
- package/vscode/src/vs/sessions/contrib/layout/browser/singlePane/singlePaneDockedTabsCoordinator.d.ts +111 -0
- package/vscode/src/vs/sessions/contrib/layout/browser/singlePane/singlePaneDockedTabsCoordinator.js +513 -0
- package/vscode/src/vs/sessions/contrib/layout/browser/singlePane/singlePaneDraftSessionStrategy.d.ts +44 -0
- package/vscode/src/vs/sessions/contrib/layout/browser/singlePane/singlePaneDraftSessionStrategy.js +423 -0
- package/vscode/src/vs/sessions/contrib/layout/browser/singlePane/singlePaneExistingSessionStrategy.d.ts +62 -0
- package/vscode/src/vs/sessions/contrib/layout/browser/singlePane/singlePaneExistingSessionStrategy.js +435 -0
- package/vscode/src/vs/sessions/contrib/layout/browser/singlePane/singlePaneLayoutStrategy.d.ts +46 -0
- package/vscode/src/vs/sessions/contrib/layout/browser/singlePane/singlePaneLayoutStrategy.js +11 -0
- package/vscode/src/vs/sessions/contrib/layout/browser/singlePane/singlePaneSharedHelpers.d.ts +11 -0
- package/vscode/src/vs/sessions/contrib/layout/browser/singlePane/singlePaneSharedHelpers.js +43 -0
- package/vscode/src/vs/sessions/contrib/layout/browser/singlePane/singlePaneVisibilityProfileStore.d.ts +21 -0
- package/vscode/src/vs/sessions/contrib/layout/browser/singlePane/singlePaneVisibilityProfileStore.js +77 -0
- package/vscode/src/vs/sessions/contrib/layout/browser/singlePaneLayoutController.d.ts +55 -0
- package/vscode/src/vs/sessions/contrib/layout/browser/singlePaneLayoutController.js +91 -0
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/agentHostReadinessContext.d.ts +11 -0
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/agentHostReadinessContext.js +39 -0
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/newSessionTourContribution.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/newSessionTourContribution.js +109 -0
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/newSessionViewTourContribution.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/newSessionViewTourContribution.js +123 -0
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/newSessionViewTourTrigger.d.ts +24 -0
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/newSessionViewTourTrigger.js +67 -0
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/newSessionViewV2TourContribution.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/newSessionViewV2TourContribution.js +47 -0
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/newSessionViewV3Prompt.d.ts +79 -0
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/newSessionViewV3Prompt.js +1277 -0
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/newSessionViewV3TourContribution.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/newSessionViewV3TourContribution.js +75 -0
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/tours/newSessionTour.d.ts +34 -0
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/tours/newSessionTour.js +53 -0
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/tours/newSessionViewTour.d.ts +40 -0
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/tours/newSessionViewTour.js +69 -0
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/tours/newSessionViewTourShared.d.ts +4 -0
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/tours/newSessionViewTourShared.js +38 -0
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/tours/newSessionViewV2Tour.d.ts +6 -0
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/tours/newSessionViewV2Tour.js +63 -0
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/tours/newSessionViewV3Tour.d.ts +15 -0
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/tours/newSessionViewV3Tour.js +49 -0
- package/vscode/src/vs/sessions/contrib/policyBlocked/browser/media/sessionsPolicyBlocked.css +125 -0
- package/vscode/src/vs/sessions/contrib/policyBlocked/browser/policyBlocked.contribution.d.ts +20 -0
- package/vscode/src/vs/sessions/contrib/policyBlocked/browser/policyBlocked.contribution.js +98 -0
- package/vscode/src/vs/sessions/contrib/policyBlocked/browser/sessionsPolicyBlocked.d.ts +39 -0
- package/vscode/src/vs/sessions/contrib/policyBlocked/browser/sessionsPolicyBlocked.js +218 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/devContainerAgentHostService.d.ts +53 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/devContainerAgentHostService.js +496 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHostConnectionCustomization.d.ts +27 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHostConnectionCustomization.js +26 -0
- package/vscode/src/vs/sessions/contrib/search/browser/media/searchEditorEmptyState.css +15 -0
- package/vscode/src/vs/sessions/contrib/search/browser/search.contribution.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/search/browser/search.contribution.js +79 -0
- package/vscode/src/vs/sessions/contrib/search/browser/searchEditorEmptyState.contribution.d.ts +7 -0
- package/vscode/src/vs/sessions/contrib/search/browser/searchEditorEmptyState.contribution.js +57 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/blockedSessionsCIFixModel.d.ts +39 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/blockedSessionsCIFixModel.js +155 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/blockedSessionsIndicatorModel.d.ts +117 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/blockedSessionsIndicatorModel.js +320 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/blockedSessionsList.d.ts +65 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/blockedSessionsList.js +129 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/media/automationsCards.css +624 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/media/blockedSessionsList.css +111 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/media/newSessionActionViewItem.css +112 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/media/sessionsTitleBarWidget.css +159 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionActionFeedback.d.ts +26 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionActionFeedback.js +26 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionDetailsAction.d.ts +2 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionDetailsAction.js +77 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessions.contribution.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessions.contribution.js +162 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsActions.d.ts +111 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsActions.js +1550 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsMouseNavigation.d.ts +13 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsMouseNavigation.js +69 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsPicker.d.ts +10 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsPicker.js +33 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsTelemetry.contribution.d.ts +126 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsTelemetry.contribution.js +724 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsTitleBarWidget.d.ts +150 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsTitleBarWidget.js +526 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsTypedCharactersTracker.d.ts +64 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsTypedCharactersTracker.js +99 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsWindowNotifier.d.ts +37 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsWindowNotifier.js +160 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/views/automationTemplates.d.ts +19 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/views/automationTemplates.js +74 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/views/automationsAccessibility.d.ts +4 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/views/automationsAccessibility.js +228 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/views/automationsView.d.ts +53 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/views/automationsView.js +2143 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/views/sessionsViewActions.d.ts +12 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/views/sessionsViewActions.js +1270 -0
- package/vscode/src/vs/sessions/contrib/workspace/browser/workspace.contribution.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/workspace/browser/workspace.contribution.js +5 -0
- package/vscode/src/vs/sessions/contrib/workspace/browser/workspaceFolderManagement.d.ts +28 -0
- package/vscode/src/vs/sessions/contrib/workspace/browser/workspaceFolderManagement.js +95 -0
- package/vscode/src/vs/sessions/services/agentHostFilter/browser/agentHostFilterService.d.ts +79 -0
- package/vscode/src/vs/sessions/services/agentHostFilter/browser/agentHostFilterService.js +259 -0
- package/vscode/src/vs/sessions/services/customView/browser/customView.d.ts +42 -0
- package/vscode/src/vs/sessions/services/customView/browser/customView.js +15 -0
- package/vscode/src/vs/sessions/services/customView/browser/customViewService.d.ts +21 -0
- package/vscode/src/vs/sessions/services/customView/browser/customViewService.js +68 -0
- package/vscode/src/vs/sessions/services/sessions/browser/closedItemHistory.d.ts +72 -0
- package/vscode/src/vs/sessions/services/sessions/browser/closedItemHistory.js +115 -0
- package/vscode/src/vs/sessions/services/sessions/browser/sessionGroupsService.d.ts +77 -0
- package/vscode/src/vs/sessions/services/sessions/browser/sessionGroupsService.js +330 -0
- package/vscode/src/vs/sessions/services/sessions/browser/sessionNavigation.d.ts +67 -0
- package/vscode/src/vs/sessions/services/sessions/browser/sessionNavigation.js +157 -0
- package/vscode/src/vs/sessions/services/sessions/browser/sessionOpenTelemetryService.d.ts +32 -0
- package/vscode/src/vs/sessions/services/sessions/browser/sessionOpenTelemetryService.js +162 -0
- package/vscode/src/vs/sessions/services/sessions/browser/sessionSectionOrderService.d.ts +40 -0
- package/vscode/src/vs/sessions/services/sessions/browser/sessionSectionOrderService.js +170 -0
- package/vscode/src/vs/sessions/services/sessions/browser/sessionsListModelService.d.ts +63 -0
- package/vscode/src/vs/sessions/services/sessions/browser/sessionsListModelService.js +419 -0
- package/vscode/src/vs/sessions/services/sessions/browser/sessionsManagementService.d.ts +229 -0
- package/vscode/src/vs/sessions/services/sessions/browser/sessionsManagementService.js +1212 -0
- package/vscode/src/vs/sessions/services/sessions/browser/sessionsProvidersService.d.ts +22 -0
- package/vscode/src/vs/sessions/services/sessions/browser/sessionsProvidersService.js +42 -0
- package/vscode/src/vs/sessions/services/sessions/browser/sessionsRecencyHistory.d.ts +43 -0
- package/vscode/src/vs/sessions/services/sessions/browser/sessionsRecencyHistory.js +103 -0
- package/vscode/src/vs/sessions/services/sessions/browser/sessionsService.d.ts +243 -0
- package/vscode/src/vs/sessions/services/sessions/browser/sessionsService.js +1121 -0
- package/vscode/src/vs/sessions/services/sessions/browser/sessionsWindowUsageService.d.ts +8 -0
- package/vscode/src/vs/sessions/services/sessions/browser/sessionsWindowUsageService.js +24 -0
- package/vscode/src/vs/sessions/services/sessions/browser/visibleSessions.d.ts +321 -0
- package/vscode/src/vs/sessions/services/sessions/browser/visibleSessions.js +729 -0
- package/vscode/src/vs/sessions/services/sessions/browser/worktreeTrust.d.ts +23 -0
- package/vscode/src/vs/sessions/services/sessions/browser/worktreeTrust.js +23 -0
- package/vscode/src/vs/sessions/services/sessions/common/sessionContextKeys.d.ts +32 -0
- package/vscode/src/vs/sessions/services/sessions/common/sessionContextKeys.js +103 -0
- package/vscode/src/vs/sessions/services/workspaceFolderLabel/browser/workspaceFolderLabelService.d.ts +16 -0
- package/vscode/src/vs/sessions/services/workspaceFolderLabel/browser/workspaceFolderLabelService.js +41 -0
- package/vscode/src/vs/workbench/browser/layout.js +7 -7
- package/vscode/src/vs/workbench/browser/workbench.js +3 -3
|
@@ -0,0 +1,1121 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { disposableTimeout, raceTimeout } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
4
|
+
import { CancellationToken, CancellationTokenSource } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
5
|
+
import { onUnexpectedError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
|
|
6
|
+
import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
7
|
+
import { Disposable, MutableDisposable, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
8
|
+
import { ResourceMap } from '@codingame/monaco-vscode-api/vscode/vs/base/common/map';
|
|
9
|
+
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
10
|
+
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
11
|
+
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
12
|
+
import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/extensions';
|
|
13
|
+
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
14
|
+
import { StorageScope, StorageTarget } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
|
|
15
|
+
import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
|
|
16
|
+
import { IUriIdentityService } from '@codingame/monaco-vscode-api/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
|
|
17
|
+
import { IWorkspaceTrustRequestService, IWorkspaceTrustManagementService } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspaceTrust.service';
|
|
18
|
+
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
19
|
+
import { SessionStatus, ChatInteractivity, ChatOriginKind } from '@codingame/monaco-vscode-api/vscode/vs/sessions/services/sessions/common/session';
|
|
20
|
+
import { inheritableSessionTarget } from '@codingame/monaco-vscode-api/vscode/vs/sessions/services/sessions/common/sessionsManagement';
|
|
21
|
+
import { ISessionsManagementService } from '@codingame/monaco-vscode-api/vscode/vs/sessions/services/sessions/common/sessionsManagement.service';
|
|
22
|
+
import { ISessionsProvidersService } from '@codingame/monaco-vscode-api/vscode/vs/sessions/services/sessions/browser/sessionsProvidersService.service';
|
|
23
|
+
import { ensureSessionWorktreesTrusted } from './worktreeTrust.js';
|
|
24
|
+
import { ClosedItemHistory } from './closedItemHistory.js';
|
|
25
|
+
import { SessionsNavigation } from './sessionNavigation.js';
|
|
26
|
+
import { SessionsRecencyHistory } from './sessionsRecencyHistory.js';
|
|
27
|
+
import { VisibleSessions } from './visibleSessions.js';
|
|
28
|
+
import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
29
|
+
import { ISessionsPartService } from '@codingame/monaco-vscode-api/vscode/vs/sessions/services/sessions/browser/sessionsPartService.service';
|
|
30
|
+
import { ICustomViewService } from '@codingame/monaco-vscode-api/vscode/vs/sessions/services/customView/browser/customViewService.service';
|
|
31
|
+
import { IsNewChatSessionContext } from '@codingame/monaco-vscode-api/vscode/vs/sessions/common/contextkeys';
|
|
32
|
+
import { setActiveSessionContextKeys } from '../common/sessionContextKeys.js';
|
|
33
|
+
import { ISessionChangesStatsCache } from '@codingame/monaco-vscode-api/vscode/vs/sessions/services/sessions/common/sessionChangesStatsCache.service';
|
|
34
|
+
import { ISessionOpenTelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/sessions/services/sessions/browser/sessionOpenTelemetryService.service';
|
|
35
|
+
import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableValue';
|
|
36
|
+
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
37
|
+
|
|
38
|
+
const ACTIVE_SESSION_STATES_KEY = "agentSessions.activeSessionStates";
|
|
39
|
+
const RESTORE_RESOLVE_BUDGET_MS = 10_000;
|
|
40
|
+
const RESTORE_SESSION_WAIT_TIMEOUT = 30_000;
|
|
41
|
+
const MAX_RECENTLY_OPENED_SESSIONS = 10;
|
|
42
|
+
let SessionsService = class SessionsService extends Disposable {
|
|
43
|
+
constructor(
|
|
44
|
+
storageService,
|
|
45
|
+
logService,
|
|
46
|
+
uriIdentityService,
|
|
47
|
+
contextKeyService,
|
|
48
|
+
sessionsManagementService,
|
|
49
|
+
sessionsProvidersService,
|
|
50
|
+
sessionsPartService,
|
|
51
|
+
customViewService,
|
|
52
|
+
instantiationService,
|
|
53
|
+
workspaceTrustRequestService,
|
|
54
|
+
workspaceTrustManagementService,
|
|
55
|
+
changesStatsCache,
|
|
56
|
+
sessionOpenTelemetryService
|
|
57
|
+
) {
|
|
58
|
+
super();
|
|
59
|
+
this.storageService = storageService;
|
|
60
|
+
this.logService = logService;
|
|
61
|
+
this.uriIdentityService = uriIdentityService;
|
|
62
|
+
this.contextKeyService = contextKeyService;
|
|
63
|
+
this.sessionsManagementService = sessionsManagementService;
|
|
64
|
+
this.sessionsProvidersService = sessionsProvidersService;
|
|
65
|
+
this.sessionsPartService = sessionsPartService;
|
|
66
|
+
this.customViewService = customViewService;
|
|
67
|
+
this.instantiationService = instantiationService;
|
|
68
|
+
this.workspaceTrustRequestService = workspaceTrustRequestService;
|
|
69
|
+
this.workspaceTrustManagementService = workspaceTrustManagementService;
|
|
70
|
+
this.changesStatsCache = changesStatsCache;
|
|
71
|
+
this.sessionOpenTelemetryService = sessionOpenTelemetryService;
|
|
72
|
+
this._onDidToggleSessionStickiness = this._register(( new Emitter()));
|
|
73
|
+
this.onDidToggleSessionStickiness = this._onDidToggleSessionStickiness.event;
|
|
74
|
+
this._initialRestoreComplete = observableValue(this, false);
|
|
75
|
+
this.initialRestoreComplete = this._initialRestoreComplete;
|
|
76
|
+
this._navigationRequest = observableValue(this, undefined);
|
|
77
|
+
this.navigationRequest = this._navigationRequest;
|
|
78
|
+
this._openSessionCts = this._register(( new MutableDisposable()));
|
|
79
|
+
this._restoreCts = this._register(( new MutableDisposable()));
|
|
80
|
+
this._pendingRestoredChatResources = ( new ResourceMap());
|
|
81
|
+
this._sendFollow = this._register(( new MutableDisposable()));
|
|
82
|
+
this._sessionStates = this._loadSessionStates();
|
|
83
|
+
this._visibility = this._register(this.instantiationService.createInstance(
|
|
84
|
+
VisibleSessions,
|
|
85
|
+
session => this._restoreInitialChat(session),
|
|
86
|
+
session => this._restoreClosedChats(session),
|
|
87
|
+
session => this._restoreShownRelatedChats(session),
|
|
88
|
+
(replaced, index, sticky, replacedBySessionId) => this._closedItems.recordReplacedSlot(replaced, index, sticky, replacedBySessionId)
|
|
89
|
+
));
|
|
90
|
+
this.visibleSessions = this._visibility.visibleSessions;
|
|
91
|
+
this.activeSession = this._visibility.activeSession;
|
|
92
|
+
this._closedItems = this._register(this.instantiationService.createInstance(
|
|
93
|
+
ClosedItemHistory,
|
|
94
|
+
this._visibility,
|
|
95
|
+
(session, chatResource) => this.openChat(session, chatResource)
|
|
96
|
+
));
|
|
97
|
+
this._isNewChatSessionContext = IsNewChatSessionContext.bindTo(this.contextKeyService);
|
|
98
|
+
this._register(this.storageService.onWillSaveState(() => this._saveSessionStates()));
|
|
99
|
+
this._recencyHistory = this._register(( new SessionsRecencyHistory(this.storageService, this.logService)));
|
|
100
|
+
this._navigation = this._register(( new SessionsNavigation(
|
|
101
|
+
this,
|
|
102
|
+
this.activeSession,
|
|
103
|
+
this.sessionsManagementService,
|
|
104
|
+
this._recencyHistory,
|
|
105
|
+
this.contextKeyService,
|
|
106
|
+
this.logService
|
|
107
|
+
)));
|
|
108
|
+
this._register(
|
|
109
|
+
this.sessionsManagementService.onDidChangeSessions(e => this._navigation.onDidRemoveSessions(e))
|
|
110
|
+
);
|
|
111
|
+
this._register(
|
|
112
|
+
this.sessionsManagementService.onDidDeleteSession(session => this._recencyHistory.remove(entry => ( entry.sessionResource.toString()) === ( session.resource.toString())))
|
|
113
|
+
);
|
|
114
|
+
this._register(autorun(reader => {
|
|
115
|
+
const activeSession = this.activeSession.read(reader);
|
|
116
|
+
const newSession = this.sessionsManagementService.newSession.read(reader);
|
|
117
|
+
this._isNewChatSessionContext.set(
|
|
118
|
+
activeSession === undefined || activeSession.sessionId === newSession?.sessionId
|
|
119
|
+
);
|
|
120
|
+
setActiveSessionContextKeys(activeSession, this.contextKeyService, reader, this.changesStatsCache);
|
|
121
|
+
}));
|
|
122
|
+
this._register(autorun(reader => {
|
|
123
|
+
const activeSession = this.activeSession.read(reader);
|
|
124
|
+
if (activeSession) {
|
|
125
|
+
reader.store.add(this._activeSessionViewListeners(activeSession));
|
|
126
|
+
}
|
|
127
|
+
}));
|
|
128
|
+
this._register(autorun(reader => {
|
|
129
|
+
const activeSession = this.activeSession.read(reader);
|
|
130
|
+
if (activeSession && !activeSession.isRead.read(reader)) {
|
|
131
|
+
this.sessionsManagementService.markRead(activeSession);
|
|
132
|
+
}
|
|
133
|
+
}));
|
|
134
|
+
this._register(
|
|
135
|
+
this.sessionsManagementService.onDidChangeSessions(e => this._onDidChangeSessions(e))
|
|
136
|
+
);
|
|
137
|
+
this._register(this.sessionsManagementService.onDidReplaceSession((
|
|
138
|
+
{
|
|
139
|
+
from,
|
|
140
|
+
to
|
|
141
|
+
}
|
|
142
|
+
) => this._onDidReplaceSession(from, to)));
|
|
143
|
+
this._register(this.sessionsManagementService.onDidReplaceNewDraftSession((
|
|
144
|
+
{
|
|
145
|
+
from,
|
|
146
|
+
to
|
|
147
|
+
}
|
|
148
|
+
) => this._onDidReplaceSession(from, to)));
|
|
149
|
+
this._register(
|
|
150
|
+
this.sessionsManagementService.onWillSendRequest(session => this._startSendFollow(session))
|
|
151
|
+
);
|
|
152
|
+
this._register(
|
|
153
|
+
this.sessionsManagementService.onDidSendRequest(() => this._sendFollow.clear())
|
|
154
|
+
);
|
|
155
|
+
this._register(autorun(reader => {
|
|
156
|
+
const visible = this.visibleSessions.read(reader);
|
|
157
|
+
const active = this._visibility.activeSession.read(reader);
|
|
158
|
+
const preserveFocus = this._visibility.activePreserveFocus.read(reader);
|
|
159
|
+
this.sessionsPartService.updateVisibleSessions(visible, active);
|
|
160
|
+
const activeId = active?.sessionId;
|
|
161
|
+
if (activeId !== this._focusedActiveSessionId) {
|
|
162
|
+
this._focusedActiveSessionId = activeId;
|
|
163
|
+
if (!preserveFocus) {
|
|
164
|
+
this.sessionsPartService.focusSession(active);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}));
|
|
168
|
+
this._register(this.sessionsPartService.onDidFocusSession(sessionId => {
|
|
169
|
+
const session = this.visibleSessions.get().find(s => s?.sessionId === sessionId);
|
|
170
|
+
if (session) {
|
|
171
|
+
this.setActive(session);
|
|
172
|
+
}
|
|
173
|
+
}));
|
|
174
|
+
}
|
|
175
|
+
_onDidReplaceSession(from, to) {
|
|
176
|
+
this._visibility.updateSession(from, to);
|
|
177
|
+
}
|
|
178
|
+
_activeSessionViewListeners(activeSession) {
|
|
179
|
+
const disposables = ( new DisposableStore());
|
|
180
|
+
const initialChatResource = activeSession.activeChat.get()?.resource;
|
|
181
|
+
let pendingRestoredChatResource;
|
|
182
|
+
this._pendingRestoredChatResources.delete(activeSession.resource);
|
|
183
|
+
const storedActiveChatResource = this._sessionStates.get(activeSession.resource)?.activeChatResource;
|
|
184
|
+
if (storedActiveChatResource) {
|
|
185
|
+
try {
|
|
186
|
+
const resource = ( URI.parse(storedActiveChatResource));
|
|
187
|
+
if (!initialChatResource || !this.uriIdentityService.extUri.isEqual(resource, initialChatResource)) {
|
|
188
|
+
pendingRestoredChatResource = resource;
|
|
189
|
+
this._pendingRestoredChatResources.set(activeSession.resource, resource);
|
|
190
|
+
}
|
|
191
|
+
} catch (error) {
|
|
192
|
+
this.logService.warn(
|
|
193
|
+
"[SessionsView] Failed to restore active chat from stored session state",
|
|
194
|
+
error
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
let wasArchived = activeSession.isArchived.get();
|
|
199
|
+
disposables.add(autorun(reader => {
|
|
200
|
+
const isArchived = activeSession.isArchived.read(reader);
|
|
201
|
+
if (isArchived && !wasArchived) {
|
|
202
|
+
if (activeSession.isQuickChat?.read(undefined)) {
|
|
203
|
+
this._openQuickChat(undefined, "automatic");
|
|
204
|
+
} else {
|
|
205
|
+
const folderUri = activeSession.workspace.read(undefined)?.folders[0]?.root;
|
|
206
|
+
void this._openNewSession(folderUri ? {
|
|
207
|
+
folderUri,
|
|
208
|
+
...inheritableSessionTarget(this.sessionsManagementService, activeSession, folderUri)
|
|
209
|
+
} : undefined, CancellationToken.None, "automatic").catch(onUnexpectedError);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
wasArchived = isArchived;
|
|
213
|
+
}));
|
|
214
|
+
if (activeSession.status.get() !== SessionStatus.Untitled) {
|
|
215
|
+
disposables.add(autorun(reader => {
|
|
216
|
+
const chats = activeSession.chats.read(reader);
|
|
217
|
+
const activeChat = activeSession.activeChat.read(reader);
|
|
218
|
+
if (activeChat && !( chats.some(
|
|
219
|
+
c => this.uriIdentityService.extUri.isEqual(c.resource, activeChat.resource)
|
|
220
|
+
))) {
|
|
221
|
+
const visible = chats.filter(c => c.interactivity.read(reader) !== ChatInteractivity.Hidden);
|
|
222
|
+
const fallback = visible[visible.length - 1] ?? activeSession.mainChat.read(reader);
|
|
223
|
+
if (fallback) {
|
|
224
|
+
void this._openChatSession(activeSession, fallback.resource, undefined, "automatic").catch(onUnexpectedError);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}));
|
|
228
|
+
}
|
|
229
|
+
if (pendingRestoredChatResource) {
|
|
230
|
+
disposables.add(autorun(reader => {
|
|
231
|
+
const resource = pendingRestoredChatResource;
|
|
232
|
+
if (!resource) {
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
const chat = activeSession.chats.read(reader).find(
|
|
236
|
+
candidate => this.uriIdentityService.extUri.isEqual(candidate.resource, resource)
|
|
237
|
+
);
|
|
238
|
+
if (chat) {
|
|
239
|
+
pendingRestoredChatResource = undefined;
|
|
240
|
+
this._pendingRestoredChatResources.delete(activeSession.resource);
|
|
241
|
+
this._visibility.openChat(activeSession, chat);
|
|
242
|
+
this._visibility.setActiveChat(activeSession, chat);
|
|
243
|
+
}
|
|
244
|
+
}));
|
|
245
|
+
}
|
|
246
|
+
disposables.add(autorun(reader => {
|
|
247
|
+
const chat = activeSession.activeChat.read(reader);
|
|
248
|
+
if (chat && chat.status.read(undefined) !== SessionStatus.Untitled) {
|
|
249
|
+
if (pendingRestoredChatResource && initialChatResource && this.uriIdentityService.extUri.isEqual(chat.resource, initialChatResource)) {
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
pendingRestoredChatResource = undefined;
|
|
253
|
+
this._pendingRestoredChatResources.delete(activeSession.resource);
|
|
254
|
+
const existing = this._sessionStates.get(activeSession.resource);
|
|
255
|
+
this._sessionStates.set(activeSession.resource, {
|
|
256
|
+
...existing,
|
|
257
|
+
sessionResource: ( activeSession.resource.toString()),
|
|
258
|
+
activeChatResource: ( chat.resource.toString()),
|
|
259
|
+
activeChatOrigin: chat.origin?.kind
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
}));
|
|
263
|
+
return disposables;
|
|
264
|
+
}
|
|
265
|
+
_onDidChangeSessions(e) {
|
|
266
|
+
const currentActive = this._visibility.activeSession.get();
|
|
267
|
+
if (e.removed.length) {
|
|
268
|
+
for (const session of e.removed) {
|
|
269
|
+
this._sessionStates.delete(session.resource);
|
|
270
|
+
}
|
|
271
|
+
this._visibility.removeMany(e.removed.map(r => r.sessionId));
|
|
272
|
+
}
|
|
273
|
+
if (!currentActive) {
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
if (e.removed.length && ( e.removed.some(r => r.sessionId === currentActive.sessionId))) {
|
|
277
|
+
const fallback = this._visibility.activeSession.get();
|
|
278
|
+
if (fallback && this.sessionsManagementService.getSession(fallback.resource)) {
|
|
279
|
+
void this._openSession(fallback.resource, {
|
|
280
|
+
source: "fallback"
|
|
281
|
+
}, "automatic").catch(onUnexpectedError);
|
|
282
|
+
} else {
|
|
283
|
+
void this._openNewSession(undefined, CancellationToken.None, "automatic").catch(onUnexpectedError);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
_startSendFollow(session) {
|
|
288
|
+
const store = ( new DisposableStore());
|
|
289
|
+
let followId = session.sessionId;
|
|
290
|
+
store.add(this.sessionsManagementService.onDidReplaceSession((
|
|
291
|
+
{
|
|
292
|
+
from,
|
|
293
|
+
to
|
|
294
|
+
}
|
|
295
|
+
) => {
|
|
296
|
+
if (from.sessionId === followId) {
|
|
297
|
+
followId = to.sessionId;
|
|
298
|
+
}
|
|
299
|
+
}));
|
|
300
|
+
store.add(autorun(reader => {
|
|
301
|
+
const active = this._visibility.activeSession.read(reader);
|
|
302
|
+
if (active && active.sessionId === followId) {
|
|
303
|
+
const chats = active.visibleChatTabs.read(reader);
|
|
304
|
+
const lastChat = chats[chats.length - 1];
|
|
305
|
+
if (lastChat) {
|
|
306
|
+
this._visibility.setActiveChat(active, lastChat);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}));
|
|
310
|
+
this._sendFollow.value = store;
|
|
311
|
+
}
|
|
312
|
+
getRecentlyOpenedSessions() {
|
|
313
|
+
const seen = ( new Set());
|
|
314
|
+
const recent = [];
|
|
315
|
+
for (const entry of this._recencyHistory.entries) {
|
|
316
|
+
if (recent.length >= MAX_RECENTLY_OPENED_SESSIONS) {
|
|
317
|
+
break;
|
|
318
|
+
}
|
|
319
|
+
const key = ( entry.sessionResource.toString());
|
|
320
|
+
if (( seen.has(key))) {
|
|
321
|
+
continue;
|
|
322
|
+
}
|
|
323
|
+
seen.add(key);
|
|
324
|
+
const session = this.sessionsManagementService.getSession(entry.sessionResource);
|
|
325
|
+
if (session) {
|
|
326
|
+
recent.push(session);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
const other = this.sessionsManagementService.getSessions().filter(s => !( seen.has(( s.resource.toString())))).sort((a, b) => b.updatedAt.get().getTime() - a.updatedAt.get().getTime());
|
|
330
|
+
return {
|
|
331
|
+
recent,
|
|
332
|
+
other
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
_startOpenSession() {
|
|
336
|
+
this._openSessionCts.value?.cancel();
|
|
337
|
+
const cts = ( new CancellationTokenSource());
|
|
338
|
+
this._openSessionCts.value = cts;
|
|
339
|
+
return cts.token;
|
|
340
|
+
}
|
|
341
|
+
_beginNavigation(intent, token = CancellationToken.None, preserveNavigation = false) {
|
|
342
|
+
if (intent === "explicit") {
|
|
343
|
+
if (!preserveNavigation) {
|
|
344
|
+
this._recordNavigation(token);
|
|
345
|
+
}
|
|
346
|
+
this.customViewService.hideCustomView();
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
_recordNavigation(token = CancellationToken.None) {
|
|
350
|
+
this._navigationRequest.set({
|
|
351
|
+
token
|
|
352
|
+
}, undefined);
|
|
353
|
+
}
|
|
354
|
+
_cancelRestore() {
|
|
355
|
+
this._restoreCts.value?.cancel();
|
|
356
|
+
this._restoreCts.clear();
|
|
357
|
+
}
|
|
358
|
+
_activate(session, preserveFocus) {
|
|
359
|
+
return this._visibility.setActive(session, preserveFocus);
|
|
360
|
+
}
|
|
361
|
+
openChat(session, chatUri, options) {
|
|
362
|
+
return this._openChatSession(session, chatUri, options, "explicit");
|
|
363
|
+
}
|
|
364
|
+
async _openChatSession(session, chatUri, options, intent) {
|
|
365
|
+
const t0 = Date.now();
|
|
366
|
+
this._cancelRestore();
|
|
367
|
+
this._beginNavigation(intent);
|
|
368
|
+
const token = this._startOpenSession();
|
|
369
|
+
const resolved = await this._resolveSessionForOpen(session, chatUri);
|
|
370
|
+
if (token.isCancellationRequested) {
|
|
371
|
+
return;
|
|
372
|
+
}
|
|
373
|
+
session = resolved.session;
|
|
374
|
+
chatUri = resolved.chatUri ?? chatUri;
|
|
375
|
+
if (options?.source) {
|
|
376
|
+
await this.sessionOpenTelemetryService.withOpenRequest(
|
|
377
|
+
options.source,
|
|
378
|
+
token,
|
|
379
|
+
telemetryAttempt => this._openChat(session, chatUri, options.preserveFocus, token, t0, telemetryAttempt)
|
|
380
|
+
);
|
|
381
|
+
return;
|
|
382
|
+
}
|
|
383
|
+
await this._openChat(session, chatUri, options?.preserveFocus, token, t0);
|
|
384
|
+
}
|
|
385
|
+
async _openChat(session, chatUri, preserveFocus, token, startTime, telemetryAttempt) {
|
|
386
|
+
if (telemetryAttempt) {
|
|
387
|
+
this.sessionOpenTelemetryService.sessionResolved(
|
|
388
|
+
telemetryAttempt,
|
|
389
|
+
session.resource,
|
|
390
|
+
session.providerId,
|
|
391
|
+
this.activeSession.get()?.sessionId === session.sessionId,
|
|
392
|
+
session.loading.get()
|
|
393
|
+
);
|
|
394
|
+
this.sessionOpenTelemetryService.sessionActivated(telemetryAttempt, chatUri);
|
|
395
|
+
}
|
|
396
|
+
this.logService.trace(`[SessionsView] openChat start uri=${( chatUri.toString())} provider=${session.providerId}`);
|
|
397
|
+
this._activate(session, preserveFocus);
|
|
398
|
+
if (!(await this._waitForSessionToLoad(session, token))) {
|
|
399
|
+
this.logService.trace(
|
|
400
|
+
`[SessionsView] openChat cancelled while waiting for session to load uri=${( chatUri.toString())}`
|
|
401
|
+
);
|
|
402
|
+
return;
|
|
403
|
+
}
|
|
404
|
+
let chat;
|
|
405
|
+
const activeSession = this._visibility.activeSession.get();
|
|
406
|
+
if (activeSession) {
|
|
407
|
+
chat = activeSession.chats.get().find(c => this.uriIdentityService.extUri.isEqual(c.resource, chatUri));
|
|
408
|
+
if (chat) {
|
|
409
|
+
this._visibility.openChat(session, chat);
|
|
410
|
+
this._visibility.setActiveChat(session, chat);
|
|
411
|
+
this._setChatVisibilityState(session, chat, true);
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
if (telemetryAttempt) {
|
|
415
|
+
if (chat) {
|
|
416
|
+
this.sessionOpenTelemetryService.sessionActivated(telemetryAttempt, chat.resource);
|
|
417
|
+
}
|
|
418
|
+
this.sessionOpenTelemetryService.sessionLoaded(telemetryAttempt);
|
|
419
|
+
}
|
|
420
|
+
if (chat && chat.status.get() === SessionStatus.Untitled) {
|
|
421
|
+
this.logService.trace(
|
|
422
|
+
`[SessionsView] openChat done total=${Date.now() - startTime}ms uri=${( chatUri.toString())} path=untitled`
|
|
423
|
+
);
|
|
424
|
+
return;
|
|
425
|
+
}
|
|
426
|
+
this.logService.trace(
|
|
427
|
+
`[SessionsView] openChat done total=${Date.now() - startTime}ms uri=${( chatUri.toString())}`
|
|
428
|
+
);
|
|
429
|
+
}
|
|
430
|
+
async closeChat(session, chat, options) {
|
|
431
|
+
this._visibility.closeChat(session, chat);
|
|
432
|
+
this._setChatVisibilityState(session, chat, false);
|
|
433
|
+
if (!options?.skipHistory) {
|
|
434
|
+
this._closedItems.recordClosedChat(session, chat.resource);
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
reopenLastClosedItem() {
|
|
438
|
+
return this._closedItems.reopenLast();
|
|
439
|
+
}
|
|
440
|
+
_setChatVisibilityState(session, chat, visible) {
|
|
441
|
+
if (this.uriIdentityService.extUri.isEqual(chat.resource, session.mainChat.get().resource)) {
|
|
442
|
+
return;
|
|
443
|
+
}
|
|
444
|
+
const existing = this._sessionStates.get(session.resource);
|
|
445
|
+
const chatResource = ( chat.resource.toString());
|
|
446
|
+
const closedChatResources = ( new Set(existing?.closedChatResources));
|
|
447
|
+
const openedChatResources = ( new Set(existing?.openedChatResources));
|
|
448
|
+
if (visible) {
|
|
449
|
+
closedChatResources.delete(chatResource);
|
|
450
|
+
openedChatResources.add(chatResource);
|
|
451
|
+
} else {
|
|
452
|
+
closedChatResources.delete(chatResource);
|
|
453
|
+
openedChatResources.delete(chatResource);
|
|
454
|
+
if (chat.origin?.kind !== ChatOriginKind.Tool) {
|
|
455
|
+
closedChatResources.add(chatResource);
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
this._sessionStates.set(session.resource, {
|
|
459
|
+
...existing,
|
|
460
|
+
sessionResource: ( session.resource.toString()),
|
|
461
|
+
closedChatResources: closedChatResources.size ? [...closedChatResources] : undefined,
|
|
462
|
+
openedChatResources: openedChatResources.size ? [...openedChatResources] : undefined
|
|
463
|
+
});
|
|
464
|
+
}
|
|
465
|
+
_applyActiveChatSelection(session, restoreOnlySideOrToolChat) {
|
|
466
|
+
if (!restoreOnlySideOrToolChat) {
|
|
467
|
+
return;
|
|
468
|
+
}
|
|
469
|
+
const state = this._sessionStates.get(session.resource);
|
|
470
|
+
if (state?.activeChatOrigin === ChatOriginKind.SideChat || state?.activeChatOrigin === ChatOriginKind.Tool) {
|
|
471
|
+
return;
|
|
472
|
+
}
|
|
473
|
+
const mainChat = session.mainChat.get();
|
|
474
|
+
this._visibility.setActiveChat(session, mainChat);
|
|
475
|
+
this._sessionStates.set(session.resource, {
|
|
476
|
+
...state,
|
|
477
|
+
sessionResource: ( session.resource.toString()),
|
|
478
|
+
activeChatResource: ( mainChat.resource.toString()),
|
|
479
|
+
activeChatOrigin: mainChat.origin?.kind
|
|
480
|
+
});
|
|
481
|
+
}
|
|
482
|
+
openSession(sessionResource, options) {
|
|
483
|
+
return this._openSession(sessionResource, options, "explicit");
|
|
484
|
+
}
|
|
485
|
+
async _openSession(sessionResource, options, intent) {
|
|
486
|
+
this.logService.trace(`[SessionsView] openSession requested uri=${( sessionResource.toString())}`);
|
|
487
|
+
this._cancelRestore();
|
|
488
|
+
this._beginNavigation(intent);
|
|
489
|
+
const token = this._startOpenSession();
|
|
490
|
+
await this.sessionOpenTelemetryService.withOpenRequest(options?.source ?? "unknown", token, async telemetryAttempt => {
|
|
491
|
+
const resolved = await this.sessionsManagementService.resolveSessionResource(sessionResource, "open");
|
|
492
|
+
if (token.isCancellationRequested) {
|
|
493
|
+
return;
|
|
494
|
+
}
|
|
495
|
+
const sessionData = this._getSession(resolved);
|
|
496
|
+
await this.sessionsProvidersService.getProvider(sessionData.providerId)?.prepareSessionForOpen?.(sessionData, "open");
|
|
497
|
+
if (token.isCancellationRequested) {
|
|
498
|
+
return;
|
|
499
|
+
}
|
|
500
|
+
this._applyActiveChatSelection(sessionData, options?.restoreOnlySideOrToolChat);
|
|
501
|
+
this.sessionOpenTelemetryService.sessionResolved(
|
|
502
|
+
telemetryAttempt,
|
|
503
|
+
sessionData.resource,
|
|
504
|
+
sessionData.providerId,
|
|
505
|
+
this.activeSession.get()?.sessionId === sessionData.sessionId,
|
|
506
|
+
sessionData.loading.get()
|
|
507
|
+
);
|
|
508
|
+
this._showSession(sessionData, options);
|
|
509
|
+
await this._waitForOpenSessionToLoad(sessionData, token, telemetryAttempt);
|
|
510
|
+
});
|
|
511
|
+
}
|
|
512
|
+
showSession(sessionResource, options) {
|
|
513
|
+
this._cancelRestore();
|
|
514
|
+
this._beginNavigation("explicit");
|
|
515
|
+
this._startOpenSession();
|
|
516
|
+
this._showSession(this._getSession(sessionResource), options);
|
|
517
|
+
}
|
|
518
|
+
async canOpenSession(session) {
|
|
519
|
+
if (this.activeSession.get()?.sessionId === session.sessionId) {
|
|
520
|
+
return true;
|
|
521
|
+
}
|
|
522
|
+
const workspace = session.workspace.get();
|
|
523
|
+
if (!workspace?.requiresWorkspaceTrust) {
|
|
524
|
+
return true;
|
|
525
|
+
}
|
|
526
|
+
await ensureSessionWorktreesTrusted(workspace, this.workspaceTrustManagementService);
|
|
527
|
+
const folders = workspace.folders.map(folder => folder.workingDirectory);
|
|
528
|
+
const trustInfos = await Promise.all(
|
|
529
|
+
folders.map(folder => this.workspaceTrustManagementService.getUriTrustInfo(folder))
|
|
530
|
+
);
|
|
531
|
+
const untrustedFolders = folders.filter((_, index) => !trustInfos[index].trusted);
|
|
532
|
+
for (const folder of untrustedFolders) {
|
|
533
|
+
const trusted = await this.workspaceTrustRequestService.requestResourcesTrust({
|
|
534
|
+
uri: folder,
|
|
535
|
+
message: ( localize(
|
|
536
|
+
4905,
|
|
537
|
+
"An agent session will be able to read files, run commands, and make changes in this folder."
|
|
538
|
+
))
|
|
539
|
+
});
|
|
540
|
+
if (!trusted) {
|
|
541
|
+
return false;
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
return true;
|
|
545
|
+
}
|
|
546
|
+
async openSessionToSide(session, options) {
|
|
547
|
+
this._beginNavigation("explicit");
|
|
548
|
+
const token = this._startOpenSession();
|
|
549
|
+
const resolved = await this._resolveSessionForOpen(session, options?.chatResource);
|
|
550
|
+
if (token.isCancellationRequested) {
|
|
551
|
+
return;
|
|
552
|
+
}
|
|
553
|
+
session = resolved.session;
|
|
554
|
+
if (options?.chatResource && resolved.chatUri) {
|
|
555
|
+
options = {
|
|
556
|
+
...options,
|
|
557
|
+
chatResource: resolved.chatUri
|
|
558
|
+
};
|
|
559
|
+
}
|
|
560
|
+
const visible = this.visibleSessions.get();
|
|
561
|
+
const lastVisible = visible[visible.length - 1];
|
|
562
|
+
if (lastVisible && lastVisible.sessionId !== session.sessionId) {
|
|
563
|
+
this.insertAt(session, lastVisible.sessionId, "right");
|
|
564
|
+
}
|
|
565
|
+
if (options?.chatResource) {
|
|
566
|
+
await this.openChat(session, options.chatResource, {
|
|
567
|
+
preserveFocus: options.preserveFocus,
|
|
568
|
+
source: options.source
|
|
569
|
+
});
|
|
570
|
+
} else {
|
|
571
|
+
await this.openSession(session.resource, {
|
|
572
|
+
preserveFocus: options?.preserveFocus,
|
|
573
|
+
source: options?.source,
|
|
574
|
+
restoreOnlySideOrToolChat: options?.restoreOnlySideOrToolChat
|
|
575
|
+
});
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
async openChatToSide(session, chatResource, options) {
|
|
579
|
+
this._beginNavigation("explicit");
|
|
580
|
+
const token = this._startOpenSession();
|
|
581
|
+
const resolved = await this._resolveSessionForOpen(session, chatResource);
|
|
582
|
+
if (token.isCancellationRequested) {
|
|
583
|
+
return;
|
|
584
|
+
}
|
|
585
|
+
session = resolved.session;
|
|
586
|
+
chatResource = resolved.chatUri ?? chatResource;
|
|
587
|
+
this._showSession(this._getSession(session.resource), options);
|
|
588
|
+
const sessionView = this.sessionsPartService.getSessionView(session.sessionId);
|
|
589
|
+
if (!sessionView) {
|
|
590
|
+
throw ( new Error(
|
|
591
|
+
`Unable to open chat to the side because session view '${session.sessionId}' is not mounted`
|
|
592
|
+
));
|
|
593
|
+
}
|
|
594
|
+
await sessionView.openChatToSide(chatResource);
|
|
595
|
+
}
|
|
596
|
+
async _resolveSessionForOpen(session, chatUri) {
|
|
597
|
+
const resolved = await this.sessionsManagementService.resolveSessionResource(session.resource, "open");
|
|
598
|
+
if (this.uriIdentityService.extUri.isEqual(resolved, session.resource)) {
|
|
599
|
+
return {
|
|
600
|
+
session,
|
|
601
|
+
chatUri
|
|
602
|
+
};
|
|
603
|
+
}
|
|
604
|
+
const superseding = this.sessionsManagementService.getSession(resolved);
|
|
605
|
+
if (!superseding) {
|
|
606
|
+
return {
|
|
607
|
+
session,
|
|
608
|
+
chatUri
|
|
609
|
+
};
|
|
610
|
+
}
|
|
611
|
+
return {
|
|
612
|
+
session: superseding,
|
|
613
|
+
chatUri: chatUri ? superseding.mainChat.get().resource : undefined
|
|
614
|
+
};
|
|
615
|
+
}
|
|
616
|
+
_getSession(sessionResource) {
|
|
617
|
+
const sessionData = this.sessionsManagementService.getSession(sessionResource);
|
|
618
|
+
if (!sessionData) {
|
|
619
|
+
this.logService.warn(`[SessionsView] openSession: session not found uri=${( sessionResource.toString())}`);
|
|
620
|
+
throw ( new Error(`Session with resource ${( sessionResource.toString())} not found`));
|
|
621
|
+
}
|
|
622
|
+
return sessionData;
|
|
623
|
+
}
|
|
624
|
+
_showSession(sessionData, options) {
|
|
625
|
+
const t0 = Date.now();
|
|
626
|
+
this.logService.trace(`[SessionsView] openSession start uri=${( sessionData.resource.toString())} provider=${sessionData.providerId}`);
|
|
627
|
+
this._activate(sessionData, options?.preserveFocus);
|
|
628
|
+
this.logService.trace(
|
|
629
|
+
`[SessionsView] showSession done total=${Date.now() - t0}ms uri=${( sessionData.resource.toString())}`
|
|
630
|
+
);
|
|
631
|
+
}
|
|
632
|
+
async _waitForOpenSessionToLoad(sessionData, token, telemetryAttempt) {
|
|
633
|
+
const t0 = Date.now();
|
|
634
|
+
if (!(await this._waitForSessionToLoad(sessionData, token))) {
|
|
635
|
+
this.logService.trace(
|
|
636
|
+
`[SessionsView] openSession cancelled while waiting for session to load uri=${( sessionData.resource.toString())}`
|
|
637
|
+
);
|
|
638
|
+
return;
|
|
639
|
+
}
|
|
640
|
+
const activeSession = this.activeSession.get();
|
|
641
|
+
const activeChat = activeSession?.sessionId === sessionData.sessionId ? activeSession.activeChat.get() : undefined;
|
|
642
|
+
if (activeChat) {
|
|
643
|
+
this.sessionOpenTelemetryService.sessionActivated(telemetryAttempt, activeChat.resource);
|
|
644
|
+
}
|
|
645
|
+
this.sessionOpenTelemetryService.sessionLoaded(telemetryAttempt);
|
|
646
|
+
this.logService.trace(
|
|
647
|
+
`[SessionsView] openSession loaded total=${Date.now() - t0}ms uri=${( sessionData.resource.toString())}`
|
|
648
|
+
);
|
|
649
|
+
}
|
|
650
|
+
unsetNewSession() {
|
|
651
|
+
this.sessionsManagementService.discardNewSession();
|
|
652
|
+
this._activate(undefined);
|
|
653
|
+
}
|
|
654
|
+
openNewSession(options, token = CancellationToken.None) {
|
|
655
|
+
return this._openNewSession(options, token, "explicit");
|
|
656
|
+
}
|
|
657
|
+
async _openNewSession(options, token, intent) {
|
|
658
|
+
if (options?.cancelRestore) {
|
|
659
|
+
this._cancelRestore();
|
|
660
|
+
}
|
|
661
|
+
const folderUri = options?.folderUri;
|
|
662
|
+
if (folderUri) {
|
|
663
|
+
const resolved = this.sessionsManagementService.resolveWorkspace(folderUri, options?.providerId);
|
|
664
|
+
if (resolved?.workspace.requiresWorkspaceTrust) {
|
|
665
|
+
const trusted = await this.workspaceTrustRequestService.requestResourcesTrust({
|
|
666
|
+
uri: folderUri,
|
|
667
|
+
message: ( localize(
|
|
668
|
+
4905,
|
|
669
|
+
"An agent session will be able to read files, run commands, and make changes in this folder."
|
|
670
|
+
))
|
|
671
|
+
});
|
|
672
|
+
if (token.isCancellationRequested) {
|
|
673
|
+
return {
|
|
674
|
+
session: undefined,
|
|
675
|
+
trustDeclined: false
|
|
676
|
+
};
|
|
677
|
+
}
|
|
678
|
+
if (!trusted) {
|
|
679
|
+
return {
|
|
680
|
+
session: undefined,
|
|
681
|
+
trustDeclined: true
|
|
682
|
+
};
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
if (token.isCancellationRequested) {
|
|
686
|
+
return {
|
|
687
|
+
session: undefined,
|
|
688
|
+
trustDeclined: false
|
|
689
|
+
};
|
|
690
|
+
}
|
|
691
|
+
this._beginNavigation(intent, token, options?.preserveNavigation);
|
|
692
|
+
this._startOpenSession();
|
|
693
|
+
try {
|
|
694
|
+
const session = this.sessionsManagementService.createNewSession(folderUri, options);
|
|
695
|
+
this._activateOrInsert(session, options?.toSide);
|
|
696
|
+
return {
|
|
697
|
+
session,
|
|
698
|
+
trustDeclined: false
|
|
699
|
+
};
|
|
700
|
+
} catch (e) {
|
|
701
|
+
this.logService.trace(
|
|
702
|
+
`[SessionsView] openNewSession: createNewSession failed for folder ${( folderUri.toString())}, falling back to composer view`
|
|
703
|
+
);
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
if (!folderUri) {
|
|
707
|
+
this._beginNavigation(intent, token, options?.preserveNavigation);
|
|
708
|
+
}
|
|
709
|
+
if (this._visibility.activeSession.get() === undefined && !options?.toSide) {
|
|
710
|
+
return {
|
|
711
|
+
session: undefined,
|
|
712
|
+
trustDeclined: false
|
|
713
|
+
};
|
|
714
|
+
}
|
|
715
|
+
if (!folderUri) {
|
|
716
|
+
this._startOpenSession();
|
|
717
|
+
}
|
|
718
|
+
const newSession = this.sessionsManagementService.newSession.get();
|
|
719
|
+
const activeSession = this._visibility.activeSession.get();
|
|
720
|
+
const targetSession = options?.toSide && newSession?.sessionId === activeSession?.sessionId ? undefined : newSession;
|
|
721
|
+
this._activateOrInsert(targetSession, options?.toSide);
|
|
722
|
+
return {
|
|
723
|
+
session: targetSession,
|
|
724
|
+
trustDeclined: false
|
|
725
|
+
};
|
|
726
|
+
}
|
|
727
|
+
_activateOrInsert(session, toSide) {
|
|
728
|
+
const activeSessionId = this._visibility.activeSession.get()?.sessionId;
|
|
729
|
+
const sessionId = session?.sessionId;
|
|
730
|
+
if (toSide && activeSessionId !== sessionId) {
|
|
731
|
+
const visible = this.visibleSessions.get();
|
|
732
|
+
const anchorId = activeSessionId ?? visible[visible.length - 1]?.sessionId;
|
|
733
|
+
if (anchorId && anchorId !== sessionId) {
|
|
734
|
+
this.insertAt(session, anchorId, "right", true);
|
|
735
|
+
return;
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
this._activate(session);
|
|
739
|
+
}
|
|
740
|
+
openQuickChat(options) {
|
|
741
|
+
return this._openQuickChat(options, "explicit");
|
|
742
|
+
}
|
|
743
|
+
_openQuickChat(options, intent) {
|
|
744
|
+
this._beginNavigation(intent);
|
|
745
|
+
this._startOpenSession();
|
|
746
|
+
try {
|
|
747
|
+
const session = this.sessionsManagementService.createQuickChat(options);
|
|
748
|
+
return this._activate(session);
|
|
749
|
+
} catch (e) {
|
|
750
|
+
this.logService.trace(`[SessionsView] openQuickChat: createQuickChat failed: ${e}`);
|
|
751
|
+
return undefined;
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
async openNewChatInSession(session, options) {
|
|
755
|
+
this._cancelRestore();
|
|
756
|
+
this._beginNavigation("explicit");
|
|
757
|
+
this._startOpenSession();
|
|
758
|
+
const chat = await this.sessionsManagementService.createNewChatInSession(session, options);
|
|
759
|
+
if (!chat) {
|
|
760
|
+
return;
|
|
761
|
+
}
|
|
762
|
+
this._activate(session);
|
|
763
|
+
this._visibility.setActiveChat(session, chat);
|
|
764
|
+
}
|
|
765
|
+
setActive(session) {
|
|
766
|
+
if (session?.sessionId !== this.activeSession.get()?.sessionId) {
|
|
767
|
+
this._recordNavigation();
|
|
768
|
+
}
|
|
769
|
+
this._activate(session);
|
|
770
|
+
}
|
|
771
|
+
async submitNewSessionInput() {
|
|
772
|
+
let activeSession = this.activeSession.get();
|
|
773
|
+
if (activeSession?.isCreated.get()) {
|
|
774
|
+
return false;
|
|
775
|
+
}
|
|
776
|
+
if (!this.sessionsPartService.getSessionView(activeSession?.sessionId)) {
|
|
777
|
+
await this.openNewSession();
|
|
778
|
+
activeSession = this.activeSession.get();
|
|
779
|
+
if (activeSession?.isCreated.get()) {
|
|
780
|
+
return false;
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
return this.sessionsPartService.getSessionView(activeSession?.sessionId)?.submitInput() ?? false;
|
|
784
|
+
}
|
|
785
|
+
toggleSessionStickiness(session) {
|
|
786
|
+
const sticky = this._visibility.toggleStickiness(session);
|
|
787
|
+
this._onDidToggleSessionStickiness.fire({
|
|
788
|
+
session,
|
|
789
|
+
sticky
|
|
790
|
+
});
|
|
791
|
+
}
|
|
792
|
+
insertAt(session, targetSessionId, side, activate = true) {
|
|
793
|
+
this._visibility.insertAt(session, targetSessionId, side, activate);
|
|
794
|
+
}
|
|
795
|
+
closeSession(session) {
|
|
796
|
+
const sessionId = session?.sessionId;
|
|
797
|
+
const visible = this._visibility.visibleSessions.get();
|
|
798
|
+
if (!( visible.some(s => s?.sessionId === sessionId))) {
|
|
799
|
+
return;
|
|
800
|
+
}
|
|
801
|
+
const activeSessionId = this._visibility.activeSession.get()?.sessionId;
|
|
802
|
+
const wasActive = activeSessionId === sessionId;
|
|
803
|
+
if (session) {
|
|
804
|
+
this._closedItems.recordClosedSession(session);
|
|
805
|
+
}
|
|
806
|
+
this.sessionsManagementService.discardNewSession(session);
|
|
807
|
+
this._visibility.removeMany([sessionId]);
|
|
808
|
+
if (!wasActive) {
|
|
809
|
+
return;
|
|
810
|
+
}
|
|
811
|
+
const fallback = this._visibility.activeSession.get();
|
|
812
|
+
if (fallback === undefined) {
|
|
813
|
+
this.openNewSession();
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
closeAllSessions() {
|
|
817
|
+
const ids = this._visibility.visibleSessions.get().filter(s => !!s).map(s => s.sessionId);
|
|
818
|
+
if (ids.length === 0) {
|
|
819
|
+
return;
|
|
820
|
+
}
|
|
821
|
+
this.sessionsManagementService.discardNewSession();
|
|
822
|
+
this._visibility.removeMany(ids);
|
|
823
|
+
}
|
|
824
|
+
_restoreInitialChat(session) {
|
|
825
|
+
const chats = session.chats.get();
|
|
826
|
+
let initialChat = chats[0];
|
|
827
|
+
const sessionState = this._sessionStates.get(session.resource);
|
|
828
|
+
if (sessionState?.activeChatResource) {
|
|
829
|
+
try {
|
|
830
|
+
const lastChatResource = ( URI.parse(sessionState.activeChatResource));
|
|
831
|
+
const found = chats.find(c => this.uriIdentityService.extUri.isEqual(c.resource, lastChatResource));
|
|
832
|
+
if (found) {
|
|
833
|
+
initialChat = found;
|
|
834
|
+
}
|
|
835
|
+
} catch (error) {
|
|
836
|
+
this.logService.warn(
|
|
837
|
+
"[SessionsView] Failed to restore active chat from stored session state",
|
|
838
|
+
error
|
|
839
|
+
);
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
return initialChat;
|
|
843
|
+
}
|
|
844
|
+
_restoreClosedChats(session) {
|
|
845
|
+
return this._sessionStates.get(session.resource)?.closedChatResources ?? [];
|
|
846
|
+
}
|
|
847
|
+
_restoreShownRelatedChats(session) {
|
|
848
|
+
return this._sessionStates.get(session.resource)?.openedChatResources ?? [];
|
|
849
|
+
}
|
|
850
|
+
async _waitForSessionToLoad(session, token) {
|
|
851
|
+
if (!session.loading.get()) {
|
|
852
|
+
return true;
|
|
853
|
+
}
|
|
854
|
+
if (token.isCancellationRequested) {
|
|
855
|
+
return false;
|
|
856
|
+
}
|
|
857
|
+
await ( new Promise(resolve => {
|
|
858
|
+
const disposables = ( new DisposableStore());
|
|
859
|
+
let resolved = false;
|
|
860
|
+
const finish = () => {
|
|
861
|
+
if (resolved) {
|
|
862
|
+
return;
|
|
863
|
+
}
|
|
864
|
+
resolved = true;
|
|
865
|
+
disposables.dispose();
|
|
866
|
+
resolve();
|
|
867
|
+
};
|
|
868
|
+
disposables.add(token.onCancellationRequested(finish));
|
|
869
|
+
disposables.add(autorun(reader => {
|
|
870
|
+
if (!session.loading.read(reader)) {
|
|
871
|
+
finish();
|
|
872
|
+
}
|
|
873
|
+
}));
|
|
874
|
+
}));
|
|
875
|
+
return !token.isCancellationRequested;
|
|
876
|
+
}
|
|
877
|
+
_loadSessionStates() {
|
|
878
|
+
const map = ( new ResourceMap());
|
|
879
|
+
const raw = this.storageService.get(ACTIVE_SESSION_STATES_KEY, StorageScope.WORKSPACE);
|
|
880
|
+
if (!raw) {
|
|
881
|
+
return map;
|
|
882
|
+
}
|
|
883
|
+
try {
|
|
884
|
+
const entries = JSON.parse(raw);
|
|
885
|
+
for (const entry of entries) {
|
|
886
|
+
const uri = ( URI.parse(entry.sessionResource));
|
|
887
|
+
map.set(uri, entry);
|
|
888
|
+
}
|
|
889
|
+
} catch {}
|
|
890
|
+
return map;
|
|
891
|
+
}
|
|
892
|
+
_saveSessionStates() {
|
|
893
|
+
const entries = this._snapshotVisibleSessionStates();
|
|
894
|
+
const visible = ( new ResourceMap());
|
|
895
|
+
for (const entry of entries) {
|
|
896
|
+
visible.set(( URI.parse(entry.sessionResource)), true);
|
|
897
|
+
}
|
|
898
|
+
for (const [resource, state] of this._sessionStates) {
|
|
899
|
+
if (( visible.has(resource))) {
|
|
900
|
+
continue;
|
|
901
|
+
}
|
|
902
|
+
entries.push({
|
|
903
|
+
sessionResource: state.sessionResource,
|
|
904
|
+
activeChatResource: state.activeChatResource,
|
|
905
|
+
activeChatOrigin: state.activeChatOrigin,
|
|
906
|
+
closedChatResources: state.closedChatResources,
|
|
907
|
+
openedChatResources: state.openedChatResources
|
|
908
|
+
});
|
|
909
|
+
}
|
|
910
|
+
this.storageService.store(
|
|
911
|
+
ACTIVE_SESSION_STATES_KEY,
|
|
912
|
+
JSON.stringify(entries),
|
|
913
|
+
StorageScope.WORKSPACE,
|
|
914
|
+
StorageTarget.MACHINE
|
|
915
|
+
);
|
|
916
|
+
}
|
|
917
|
+
_snapshotVisibleSessionStates() {
|
|
918
|
+
const activeId = this._visibility.activeSession.get()?.sessionId;
|
|
919
|
+
const visible = this._visibility.visibleSessions.get();
|
|
920
|
+
const entries = [];
|
|
921
|
+
visible.forEach((session, index) => {
|
|
922
|
+
if (!session) {
|
|
923
|
+
return;
|
|
924
|
+
}
|
|
925
|
+
if (session.status.get() === SessionStatus.Untitled) {
|
|
926
|
+
this._sessionStates.delete(session.resource);
|
|
927
|
+
return;
|
|
928
|
+
}
|
|
929
|
+
const existing = this._sessionStates.get(session.resource);
|
|
930
|
+
const state = {
|
|
931
|
+
sessionResource: ( session.resource.toString()),
|
|
932
|
+
activeChatResource: this._pendingRestoredChatResources.get(session.resource)?.toString() ?? session.activeChat.get()?.resource.toString() ?? existing?.activeChatResource,
|
|
933
|
+
activeChatOrigin: session.activeChat.get()?.origin?.kind ?? existing?.activeChatOrigin,
|
|
934
|
+
closedChatResources: existing?.closedChatResources ?? session.closedChats.get().map(c => ( c.resource.toString())),
|
|
935
|
+
openedChatResources: existing?.openedChatResources,
|
|
936
|
+
visibleOrder: index,
|
|
937
|
+
isSticky: session.sticky.get(),
|
|
938
|
+
isActive: session.sessionId === activeId
|
|
939
|
+
};
|
|
940
|
+
this._sessionStates.set(session.resource, state);
|
|
941
|
+
entries.push(state);
|
|
942
|
+
});
|
|
943
|
+
return entries;
|
|
944
|
+
}
|
|
945
|
+
_getVisibleSessionStates() {
|
|
946
|
+
const states = [];
|
|
947
|
+
for (const [, state] of this._sessionStates) {
|
|
948
|
+
if (state.visibleOrder !== undefined) {
|
|
949
|
+
states.push(state);
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
return states.sort((a, b) => (a.visibleOrder - b.visibleOrder));
|
|
953
|
+
}
|
|
954
|
+
_waitForSession(sessionResource, token, timeout) {
|
|
955
|
+
const existing = this.sessionsManagementService.getSession(sessionResource);
|
|
956
|
+
if (existing) {
|
|
957
|
+
return Promise.resolve(existing);
|
|
958
|
+
}
|
|
959
|
+
return ( new Promise(resolve => {
|
|
960
|
+
const disposables = ( new DisposableStore());
|
|
961
|
+
let resolved = false;
|
|
962
|
+
const finish = session => {
|
|
963
|
+
if (resolved) {
|
|
964
|
+
return;
|
|
965
|
+
}
|
|
966
|
+
resolved = true;
|
|
967
|
+
disposables.dispose();
|
|
968
|
+
resolve(session);
|
|
969
|
+
};
|
|
970
|
+
disposables.add(token.onCancellationRequested(() => finish(undefined)));
|
|
971
|
+
const tryFind = () => {
|
|
972
|
+
if (token.isCancellationRequested) {
|
|
973
|
+
finish(undefined);
|
|
974
|
+
return;
|
|
975
|
+
}
|
|
976
|
+
const session = this.sessionsManagementService.getSession(sessionResource);
|
|
977
|
+
if (session) {
|
|
978
|
+
finish(session);
|
|
979
|
+
}
|
|
980
|
+
};
|
|
981
|
+
disposables.add(this.sessionsProvidersService.onDidChangeProviders(() => tryFind()));
|
|
982
|
+
disposables.add(this.sessionsManagementService.onDidChangeSessions(() => tryFind()));
|
|
983
|
+
if (timeout !== undefined) {
|
|
984
|
+
disposables.add(disposableTimeout(() => finish(undefined), timeout));
|
|
985
|
+
}
|
|
986
|
+
tryFind();
|
|
987
|
+
}));
|
|
988
|
+
}
|
|
989
|
+
async restoreVisibleSessions() {
|
|
990
|
+
try {
|
|
991
|
+
await this._restoreVisibleSessions();
|
|
992
|
+
} finally {
|
|
993
|
+
this._initialRestoreComplete.set(true, undefined);
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
async _restoreVisibleSessions() {
|
|
997
|
+
const cts = ( new CancellationTokenSource());
|
|
998
|
+
this._restoreCts.value = cts;
|
|
999
|
+
const token = cts.token;
|
|
1000
|
+
const persisted = this._getVisibleSessionStates();
|
|
1001
|
+
const unresolved = persisted.map(state => ({
|
|
1002
|
+
resource: ( URI.parse(state.sessionResource)),
|
|
1003
|
+
isSticky: !!state.isSticky,
|
|
1004
|
+
isActive: !!state.isActive,
|
|
1005
|
+
order: state.visibleOrder
|
|
1006
|
+
}));
|
|
1007
|
+
const targets = (await raceTimeout(Promise.all(persisted.map(async (state, index) => ({
|
|
1008
|
+
resource: await this.sessionsManagementService.resolveSessionResource(( URI.parse(state.sessionResource)), "restore"),
|
|
1009
|
+
isSticky: unresolved[index].isSticky,
|
|
1010
|
+
isActive: unresolved[index].isActive,
|
|
1011
|
+
order: unresolved[index].order
|
|
1012
|
+
}))), RESTORE_RESOLVE_BUDGET_MS)) ?? unresolved;
|
|
1013
|
+
if (token.isCancellationRequested) {
|
|
1014
|
+
return;
|
|
1015
|
+
}
|
|
1016
|
+
if (targets.length === 0) {
|
|
1017
|
+
targets.push({
|
|
1018
|
+
resource: undefined,
|
|
1019
|
+
isSticky: false,
|
|
1020
|
+
isActive: true,
|
|
1021
|
+
order: 1
|
|
1022
|
+
});
|
|
1023
|
+
}
|
|
1024
|
+
targets.sort((a, b) => a.order - b.order);
|
|
1025
|
+
let activeIdx = targets.findIndex(t => t.isActive);
|
|
1026
|
+
if (activeIdx < 0) {
|
|
1027
|
+
activeIdx = 0;
|
|
1028
|
+
}
|
|
1029
|
+
const resolved = ( new Array(targets.length)).fill(undefined);
|
|
1030
|
+
const place = (idx, session) => {
|
|
1031
|
+
let anchor;
|
|
1032
|
+
for (let j = idx - 1; j >= 0 && !anchor; j--) {
|
|
1033
|
+
const neighbour = resolved[j];
|
|
1034
|
+
if (neighbour !== undefined) {
|
|
1035
|
+
anchor = {
|
|
1036
|
+
id: neighbour?.sessionId,
|
|
1037
|
+
side: "right"
|
|
1038
|
+
};
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
for (let j = idx + 1; j < targets.length && !anchor; j++) {
|
|
1042
|
+
const neighbour = resolved[j];
|
|
1043
|
+
if (neighbour !== undefined) {
|
|
1044
|
+
anchor = {
|
|
1045
|
+
id: neighbour?.sessionId,
|
|
1046
|
+
side: "left"
|
|
1047
|
+
};
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
resolved[idx] = session;
|
|
1051
|
+
if (anchor) {
|
|
1052
|
+
this._visibility.insertAt(session, anchor.id, anchor.side, false);
|
|
1053
|
+
} else {
|
|
1054
|
+
this._activate(session);
|
|
1055
|
+
}
|
|
1056
|
+
if (targets[idx].isSticky) {
|
|
1057
|
+
this._visibility.toggleStickiness(session);
|
|
1058
|
+
}
|
|
1059
|
+
};
|
|
1060
|
+
const activeTarget = targets[activeIdx];
|
|
1061
|
+
const activeSessionPromise = activeTarget.resource ? this._waitForSession(activeTarget.resource, token, RESTORE_SESSION_WAIT_TIMEOUT).then(session => session ?? undefined) : Promise.resolve(undefined);
|
|
1062
|
+
const activeSession = await activeSessionPromise;
|
|
1063
|
+
if (token.isCancellationRequested) {
|
|
1064
|
+
return;
|
|
1065
|
+
}
|
|
1066
|
+
if (activeSession) {
|
|
1067
|
+
const provider = this.sessionsProvidersService.getProvider(activeSession.providerId);
|
|
1068
|
+
void provider?.prepareSessionForOpen?.(activeSession, "restore").catch(error => this.logService.warn(
|
|
1069
|
+
`[SessionsView] Failed to prepare restored session for provider '${provider.id}'`,
|
|
1070
|
+
error
|
|
1071
|
+
));
|
|
1072
|
+
}
|
|
1073
|
+
const slots = [];
|
|
1074
|
+
let activeSlotIndex = -1;
|
|
1075
|
+
for (let idx = 0; idx < targets.length; idx++) {
|
|
1076
|
+
const target = targets[idx];
|
|
1077
|
+
let session;
|
|
1078
|
+
if (!target.resource) {
|
|
1079
|
+
session = null;
|
|
1080
|
+
} else if (idx === activeIdx) {
|
|
1081
|
+
session = activeSession;
|
|
1082
|
+
} else {
|
|
1083
|
+
session = this.sessionsManagementService.getSession(target.resource);
|
|
1084
|
+
}
|
|
1085
|
+
if (session === undefined) {
|
|
1086
|
+
continue;
|
|
1087
|
+
}
|
|
1088
|
+
resolved[idx] = session;
|
|
1089
|
+
if (idx === activeIdx) {
|
|
1090
|
+
activeSlotIndex = slots.length;
|
|
1091
|
+
}
|
|
1092
|
+
slots.push({
|
|
1093
|
+
session: session ?? undefined,
|
|
1094
|
+
sticky: target.isSticky
|
|
1095
|
+
});
|
|
1096
|
+
}
|
|
1097
|
+
this._visibility.restoreGrid(slots, activeSlotIndex);
|
|
1098
|
+
if (token.isCancellationRequested) {
|
|
1099
|
+
return;
|
|
1100
|
+
}
|
|
1101
|
+
await Promise.all(targets.map(async (target, idx) => {
|
|
1102
|
+
if (idx === activeIdx || !target.resource || token.isCancellationRequested || resolved[idx] !== undefined) {
|
|
1103
|
+
return;
|
|
1104
|
+
}
|
|
1105
|
+
const session = await this._waitForSession(target.resource, token, RESTORE_SESSION_WAIT_TIMEOUT);
|
|
1106
|
+
if (!session || token.isCancellationRequested || resolved[idx] !== undefined) {
|
|
1107
|
+
return;
|
|
1108
|
+
}
|
|
1109
|
+
place(idx, session);
|
|
1110
|
+
}));
|
|
1111
|
+
}
|
|
1112
|
+
async openPreviousSession() {
|
|
1113
|
+
await this._navigation.goBack();
|
|
1114
|
+
}
|
|
1115
|
+
async openNextSession() {
|
|
1116
|
+
await this._navigation.goForward();
|
|
1117
|
+
}
|
|
1118
|
+
};
|
|
1119
|
+
SessionsService = ( __decorate([( __param(0, IStorageService)), ( __param(1, ILogService)), ( __param(2, IUriIdentityService)), ( __param(3, IContextKeyService)), ( __param(4, ISessionsManagementService)), ( __param(5, ISessionsProvidersService)), ( __param(6, ISessionsPartService)), ( __param(7, ICustomViewService)), ( __param(8, IInstantiationService)), ( __param(9, IWorkspaceTrustRequestService)), ( __param(10, IWorkspaceTrustManagementService)), ( __param(11, ISessionChangesStatsCache)), ( __param(12, ISessionOpenTelemetryService))], SessionsService));
|
|
1120
|
+
|
|
1121
|
+
export { SessionsService };
|