import { Event } from "../../../../base/common/event.js"; import { IDisposable } from "../../../../base/common/lifecycle.js"; import { URI } from "../../../../base/common/uri.js"; import { IChatDebugEvent, ChatDebugLogLevel, IChatDebugLogProvider, IChatDebugResolvedEventContent } from "@codingame/monaco-vscode-chat-service-override/vscode/vs/workbench/contrib/chat/common/chatDebugService"; export declare const IChatDebugService: import("../../../../platform/instantiation/common/instantiation.js").ServiceIdentifier; /** * Service for collecting and exposing chat debug events. * Internal components can log events, * and the debug editor pane can display them. */ export interface IChatDebugService extends IDisposable { readonly _serviceBrand: undefined; /** * Fired when a new event is added. */ readonly onDidAddEvent: Event; /** * Fired when provider events are cleared for a session (before re-invoking providers). */ readonly onDidClearProviderEvents: Event; /** * Log a generic event to the debug service. */ log(sessionResource: URI, name: string, details?: string, level?: ChatDebugLogLevel, options?: { id?: string; category?: string; parentEventId?: string; }): void; /** * Add a typed event to the debug service. */ addEvent(event: IChatDebugEvent): void; /** * Add an event sourced from an external provider. * These events are cleared before re-invoking providers to avoid duplicates. */ addProviderEvent(event: IChatDebugEvent): void; /** * Get all events for a specific session. */ getEvents(sessionResource?: URI): readonly IChatDebugEvent[]; /** * Get all session resources that have logged events. */ getSessionResources(): readonly URI[]; /** * The currently active session resource for debugging. */ activeSessionResource: URI | undefined; /** * Clear all logged events. */ clear(): void; /** * Register an external provider that can supply additional debug events. * This is used by the extension API (ChatDebugLogProvider). */ registerProvider(provider: IChatDebugLogProvider): IDisposable; /** * Check whether providers have already been invoked for a given session. */ hasInvokedProviders(sessionResource: URI): boolean; /** * Invoke all registered providers for a given session resource. * Called when the Debug View is opened to fetch events from extensions. */ invokeProviders(sessionResource: URI): Promise; /** * End a debug session: cancels any in-flight provider invocation, * disposes the associated CancellationTokenSource, and removes it. * Called when the chat session is disposed/archived. */ endSession(sessionResource: URI): void; /** * Resolve the full details of an event by its id. * Delegates to the registered provider's resolveChatDebugLogEvent. */ resolveEvent(eventId: string): Promise; /** * Fired when debug data is attached to a session. */ readonly onDidAttachDebugData: Event; /** * Mark a session as having debug data attached. */ markDebugDataAttached(sessionResource: URI): void; /** * Check whether a session has had debug data attached. */ hasAttachedDebugData(sessionResource: URI): boolean; }