import { Disposable } from "../../../../base/common/lifecycle.js"; import { IObservable } from "../../../../base/common/observable.js"; import { URI } from "../../../../base/common/uri.js"; import { IOffsetRange } from "../../../../editor/common/core/ranges/offsetRange.js"; import { IConfigurationService } from "../../../../platform/configuration/common/configuration.service.js"; import { IContextKeyService } from "../../../../platform/contextkey/common/contextkey.service.js"; import { ILogService } from "../../../../platform/log/common/log.service.js"; import { IStorageService } from "../../../../platform/storage/common/storage.service.js"; import { IChatAgentService } from "./participants/chatAgents.service.js"; import { ChatModeKind } from "./constants.js"; import { IHandOff } from "./promptSyntax/promptFileParser.js"; import { ExtensionAgentSourceType, IAgentSource, ICustomAgent, ICustomAgentVisibility, PromptsStorage } from "./promptSyntax/service/promptsService.js"; import { IPromptsService } from "./promptSyntax/service/promptsService.service.js"; import { Target } from "./promptSyntax/promptTypes.js"; import { ThemeIcon } from "../../../../base/common/themables.js"; import { IChatModeService } from "./chatModes.service.js"; export declare class ChatModeService extends Disposable implements IChatModeService { private readonly promptsService; private readonly chatAgentService; private readonly logService; private readonly storageService; private readonly configurationService; readonly _serviceBrand: undefined; private static readonly CUSTOM_MODES_STORAGE_KEY; private readonly hasCustomModes; private readonly agentModeDisabledByPolicy; private readonly _customModeInstances; private readonly _onDidChangeChatModes; readonly onDidChangeChatModes: import("../../../../base/common/event.js").Event; constructor(promptsService: IPromptsService, chatAgentService: IChatAgentService, contextKeyService: IContextKeyService, logService: ILogService, storageService: IStorageService, configurationService: IConfigurationService); private loadCachedModes; private deserializeCachedModes; private saveCachedModes; private refreshCustomPromptModes; getModes(): { builtin: readonly IChatMode[]; custom: readonly IChatMode[]; }; findModeById(id: string | ChatModeKind): IChatMode | undefined; findModeByName(name: string): IChatMode | undefined; private getBuiltinModes; private getCustomModes; private updateAgentModePolicyContextKey; private isAgentModeDisabledByPolicy; } export interface IChatModeData { readonly id: string; readonly name: string; readonly description?: string; readonly kind: ChatModeKind; readonly customTools?: readonly string[]; readonly model?: readonly string[] | string; readonly argumentHint?: string; readonly modeInstructions?: IChatModeInstructions; readonly body?: string; readonly handOffs?: readonly IHandOff[]; readonly uri?: URI; readonly source?: IChatModeSourceData; readonly target?: Target; readonly visibility?: ICustomAgentVisibility; readonly agents?: readonly string[]; readonly infer?: boolean; } export interface IChatMode { readonly id: string; readonly name: IObservable; readonly label: IObservable; readonly icon: IObservable; readonly description: IObservable; readonly isBuiltin: boolean; readonly kind: ChatModeKind; readonly customTools?: IObservable; readonly handOffs?: IObservable; readonly model?: IObservable; readonly argumentHint?: IObservable; readonly modeInstructions?: IObservable; readonly uri?: IObservable; readonly source?: IAgentSource; readonly target: IObservable; readonly visibility?: IObservable; readonly agents?: IObservable; } export interface IVariableReference { readonly name: string; readonly range: IOffsetRange; } export interface IChatModeInstructions { readonly content: string; readonly toolReferences: readonly IVariableReference[]; readonly metadata?: Record; } export declare class CustomChatMode implements IChatMode { private readonly _nameObservable; private readonly _descriptionObservable; private readonly _customToolsObservable; private readonly _modeInstructions; private readonly _uriObservable; private readonly _modelObservable; private readonly _argumentHintObservable; private readonly _handoffsObservable; private readonly _targetObservable; private readonly _visibilityObservable; private readonly _agentsObservable; private _source; readonly id: string; get name(): IObservable; get description(): IObservable; get icon(): IObservable; get isBuiltin(): boolean; get customTools(): IObservable; get model(): IObservable; get argumentHint(): IObservable; get modeInstructions(): IObservable; get uri(): IObservable; get label(): IObservable; get handOffs(): IObservable; get source(): IAgentSource; get target(): IObservable; get visibility(): IObservable; get agents(): IObservable; readonly kind = ChatModeKind.Agent; constructor(customChatMode: ICustomAgent); /** * Updates the underlying data and triggers observable changes */ updateData(newData: ICustomAgent): void; toJSON(): IChatModeData; } type IChatModeSourceData = { readonly storage: PromptsStorage.extension; readonly extensionId: string; type?: ExtensionAgentSourceType; } | { readonly storage: PromptsStorage.local | PromptsStorage.user; } | { readonly storage: PromptsStorage.plugin; readonly pluginUri: URI; }; export declare class BuiltinChatMode implements IChatMode { readonly kind: ChatModeKind; readonly name: IObservable; readonly label: IObservable; readonly description: IObservable; readonly icon: IObservable; readonly target: IObservable; constructor(kind: ChatModeKind, label: string, description: string, icon: ThemeIcon); get isBuiltin(): boolean; get id(): string; /** * Getters are not json-stringified */ toJSON(): IChatModeData; } export declare namespace ChatMode { const Ask: BuiltinChatMode; const Edit: BuiltinChatMode; const Agent: BuiltinChatMode; } export declare function isBuiltinChatMode(mode: IChatMode): boolean; /** * Returns a telemetry-safe mode name. User/local mode names are hashed * to avoid leaking PII; builtin and extension mode names are returned as-is. */ export declare function getModeNameForTelemetry(mode: IChatMode): string; export {};