wcgw 2.0.1__py3-none-any.whl → 2.0.3__py3-none-any.whl

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.

@@ -262,6 +262,7 @@ def loop(
262
262
  - Interact with the linux os on docker using mouse.
263
263
  - Uses xdotool
264
264
  - 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.
265
+ - The output of this command has the screenshot after doing this action. Use this to verify if the action was successful.
265
266
  """,
266
267
  ),
267
268
  ToolParam(
@@ -272,6 +273,8 @@ def loop(
272
273
  - Emulate keyboard input to the screen
273
274
  - Uses xdootool to send keyboard input, keys like Return, BackSpace, Escape, Page_Up, etc. can be used.
274
275
  - Do not use it to interact with Bash tool.
276
+ - Make sure you've selected a text area or an editable element before sending text.
277
+ - The output of this command has the screenshot after doing this action. Use this to verify if the action was successful.
275
278
  """,
276
279
  ),
277
280
  ]
@@ -245,9 +245,17 @@ class ComputerTool:
245
245
  return self.shell(f"{self.xdotool} key -- {text}")
246
246
  elif action == "type":
247
247
  results: list[ToolResult] = []
248
- for chunk in chunks(text, TYPING_GROUP_SIZE):
249
- cmd = f"{self.xdotool} type --delay {TYPING_DELAY_MS} -- {shlex.quote(chunk)}"
250
- results.append(self.shell(cmd, take_screenshot=False))
248
+ all_lines = text.splitlines()
249
+ for i, line in enumerate(all_lines):
250
+ for chunk in chunks(line, TYPING_GROUP_SIZE):
251
+ cmd = f"{self.xdotool} type --delay {TYPING_DELAY_MS} -- {shlex.quote(chunk)}"
252
+ results.append(self.shell(cmd, take_screenshot=False))
253
+ if i < len(all_lines) - 1:
254
+ results.append(
255
+ self.shell(
256
+ f"{self.xdotool} key Return", take_screenshot=False
257
+ )
258
+ )
251
259
  screenshot_base64 = self.screenshot().base64_image
252
260
  return ToolResult(
253
261
  output="".join(result.output or "" for result in results),
@@ -343,8 +351,9 @@ class ComputerTool:
343
351
 
344
352
  def shell(self, command: str, take_screenshot: bool = True) -> ToolResult:
345
353
  """Run a shell command and return the output, error, and optionally a screenshot."""
354
+ escaped_command = shlex.quote(command)
346
355
  _, stdout, stderr = command_run(
347
- f"docker exec {self.docker_image_id} sh -c '{command}'"
356
+ f"docker exec {self.docker_image_id} bash -c {escaped_command}",
348
357
  )
349
358
  base64_image = None
350
359
 
@@ -178,6 +178,7 @@ async def handle_list_tools() -> list[types.Tool]:
178
178
  - Interact with the linux os on docker using mouse.
179
179
  - Uses xdotool
180
180
  - 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.
181
+ - The output of this command has the screenshot after doing this action. Use this to verify if the action was successful.
181
182
  """,
182
183
  ),
183
184
  ToolParam(
@@ -189,6 +190,7 @@ async def handle_list_tools() -> list[types.Tool]:
189
190
  - Uses xdootool to send keyboard input, keys like Return, BackSpace, Escape, Page_Up, etc. can be used.
190
191
  - Do not use it to interact with Bash tool.
191
192
  - Make sure you've selected a text area or an editable element before sending text.
193
+ - The output of this command has the screenshot after doing this action. Use this to verify if the action was successful.
192
194
  """,
193
195
  ),
194
196
  ]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: wcgw
3
- Version: 2.0.1
3
+ Version: 2.0.3
4
4
  Summary: What could go wrong giving full shell access to chatgpt?
5
5
  Project-URL: Homepage, https://github.com/rusiaaman/wcgw
6
6
  Author-email: Aman Rusia <gapypi@arcfu.com>
