fix: 工具数量勘误 40→32 + 上下文长度选项补齐低端档位

- DEVELOPMENT.md/workspace-panel.ts/index.html 工具数量勘误(删除 8 个非必要工具后残留的 40,修正为 32)
- DEVELOPMENT.md 文件系统分类数 16→13
- index.html 上下文长度下拉框新增 8K/16K/32K/64K 四档(原仅 128K-1M,跳档过稀)
This commit is contained in:
紫影233
2026-07-16 17:59:40 +08:00
parent 94e0a36981
commit ad44989ebb
3 changed files with 11 additions and 7 deletions
+5 -5
View File
@@ -10,7 +10,7 @@ Metona Ollama Desktop 是基于 TypeScript + Electron 的 Windows 本地 AI 桌
核心架构: 核心架构:
- **ReAct Agent Loop** — 8 状态机驱动的智能体循环(INIT→THINKING→PARSING→EXECUTING→OBSERVING→REFLECTING→COMPRESSING→TERMINATED),最大 85 轮(可配置) - **ReAct Agent Loop** — 8 状态机驱动的智能体循环(INIT→THINKING→PARSING→EXECUTING→OBSERVING→REFLECTING→COMPRESSING→TERMINATED),最大 85 轮(可配置)
- **40 个内置工具** — 文件系统(16)、命令执行(1)、联网搜索(2)、浏览器控制(9)、Git(1)、记忆(1)、会话/子代理(3)、系统(6)、Plan Mode1 - **32 个内置工具** — 文件系统(13)、命令执行(1)、联网搜索(2)、浏览器控制(9)、Git(1)、记忆(1)、会话/子代理(3)、系统(1)、Plan Mode1
- **Harness Engineering** — 5 层抗幻觉体系 + 4 阶段 Hook 系统 + Completion Gate5 项检查)+ Agent Metrics + 渐进式披露 - **Harness Engineering** — 5 层抗幻觉体系 + 4 阶段 Hook 系统 + Completion Gate5 项检查)+ Agent Metrics + 渐进式披露
- **MCP 协议扩展** — JSON-RPC 2.0 over stdio,动态工具发现 - **MCP 协议扩展** — JSON-RPC 2.0 over stdio,动态工具发现
- **Plan Mode** — 开关切换,先规划后执行,步骤级进度追踪 - **Plan Mode** — 开关切换,先规划后执行,步骤级进度追踪
@@ -47,7 +47,7 @@ src/
│ ├── mcp-manager.ts # MCP JSON-RPC 2.0 协议管理 │ ├── mcp-manager.ts # MCP JSON-RPC 2.0 协议管理
│ ├── tool-security.ts # 路径/命令安全检查(黑名单 + 豁免机制) │ ├── tool-security.ts # 路径/命令安全检查(黑名单 + 豁免机制)
│ ├── tool-handlers.ts # 工具处理器 re-export 聚合 │ ├── tool-handlers.ts # 工具处理器 re-export 聚合
│ ├── tool-handlers-fs.ts # 16 个文件系统工具实现 │ ├── tool-handlers-fs.ts # 13 个文件系统工具实现
│ ├── tool-handlers-system.ts # 系统/网络工具 + 联网搜索(双模式)+ 自动抓取 │ ├── tool-handlers-system.ts # 系统/网络工具 + 联网搜索(双模式)+ 自动抓取
│ ├── tool-handlers-git.ts # Git 全操作 │ ├── tool-handlers-git.ts # Git 全操作
│ ├── tool-handlers-shared.ts # 共享类型和辅助函数 │ ├── tool-handlers-shared.ts # 共享类型和辅助函数
@@ -78,11 +78,11 @@ src/
│ │ ├── toast.ts # Toast 通知 │ │ ├── toast.ts # Toast 通知
│ │ ├── token-dashboard.ts # Token 消耗仪表盘(全局 + 会话统计) │ │ ├── token-dashboard.ts # Token 消耗仪表盘(全局 + 会话统计)
│ │ ├── tool-confirm-modal.ts # 工具执行确认对话框 │ │ ├── tool-confirm-modal.ts # 工具执行确认对话框
│ │ ├── tools-modal.ts # 工具列表面板(40 个工具卡片) │ │ ├── tools-modal.ts # 工具列表面板(32 个工具卡片)
│ │ └── workspace-panel.ts # 工作空间面板(终端 + 工具卡片 + 文件浏览) │ │ └── workspace-panel.ts # 工作空间面板(终端 + 工具卡片 + 文件浏览)
│ ├── services/ # 14 个服务模块 │ ├── services/ # 14 个服务模块
│ │ ├── agent-engine.ts # ★ ReAct Agent Loop 核心引擎(8 状态机) │ │ ├── agent-engine.ts # ★ ReAct Agent Loop 核心引擎(8 状态机)
│ │ ├── tool-registry.ts # 工具注册与调度中心(40 内置 + MCP 动态 + Plan Mode │ │ ├── tool-registry.ts # 工具注册与调度中心(32 内置 + MCP 动态 + Plan Mode
│ │ ├── memory-service.ts # 记忆管理(MEMORY.md 读写 + 格式校验 + 自动提取) │ │ ├── memory-service.ts # 记忆管理(MEMORY.md 读写 + 格式校验 + 自动提取)
│ │ ├── context-manager.ts # 上下文窗口管理(滑动窗口 + Token 校准 + LLM 压缩) │ │ ├── context-manager.ts # 上下文窗口管理(滑动窗口 + Token 校准 + LLM 压缩)
│ │ ├── sub-agent.ts # 子代理委派(独立上下文 + 超时保护) │ │ ├── sub-agent.ts # 子代理委派(独立上下文 + 超时保护)
@@ -178,7 +178,7 @@ logDebug('调试信息', '可选详情');
### 5.1 五大子系统 ### 5.1 五大子系统
``` ```
① Agent 系统 → agent-engine.ts + tool-registry.ts40 内置工具 + MCP 动态) ① Agent 系统 → agent-engine.ts + tool-registry.ts32 内置工具 + MCP 动态)
② 记忆系统 → memory-service.tsMEMORY.md 文件存储 + 格式校验 + 自动提取) ② 记忆系统 → memory-service.tsMEMORY.md 文件存储 + 格式校验 + 自动提取)
③ 上下文系统 → context-manager.ts + context-indexer.ts(渐进式披露) ③ 上下文系统 → context-manager.ts + context-indexer.ts(渐进式披露)
④ 工作空间 → workspace.ts (主进程) + workspace-panel.ts (渲染进程) ④ 工作空间 → workspace.ts (主进程) + workspace-panel.ts (渲染进程)
+1 -1
View File
@@ -977,7 +977,7 @@ function renderToolCalls(): void {
</div> </div>
<div class="ws-idle-divider"></div> <div class="ws-idle-divider"></div>
<div class="ws-idle-desc">AI 对话中自动调用工具,结果在此展示</div> <div class="ws-idle-desc">AI 对话中自动调用工具,结果在此展示</div>
<div class="ws-idle-hint">共 40 个内置工具 · MCP 动态扩展</div> <div class="ws-idle-hint">共 32 个内置工具 · MCP 动态扩展</div>
</div> </div>
`; `;
return; return;
+5 -1
View File
@@ -297,6 +297,10 @@
<p class="text-muted" style="margin-top:4px;font-size:11px;">Agent Loop 最大工具调用轮数。默认 85 轮,复杂任务可能需要更多轮次。</p> <p class="text-muted" style="margin-top:4px;font-size:11px;">Agent Loop 最大工具调用轮数。默认 85 轮,复杂任务可能需要更多轮次。</p>
<label class="setting-label" style="margin-top:12px;">上下文长度(Context Length</label> <label class="setting-label" style="margin-top:12px;">上下文长度(Context Length</label>
<select class="setting-input" id="selectContextLength" style="margin-bottom:0;"> <select class="setting-input" id="selectContextLength" style="margin-bottom:0;">
<option value="8192">8K</option>
<option value="16384">16K</option>
<option value="32768">32K</option>
<option value="65536">64K</option>
<option value="131072">128K</option> <option value="131072">128K</option>
<option value="262144">256K</option> <option value="262144">256K</option>
<option value="524288">512K</option> <option value="524288">512K</option>
@@ -458,7 +462,7 @@
<div class="modal-overlay" id="toolsModal" style="display:none;"> <div class="modal-overlay" id="toolsModal" style="display:none;">
<div class="modal"> <div class="modal">
<div class="modal-header"> <div class="modal-header">
<h3>🔧 工具面板(40 个 + 1 Plan 专属)</h3> <h3>🔧 工具面板(32 个 + 1 Plan 专属)</h3>
<button class="icon-btn" id="btnCloseTools"> <button class="icon-btn" id="btnCloseTools">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/> <line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/>