wcgw 2.0.0__py3-none-any.whl → 2.0.2__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.

@@ -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
 
wcgw/client/tools.py CHANGED
@@ -929,9 +929,7 @@ def register_client(server_url: str, client_uuid: str = "") -> None:
929
929
  client_version = importlib.metadata.version("wcgw")
930
930
  websocket.send(client_version)
931
931
 
932
- print(
933
- f"Connected. Share this user id with the chatbot: {client_uuid} \nLink: https://chatgpt.com/g/g-Us0AAXkRh-wcgw-giving-shell-access"
934
- )
932
+ print(f"Connected. Share this user id with the chatbot: {client_uuid}")
935
933
  while True:
936
934
  # Wait to receive data from the server
937
935
  message = websocket.recv()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: wcgw
3
- Version: 2.0.0
3
+ Version: 2.0.2
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
@@ -5,18 +5,18 @@ wcgw/client/__main__.py,sha256=wcCrL4PjG51r5wVKqJhcoJPTLfHW0wNbD31DrUN0MWI,28
5
5
  wcgw/client/anthropic_client.py,sha256=yhFavV51c7zl2AqWQS2i-4KtLh4BRI-odFlppg5sIDY,19965
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
12
12
  wcgw/client/sys_utils.py,sha256=GajPntKhaTUMn6EOmopENWZNR2G_BJyuVbuot0x6veI,1376
13
- wcgw/client/tools.py,sha256=DQ5oRhaXkNDMQccbM59tyMjL76VIyihM5rgkvN-_2B4,33237
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
16
  wcgw/client/mcp_server/server.py,sha256=M9pJ3DktGsxf6cufXbZ0xxs0HIKNLGc75O_biV2UKYA,10571
17
17
  wcgw/relay/serve.py,sha256=RUcUeyL4Xt0EEo12Ul6VQjb4tRle4uIdsa85v7XXxEw,8771
18
18
  wcgw/relay/static/privacy.txt,sha256=s9qBdbx2SexCpC_z33sg16TptmAwDEehMCLz4L50JLc,529
19
- wcgw-2.0.0.dist-info/METADATA,sha256=oJwWfTlEZnRw470t40fgZMdVRfS5qSstxBgDSISWEb4,5054
20
- wcgw-2.0.0.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
21
- wcgw-2.0.0.dist-info/entry_points.txt,sha256=eKo1omwbAggWlQ0l7GKoR7uV1-j16nk9tK0BhC2Oz_E,120
22
- wcgw-2.0.0.dist-info/RECORD,,
19
+ wcgw-2.0.2.dist-info/METADATA,sha256=qMZuMfGrqgLa_vsnfDrrsQW0rMEiSeqib-NX87WyDH4,5249
20
+ wcgw-2.0.2.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
21
+ wcgw-2.0.2.dist-info/entry_points.txt,sha256=eKo1omwbAggWlQ0l7GKoR7uV1-j16nk9tK0BhC2Oz_E,120
22
+ wcgw-2.0.2.dist-info/RECORD,,
File without changes