import { ContributionProvider, Emitter, Event, ILogger, PreferenceService } from '@theia/core'; import { ChatAgent } from './chat-agents'; import { AgentService, AISettingsService } from '@theia/ai-core'; import { ParsedChatRequest } from './parsed-chat-request'; /** * The default chat agent to invoke */ export declare const DefaultChatAgentId: unique symbol; export interface DefaultChatAgentId { id: string; } /** * In case no fitting chat agent is available, this one will be used (if it is itself available) */ export declare const FallbackChatAgentId: unique symbol; export interface FallbackChatAgentId { id: string; } export declare const ChatAgentService: unique symbol; export declare const ChatAgentServiceFactory: unique symbol; /** * The ChatAgentService provides access to the available chat agents. */ export interface ChatAgentService { /** * Returns all available agents. * @param includeHidden whether to include agents that are hidden from chat (showInChat set to false). Defaults to false, meaning hidden agents will not be returned. */ getAgents(includeHidden?: boolean): ChatAgent[]; /** * Returns the specified agent, if available * @param id the agent id * @param includeHidden whether to include agents that are hidden from chat (showInChat set to false). Defaults to false, meaning hidden agents will not be returned. */ getAgent(id: string, includeHidden?: boolean): ChatAgent | undefined; /** * Returns all agents, including disabled ones. */ getAllAgents(): ChatAgent[]; /** * Allows to register a chat agent programmatically. * @param agent the agent to register */ registerChatAgent(agent: ChatAgent): void; /** * Allows to unregister a chat agent programmatically. * @param agentId the agent id to unregister */ unregisterChatAgent(agentId: string): void; /** * Returns the configured default chat agent, if available and enabled. */ getDefaultAgent(): ChatAgent | undefined; /** * Returns the configured fallback chat agent, if available and enabled. */ getFallbackAgent(): ChatAgent | undefined; /** * Resolves the agent from a parsed request. * Checks for explicit @agent mention first, then preference-based default, * then DI-bound default, and finally falls back to the fallback agent. * @param parsedRequest The parsed chat request to resolve the agent from * @returns The resolved agent, or undefined if no agent could be determined */ resolveAgent(parsedRequest: ParsedChatRequest): ChatAgent | undefined; /** * Returns the user's preference-configured default chat agent, if available and enabled. * This takes precedence over the DI-bound default agent. */ getPreferenceDefaultAgent(): ChatAgent | undefined; /** * Returns the effective default agent by checking preference first, then DI-bound default. * @returns The effective default agent, or undefined if none is configured or available */ getEffectiveDefaultAgent(): ChatAgent | undefined; /** * Fired when an agent is registered or unregistered. */ readonly onDidChangeAgents: Event; /** * Fired when the effective default agent changes (either through preference change * or when the configured agent becomes available/unavailable). */ readonly onDefaultAgentChanged: Event; } export declare class ChatAgentServiceImpl implements ChatAgentService { protected readonly onDidChangeAgentsEmitter: Emitter; readonly onDidChangeAgents: Event; protected readonly onDefaultAgentChangedEmitter: Emitter; readonly onDefaultAgentChanged: Event; protected readonly agentContributions: ContributionProvider; protected readonly logger: ILogger; protected readonly agentService: AgentService; protected readonly preferenceService: PreferenceService | undefined; protected readonly defaultChatAgentId: DefaultChatAgentId | undefined; protected readonly fallbackChatAgentId: FallbackChatAgentId | undefined; protected readonly aiSettingsService: AISettingsService | undefined; protected _agents: ChatAgent[]; protected hiddenFromChatAgents: Set; protected _cachedPreferenceDefaultAgentId: string | undefined; protected init(): void; protected handleDefaultAgentPreferenceChange(): void; protected checkAndFireDefaultAgentChange(): void; protected get agents(): ChatAgent[]; registerChatAgent(agent: ChatAgent): void; unregisterChatAgent(agentId: string): void; getAgent(id: string, includeHidden?: boolean): ChatAgent | undefined; getAgents(includeHidden?: boolean): ChatAgent[]; getAllAgents(): ChatAgent[]; private _agentIsEnabled; private _agentShowsInChat; getDefaultAgent(): ChatAgent | undefined; getFallbackAgent(): ChatAgent | undefined; getPreferenceDefaultAgent(): ChatAgent | undefined; getEffectiveDefaultAgent(): ChatAgent | undefined; resolveAgent(parsedRequest: ParsedChatRequest): ChatAgent | undefined; } //# sourceMappingURL=chat-agent-service.d.ts.map