Skip to content

Commit 1eb6fc0

Browse files
committed
docs: update approval mode documentation and fix tool validation reference
- Updated AgentFramework.tsx to clarify that toml-loader validates tools configuration instead of SubagentManager - Modified ApprovalModeSystem.tsx to reflect 3 approval modes instead of 4 (removed Plan mode) - Updated flowchart diagram to show PolicyEngine as the decision point - Removed Plan mode from UI and documentation - Adjusted related text and numbers to match new 3-mode system - Updated error styling in flowchart to use policy_deny node
1 parent 41725b2 commit 1eb6fc0

39 files changed

Lines changed: 450 additions & 538 deletions

src/pages/AgentFramework.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,7 @@ this.emitActivity('ERROR', { error: errorMessage, context: 'tool_call' });`;
963963

964964
<HighlightBox title="为什么 Agent 不能调用 delegate_to_agent?" variant="purple">
965965
<p className="text-sm">
966-
<strong>防止递归和复杂性</strong>SubagentManager 会验证 tools 配置,
966+
<strong>防止递归和复杂性</strong>toml-loader 会验证 tools 配置,
967967
拒绝包含 delegate_to_agent 的 Agent 定义。这防止了 Agent 之间的递归调用,
968968
简化了执行模型和调试。
969969
</p>

src/pages/ApprovalModeSystem.tsx

Lines changed: 138 additions & 183 deletions
Large diffs are not rendered by default.

src/pages/AuthenticationFlow.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export function AuthenticationFlow() {
136136
title="Device Authorization Grant 完整时序"
137137
chart={`sequenceDiagram
138138
autonumber
139-
participant CLI as Innies CLI
139+
participant CLI as Gemini CLI
140140
participant Auth as 认证服务器
141141
participant Browser as 用户浏览器
142142

