附录 B:工具速查表

本附录以当前 ../octos main 分支的 octos-agent/src/tools/octos-agent/src/tools/policy.rsoctos-cli/src/api/coding_tool_contract.rs 以及 CLI 运行时注册路径为准。octos 的工具不是一个固定列表:基础 registry、Codex-compatible coding 合约、feature flags、profile、Serve/Admin API、MCP、插件和 app-skills 都会影响最终暴露给 Agent 的工具集合。

Codex-compatible 编码工具面

这些工具由 ToolRegistry::with_builtins_and_permissions() 直接注册,并由 coding.tool_contract.v1 对 AppUI/模型声明。它们的定位是让 Octos 可以作为 autonomous coding harness 的后端工具面,而不是要求前端本地实现这些能力。

工具名分组核心参数功能
apply_patchgroup:fsCodex patch envelope 或 path, diff应用补丁;写入受文件访问策略约束
exec_commandgroup:runtimecmd, workdir?, timeout_secs?, tty?, yield_time_ms?执行命令;支持 PTY/长命令 session
write_stdingroup:runtimesession_id, charsexec_command 启动的运行中 session 写入 stdin
bashgroup:runtimecmdCodex-compatible shell alias,共用 shell/exec policy 与 sandbox
update_plan-plan: array写入结构化计划状态
request_user_input-questions: array请求用户输入,返回结构化 metadata
spawn_agentgroup:sessionstask, role?, agent_type?启动受监督的子 Agent;依赖运行时绑定 native spawn delegate
send_inputgroup:sessionsagent_id, input当前记录到 supervisor metadata;不是实时 conversational delivery
resume_agentgroup:sessionsagent_id重新拉起/恢复受监督任务
wait_agentgroup:sessionsagent_id, timeout_ms?等待子 Agent 进入终态或超时
close_agentgroup:sessionsagent_id取消活跃受监督任务或关闭终态任务
delegategroup:sessionstask, role?, timeout_ms?spawn_agent + wait_agent 的一调用封装
view_image-path工作区内图片元数据检查,不返回原始图片字节
tool_search-query, limit?从 live tool catalog 搜索可见工具
tool_suggest-task, limit?根据任务描述建议工具
image_generation-prompt当前仅返回 coding_tool_unsupported,尚未绑定生成后端

核心内置工具

工具名分组核心参数功能
shellgroup:runtimecommand: string在策略和沙箱约束下执行 Shell 命令
read_filegroup:fspath: string, offset?: int, limit?: int读取文件内容,支持分页
write_filegroup:fspath: string, content: string写入文件并记录 workspace 变更
edit_filegroup:fspath: string, old_string: string, new_string: string精确字符串替换
diff_editgroup:fspath: string, diff: string应用 unified diff 风格补丁
globgroup:searchpattern: string, path?: string文件路径模式搜索
grepgroup:searchpattern: string, path?: string, include?: string内容正则搜索
list_dirgroup:searchpath: string列出目录内容
web_searchgroup:webquery: string, count?: int网页搜索
web_fetchgroup:weburl: string, max_chars?: int, extract_mode?: string获取网页内容并抽取文本
browsergroup:weburl?: string, action?: string, selector?: string浏览器自动化
spawngroup:sessionsprompt: string, agent_definition_id?: string, allowed_tools?: string[]后台异步执行子 Agent
recall_memorygroup:memoryquery: string, limit?: int检索长期记忆
save_memorygroup:memoryname: string, content: string保存长期记忆

Feature / 运行时注册工具

工具名来源分组核心参数功能
gitgit feature-command: stringGit 操作与仓库查询
code_structureast feature-path: stringAST 代码结构分析
searchbundled app skill / runtimegroup:researchquery: string单 binary 研究流水线;旧文档中的 deep_search 是 contract/兼容别名
synthesize_researchruntimegroup:researchfindings: array/object综合研究结果
deep_crawlbundled app skill / runtimegroup:researchurl: string, max_depth?: int深度爬取站点
run_pipelineCLI/Gateway/Serve per-session-dot: string 或 pipeline 配置执行 DOT 工作流
model_checkCLI runtimegroup:adminaction: string查询/切换模型配置
configure_toolcore runtimegroup:adminaction: string, tool?: string, key?: string, value?: any查看、设置或重置可配置工具字段
activate_toolscore runtime-tools: string[]激活被延迟隐藏的工具或工具组
manage_skillscore runtimegroup:adminaction: string, name?: string管理本地 skills
check_background_taskscore runtime-status?: string查看后台任务状态
read_task_outputcore runtime-task_id: string, mode: object读取后台任务输出
check_workspace_contractcore runtime-path?: string检查 workspace 合约
workspace_log / workspace_show / workspace_diffworkspace history-Git revision / diff 参数查看 workspace 变更历史
send_filechannel runtime-path: string, caption?: string向用户发送文件
messagechannel runtimegroup:delegated deny listtext: string向频道发送进度消息
send_app_card / show_weather_cardApp UI runtimegroup:media 类能力card/weather payload发送结构化 App 卡片
delegate_taskdelegate runtimegroup:delegated deny listtask: string, allowed_tools?: string[]同步委托子任务

Serve/Admin API 工具

这些工具只在 Serve/Admin API 上下文注册,名称来自 octos-agent/src/tools/admin/

类别工具
Profile 管理admin_list_profiles, admin_profile_status, admin_start_profile, admin_stop_profile, admin_restart_profile, admin_enable_profile, admin_update_profile
系统监控admin_view_logs, admin_system_health, admin_system_metrics, admin_provider_metrics, admin_manage_watchdog
诊断admin_view_sessions, admin_cron_status, admin_check_config
多租户子账号admin_list_sub_accounts, admin_create_sub_account
Skill / 平台管理admin_manage_skills, admin_platform_skills, admin_update_octos

工具分组策略

分组定义来自 octos-agent/src/tools/policy.rs

分组名包含工具典型策略
group:fsread_file, write_file, apply_patch, edit_file, diff_edit文件操作
group:runtimeshell, exec_command, write_stdin, bash命令执行
group:webweb_search, web_fetch, browser网络操作
group:searchglob, grep, list_dir代码搜索
group:sessionsspawn, spawn_agent, send_input, resume_agent, wait_agent, close_agent, delegate后台任务与子 Agent 生命周期
group:memoryrecall_memory, save_memory记忆操作
group:researchsearch, synthesize_research, deep_crawl深度研究
group:adminmanage_skills, configure_tool, model_check管理操作
group:mediamofa_comic, mofa_slides, mofa_infographic, mofa_cards, fm_tts, fm_voice_list媒体生成与语音
group:delegateddelegate_task, spawn, send_message, message, save_memory, execute_code委托子任务的 canonical deny list

策略配置示例

{
  "tool_policy": {
    "allow": ["group:fs", "group:search", "shell"],
    "deny": ["browser", "web_fetch"]
  },
  "tool_policy_by_provider": {
    "ollama": {
      "allow": ["read_file", "shell", "grep"]
    }
  }
}

deny-wins 规则:deny 列表优先于 allow 列表。上例中 browser 被禁止,即使它属于某个允许的分组。profile 级 allow/deny 还支持普通工具名、group:<id><prefix>* 通配符;spawn-only 工具会被保留,以避免后台任务 wiring 被 profile 过滤破坏。