import { ThemeIcon } from "../../../../../base/common/themables.js"; import { URI } from "../../../../../base/common/uri.js"; /** * Where a session does its work: the workspace it belongs to, the isolated * worktree it checked out (if any) and the branch it is on. */ export interface ISessionSummaryHoverLocation { /** Workspace path, or a repository label for workspaces with no local path. */ readonly workspace?: string; /** Icon for {@link workspace}. Defaults to a folder. */ readonly workspaceIcon?: ThemeIcon; /** Path of the session's isolated worktree, when it runs in one. */ readonly worktree?: string; /** Whether the worktree is still being created, so it has no path yet. */ readonly worktreePending?: boolean; /** Branch the session is working on. */ readonly branch?: string; /** Aggregated pending changes. Omitted when the session has none. */ readonly changes?: { readonly files: number; readonly insertions: number; readonly deletions: number; }; } /** A pull request produced by a session. */ export interface ISessionSummaryHoverPullRequest { /** Pull request title, or a `#123`-style fallback when the title is unknown. */ readonly title: string; /** Icon carrying the pull request's state (and its color). */ readonly icon?: ThemeIcon; /** * Where the pull request lives. Together with {@link onOpen} it makes the row * a real link, so it is announced as one and offers a link's affordances * (copying the target, opening it in a new tab). */ readonly uri?: URI; /** * Opens the pull request. Activation is routed through this rather than the * anchor's own navigation, so it goes through the opener service instead of * navigating the window {@link uri} is rendered in. */ readonly onOpen?: () => void; } export interface ISessionSummaryHoverWorkspace { readonly name: string; readonly parentPath?: string; readonly icon?: ThemeIcon; } /** * Everything the session hover shows, in a provider-neutral shape. * * Each window populates this from its own data source — the Agents window from * an `ISession`, the editor window from an `IChatSessionItem` — so the widget * stays free of both. Every field except {@link title} is optional: a data * source that cannot answer omits it and the corresponding row disappears. */ export interface ISessionSummaryHoverData { readonly title: string; /** When the session was last updated. */ readonly updatedAt?: Date; readonly location?: ISessionSummaryHoverLocation; /** * Pull requests this session produced. Pull requests inherited from the * checkout it started from do not belong here — they are not its work. */ readonly pullRequests?: readonly ISessionSummaryHoverPullRequest[]; /** * The kind of agent serving the session, e.g. "Claude", shown beside the * title as "Fix the redirect loop · Claude". */ readonly providerLabel?: string; /** The remote host serving the session, shown after {@link providerLabel} when present. */ readonly remoteName?: string; /** Session that created this session, when available. */ readonly createdBy?: { readonly title: string; readonly onOpen: () => void; }; /** Application that created the session, when it was not VS Code. */ readonly application?: { readonly label: string; readonly onOpen: () => void; }; /** Aggregate context shown after chat-specific details for a multi-folder session. */ readonly sessionSummary?: { readonly workspaces: readonly ISessionSummaryHoverWorkspace[]; readonly changes?: ISessionSummaryHoverLocation["changes"]; readonly pullRequests?: readonly ISessionSummaryHoverPullRequest[]; }; } /** * The hover shown for a session, wherever a session is surfaced: rows in the * Agents window sessions list, and `agent-host-session://` pills in chat output. * * Owns the whole presentation — icons, the ordering of rows and the separators — * so every surface shows the same thing. Callers supply data through * {@link update} and place {@link domNode}; the widget is pure DOM and holds no * listeners, so it needs no disposal. */ export declare class SessionSummaryHoverWidget { readonly domNode: HTMLElement; private readonly _title; private readonly _location; private readonly _pullRequests; private readonly _createdBy; private readonly _application; private readonly _sessionSummary; constructor(data?: ISessionSummaryHoverData); update(data: ISessionSummaryHoverData): void; updateApplication(application: ISessionSummaryHoverData["application"]): void; private _renderLocation; private _renderWorkspaces; private _renderPullRequests; private _appendChangesRow; /** * A row of `icon label [· detail]`, returning the inline text container so * callers can append further inline content. The icon keeps its theme color, * so a merged pull request reads as merged at a glance. */ private _appendRow; /** * A row that navigates somewhere: a real anchor, so assistive technology * announces a link and the usual affordances (copy the target, open it in a * new tab) are available. Activation is handled rather than left to the * anchor, so the target is opened through the caller's opener service * instead of navigating the window the hover is shown in. */ private _appendLinkRow; /** A row that runs an in-app action, so it has no target to link to. */ private _appendButtonRow; private _appendRowContent; }