/** * AgentCore — AI 分身核心调度引擎(v2) * * 升级自 v1,集成: * - SkillRuntime: 技能管理(热加载 / 动态创建) * - MemoryStore: 持久化记忆 * - IntentEngine: LLM Function Calling 意图识别 * * 保持向后兼容:旧的 registerTool / executeTool API 仍可用 */ import type { Tool, ToolParameter, ToolResult, ToolCategory, TaskStep, AgentTask, AgentConfig, ParsedIntent } from "./types.js"; import { SkillRuntime } from "./skills/runtime.js"; import { MemoryStore } from "./memory/store.js"; import { type IntentEngineConfig, type ExecutionPlan } from "./intent/engine.js"; import type { SkillFactory } from "./skills/types.js"; export declare class AgentCore { /** 直接注册的工具(向后兼容) */ private tools; /** 任务历史 */ private tasks; /** 配置 */ private config; /** Skills 运行时 */ readonly skills: SkillRuntime; /** 记忆系统 */ readonly memory: MemoryStore; /** 意图引擎 */ private intentEngine; constructor(config?: AgentConfig, intentConfig?: IntentEngineConfig); /** * 完整初始化流程 * 加载记忆 → 激活所有 Skill → 启动自动保存 */ initialize(): Promise; /** * 优雅关闭 */ shutdown(): Promise; /** 注册工具(旧 API,保持兼容) */ registerTool(tool: Tool): void; /** 批量注册工具 */ registerTools(tools: Tool[]): void; /** 注销工具 */ unregisterTool(name: string): boolean; /** 注册内置 Skill */ registerSkill(factory: SkillFactory): void; /** 批量注册内置 Skill */ registerSkills(factories: SkillFactory[]): void; /** 从目录加载 Skill */ loadSkillsFromDir(dir: string): Promise; /** 获取单个工具(先查 Skill,再查直接注册) */ getTool(name: string): Tool | undefined; /** 获取所有可用工具(Skill 工具 + 直接注册的工具) */ getAllTools(): Tool[]; /** 获取所有工具描述(供 LLM function calling 使用) */ getToolDescriptions(): { name: string; description: string; category: ToolCategory; parameters: Record; }[]; /** 按分类获取工具 */ getToolsByCategory(category: ToolCategory): Tool[]; private getAllToolsCount; /** 获取当前配置 */ getConfig(): AgentConfig; /** 更新配置 */ updateConfig(partial: Partial): void; /** 执行单个工具 */ executeTool(name: string, params: Record): Promise; /** 执行多步骤任务(支持依赖链) */ executeTask(task: AgentTask): Promise; /** * 解析用户指令(v2) * 优先使用 LLM Function Calling,不可用时回退到正则 */ parseInstruction(instruction: string): Promise; /** * 旧版意图识别(保持向后兼容) * @deprecated 请使用 parseInstruction() */ parseIntent(instruction: string): ParsedIntent; /** 根据旧版意图生成步骤(保持向后兼容) */ intentToSteps(intent: ParsedIntent): TaskStep[]; /** * 自然语言 → LLM 意图识别 → 任务编排 → 执行 * * 这是主入口,升级后的版本: * 1. 记录用户消息到 Memory * 2. 使用 LLM Function Calling 解析意图 * 3. 生成并执行任务 * 4. 记录结果到 Memory */ run(instruction: string): Promise; /** 获取任务历史 */ getTaskHistory(): AgentTask[]; /** 获取单个任务 */ getTask(id: string): AgentTask | undefined; /** 获取 Agent 完整状态 */ getStatus(): { skills: { total: number; active: number; }; tools: number; memory: { memories: number; publishHistory: number; }; tasks: number; }; } //# sourceMappingURL=agent.d.ts.map