import { Disposable } from "../../../../../base/common/lifecycle.js"; import { IObservable } from "../../../../../base/common/observable.js"; import { URI } from "../../../../../base/common/uri.js"; import { IConfigurationService } from "../../../../../platform/configuration/common/configuration.service.js"; import { IInstantiationService } from "../../../../../platform/instantiation/common/instantiation.js"; import { IOpenerService } from "../../../../../platform/opener/common/opener.service.js"; import { IChatPill, type IChatPillSection } from "../../../../browser/chatPills.js"; import { type IChatDropdownPillOptions } from "../../../../browser/chatDropdownPill.js"; /** * Presentation of the artifacts pill. Only a file artifact is worth showing in * place of the summary — its name and themed icon say what it is — while any * other lone artifact stays behind the count, so the row keeps a stable shape * instead of turning into whichever artifact happens to be recorded first. */ export declare const chatArtifactPillOptions: IChatDropdownPillOptions; export declare const CHAT_TURN_CHANGES_PILL_ID = "chat.turnPills.changes"; export declare const CHAT_TURN_ARTIFACT_PILL_ID = "chat.turnPills.artifact"; /** Aggregate diff counts shown in the changes pill (scoped to a single turn). */ export interface IDiffStats { readonly files: number; readonly insertions: number; readonly deletions: number; } export declare const EMPTY_DIFF_STATS: IDiffStats; /** A file outside the workspace that the artifact pill can open. */ export interface IPreviewFile { readonly uri: URI; readonly kind: "markdown" | "html"; /** Whether the file was created (vs. edited) during the turn. */ readonly created: boolean; } /** Classify a resource as a previewable file, if applicable. */ export declare function previewKind(uri: URI, htmlPreviewAvailable?: boolean): IPreviewFile["kind"] | undefined; export declare function diffStatsEqual(a: IDiffStats, b: IDiffStats): boolean; export declare function previewFilesEqual(a: readonly IPreviewFile[], b: readonly IPreviewFile[]): boolean; /** Opens a turn file with the editor configured for resources opened from chat. */ export declare function openChatTurnFile(file: IPreviewFile, openerService: IOpenerService, configurationService: IConfigurationService): Promise; /** The data and interactions a {@link ChatTurnPillsWidget} reflects. */ export interface IChatTurnPillsModel { readonly stats: IObservable; /** Artifact sections shown in the artifact pill, in display order. */ readonly artifacts: IObservable; /** When `false` the changes pill stays hidden regardless of the data. */ readonly changesEnabled: IObservable; /** When `false` the artifact pill stays hidden regardless of the data. */ readonly artifactsEnabled: IObservable; openChanges(): void; } /** * A toolbar of clickable pills reflecting a single turn's status. Used both as a * floating widget above the chat input (live, active turn) and inside a completed * chat response. The pills are actions inside a {@link ToolBar}: * * - **Changes** — ` Files +ins -del` for the turn. Activating it opens the * changes. * - **Artifact** — shown when the turn created or edited a previewable file outside * the current workspace. * A single artifact opens directly; multiple artifacts open a dropdown. * The data and the open actions are supplied by the {@link IChatTurnPillsModel} * so the same widget serves surfaces with different data sources. */ export declare class ChatTurnPillsProvider extends Disposable { private readonly _model; private readonly _instantiationService; readonly pills: IObservable; private readonly _changesAction; private readonly _artifactAction; private readonly _resourceLabels; constructor(_model: IChatTurnPillsModel, _instantiationService: IInstantiationService); private _showChanges; private _showArtifacts; private _openPrimaryArtifact; } /** A standalone widget for a single turn's pills. */ export declare class ChatTurnPillsWidget extends Disposable { readonly element: HTMLElement; readonly isVisible: IObservable; constructor(model: IChatTurnPillsModel, instantiationService: IInstantiationService); }