__init__.py 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. """
  2. 内置基础工具 - 参考 opencode 实现
  3. 这些工具参考 vendor/opencode/packages/opencode/src/tool/ 的设计,
  4. 在 Python 中重新实现核心功能。
  5. 参考版本:opencode main branch (2025-01)
  6. """
  7. # 文件操作工具
  8. from agent.tools.builtin.file.read import read_file
  9. from agent.tools.builtin.file.edit import edit_file
  10. from agent.tools.builtin.file.write import write_file
  11. from agent.tools.builtin.file.glob import glob_files
  12. from agent.tools.builtin.file.grep import grep_content
  13. # 系统工具
  14. from agent.tools.builtin.bash import bash_command
  15. from agent.tools.builtin.skill import skill, list_skills
  16. from agent.tools.builtin.search import search_posts, get_search_suggestions
  17. from agent.tools.builtin.sandbox import (sandbox_create_environment, sandbox_run_shell,
  18. sandbox_rebuild_with_ports,sandbox_destroy_environment)
  19. from agent.tools.builtin.feishu.chat import (feishu_get_chat_history, feishu_get_contact_replies,
  20. feishu_send_message_to_contact,feishu_get_contact_list)
  21. # 导入浏览器工具以触发注册
  22. import agent.tools.builtin.browser # noqa: F401
  23. __all__ = [
  24. # 文件操作
  25. "read_file",
  26. "edit_file",
  27. "write_file",
  28. "glob_files",
  29. "grep_content",
  30. # 系统工具
  31. "bash_command",
  32. "skill",
  33. "list_skills",
  34. "search_posts",
  35. "get_search_suggestions",
  36. "sandbox_create_environment",
  37. "sandbox_run_shell",
  38. "sandbox_rebuild_with_ports",
  39. "sandbox_destroy_environment",
  40. ]