/** * Agent Executor Factory * * 从 Pod 读取凭证和 Provider 配置,创建对应的 Agent 执行器。 * * 支持的执行器类型: * - codebuddy: CodeBuddy Agent SDK * - claude: Claude Agent SDK * * 使用流程: * 1. 从 Pod 读取 Provider 配置 * 2. 从 Pod 读取对应的 Credential * 3. 根据 runtimeKind 创建对应的执行器实例 */ import type { IAgentExecutor, ExecutorType, AiCredential, ProviderConfig, BaseExecutorOptions, AIConnectionInvocationConfig } from './types'; /** * 支持的执行器类型 */ export declare const SUPPORTED_EXECUTOR_TYPES: ExecutorType[]; /** * Agent Executor Factory * * 负责从 Pod 读取配置并创建执行器实例。 */ export declare class AgentExecutorFactory { private readonly logger; private resolveModelId; /** * 检查执行器类型是否支持 */ isSupported(executorType: string): executorType is ExecutorType; /** * 从 Pod 创建执行器 * * @param podBaseUrl Pod 根 URL * @param providerId 供应商 ID * @param authenticatedFetch 带认证的 fetch 函数 * @param webId 用户 WebID(可选) * @returns 执行器实例,如果未找到配置则返回 null */ create(podBaseUrl: string, providerId: string, runtimeKind: ExecutorType, authenticatedFetch: typeof fetch, webId?: string, aiConnection?: AIConnectionInvocationConfig): Promise; /** * 列出所有可用的供应商 */ listProviders(podBaseUrl: string, authenticatedFetch: typeof fetch, runtimeKind: ExecutorType, webId?: string): Promise; /** * 列出所有启用的供应商 */ listEnabledProviders(podBaseUrl: string, authenticatedFetch: typeof fetch, runtimeKind: ExecutorType, webId?: string): Promise; /** * 列出所有支持的供应商(runtimeKind 受支持且已启用) */ listSupportedProviders(podBaseUrl: string, authenticatedFetch: typeof fetch, runtimeKind: ExecutorType, webId?: string): Promise; /** * 根据 executorType 创建执行器 */ createExecutor(executorType: ExecutorType, options: BaseExecutorOptions): IAgentExecutor; /** * 创建指定类型的执行器(直接使用凭证,不从 Pod 读取) * * 用于测试或已知凭证的场景。 */ createDirect(executorType: ExecutorType, providerId: string, credential: AiCredential, aiConnection?: AIConnectionInvocationConfig): IAgentExecutor; } /** * 默认工厂实例 */ export declare const agentExecutorFactory: AgentExecutorFactory;