import { Disposable } from "../../../../base/common/lifecycle.js"; import { IObservable, IReader } from "../../../../base/common/observable.js"; import { ArtifactContributionSnapshot, ArtifactJsonValue, ArtifactRun, ArtifactSnapshot, IArtifactModel } from "../../../../platform/artifactIntegrations/common/artifactIntegration.js"; import { IInstantiationService } from "../../../../platform/instantiation/common/instantiation.js"; import { INotificationService } from "../../../../platform/notification/common/notification.service.js"; import { IOpenerService } from "../../../../platform/opener/common/opener.service.js"; import { IChatPill, IChatPillAction, IChatPillEntry } from "../../../../workbench/browser/chatPills.js"; import { IArtifactButton } from "./artifactButtons.js"; import { ArtifactDetailsSelection, ArtifactDetailsViewState, IArtifactActionViewData } from "./artifactDetailsView.js"; export interface IArtifactDetailsHost { readonly id: string; readonly selected: IObservable; /** * @param target The control that shows the details, which receives focus back when they close. Defaults to the * focused element, such as a dropdown's pill after the dropdown closes. */ toggle(presentation: ArtifactIntegrationPresentation, target?: HTMLElement, section?: ArtifactDetailsSelection): void; release(presentation: ArtifactIntegrationPresentation): void; } /** The number of Autopilot rules enabled across an artifact's integrations. */ export declare function countEnabledArtifactAutomations(snapshot: ArtifactSnapshot): number; /** Opens an artifact's resource from a list where activating the artifact opens its details instead. */ export declare function createArtifactOpenAction(entry: IChatPillEntry): IChatPillAction; /** * The status sections an artifact shows beside its main part: each integration section, a Sign In section while * authentication is required, and the number of enabled Autopilot rules. Activating one opens the artifact's * details on the matching list, action or Autopilot. */ export declare function getArtifactStatusButtons(presentation: ArtifactIntegrationPresentation, snapshot: ArtifactSnapshot, expanded: boolean, open: (target: HTMLElement, selection: ArtifactDetailsSelection) => void): IArtifactButton[]; export declare class ArtifactIntegrationPresentation extends Disposable { readonly model: IArtifactModel; private readonly invokingChat; readonly detailsHost: IArtifactDetailsHost; private readonly instantiationService; private readonly notifications; private readonly openerService; readonly inlinePill: IChatPill; readonly viewState: ArtifactDetailsViewState; private entry; private readonly action; readonly snapshot: IObservable; constructor(model: IArtifactModel, invokingChat: (reader?: IReader) => string | undefined, detailsHost: IArtifactDetailsHost, instantiationService: IInstantiationService, notifications: INotificationService, openerService: IOpenerService); /** * A pill for this artifact, with a trailing action button such as Unpin. The surface placing the pill owns that * action, so pills with different trailing actions can show the same artifact. */ createPill(trailingAction: IObservable): IChatPill; /** * Lists this artifact in the dropdown of the pill for its kind, such as Artifacts, with its main part's icon and * label. Selecting the entry opens the artifact's details, and its first row action opens the resource; as the * pill's only entry, it renders as this artifact's own pill. Entries that identify their resource with a badge, * such as pull requests and issues, keep their own label beside it. */ decorate(entry: T, reader: IReader): T; get baseEntry(): IChatPillEntry | undefined; /** `input` is passed to the action, for example the details item it runs for. */ invoke(integrationId: string, actionId: string, input?: ArtifactJsonValue): Promise; authenticationButton(contribution: ArtifactContributionSnapshot): IArtifactActionViewData | undefined; run(operation: () => Promise): Promise; }