import { Event } from "../../../../base/common/event.js"; import { Disposable } from "../../../../base/common/lifecycle.js"; import { IObservable } from "../../../../base/common/observable.js"; import { IInstantiationService } from "../../../../platform/instantiation/common/instantiation.js"; import { ISessionInputPickerVisibility } from "../../../services/sessions/common/sessionPickerVisibility.service.js"; import { IActiveSession } from "../../../services/sessions/common/sessionsManagement.js"; import { NewSessionBanners } from "../../chat/common/newSessionBanners.js"; import { IWorktreeSuggestionService } from "./worktreeSuggestionService.service.js"; /** The parts of a new-session composer that the worktree suggestion reads. */ export interface IWorktreeSuggestionComposer { /** The new session the composer configures. */ readonly session: IObservable; /** The composer's pickers. A session needs an interactive isolation picker to be offered a worktree. */ readonly pickerVisibility: ISessionInputPickerVisibility; /** Whether the composer is shown. */ readonly visible: IObservable; readonly getInputValue: () => string; readonly onDidChangeInput: Event; readonly focusInput: () => void; /** Shows the isolation picker when the session options are collapsed. */ readonly revealIsolationPicker: () => void; /** Opens the isolation picker with New Worktree focused, showing it first when the session options are collapsed. */ readonly openIsolationPicker: () => void; /** The banners below the input, which show one at a time. The inline hint is one of them. */ readonly banners: NewSessionBanners; } /** * Suggests a new worktree when Branch isolation is selected for a new session in a folder with uncommitted * changes, using the presentation selected by the worktree suggestion experiment. It owns the spotlight on * send and the inline hint; the isolation picker owns the number of uncommitted files. */ export declare class WorktreeSuggestionController extends Disposable { private readonly _composer; private readonly _service; private readonly _instantiationService; private readonly _suggestion; private readonly _hasInput; /** * Sessions whose isolation picker was interactive at least once, so New Worktree is offered for them. * The picker briefly unregisters whenever it re-renders or resolves configuration, which must not * withdraw a suggestion that is showing. */ private readonly _sessionsWithIsolationPicker; private _inlineSuggestion; private _announcedSessionId; constructor(container: HTMLElement, _composer: IWorktreeSuggestionComposer, _service: IWorktreeSuggestionService, _instantiationService: IInstantiationService); /** * Before the composer sends `query`, spotlights the isolation picker once to offer sending it in a new * worktree, when that presentation applies. Returns `false` when switching to a new worktree failed, * which leaves the request unsent. */ confirmBeforeSend(query: string): Promise; private _renderInlineSuggestion; /** Hides the inline hint for good, or for the session only. Focus inside it returns to the input. */ private _hideInlineSuggestion; }