@saber2pr/ai-agent 0.0.30 → 0.0.31
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/lib/core/agent-graph.js +10 -4
- package/package.json +1 -1
package/lib/core/agent-graph.js
CHANGED
|
@@ -365,13 +365,19 @@ class McpGraphAgent {
|
|
|
365
365
|
进度:{doneCount}/{targetCount}
|
|
366
366
|
已审计文件:{auditedList}
|
|
367
367
|
|
|
368
|
-
#
|
|
368
|
+
# 🛠️ 工具调用规范
|
|
369
369
|
1. Arguments 必须是纯粹的 JSON 对象,严禁将其作为字符串放入引号中。
|
|
370
370
|
2. 严禁对 JSON 内容进行二次转义。
|
|
371
|
+
3. **禁止空操作**:如果你认为任务已完成或不需要调用工具,请不要输出任何 Action 结构。严禁使用 "None"、"null" 或空字符串作为工具名称。
|
|
371
372
|
|
|
372
|
-
#
|
|
373
|
-
1.
|
|
374
|
-
2.
|
|
373
|
+
# 🎯 核心指令
|
|
374
|
+
1. **任务终结判定**:当你已经读取了用户要求的文件、回答了问题或完成了审计目标时,必须立即提供最终回复。
|
|
375
|
+
2. **回复格式**:任务完成时,请以 "Final Answer:" 开头进行总结,此时不再调用任何工具。
|
|
376
|
+
3. **避免重复**:不要重复调用相同的工具和参数。如果工具返回错误,请分析原因(如参数 Schema 错误)而不是盲目重试。{recentToolCalls}
|
|
377
|
+
|
|
378
|
+
# 📝 审计任务专项
|
|
379
|
+
1. 避免在同一个文件上陷入无限循环尝试。
|
|
380
|
+
2. 优先通过 \`list_directory\` 了解全局,再深入具体文件。
|
|
375
381
|
{extraPrompt}`;
|
|
376
382
|
// 2. 核心逻辑:处理消息上下文
|
|
377
383
|
let inputMessages;
|