wcgw 1.1.1__py3-none-any.whl → 1.1.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.
wcgw/client/tools.py
CHANGED
|
@@ -9,6 +9,7 @@ import re
|
|
|
9
9
|
import sys
|
|
10
10
|
import threading
|
|
11
11
|
import importlib.metadata
|
|
12
|
+
import time
|
|
12
13
|
import traceback
|
|
13
14
|
from typing import (
|
|
14
15
|
Callable,
|
|
@@ -755,16 +756,16 @@ def register_client(server_url: str, client_uuid: str = "") -> None:
|
|
|
755
756
|
client_uuid = str(uuid.uuid4())
|
|
756
757
|
|
|
757
758
|
# Create the WebSocket connection
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
759
|
+
try:
|
|
760
|
+
with syncconnect(f"{server_url}/{client_uuid}") as websocket:
|
|
761
|
+
server_version = str(websocket.recv())
|
|
762
|
+
print(f"Server version: {server_version}")
|
|
763
|
+
client_version = importlib.metadata.version("wcgw")
|
|
764
|
+
websocket.send(client_version)
|
|
765
|
+
|
|
766
|
+
print(
|
|
767
|
+
f"Connected. Share this user id with the chatbot: {client_uuid} \nLink: https://chatgpt.com/g/g-Us0AAXkRh-wcgw-giving-shell-access"
|
|
768
|
+
)
|
|
768
769
|
while True:
|
|
769
770
|
# Wait to receive data from the server
|
|
770
771
|
message = websocket.recv()
|
|
@@ -783,9 +784,10 @@ def register_client(server_url: str, client_uuid: str = "") -> None:
|
|
|
783
784
|
assert isinstance(output, str)
|
|
784
785
|
websocket.send(output)
|
|
785
786
|
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
787
|
+
except (websockets.ConnectionClosed, ConnectionError, OSError):
|
|
788
|
+
print(f"Connection closed for UUID: {client_uuid}, retrying")
|
|
789
|
+
time.sleep(0.5)
|
|
790
|
+
register_client(server_url, client_uuid)
|
|
789
791
|
|
|
790
792
|
|
|
791
793
|
run = Typer(pretty_exceptions_show_locals=False, no_args_is_help=True)
|
|
@@ -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
|
|
11
|
+
wcgw/client/tools.py,sha256=-Of_Kknaf27fi76rhDdMeDTuHjTw_AKSesPKCDDqAVM,24833
|
|
12
12
|
wcgw/relay/serve.py,sha256=hUMNnf4KxF-clUYvky09bWQtuRvqJny71D93PppSpec,7236
|
|
13
13
|
wcgw/relay/static/privacy.txt,sha256=s9qBdbx2SexCpC_z33sg16TptmAwDEehMCLz4L50JLc,529
|
|
14
|
-
wcgw-1.1.
|
|
15
|
-
wcgw-1.1.
|
|
16
|
-
wcgw-1.1.
|
|
17
|
-
wcgw-1.1.
|
|
14
|
+
wcgw-1.1.2.dist-info/METADATA,sha256=f5t2PzR0Oz0BRTAMs2BwQC8Y5p7hXVUobut-PS1HIVQ,5255
|
|
15
|
+
wcgw-1.1.2.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
|
16
|
+
wcgw-1.1.2.dist-info/entry_points.txt,sha256=WlIB825-Vm9ZtNzgENQsbHj4DRMkbpVR7uSkQyBlaPA,93
|
|
17
|
+
wcgw-1.1.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|