hypercli-sdk 1.0.1__tar.gz → 1.0.3__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.
- {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/PKG-INFO +1 -1
- {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/hypercli/gateway.py +10 -5
- {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/hypercli/jobs.py +1 -1
- {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/pyproject.toml +1 -1
- {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/.gitignore +0 -0
- {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/README.md +0 -0
- {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/hypercli/__init__.py +0 -0
- {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/hypercli/agents.py +0 -0
- {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/hypercli/billing.py +0 -0
- {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/hypercli/claw.py +0 -0
- {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/hypercli/client.py +0 -0
- {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/hypercli/config.py +0 -0
- {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/hypercli/files.py +0 -0
- {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/hypercli/http.py +0 -0
- {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/hypercli/instances.py +0 -0
- {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/hypercli/job/__init__.py +0 -0
- {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/hypercli/job/base.py +0 -0
- {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/hypercli/job/comfyui.py +0 -0
- {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/hypercli/job/gradio.py +0 -0
- {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/hypercli/keys.py +0 -0
- {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/hypercli/logs.py +0 -0
- {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/hypercli/renders.py +0 -0
- {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/hypercli/shell.py +0 -0
- {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/hypercli/user.py +0 -0
- {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/hypercli/x402.py +0 -0
- {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/tests/test_agents.py +0 -0
- {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/tests/test_apply_params.py +0 -0
- {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/tests/test_claw.py +0 -0
- {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/tests/test_graph_to_api.py +0 -0
|
@@ -86,15 +86,17 @@ class GatewayClient:
|
|
|
86
86
|
url: str,
|
|
87
87
|
token: str,
|
|
88
88
|
gateway_token: str = "traefik-forwarded-auth-not-used",
|
|
89
|
-
client_id: str = "
|
|
90
|
-
client_mode: str = "
|
|
89
|
+
client_id: str = "openclaw-control-ui",
|
|
90
|
+
client_mode: str = "webchat",
|
|
91
|
+
origin: str = "https://hyperclaw.app",
|
|
91
92
|
timeout: float = DEFAULT_TIMEOUT,
|
|
92
93
|
):
|
|
93
94
|
self.url = url
|
|
94
95
|
self.token = token
|
|
95
96
|
self.gateway_token = gateway_token
|
|
96
|
-
self.client_id = client_id
|
|
97
|
-
self.client_mode = client_mode
|
|
97
|
+
self.client_id = client_id or "openclaw-control-ui"
|
|
98
|
+
self.client_mode = client_mode or "webchat"
|
|
99
|
+
self.origin = origin
|
|
98
100
|
self.timeout = timeout
|
|
99
101
|
self._ws: Optional[ClientConnection] = None
|
|
100
102
|
self._pending: dict[str, asyncio.Future] = {}
|
|
@@ -107,6 +109,8 @@ class GatewayClient:
|
|
|
107
109
|
async def connect(self):
|
|
108
110
|
"""Connect and perform the challenge-response handshake."""
|
|
109
111
|
headers = {"Authorization": f"Bearer {self.token}"}
|
|
112
|
+
if self.origin:
|
|
113
|
+
headers["Origin"] = self.origin
|
|
110
114
|
self._ws = await websockets.connect(self.url, additional_headers=headers)
|
|
111
115
|
|
|
112
116
|
# 1. Receive challenge
|
|
@@ -398,7 +402,8 @@ class GatewayClient:
|
|
|
398
402
|
|
|
399
403
|
Yields ChatEvent objects as the agent responds.
|
|
400
404
|
"""
|
|
401
|
-
|
|
405
|
+
import uuid as _uuid
|
|
406
|
+
params: dict = {"message": message, "idempotencyKey": str(_uuid.uuid4())}
|
|
402
407
|
if session_key:
|
|
403
408
|
params["sessionKey"] = session_key
|
|
404
409
|
if agent_id:
|
|
@@ -261,7 +261,7 @@ class Jobs:
|
|
|
261
261
|
job_key = job.job_key
|
|
262
262
|
|
|
263
263
|
# Convert HTTP base to WebSocket base
|
|
264
|
-
ws_base = self._http.
|
|
264
|
+
ws_base = self._http.base_url.replace("https://", "wss://").replace("http://", "ws://")
|
|
265
265
|
# Strip /api suffix if present, shell endpoint is on /orchestra
|
|
266
266
|
ws_base = ws_base.removesuffix("/api")
|
|
267
267
|
url = f"{ws_base}/orchestra/ws/shell/{job_id}?token={job_key}&shell={shell}"
|
|
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
|
|
File without changes
|