import { Disposable } from "../../../base/common/lifecycle.js"; import { URI, UriComponents } from "../../../base/common/uri.js"; import { IStorageService } from "../../storage/common/storage.service.js"; export declare const EDITOR_AGENT_HOST_SESSIONS_STORAGE_KEY = "chat.editorUsage.agentHostSessions"; export declare const AGENTS_WINDOW_TOTAL_SESSIONS_STORAGE_KEY = "agentSessions.telemetry.totalSessions"; export declare const AGENTS_WINDOW_LAST_SESSION_CREATED_STORAGE_KEY = "agentSessions.telemetry.lastSessionCreated"; export declare const AGENTS_WINDOW_INVITATION_IMPRESSION_STORAGE_KEY = "chat.agentsWindowBanner.lastShown"; /** Suppresses invitations for recent creators, conservatively retaining suppression for legacy users with no creation date. */ export declare function isActiveAgentsWindowUser(storageService: IStorageService, now?: number): boolean; export interface IAgentHostEditorSession { readonly resource: UriComponents; readonly windowId: number; readonly inProgress: boolean; readonly needsInput: boolean; } export interface IAgentsWindowInvitationImpression { readonly timestamp: number; readonly editorSessionCount: number; } export interface IAgentsWindowInvitation { readonly id: string; readonly revision: number; readonly windowId: number; readonly resource: UriComponents; readonly developerMode: boolean; readonly shown: boolean; } export interface IAgentHostEditorState { readonly revision: number; readonly sessions: readonly IAgentHostEditorSession[]; readonly editorSessionCount: number; readonly lastShown: IAgentsWindowInvitationImpression | undefined; /** Editor-created session ordinal at the most recent visible Copilot harness introduction. */ readonly lastCopilotHarnessIntroductionSessionCount: number | undefined; readonly invitation: IAgentsWindowInvitation | undefined; } /** The harness introduction participates in session spacing, but not the invitation's time-based cooldown. */ export declare function hasAgentsWindowInvitationSessionCooldownElapsed(state: IAgentHostEditorState): boolean; export type AgentHostEditorUpdate = { readonly kind: "request"; readonly resource: UriComponents; readonly isNewSession: boolean; } | { readonly kind: "sessions"; readonly sessions: readonly Omit[]; } | { readonly kind: "commit"; readonly original: UriComponents; readonly committed: UriComponents; } | { readonly kind: "delete"; readonly resources: readonly UriComponents[]; } | { readonly kind: "copilotHarnessIntroductionShown"; }; /** Main-process ownership makes claims and usage increments atomic across editor windows. */ export declare class AgentsWindowInvitationState extends Disposable { private readonly now; private readonly storageService; private readonly sessions; private readonly developerPreviews; private invitation; private revision; private readonly _onDidChange; readonly onDidChange: import("../../../base/common/event.js").Event; constructor(now: () => number, storageService: IStorageService); initialize(legacyEditorSessionCount: number): IAgentHostEditorState; getState(): IAgentHostEditorState; update(windowId: number, update: AgentHostEditorUpdate): void; /** An Agents Window request revokes editor ownership without contributing editor usage. */ update(windowId: undefined, update: Extract): void; claim(windowId: number, resource: URI, developerMode: boolean): IAgentsWindowInvitation | undefined; markShown(windowId: number, id: string): void; release(windowId: number, id: string): void; resetWindow(windowId: number, retainActivity: boolean): void; private fireChange; } export declare function getAgentHostEditorActivity(state: IAgentHostEditorState, windowId: number, resource: URI): { readonly sameWindow: number; readonly acrossWindows: boolean; } | undefined;