wcgw 2.3.0__tar.gz → 2.3.2__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.
Files changed (39) hide show
  1. {wcgw-2.3.0 → wcgw-2.3.2}/PKG-INFO +1 -1
  2. {wcgw-2.3.0 → wcgw-2.3.2}/pyproject.toml +1 -1
  3. {wcgw-2.3.0 → wcgw-2.3.2}/src/wcgw/client/mcp_server/server.py +5 -2
  4. {wcgw-2.3.0 → wcgw-2.3.2}/src/wcgw/client/tools.py +19 -8
  5. {wcgw-2.3.0 → wcgw-2.3.2}/.github/workflows/python-publish.yml +0 -0
  6. {wcgw-2.3.0 → wcgw-2.3.2}/.github/workflows/python-tests.yml +0 -0
  7. {wcgw-2.3.0 → wcgw-2.3.2}/.github/workflows/python-types.yml +0 -0
  8. {wcgw-2.3.0 → wcgw-2.3.2}/.gitignore +0 -0
  9. {wcgw-2.3.0 → wcgw-2.3.2}/.python-version +0 -0
  10. {wcgw-2.3.0 → wcgw-2.3.2}/.vscode/settings.json +0 -0
  11. {wcgw-2.3.0 → wcgw-2.3.2}/README.md +0 -0
  12. {wcgw-2.3.0 → wcgw-2.3.2}/gpt_action_json_schema.json +0 -0
  13. {wcgw-2.3.0 → wcgw-2.3.2}/gpt_instructions.txt +0 -0
  14. {wcgw-2.3.0 → wcgw-2.3.2}/openai.md +0 -0
  15. {wcgw-2.3.0 → wcgw-2.3.2}/src/__init__.py +0 -0
  16. {wcgw-2.3.0 → wcgw-2.3.2}/src/wcgw/__init__.py +0 -0
  17. {wcgw-2.3.0 → wcgw-2.3.2}/src/wcgw/client/__init__.py +0 -0
  18. {wcgw-2.3.0 → wcgw-2.3.2}/src/wcgw/client/__main__.py +0 -0
  19. {wcgw-2.3.0 → wcgw-2.3.2}/src/wcgw/client/anthropic_client.py +0 -0
  20. {wcgw-2.3.0 → wcgw-2.3.2}/src/wcgw/client/cli.py +0 -0
  21. {wcgw-2.3.0 → wcgw-2.3.2}/src/wcgw/client/common.py +0 -0
  22. {wcgw-2.3.0 → wcgw-2.3.2}/src/wcgw/client/computer_use.py +0 -0
  23. {wcgw-2.3.0 → wcgw-2.3.2}/src/wcgw/client/diff-instructions.txt +0 -0
  24. {wcgw-2.3.0 → wcgw-2.3.2}/src/wcgw/client/mcp_server/Readme.md +0 -0
  25. {wcgw-2.3.0 → wcgw-2.3.2}/src/wcgw/client/mcp_server/__init__.py +0 -0
  26. {wcgw-2.3.0 → wcgw-2.3.2}/src/wcgw/client/openai_client.py +0 -0
  27. {wcgw-2.3.0 → wcgw-2.3.2}/src/wcgw/client/openai_utils.py +0 -0
  28. {wcgw-2.3.0 → wcgw-2.3.2}/src/wcgw/client/sys_utils.py +0 -0
  29. {wcgw-2.3.0 → wcgw-2.3.2}/src/wcgw/relay/serve.py +0 -0
  30. {wcgw-2.3.0 → wcgw-2.3.2}/src/wcgw/relay/static/privacy.txt +0 -0
  31. {wcgw-2.3.0 → wcgw-2.3.2}/src/wcgw/types_.py +0 -0
  32. {wcgw-2.3.0 → wcgw-2.3.2}/static/claude-ss.jpg +0 -0
  33. {wcgw-2.3.0 → wcgw-2.3.2}/static/computer-use.jpg +0 -0
  34. {wcgw-2.3.0 → wcgw-2.3.2}/static/example.jpg +0 -0
  35. {wcgw-2.3.0 → wcgw-2.3.2}/static/rocket-icon.png +0 -0
  36. {wcgw-2.3.0 → wcgw-2.3.2}/static/ss1.png +0 -0
  37. {wcgw-2.3.0 → wcgw-2.3.2}/tests/test_basic.py +0 -0
  38. {wcgw-2.3.0 → wcgw-2.3.2}/tests/test_tools.py +0 -0
  39. {wcgw-2.3.0 → wcgw-2.3.2}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wcgw
3
- Version: 2.3.0
3
+ Version: 2.3.2
4
4
  Summary: Shell and coding agent on claude and chatgpt
5
5
  Project-URL: Homepage, https://github.com/rusiaaman/wcgw
6
6
  Author-email: Aman Rusia <gapypi@arcfu.com>
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  authors = [{ name = "Aman Rusia", email = "gapypi@arcfu.com" }]
3
3
  name = "wcgw"
