Skip to content

Commit 12b6f47

Browse files
committed
refactor: 重写扩展系统与非交互模式,对齐上游 gemini-cli
- ExtensionSystem: package.json → gemini-extension.json 结构 - NonInteractiveMode: positional prompt、output-format、approval-mode - AgentLoop: ERROR_NO_COMPLETE_TASK_CALL、tool 注册隔离 - MCPDiscovery: settings + extensions 配置来源 - ShellInjection: 硬拒绝(解析失败) vs 软拒绝(不在allowlist) - PolicyEngine: checkShellCommand、allowRedirection - 工具名/Kind 枚举统一
1 parent 8afc45e commit 12b6f47

22 files changed

Lines changed: 1519 additions & 1720 deletions

src/pages/AgentFramework.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,8 @@ export class AgentRegistry {
277277
const tomlConfigCode = `# ~/.gemini/agents/code-reviewer.toml
278278
name = "code-reviewer"
279279
description = "专业代码审查,检查最佳实践和潜在问题"
280-
tools = ["Read", "Grep", "Glob", "LSP"]
280+
tools = ["read_file", "search_file_content", "glob", "list_directory"]
281+
# 说明:内置工具使用 tool name(如 read_file);MCP 工具用 server__tool 格式
281282
282283
[prompts]
283284
system_prompt = """
@@ -760,7 +761,7 @@ this.emitActivity('ERROR', { error: errorMessage, context: 'tool_call' });`;
760761
<p className="text-sm mb-2">代码库探索和分析 Agent</p>
761762
<ul className="text-sm space-y-1 text-[var(--text-muted)]">
762763
<li><strong>结构化输出</strong>: Zod schema 验证</li>
763-
<li><strong>只读工具</strong>: ls, Read, Glob, Grep</li>
764+
<li><strong>只读/搜索工具</strong>: list_directory, read_file, glob, search_file_content</li>
764765
<li><strong>Scratchpad</strong>: 系统化探索方法</li>
765766
<li>• 最多 15 轮,5 分钟超时</li>
766767
</ul>

0 commit comments

Comments
 (0)