[ {"type": "function", "function": { "name": "code_run", "description": "代码执行器。优先使用python,仅在必要系统操作时使用 powershell。注意:执行的代码必须放在在回复正文中,以 ```python 或 ```powershell 代码块的形式。严禁在代码中硬编码大量数据,如有需要应通过文件读取。", "parameters": {"type": "object", "properties": { "type": {"type": "string", "enum": ["python", "powershell"], "description": "执行环境类型,默认为 python。", "default": "python"}, "timeout": {"type": "integer", "description": "执行超时时间(秒),默认 60。", "default": 60}, "cwd": {"type": "string", "description": "工作目录,默认为当前工作目录。"}}} }}, {"type": "function", "function": { "name": "file_read", "description": "读取文件内容。建议在修改文件前先读取,以确保获取最新的上下文和行号。支持分页读取或关键字搜索。", "parameters": {"type": "object", "properties": { "path": {"type": "string", "description": "文件相对或绝对路径。"}, "start": {"type": "integer", "description": "起始行号(从 1 开始)。", "default": 1}, "count": {"type": "integer", "description": "读取的行数。", "default": 100}, "keyword": {"type": "string", "description": "可选搜索关键字。如果提供,将返回第一个匹配项(忽略大小写)及其周边的内容。"}, "show_linenos": {"type": "boolean", "description": "是否显示行号,建议开启以辅助 file_patch 定位。", "default": true}}, "required": ["path"]} }}, {"type": "function", "function": { "name": "file_patch", "description": "精细化局部文件修改。在文件中寻找唯一的 old_content 块并替换为 new_content。要求 old_content 必须在文件中唯一存在,且空格、缩进、换行必须与原文件完全一致。如果匹配失败,请使用 file_read 重新确认文件内容。", "parameters": {"type": "object", "properties": { "path": {"type": "string", "description": "文件路径。"}, "old_content": {"type": "string", "description": "文件中需要被替换的原始文本块(需确保唯一性)。"}, "new_content": {"type": "string", "description": "替换后的新文本内容。"}}, "required": ["path", "old_content", "new_content"]} }}, {"type": "function", "function": { "name": "file_write", "description": "用于文件的新建、全量覆盖或追加写入。对于精细的代码修改,应优先使用 file_patch。注意:要写入的内容必须放在回复正文的 标签或代码块中。", "parameters": {"type": "object", "properties": { "path": {"type": "string", "description": "文件路径。"}, "mode": {"type": "string", "enum": ["overwrite", "append", "prepend"], "description": "写入模式覆盖、追加或在开头追加。", "default": "overwrite"}}, "required": ["path"]} }}, {"type": "function", "function": { "name": "web_scan", "description": "获取当前网页的清洗后内容,并列出所有已打开的标签页。支持切换标签页。在长页面中,可以使用 focus_item 进行语义过滤以提取关键信息。", "parameters": {"type": "object", "properties": { "focus_item": {"type": "string", "description": "语义过滤指令,用于在长列表中优先保留与该关键词相关的项。"}, "switch_tab_id": {"type": "string", "description": "可选的标签页 ID。如果提供,系统将在扫描前切换到该标签页。"}}} }}, {"type": "function", "function": { "name": "web_execute_js", "description": "万能网页操控工具。通过执行 JavaScript 脚本实现对浏览器的完全控制(如点击、滚动、提取特定数据)。这是 Web 场景下的首选工具。执行结果可选择保存到本地文件进行后续分析。", "parameters": {"type": "object", "properties": { "script": {"type": "string", "description": "要执行的 JavaScript 代码。"}, "save_to_file": {"type": "string", "description": "可选。将 JS 执行结果(js_return)保存到的文件路径。注意:该功能不支持 await 等异步结果。"}}, "required": ["script"]} }}, {"type": "function", "function": { "name": "update_sop_plan", "description": "【在读取SOP后需要调用】准备开始执行此SOP。提取容易遗忘但关键的内容,生成极简检查清单,100tokens以内,后续每轮自动注入context。特别是靠后的内容。", "parameters": {"type": "object", "properties": { "keys": {"type": "string", "description": "每轮自动注入的必须注意的文本,可以是约束规则/执行步骤/需要注意的坑"}, "sop_path": {"type": "string", "description": "sop路径,必要时可以再读"}}} }}, {"type": "function", "function": { "name": "ask_user", "description": "当需要用户决策、提供额外信息或遇到无法自动解决的阻碍时,调用此工具中断任务并提问。", "parameters": {"type": "object", "properties": { "question": {"type": "string", "description": "向用户提出的明确问题。"}, "candidates": {"type": "array", "items": {"type": "string"}, "description": "提供给用户的可选快捷选项列表。"}}, "required": ["question"]} }}, {"type": "function", "function": { "name": "conclude_and_reflect", "description": "用户的任务完成后,若发现值得长期记忆的信息(环境事实/用户偏好/避坑经验),调用此工具触发记忆提炼。不允许在记忆更新或自主流程内调用。", "parameters": {"type": "object", "properties": {}}} } ]