4
- version = "2.3.0"
4
+ version = "2.3.2"
5
5
  description = "Shell and coding agent on claude and chatgpt"
6
6
  readme = "README.md"
7
7
  requires-python = ">=3.11, <3.13"
@@ -30,8 +30,6 @@ from ...types_ import (
30
30
  )
31
31
  from ..computer_use import SLEEP_TIME_MAX_S
32
32
 
33
- tools.TIMEOUT = SLEEP_TIME_MAX_S
34
-
35
33
  COMPUTER_USE_ON_DOCKER_ENABLED = False
36
34
 
37
35
  server = Server("wcgw")
@@ -275,6 +273,11 @@ async def handle_call_tool(
275
273
 
276
274
  async def main(computer_use: bool) -> None:
277
275
  global COMPUTER_USE_ON_DOCKER_ENABLED
276
+
277
+ tools.TIMEOUT = SLEEP_TIME_MAX_S
278
+
279
+ tools.console = tools.DisableConsole()
280
+
278
281
  if computer_use:
279
282
  COMPUTER_USE_ON_DOCKER_ENABLED = True
280
283
 
@@ -72,7 +72,18 @@ from .common import CostData, Models, discard_input
72
72
  from .sys_utils import command_run
73
73
  from .openai_utils import get_input_cost, get_output_cost
74
74
 
75
- console = rich.console.Console(style="magenta", highlight=False, markup=False)
75
+
76
+ class DisableConsole:
77
+ def print(self, *args, **kwargs): # type: ignore
78
+ pass
79
+
80
+ def log(self, *args, **kwargs): # type: ignore
81
+ pass
82
+
83
+
84
+ console: rich.console.Console | DisableConsole = rich.console.Console(
85
+ style="magenta", highlight=False, markup=False
86
+ )
76
87
 
77
88
  TIMEOUT = 5
78
89
 
@@ -119,7 +130,7 @@ def start_shell() -> pexpect.spawn: # type: ignore
119
130
  )
120
131
  shell.sendline(f"export PS1={PROMPT}")
121
132
  except Exception as e:
122
- traceback.print_exc()
133
+ console.print(traceback.format_exc())
123
134
  console.log(f"Error starting shell: {e}. Retrying without rc ...")
124
135
 
125
136
  shell = pexpect.spawn(
@@ -159,7 +170,7 @@ def _get_exit_code(shell: pexpect.spawn) -> int: # type: ignore
159
170
  try:
160
171
  shell.expect(PROMPT, timeout=0.2)
161
172
  except pexpect.TIMEOUT:
162
- print(f"Couldn't get exit code, before: {before}")
173
+ console.print(f"Couldn't get exit code, before: {before}")
163
174
  raise
164
175
  assert isinstance(shell.before, str)
165
176
  # Render because there could be some anscii escape sequences still set like in google colab env
@@ -283,12 +294,12 @@ def update_repl_prompt(command: str) -> bool:
283
294
  PROMPT = before.split("\n")[-1].strip()
284
295
  # Escape all regex
285
296
  PROMPT = re.escape(PROMPT)
286
- print(f"Trying to update prompt to: {PROMPT.encode()!r}")
297
+ console.print(f"Trying to update prompt to: {PROMPT.encode()!r}")
287
298
  index = 0
288
299
  while index == 0:
289
300
  # Consume all REPL prompts till now
290
301
  index = BASH_STATE.shell.expect([PROMPT, pexpect.TIMEOUT], timeout=0.2)
291
- print(f"Prompt updated to: {PROMPT}")
302
+ console.print(f"Prompt updated to: {PROMPT}")
292
303
  return True
293
304
  return False
294
305
 
@@ -484,7 +495,7 @@ Otherwise, you may want to try Ctrl-c again or program specific exit interactive
484
495
  output += exit_status
485
496
  except ValueError as e:
486
497
  console.print(output)
487
- traceback.print_exc()
498
+ console.print(traceback.format_exc())
488
499
  console.print("Malformed output, restarting shell", style="red")
489
500
  # Malformed output, restart shell
490
501
  BASH_STATE.reset()
@@ -508,7 +519,7 @@ def serve_image_in_bg(file_path: str, client_uuid: str, name: str) -> None:
508
519
  try:
509
520
  websocket.send(json.dumps(uu))
510
521
  except websockets.ConnectionClosed:
511
- print(f"Connection closed for UUID: {client_uuid}, retrying")
522
+ console.print(f"Connection closed for UUID: {client_uuid}, retrying")
512
523
  serve_image_in_bg(file_path, client_uuid, name)
513
524
 
514
525
 
@@ -1139,7 +1150,7 @@ def register_client(server_url: str, client_uuid: str = "") -> None:
1139
1150
  print(f"{curr_cost=}")
1140
1151
  except Exception as e:
1141
1152
  output = f"GOT EXCEPTION while calling tool. Error: {e}"
1142
- traceback.print_exc()
1153
+ console.print(traceback.format_exc())
1143
1154
  assert isinstance(output, str)
1144
1155
  websocket.send(output)
1145
1156
 
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