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

wcgw/client/tools.py CHANGED
@@ -744,6 +744,7 @@ class Mdata(BaseModel):
744
744
  | ResetShell
745
745
  | FileEditFindReplace
746
746
  | FullFileEdit
747
+ | str
747
748
  )
748
749
 
749
750
 
@@ -768,6 +769,8 @@ def register_client(server_url: str, client_uuid: str = "") -> None:
768
769
  # Wait to receive data from the server
769
770
  message = websocket.recv()
770
771
  mdata = Mdata.model_validate_json(message)
772
+ if isinstance(mdata.data, str):
773
+ raise Exception(mdata)
771
774
  try:
772
775
  output, cost = get_tool_output(
773
776
  mdata.data, default_enc, 0.0, lambda x, y: ("", 0), None
@@ -780,7 +783,7 @@ def register_client(server_url: str, client_uuid: str = "") -> None:
780
783
  assert isinstance(output, str)
781
784
  websocket.send(output)
782
785
 
783
- except (websockets.ConnectionClosed, ConnectionError):
786
+ except (websockets.ConnectionClosed, ConnectionError, OSError):
784
787
  print(f"Connection closed for UUID: {client_uuid}, retrying")
785
788
  register_client(server_url, client_uuid)
786
789
 
wcgw/relay/serve.py CHANGED
@@ -35,6 +35,7 @@ class Mdata(BaseModel):
35
35
  | ResetShell
36
36
  | FileEditFindReplace
37
37
  | FullFileEdit
38
+ | str
38
39
  )
39
40
  user_id: UUID
40
41
 
@@ -48,7 +49,7 @@ gpts: dict[UUID, Callable[[str], None]] = {}
48
49
  images: DefaultDict[UUID, dict[str, dict[str, Any]]] = DefaultDict(dict)
49
50
 
50
51
 
51
- CLIENT_VERSION_MINIMUM = "1.0.0"
52
+ CLIENT_VERSION_MINIMUM = "1.1.0"
52
53
 
53
54
 
54
55
  @app.websocket("/v1/register/{uuid}")
@@ -65,7 +66,10 @@ async def register_websocket(websocket: WebSocket, uuid: UUID) -> None:
65
66
  sem_version_server = semantic_version.Version.coerce(CLIENT_VERSION_MINIMUM)
66
67
  if sem_version_client < sem_version_server:
67
68
  await websocket.send_text(
68
- f"Client version {client_version} is outdated. Please upgrade to {CLIENT_VERSION_MINIMUM} or higher."
69
+ Mdata(
70
+ user_id=uuid,
71
+ data=f"Client version {client_version} is outdated. Please upgrade to {CLIENT_VERSION_MINIMUM} or higher.",
72
+ ).model_dump_json()
69
73
  )
70
74
  await websocket.close(
71
75
  reason="Client version outdated. Please upgrade to the latest version.",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: wcgw
3
- Version: 1.1.0
3
+ Version: 1.1.1
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>
@@ -8,10 +8,10 @@ wcgw/client/common.py,sha256=grH-yV_4tnTQZ29xExn4YicGLxEq98z-HkEZwH0ReSg,1410
8
8
  wcgw/client/diff-instructions.txt,sha256=IcoPUZS5Y_fDlA5BuryIEGYykpnDtGUAP_oUNrZyC8U,1564
9
9
  wcgw/client/openai_client.py,sha256=Qu5xjfL3zP7YkdDwowtyq2kAGYY1-YvNOt8FwdScoU8,16972
10
10
  wcgw/client/openai_utils.py,sha256=YNwCsA-Wqq7jWrxP0rfQmBTb1dI0s7dWXzQqyTzOZT4,2629
11
- wcgw/client/tools.py,sha256=KxMd8aPJmnkH-R-IisEAJ6KHAX95PRt2kLh9Z1t28hE,24667
12
- wcgw/relay/serve.py,sha256=Ch-vdUK-W60fkVVwFZIfy2L1VT7Te4Yt4Z8Bb0ykAh8,7131
11
+ wcgw/client/tools.py,sha256=ElFLxeEezLmIzmEmvts6BdtcWWjjK-R4VUS2BXA6qWw,24781
12
+ wcgw/relay/serve.py,sha256=hUMNnf4KxF-clUYvky09bWQtuRvqJny71D93PppSpec,7236
13
13
  wcgw/relay/static/privacy.txt,sha256=s9qBdbx2SexCpC_z33sg16TptmAwDEehMCLz4L50JLc,529
14
- wcgw-1.1.0.dist-info/METADATA,sha256=uvRAnlHl03aoR4uhhF0qVTK3Et3GF6DHIofx1jHUNQQ,5255
15
- wcgw-1.1.0.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
16
- wcgw-1.1.0.dist-info/entry_points.txt,sha256=WlIB825-Vm9ZtNzgENQsbHj4DRMkbpVR7uSkQyBlaPA,93
17
- wcgw-1.1.0.dist-info/RECORD,,
14
+ wcgw-1.1.1.dist-info/METADATA,sha256=g91AStAolRmCDBXzhjKkTwljoHoJTv9uuS0iqGXpbHM,5255
15
+ wcgw-1.1.1.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
16
+ wcgw-1.1.1.dist-info/entry_points.txt,sha256=WlIB825-Vm9ZtNzgENQsbHj4DRMkbpVR7uSkQyBlaPA,93
17
+ wcgw-1.1.1.dist-info/RECORD,,
File without changes