feat: v0.10.0 — 全面增强网络搜索、Agent Loop、工具稳定性与性能
网络搜索增强: - web_search: 4引擎并行(Bing+百度+DuckDuckGo+Google), LRU缓存5min, URL可达性预检, 结构化JSON输出 - web_fetch: 自动重试(指数退避2次), 移动端UA切换, SPA页面自动升级浏览器渲染 Agent Loop增强: - 流式调用超时保护(默认180s可配置) - Final Answer多模式检测 + 内容长度验证 - 预算警告改用ephemeral标记(context优先丢弃) - Token感知动态迭代预算(>80%自动缩减到3轮) - 工具缓存TTL(搜索5min/网页10min/文件30min) - 自动子任务拆解(并行关键词检测+spawn子代理) - 增量记忆提取(每20轮触发) - 智能批次划分: 16个只读工具加入ALWAYS_PARALLEL白名单 - 旧工具结果超过10轮自动截断到500字符 工具增强: - read_multiple_files: 串行→并行Promise.all - diff_files: 三级回退(diff -u → git diff → builtin) - search_files: 新增use_regex正则搜索 - list_directory: 新增offset分页 - Git: stash参数修复, clone/push/pull超时保护 - browser: 提取ensureBrowserReady()消除重复, browser_open切换URL自动重建 文档更新: - 帮助面板新增Agent Loop v0.10.0增强章节 - README中英文同步更新(四引擎搜索/工具描述) - SOUL.md/AGENT.md更新(v0.10.0能力描述/SPA规则翻转)
This commit is contained in:
@@ -45,7 +45,7 @@ export const TOOL_DEFINITIONS: ToolDefinition[] = [
|
||||
type: 'function',
|
||||
function: {
|
||||
name: 'list_directory',
|
||||
description: 'List directory contents. Returns file names, types, sizes, and modification times.',
|
||||
description: 'List directory contents. Returns file names, types, sizes, and modification times. Supports offset-based pagination for directories with many entries.',
|
||||
parameters: {
|
||||
type: 'object',
|
||||
required: ['path'],
|
||||
@@ -53,7 +53,8 @@ export const TOOL_DEFINITIONS: ToolDefinition[] = [
|
||||
path: { type: 'string', description: 'Directory path.' },
|
||||
recursive: { type: 'boolean', description: 'List recursively. Default: false.' },
|
||||
max_depth: { type: 'integer', description: 'Max recursion depth. Default: 3.' },
|
||||
include_hidden: { type: 'boolean', description: 'Include hidden files. Default: false.' }
|
||||
include_hidden: { type: 'boolean', description: 'Include hidden files. Default: false.' },
|
||||
offset: { type: 'integer', description: 'Skip first N entries for pagination. Default: 0.' }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -62,17 +63,18 @@ export const TOOL_DEFINITIONS: ToolDefinition[] = [
|
||||
type: 'function',
|
||||
function: {
|
||||
name: 'search_files',
|
||||
description: 'Search files by name pattern or text content within files.',
|
||||
description: 'Search files by name pattern or text content within files. Supports regular expressions with use_regex=true.',
|
||||
parameters: {
|
||||
type: 'object',
|
||||
required: ['path', 'query'],
|
||||
properties: {
|
||||
path: { type: 'string', description: 'Root directory to search.' },
|
||||
query: { type: 'string', description: 'Search query (glob or text).' },
|
||||
query: { type: 'string', description: 'Search query (glob, text, or regex).' },
|
||||
search_type: { type: 'string', enum: ['filename', 'content', 'both'], description: 'Search target. Default: both.' },
|
||||
case_sensitive: { type: 'boolean', description: 'Case sensitive. Default: false.' },
|
||||
max_results: { type: 'integer', description: 'Max results. Default: 50.' },
|
||||
file_extensions: { type: 'array', items: { type: 'string' }, description: 'Filter extensions, e.g. [".ts", ".js"]' }
|
||||
file_extensions: { type: 'array', items: { type: 'string' }, description: 'Filter extensions, e.g. [".ts", ".js"]' },
|
||||
use_regex: { type: 'boolean', description: 'Treat query as regular expression. Default: false.' }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -156,14 +158,16 @@ export const TOOL_DEFINITIONS: ToolDefinition[] = [
|
||||
type: 'function',
|
||||
function: {
|
||||
name: 'web_fetch',
|
||||
description: 'Fetch content from a URL. Returns the page text content (HTML stripped). Supports HTTP/HTTPS.',
|
||||
description: 'Fetch content from a URL. Returns the page text content (HTML stripped). Supports HTTP/HTTPS. Automatically retries on failure (up to 2 times with exponential backoff). Will auto-upgrade to browser rendering for JavaScript-heavy pages that return empty shells.',
|
||||
parameters: {
|
||||
type: 'object',
|
||||
required: ['url'],
|
||||
properties: {
|
||||
url: { type: 'string', description: 'URL to fetch (http/https).' },
|
||||
max_chars: { type: 'integer', description: 'Max characters to return. Default: 0 (no limit, return full content).' },
|
||||
extract_mode: { type: 'string', enum: ['text', 'markdown'], description: 'Extraction mode. Default: text.' }
|
||||
extract_mode: { type: 'string', enum: ['text', 'markdown'], description: 'Extraction mode. Default: text.' },
|
||||
mobile_ua: { type: 'boolean', description: 'Use mobile User-Agent. Some sites return simpler content for mobile. Default: false.' },
|
||||
retry: { type: 'boolean', description: 'Enable auto-retry on failure (5xx/network errors, up to 2 times). Default: true.' }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -342,13 +346,13 @@ export const TOOL_DEFINITIONS: ToolDefinition[] = [
|
||||
type: 'function',
|
||||
function: {
|
||||
name: 'web_search',
|
||||
description: 'Search the web and return relevant results. Use this when you need to find current information, news, facts, or answer questions that require up-to-date knowledge beyond your training data.',
|
||||
description: 'Search the web using multiple engines in parallel (Bing + Baidu + DuckDuckGo + Google) and return merged, deduplicated results. Results are cached for 5 minutes. Includes reachability checks for top results. Returns both formatted text and structured JSON. Use this when you need current information, news, facts, or answers requiring up-to-date knowledge beyond your training data.',
|
||||
parameters: {
|
||||
type: 'object',
|
||||
required: ['query'],
|
||||
properties: {
|
||||
query: { type: 'string', description: 'The search query. Be specific and concise for best results.' },
|
||||
max_results: { type: 'integer', description: 'Maximum number of results to return. Default: 15, max: 15.' }
|
||||
max_results: { type: 'integer', description: 'Maximum number of results to return. Default: 15, max: 20.' }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user