/**
 * SmartPerfetto Base SubAgent
 *
 * SubAgent 基类，提供：
 * 1. 通用的 Think-Act 循环框架
 * 2. 工具注册和调用
 * 3. 与 ModelRouter 的集成
 * 4. 结果提取和格式化
 * 5. 生命周期钩子支持
 */
import { EventEmitter } from 'events';
import { SubAgentConfig, SubAgentContext, SubAgentResult, Finding, ToolResult, PipelineStage } from '../../types';
import { ModelRouter } from '../../core/modelRouter';
import { StageExecutor } from '../../core/pipelineExecutor';
import { HookRegistry, HookContext } from '../../hooks';
/**
 * 工具接口
 */
export interface AgentTool {
    name: string;
    description: string;
    execute(params: Record<string, any>, context: SubAgentContext): Promise<ToolResult>;
}
export type NextAction = string | {
    toolName: string;
    params?: Record<string, any>;
};
/**
 * 思考结果
 */
export interface ThinkResult {
    observation: string;
    reasoning: string;
    decision: 'continue' | 'conclude' | 'delegate';
    nextActions: NextAction[];
    confidence: number;
}
/**
 * SubAgent 基类
 */
export declare abstract class BaseSubAgent extends EventEmitter implements StageExecutor {
    protected config: SubAgentConfig;
    protected modelRouter: ModelRouter;
    protected tools: Map<string, AgentTool>;
    protected currentIteration: number;
    protected hookRegistry: HookRegistry;
    protected hookContext: HookContext | null;
    constructor(config: SubAgentConfig, modelRouter: ModelRouter, hookRegistry?: HookRegistry);
    /**
     * 构建系统提示词
     */
    protected abstract buildSystemPrompt(context: SubAgentContext): string;
    /**
     * 构建任务提示词
     */
    protected abstract buildTaskPrompt(context: SubAgentContext): string;
    /**
     * 解析 LLM 响应
     */
    protected abstract parseResponse(response: string, context: SubAgentContext): SubAgentResult;
    /**
     * 执行分析（实现 StageExecutor 接口）
     */
    execute(stage: PipelineStage, context: SubAgentContext): Promise<SubAgentResult>;
    /**
     * Think-Act 循环
     */
    protected runThinkActLoop(context: SubAgentContext): Promise<SubAgentResult>;
    /**
     * 思考步骤
     */
    protected think(context: SubAgentContext, currentFindings: Finding[]): Promise<ThinkResult>;
    /**
     * 执行动作
     */
    protected act(action: NextAction, context: SubAgentContext): Promise<ToolResult | null>;
    /**
     * 构建思考提示词
     */
    protected buildThinkPrompt(context: SubAgentContext, currentFindings: Finding[]): string;
    /**
     * 获取工具描述
     */
    protected getToolsDescription(): string;
    /**
     * 解析思考响应
     */
    protected parseThinkResponse(response: string): ThinkResult;
    /**
     * 从工具结果中提取发现
     */
    protected extractFindings(result: ToolResult): Finding[];
    /**
     * 生成建议
     */
    protected generateSuggestions(findings: Finding[], context: SubAgentContext): Promise<string[]>;
    /**
     * 注册工具
     */
    registerTool(tool: AgentTool): void;
    /**
     * 注册多个工具
     */
    registerTools(tools: AgentTool[]): void;
    /**
     * 获取工具
     */
    getTool(name: string): AgentTool | undefined;
    /**
     * 列出工具
     */
    listTools(): string[];
    /**
     * 获取配置
     */
    getConfig(): SubAgentConfig;
    /**
     * 获取 ID
     */
    get id(): string;
    /**
     * 获取类型
     */
    get type(): string;
    /**
     * 获取名称
     */
    get name(): string;
    /**
     * 重置状态
     */
    reset(): void;
}
export default BaseSubAgent;
//# sourceMappingURL=baseSubAgent.d.ts.map