import { Disposable } from "../../../../base/common/lifecycle.js"; import { IObservable, IReader } from "../../../../base/common/observable.js"; import { IStorageService } from "../../../../platform/storage/common/storage.service.js"; import { ISessionChatPillVisibilityService } from "./sessionChatPills.service.js"; /** The kinds of pill shown above an agent chat input, each independently hideable. */ export declare enum SessionChatPillKind { Changes = "changes", Artifacts = "artifacts", References = "references", Customizations = "customizations", Canvases = "canvases", PullRequests = "pullRequests", Issues = "issues", Browsers = "browsers", Subagents = "subagents", BackgroundShells = "backgroundShells" } /** All pill kinds, in the order they are offered in the visibility menu. */ export declare const SESSION_CHAT_PILL_KINDS: readonly SessionChatPillKind[]; /** Provider-neutral metadata for an active background shell owned by a chat. */ export interface IChatBackgroundShell { /** Identity of the entry, unique within the chat. */ readonly id: string; /** The agent's own ID for the shell, when it reports one. Only shown to the user. */ readonly shellId?: string; readonly description: string; readonly command: string; readonly startedAt: string; /** Whether the shell is tied to its agent's lifetime, when the agent reports it. */ readonly attachmentMode?: "attached" | "detached"; /** The shell's live output, when the agent can show it. Only subscribes while read. */ readonly output?: IObservable; /** Stops the shell, when the agent offers it. Resolves false when the shell had already finished. */ readonly stop?: () => Promise; } /** What a background shell's live output view shows. */ export type ChatBackgroundShellOutput = { readonly status: "loading"; } | { readonly status: "running"; readonly text: string; } | { readonly status: "exited"; readonly text: string; readonly exitCode?: number; } | { readonly status: "unavailable"; readonly message: string; }; export declare function getSessionChatPillLabel(kind: SessionChatPillKind): string; /** * Whether the user can hide a pill. Changes reports what the turn did to the * user's files, so it always shows once it has data. */ export declare function isSessionChatPillHideable(kind: SessionChatPillKind): boolean; /** One entry of the pill visibility context menu. */ export interface ISessionChatPillMenuEntry { readonly kind: SessionChatPillKind; readonly label: string; /** Whether the pill shows when it has data. */ readonly checked: boolean; } /** * The pill visibility context menu: an optional "Hide X" for the pill that was * right-clicked, then the kinds the surface has data for, then the rest. The * caller renders a separator between the groups it shows. */ export interface ISessionChatPillMenu { readonly hide?: { readonly kind: SessionChatPillKind; readonly label: string; }; readonly withData: readonly ISessionChatPillMenuEntry[]; readonly withoutData: readonly ISessionChatPillMenuEntry[]; } /** * Builds the visibility menu. Every offered, hideable kind is listed and * toggleable, checked while it is not hidden, and grouped by whether the * current session has data for it. */ export declare function getSessionChatPillMenu(kindsWithData: ReadonlySet, hiddenKinds: ReadonlySet, targetKind?: SessionChatPillKind, offeredKinds?: readonly SessionChatPillKind[]): ISessionChatPillMenu; /** Whether a pill kind starts hidden until the user turns it on. */ export declare function isSessionChatPillHiddenByDefault(kind: SessionChatPillKind): boolean; export interface ISessionChatPillFilter { readonly showAll: IObservable; setShowAll(showAll: boolean): void; } /** The user's per-kind pill visibility choices, persisted across windows. */ export declare class SessionChatPillVisibility extends Disposable implements ISessionChatPillVisibilityService { readonly _serviceBrand: undefined; readonly pullRequests: ISessionChatPillVisibilityService["pullRequests"]; readonly subagents: ISessionChatPillFilter; private readonly _hiddenKinds; constructor(storageService: IStorageService); private _createFilter; readHiddenKinds(reader: IReader | undefined): ReadonlySet; isVisible(kind: SessionChatPillKind, reader: IReader | undefined): boolean; hide(kind: SessionChatPillKind): void; toggle(kind: SessionChatPillKind): void; }