import { Disposable, IDisposable } from "../../../../base/common/lifecycle.js"; import { IObservable } from "../../../../base/common/observable.js"; import { IStorageService } from "../../../../platform/storage/common/storage.service.js"; /** The number of sessions a user must have started in the Agents window before any banner shows below the new-session input. */ export declare const NEW_SESSION_BANNERS_MIN_CREATED_SESSIONS = 3; /** * The priorities of the banners below the new-session input. Of the banners that want to show, only the one with the * highest priority shows. The values leave room for new banners between existing ones. */ export declare enum NewSessionBannerPriority { /** A getting-started tip, including contextual tips such as connector recommendations. */ Tip = 100, /** The notice that agent customizations need to be migrated. */ Migration = 200, /** The suggestion to start the session in a new worktree, because its folder has uncommitted changes. */ WorktreeSuggestion = 300 } export interface INewSessionBannerOptions { /** * Whether the banner shows as a developer preview, the only way a banner can show before the user started * {@link NEW_SESSION_BANNERS_MIN_CREATED_SESSIONS} sessions. */ readonly isDeveloperPreview?: IObservable; } /** A banner registered with {@link NewSessionBanners}. Disposing it unregisters the banner. */ export interface INewSessionBanner extends IDisposable { /** Whether this is the banner that shows. A banner renders only while this is `true`. */ readonly isShowing: IObservable; } /** * Makes the banners below the new-session input show one at a time, and only once the user started * {@link NEW_SESSION_BANNERS_MIN_CREATED_SESSIONS} sessions. Each banner registers with a priority and an observable of * its own conditions to show, and renders only while it is the banner that shows: the one with the highest priority of * those that want to show. Of banners with the same priority, the one registered first shows. */ export declare class NewSessionBanners extends Disposable { private readonly _registrations; private readonly _hasEnoughSessions; /** Reads the conditions of banners in priority order, up to the first that shows. */ private readonly _showing; constructor(storageService: IStorageService); /** * Registers a banner with a priority from {@link NewSessionBannerPriority}. `wantsToShow` reflects only the banner's * own conditions, never whether this or another banner shows, nor how many sessions the user started. */ register(priority: number, wantsToShow: IObservable, options?: INewSessionBannerOptions): INewSessionBanner; }