import { Event } from "../../../../../base/common/event.js"; import { IMarkdownString } from "../../../../../base/common/htmlContent.js"; import { Disposable } from "../../../../../base/common/lifecycle.js"; import { MarshalledId } from "../../../../../base/common/marshallingIds.js"; import { ThemeIcon } from "../../../../../base/common/themables.js"; import { URI } from "../../../../../base/common/uri.js"; import { IInstantiationService } from "../../../../../platform/instantiation/common/instantiation.js"; import { IProductService } from "../../../../../platform/product/common/productService.service.js"; import { IStorageService } from "../../../../../platform/storage/common/storage.service.js"; import { IWorkspaceContextService } from "../../../../../platform/workspace/common/workspace.service.js"; import { IWorkspaceTrustManagementService } from "../../../../../platform/workspace/common/workspaceTrust.service.js"; import { IChatEntitlementService } from "../../../../services/chat/common/chatEntitlementService.service.js"; import { ILifecycleService } from "../../../../services/lifecycle/common/lifecycle.service.js"; import { ChatSessionStatus as AgentSessionStatus, IChatSessionItem } from "../../common/chatSessionsService.js"; import { IChatSessionsService } from "../../common/chatSessionsService.service.js"; import { IChatWidgetService } from "../chat.service.js"; export { ChatSessionStatus as AgentSessionStatus, isSessionInProgressStatus } from "../../common/chatSessionsService.js"; export interface IAgentSessionsModel { readonly onWillResolve: Event; readonly onDidResolve: Event; readonly onDidChangeSessions: Event; readonly onDidChangeSessionArchivedState: Event; readonly resolved: boolean; readonly sessions: IAgentSession[]; getSession(resource: URI): IAgentSession | undefined; resolve(provider: string | string[] | undefined): Promise; } interface IAgentSessionData extends Omit { readonly providerType: string; readonly providerLabel: string; readonly resource: URI; readonly status: AgentSessionStatus; readonly tooltip?: string | IMarkdownString; readonly label: string; readonly description?: string | IMarkdownString; readonly badge?: string | IMarkdownString; readonly icon: ThemeIcon; readonly timing: IChatSessionItem["timing"]; readonly changes?: IChatSessionItem["changes"]; } /** * Checks if the provided changes object represents valid diff information. */ export declare function hasValidDiff(changes: IAgentSession["changes"]): boolean; /** * Gets a summary of agent session changes, converting from array format to object format if needed. */ export declare function getAgentChangesSummary(changes: IAgentSession["changes"]): { readonly files: number; readonly insertions: number; readonly deletions: number; } | undefined; export interface IAgentSession extends IAgentSessionData { isArchived(): boolean; setArchived(archived: boolean): void; isPinned(): boolean; setPinned(pinned: boolean): void; isRead(): boolean; isMarkedUnread(): boolean; setRead(read: boolean): void; } export declare function isLocalAgentSessionItem(session: IAgentSession): boolean; export declare function isAgentSession(obj: unknown): obj is IAgentSession; export declare function isAgentSessionsModel(obj: unknown): obj is IAgentSessionsModel; export declare function countUnreadSessions(sessions: IAgentSession[]): number; export declare enum AgentSessionSection { Pinned = "pinned", Today = "today", Yesterday = "yesterday", Week = "week", Older = "older", Archived = "archived", More = "more", Repository = "repository" } export interface IAgentSessionSection { readonly section: AgentSessionSection; readonly label: string; readonly sessions: IAgentSession[]; } export declare function isAgentSessionSection(obj: unknown): obj is IAgentSessionSection; /** * A "Show N More..." item that appears as the last child * of a capped repository group section. */ export interface IAgentSessionShowMore { readonly showMore: true; readonly sectionLabel: string; readonly remainingCount: number; } export declare function isAgentSessionShowMore(obj: unknown): obj is IAgentSessionShowMore; /** * A "Show less" item that appears as the last child * of an expanded repository group section to allow collapsing back. */ export interface IAgentSessionShowLess { readonly showLess: true; readonly sectionLabel: string; } export declare function isAgentSessionShowLess(obj: unknown): obj is IAgentSessionShowLess; export interface IMarshalledAgentSessionContext { readonly $mid: MarshalledId.AgentSessionContext; readonly session: IAgentSession; readonly sessions: IAgentSession[]; } export declare function isMarshalledAgentSessionContext(thing: unknown): thing is IMarshalledAgentSessionContext; export declare class AgentSessionsModel extends Disposable implements IAgentSessionsModel { private readonly chatSessionsService; private readonly lifecycleService; private readonly instantiationService; private readonly storageService; private readonly productService; private readonly chatWidgetService; private readonly workspaceContextService; private readonly workspaceTrustManagementService; private readonly chatEntitlementService; private readonly _onWillResolve; readonly onWillResolve: Event; private readonly _onDidResolve; readonly onDidResolve: Event; private readonly _onDidChangeSessions; readonly onDidChangeSessions: Event; private readonly _onDidChangeSessionArchivedState; readonly onDidChangeSessionArchivedState: Event; private _resolved; get resolved(): boolean; private _sessions; get sessions(): IAgentSession[]; private readonly resolvers; private readonly cache; private readonly logger; constructor(chatSessionsService: IChatSessionsService, lifecycleService: ILifecycleService, instantiationService: IInstantiationService, storageService: IStorageService, productService: IProductService, chatWidgetService: IChatWidgetService, workspaceContextService: IWorkspaceContextService, workspaceTrustManagementService: IWorkspaceTrustManagementService, chatEntitlementService: IChatEntitlementService); private registerListeners; getSession(resource: URI): IAgentSession | undefined; resolve(provider: string | string[] | undefined): Promise; private resolveProvider; private doResolveProvider; private toAgentSession; private static readonly UNREAD_MARKER; private readonly sessionStates; private isArchived; private setArchived; private isPinned; private setPinned; private isMarkedUnread; private isRead; private sessionTimeForReadStateTracking; private setRead; private static readonly READ_DATE_BASELINE_KEY; private readonly readDateBaseline; private resolveReadDateBaseline; }