src/pages/ChatRecording.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ export interface ToolCallRecord {
169169
export type ConversationRecordExtra =
170170
| { type: 'user' }
171171
| {
172-
type: 'qwen'; // AI 助手消息
172+
type: 'model'; // AI 助手消息
173173
toolCalls?: ToolCallRecord[];
174174
thoughts?: Array<ThoughtSummary & { timestamp: string }>;
175175
tokens?: TokensSummary | null;
@@ -239,12 +239,12 @@ export interface ConversationRecord {
239239
const recordMethodsCode = `/** 记录消息 */
240240
recordMessage(message: {
241241
model: string;
242-
type: 'user' | 'qwen';
242+
type: 'user' | 'model';
243243
content: PartListUnion;
244244
}): void {
245245
this.updateConversation((conversation) => {
246246
const msg = this.newMessage(message.type, message.content);
247-
if (msg.type === 'qwen') {
247+
if (msg.type === 'model') {
248248
// 合并队列中的 thoughts 和 tokens
249249
conversation.messages.push({
250250
...msg,
@@ -281,7 +281,7 @@ recordMessageTokens(respUsageMetadata: GenerateContentResponseUsageMetadata): vo
281281
// 尝试附加到最后一条消息,否则入队列
282282
this.updateConversation((conversation) => {
283283
const lastMsg = conversation.messages.at(-1);
284-
if (lastMsg?.type === 'qwen' && !lastMsg.tokens) {
284+
if (lastMsg?.type === 'model' && !lastMsg.tokens) {
285285
lastMsg.tokens = tokens;
286286
} else {
287287
this.queuedTokens = tokens;
@@ -307,10 +307,10 @@ recordToolCalls(model: string, toolCalls: ToolCallRecord[]): void {
307307
const lastMsg = conversation.messages.at(-1);
308308
309309
// 如果没有 AI 消息或有新思考,创建新消息
310-
if (!lastMsg || lastMsg.type !== 'qwen' || this.queuedThoughts.length > 0) {
310+
if (!lastMsg || lastMsg.type !== 'model' || this.queuedThoughts.length > 0) {
311311
const newMsg: MessageRecord = {
312-
...this.newMessage('qwen', ''),
313-
type: 'qwen',
312+
...this.newMessage('model', ''),
313+
type: 'model',
314314
toolCalls: enrichedToolCalls,
315315
thoughts: this.queuedThoughts,
316316
model,
@@ -399,7 +399,7 @@ private updateConversation(updateFn: (conv: ConversationRecord) => void) {
399399
</div>
400400
</HighlightBox>
401401

402-
<HighlightBox title="AI 消息 (qwen)" variant="purple">
402+
<HighlightBox title="AI 消息 (model)" variant="purple">
403403
<div className="text-sm space-y-2">
404404
<ul className="text-gray-400 space-y-1">
405405
<li><code>toolCalls</code>: 工具调用列表</li>

src/pages/CommandExecutionContext.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ export const createMockCommandContext = (
240240
<h2>🔌 命令加载器架构</h2>
241241

242242
<p>
243-
Innies CLI 使用<strong>提供者模式</strong>加载命令。三种加载器分别负责不同来源的命令,
243+
Gemini CLI 使用<strong>提供者模式</strong>加载命令。三种加载器分别负责不同来源的命令,
244244
最终由 <code>CommandService</code> 聚合并处理命名冲突。
245245
</p>
246246

src/pages/ConcurrencyPatterns.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export function ConcurrencyPatterns() {
3232
⚡ 并发模式详解
3333
</h1>
3434
<p className="text-[var(--text-secondary)] mb-6 text-sm">
35-
Innies CLI 中的并行处理、队列调度与分布式同步策略
35+
Gemini CLI 中的并行处理、队列调度与分布式同步策略
3636
</p>
3737

3838
{/* Tab Navigation */}
@@ -141,7 +141,7 @@ mindmap
141141
{/* Design Insight */}
142142
<HighlightBox title="💡 设计洞察" variant="blue">
143143
<p className="text-sm">
144-
Innies CLI 采用<strong className="text-[var(--text-primary)]">混合并发策略</strong>
144+
Gemini CLI 采用<strong className="text-[var(--text-primary)]">混合并发策略</strong>
145145
I/O 密集型操作(文件读取)使用高并发批处理,
146146
而状态关键操作(工具执行)使用严格顺序队列。
147147
这种组合既保证了性能,又避免了状态竞争。
@@ -557,13 +557,13 @@ private async acquireLock(lockPath: string): Promise<void> {
557557

558558
{/* Promise Deduplication */}
559559
<Layer title="🔄 Promise 去重">
560-
<CodeBlock language="typescript" code={`private refreshPromise: Promise<InniesCredentials> | null = null;
560+
<CodeBlock language="typescript" code={`private refreshPromise: Promise<Credentials> | null = null;
561561
private checkPromise: Promise<void> | null = null;
562562
563563
async getValidCredentials(
564-
geminiClient: IInniesOAuth2Client,
564+
geminiClient: IGoogleOAuth2Client,
565565
forceRefresh = false,
566-
): Promise<InniesCredentials> {
566+
): Promise<Credentials> {
567567
// 先检查文件是否被其他进程更新
568568
await this.checkAndReloadIfNeeded(geminiClient);
569569

src/pages/ConfigSystem.tsx

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ export function ConfigSystem() {
173173
<h4 className="text-green-400 font-bold mb-2">🏢 System Defaults</h4>
174174
<code className="text-xs text-gray-400 block mb-2">
175175
/etc/gemini-code/system-defaults.json (Linux)<br/>
176-
/Library/Application Support/InniesCode/system-defaults.json (macOS)
176+
/Library/Application Support/GeminiCode/system-defaults.json (macOS)
177177
</code>
178178
<p className="text-sm text-gray-300">
179179
系统级默认值,可被用户/项目覆盖
@@ -184,7 +184,7 @@ export function ConfigSystem() {
184184
<h4 className="text-red-400 font-bold mb-2">🔒 System Settings (Override)</h4>
185185
<code className="text-xs text-gray-400 block mb-2">
186186
/etc/gemini-code/settings.json (Linux)<br/>
187-
/Library/Application Support/InniesCode/settings.json (macOS)
187+
/Library/Application Support/GeminiCode/settings.json (macOS)
188188
</code>
189189
<p className="text-sm text-gray-300">
190190
系统管理员强制覆盖,优先级最高
@@ -346,7 +346,7 @@ export function getSystemDefaultsPath(): string {
346346
"loadMemoryFromIncludeDirectories": false,
347347
"fileFiltering": {
348348
"respectGitIgnore": true,
349-
"respectInniesIgnore": true,
349+
"respectGeminiIgnore": true,
350350
"enableRecursiveFileSearch": true,
351351
"disableFuzzySearch": false
352352
}
@@ -1338,13 +1338,11 @@ export class LoadedSettings {
13381338

13391339
<CodeBlock
13401340
title="packages/cli/src/config/config.ts:72-88 - approvalMode 解析"
1341-
code={`const VALID_APPROVAL_MODE_VALUES = ['plan', 'default', 'auto-edit', 'yolo'] as const;
1341+
code={`const VALID_APPROVAL_MODE_VALUES = ['default', 'auto-edit', 'yolo'] as const;
13421342
13431343
function parseApprovalModeValue(value: string): ApprovalMode {
13441344
const normalized = value.trim().toLowerCase();
13451345
switch (normalized) {
1346-
case 'plan':
1347-
return ApprovalMode.PLAN;
13481346
case 'default':
13491347
return ApprovalMode.DEFAULT;
13501348
case 'yolo':
@@ -1414,8 +1412,7 @@ function parseApprovalModeValue(value: string): ApprovalMode {
14141412
code={`// loadCliConfig() 中的 approval mode 校验
14151413
if (
14161414
!trustedFolder &&
1417-
approvalMode !== ApprovalMode.DEFAULT &&
1418-
approvalMode !== ApprovalMode.PLAN
1415+
approvalMode !== ApprovalMode.DEFAULT
14191416
) {
14201417
logger.warn(
14211418
\`Approval mode overridden to "default" because the current folder is not trusted.\`,
@@ -1569,7 +1566,7 @@ if (
15691566
}
15701567
15711568
// 7️⃣ 🔐 强制安全降级:不受信任 → 降级至 default
1572-
if (!trustedFolder && approvalMode !== ApprovalMode.DEFAULT && approvalMode !== ApprovalMode.PLAN) {
1569+
if (!trustedFolder && approvalMode !== ApprovalMode.DEFAULT) {
15731570
logger.warn('Approval mode overridden to "default" because the current folder is not trusted.');
15741571
approvalMode = ApprovalMode.DEFAULT;
15751572
}
@@ -1709,7 +1706,6 @@ if (argv.allowedMcpServerNames) {
17091706
code={`// config.ts:640-658
17101707
if (!interactive && !argv.experimentalAcp) {
17111708
switch (approvalMode) {
1712-
case ApprovalMode.PLAN:
17131709
case ApprovalMode.DEFAULT:
17141710
// 排除所有需要审批的工具
17151711
extraExcludes.push(ShellTool.Name, EditTool.Name, WriteFileTool.Name);
@@ -2023,7 +2019,7 @@ if (needsMigration(settingsObject)) {
20232019
<ul className="text-sm text-gray-400 space-y-1">
20242020
<li>• workspace 配置被忽略</li>
20252021
<li>• 项目 .env 不加载</li>
2026-
<li>• approvalMode 强制降级为 PLAN</li>
2022+
<li>• approvalMode 强制降级为 DEFAULT</li>
20272023
<li>• MCP Server 不启动</li>
20282024
</ul>
20292025
</div>

src/pages/CustomCommands.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ exclude = [
534534
]
535535
536536
[approvalMode]
537-
mode = "DEFAULT" # DEFAULT | YOLO | AUTO_EDIT | PLAN`}
537+
mode = "DEFAULT" # DEFAULT | YOLO | AUTO_EDIT`}
538538
/>
539539

540540
<h4 className="text-lg text-cyan-400 font-bold mb-3 mt-5">三大注入机制详解</h4>

src/pages/DesignTradeoffs.tsx

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export function DesignTradeoffs() {
2525
🎭 设计权衡与架构决策
2626
</h1>
2727
<p className="text-[var(--text-secondary)] mb-6 text-sm">
28-
深入分析 Innies CLI 的关键架构决策及其背后的权衡考量
28+
深入分析 Gemini CLI 的关键架构决策及其背后的权衡考量
2929
</p>
3030

3131
{/* Tab Navigation */}
@@ -74,7 +74,7 @@ function OverviewTab() {
7474
<div className="flex flex-col gap-6">
7575
<Layer title="📐 设计哲学总览">
7676
<p className="text-[var(--text-secondary)] mb-4">
77-
Innies CLI 的架构遵循以下核心原则,每个原则背后都有明确的权衡决策:
77+
Gemini CLI 的架构遵循以下核心原则,每个原则背后都有明确的权衡决策:
7878
</p>
7979

8080
<MermaidDiagram chart={`
@@ -150,7 +150,7 @@ mindmap
150150
{/* Core Insight */}
151151
<HighlightBox title="💡 核心洞察:拒绝纯并行" variant="blue">
152152
<p className="text-[var(--text-secondary)] text-sm">
153-
Innies CLI 最显著的战略选择是<strong className="text-[var(--text-primary)]">拒绝纯并行</strong>
153+
Gemini CLI 最显著的战略选择是<strong className="text-[var(--text-primary)]">拒绝纯并行</strong>
154154
转而采用<strong className="text-[var(--text-primary)]">顺序请求队列</strong>
155155
这看似反直觉,但实际上是正确的——工具输出必须在下一批次执行前被纳入上下文,
156156
并行执行会导致状态竞争条件。
@@ -165,7 +165,7 @@ function SafetyTab() {
165165
<div className="flex flex-col gap-6">
166166
<Layer title="🛡️ 审批模式分层">
167167
<p className="text-[var(--text-secondary)] mb-4">
168-
四层审批模式体现了<strong className="text-[var(--text-primary)]">安全优先</strong><strong className="text-[var(--text-primary)]">效率需求</strong>的平衡:
168+
三层审批模式体现了<strong className="text-[var(--text-primary)]">安全优先</strong><strong className="text-[var(--text-primary)]">效率需求</strong>的平衡:
169169
</p>
170170

171171
<MermaidDiagram chart={`
@@ -176,23 +176,19 @@ graph TD
176176
end
177177
178178
subgraph "审批模式"
179-
PLAN[PLAN<br/>仅规划]
180179
DEFAULT[DEFAULT<br/>需确认]
181180
AUTOEDIT[AUTO_EDIT<br/>自动编辑]
182181
YOLO[YOLO<br/>全自动]
183182
end
184183
185-
TF --> PLAN
186184
TF --> DEFAULT
187185
TF --> AUTOEDIT
188186
TF --> YOLO
189187
190-
UF --> PLAN
191188
UF --> DEFAULT
192189
UF -.->|❌ 禁止| AUTOEDIT
193190
UF -.->|❌ 禁止| YOLO
194191
195-
style PLAN fill:#22c55e,stroke:#16a34a,color:#fff
196192
style DEFAULT fill:#3b82f6,stroke:#2563eb,color:#fff
197193
style AUTOEDIT fill:#f59e0b,stroke:#d97706,color:#fff
198194
style YOLO fill:#ef4444,stroke:#dc2626,color:#fff
@@ -204,9 +200,8 @@ graph TD
204200
<CodeBlock language="typescript" code={`// packages/core/src/config/config.ts
205201
206202
export enum ApprovalMode {
207-
PLAN = 'plan', // 安全:仅生成计划
208203
DEFAULT = 'default', // 标准:每个操作需确认
209-
AUTO_EDIT = 'auto-edit',// 特权:自动批准编辑
204+
AUTO_EDIT = 'autoEdit', // 特权:自动批准编辑
210205
YOLO = 'yolo', // 最高:无需任何确认
211206
}
212207
@@ -430,7 +425,7 @@ function CorrectnessTab() {
430425
<div className="flex flex-col gap-6">
431426
<Layer title="🔄 工具执行队列">
432427
<p className="text-[var(--text-secondary)] mb-4">
433-
<strong className="text-[var(--error)]">拒绝并行</strong>Innies CLI 最重要的架构决策之一:
428+
<strong className="text-[var(--error)]">拒绝并行</strong>Gemini CLI 最重要的架构决策之一:
434429
</p>
435430

436431
<CodeBlock language="typescript" code={`// packages/core/src/core/coreToolScheduler.ts

src/pages/ErrorRecoveryPatterns.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export function ErrorRecoveryPatterns() {
3232
🛠️ 错误恢复模式
3333
</h1>
3434
<p className="text-[var(--text-secondary)] mb-6 text-sm">
35-
Innies CLI 中的错误处理、重试机制与优雅降级策略
35+
Gemini CLI 中的错误处理、重试机制与优雅降级策略
3636
</p>
3737

3838
{/* Tab Navigation */}

0 commit comments

Comments
 (0)