autourgos-cua-mouse-click-tool
Mouse click tool for Autourgos computer-use agents.
Left- or right-click at a given pixel position -- typically the coordinates returned by
autourgos-cua-coordinate-tool.
There are two ways to use this package -- pick one:
| Use when | |
|---|---|
click_mouse() |
You're calling it directly from your own code. |
MouseClickTool |
You want to hand it to an autourgos-agent Agent as a tool. |
Table of Contents
- Install
- Use Case 1:
click_mouse()(library) - Use Case 2:
MouseClickTool(agent tool) - Error Handling
- API Reference
- License
Install
pip install autourgos-cua-mouse-click-tool
Uses pyautogui under the hood to perform the
actual click -- installed automatically as a dependency.
Use Case 1: click_mouse() (library)
Call it directly from your own code.
from autourgos_cua_mouse_click_tool import click_mouse
click_mouse(500, 300) # left click at (500, 300)
click_mouse(500, 300, "right") # right click at (500, 300)
click_mouse(500, 300, clicks=2) # double left-click
Use Case 2: MouseClickTool (agent tool)
For autourgos-agent. No constructor arguments needed -- hand it straight to
agent.add_tools(...).
from autourgos_agent import Agent
from autourgos_cua_mouse_click_tool import MouseClickTool
agent = Agent(llm=my_llm)
agent.add_tools(MouseClickTool())
result = agent.invoke("Click the Submit button at (512, 780)")
Often paired with autourgos-cua-coordinate-tool's
CoordinateFinderTool, so the agent first finds where an element is, then clicks it:
from autourgos_cua_coordinate_tool import CoordinateFinderTool
from autourgos_cua_mouse_click_tool import MouseClickTool
agent.add_tools(CoordinateFinderTool(my_llm), MouseClickTool())
result = agent.invoke("Find and click the Submit button")
It returns a dict:
{"clicked": True, "x": 512, "y": 780, "button": "left"}
# or, on failure:
{"clicked": False, "error": "..."}
Error Handling
click_mouse() raises ClickError -- never silently does nothing -- when:
buttonisn't"left"or"right",- the
pyautoguidependency is unavailable, or - the underlying click call itself fails (e.g. no display/desktop session).
MouseClickTool's wrapped call catches ClickError and returns
{"clicked": False, "error": "..."} instead of raising, so a calling agent gets a
structured result rather than a crash.
API Reference
click_mouse(x, y, button="left", *, clicks=1) -> None
x,y: pixel coordinates to click at.button:"left"or"right".clicks: number of clicks to perform (e.g.2for a double-click).
Raises ClickError on failure.
MouseClickTool() -> Tool
A click_mouse(x, y, button) tool with a fixed name (click_mouse) and description
stating it supports both left and right clicks. Ready for agent.add_tools(...).
License
Apache License 2.0. See LICENSE.
Metadata
Release files for autourgos-cua-mouse-click-tool 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| autourgos_cua_mouse_click_tool-1.0.0.tar.gz | 16.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| autourgos_cua_mouse_click_tool-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 29.8 kB
Release files / autourgos_cua_mouse_click_tool-1.0.0.tar.gz
| Download URL | autourgos_cua_mouse_click_tool-1.0.0.tar.gz |
|---|---|
| Size | 16.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3cc53aba1f05500e2391b23a565961a9be7a8ed7ecd9108f9e9ac91bf91f756a
|
|
BLAKE2b-256 checksum How to use checksums |
c9d5051cf833be8ba8bb2d5293937ded2a33e6effe2d50c099baaaa58fcffe68
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.9
|
Release files / autourgos_cua_mouse_click_tool-1.0.0-py3-none-any.whl
| Download URL | autourgos_cua_mouse_click_tool-1.0.0-py3-none-any.whl |
|---|---|
| Size | 13.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
87ab08a4af0ca24fee6e89a50d2fa9340a3d185654ba5061cc97486e5916a0ce
|
|
BLAKE2b-256 checksum How to use checksums |
b84f858b11d2aaae2e33fa980425f638667c065781207f835f35783a7e19e4cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.9
|