@yuantest/playwright - v1.2.1
    正在准备搜索索引...

    类 ChatService

    UnifiedAIService — 统一 AI 服务。

    完全合并 ChatService(对话管理 + MCP 连接)和 AgentService(测试管线编排), 所有子管理器归该类直接持有,不存在内部委托。

    聊天系统(sendMessage)的 executeTool 可直接调用 this.plan() / this.heal() 等 Agent 管线方法,无需经过 ToolRegistry 桥接。

    索引

    构造函数

    • 参数

      • dataDir: string
      • projectRoot: string
      • toolRegistry: ToolRegistry
      • 可选llmConfig: LLMConfig
      • 可选sharedLLMService: LLMService
      • 可选mcpConfigService: MCPConfigService
      • 可选sharedMCPClientManager: MCPClientManager
      • 可选agentConfig: Partial<AgentConfig>
      • 可选sharedToolRegistry: ToolRegistry

      返回 ChatService

    方法

    • 统一 LLM 连接状态查询

      返回:{ configured, connected, status: 'green' | 'yellow' | 'red' }

      • green: 已配置且连接成功
      • yellow: 已配置但连接失败
      • red: 未配置或未启用

      返回 Promise<
          {
              configured: boolean;
              connected: boolean;
              status: "green"
              | "yellow"
              | "red";
          },
      >

    • 参数

      • 可选title: string

      返回 Conversation

    • 参数

      • id: string

      返回 Conversation | null

    • 参数

      • id: string
      • enabled: boolean

      返回 Promise<void>

    • 返回 { name: string; description: string; source: "builtin" | "mcp" }[]

    • 参数

      • conversationId: string
      • userMessage: string
      • onEvent: (event: SSEEvent) => void

      返回 Promise<void>

    • 参数

      • planContent: string
      • 可选options: { outputDir?: string; seedTest?: string }

      返回 Promise<AgentResult<string[]>>

    • 参数

      • testFilePath: string
      • 可选options: { runId?: string; testId?: string; error?: string; stackTrace?: string }

      返回 Promise<AgentResult<AgentHealResult>>

    • 参数

      • prompts: Partial<AgentPrompts> | null

      返回 void

    • 参数

      • manager: BrowserSessionManager | null

      返回 void