@codingame/monaco-vscode-workbench-service-override 37.6.0 → 38.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/common.js +2 -0
- package/index.js +9 -10
- package/package.json +10 -10
- package/session.js +45 -42
- package/vscode/src/vs/platform/agentHost/common/sessionComparisonPrompts.d.ts +1 -0
- package/vscode/src/vs/platform/agentHost/common/sessionComparisonPrompts.js +12 -0
- package/vscode/src/vs/sessions/browser/{singlePaneWorkbench.d.ts → desktopWorkbench.d.ts} +6 -5
- package/vscode/src/vs/sessions/browser/{singlePaneWorkbench.js → desktopWorkbench.js} +23 -25
- package/vscode/src/vs/sessions/browser/dockedAuxiliaryBarController.d.ts +5 -2
- package/vscode/src/vs/sessions/browser/dockedAuxiliaryBarController.js +41 -3
- package/vscode/src/vs/sessions/browser/layoutActions.js +25 -41
- package/vscode/src/vs/sessions/browser/mobileWorkbench.d.ts +4 -0
- package/vscode/src/vs/sessions/browser/mobileWorkbench.js +10 -0
- package/vscode/src/vs/sessions/browser/parts/chatCompositeBar.d.ts +10 -5
- package/vscode/src/vs/sessions/browser/parts/chatCompositeBar.js +138 -34
- package/vscode/src/vs/sessions/browser/parts/chatGroupDropTarget.d.ts +2 -0
- package/vscode/src/vs/sessions/browser/parts/chatGroupDropTarget.js +13 -5
- package/vscode/src/vs/sessions/browser/parts/chatGroupView.d.ts +27 -5
- package/vscode/src/vs/sessions/browser/parts/chatGroupView.js +129 -28
- package/vscode/src/vs/sessions/browser/parts/chatGroupsView.d.ts +22 -7
- package/vscode/src/vs/sessions/browser/parts/chatGroupsView.js +260 -21
- package/vscode/src/vs/sessions/browser/parts/chatHeader.d.ts +25 -0
- package/vscode/src/vs/sessions/browser/parts/chatHeader.js +42 -0
- package/vscode/src/vs/sessions/browser/parts/customViewGridPart.js +9 -1
- package/vscode/src/vs/sessions/browser/parts/customViewNode.js +1 -1
- package/vscode/src/vs/sessions/browser/parts/{singlePaneAuxiliaryBarPart.d.ts → desktopAuxiliaryBarPart.d.ts} +4 -4
- package/vscode/src/vs/sessions/browser/parts/desktopAuxiliaryBarPart.js +26 -0
- package/vscode/src/vs/sessions/browser/parts/{singlePaneEditorPart.d.ts → desktopEditorPart.d.ts} +8 -6
- package/vscode/src/vs/sessions/browser/parts/{singlePaneEditorPart.js → desktopEditorPart.js} +25 -5
- package/vscode/src/vs/sessions/browser/parts/editorPart.js +16 -4
- package/vscode/src/vs/sessions/browser/parts/editorParts.d.ts +1 -1
- package/vscode/src/vs/sessions/browser/parts/editorParts.js +7 -6
- package/vscode/src/vs/sessions/browser/parts/gridGap.d.ts +14 -0
- package/vscode/src/vs/sessions/browser/parts/gridGap.js +69 -0
- package/vscode/src/vs/sessions/browser/parts/media/chatCompositeBar.css +132 -4
- package/vscode/src/vs/sessions/browser/parts/media/chatGroupsView.css +10 -0
- package/vscode/src/vs/sessions/browser/parts/media/editorPart.css +46 -2
- package/vscode/src/vs/sessions/browser/parts/media/sessionReadOnlyBanner.css +3 -3
- package/vscode/src/vs/sessions/browser/parts/media/sessionView.css +45 -48
- package/vscode/src/vs/sessions/browser/parts/media/sessionsPart.css +15 -0
- package/vscode/src/vs/sessions/browser/parts/menubar.contribution.js +8 -8
- package/vscode/src/vs/sessions/browser/parts/mobile/mobileSessionsPart.js +1 -1
- package/vscode/src/vs/sessions/browser/parts/remoteHostUnavailableEmptyState.d.ts +9 -1
- package/vscode/src/vs/sessions/browser/parts/remoteHostUnavailableEmptyState.js +21 -3
- package/vscode/src/vs/sessions/browser/parts/sessionBarStyles.js +1 -1
- package/vscode/src/vs/sessions/browser/parts/sessionDropTarget.d.ts +4 -3
- package/vscode/src/vs/sessions/browser/parts/sessionDropTarget.js +29 -15
- package/vscode/src/vs/sessions/browser/parts/sessionGridLayout.d.ts +67 -0
- package/vscode/src/vs/sessions/browser/parts/sessionGridLayout.js +598 -0
- package/vscode/src/vs/sessions/browser/parts/sessionHeader.d.ts +11 -84
- package/vscode/src/vs/sessions/browser/parts/sessionHeader.js +37 -317
- package/vscode/src/vs/sessions/browser/parts/sessionHeaderBar.d.ts +103 -0
- package/vscode/src/vs/sessions/browser/parts/sessionHeaderBar.js +391 -0
- package/vscode/src/vs/sessions/browser/parts/sessionReadOnlyBanner.d.ts +6 -4
- package/vscode/src/vs/sessions/browser/parts/sessionReadOnlyBanner.js +58 -28
- package/vscode/src/vs/sessions/browser/parts/sessionRemoteConnection.d.ts +4 -0
- package/vscode/src/vs/sessions/browser/parts/sessionRemoteConnection.js +66 -23
- package/vscode/src/vs/sessions/browser/parts/sessionView.d.ts +24 -5
- package/vscode/src/vs/sessions/browser/parts/sessionView.js +143 -33
- package/vscode/src/vs/sessions/browser/parts/sessionsPart.d.ts +25 -19
- package/vscode/src/vs/sessions/browser/parts/sessionsPart.js +157 -58
- package/vscode/src/vs/sessions/browser/parts/sessionsParts.d.ts +12 -3
- package/vscode/src/vs/sessions/browser/parts/sessionsParts.js +17 -2
- package/vscode/src/vs/sessions/browser/sessionWorkspace.d.ts +6 -3
- package/vscode/src/vs/sessions/browser/sessionWorkspace.js +2 -2
- package/vscode/src/vs/sessions/browser/sessionsSetUpService.js +66 -20
- package/vscode/src/vs/sessions/browser/sessionsSignInDialog.d.ts +1 -0
- package/vscode/src/vs/sessions/browser/sessionsSignInDialog.js +5 -4
- package/vscode/src/vs/sessions/browser/workbenchFactory.d.ts +12 -0
- package/vscode/src/vs/sessions/browser/workbenchFactory.js +17 -0
- package/vscode/src/vs/sessions/contrib/accountMenu/browser/account.contribution.d.ts +85 -1
- package/vscode/src/vs/sessions/contrib/accountMenu/browser/account.contribution.js +118 -100
- package/vscode/src/vs/sessions/contrib/accountMenu/browser/chatPetAchievementBadges.d.ts +3 -2
- package/vscode/src/vs/sessions/contrib/accountMenu/browser/chatPetAchievementBadges.js +39 -34
- package/vscode/src/vs/sessions/contrib/accountMenu/browser/media/accountTitleBarWidget.css +6 -0
- package/vscode/src/vs/sessions/contrib/agentFeedback/browser/nullAgentFeedbackService.contribution.d.ts +3 -0
- package/vscode/src/vs/sessions/contrib/agentFeedback/browser/nullAgentFeedbackService.contribution.js +6 -0
- package/vscode/src/vs/sessions/contrib/aiCustomizationTreeView/browser/aiCustomizationTreeView.contribution.js +18 -18
- package/vscode/src/vs/sessions/contrib/aiCustomizationTreeView/browser/aiCustomizationTreeViewViews.js +12 -12
- package/vscode/src/vs/sessions/contrib/applyCommitsToParentRepo/browser/applyChangesToParentRepo.js +7 -7
- package/vscode/src/vs/sessions/contrib/aquarium/browser/aquarium.contribution.js +12 -12
- package/vscode/src/vs/sessions/contrib/aquarium/browser/aquariumOverlay.js +10 -10
- package/vscode/src/vs/sessions/contrib/automations/browser/automationDialog.d.ts +78 -8
- package/vscode/src/vs/sessions/contrib/automations/browser/automationDialog.js +1166 -202
- package/vscode/src/vs/sessions/contrib/automations/browser/automationDialogService.d.ts +11 -1
- package/vscode/src/vs/sessions/contrib/automations/browser/automationDialogService.js +190 -69
- package/vscode/src/vs/sessions/contrib/automations/browser/automationRunner.d.ts +11 -9
- package/vscode/src/vs/sessions/contrib/automations/browser/automationRunner.js +122 -233
- package/vscode/src/vs/sessions/contrib/automations/browser/automationTelemetry.d.ts +22 -0
- package/vscode/src/vs/sessions/contrib/automations/browser/automationTelemetry.js +62 -0
- package/vscode/src/vs/sessions/contrib/automations/browser/automationTools.d.ts +7 -2
- package/vscode/src/vs/sessions/contrib/automations/browser/automationTools.js +172 -84
- package/vscode/src/vs/sessions/contrib/automations/browser/automations.contribution.js +17 -7
- package/vscode/src/vs/sessions/contrib/automations/browser/media/automationDialog.css +242 -60
- package/vscode/src/vs/sessions/contrib/automations/browser/providerAutomationService.d.ts +24 -36
- package/vscode/src/vs/sessions/contrib/automations/browser/providerAutomationService.js +104 -420
- package/vscode/src/vs/sessions/contrib/changes/browser/changes.contribution.js +15 -14
- package/vscode/src/vs/sessions/contrib/changes/browser/changesActions.d.ts +13 -3
- package/vscode/src/vs/sessions/contrib/changes/browser/changesActions.js +66 -43
- package/vscode/src/vs/sessions/contrib/changes/browser/changesMultiDiffSourceResolver.js +2 -7
- package/vscode/src/vs/sessions/contrib/changes/browser/changesViewActions.js +54 -59
- package/vscode/src/vs/sessions/contrib/changes/browser/changesetReviewActions.js +7 -7
- package/vscode/src/vs/sessions/contrib/changes/browser/media/changesActions.css +6 -0
- package/vscode/src/vs/sessions/contrib/changes/browser/sessionSyncChanges.js +25 -21
- package/vscode/src/vs/sessions/contrib/changes/browser/sessionsChangesAccessibilityHelp.js +21 -27
- package/vscode/src/vs/sessions/contrib/chat/browser/sessionChatInputToolbarDebug.js +17 -17
- package/vscode/src/vs/sessions/contrib/chat/browser/sessionTaskRunner.d.ts +5 -5
- package/vscode/src/vs/sessions/contrib/chat/browser/sessionTaskRunner.js +2 -2
- package/vscode/src/vs/sessions/contrib/chatDebug/browser/chatDebug.contribution.js +2 -2
- package/vscode/src/vs/sessions/contrib/codeReview/browser/codeReview.contributions.js +9 -16
- package/vscode/src/vs/sessions/contrib/customViewTest/browser/customViewTest.contribution.js +7 -7
- package/vscode/src/vs/sessions/contrib/editor/browser/addTabActions.js +15 -13
- package/vscode/src/vs/sessions/contrib/editor/browser/editor.contribution.d.ts +13 -1
- package/vscode/src/vs/sessions/contrib/editor/browser/editor.contribution.js +104 -117
- package/vscode/src/vs/sessions/contrib/editor/browser/emptyFileEditor.contribution.js +8 -7
- package/vscode/src/vs/sessions/contrib/editor/browser/emptyFileEditor.js +5 -5
- package/vscode/src/vs/sessions/contrib/editor/browser/emptyFileEditorInput.js +1 -1
- package/vscode/src/vs/sessions/contrib/editor/browser/media/editorBreadcrumbs.css +0 -1
- package/vscode/src/vs/sessions/contrib/editor/browser/media/editorHeader.css +1 -1
- package/vscode/src/vs/sessions/contrib/files/browser/files.contribution.d.ts +7 -0
- package/vscode/src/vs/sessions/contrib/files/browser/files.contribution.js +77 -13
- package/vscode/src/vs/sessions/contrib/files/browser/filesView.d.ts +2 -1
- package/vscode/src/vs/sessions/contrib/files/browser/filesView.js +14 -4
- package/vscode/src/vs/sessions/contrib/layout/browser/baseSessionLayoutController.d.ts +45 -10
- package/vscode/src/vs/sessions/contrib/layout/browser/baseSessionLayoutController.js +527 -96
- package/vscode/src/vs/sessions/contrib/layout/browser/chatLayoutOwnerKeys.d.ts +18 -0
- package/vscode/src/vs/sessions/contrib/layout/browser/chatLayoutOwnerKeys.js +95 -0
- package/vscode/src/vs/sessions/contrib/layout/browser/{singlePane/singlePaneDetailPanelCoordinator.d.ts → desktop/desktopDetailPanelCoordinator.d.ts} +5 -4
- package/vscode/src/vs/sessions/contrib/layout/browser/{singlePane/singlePaneDetailPanelCoordinator.js → desktop/desktopDetailPanelCoordinator.js} +10 -7
- package/vscode/src/vs/sessions/contrib/layout/browser/{singlePane/singlePaneDockedTabsCoordinator.d.ts → desktop/desktopDockedTabsCoordinator.d.ts} +15 -12
- package/vscode/src/vs/sessions/contrib/layout/browser/{singlePane/singlePaneDockedTabsCoordinator.js → desktop/desktopDockedTabsCoordinator.js} +91 -44
- package/vscode/src/vs/sessions/contrib/layout/browser/{singlePane/singlePaneDraftSessionStrategy.d.ts → desktop/desktopDraftSessionStrategy.d.ts} +10 -5
- package/vscode/src/vs/sessions/contrib/layout/browser/{singlePane/singlePaneDraftSessionStrategy.js → desktop/desktopDraftSessionStrategy.js} +95 -22
- package/vscode/src/vs/sessions/contrib/layout/browser/{singlePane/singlePaneExistingSessionStrategy.d.ts → desktop/desktopExistingSessionStrategy.d.ts} +13 -11
- package/vscode/src/vs/sessions/contrib/layout/browser/{singlePane/singlePaneExistingSessionStrategy.js → desktop/desktopExistingSessionStrategy.js} +137 -57
- package/vscode/src/vs/sessions/contrib/layout/browser/{singlePane/singlePaneLayoutStrategy.d.ts → desktop/desktopLayoutStrategy.d.ts} +22 -13
- package/vscode/src/vs/sessions/contrib/layout/browser/{singlePane/singlePaneLayoutStrategy.js → desktop/desktopLayoutStrategy.js} +2 -2
- package/vscode/src/vs/sessions/contrib/layout/browser/desktop/desktopOwnerCompositionStore.d.ts +22 -0
- package/vscode/src/vs/sessions/contrib/layout/browser/desktop/desktopOwnerCompositionStore.js +136 -0
- package/vscode/src/vs/sessions/contrib/layout/browser/{singlePane/singlePaneSharedHelpers.d.ts → desktop/desktopSharedHelpers.d.ts} +9 -2
- package/vscode/src/vs/sessions/contrib/layout/browser/desktop/desktopSharedHelpers.js +56 -0
- package/vscode/src/vs/sessions/contrib/layout/browser/{singlePane/singlePaneVisibilityProfileStore.d.ts → desktop/desktopVisibilityProfileStore.d.ts} +3 -2
- package/vscode/src/vs/sessions/contrib/layout/browser/{singlePane/singlePaneVisibilityProfileStore.js → desktop/desktopVisibilityProfileStore.js} +10 -9
- package/vscode/src/vs/sessions/contrib/layout/browser/desktopLayoutController.d.ts +71 -0
- package/vscode/src/vs/sessions/contrib/layout/browser/desktopLayoutController.js +201 -0
- package/vscode/src/vs/sessions/contrib/layout/browser/sessions.layout.contribution.d.ts +8 -1
- package/vscode/src/vs/sessions/contrib/layout/browser/sessions.layout.contribution.js +35 -35
- package/vscode/src/vs/sessions/contrib/layout/common/sessionEditorWorkingSet.d.ts +39 -0
- package/vscode/src/vs/sessions/contrib/layout/common/sessionEditorWorkingSet.js +73 -0
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/newSessionTourContribution.d.ts +42 -1
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/newSessionTourContribution.js +14 -10
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/newSessionViewTourContribution.js +3 -4
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/newSessionViewTourTrigger.d.ts +2 -2
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/newSessionViewTourTrigger.js +13 -9
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/newSessionViewV2TourContribution.js +20 -5
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/newSessionViewV2TourVariation.d.ts +8 -0
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/newSessionViewV2TourVariation.js +19 -0
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/newSessionViewV3Prompt.js +21 -20
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/tours/newSessionTour.js +10 -5
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/tours/newSessionViewTour.js +12 -8
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/tours/newSessionViewTourShared.d.ts +3 -1
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/tours/newSessionViewTourShared.js +12 -7
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/tours/newSessionViewV2Tour.d.ts +9 -1
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/tours/newSessionViewV2Tour.js +46 -19
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/tours/newSessionViewV3Tour.js +2 -0
- package/vscode/src/vs/sessions/contrib/policyBlocked/browser/media/sessionsPolicyBlocked.css +33 -0
- package/vscode/src/vs/sessions/contrib/policyBlocked/browser/policyBlocked.contribution.d.ts +4 -2
- package/vscode/src/vs/sessions/contrib/policyBlocked/browser/policyBlocked.contribution.js +29 -8
- package/vscode/src/vs/sessions/contrib/policyBlocked/browser/sessionsPolicyBlocked.d.ts +15 -2
- package/vscode/src/vs/sessions/contrib/policyBlocked/browser/sessionsPolicyBlocked.js +169 -32
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostForkActions.js +30 -8
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostSessionBranchActions.js +8 -34
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentMergeActions.js +63 -49
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/exportDebugLogsAction.js +1 -1
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/mobile/mobileChatInputConfigPicker.js +31 -17
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/connectionDiagnostics.contribution.d.ts +32 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/connectionDiagnostics.contribution.js +250 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/connectionDiagnosticsLogs.d.ts +6 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/connectionDiagnosticsLogs.js +52 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/connectionDiagnosticsReport.d.ts +51 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/connectionDiagnosticsReport.js +439 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/connectionDiagnosticsService.d.ts +45 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/connectionDiagnosticsService.js +595 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/devContainerAgentHostService.d.ts +20 -3
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/devContainerAgentHostService.js +360 -46
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/devContainerSource.d.ts +9 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/devContainerSource.js +59 -0
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/media/connectionDiagnostics.css +201 -0
- package/vscode/src/vs/sessions/contrib/remoteSessions/browser/getRemoteSessionTool.d.ts +10 -0
- package/vscode/src/vs/sessions/contrib/remoteSessions/browser/getRemoteSessionTool.js +70 -0
- package/vscode/src/vs/sessions/contrib/remoteSessions/browser/remoteSessionChatService.d.ts +20 -0
- package/vscode/src/vs/sessions/contrib/remoteSessions/browser/remoteSessionChatService.js +104 -0
- package/vscode/src/vs/sessions/contrib/remoteSessions/browser/remoteSessionInspector.d.ts +15 -0
- package/vscode/src/vs/sessions/contrib/remoteSessions/browser/remoteSessionInspector.js +152 -0
- package/vscode/src/vs/sessions/contrib/remoteSessions/browser/remoteSessionMessageRouter.d.ts +49 -0
- package/vscode/src/vs/sessions/contrib/remoteSessions/browser/remoteSessionMessageRouter.js +340 -0
- package/vscode/src/vs/sessions/contrib/remoteSessions/browser/remoteSessionService.d.ts +41 -0
- package/vscode/src/vs/sessions/contrib/remoteSessions/browser/remoteSessionService.js +400 -0
- package/vscode/src/vs/sessions/contrib/remoteSessions/browser/remoteSessionSource.d.ts +28 -0
- package/vscode/src/vs/sessions/contrib/remoteSessions/browser/remoteSessionSource.js +178 -0
- package/vscode/src/vs/sessions/contrib/remoteSessions/browser/remoteSessionTools.d.ts +17 -0
- package/vscode/src/vs/sessions/contrib/remoteSessions/browser/remoteSessionTools.js +206 -0
- package/vscode/src/vs/sessions/contrib/remoteSessions/browser/remoteSessions.contribution.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/remoteSessions/browser/remoteSessions.contribution.js +58 -0
- package/vscode/src/vs/sessions/contrib/remoteSessions/browser/sendRemoteMessageTool.d.ts +10 -0
- package/vscode/src/vs/sessions/contrib/remoteSessions/browser/sendRemoteMessageTool.js +90 -0
- package/vscode/src/vs/sessions/contrib/remoteSessions/common/remoteSessionInspection.d.ts +38 -0
- package/vscode/src/vs/sessions/contrib/remoteSessions/common/remoteSessionInspection.js +58 -0
- package/vscode/src/vs/sessions/contrib/search/browser/search.contribution.js +4 -5
- package/vscode/src/vs/sessions/contrib/search/browser/searchEditorEmptyState.contribution.js +1 -1
- package/vscode/src/vs/sessions/contrib/sessionComparison/browser/sessionComparison.contribution.d.ts +1 -0
- package/vscode/src/vs/sessions/contrib/sessionComparison/browser/sessionComparison.contribution.js +33 -0
- package/vscode/src/vs/sessions/contrib/sessionComparison/browser/sessionComparisonGridController.d.ts +30 -0
- package/vscode/src/vs/sessions/contrib/sessionComparison/browser/sessionComparisonGridController.js +190 -0
- package/vscode/src/vs/sessions/contrib/sessionComparison/browser/sessionComparisonTool.d.ts +31 -0
- package/vscode/src/vs/sessions/contrib/sessionComparison/browser/sessionComparisonTool.js +559 -0
- package/vscode/src/vs/sessions/contrib/sessionComparison/browser/sessionComparisonViewService.d.ts +12 -0
- package/vscode/src/vs/sessions/contrib/sessionComparison/browser/sessionComparisonViewService.js +38 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/blockedSessionsIndicatorModel.d.ts +13 -4
- package/vscode/src/vs/sessions/contrib/sessions/browser/blockedSessionsIndicatorModel.js +155 -22
- package/vscode/src/vs/sessions/contrib/sessions/browser/blockedSessionsList.js +9 -5
- package/vscode/src/vs/sessions/contrib/sessions/browser/media/automationsCards.css +90 -25
- package/vscode/src/vs/sessions/contrib/sessions/browser/media/sessionsTitleBarWidget.css +21 -4
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionDetailsAction.d.ts +2 -1
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionDetailsAction.js +11 -7
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessions.contribution.d.ts +116 -1
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessions.contribution.js +126 -30
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsAccountTelemetry.d.ts +26 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsAccountTelemetry.js +160 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsActions.d.ts +14 -6
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsActions.js +555 -151
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsLifecycleTracker.d.ts +192 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsLifecycleTracker.js +510 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsTelemetry.contribution.d.ts +6 -7
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsTelemetry.contribution.js +64 -57
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsTitleBarWidget.d.ts +5 -3
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsTitleBarWidget.js +83 -51
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsWindowNotifier.d.ts +5 -1
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsWindowNotifier.js +33 -12
- package/vscode/src/vs/sessions/contrib/sessions/browser/views/automationCataloguePresentation.d.ts +3 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/views/automationCataloguePresentation.js +53 -0
- package/vscode/src/vs/sessions/contrib/sessions/browser/views/automationTemplates.js +10 -10
- package/vscode/src/vs/sessions/contrib/sessions/browser/views/automationsAccessibility.d.ts +2 -2
- package/vscode/src/vs/sessions/contrib/sessions/browser/views/automationsAccessibility.js +103 -55
- package/vscode/src/vs/sessions/contrib/sessions/browser/views/automationsView.d.ts +7 -1
- package/vscode/src/vs/sessions/contrib/sessions/browser/views/automationsView.js +679 -325
- package/vscode/src/vs/sessions/contrib/sessions/browser/views/sessionsViewActions.d.ts +27 -1
- package/vscode/src/vs/sessions/contrib/sessions/browser/views/sessionsViewActions.js +508 -163
- package/vscode/src/vs/sessions/contrib/terminal/browser/agentHostSessionTaskRunner.d.ts +20 -2
- package/vscode/src/vs/sessions/contrib/terminal/browser/agentHostSessionTaskRunner.js +100 -17
- package/vscode/src/vs/sessions/contrib/terminal/browser/sessionsTerminalContribution.d.ts +5 -1
- package/vscode/src/vs/sessions/contrib/terminal/browser/sessionsTerminalContribution.js +108 -30
- package/vscode/src/vs/sessions/contrib/workspace/browser/workspaceFolderManagement.d.ts +5 -3
- package/vscode/src/vs/sessions/contrib/workspace/browser/workspaceFolderManagement.js +47 -35
- package/vscode/src/vs/sessions/services/agentHostFilter/browser/agentHostFilterService.d.ts +9 -4
- package/vscode/src/vs/sessions/services/agentHostFilter/browser/agentHostFilterService.js +75 -25
- package/vscode/src/vs/sessions/services/customView/browser/customViewService.d.ts +11 -4
- package/vscode/src/vs/sessions/services/customView/browser/customViewService.js +17 -9
- package/vscode/src/vs/sessions/services/sessions/browser/closedItemHistory.d.ts +5 -0
- package/vscode/src/vs/sessions/services/sessions/browser/closedItemHistory.js +20 -2
- package/vscode/src/vs/sessions/services/sessions/browser/sessionComparisonService.d.ts +75 -0
- package/vscode/src/vs/sessions/services/sessions/browser/sessionComparisonService.js +1135 -0
- package/vscode/src/vs/sessions/services/sessions/browser/sessionGridState.d.ts +17 -0
- package/vscode/src/vs/sessions/services/sessions/browser/sessionGridState.js +99 -0
- package/vscode/src/vs/sessions/services/sessions/browser/sessionGroupsService.d.ts +4 -0
- package/vscode/src/vs/sessions/services/sessions/browser/sessionGroupsService.js +88 -23
- package/vscode/src/vs/sessions/services/sessions/browser/sessionNavigation.d.ts +19 -26
- package/vscode/src/vs/sessions/services/sessions/browser/sessionNavigation.js +115 -74
- package/vscode/src/vs/sessions/services/sessions/browser/sessionsListModelService.js +1 -1
- package/vscode/src/vs/sessions/services/sessions/browser/sessionsManagementService.d.ts +22 -7
- package/vscode/src/vs/sessions/services/sessions/browser/sessionsManagementService.js +278 -60
- package/vscode/src/vs/sessions/services/sessions/browser/sessionsRecencyHistory.d.ts +17 -20
- package/vscode/src/vs/sessions/services/sessions/browser/sessionsRecencyHistory.js +33 -22
- package/vscode/src/vs/sessions/services/sessions/browser/sessionsService.d.ts +28 -8
- package/vscode/src/vs/sessions/services/sessions/browser/sessionsService.js +673 -160
- package/vscode/src/vs/sessions/services/sessions/browser/visibleSessions.d.ts +13 -4
- package/vscode/src/vs/sessions/services/sessions/browser/visibleSessions.js +105 -15
- package/vscode/src/vs/sessions/services/sessions/common/sessionContextKeys.js +53 -34
- package/vscode/src/vs/sessions/services/workspaceFolderLabel/browser/workspaceFolderLabelService.js +1 -1
- package/vscode/src/vs/workbench/browser/layout.d.ts +46 -70
- package/vscode/src/vs/workbench/browser/layout.js +243 -44
- package/vscode/src/vs/workbench/browser/workbench.d.ts +1 -3
- package/vscode/src/vs/workbench/browser/workbench.js +26 -24
- package/vscode/src/vs/workbench/contrib/chat/common/automations/schedule.d.ts +6 -0
- package/vscode/src/vs/workbench/contrib/chat/common/automations/schedule.js +41 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatUsage.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatUsage.js +56 -0
- package/vscode/src/vs/platform/agentHost/common/meta/agentCheckoutOperationMeta.d.ts +0 -18
- package/vscode/src/vs/platform/agentHost/common/meta/agentCheckoutOperationMeta.js +0 -27
- package/vscode/src/vs/sessions/browser/parts/singlePaneAuxiliaryBarPart.js +0 -36
- package/vscode/src/vs/sessions/contrib/automations/browser/automationLeaderElection.d.ts +0 -37
- package/vscode/src/vs/sessions/contrib/automations/browser/automationLeaderElection.js +0 -126
- package/vscode/src/vs/sessions/contrib/automations/browser/automationScheduler.d.ts +0 -59
- package/vscode/src/vs/sessions/contrib/automations/browser/automationScheduler.js +0 -232
- package/vscode/src/vs/sessions/contrib/automations/browser/automationStorageService.d.ts +0 -13
- package/vscode/src/vs/sessions/contrib/automations/browser/automationStorageService.js +0 -22
- package/vscode/src/vs/sessions/contrib/blockedSessions/browser/blockedSessions.d.ts +0 -45
- package/vscode/src/vs/sessions/contrib/blockedSessions/browser/blockedSessions.js +0 -110
- package/vscode/src/vs/sessions/contrib/layout/browser/desktopSessionLayoutController.d.ts +0 -112
- package/vscode/src/vs/sessions/contrib/layout/browser/desktopSessionLayoutController.js +0 -444
- package/vscode/src/vs/sessions/contrib/layout/browser/singlePane/singlePaneSharedHelpers.js +0 -43
- package/vscode/src/vs/sessions/contrib/layout/browser/singlePaneLayoutController.d.ts +0 -55
- package/vscode/src/vs/sessions/contrib/layout/browser/singlePaneLayoutController.js +0 -91
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostClaudePermissionModePicker.d.ts +0 -26
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostClaudePermissionModePicker.js +0 -98
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostCodexApprovalsPicker.d.ts +0 -33
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostCodexApprovalsPicker.js +0 -98
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostModeIcon.d.ts +0 -2
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostModeIcon.js +0 -13
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostModePicker.d.ts +0 -122
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostModePicker.js +0 -464
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostPermissionPickerActionItem.d.ts +0 -35
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostPermissionPickerActionItem.js +0 -90
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostPermissionPickerDelegate.d.ts +0 -84
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostPermissionPickerDelegate.js +0 -328
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostSessionConfigPicker.d.ts +0 -174
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostSessionConfigPicker.js +0 -1390
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/media/agentHostSessionConfigPicker.css +0 -44
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/mobile/mobileAgentHostModePicker.d.ts +0 -30
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/mobile/mobileAgentHostModePicker.js +0 -78
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/mobile/mobileChatPhoneInputTarget.d.ts +0 -11
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/mobile/mobileChatPhoneInputTarget.js +0 -26
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHostConnectionCustomization.d.ts +0 -27
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHostConnectionCustomization.js +0 -26
|
@@ -32,10 +32,18 @@ import { IsNewChatSessionContext } from '@codingame/monaco-vscode-api/vscode/vs/
|
|
|
32
32
|
import { setActiveSessionContextKeys } from '../common/sessionContextKeys.js';
|
|
33
33
|
import { ISessionChangesStatsCache } from '@codingame/monaco-vscode-api/vscode/vs/sessions/services/sessions/common/sessionChangesStatsCache.service';
|
|
34
34
|
import { ISessionOpenTelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/sessions/services/sessions/browser/sessionOpenTelemetryService.service';
|
|
35
|
+
import { isAgentHostProvider } from '@codingame/monaco-vscode-api/vscode/vs/sessions/common/agentHostSessionsProvider';
|
|
36
|
+
import { Direction } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/grid/grid';
|
|
37
|
+
import { projectSessionGrid, isSessionGridState } from './sessionGridState.js';
|
|
35
38
|
import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableValue';
|
|
36
39
|
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
40
|
+
import { transaction } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/transaction';
|
|
37
41
|
|
|
38
42
|
const ACTIVE_SESSION_STATES_KEY = "agentSessions.activeSessionStates";
|
|
43
|
+
const SESSION_GRID_STATE_KEY = "agentSessions.gridState";
|
|
44
|
+
function toSessionGridDirection(direction) {
|
|
45
|
+
return direction === Direction.Left ? "left" : direction === Direction.Right ? "right" : direction === Direction.Up ? "up" : "down";
|
|
46
|
+
}
|
|
39
47
|
const RESTORE_RESOLVE_BUDGET_MS = 10_000;
|
|
40
48
|
const RESTORE_SESSION_WAIT_TIMEOUT = 30_000;
|
|
41
49
|
const MAX_RECENTLY_OPENED_SESSIONS = 10;
|
|
@@ -71,6 +79,7 @@ let SessionsService = class SessionsService extends Disposable {
|
|
|
71
79
|
this.sessionOpenTelemetryService = sessionOpenTelemetryService;
|
|
72
80
|
this._onDidToggleSessionStickiness = this._register(( new Emitter()));
|
|
73
81
|
this.onDidToggleSessionStickiness = this._onDidToggleSessionStickiness.event;
|
|
82
|
+
this._gridRequest = observableValue(this, undefined);
|
|
74
83
|
this._initialRestoreComplete = observableValue(this, false);
|
|
75
84
|
this.initialRestoreComplete = this._initialRestoreComplete;
|
|
76
85
|
this._navigationRequest = observableValue(this, undefined);
|
|
@@ -78,6 +87,7 @@ let SessionsService = class SessionsService extends Disposable {
|
|
|
78
87
|
this._openSessionCts = this._register(( new MutableDisposable()));
|
|
79
88
|
this._restoreCts = this._register(( new MutableDisposable()));
|
|
80
89
|
this._pendingRestoredChatResources = ( new ResourceMap());
|
|
90
|
+
this._pendingExplicitChatOpens = ( new ResourceMap());
|
|
81
91
|
this._sendFollow = this._register(( new MutableDisposable()));
|
|
82
92
|
this._sessionStates = this._loadSessionStates();
|
|
83
93
|
this._visibility = this._register(this.instantiationService.createInstance(
|
|
@@ -97,20 +107,31 @@ let SessionsService = class SessionsService extends Disposable {
|
|
|
97
107
|
this._isNewChatSessionContext = IsNewChatSessionContext.bindTo(this.contextKeyService);
|
|
98
108
|
this._register(this.storageService.onWillSaveState(() => this._saveSessionStates()));
|
|
99
109
|
this._recencyHistory = this._register(( new SessionsRecencyHistory(this.storageService, this.logService)));
|
|
100
|
-
this._navigation = this._register(( new SessionsNavigation(
|
|
101
|
-
this,
|
|
102
|
-
this.
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
110
|
+
this._navigation = this._register(( new SessionsNavigation({
|
|
111
|
+
openSession: (resource, options) => this._openSession(resource, options, "history"),
|
|
112
|
+
openChat: (session, resource) => this._openChatSession(session, resource, {
|
|
113
|
+
source: "navigation"
|
|
114
|
+
}, "history"),
|
|
115
|
+
openNewSession: async () => {
|
|
116
|
+
await this._openNewSession({
|
|
117
|
+
cancelRestore: true
|
|
118
|
+
}, CancellationToken.None, "history");
|
|
119
|
+
}
|
|
120
|
+
}, this.activeSession, this.customViewService, this.sessionsManagementService, this._recencyHistory, this.contextKeyService, this.logService)));
|
|
108
121
|
this._register(
|
|
109
122
|
this.sessionsManagementService.onDidChangeSessions(e => this._navigation.onDidRemoveSessions(e))
|
|
110
123
|
);
|
|
111
124
|
this._register(
|
|
112
|
-
this.sessionsManagementService.onDidDeleteSession(session => this._recencyHistory.remove(
|
|
125
|
+
this.sessionsManagementService.onDidDeleteSession(session => this._recencyHistory.remove(
|
|
126
|
+
entry => entry.kind === "session" && this.uriIdentityService.extUri.isEqual(entry.sessionResource, session.resource)
|
|
127
|
+
))
|
|
113
128
|
);
|
|
129
|
+
this._register(autorun(reader => {
|
|
130
|
+
if (this.customViewService.activeCustomViewOpen.read(reader)) {
|
|
131
|
+
this._openSessionCts.value?.cancel();
|
|
132
|
+
this._recordNavigation();
|
|
133
|
+
}
|
|
134
|
+
}));
|
|
114
135
|
this._register(autorun(reader => {
|
|
115
136
|
const activeSession = this.activeSession.read(reader);
|
|
116
137
|
const newSession = this.sessionsManagementService.newSession.read(reader);
|
|
@@ -125,12 +146,6 @@ let SessionsService = class SessionsService extends Disposable {
|
|
|
125
146
|
reader.store.add(this._activeSessionViewListeners(activeSession));
|
|
126
147
|
}
|
|
127
148
|
}));
|
|
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
149
|
this._register(
|
|
135
150
|
this.sessionsManagementService.onDidChangeSessions(e => this._onDidChangeSessions(e))
|
|
136
151
|
);
|
|
@@ -156,10 +171,10 @@ let SessionsService = class SessionsService extends Disposable {
|
|
|
156
171
|
const visible = this.visibleSessions.read(reader);
|
|
157
172
|
const active = this._visibility.activeSession.read(reader);
|
|
158
173
|
const preserveFocus = this._visibility.activePreserveFocus.read(reader);
|
|
159
|
-
this.
|
|
160
|
-
|
|
161
|
-
if (
|
|
162
|
-
this.
|
|
174
|
+
const request = this._gridRequest.read(reader);
|
|
175
|
+
this.sessionsPartService.updateVisibleSessions(visible, active, this._visibility.getGridSlots(), request);
|
|
176
|
+
if (active !== this._focusedActiveSession) {
|
|
177
|
+
this._focusedActiveSession = active;
|
|
163
178
|
if (!preserveFocus) {
|
|
164
179
|
this.sessionsPartService.focusSession(active);
|
|
165
180
|
}
|
|
@@ -167,13 +182,19 @@ let SessionsService = class SessionsService extends Disposable {
|
|
|
167
182
|
}));
|
|
168
183
|
this._register(this.sessionsPartService.onDidFocusSession(sessionId => {
|
|
169
184
|
const session = this.visibleSessions.get().find(s => s?.sessionId === sessionId);
|
|
170
|
-
if (session) {
|
|
185
|
+
if (sessionId === undefined || session) {
|
|
171
186
|
this.setActive(session);
|
|
172
187
|
}
|
|
173
188
|
}));
|
|
189
|
+
this._register(this.sessionsPartService.onDidInteractWithGrid(() => {
|
|
190
|
+
this._cancelRestore();
|
|
191
|
+
this._startOpenSession();
|
|
192
|
+
}));
|
|
174
193
|
}
|
|
175
194
|
_onDidReplaceSession(from, to) {
|
|
176
|
-
this.
|
|
195
|
+
const sessionView = this.sessionsPartService.getSessionView(from.sessionId);
|
|
196
|
+
const preserveFocus = !sessionView || this.sessionsPartService.getFocusedSessionView() !== sessionView;
|
|
197
|
+
this._visibility.updateSession(from, to, preserveFocus);
|
|
177
198
|
}
|
|
178
199
|
_activeSessionViewListeners(activeSession) {
|
|
179
200
|
const disposables = ( new DisposableStore());
|
|
@@ -260,6 +281,50 @@ let SessionsService = class SessionsService extends Disposable {
|
|
|
260
281
|
});
|
|
261
282
|
}
|
|
262
283
|
}));
|
|
284
|
+
let previousActiveChat;
|
|
285
|
+
let lastReadRequest;
|
|
286
|
+
disposables.add(autorun(reader => {
|
|
287
|
+
const chat = activeSession.activeChat.read(reader);
|
|
288
|
+
const mainChat = activeSession.mainChat.read(reader);
|
|
289
|
+
const activeChatChanged = !chat || !previousActiveChat || !this.uriIdentityService.extUri.isEqual(chat.resource, previousActiveChat);
|
|
290
|
+
previousActiveChat = chat?.resource;
|
|
291
|
+
if (activeChatChanged) {
|
|
292
|
+
lastReadRequest = undefined;
|
|
293
|
+
}
|
|
294
|
+
if (activeSession.loading.read(reader)) {
|
|
295
|
+
lastReadRequest = undefined;
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
if (!chat || chat.isRead.read(reader)) {
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
const pendingExplicitChat = this._pendingExplicitChatOpens.get(activeSession.resource)?.chatResource;
|
|
302
|
+
if (pendingExplicitChat && !this.uriIdentityService.extUri.isEqual(chat.resource, pendingExplicitChat)) {
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
const version = (chat.lastTurnEnd?.read(reader) ?? chat.updatedAt.read(reader))?.getTime();
|
|
306
|
+
if (lastReadRequest && this.uriIdentityService.extUri.isEqual(lastReadRequest.chat, chat.resource) && lastReadRequest.version === version) {
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
const readRequest = {
|
|
310
|
+
chat: chat.resource,
|
|
311
|
+
version
|
|
312
|
+
};
|
|
313
|
+
lastReadRequest = readRequest;
|
|
314
|
+
const accepted = this.uriIdentityService.extUri.isEqual(chat.resource, mainChat.resource) ? this.sessionsManagementService.markRead(activeSession, {
|
|
315
|
+
preserveExplicitUnread: !activeChatChanged
|
|
316
|
+
}) : this.sessionsManagementService.markChatRead(activeSession, chat);
|
|
317
|
+
accepted.then(result => {
|
|
318
|
+
if (result === false && lastReadRequest === readRequest) {
|
|
319
|
+
lastReadRequest = undefined;
|
|
320
|
+
}
|
|
321
|
+
}, error => {
|
|
322
|
+
if (lastReadRequest === readRequest) {
|
|
323
|
+
lastReadRequest = undefined;
|
|
324
|
+
}
|
|
325
|
+
onUnexpectedError(error);
|
|
326
|
+
});
|
|
327
|
+
}));
|
|
263
328
|
return disposables;
|
|
264
329
|
}
|
|
265
330
|
_onDidChangeSessions(e) {
|
|
@@ -316,6 +381,9 @@ let SessionsService = class SessionsService extends Disposable {
|
|
|
316
381
|
if (recent.length >= MAX_RECENTLY_OPENED_SESSIONS) {
|
|
317
382
|
break;
|
|
318
383
|
}
|
|
384
|
+
if (entry.kind !== "session") {
|
|
385
|
+
continue;
|
|
386
|
+
}
|
|
319
387
|
const key = ( entry.sessionResource.toString());
|
|
320
388
|
if (( seen.has(key))) {
|
|
321
389
|
continue;
|
|
@@ -339,11 +407,10 @@ let SessionsService = class SessionsService extends Disposable {
|
|
|
339
407
|
return cts.token;
|
|
340
408
|
}
|
|
341
409
|
_beginNavigation(intent, token = CancellationToken.None, preserveNavigation = false) {
|
|
342
|
-
if (intent
|
|
410
|
+
if (intent !== "automatic") {
|
|
343
411
|
if (!preserveNavigation) {
|
|
344
412
|
this._recordNavigation(token);
|
|
345
413
|
}
|
|
346
|
-
this.customViewService.hideCustomView();
|
|
347
414
|
}
|
|
348
415
|
}
|
|
349
416
|
_recordNavigation(token = CancellationToken.None) {
|
|
@@ -354,9 +421,17 @@ let SessionsService = class SessionsService extends Disposable {
|
|
|
354
421
|
_cancelRestore() {
|
|
355
422
|
this._restoreCts.value?.cancel();
|
|
356
423
|
this._restoreCts.clear();
|
|
424
|
+
this._restoringGridState = undefined;
|
|
357
425
|
}
|
|
358
|
-
_activate(session, preserveFocus) {
|
|
359
|
-
|
|
426
|
+
_activate(session, preserveFocus, intent = "automatic") {
|
|
427
|
+
let active;
|
|
428
|
+
transaction(tx => {
|
|
429
|
+
if (intent !== "automatic") {
|
|
430
|
+
this.customViewService.hideCustomView(tx);
|
|
431
|
+
}
|
|
432
|
+
active = this._visibility.setActive(session, preserveFocus);
|
|
433
|
+
});
|
|
434
|
+
return active;
|
|
360
435
|
}
|
|
361
436
|
openChat(session, chatUri, options) {
|
|
362
437
|
return this._openChatSession(session, chatUri, options, "explicit");
|
|
@@ -366,66 +441,99 @@ let SessionsService = class SessionsService extends Disposable {
|
|
|
366
441
|
this._cancelRestore();
|
|
367
442
|
this._beginNavigation(intent);
|
|
368
443
|
const token = this._startOpenSession();
|
|
369
|
-
const
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
token,
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
444
|
+
const navigation = this._navigation.beginSessionOpen(intent, token);
|
|
445
|
+
try {
|
|
446
|
+
const resolved = await this._resolveSessionForOpen(session, chatUri);
|
|
447
|
+
if (token.isCancellationRequested) {
|
|
448
|
+
return;
|
|
449
|
+
}
|
|
450
|
+
session = resolved.session;
|
|
451
|
+
chatUri = resolved.chatUri ?? chatUri;
|
|
452
|
+
if (options?.source) {
|
|
453
|
+
await this.sessionOpenTelemetryService.withOpenRequest(options.source, token, async telemetryAttempt => {
|
|
454
|
+
this.sessionOpenTelemetryService.sessionResolved(
|
|
455
|
+
telemetryAttempt,
|
|
456
|
+
session.resource,
|
|
457
|
+
session.providerId,
|
|
458
|
+
this.activeSession.get()?.sessionId === session.sessionId,
|
|
459
|
+
session.loading.get()
|
|
460
|
+
);
|
|
461
|
+
await this._openChat(
|
|
462
|
+
session,
|
|
463
|
+
chatUri,
|
|
464
|
+
options.preserveFocus,
|
|
465
|
+
token,
|
|
466
|
+
t0,
|
|
467
|
+
telemetryAttempt,
|
|
468
|
+
intent
|
|
469
|
+
);
|
|
470
|
+
});
|
|
471
|
+
return;
|
|
472
|
+
}
|
|
473
|
+
await this._openChat(session, chatUri, options?.preserveFocus, token, t0, undefined, intent);
|
|
474
|
+
} finally {
|
|
475
|
+
navigation.cancel();
|
|
382
476
|
}
|
|
383
|
-
await this._openChat(session, chatUri, options?.preserveFocus, token, t0);
|
|
384
477
|
}
|
|
385
|
-
async _openChat(
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
)
|
|
402
|
-
|
|
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);
|
|
478
|
+
async _openChat(
|
|
479
|
+
session,
|
|
480
|
+
chatUri,
|
|
481
|
+
preserveFocus,
|
|
482
|
+
token,
|
|
483
|
+
startTime,
|
|
484
|
+
telemetryAttempt,
|
|
485
|
+
intent = "explicit"
|
|
486
|
+
) {
|
|
487
|
+
const pendingOpen = {
|
|
488
|
+
chatResource: chatUri,
|
|
489
|
+
token
|
|
490
|
+
};
|
|
491
|
+
this._pendingExplicitChatOpens.set(session.resource, pendingOpen);
|
|
492
|
+
const navigation = this._navigation.beginSessionOpen(intent, token);
|
|
493
|
+
try {
|
|
494
|
+
if (telemetryAttempt) {
|
|
495
|
+
this.sessionOpenTelemetryService.sessionActivated(telemetryAttempt, chatUri);
|
|
412
496
|
}
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
if (
|
|
416
|
-
this.
|
|
497
|
+
this.logService.trace(`[SessionsView] openChat start uri=${( chatUri.toString())} provider=${session.providerId}`);
|
|
498
|
+
this._activate(session, preserveFocus, intent);
|
|
499
|
+
if (!(await this._waitForSessionToLoad(session, token))) {
|
|
500
|
+
this.logService.trace(
|
|
501
|
+
`[SessionsView] openChat cancelled while waiting for session to load uri=${( chatUri.toString())}`
|
|
502
|
+
);
|
|
503
|
+
return;
|
|
504
|
+
}
|
|
505
|
+
let chat;
|
|
506
|
+
const activeSession = this._visibility.activeSession.get();
|
|
507
|
+
if (activeSession) {
|
|
508
|
+
chat = activeSession.chats.get().find(c => this.uriIdentityService.extUri.isEqual(c.resource, chatUri));
|
|
509
|
+
if (chat) {
|
|
510
|
+
this._visibility.openChat(session, chat);
|
|
511
|
+
this._visibility.setActiveChat(session, chat);
|
|
512
|
+
this._setChatVisibilityState(session, chat, true);
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
navigation.complete();
|
|
516
|
+
if (telemetryAttempt) {
|
|
517
|
+
if (chat) {
|
|
518
|
+
this.sessionOpenTelemetryService.sessionActivated(telemetryAttempt, chat.resource);
|
|
519
|
+
}
|
|
520
|
+
this.sessionOpenTelemetryService.sessionLoaded(telemetryAttempt);
|
|
521
|
+
}
|
|
522
|
+
if (chat && chat.status.get() === SessionStatus.Untitled) {
|
|
523
|
+
this.logService.trace(
|
|
524
|
+
`[SessionsView] openChat done total=${Date.now() - startTime}ms uri=${( chatUri.toString())} path=untitled`
|
|
525
|
+
);
|
|
526
|
+
return;
|
|
417
527
|
}
|
|
418
|
-
this.sessionOpenTelemetryService.sessionLoaded(telemetryAttempt);
|
|
419
|
-
}
|
|
420
|
-
if (chat && chat.status.get() === SessionStatus.Untitled) {
|
|
421
528
|
this.logService.trace(
|
|
422
|
-
`[SessionsView] openChat done total=${Date.now() - startTime}ms uri=${( chatUri.toString())}
|
|
529
|
+
`[SessionsView] openChat done total=${Date.now() - startTime}ms uri=${( chatUri.toString())}`
|
|
423
530
|
);
|
|
424
|
-
|
|
531
|
+
} finally {
|
|
532
|
+
if (this._pendingExplicitChatOpens.get(session.resource) === pendingOpen) {
|
|
533
|
+
this._pendingExplicitChatOpens.delete(session.resource);
|
|
534
|
+
}
|
|
535
|
+
navigation.cancel();
|
|
425
536
|
}
|
|
426
|
-
this.logService.trace(
|
|
427
|
-
`[SessionsView] openChat done total=${Date.now() - startTime}ms uri=${( chatUri.toString())}`
|
|
428
|
-
);
|
|
429
537
|
}
|
|
430
538
|
async closeChat(session, chat, options) {
|
|
431
539
|
this._visibility.closeChat(session, chat);
|
|
@@ -435,6 +543,8 @@ let SessionsService = class SessionsService extends Disposable {
|
|
|
435
543
|
}
|
|
436
544
|
}
|
|
437
545
|
reopenLastClosedItem() {
|
|
546
|
+
this._cancelRestore();
|
|
547
|
+
this._startOpenSession();
|
|
438
548
|
return this._closedItems.reopenLast();
|
|
439
549
|
}
|
|
440
550
|
_setChatVisibilityState(session, chat, visible) {
|
|
@@ -462,12 +572,12 @@ let SessionsService = class SessionsService extends Disposable {
|
|
|
462
572
|
openedChatResources: openedChatResources.size ? [...openedChatResources] : undefined
|
|
463
573
|
});
|
|
464
574
|
}
|
|
465
|
-
_applyActiveChatSelection(session,
|
|
466
|
-
if (!restoreOnlySideOrToolChat) {
|
|
575
|
+
_applyActiveChatSelection(session, options) {
|
|
576
|
+
if (!options?.forceMainChat && !options?.restoreOnlySideOrToolChat) {
|
|
467
577
|
return;
|
|
468
578
|
}
|
|
469
579
|
const state = this._sessionStates.get(session.resource);
|
|
470
|
-
if (state?.activeChatOrigin === ChatOriginKind.SideChat || state?.activeChatOrigin === ChatOriginKind.Tool) {
|
|
580
|
+
if (!options.forceMainChat && (state?.activeChatOrigin === ChatOriginKind.SideChat || state?.activeChatOrigin === ChatOriginKind.Tool)) {
|
|
471
581
|
return;
|
|
472
582
|
}
|
|
473
583
|
const mainChat = session.mainChat.get();
|
|
@@ -487,27 +597,35 @@ let SessionsService = class SessionsService extends Disposable {
|
|
|
487
597
|
this._cancelRestore();
|
|
488
598
|
this._beginNavigation(intent);
|
|
489
599
|
const token = this._startOpenSession();
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
600
|
+
const navigation = this._navigation.beginSessionOpen(intent, token);
|
|
601
|
+
try {
|
|
602
|
+
await this.sessionOpenTelemetryService.withOpenRequest(options?.source ?? "unknown", token, async telemetryAttempt => {
|
|
603
|
+
const resolved = await this.sessionsManagementService.resolveSessionResource(sessionResource, "open");
|
|
604
|
+
if (token.isCancellationRequested) {
|
|
605
|
+
return;
|
|
606
|
+
}
|
|
607
|
+
const sessionData = this._getSession(resolved);
|
|
608
|
+
this._applyActiveChatSelection(sessionData, options);
|
|
609
|
+
this.sessionOpenTelemetryService.sessionResolved(
|
|
610
|
+
telemetryAttempt,
|
|
611
|
+
sessionData.resource,
|
|
612
|
+
sessionData.providerId,
|
|
613
|
+
this.activeSession.get()?.sessionId === sessionData.sessionId,
|
|
614
|
+
sessionData.loading.get()
|
|
615
|
+
);
|
|
616
|
+
this._showSession(sessionData, options, intent);
|
|
617
|
+
if (intent !== "history") {
|
|
618
|
+
navigation.complete();
|
|
619
|
+
}
|
|
620
|
+
await this.sessionsProvidersService.getProvider(sessionData.providerId)?.prepareSessionForOpen?.(sessionData, "open");
|
|
621
|
+
if (token.isCancellationRequested) {
|
|
622
|
+
return;
|
|
623
|
+
}
|
|
624
|
+
await this._waitForOpenSessionToLoad(sessionData, token, telemetryAttempt);
|
|
625
|
+
});
|
|
626
|
+
} finally {
|
|
627
|
+
navigation.cancel();
|
|
628
|
+
}
|
|
511
629
|
}
|
|
512
630
|
showSession(sessionResource, options) {
|
|
513
631
|
this._cancelRestore();
|
|
@@ -533,7 +651,7 @@ let SessionsService = class SessionsService extends Disposable {
|
|
|
533
651
|
const trusted = await this.workspaceTrustRequestService.requestResourcesTrust({
|
|
534
652
|
uri: folder,
|
|
535
653
|
message: ( localize(
|
|
536
|
-
|
|
654
|
+
6342,
|
|
537
655
|
"An agent session will be able to read files, run commands, and make changes in this folder."
|
|
538
656
|
))
|
|
539
657
|
});
|
|
@@ -544,8 +662,11 @@ let SessionsService = class SessionsService extends Disposable {
|
|
|
544
662
|
return true;
|
|
545
663
|
}
|
|
546
664
|
async openSessionToSide(session, options) {
|
|
665
|
+
const referenceWasVisible = options?.referenceSessionId !== undefined && !!this._visibility.getSlot(options.referenceSessionId);
|
|
666
|
+
this._cancelRestore();
|
|
547
667
|
this._beginNavigation("explicit");
|
|
548
668
|
const token = this._startOpenSession();
|
|
669
|
+
session = this.sessionsManagementService.getSession(session.resource) ?? session;
|
|
549
670
|
const resolved = await this._resolveSessionForOpen(session, options?.chatResource);
|
|
550
671
|
if (token.isCancellationRequested) {
|
|
551
672
|
return;
|
|
@@ -557,33 +678,241 @@ let SessionsService = class SessionsService extends Disposable {
|
|
|
557
678
|
chatResource: resolved.chatUri
|
|
558
679
|
};
|
|
559
680
|
}
|
|
681
|
+
if (!this.areGridSessionsCurrent([session]) || !(await this.canOpenSession(session)) || token.isCancellationRequested || !this.areGridSessionsCurrent([session])) {
|
|
682
|
+
return;
|
|
683
|
+
}
|
|
684
|
+
await this.sessionsProvidersService.getProvider(session.providerId)?.prepareSessionForOpen?.(session, "open");
|
|
685
|
+
if (token.isCancellationRequested || !this.areGridSessionsCurrent([session])) {
|
|
686
|
+
return;
|
|
687
|
+
}
|
|
560
688
|
const visible = this.visibleSessions.get();
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
preserveFocus: options.preserveFocus,
|
|
568
|
-
source: options.source
|
|
689
|
+
if (referenceWasVisible && !this._visibility.getSlot(options?.referenceSessionId)) {
|
|
690
|
+
return;
|
|
691
|
+
}
|
|
692
|
+
if (options?.forceMainChat && !options.chatResource && ( visible.some(candidate => candidate?.sessionId === session.sessionId))) {
|
|
693
|
+
await this.openChatToSide(session, session.mainChat.get().resource, {
|
|
694
|
+
preserveFocus: options.preserveFocus
|
|
569
695
|
});
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
696
|
+
return;
|
|
697
|
+
}
|
|
698
|
+
const reference = visible.find(candidate => candidate?.sessionId === options?.referenceSessionId) ?? visible[visible.length - 1];
|
|
699
|
+
const navigation = this._navigation.beginSessionOpen("explicit", token);
|
|
700
|
+
try {
|
|
701
|
+
await this.sessionOpenTelemetryService.withOpenRequest(options?.source ?? "unknown", token, async attempt => {
|
|
702
|
+
if (token.isCancellationRequested || !this.areGridSessionsCurrent([session])) {
|
|
703
|
+
return;
|
|
704
|
+
}
|
|
705
|
+
this.sessionOpenTelemetryService.sessionResolved(
|
|
706
|
+
attempt,
|
|
707
|
+
session.resource,
|
|
708
|
+
session.providerId,
|
|
709
|
+
this.activeSession.get()?.sessionId === session.sessionId,
|
|
710
|
+
session.loading.get()
|
|
711
|
+
);
|
|
712
|
+
transaction(() => {
|
|
713
|
+
if (reference && reference.sessionId !== session.sessionId) {
|
|
714
|
+
this._visibility.insertAt(session, reference.sessionId, "right", false);
|
|
715
|
+
}
|
|
716
|
+
this._applyActiveChatSelection(session, options);
|
|
717
|
+
this._showSession(session, options);
|
|
718
|
+
});
|
|
719
|
+
if (options?.chatResource) {
|
|
720
|
+
await this._openChat(
|
|
721
|
+
session,
|
|
722
|
+
options.chatResource,
|
|
723
|
+
options.preserveFocus,
|
|
724
|
+
token,
|
|
725
|
+
Date.now(),
|
|
726
|
+
attempt
|
|
727
|
+
);
|
|
728
|
+
} else {
|
|
729
|
+
navigation.complete();
|
|
730
|
+
await this._waitForOpenSessionToLoad(session, token, attempt);
|
|
731
|
+
}
|
|
575
732
|
});
|
|
733
|
+
} finally {
|
|
734
|
+
navigation.cancel();
|
|
576
735
|
}
|
|
577
736
|
}
|
|
578
|
-
async
|
|
737
|
+
async prepareGridSessions(sessions, token) {
|
|
738
|
+
const result = [];
|
|
739
|
+
const ids = ( new Set());
|
|
740
|
+
const candidates = sessions.map(
|
|
741
|
+
candidate => this.sessionsManagementService.getSession(candidate.resource) ?? candidate
|
|
742
|
+
);
|
|
743
|
+
for (const candidate of candidates) {
|
|
744
|
+
const {
|
|
745
|
+
session
|
|
746
|
+
} = await this._resolveSessionForOpen(candidate, undefined);
|
|
747
|
+
if (token.isCancellationRequested || !this.areGridSessionsCurrent([session])) {
|
|
748
|
+
return undefined;
|
|
749
|
+
}
|
|
750
|
+
if (( ids.has(session.sessionId))) {
|
|
751
|
+
continue;
|
|
752
|
+
}
|
|
753
|
+
if (!this._visibility.getSlot(session.sessionId)) {
|
|
754
|
+
if (!(await this.canOpenSession(session)) || token.isCancellationRequested || !this.areGridSessionsCurrent([session])) {
|
|
755
|
+
return undefined;
|
|
756
|
+
}
|
|
757
|
+
await this.sessionsProvidersService.getProvider(session.providerId)?.prepareSessionForOpen?.(session, "open");
|
|
758
|
+
if (token.isCancellationRequested) {
|
|
759
|
+
return undefined;
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
ids.add(session.sessionId);
|
|
763
|
+
result.push(session);
|
|
764
|
+
}
|
|
765
|
+
return result;
|
|
766
|
+
}
|
|
767
|
+
areGridSessionsCurrent(sessions) {
|
|
768
|
+
if (( sessions.some(
|
|
769
|
+
session => this.sessionsManagementService.getSession(session.resource) !== session
|
|
770
|
+
))) {
|
|
771
|
+
this.logService.trace(
|
|
772
|
+
"[SessionsView] Cancelled grid opening because a candidate was removed or replaced"
|
|
773
|
+
);
|
|
774
|
+
return false;
|
|
775
|
+
}
|
|
776
|
+
return true;
|
|
777
|
+
}
|
|
778
|
+
async openSessionsAt(sessions, referenceSessionId, direction, options) {
|
|
779
|
+
this._cancelRestore();
|
|
579
780
|
this._beginNavigation("explicit");
|
|
580
781
|
const token = this._startOpenSession();
|
|
581
|
-
const
|
|
582
|
-
if (token.isCancellationRequested) {
|
|
782
|
+
const prepared = await this.prepareGridSessions(sessions, token);
|
|
783
|
+
if (!prepared || token.isCancellationRequested || !this._visibility.getSlot(referenceSessionId) || !this.areGridSessionsCurrent(prepared)) {
|
|
583
784
|
return;
|
|
584
785
|
}
|
|
585
|
-
|
|
586
|
-
|
|
786
|
+
const primary = options?.activate === "last" ? prepared.at(-1) : prepared[0];
|
|
787
|
+
if (!primary) {
|
|
788
|
+
return;
|
|
789
|
+
}
|
|
790
|
+
const splitMainChat = options?.activate !== false && options?.forceMainChat && !!this._visibility.getSlot(primary.sessionId);
|
|
791
|
+
const entries = prepared.filter(
|
|
792
|
+
session => session.sessionId !== referenceSessionId && (!splitMainChat || session !== primary)
|
|
793
|
+
);
|
|
794
|
+
const open = async attempt => {
|
|
795
|
+
if (token.isCancellationRequested || !this.areGridSessionsCurrent(prepared)) {
|
|
796
|
+
return;
|
|
797
|
+
}
|
|
798
|
+
if (attempt) {
|
|
799
|
+
this.sessionOpenTelemetryService.sessionResolved(
|
|
800
|
+
attempt,
|
|
801
|
+
primary.resource,
|
|
802
|
+
primary.providerId,
|
|
803
|
+
this.activeSession.get()?.sessionId === primary.sessionId,
|
|
804
|
+
primary.loading.get()
|
|
805
|
+
);
|
|
806
|
+
}
|
|
807
|
+
const navigation = splitMainChat ? this._navigation.beginSessionOpen("explicit", token) : undefined;
|
|
808
|
+
try {
|
|
809
|
+
transaction(tx => {
|
|
810
|
+
this.customViewService.hideCustomView(tx);
|
|
811
|
+
const ordered = direction === "right" || direction === "down" ? [...entries].reverse() : entries;
|
|
812
|
+
for (const session of ordered) {
|
|
813
|
+
this._visibility.insertAt(session, referenceSessionId, direction, false);
|
|
814
|
+
}
|
|
815
|
+
if (options?.activate !== false) {
|
|
816
|
+
if (!splitMainChat) {
|
|
817
|
+
this._applyActiveChatSelection(primary, options);
|
|
818
|
+
}
|
|
819
|
+
this._showSession(primary, options);
|
|
820
|
+
}
|
|
821
|
+
});
|
|
822
|
+
if (splitMainChat) {
|
|
823
|
+
await this._showChatToSide(primary, primary.mainChat.get().resource, options);
|
|
824
|
+
if (token.isCancellationRequested) {
|
|
825
|
+
return;
|
|
826
|
+
}
|
|
827
|
+
navigation?.complete();
|
|
828
|
+
}
|
|
829
|
+
if (options?.activate !== false && !options?.preserveFocus) {
|
|
830
|
+
this.sessionsPartService.focusSession(this.activeSession.get());
|
|
831
|
+
}
|
|
832
|
+
if (attempt) {
|
|
833
|
+
await this._waitForOpenSessionToLoad(primary, token, attempt);
|
|
834
|
+
}
|
|
835
|
+
} finally {
|
|
836
|
+
navigation?.cancel();
|
|
837
|
+
}
|
|
838
|
+
};
|
|
839
|
+
if (options?.source && options.activate !== false) {
|
|
840
|
+
await this.sessionOpenTelemetryService.withOpenRequest(options.source, token, open);
|
|
841
|
+
} else {
|
|
842
|
+
await open();
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
async openSessionsInGrid(sessions) {
|
|
846
|
+
this._cancelRestore();
|
|
847
|
+
this._beginNavigation("explicit");
|
|
848
|
+
const token = this._startOpenSession();
|
|
849
|
+
const prepared = await this.prepareGridSessions(sessions, token);
|
|
850
|
+
if (!prepared || token.isCancellationRequested || !prepared.length || !this.areGridSessionsCurrent(prepared)) {
|
|
851
|
+
return;
|
|
852
|
+
}
|
|
853
|
+
const active = this.activeSession.get();
|
|
854
|
+
const slots = prepared.map(session => ({
|
|
855
|
+
session,
|
|
856
|
+
sticky: this._visibility.getSlot(session.sessionId)?.sticky ?? false
|
|
857
|
+
}));
|
|
858
|
+
transaction(tx => {
|
|
859
|
+
this.customViewService.hideCustomView(tx);
|
|
860
|
+
this._visibility.restoreGrid(
|
|
861
|
+
slots,
|
|
862
|
+
Math.max(0, prepared.findIndex(session => session.sessionId === active?.sessionId))
|
|
863
|
+
);
|
|
864
|
+
this._gridRequest.set({
|
|
865
|
+
type: "arrange"
|
|
866
|
+
}, tx);
|
|
867
|
+
});
|
|
868
|
+
}
|
|
869
|
+
arrangeSessions() {
|
|
870
|
+
this._cancelRestore();
|
|
871
|
+
this._startOpenSession();
|
|
872
|
+
this._gridRequest.set({
|
|
873
|
+
type: "arrange"
|
|
874
|
+
}, undefined);
|
|
875
|
+
}
|
|
876
|
+
focusSessionInDirection(session, direction) {
|
|
877
|
+
this._cancelRestore();
|
|
878
|
+
this._startOpenSession();
|
|
879
|
+
const neighbor = this.sessionsPartService.getNeighborSession(session?.sessionId, direction);
|
|
880
|
+
if (neighbor !== undefined) {
|
|
881
|
+
this.setActive(neighbor ?? undefined);
|
|
882
|
+
this.sessionsPartService.focusSession(neighbor ?? undefined);
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
moveSessionInDirection(session, direction) {
|
|
886
|
+
this._cancelRestore();
|
|
887
|
+
this._startOpenSession();
|
|
888
|
+
const neighbor = this.sessionsPartService.getNeighborSession(session?.sessionId, direction);
|
|
889
|
+
if (neighbor !== undefined) {
|
|
890
|
+
this.insertAt(session, neighbor?.sessionId, toSessionGridDirection(direction));
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
resizeSession(session, direction) {
|
|
894
|
+
this._cancelRestore();
|
|
895
|
+
this._startOpenSession();
|
|
896
|
+
this.sessionsPartService.resizeSession(session?.sessionId, direction, 40);
|
|
897
|
+
}
|
|
898
|
+
async openChatToSide(session, chatResource, options) {
|
|
899
|
+
this._beginNavigation("explicit");
|
|
900
|
+
const token = this._startOpenSession();
|
|
901
|
+
const navigation = this._navigation.beginSessionOpen("explicit", token);
|
|
902
|
+
try {
|
|
903
|
+
const resolved = await this._resolveSessionForOpen(session, chatResource);
|
|
904
|
+
if (token.isCancellationRequested) {
|
|
905
|
+
return;
|
|
906
|
+
}
|
|
907
|
+
session = resolved.session;
|
|
908
|
+
chatResource = resolved.chatUri ?? chatResource;
|
|
909
|
+
await this._showChatToSide(session, chatResource, options);
|
|
910
|
+
navigation.complete();
|
|
911
|
+
} finally {
|
|
912
|
+
navigation.cancel();
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
async _showChatToSide(session, chatResource, options) {
|
|
587
916
|
this._showSession(this._getSession(session.resource), options);
|
|
588
917
|
const sessionView = this.sessionsPartService.getSessionView(session.sessionId);
|
|
589
918
|
if (!sessionView) {
|
|
@@ -591,7 +920,7 @@ let SessionsService = class SessionsService extends Disposable {
|
|
|
591
920
|
`Unable to open chat to the side because session view '${session.sessionId}' is not mounted`
|
|
592
921
|
));
|
|
593
922
|
}
|
|
594
|
-
await sessionView.openChatToSide(chatResource);
|
|
923
|
+
await sessionView.openChatToSide(chatResource, options?.referenceChatResource);
|
|
595
924
|
}
|
|
596
925
|
async _resolveSessionForOpen(session, chatUri) {
|
|
597
926
|
const resolved = await this.sessionsManagementService.resolveSessionResource(session.resource, "open");
|
|
@@ -621,10 +950,10 @@ let SessionsService = class SessionsService extends Disposable {
|
|
|
621
950
|
}
|
|
622
951
|
return sessionData;
|
|
623
952
|
}
|
|
624
|
-
_showSession(sessionData, options) {
|
|
953
|
+
_showSession(sessionData, options, intent = "explicit") {
|
|
625
954
|
const t0 = Date.now();
|
|
626
955
|
this.logService.trace(`[SessionsView] openSession start uri=${( sessionData.resource.toString())} provider=${sessionData.providerId}`);
|
|
627
|
-
this._activate(sessionData, options?.preserveFocus);
|
|
956
|
+
this._activate(sessionData, options?.preserveFocus, intent);
|
|
628
957
|
this.logService.trace(
|
|
629
958
|
`[SessionsView] showSession done total=${Date.now() - t0}ms uri=${( sessionData.resource.toString())}`
|
|
630
959
|
);
|
|
@@ -665,7 +994,7 @@ let SessionsService = class SessionsService extends Disposable {
|
|
|
665
994
|
const trusted = await this.workspaceTrustRequestService.requestResourcesTrust({
|
|
666
995
|
uri: folderUri,
|
|
667
996
|
message: ( localize(
|
|
668
|
-
|
|
997
|
+
6342,
|
|
669
998
|
"An agent session will be able to read files, run commands, and make changes in this folder."
|
|
670
999
|
))
|
|
671
1000
|
});
|
|
@@ -692,7 +1021,29 @@ let SessionsService = class SessionsService extends Disposable {
|
|
|
692
1021
|
this._startOpenSession();
|
|
693
1022
|
try {
|
|
694
1023
|
const session = this.sessionsManagementService.createNewSession(folderUri, options);
|
|
695
|
-
|
|
1024
|
+
if (options?.requireDevContainer) {
|
|
1025
|
+
const provider = this.sessionsProvidersService.getProvider(session.providerId);
|
|
1026
|
+
if (!provider || !isAgentHostProvider(provider) || !provider.preferDevContainer) {
|
|
1027
|
+
this.sessionsManagementService.discardNewSession(session);
|
|
1028
|
+
throw ( new Error(
|
|
1029
|
+
`Session provider '${session.providerId}' does not support Dev Container drafts.`
|
|
1030
|
+
));
|
|
1031
|
+
}
|
|
1032
|
+
try {
|
|
1033
|
+
provider.preferDevContainer(session.sessionId, {
|
|
1034
|
+
required: true
|
|
1035
|
+
});
|
|
1036
|
+
} catch (error) {
|
|
1037
|
+
this.sessionsManagementService.discardNewSession(session);
|
|
1038
|
+
throw error;
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
this._activateOrInsert(session, options?.toSide, intent);
|
|
1042
|
+
if (intent === "explicit" && !options?.preserveNavigation) {
|
|
1043
|
+
this._navigation.recordOpened({
|
|
1044
|
+
kind: "newSession"
|
|
1045
|
+
});
|
|
1046
|
+
}
|
|
696
1047
|
return {
|
|
697
1048
|
session,
|
|
698
1049
|
trustDeclined: false
|
|
@@ -707,6 +1058,17 @@ let SessionsService = class SessionsService extends Disposable {
|
|
|
707
1058
|
this._beginNavigation(intent, token, options?.preserveNavigation);
|
|
708
1059
|
}
|
|
709
1060
|
if (this._visibility.activeSession.get() === undefined && !options?.toSide) {
|
|
1061
|
+
if (intent !== "automatic") {
|
|
1062
|
+
if (!folderUri && !options?.preserveNavigation) {
|
|
1063
|
+
this._startOpenSession();
|
|
1064
|
+
}
|
|
1065
|
+
this.customViewService.hideCustomView();
|
|
1066
|
+
}
|
|
1067
|
+
if (intent === "explicit" && !options?.preserveNavigation) {
|
|
1068
|
+
this._navigation.recordOpened({
|
|
1069
|
+
kind: "newSession"
|
|
1070
|
+
});
|
|
1071
|
+
}
|
|
710
1072
|
return {
|
|
711
1073
|
session: undefined,
|
|
712
1074
|
trustDeclined: false
|
|
@@ -718,34 +1080,44 @@ let SessionsService = class SessionsService extends Disposable {
|
|
|
718
1080
|
const newSession = this.sessionsManagementService.newSession.get();
|
|
719
1081
|
const activeSession = this._visibility.activeSession.get();
|
|
720
1082
|
const targetSession = options?.toSide && newSession?.sessionId === activeSession?.sessionId ? undefined : newSession;
|
|
721
|
-
this._activateOrInsert(targetSession, options?.toSide);
|
|
1083
|
+
this._activateOrInsert(targetSession, options?.toSide, intent);
|
|
1084
|
+
if (intent === "explicit" && !options?.preserveNavigation) {
|
|
1085
|
+
this._navigation.recordOpened({
|
|
1086
|
+
kind: "newSession"
|
|
1087
|
+
});
|
|
1088
|
+
}
|
|
722
1089
|
return {
|
|
723
1090
|
session: targetSession,
|
|
724
1091
|
trustDeclined: false
|
|
725
1092
|
};
|
|
726
1093
|
}
|
|
727
|
-
_activateOrInsert(session, toSide) {
|
|
1094
|
+
_activateOrInsert(session, toSide, intent) {
|
|
728
1095
|
const activeSessionId = this._visibility.activeSession.get()?.sessionId;
|
|
729
1096
|
const sessionId = session?.sessionId;
|
|
730
1097
|
if (toSide && activeSessionId !== sessionId) {
|
|
731
1098
|
const visible = this.visibleSessions.get();
|
|
732
1099
|
const anchorId = activeSessionId ?? visible[visible.length - 1]?.sessionId;
|
|
733
1100
|
if (anchorId && anchorId !== sessionId) {
|
|
734
|
-
|
|
1101
|
+
transaction(tx => {
|
|
1102
|
+
if (intent !== "automatic") {
|
|
1103
|
+
this.customViewService.hideCustomView(tx);
|
|
1104
|
+
}
|
|
1105
|
+
this.insertAt(session, anchorId, "right", true);
|
|
1106
|
+
});
|
|
735
1107
|
return;
|
|
736
1108
|
}
|
|
737
1109
|
}
|
|
738
|
-
this._activate(session);
|
|
1110
|
+
this._activate(session, undefined, intent);
|
|
739
1111
|
}
|
|
740
|
-
openQuickChat(options) {
|
|
741
|
-
return this._openQuickChat(options, "explicit");
|
|
1112
|
+
openQuickChat(options, preserveNavigation = false) {
|
|
1113
|
+
return this._openQuickChat(options, preserveNavigation ? "automatic" : "explicit");
|
|
742
1114
|
}
|
|
743
1115
|
_openQuickChat(options, intent) {
|
|
744
1116
|
this._beginNavigation(intent);
|
|
745
1117
|
this._startOpenSession();
|
|
746
1118
|
try {
|
|
747
1119
|
const session = this.sessionsManagementService.createQuickChat(options);
|
|
748
|
-
return this._activate(session);
|
|
1120
|
+
return this._activate(session, undefined, intent);
|
|
749
1121
|
} catch (e) {
|
|
750
1122
|
this.logService.trace(`[SessionsView] openQuickChat: createQuickChat failed: ${e}`);
|
|
751
1123
|
return undefined;
|
|
@@ -754,16 +1126,24 @@ let SessionsService = class SessionsService extends Disposable {
|
|
|
754
1126
|
async openNewChatInSession(session, options) {
|
|
755
1127
|
this._cancelRestore();
|
|
756
1128
|
this._beginNavigation("explicit");
|
|
757
|
-
this._startOpenSession();
|
|
1129
|
+
const token = this._startOpenSession();
|
|
758
1130
|
const chat = await this.sessionsManagementService.createNewChatInSession(session, options);
|
|
759
|
-
if (!chat) {
|
|
1131
|
+
if (!chat || token.isCancellationRequested) {
|
|
760
1132
|
return;
|
|
761
1133
|
}
|
|
762
|
-
this.
|
|
763
|
-
|
|
1134
|
+
const navigation = this._navigation.beginSessionOpen("explicit", token);
|
|
1135
|
+
try {
|
|
1136
|
+
this._activate(session, undefined, "explicit");
|
|
1137
|
+
this._visibility.setActiveChat(session, chat);
|
|
1138
|
+
navigation.complete();
|
|
1139
|
+
} finally {
|
|
1140
|
+
navigation.cancel();
|
|
1141
|
+
}
|
|
764
1142
|
}
|
|
765
1143
|
setActive(session) {
|
|
766
1144
|
if (session?.sessionId !== this.activeSession.get()?.sessionId) {
|
|
1145
|
+
this._cancelRestore();
|
|
1146
|
+
this._startOpenSession();
|
|
767
1147
|
this._recordNavigation();
|
|
768
1148
|
}
|
|
769
1149
|
this._activate(session);
|
|
@@ -783,6 +1163,8 @@ let SessionsService = class SessionsService extends Disposable {
|
|
|
783
1163
|
return this.sessionsPartService.getSessionView(activeSession?.sessionId)?.submitInput() ?? false;
|
|
784
1164
|
}
|
|
785
1165
|
toggleSessionStickiness(session) {
|
|
1166
|
+
this._cancelRestore();
|
|
1167
|
+
this._startOpenSession();
|
|
786
1168
|
const sticky = this._visibility.toggleStickiness(session);
|
|
787
1169
|
this._onDidToggleSessionStickiness.fire({
|
|
788
1170
|
session,
|
|
@@ -790,9 +1172,13 @@ let SessionsService = class SessionsService extends Disposable {
|
|
|
790
1172
|
});
|
|
791
1173
|
}
|
|
792
1174
|
insertAt(session, targetSessionId, side, activate = true) {
|
|
1175
|
+
this._cancelRestore();
|
|
1176
|
+
this._startOpenSession();
|
|
793
1177
|
this._visibility.insertAt(session, targetSessionId, side, activate);
|
|
794
1178
|
}
|
|
795
1179
|
closeSession(session) {
|
|
1180
|
+
this._cancelRestore();
|
|
1181
|
+
this._startOpenSession();
|
|
796
1182
|
const sessionId = session?.sessionId;
|
|
797
1183
|
const visible = this._visibility.visibleSessions.get();
|
|
798
1184
|
if (!( visible.some(s => s?.sessionId === sessionId))) {
|
|
@@ -814,6 +1200,8 @@ let SessionsService = class SessionsService extends Disposable {
|
|
|
814
1200
|
}
|
|
815
1201
|
}
|
|
816
1202
|
closeAllSessions() {
|
|
1203
|
+
this._cancelRestore();
|
|
1204
|
+
this._startOpenSession();
|
|
817
1205
|
const ids = this._visibility.visibleSessions.get().filter(s => !!s).map(s => s.sessionId);
|
|
818
1206
|
if (ids.length === 0) {
|
|
819
1207
|
return;
|
|
@@ -823,7 +1211,7 @@ let SessionsService = class SessionsService extends Disposable {
|
|
|
823
1211
|
}
|
|
824
1212
|
_restoreInitialChat(session) {
|
|
825
1213
|
const chats = session.chats.get();
|
|
826
|
-
let initialChat = chats[0];
|
|
1214
|
+
let initialChat = chats[0] ?? session.mainChat.get();
|
|
827
1215
|
const sessionState = this._sessionStates.get(session.resource);
|
|
828
1216
|
if (sessionState?.activeChatResource) {
|
|
829
1217
|
try {
|
|
@@ -913,6 +1301,70 @@ let SessionsService = class SessionsService extends Disposable {
|
|
|
913
1301
|
StorageScope.WORKSPACE,
|
|
914
1302
|
StorageTarget.MACHINE
|
|
915
1303
|
);
|
|
1304
|
+
if (this._restoringGridState) {
|
|
1305
|
+
this.storageService.store(
|
|
1306
|
+
SESSION_GRID_STATE_KEY,
|
|
1307
|
+
JSON.stringify(this._restoringGridState),
|
|
1308
|
+
StorageScope.WORKSPACE,
|
|
1309
|
+
StorageTarget.MACHINE
|
|
1310
|
+
);
|
|
1311
|
+
return;
|
|
1312
|
+
}
|
|
1313
|
+
const grid = this.sessionsPartService.getGridLayout();
|
|
1314
|
+
if (grid) {
|
|
1315
|
+
const visible = this.visibleSessions.get();
|
|
1316
|
+
const slots = this._visibility.getGridSlots();
|
|
1317
|
+
const activeId = this.activeSession.get()?.sessionId;
|
|
1318
|
+
const activeIndex = Math.max(0, visible.findIndex(session => session?.sessionId === activeId));
|
|
1319
|
+
const composerIndex = !visible[activeIndex]?.isCreated.get() ? activeIndex : visible.findIndex(session => !session?.isCreated.get());
|
|
1320
|
+
const bindings = [];
|
|
1321
|
+
for (let index = 0; index < slots.length; index++) {
|
|
1322
|
+
const session = visible[index];
|
|
1323
|
+
const resource = session?.isCreated.get() ? ( session.resource.toString()) : undefined;
|
|
1324
|
+
if (!resource && index !== composerIndex) {
|
|
1325
|
+
continue;
|
|
1326
|
+
}
|
|
1327
|
+
bindings.push({
|
|
1328
|
+
id: slots[index].id,
|
|
1329
|
+
resource,
|
|
1330
|
+
sticky: resource ? session.sticky.get() : false
|
|
1331
|
+
});
|
|
1332
|
+
}
|
|
1333
|
+
const projected = projectSessionGrid(grid, id => ( bindings.some(binding => binding.id === id)) ? id : undefined);
|
|
1334
|
+
const active = slots[activeIndex].id;
|
|
1335
|
+
if (projected) {
|
|
1336
|
+
const state = {
|
|
1337
|
+
version: 1,
|
|
1338
|
+
grid: projected,
|
|
1339
|
+
sessions: bindings,
|
|
1340
|
+
active: ( bindings.some(binding => binding.id === active)) ? active : bindings[0].id
|
|
1341
|
+
};
|
|
1342
|
+
this.storageService.store(
|
|
1343
|
+
SESSION_GRID_STATE_KEY,
|
|
1344
|
+
JSON.stringify(state),
|
|
1345
|
+
StorageScope.WORKSPACE,
|
|
1346
|
+
StorageTarget.MACHINE
|
|
1347
|
+
);
|
|
1348
|
+
}
|
|
1349
|
+
}
|
|
1350
|
+
}
|
|
1351
|
+
loadGridState() {
|
|
1352
|
+
const raw = this.storageService.get(SESSION_GRID_STATE_KEY, StorageScope.WORKSPACE);
|
|
1353
|
+
if (!raw) {
|
|
1354
|
+
return undefined;
|
|
1355
|
+
}
|
|
1356
|
+
try {
|
|
1357
|
+
const value = JSON.parse(raw);
|
|
1358
|
+
if (isSessionGridState(value)) {
|
|
1359
|
+
return value;
|
|
1360
|
+
}
|
|
1361
|
+
this.logService.warn(
|
|
1362
|
+
"[SessionsView] Invalid or unsupported session grid state; restoring session order instead"
|
|
1363
|
+
);
|
|
1364
|
+
} catch (error) {
|
|
1365
|
+
this.logService.warn("[SessionsView] Failed to read session grid state", error);
|
|
1366
|
+
}
|
|
1367
|
+
return undefined;
|
|
916
1368
|
}
|
|
917
1369
|
_snapshotVisibleSessionStates() {
|
|
918
1370
|
const activeId = this._visibility.activeSession.get()?.sessionId;
|
|
@@ -987,29 +1439,55 @@ let SessionsService = class SessionsService extends Disposable {
|
|
|
987
1439
|
}));
|
|
988
1440
|
}
|
|
989
1441
|
async restoreVisibleSessions() {
|
|
1442
|
+
this._cancelRestore();
|
|
1443
|
+
const cts = ( new CancellationTokenSource());
|
|
1444
|
+
this._restoreCts.value = cts;
|
|
990
1445
|
try {
|
|
991
|
-
await this._restoreVisibleSessions();
|
|
1446
|
+
await this._restoreVisibleSessions(cts.token);
|
|
992
1447
|
} finally {
|
|
1448
|
+
if (this._restoreCts.value === cts) {
|
|
1449
|
+
this._restoringGridState = undefined;
|
|
1450
|
+
this._restoreCts.clear();
|
|
1451
|
+
}
|
|
993
1452
|
this._initialRestoreComplete.set(true, undefined);
|
|
994
1453
|
}
|
|
995
1454
|
}
|
|
996
|
-
async _restoreVisibleSessions() {
|
|
997
|
-
const
|
|
998
|
-
this.
|
|
999
|
-
const token = cts.token;
|
|
1455
|
+
async _restoreVisibleSessions(token) {
|
|
1456
|
+
const gridState = this.loadGridState();
|
|
1457
|
+
this._restoringGridState = gridState;
|
|
1000
1458
|
const persisted = this._getVisibleSessionStates();
|
|
1001
|
-
const unresolved =
|
|
1459
|
+
const unresolved = gridState ? gridState.sessions.map((binding, index) => ({
|
|
1460
|
+
resource: binding.resource ? ( URI.parse(binding.resource)) : undefined,
|
|
1461
|
+
isSticky: binding.sticky,
|
|
1462
|
+
isActive: binding.id === gridState.active,
|
|
1463
|
+
order: index,
|
|
1464
|
+
gridId: binding.id
|
|
1465
|
+
})) : persisted.map(state => ({
|
|
1002
1466
|
resource: ( URI.parse(state.sessionResource)),
|
|
1003
1467
|
isSticky: !!state.isSticky,
|
|
1004
1468
|
isActive: !!state.isActive,
|
|
1005
1469
|
order: state.visibleOrder
|
|
1006
1470
|
}));
|
|
1007
|
-
const
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
isActive: unresolved[index].isActive,
|
|
1011
|
-
order: unresolved[index].order
|
|
1471
|
+
const redirected = (await raceTimeout(Promise.all(unresolved.map(async target => ({
|
|
1472
|
+
...target,
|
|
1473
|
+
resource: target.resource ? await this.sessionsManagementService.resolveSessionResource(target.resource, "restore") : undefined
|
|
1012
1474
|
}))), RESTORE_RESOLVE_BUDGET_MS)) ?? unresolved;
|
|
1475
|
+
const targets = [];
|
|
1476
|
+
const redirects = ( new Map());
|
|
1477
|
+
for (const target of redirected) {
|
|
1478
|
+
const duplicate = targets.find(
|
|
1479
|
+
existing => this.uriIdentityService.extUri.isEqual(existing.resource, target.resource)
|
|
1480
|
+
);
|
|
1481
|
+
if (duplicate) {
|
|
1482
|
+
duplicate.isSticky ||= target.isSticky;
|
|
1483
|
+
duplicate.isActive ||= target.isActive;
|
|
1484
|
+
if (target.gridId && duplicate.gridId) {
|
|
1485
|
+
redirects.set(target.gridId, duplicate.gridId);
|
|
1486
|
+
}
|
|
1487
|
+
} else {
|
|
1488
|
+
targets.push(target);
|
|
1489
|
+
}
|
|
1490
|
+
}
|
|
1013
1491
|
if (token.isCancellationRequested) {
|
|
1014
1492
|
return;
|
|
1015
1493
|
}
|
|
@@ -1027,7 +1505,51 @@ let SessionsService = class SessionsService extends Disposable {
|
|
|
1027
1505
|
activeIdx = 0;
|
|
1028
1506
|
}
|
|
1029
1507
|
const resolved = ( new Array(targets.length)).fill(undefined);
|
|
1508
|
+
const restoreResolved = preserveActive => {
|
|
1509
|
+
const slots = [];
|
|
1510
|
+
let activeIndex = -1;
|
|
1511
|
+
const activeId = this.activeSession.get()?.sessionId;
|
|
1512
|
+
for (let index = 0; index < targets.length; index++) {
|
|
1513
|
+
const session = resolved[index];
|
|
1514
|
+
if (session === undefined) {
|
|
1515
|
+
continue;
|
|
1516
|
+
}
|
|
1517
|
+
if (preserveActive ? session?.sessionId === activeId : index === activeIdx) {
|
|
1518
|
+
activeIndex = slots.length;
|
|
1519
|
+
}
|
|
1520
|
+
slots.push({
|
|
1521
|
+
session: session ?? undefined,
|
|
1522
|
+
sticky: targets[index].isSticky,
|
|
1523
|
+
gridId: targets[index].gridId
|
|
1524
|
+
});
|
|
1525
|
+
}
|
|
1526
|
+
transaction(tx => {
|
|
1527
|
+
this._visibility.restoreGrid(slots, Math.max(0, activeIndex));
|
|
1528
|
+
if (gridState) {
|
|
1529
|
+
const ids = ( new Set(slots.map(slot => slot.gridId)));
|
|
1530
|
+
const grid = projectSessionGrid(gridState.grid, id => {
|
|
1531
|
+
const mapped = redirects.get(id) ?? id;
|
|
1532
|
+
return ( ids.has(mapped)) ? mapped : undefined;
|
|
1533
|
+
});
|
|
1534
|
+
if (grid) {
|
|
1535
|
+
this._gridRequest.set({
|
|
1536
|
+
type: "restore",
|
|
1537
|
+
grid
|
|
1538
|
+
}, tx);
|
|
1539
|
+
}
|
|
1540
|
+
} else if (( persisted.some(state => state.gridLayout === "grid"))) {
|
|
1541
|
+
this._gridRequest.set({
|
|
1542
|
+
type: "arrange"
|
|
1543
|
+
}, tx);
|
|
1544
|
+
}
|
|
1545
|
+
});
|
|
1546
|
+
};
|
|
1030
1547
|
const place = (idx, session) => {
|
|
1548
|
+
if (gridState) {
|
|
1549
|
+
resolved[idx] = session;
|
|
1550
|
+
restoreResolved(true);
|
|
1551
|
+
return;
|
|
1552
|
+
}
|
|
1031
1553
|
let anchor;
|
|
1032
1554
|
for (let j = idx - 1; j >= 0 && !anchor; j--) {
|
|
1033
1555
|
const neighbour = resolved[j];
|
|
@@ -1070,8 +1592,6 @@ let SessionsService = class SessionsService extends Disposable {
|
|
|
1070
1592
|
error
|
|
1071
1593
|
));
|
|
1072
1594
|
}
|
|
1073
|
-
const slots = [];
|
|
1074
|
-
let activeSlotIndex = -1;
|
|
1075
1595
|
for (let idx = 0; idx < targets.length; idx++) {
|
|
1076
1596
|
const target = targets[idx];
|
|
1077
1597
|
let session;
|
|
@@ -1086,15 +1606,8 @@ let SessionsService = class SessionsService extends Disposable {
|
|
|
1086
1606
|
continue;
|
|
1087
1607
|
}
|
|
1088
1608
|
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
1609
|
}
|
|
1097
|
-
|
|
1610
|
+
restoreResolved(false);
|
|
1098
1611
|
if (token.isCancellationRequested) {
|
|
1099
1612
|
return;
|
|
1100
1613
|
}
|
|
@@ -1118,4 +1631,4 @@ let SessionsService = class SessionsService extends Disposable {
|
|
|
1118
1631
|
};
|
|
1119
1632
|
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
1633
|
|
|
1121
|
-
export { SessionsService };
|
|
1634
|
+
export { SessionsService, toSessionGridDirection };
|