deepfish-ai 2.0.5 → 2.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -230,6 +230,8 @@ MCP(Model Context Protocol)允许 AI 连接外部工具和服务。通过 `a
230
230
  DeepFish 支持通过 Tool 和 Skill 扩展 AI 的能力。扩展文件可以放在当前工作目录的 `.deepfish-ai` 目录中,也可以放在全局配置目录中。
231
231
 
232
232
  - **Tool 扩展**:用于定义 AI 可直接调用的自定义函数工具,适合封装 API 调用、数据库操作、文件处理等能力。可以使用 `ai tools generate xxx` 命令让 AI 根据描述生成 Tool。
233
+ - 在 Tool 函数中,可以通过调用 `this.createSubAgent(prompt: string)` 创建子 Agent,并将任务说明作为 `prompt` 传入。
234
+ - 在 Tool 函数中,可以通过 `this.curAgent` 获取当前正在执行该 Tool 的 Agent 实例;当 Tool 运行在子 Agent 中时,`this.curAgent` 指向该子 Agent,而不是主 Agent。可用于访问当前 Agent 的上下文能力,例如 `this.curAgent.createSubAgent()` 继续创建下级子 Agent。
233
235
  - **Skill 扩展**:用于定义 AI 的工作流知识包,适合沉淀某类任务的执行步骤、规范和最佳实践。可以使用 `ai skills generate xxx` 命令让 AI 根据描述生成 Skill。
234
236
 
235
237
  ### 当前目录扩展
@@ -85,4 +85,4 @@ module.exports = { functions, descriptions };
85
85
  1. 理解用户要生成的工具功能
86
86
  2. 在当前工作目录下创建 `deepfish-tool-{功能名}/` 目录
87
87
  3. 编写 `index.js`,导出 `functions` 和 `descriptions`
88
- 4. 确保代码语法正确、可以直接 `require` 使用
88
+ 4. 确保代码语法正确、可以直接使用 `require`