import { CancellationToken } from "@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation"; import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event"; import { Disposable, IDisposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle"; import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri"; import { ChatDebugLogLevel, IChatDebugEvent, IChatDebugLogProvider, IChatDebugResolvedEventContent } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatDebugService"; import { IChatDebugService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatDebugService.service"; export declare class ChatDebugServiceImpl extends Disposable implements IChatDebugService { readonly _serviceBrand: undefined; static readonly MAX_EVENTS_PER_SESSION = 10000; static readonly MAX_SESSIONS = 5; /** Per-session event buffers. Ordered from oldest to newest session (LRU). */ private readonly _sessionBuffers; /** Ordered list of session URIs for LRU eviction. */ private readonly _sessionOrder; /** Per-session tracking of seen event IDs to deduplicate events * that share the same ID (e.g. subagentInvocation + userMessage * emitted from the same span). Stores id → event kind so we can * keep the richer event kind on collision. */ private readonly _seenEventIds; private readonly _onDidAddEvent; readonly onDidAddEvent: Event; private readonly _onDidClearProviderEvents; readonly onDidClearProviderEvents: Event; private readonly _onDidChangeAvailableSessionResources; readonly onDidChangeAvailableSessionResources: Event; private readonly _providers; private readonly _invocationCts; /** Events that were returned by providers (not internally logged). */ private readonly _providerEvents; /** Session URIs created via import. */ private readonly _importedSessions; /** Session URIs reported by providers as available on disk (historical sessions). */ private readonly _availableSessionResources; private readonly _availableSessionResourceSet; /** Titles for historical sessions discovered from disk. */ private readonly _historicalSessionTitles; /** Human-readable titles for imported sessions. */ private readonly _importedSessionTitles; activeSessionResource: URI | undefined; /** Priority for deduplicating events with the same ID: lower = richer. */ private static readonly _eventKindPriority; /** Session types eligible for debug logging and provider invocation. */ private static readonly _debugEligibleSessionTypes; private _isDebugEligibleSession; log(sessionResource: URI, name: string, details?: string, level?: ChatDebugLogLevel, options?: { id?: string; category?: string; parentEventId?: string; }): void; addEvent(event: IChatDebugEvent): void; addProviderEvent(event: IChatDebugEvent): void; getEvents(sessionResource?: URI): readonly IChatDebugEvent[]; private _isSorted; private _deduplicateEvents; getSessionResources(): readonly URI[]; clear(): void; /** Remove all ancillary state for an evicted session. */ private _evictSession; registerProvider(provider: IChatDebugLogProvider): IDisposable; hasInvokedProviders(sessionResource: URI): boolean; invokeProviders(sessionResource: URI): Promise; private _invokeProvider; endSession(sessionResource: URI): void; private _clearProviderEvents; resolveEvent(eventId: string): Promise; isCoreEvent(event: IChatDebugEvent): boolean; setImportedSessionTitle(sessionResource: URI, title: string): void; getImportedSessionTitle(sessionResource: URI): string | undefined; addAvailableSessionResources(resources: readonly { uri: URI; title?: string; }[]): void; /** Lazy fetcher for available sessions from the extension. */ private _availableSessionsFetcher; private _availableSessionsFetchStarted; private _availableSessionsRequested; getAvailableSessionResources(): readonly URI[]; registerAvailableSessionsFetcher(fetcher: (token: CancellationToken) => Promise<{ uri: URI; title?: string; }[]>): void; private _tryFetchAvailableSessions; getHistoricalSessionTitle(sessionResource: URI): string | undefined; exportLog(sessionResource: URI): Promise; importLog(data: Uint8Array): Promise; dispose(): void; }