wcgw 1.5.2__tar.gz → 1.5.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of wcgw might be problematic. Click here for more details.
- {wcgw-1.5.2 → wcgw-1.5.3}/PKG-INFO +1 -1
- {wcgw-1.5.2 → wcgw-1.5.3}/pyproject.toml +1 -1
- {wcgw-1.5.2 → wcgw-1.5.3}/src/wcgw/client/anthropic_client.py +10 -0
- {wcgw-1.5.2 → wcgw-1.5.3}/src/wcgw/client/computer_use.py +5 -0
- {wcgw-1.5.2 → wcgw-1.5.3}/src/wcgw/client/mcp_server/server.py +25 -26
- {wcgw-1.5.2 → wcgw-1.5.3}/src/wcgw/types_.py +1 -0
- {wcgw-1.5.2 → wcgw-1.5.3}/uv.lock +1 -1
- wcgw-1.5.2/claude_desktop_config.json +0 -15
- {wcgw-1.5.2 → wcgw-1.5.3}/.github/workflows/python-publish.yml +0 -0
- {wcgw-1.5.2 → wcgw-1.5.3}/.github/workflows/python-tests.yml +0 -0
- {wcgw-1.5.2 → wcgw-1.5.3}/.gitignore +0 -0
- {wcgw-1.5.2 → wcgw-1.5.3}/.python-version +0 -0
- {wcgw-1.5.2 → wcgw-1.5.3}/.vscode/settings.json +0 -0
- {wcgw-1.5.2 → wcgw-1.5.3}/README.md +0 -0
- {wcgw-1.5.2 → wcgw-1.5.3}/add.py +0 -0
- {wcgw-1.5.2 → wcgw-1.5.3}/gpt_action_json_schema.json +0 -0
- {wcgw-1.5.2 → wcgw-1.5.3}/gpt_instructions.txt +0 -0
- {wcgw-1.5.2 → wcgw-1.5.3}/src/__init__.py +0 -0
- {wcgw-1.5.2 → wcgw-1.5.3}/src/wcgw/__init__.py +0 -0
- {wcgw-1.5.2 → wcgw-1.5.3}/src/wcgw/client/__init__.py +0 -0
- {wcgw-1.5.2 → wcgw-1.5.3}/src/wcgw/client/__main__.py +0 -0
- {wcgw-1.5.2 → wcgw-1.5.3}/src/wcgw/client/cli.py +0 -0
- {wcgw-1.5.2 → wcgw-1.5.3}/src/wcgw/client/common.py +0 -0
- {wcgw-1.5.2 → wcgw-1.5.3}/src/wcgw/client/diff-instructions.txt +0 -0
- {wcgw-1.5.2 → wcgw-1.5.3}/src/wcgw/client/mcp_server/Readme.md +0 -0
- {wcgw-1.5.2 → wcgw-1.5.3}/src/wcgw/client/mcp_server/__init__.py +0 -0
- {wcgw-1.5.2 → wcgw-1.5.3}/src/wcgw/client/openai_client.py +0 -0
- {wcgw-1.5.2 → wcgw-1.5.3}/src/wcgw/client/openai_utils.py +0 -0
- {wcgw-1.5.2 → wcgw-1.5.3}/src/wcgw/client/sys_utils.py +0 -0
- {wcgw-1.5.2 → wcgw-1.5.3}/src/wcgw/client/tools.py +0 -0
- {wcgw-1.5.2 → wcgw-1.5.3}/src/wcgw/relay/serve.py +0 -0
- {wcgw-1.5.2 → wcgw-1.5.3}/src/wcgw/relay/static/privacy.txt +0 -0
- {wcgw-1.5.2 → wcgw-1.5.3}/static/claude-ss.jpg +0 -0
- {wcgw-1.5.2 → wcgw-1.5.3}/static/computer-use.jpg +0 -0
- {wcgw-1.5.2 → wcgw-1.5.3}/static/example.jpg +0 -0
- {wcgw-1.5.2 → wcgw-1.5.3}/static/rocket-icon.png +0 -0
- {wcgw-1.5.2 → wcgw-1.5.3}/static/ss1.png +0 -0
- {wcgw-1.5.2 → wcgw-1.5.3}/tests/test_basic.py +0 -0
- {wcgw-1.5.2 → wcgw-1.5.3}/tests/test_tools.py +0 -0
|
@@ -182,6 +182,9 @@ def loop(
|
|
|
182
182
|
- Send text input to the running program.
|
|
183
183
|
- Send send_specials=["Enter"] to recheck status of a running program.
|
|
184
184
|
- Only one of send_text, send_specials, send_ascii should be provided.
|
|
185
|
+
- This returns within 5 seconds, for heavy programs keep checking status for upto 10 turns before asking user to continue checking again.
|
|
186
|
+
- Programs don't hang easily, so most likely explanation for no output is usually that the program is still running, and you need to check status again usign ["Enter"].
|
|
187
|
+
|
|
185
188
|
""",
|
|
186
189
|
),
|
|
187
190
|
ToolParam(
|
|
@@ -236,6 +239,12 @@ def loop(
|
|
|
236
239
|
name="ScreenShot",
|
|
237
240
|
description="""
|
|
238
241
|
- Capture screenshot of the linux os on docker.
|
|
242
|
+
- All actions on UI using mouse and keyboard return within 0.5 seconds.
|
|
243
|
+
* So if you're doing something that takes longer for UI to update like heavy page loading, keep checking UI for update usign ScreenShot upto 10 turns.
|
|
244
|
+
* Notice for smallest of the loading icons to check if your action worked.
|
|
245
|
+
* After 10 turns of no change, ask user for permission to keep checking.
|
|
246
|
+
* If you don't notice even slightest of the change, it's likely you clicked on the wrong place.
|
|
247
|
+
|
|
239
248
|
""",
|
|
240
249
|
),
|
|
241
250
|
ToolParam(
|
|
@@ -244,6 +253,7 @@ def loop(
|
|
|
244
253
|
description="""
|
|
245
254
|
- Interact with the linux os on docker using mouse.
|
|
246
255
|
- Uses xdotool
|
|
256
|
+
- About left_click_drag: the current mouse position will be used as the starting point, click and drag to the given x, y coordinates. Useful in things like sliders, moving things around, etc.
|
|
247
257
|
""",
|
|
248
258
|
),
|
|
249
259
|
ToolParam(
|
|
@@ -26,6 +26,7 @@ from ..types_ import (
|
|
|
26
26
|
OUTPUT_DIR = "/tmp/outputs"
|
|
27
27
|
TYPING_DELAY_MS = 12
|
|
28
28
|
TYPING_GROUP_SIZE = 50
|
|
29
|
+
SLEEP_TIME_MAX_S = 3
|
|
29
30
|
|
|
30
31
|
Action = Literal[
|
|
31
32
|
"key",
|
|
@@ -187,12 +188,15 @@ class ComputerTool:
|
|
|
187
188
|
text: str | None = None,
|
|
188
189
|
coordinate: tuple[int, int] | None = None,
|
|
189
190
|
do_left_click_on_move: bool | None = None,
|
|
191
|
+
take_after_delay_seconds: int | None = None,
|
|
190
192
|
**kwargs: Any,
|
|
191
193
|
) -> ToolResult:
|
|
192
194
|
if action == "get_screen_info":
|
|
193
195
|
assert docker_image_id is not None
|
|
194
196
|
self.docker_image_id = docker_image_id
|
|
195
197
|
self.get_screen_info()
|
|
198
|
+
if take_after_delay_seconds is not None:
|
|
199
|
+
time.sleep(min(take_after_delay_seconds, SLEEP_TIME_MAX_S))
|
|
196
200
|
screenshot_res = self.screenshot()
|
|
197
201
|
return ToolResult(
|
|
198
202
|
output=f"width: {self.width}, height: {self.height}, display_num: {self.display_num}",
|
|
@@ -396,6 +400,7 @@ def run_computer_tool(
|
|
|
396
400
|
elif isinstance(action, ScreenShot):
|
|
397
401
|
result = Computer(
|
|
398
402
|
action="screenshot",
|
|
403
|
+
screenshot_delay=action.take_after_delay_seconds,
|
|
399
404
|
)
|
|
400
405
|
elif isinstance(action, Keyboard):
|
|
401
406
|
result = Computer(
|
|
@@ -28,9 +28,9 @@ from ...types_ import (
|
|
|
28
28
|
ScreenShot,
|
|
29
29
|
GetScreenInfo,
|
|
30
30
|
)
|
|
31
|
-
from ..computer_use import
|
|
31
|
+
from ..computer_use import SLEEP_TIME_MAX_S
|
|
32
32
|
|
|
33
|
-
tools.TIMEOUT =
|
|
33
|
+
tools.TIMEOUT = SLEEP_TIME_MAX_S
|
|
34
34
|
|
|
35
35
|
server = Server("wcgw")
|
|
36
36
|
|
|
@@ -102,6 +102,8 @@ async def handle_list_tools() -> list[types.Tool]:
|
|
|
102
102
|
- Send text input to the running program.
|
|
103
103
|
- Send send_specials=["Enter"] to recheck status of a running program.
|
|
104
104
|
- Only one of send_text, send_specials, send_ascii should be provided.
|
|
105
|
+
- This returns within 3 seconds, for heavy programs keep checking status for upto 10 turns before asking user to continue checking again.
|
|
106
|
+
- Programs don't hang easily, so most likely explanation for no output is usually that the program is still running, and you need to check status again usign ["Enter"].
|
|
105
107
|
""",
|
|
106
108
|
),
|
|
107
109
|
ToolParam(
|
|
@@ -164,6 +166,11 @@ async def handle_list_tools() -> list[types.Tool]:
|
|
|
164
166
|
name="ScreenShot",
|
|
165
167
|
description="""
|
|
166
168
|
- Capture screenshot of the linux os on docker.
|
|
169
|
+
- All actions on UI using mouse and keyboard return within 0.5 seconds.
|
|
170
|
+
* So if you're doing something that takes longer for UI to update like heavy page loading, keep checking UI for update usign ScreenShot upto 10 turns.
|
|
171
|
+
* Notice for smallest of the loading icons to check if your action worked.
|
|
172
|
+
* After 10 turns of no change, ask user for permission to keep checking.
|
|
173
|
+
* If you don't notice even slightest of the change, it's likely you clicked on the wrong place.
|
|
167
174
|
""",
|
|
168
175
|
),
|
|
169
176
|
ToolParam(
|
|
@@ -172,6 +179,7 @@ async def handle_list_tools() -> list[types.Tool]:
|
|
|
172
179
|
description="""
|
|
173
180
|
- Interact with the linux os on docker using mouse.
|
|
174
181
|
- Uses xdotool
|
|
182
|
+
- About left_click_drag: the current mouse position will be used as the starting point, click and drag to the given x, y coordinates. Useful in things like sliders, moving things around, etc.
|
|
175
183
|
""",
|
|
176
184
|
),
|
|
177
185
|
ToolParam(
|
|
@@ -257,27 +265,18 @@ async def handle_call_tool(
|
|
|
257
265
|
|
|
258
266
|
async def main() -> None:
|
|
259
267
|
version = importlib.metadata.version("wcgw")
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
raise_exceptions=False,
|
|
276
|
-
)
|
|
277
|
-
except BaseException as e:
|
|
278
|
-
print(f"Server encountered an error: {e}", file=sys.stderr)
|
|
279
|
-
print("Stack trace:", file=sys.stderr)
|
|
280
|
-
traceback.print_exc(file=sys.stderr)
|
|
281
|
-
print("Restarting server in 5 seconds...", file=sys.stderr)
|
|
282
|
-
await asyncio.sleep(5)
|
|
283
|
-
continue
|
|
268
|
+
# Run the server using stdin/stdout streams
|
|
269
|
+
async with mcp.server.stdio.stdio_server() as (read_stream, write_stream):
|
|
270
|
+
await server.run(
|
|
271
|
+
read_stream,
|
|
272
|
+
write_stream,
|
|
273
|
+
InitializationOptions(
|
|
274
|
+
server_name="wcgw",
|
|
275
|
+
server_version=version,
|
|
276
|
+
capabilities=server.get_capabilities(
|
|
277
|
+
notification_options=NotificationOptions(),
|
|
278
|
+
experimental_capabilities={},
|
|
279
|
+
),
|
|
280
|
+
),
|
|
281
|
+
raise_exceptions=False,
|
|
282
|
+
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{wcgw-1.5.2 → wcgw-1.5.3}/add.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|