@@ -34,7 +34,7 @@ function QuickSummary({ isExpanded, onToggle }: { isExpanded: boolean; onToggle:
3434 < div className = "bg-[var(--bg-terminal)]/50 rounded-lg p-4 border-l-4 border-[var(--cyber-blue)]" >
3535 < p className = "text-[var(--text-primary)] font-medium" >
3636 < span className = "text-[var(--cyber-blue)] font-bold" > 一句话:</ span >
37- 可配置的子代理执行框架,通过 TOML 定义 Agent,支持本地执行和远程 A2A 调用
37+ 可配置的子代理执行框架,通过 Markdown + YAML frontmatter 定义 Agent,支持本地执行和远程 A2A 调用
3838 </ p >
3939 </ div >
4040
@@ -53,7 +53,7 @@ function QuickSummary({ isExpanded, onToggle }: { isExpanded: boolean; onToggle:
5353 < div className = "text-xs text-[var(--text-muted)]" > 配置层级</ div >
5454 </ div >
5555 < div className = "bg-[var(--bg-card)] rounded-lg p-3 text-center border border-[var(--border-subtle)]" >
56- < div className = "text-2xl font-bold text-[var(--purple)]" > 2 </ div >
56+ < div className = "text-2xl font-bold text-[var(--purple)]" > 3 </ div >
5757 < div className = "text-xs text-[var(--text-muted)]" > 内置 Agent</ div >
5858 </ div >
5959 </ div >
@@ -63,7 +63,7 @@ function QuickSummary({ isExpanded, onToggle }: { isExpanded: boolean; onToggle:
6363 < h4 className = "text-sm font-semibold text-[var(--text-muted)] mb-2" > Agent 执行流程</ h4 >
6464 < div className = "flex items-center gap-2 flex-wrap text-sm" >
6565 < span className = "px-3 py-1.5 bg-[var(--cyber-blue)]/20 text-[var(--cyber-blue)] rounded-lg border border-[var(--cyber-blue)]/30" >
66- TOML 加载
66+ Markdown frontmatter 加载
6767 </ span >
6868 < span className = "text-[var(--text-muted)]" > →</ span >
6969 < span className = "px-3 py-1.5 bg-[var(--purple)]/20 text-[var(--purple)] rounded-lg border border-[var(--purple)]/30" >
@@ -98,15 +98,15 @@ export function AgentFramework() {
9898
9999 const architectureChart = `flowchart TD
100100 subgraph Config["📁 配置层"]
101- TOML[TOML 配置文件]
101+ TOML[Markdown 配置文件]
102102 BUILTIN[内置 Agent]
103103 end
104104
105105 subgraph Registry["📋 AgentRegistry"]
106106 REG[注册与管理]
107107 REG --> |用户级| USER["~/.gemini/agents/"]
108108 REG --> |项目级| PROJ[".gemini/agents/"]
109- REG --> |内置| BUILT[CodebaseInvestigator\nIntrospectionAgent ]
109+ REG --> |内置| BUILT[codebase_investigator\ncli_help\ngeneralist ]
110110 end
111111
112112 subgraph Execution["⚡ 执行层"]
@@ -252,15 +252,28 @@ export class AgentRegistry {
252252 }
253253
254254 private loadBuiltInAgents(): void {
255+ const investigatorSettings = this.config.getCodebaseInvestigatorSettings();
256+ const cliHelpSettings = this.config.getCliHelpAgentSettings();
257+ const agentsOverrides = this.config.getAgentsSettings().overrides ?? {};
258+
255259 // CodebaseInvestigator - 代码库探索
256- if (this.config.getCodebaseInvestigatorSettings()?.enabled) {
260+ if (
261+ investigatorSettings?.enabled &&
262+ agentsOverrides[CodebaseInvestigatorAgent.name]?.enabled !== false
263+ ) {
257264 this.registerLocalAgent(CodebaseInvestigatorAgent);
258265 }
259266
260- // IntrospectionAgent - 自省分析
261- if (this.config.getIntrospectionAgentSettings().enabled) {
262- this.registerLocalAgent(IntrospectionAgent);
267+ // CLI Help - 文档问答
268+ if (
269+ cliHelpSettings.enabled &&
270+ agentsOverrides[CliHelpAgent.name]?.enabled !== false
271+ ) {
272+ this.registerLocalAgent(CliHelpAgent(this.config));
263273 }
274+
275+ // Generalist - 通用代理(实验特性)
276+ this.registerLocalAgent(GeneralistAgent(this.config));
264277 }
265278
266279 // 获取 Agent 目录上下文(注入到系统提示词)
@@ -274,14 +287,22 @@ export class AgentRegistry {
274287 }
275288}` ;
276289
277- const tomlConfigCode = `# ~/.gemini/agents/code-reviewer.toml
278- name = "code-reviewer"
279- description = "专业代码审查,检查最佳实践和潜在问题"
280- tools = ["read_file", "search_file_content", "glob", "list_directory"]
290+ const markdownConfigCode = `---
291+ kind: local
292+ name: code-reviewer
293+ description: 专业代码审查,检查最佳实践和潜在问题
294+ display_name: Code Reviewer
295+ tools:
296+ - read_file
297+ - search_file_content
298+ - glob
299+ - list_directory
281300# 说明:内置工具使用 tool name(如 read_file);MCP 工具用 server__tool 格式
282-
283- [prompts]
284- system_prompt = """
301+ model: gemini-2.5-flash
302+ temperature: 0.3
303+ max_turns: 10
304+ timeout_mins: 5
305+ ---
285306You are a senior code reviewer. Analyze the code for:
286307- Best practices and patterns
287308- Potential bugs and issues
@@ -291,16 +312,7 @@ You are a senior code reviewer. Analyze the code for:
291312Current model: \${activeModel}
292313Today: \${today}
293314
294- When asked to review code, focus on actionable feedback.
295- """
296-
297- [model]
298- model = "gemini-2.0-flash"
299- temperature = 0.3
300-
301- [run]
302- max_turns = 10
303- timeout_mins = 5` ;
315+ When asked to review code, focus on actionable feedback.` ;
304316
305317 const remoteAgentNote = `注意:远程 Agent 通过 A2A (Agent-to-Agent) 协议调用,
306318配置需要提供 agent_card_url 指向远程 Agent 的描述文件。
@@ -559,7 +571,7 @@ this.emitActivity('ERROR', { error: errorMessage, context: 'tool_call' });`;
559571 Agent Framework 代理框架
560572 </ h1 >
561573 < p className = "text-xl text-[var(--text-muted)]" >
562- 可配置的子代理执行框架 - TOML 驱动的 Agent 定义与执行
574+ 可配置的子代理执行框架 - Markdown frontmatter 驱动的 Agent 定义与执行
563575 </ p >
564576 </ div >
565577
@@ -571,7 +583,7 @@ this.emitActivity('ERROR', { error: errorMessage, context: 'tool_call' });`;
571583 { /* 核心架构 */ }
572584 < Layer title = "核心架构" >
573585 < p className = "text-[var(--text-secondary)] mb-6" >
574- Agent Framework 提供了一套完整的子代理系统,支持通过 TOML 配置文件定义 Agent,
586+ Agent Framework 提供了一套完整的子代理系统,支持通过 Markdown + YAML frontmatter 定义 Agent,
575587 并在隔离的执行环境中运行。支持本地执行和远程 A2A (Agent-to-Agent) 调用。
576588 </ p >
577589 < MermaidDiagram chart = { architectureChart } />
@@ -652,14 +664,14 @@ this.emitActivity('ERROR', { error: errorMessage, context: 'tool_call' });`;
652664 </ div >
653665 </ Layer >
654666
655- { /* TOML 配置示例 */ }
656- < Layer title = "TOML 配置示例" >
667+ { /* Markdown 配置示例 */ }
668+ < Layer title = "Markdown 配置示例" >
657669 < p className = "text-[var(--text-secondary)] mb-4" >
658- Agent 通过 TOML 文件定义,放置在 < code > ~/.gemini/agents/ </ code > (用户级) 或
659- < code > .gemini/agents/</ code > (项目级) 目录下。
670+ Agent 通过 Markdown 文件 + YAML frontmatter 定义(文件必须以 < code > --- </ code > 开头),放置在
671+ < code > ~/ .gemini/agents/</ code > (用户级) 或 < code > .gemini/agents/ </ code > ( 项目级) 目录下(仅加载 < code > .md </ code > ) 。
660672 </ p >
661673
662- < CodeBlock code = { tomlConfigCode } language = "toml " title = "本地 Agent 配置示例" />
674+ < CodeBlock code = { markdownConfigCode } language = "markdown " title = "本地 Agent 配置示例" />
663675
664676 < div className = "mt-6 bg-[var(--amber)]/10 rounded-lg p-4 border border-[var(--amber)]/30" >
665677 < h4 className = "text-[var(--amber)] font-bold mb-2" > 关于远程 Agent</ h4 >
@@ -688,11 +700,11 @@ this.emitActivity('ERROR', { error: errorMessage, context: 'tool_call' });`;
688700 < CodeBlock code = { registryCode } language = "typescript" title = "registry.ts" />
689701
690702 < div className = "mt-6 grid grid-cols-1 md:grid-cols-3 gap-4" >
691- < HighlightBox title = "内置 Agent (2个 )" variant = "blue" >
703+ < HighlightBox title = "内置 Agent (3个 )" variant = "blue" >
692704 < ul className = "text-sm space-y-1" >
693- < li > • < strong > CodebaseInvestigator </ strong > - 代码库探索</ li >
694- < li > • < strong > IntrospectionAgent </ strong > - 自省分析 </ li >
695- < li > • 通过设置启用/禁用 </ li >
705+ < li > • < strong > codebase_investigator </ strong > - 代码库探索</ li >
706+ < li > • < strong > cli_help </ strong > - CLI 文档问答 </ li >
707+ < li > • < strong > generalist </ strong > - 通用代理(实验) </ li >
696708 </ ul >
697709 </ HighlightBox >
698710
@@ -934,8 +946,8 @@ this.emitActivity('ERROR', { error: errorMessage, context: 'tool_call' });`;
934946 < td className = "py-2 px-3 text-[var(--text-secondary)]" > LocalAgentExecutor - 本地 Agent 执行循环</ td >
935947 </ tr >
936948 < tr className = "border-b border-[var(--border-subtle)]/50" >
937- < td className = "py-2 px-3 font-mono text-[var(--cyber-blue)] text-xs" > agents/toml-loader .ts</ td >
938- < td className = "py-2 px-3 text-[var(--text-secondary)]" > TOML 配置解析与验证 </ td >
949+ < td className = "py-2 px-3 font-mono text-[var(--cyber-blue)] text-xs" > agents/agentLoader .ts</ td >
950+ < td className = "py-2 px-3 text-[var(--text-secondary)]" > Markdown frontmatter 解析与验证 </ td >
939951 </ tr >
940952 < tr className = "border-b border-[var(--border-subtle)]/50" >
941953 < td className = "py-2 px-3 font-mono text-[var(--cyber-blue)] text-xs" > agents/delegate-to-agent-tool.ts</ td >
@@ -949,6 +961,14 @@ this.emitActivity('ERROR', { error: errorMessage, context: 'tool_call' });`;
949961 < td className = "py-2 px-3 font-mono text-[var(--cyber-blue)] text-xs" > agents/codebase-investigator.ts</ td >
950962 < td className = "py-2 px-3 text-[var(--text-secondary)]" > CodebaseInvestigatorAgent 内置定义</ td >
951963 </ tr >
964+ < tr className = "border-b border-[var(--border-subtle)]/50" >
965+ < td className = "py-2 px-3 font-mono text-[var(--cyber-blue)] text-xs" > agents/cli-help-agent.ts</ td >
966+ < td className = "py-2 px-3 text-[var(--text-secondary)]" > CliHelpAgent 内置定义</ td >
967+ </ tr >
968+ < tr className = "border-b border-[var(--border-subtle)]/50" >
969+ < td className = "py-2 px-3 font-mono text-[var(--cyber-blue)] text-xs" > agents/generalist-agent.ts</ td >
970+ < td className = "py-2 px-3 text-[var(--text-secondary)]" > GeneralistAgent 内置定义(experimental)</ td >
971+ </ tr >
952972 < tr className = "border-b border-[var(--border-subtle)]/50" >
953973 < td className = "py-2 px-3 font-mono text-[var(--cyber-blue)] text-xs" > agents/a2a-client-manager.ts</ td >
954974 < td className = "py-2 px-3 text-[var(--text-secondary)]" > A2AClientManager - 远程 Agent 通信</ td >
@@ -971,7 +991,7 @@ this.emitActivity('ERROR', { error: errorMessage, context: 'tool_call' });`;
971991
972992 < HighlightBox title = "为什么 Agent 不能调用 delegate_to_agent?" variant = "purple" >
973993 < p className = "text-sm" >
974- < strong > 防止递归和复杂性</ strong > :toml-loader 会验证 tools 配置,
994+ < strong > 防止递归和复杂性</ strong > :agentLoader 会验证 tools 配置,
975995 拒绝包含 delegate_to_agent 的 Agent 定义。这防止了 Agent 之间的递归调用,
976996 简化了执行模型和调试。
977997 </ p >
0 commit comments