computer_use_tool.py 1.1 KB

1234567891011121314151617181920212223242526272829
  1. """Discovery shim: tools.registry auto-imports ``tools/*.py``, so this top-level
  2. module registers ``computer_use`` for the ``tools/computer_use/`` package."""
  3. from __future__ import annotations
  4. from tools.computer_use.schema import COMPUTER_USE_SCHEMA
  5. from tools.computer_use.tool import (
  6. check_computer_use_requirements, handle_computer_use, release_computer_use_session, set_approval_callback,
  7. )
  8. from tools.registry import registry
  9. registry.register(
  10. name="computer_use",
  11. toolset="computer_use",
  12. schema=COMPUTER_USE_SCHEMA,
  13. handler=lambda args, **kw: handle_computer_use(args, **kw),
  14. check_fn=check_computer_use_requirements,
  15. requires_env=[],
  16. description=(
  17. "Universal desktop control via cua-driver (macOS, Windows, Linux). Works with any "
  18. "tool-capable model (Anthropic, OpenAI, OpenRouter, local vLLM, "
  19. "etc.). Background computer-use: does NOT steal the user's cursor "
  20. "or keyboard focus."
  21. ),
  22. )
  23. __all__ = ["check_computer_use_requirements", "handle_computer_use", "release_computer_use_session", "set_approval_callback"]