import { Disposable } from "../../../../base/common/lifecycle.js"; import { IObservable, IReader } from "../../../../base/common/observable.js"; import { URI } from "../../../../base/common/uri.js"; import { IClipboardService } from "../../../../platform/clipboard/common/clipboardService.service.js"; import { ICommandService } from "../../../../platform/commands/common/commands.service.js"; import { IConfigurationService } from "../../../../platform/configuration/common/configuration.service.js"; import { IFileDialogService } from "../../../../platform/dialogs/common/dialogs.service.js"; import { IFileService } from "../../../../platform/files/common/files.service.js"; import { GitHubCommit } from "../../../../platform/github/common/githubQueryService.js"; import { ILabelService } from "../../../../platform/label/common/label.service.js"; import { IInstantiationService } from "../../../../platform/instantiation/common/instantiation.js"; import { ILogService } from "../../../../platform/log/common/log.service.js"; import { IOpenerService } from "../../../../platform/opener/common/opener.service.js"; import { INotificationService } from "../../../../platform/notification/common/notification.service.js"; import { ITelemetryService } from "../../../../platform/telemetry/common/telemetry.service.js"; import { IWorkspaceContextService } from "../../../../platform/workspace/common/workspace.service.js"; import { ISharedWebContentExtractorService } from "../../../../platform/webContentExtractor/common/webContentExtractor.service.js"; import { type IChatPillAction, type IChatPillEntry, type IChatPillSection } from "../../../../workbench/browser/chatPills.js"; import { IChatImageCarouselService } from "../../../../workbench/contrib/chat/browser/chatImageCarouselService.service.js"; import { IChatService } from "../../../../workbench/contrib/chat/common/chatService/chatService.service.js"; import { GitHubResourceDetailsResolver } from "../../../../workbench/contrib/github/browser/githubResourceDetails.js"; import { ChatPillHoverCache } from "../../../../workbench/browser/chatPillHover.js"; import { IWorkbenchGitHubService } from "../../../../workbench/services/github/common/githubService.service.js"; import { type IChat, type IGitHubPullRequestRef, type ISessionArtifact } from "../../../services/sessions/common/session.js"; import { ISessionsService } from "../../../services/sessions/browser/sessionsService.service.js"; import { ArtifactIntegrationPresentation, IArtifactDetailsHost } from "./artifactIntegrationPresentation.js"; import { type IActiveSession } from "../../../services/sessions/common/sessionsManagement.js"; import { ISessionsManagementService } from "../../../services/sessions/common/sessionsManagement.service.js"; import { ISessionGitHubReferences } from "../../github/common/sessionGitHubReferences.js"; import { IGitHubService as ISessionsGitHubService } from "../../github/browser/githubService.service.js"; /** Action id of the references pill. */ export declare const SESSION_REFERENCES_PILL_ID = "sessions.chatPills.references"; /** What an artifact entry needs from the surrounding surface to be activated. */ export interface ISessionArtifactActions { recordOpen(artifact: ISessionArtifact): void; openExternal(link: URI): void; openResource(uri: URI): void; openImages(images: readonly ISessionArtifactImage[], startIndex: number): void; downloadImage(uri: URI, name: string): Promise; /** Reveals a file or folder on this device in the OS file manager; absent where that is unsupported. */ revealInOS?(uri: URI): void; /** Downloads a remote file or folder to this device. */ downloadResource?(uri: URI, name: string): Promise; copy(text: string): void; /** Opens a GitHub pull request's changes in a multi-file diff editor. */ openPullRequestChanges(pullRequest: IGitHubPullRequestRef): void; /** * Deletes the session's record of an artifact or reference by its stable id. * Never mutates or deletes the underlying file, resource, PR, issue or other * external target — only the session's own bookkeeping entry. */ remove?(id: string, label: string): Promise; } export interface ISessionArtifactImage { readonly artifact: ISessionArtifactPresentation; readonly uri: URI; readonly mimeType: string; readonly name: string; } interface ISessionArtifactPresentation extends ISessionArtifact { readonly generatedImageMimeType?: string; /** An integration presents the record, whose entry alone reaches its details, so a browser showing its page never replaces it. */ readonly integrated?: boolean; } /** * How an artifact's location reads: a link keeps its URL, while a file reads as * a path — no scheme, tildified when it is under the user home, and relative to * the workspace folder holding it. A folder that is itself the workspace root * has no relative path, so it falls back to its full path. */ export declare function sessionArtifactLocationText(uri: URI, labelService: Pick): string; /** * The location details shown for an artifact: its path/link as the hover beside * the dropdown row, the plain-text screen reader description, and the tooltip, * while the accessible name stays the action the entry performs. */ export declare function sessionArtifactLocation(location: string, label: string): Pick; /** The row action opening a pull request's changes, shared by the pull requests pill and recorded pull request rows. */ export declare function createOpenPullRequestChangesAction(pullRequest: Pick, run: () => unknown): IChatPillAction; /** * Builds the sections shown in a pill from one group of agent-set entries — * the artifacts pill and the references pill each build their own. Entries keep * the order they arrive in, which is newest first, so each section opens on * what the session recorded last. Websites the browsers pill already lists are * left out, so the same page is offered once across the pills, unless an * integration presents them. */ export declare function buildSessionArtifactSections(artifacts: readonly ISessionArtifactPresentation[], actions: ISessionArtifactActions, labelService: Pick, imageCarouselEnabled: boolean, browserUrls: ReadonlySet, commits?: ReadonlyMap, gitHubResolver?: GitHubResourceDetailsResolver, reader?: IReader, commitHoverCache?: ChatPillHoverCache): readonly IChatPillSection[]; /** Publishes a session's artifact and reference sections for the chat input pills. */ export declare class SessionArtifacts extends Disposable { /** The URLs the browsers pill lists; website entries for them are left out. */ private readonly _browserUrls; private readonly _gitHubReferences; private readonly _clipboardService; private readonly _configurationService; private readonly _labelService; private readonly _notificationService; private readonly _openerService; private readonly _sessionsManagementService; private readonly _instantiationService; private readonly _telemetryService; private readonly _chatImageCarouselService; private readonly _fileService; private readonly _fileDialogService; private readonly _webContentExtractorService; private readonly _commandService; private readonly _sessionsService; private readonly presentations; /** Sections for the artifacts pill: what the session produced. */ readonly sections: IObservable; /** Sections for the references pill: what the session points the user at. */ readonly referenceSections: IObservable; /** * Undecorated entries of the artifacts and references an integration presents in pills of their own, because their * main integration assigns them a group ID; see {@link getPresentation}. The sections list the other integrated records. */ readonly integratedEntries: IObservable; constructor(session: IObservable, chat: IObservable, /** The URLs the browsers pill lists; website entries for them are left out. */ _browserUrls: IObservable>, _gitHubReferences: IObservable, detailsHost: IArtifactDetailsHost, _clipboardService: IClipboardService, _configurationService: IConfigurationService, _labelService: ILabelService, _notificationService: INotificationService, _openerService: IOpenerService, _sessionsManagementService: ISessionsManagementService, workspaceContextService: IWorkspaceContextService, gitHubService: ISessionsGitHubService, _instantiationService: IInstantiationService, workbenchGitHubService: IWorkbenchGitHubService, logService: ILogService, _telemetryService: ITelemetryService, chatService: IChatService, _chatImageCarouselService: IChatImageCarouselService, _fileService: IFileService, _fileDialogService: IFileDialogService, _webContentExtractorService: ISharedWebContentExtractorService, _commandService: ICommandService, _sessionsService: ISessionsService); decorateEntry(entry: T, reader: IReader): T; getPresentation(id: string, reader: IReader): ArtifactIntegrationPresentation | undefined; /** Whether an integration presents the record in a pill of its own, rather than in the pill for its kind. */ hasOwnPill(id: string, reader: IReader): boolean; private _actions; } export {};