@@ -27,9 +27,10 @@ Requires-Dist: uvicorn>=0.31.0
27
27
  Requires-Dist: websockets>=13.1
28
28
  Description-Content-Type: text/markdown
29
29
 
30
- # Shell and Coding agent on Claude desktop app
30
+ # Shell and Coding agent for Claude and Chatgpt
31
31
 
32
- - An MCP server on claude desktop for autonomous shell, coding and desktop control agent.
32
+ - Claude - An MCP server on claude desktop for autonomous shell, coding and desktop control agent.
33
+ - Chatgpt - Allows custom gpt to talk to your shell via a relay server.
33
34
 
34
35
  [![Tests](https://github.com/rusiaaman/wcgw/actions/workflows/python-tests.yml/badge.svg?branch=main)](https://github.com/rusiaaman/wcgw/actions/workflows/python-tests.yml)
35
36
  [![Mypy strict](https://github.com/rusiaaman/wcgw/actions/workflows/python-types.yml/badge.svg?branch=main)](https://github.com/rusiaaman/wcgw/actions/workflows/python-types.yml)
@@ -37,7 +38,7 @@ Description-Content-Type: text/markdown
37
38
 
38
39
  ## Updates
39
40
 
40
- - [01 Dec 2024] Deprecated chatgpt app support
41
+ - [01 Dec 2024] Removed author hosted relay server for chatgpt.
41
42
 
42
43
  - [26 Nov 2024] Introduced claude desktop support through mcp
43
44
 
@@ -49,7 +50,7 @@ Description-Content-Type: text/markdown
49
50
  - ⚡ **Interactive Command Handling**: Supports interactive commands using arrow keys, interrupt, and ansi escape sequences.
50
51
  - ⚡ **REPL support**: [beta] Supports python/node and other REPL execution.
51
52
 
52
- ## Setup
53
+ ## Claude Setup
53
54
 
54
55
  Update `claude_desktop_config.json` (~/Library/Application Support/Claude/claude_desktop_config.json)
55
56
 
@@ -74,7 +75,7 @@ Update `claude_desktop_config.json` (~/Library/Application Support/Claude/claude
74
75
 
75
76
  Then restart claude app.
76
77
 
77
- ## [Optional] Computer use support using desktop on docker
78
+ ### [Optional] Computer use support using desktop on docker
78
79
 
79
80
  Computer use is disabled by default. Add `--computer-use` to enable it. This will add necessary tools to Claude including ScreenShot, Mouse and Keyboard control.
80
81
 
@@ -123,7 +124,12 @@ Then ask claude to execute shell commands, read files, edit files, run your code
123
124
 
124
125
  If you've run the docker for LLM to access, you can ask it to control the "docker os". If you don't provide the docker container id to it, it'll try to search for available docker using `docker ps` command.
125
126
 
126
- ## Example
127
+
128
+ ## Chatgpt Setup
129
+
130
+ Read here: https://github.com/rusiaaman/wcgw/blob/main/openai.md
131
+
132
+ ## Examples
127
133
 
128
134
  ### Computer use example
129
135
 
@@ -133,6 +139,7 @@ If you've run the docker for LLM to access, you can ask it to control the "docke
133
139
 
134
140
  ![example](https://github.com/rusiaaman/wcgw/blob/main/static/example.jpg?raw=true)
135
141
 
142
+
136
143
  ## [Optional] Local shell access with openai API key or anthropic API key
137
144
 
138
145
  ### Openai
@@ -2,10 +2,10 @@ wcgw/__init__.py,sha256=9K2QW7QuSLhMTVbKbBYd9UUp-ZyrfBrxcjuD_xk458k,118
2
2
  wcgw/types_.py,sha256=rDz4olJS2zvYC13jzeOppA2tci-tVDyWAqeA5BesAaU,1773
3
3
  wcgw/client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  wcgw/client/__main__.py,sha256=wcCrL4PjG51r5wVKqJhcoJPTLfHW0wNbD31DrUN0MWI,28
5
- wcgw/client/anthropic_client.py,sha256=yhFavV51c7zl2AqWQS2i-4KtLh4BRI-odFlppg5sIDY,19965
5
+ wcgw/client/anthropic_client.py,sha256=G5bUSKndI-rXIPhzRg-P3YVU5OiJLX24Ks4FswkD-m4,20293
6
6
  wcgw/client/cli.py,sha256=-z0kpDAW3mzfQrQeZfaVJhBCAQY3HXnt9GdgQ8s-u0Y,1003
7
7
  wcgw/client/common.py,sha256=grH-yV_4tnTQZ29xExn4YicGLxEq98z-HkEZwH0ReSg,1410
8
- wcgw/client/computer_use.py,sha256=7m_EMdyvJXZz5L0sVJA9zN2pQNtTkiQE__ie3qsvfG8,14878
8
+ wcgw/client/computer_use.py,sha256=vogD9DDgEJAEJ6VSVRB1cAYcj4UXpSu2qqyaVXddMlQ,15312
9
9
  wcgw/client/diff-instructions.txt,sha256=s5AJKG23JsjwRYhFZFQVvwDpF67vElawrmdXwvukR1A,1683
10
10
  wcgw/client/openai_client.py,sha256=F5TEv5DhU9twsywSZGtuVkPo6xVaaoaEjvIh88FnIUQ,17780
11
11
  wcgw/client/openai_utils.py,sha256=YNwCsA-Wqq7jWrxP0rfQmBTb1dI0s7dWXzQqyTzOZT4,2629
@@ -13,10 +13,10 @@ wcgw/client/sys_utils.py,sha256=GajPntKhaTUMn6EOmopENWZNR2G_BJyuVbuot0x6veI,1376
13
13
  wcgw/client/tools.py,sha256=T97lOO58UP_2ohfvXQNCVJgLLtEWlcVT9iBSkSwuVW8,33140
14
14
  wcgw/client/mcp_server/Readme.md,sha256=I8N4dHkTUVGNQ63BQkBMBhCCBTgqGOSF_pUR6iOEiUk,2495
15
15
  wcgw/client/mcp_server/__init__.py,sha256=hyPPwO9cabAJsOMWhKyat9yl7OlSmIobaoAZKHu3DMc,381
16
- wcgw/client/mcp_server/server.py,sha256=M9pJ3DktGsxf6cufXbZ0xxs0HIKNLGc75O_biV2UKYA,10571
16
+ wcgw/client/mcp_server/server.py,sha256=XWZCMlL5HOpvRQjY1qoZnmFAe9x_rpRb_udZz9k8ks4,10815
17
17
  wcgw/relay/serve.py,sha256=RUcUeyL4Xt0EEo12Ul6VQjb4tRle4uIdsa85v7XXxEw,8771
18
18
  wcgw/relay/static/privacy.txt,sha256=s9qBdbx2SexCpC_z33sg16TptmAwDEehMCLz4L50JLc,529
19
- wcgw-2.0.1.dist-info/METADATA,sha256=0SfD0wo1GHoNJ3dUM3a2xLHLxXswZkxUivSedgD-ibA,5054
20
- wcgw-2.0.1.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
21
- wcgw-2.0.1.dist-info/entry_points.txt,sha256=eKo1omwbAggWlQ0l7GKoR7uV1-j16nk9tK0BhC2Oz_E,120
22
- wcgw-2.0.1.dist-info/RECORD,,
19
+ wcgw-2.0.3.dist-info/METADATA,sha256=IAOrtOrugaHoMJMpF0i_n3PRMSvssR4E7HbF3iyK7ok,5249
20
+ wcgw-2.0.3.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
21
+ wcgw-2.0.3.dist-info/entry_points.txt,sha256=eKo1omwbAggWlQ0l7GKoR7uV1-j16nk9tK0BhC2Oz_E,120
22
+ wcgw-2.0.3.dist-info/RECORD,,
File without changes