|
| 1 | +/*--------------------------------------------------------------------------------------------- |
| 2 | + * Copyright (c) Microsoft Corporation. All rights reserved. |
| 3 | + * Licensed under the MIT License. See License.txt in the project root for license information. |
| 4 | + *--------------------------------------------------------------------------------------------*/ |
| 5 | + |
| 6 | +import { URI } from '../../base/common/uri.js'; |
| 7 | + |
| 8 | +export const enum WorkspaceSelectionOrigin { |
| 9 | + None = 'none', |
| 10 | + CheckedWorkspace = 'checkedWorkspace', |
| 11 | + AgentsRecent = 'agentsRecent', |
| 12 | + VSCodeRecent = 'vscodeRecent', |
| 13 | + VSCodeWorkspace = 'vscodeWorkspace', |
| 14 | + ExistingSessions = 'existingSessions', |
| 15 | + WindowOpen = 'windowOpen', |
| 16 | + WindowContext = 'windowContext', |
| 17 | + RestoredDraft = 'restoredDraft', |
| 18 | + SessionSync = 'sessionSync', |
| 19 | + Programmatic = 'programmatic', |
| 20 | + User = 'user', |
| 21 | +} |
| 22 | + |
| 23 | +export type WorkspaceHistoryLoadState = 'loading' | 'loaded' | 'error'; |
| 24 | +export type WorkspaceSessionFallbackState = 'idle' | 'pending' | 'completed' | 'error' | 'disabled'; |
| 25 | +export type WorkspaceArgumentKind = 'none' | 'local' | 'devContainer' | 'remote' | 'other'; |
| 26 | + |
| 27 | +/** Selection and lookup state at the instant it is read, not a guarantee that a session can run. */ |
| 28 | +export interface IWorkspaceSelectionSnapshot { |
| 29 | + /** For local comparisons only; never include this URI in telemetry. */ |
| 30 | + readonly folderUri: URI | undefined; |
| 31 | + readonly origin: WorkspaceSelectionOrigin; |
| 32 | + readonly state: 'none' | 'noWorkspace' | 'selected' | 'unresolved'; |
| 33 | + readonly historyState: WorkspaceHistoryLoadState; |
| 34 | + readonly sessionFallbackState: WorkspaceSessionFallbackState; |
| 35 | + readonly registeredProviderCount: number; |
| 36 | +} |
0 commit comments