refactor(core): rename TaskTool to AgentTool

Rename the Task tool to Agent tool for clearer semantics and better
alignment with industry terminology. This change includes:

- Rename TaskTool -> AgentTool, TaskParams -> AgentParams
- Rename TaskResultDisplay -> AgentResultDisplay
- Add 'Explore' built-in agent for read-only codebase exploration
- Add backward compatibility mappings for legacy tool names
- Improve Agent tool description with clearer usage guidelines
- Add case-insensitive agent name matching
- Fallback to built-in agents when subagent loading fails

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
tanzhenxin 2026-03-19 14:55:14 +08:00
parent 27356c1bac
commit 8891f4219d
37 changed files with 433 additions and 323 deletions

View file

@ -65,7 +65,7 @@ const basicPermissionOptions: readonly PermissionOptionConfig[] = [
] as const;
/**
* Tracks and emits events for sub-agent tool calls within TaskTool execution.
* Tracks and emits events for sub-agent tool calls within AgentTool execution.
*
* Uses the unified ToolCallEmitter for consistency with normal flow
* and history replay. Also handles permission requests for tools that
@ -106,7 +106,7 @@ export class SubAgentTracker {
/**
* Sets up event listeners for a sub-agent's tool events.
*
* @param eventEmitter - The AgentEventEmitter from TaskTool
* @param eventEmitter - The AgentEventEmitter from AgentTool
* @param abortSignal - Signal to abort tracking if parent is cancelled
* @returns Array of cleanup functions to remove listeners
*/