/** * Claude Executor * * 使用 Claude Agent SDK 执行任务。 * * 支持功能: * - 完整的 Agent 能力(代码理解、文件编辑、命令执行等) * - 工具调用(MCP) * - 权限管理 * - 流式输出 * * 注意: * - Claude Agent SDK 需要 Anthropic-compatible env,但值必须来自 * invocation-scoped Xpod AI Connection,不允许直接投递 Pod provider secret。 * - SDK 会自动处理复杂的交互逻辑 */ import { BaseAgentExecutor } from './BaseAgentExecutor'; import type { ExecutorType, AuthType, AuthInfo, ExecutorConfig, ExecuteMessage, ChatMessage, ExecuteResult, BaseExecutorOptions } from './types'; /** * Claude 鉴权错误 */ export declare class ClaudeAuthenticationError extends Error { constructor(message?: string); } export declare class ClaudeExecutor extends BaseAgentExecutor { readonly executorType: ExecutorType; /** * 获取认证类型 */ getAuthType(): AuthType; /** * 获取环境变量配置 */ private getEnvConfig; private requireAiConnections; /** * 检查认证状态 */ checkAuthentication(): Promise; /** * 构建 SDK Options */ private buildOptions; /** * 执行任务(流式) */ execute(config: ExecutorConfig, message: string): AsyncGenerator; /** * 多轮对话 * * 注意:Claude Agent SDK 主要设计用于单次查询模式, * 多轮对话需要通过 session API(V2,目前不稳定)或 * 在 prompt 中包含历史消息。 */ chat(config: ExecutorConfig, messages: ChatMessage[]): Promise; } /** * 创建 Claude executor 实例 */ export declare function createClaudeExecutor(options?: BaseExecutorOptions): ClaudeExecutor;