import { CancellationToken } from "../../../../base/common/cancellation.js"; import { Event } from "../../../../base/common/event.js"; import { IDisposable } from "../../../../base/common/lifecycle.js"; import { ThemeIcon } from "../../../../base/common/themables.js"; import { URI } from "../../../../base/common/uri.js"; import { IChatService } from "./chatService/chatService.service.js"; import { IChatSessionsExtensionPoint, IChatSessionItemController, IChatSessionItem, IChatSessionContentProvider, IChatSession, IChatSessionProviderOptionItem, IChatSessionProviderOptionGroup, IChatSessionOptionsWillNotifyExtensionEvent } from "./chatSessionsService.js"; import { IChatModel } from "./model/chatModel.js"; import { IChatAgentAttachmentCapabilities, IChatAgentRequest } from "./participants/chatAgents.js"; import { Target } from "./promptSyntax/promptTypes.js"; export declare const IChatSessionsService: import("../../../../platform/instantiation/common/instantiation.js").ServiceIdentifier; export interface IChatSessionsService { readonly _serviceBrand: undefined; readonly onDidChangeItemsProviders: Event<{ readonly chatSessionType: string; }>; readonly onDidChangeSessionItems: Event<{ readonly chatSessionType: string; }>; readonly onDidChangeAvailability: Event; readonly onDidChangeInProgress: Event; getChatSessionContribution(chatSessionType: string): IChatSessionsExtensionPoint | undefined; registerChatSessionItemController(chatSessionType: string, controller: IChatSessionItemController): IDisposable; activateChatSessionItemProvider(chatSessionType: string): Promise; getAllChatSessionContributions(): IChatSessionsExtensionPoint[]; getIconForSessionType(chatSessionType: string): ThemeIcon | URI | undefined; getWelcomeTitleForSessionType(chatSessionType: string): string | undefined; getWelcomeMessageForSessionType(chatSessionType: string): string | undefined; getInputPlaceholderForSessionType(chatSessionType: string): string | undefined; /** * Get the list of current chat session items grouped by session type. * @param providerTypeFilter If specified, only returns items from the given providers. If undefined, returns items from all providers. */ getChatSessionItems(providerTypeFilter: readonly string[] | undefined, token: CancellationToken): Promise>; /** * Forces the controllers to refresh their session items, optionally filtered by provider type. */ refreshChatSessionItems(providerTypeFilter: readonly string[] | undefined, token: CancellationToken): Promise; reportInProgress(chatSessionType: string, count: number): void; getInProgress(): { displayName: string; count: number; }[]; readonly onDidChangeContentProviderSchemes: Event<{ readonly added: string[]; readonly removed: string[]; }>; getContentProviderSchemes(): string[]; registerChatSessionContentProvider(scheme: string, provider: IChatSessionContentProvider): IDisposable; canResolveChatSession(sessionType: string): Promise; getOrCreateChatSession(sessionResource: URI, token: CancellationToken): Promise; hasAnySessionOptions(sessionResource: URI): boolean; getSessionOption(sessionResource: URI, optionId: string): string | IChatSessionProviderOptionItem | undefined; setSessionOption(sessionResource: URI, optionId: string, value: string | IChatSessionProviderOptionItem): boolean; /** * Fired when options for a chat session change. */ readonly onDidChangeSessionOptions: Event; /** * Get the capabilities for a specific session type */ getCapabilitiesForSessionType(chatSessionType: string): IChatAgentAttachmentCapabilities | undefined; /** * Get the customAgentTarget for a specific session type. * When the Target is not `Target.Undefined`, the mode picker should show filtered custom agents matching this target. */ getCustomAgentTargetForSessionType(chatSessionType: string): Target; /** * Returns whether the session type requires custom models. When true, the model picker should show filtered custom models. */ requiresCustomModelsForSessionType(chatSessionType: string): boolean; readonly onDidChangeOptionGroups: Event; getOptionGroupsForSessionType(chatSessionType: string): IChatSessionProviderOptionGroup[] | undefined; setOptionGroupsForSessionType(chatSessionType: string, handle: number, optionGroups?: IChatSessionProviderOptionGroup[]): void; getNewSessionOptionsForSessionType(chatSessionType: string): Record | undefined; setNewSessionOptionsForSessionType(chatSessionType: string, options: Record): void; /** * Event fired when session options change and need to be sent to the extension. * MainThreadChatSessions subscribes to this to forward changes to the extension host. * Uses IWaitUntil pattern to allow listeners to register async work. */ readonly onRequestNotifyExtension: Event; notifySessionOptionsChange(sessionResource: URI, updates: ReadonlyArray<{ optionId: string; value: string | IChatSessionProviderOptionItem; }>): Promise; registerChatModelChangeListeners(chatService: IChatService, chatSessionType: string, onChange: () => void): IDisposable; getInProgressSessionDescription(chatModel: IChatModel): string | undefined; /** * Creates a new chat session item using the controller's newChatSessionItemHandler. * Returns undefined if the controller doesn't have a handler or if no controller is registered. */ createNewChatSessionItem(chatSessionType: string, request: IChatAgentRequest, token: CancellationToken): Promise; /** * Registers an alias so that session-option lookups by the real resource * are redirected to the canonical (untitled) resource in the internal session map. */ registerSessionResourceAlias(untitledResource: URI, realResource: URI): void; }