import { CancellationToken } from "../../../../base/common/cancellation.js"; import { Disposable, IDisposable } from "../../../../base/common/lifecycle.js"; import { IObservable } from "../../../../base/common/observable.js"; import { Event } from "../../../../base/common/event.js"; import { URI } from "../../../../base/common/uri.js"; import { ThemeIcon } from "../../../../base/common/themables.js"; import { IWorkspaceSelectionSnapshot } from "../../../common/workspaceSelection.js"; import { ISendRequestOptions } from "../../../services/sessions/common/sessionsManagement.js"; import { INewSessionComposerService } from "./newSessionComposerService.service.js"; export declare const NEW_SESSION_PROMPT_TYPING_DURATION_MS = 2500; export interface INewSessionPromptOption { readonly id: string; readonly title: string; readonly titleDetail?: string; readonly description: string; readonly prompt: string; readonly placeholder: string; readonly icon?: ThemeIcon; } export type NewSessionPromptOptionsState = { readonly kind: "loading"; } | { readonly kind: "resolved"; readonly options: readonly INewSessionPromptOption[]; }; export declare enum NewSessionWorkspacePreselectionSource { None = "none", CheckedWorkspace = "checkedWorkspace", RecentWorkspace = "recentWorkspace", ExistingSessions = "existingSessions", ProvidedWorkspace = "providedWorkspace", User = "user", Unknown = "unknown" } /** * Reports an intermediate prompt-option state while {@link INewSessionPromptOptionsController.resolve} * is still running, so options can be rendered before the controller has settled on its final set. * * Returns whether the state was rendered. Implementers may refuse a late update, for example while * the user is already acting on the options on screen. */ export type NewSessionPromptOptionsProgress = (state: NewSessionPromptOptionsState) => boolean; export interface INewSessionPromptOptionsController { /** * Resolves the final prompt options. Single-shot per refresh. * * @param progress Optional sink for intermediate states. Implementers may ignore it; callers that * pass it must tolerate it never being invoked and must apply the returned state regardless. */ resolve(token: CancellationToken, progress?: NewSessionPromptOptionsProgress): Promise; onDidSelectOption(option: INewSessionPromptOption): void; onDidClose(): void; } export interface INewSessionComposerPicker { getDomNode(): HTMLElement | undefined; open(): void; openComparison?(): void; } export interface INewSessionComposer { readonly sessionResource?: IObservable; readonly modelPicker?: INewSessionComposerPicker; readonly workspacePreselectionSource?: NewSessionWorkspacePreselectionSource; readonly workspaceSelection?: IWorkspaceSelectionSnapshot; readonly onDidChangeWorkspaceSelection?: Event; readonly hasInput?: boolean; readonly isInputReady?: boolean; readonly onDidChangeInput?: Event; readonly onDidFocus?: Event; readonly canApplyWorkspaceDefault?: boolean; animatePrompt(text: string, durationMs: number, placeholder: string, token: CancellationToken): Promise; showPromptOptions(state: NewSessionPromptOptionsState | undefined): boolean; setPromptOptionsController?(controller: INewSessionPromptOptionsController): void; refreshPromptOptions?(token?: CancellationToken): Promise; } export declare class NewSessionComposerService extends Disposable implements INewSessionComposerService { readonly _serviceBrand: undefined; private readonly _composers; private readonly _visibleComposers; private readonly _activeComposer; readonly activeComposer: IObservable; private readonly _userWorkspaceSelectionVersion; readonly userWorkspaceSelectionVersion: IObservable; private readonly _userNavigationVersion; readonly userNavigationVersion: IObservable; private readonly _inputVersion; readonly inputVersion: IObservable; private readonly _draftInputVersion; readonly draftInputVersion: IObservable; private readonly _selectionChanged; readonly workspaceSelection: import("../../../../base/common/observable.js").IObservableWithChange; private readonly _onWillSendRequest; readonly onWillSendRequest: Event<{ readonly options: ISendRequestOptions; readonly selection: IWorkspaceSelectionSnapshot | undefined; }>; notifyUserWorkspaceSelection(): void; notifyUserNavigation(): void; notifyWillSendRequest(options: ISendRequestOptions, selection: IWorkspaceSelectionSnapshot | undefined): void; get hasDraftInput(): boolean | undefined; getDraftInputStateForSession(sessionResource: URI | undefined): boolean | undefined; hasDraftInputForSession(sessionResource: URI): boolean; registerComposer(composer: INewSessionComposer, visible?: IObservable): IDisposable; }