import { type IAction, type IActionRunner } from "../../../../base/common/actions.js"; import { Event } from "../../../../base/common/event.js"; import { Disposable } from "../../../../base/common/lifecycle.js"; import { IObservable, IReader } from "../../../../base/common/observable.js"; import { ThemeIcon } from "../../../../base/common/themables.js"; import type { CodeWindow } from "../../../../base/browser/window.js"; import { IContextMenuService } from "../../../../platform/contextview/browser/contextView.service.js"; import { IInstantiationService } from "../../../../platform/instantiation/common/instantiation.js"; import { IStorageService } from "../../../../platform/storage/common/storage.service.js"; import { ResourceLabels } from "../../../browser/labels.js"; import { type IChatChangesStats } from "../../../browser/chatChangesPill.js"; import { type ChatPillsCompactMode, type IChatPill, type IChatPillAction, type IChatPillEntry, type IChatPillSection } from "../../../browser/chatPills.js"; import { type IChatDropdownPillOptions } from "../../../browser/chatDropdownPill.js"; import { SessionChatPillKind } from "../common/sessionChatPills.js"; import { ISessionChatPillVisibilityService } from "../common/sessionChatPills.service.js"; export interface IChatInputPillSource { readonly kind?: SessionChatPillKind; readonly hasData: IObservable; /** Whether any entries remain after the pill's own filtering. */ readonly isVisible?: IObservable; readonly pills: IObservable; getContextMenuActions?(): readonly IAction[]; /** Actions on this pill's content, shown directly when its context menu is opened. */ getContextMenuPrimaryActions?(pill: IChatPill): readonly IAction[]; } export interface IChatInputPillsOptions { readonly debugName: string; readonly compact: ChatPillsCompactMode; readonly targetWindow?: CodeWindow; readonly enabled: IObservable; readonly sources: IObservable; readonly offeredKinds: readonly SessionChatPillKind[]; readonly ariaLabel?: string; readonly context?: IObservable; readonly actionRunner?: IActionRunner; readonly focusFallback?: () => void; } export interface IStandardChatInputPillSections { readonly sections: IObservable; /** Keeps configuration reachable when the source filters out all its entries. */ readonly hasData?: IObservable; readonly icon?: ThemeIcon | IObservable; getContextMenuActions?(): readonly IAction[]; getContextMenuPrimaryActions?(): readonly IAction[]; } export interface IStandardChatInputPillsData { readonly changes?: { readonly stats: IObservable; readonly label: IObservable; open(): void; getContextMenuActions?(): readonly IAction[]; getContextMenuPrimaryActions?(): readonly IAction[]; }; readonly pullRequests?: IStandardChatInputPillSections; readonly issues?: IStandardChatInputPillSections; readonly artifacts?: IStandardChatInputPillSections; readonly references?: IStandardChatInputPillSections; readonly customizations?: IStandardChatInputPillSections; readonly canvases?: IStandardChatInputPillSections; readonly browsers?: IStandardChatInputPillSections; readonly subagents?: IStandardChatInputPillSections; readonly backgroundShells?: IStandardChatInputPillSections; } /** Onboarding spotlight target of a chat input's changes pill, used by tours that teach reviewing changes. */ export declare const CHAT_CHANGES_PILL_ONBOARDING_TARGET_ID = "chat.changesPill"; /** * The entries a user pinned out of a chat input pill's dropdown into pills of * their own, per pin scope (such as a chat) and pill kind. Shared by every * surface composing chat input pills, so an entry stays pinned whichever * presentation lists it. */ export declare class ChatInputPillPins extends Disposable { private readonly storageService; private readonly pinned; constructor(storageService: IStorageService); /** The IDs of the entries pinned for a scope and pill kind. */ getPinned(scope: string | undefined, kind: SessionChatPillKind, reader: IReader | undefined): ReadonlySet; setPinned(scope: string, kind: SessionChatPillKind, entryId: string, label: string, pinned: boolean): void; /** The action that pins an entry into a pill of its own, or unpins it back into its dropdown. */ createPinAction(entry: Pick, kind: SessionChatPillKind, scope: string, pinned: boolean): IChatPillAction; } /** Creates a source backed by one section/dropdown pill. */ export declare function createChatSectionPillSource(kind: SessionChatPillKind, action: IChatPill["action"], sections: IObservable, options: IChatDropdownPillOptions, resourceLabels: ResourceLabels, instantiationService: IInstantiationService): IChatInputPillSource; /** Builds the canonical pill components and ordering from surface-specific data adapters. */ export declare class StandardChatInputPillSources extends Disposable { readonly sources: readonly IChatInputPillSource[]; private readonly pins; constructor(data: IStandardChatInputPillsData, offeredKinds: readonly SessionChatPillKind[], pinScope: IObservable, instantiationService: IInstantiationService); private withPinAction; } /** Shared renderer/controller for status pills above a chat input. */ export declare class ChatInputPills extends Disposable { private readonly _options; private readonly _contextMenuService; private readonly _visibility; readonly element: HTMLElement; readonly onDidChange: Event; private readonly _onDidChangeVisibility; readonly onDidChangeVisibility: Event; private readonly _row; private readonly _pills; private _visible; constructor(container: HTMLElement | undefined, _options: IChatInputPillsOptions, _contextMenuService: IContextMenuService, _visibility: ISessionChatPillVisibilityService, instantiationService: IInstantiationService); get visible(): boolean; getPillElements(): readonly HTMLElement[]; focusFirst(): boolean; private _getTarget; private _getVisibilityActions; } /** Creates a source for a pill whose data presence is represented by its membership. */ export declare function createChatInputPillSource(pill: IChatPill, kind?: SessionChatPillKind): IChatInputPillSource;