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.
Files changed (29) hide show
  1. {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/PKG-INFO +1 -1
  2. {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/hypercli/gateway.py +10 -5
  3. {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/hypercli/jobs.py +1 -1
  4. {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/pyproject.toml +1 -1
  5. {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/.gitignore +0 -0
  6. {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/README.md +0 -0
  7. {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/hypercli/__init__.py +0 -0
  8. {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/hypercli/agents.py +0 -0
  9. {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/hypercli/billing.py +0 -0
  10. {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/hypercli/claw.py +0 -0
  11. {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/hypercli/client.py +0 -0
  12. {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/hypercli/config.py +0 -0
  13. {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/hypercli/files.py +0 -0
  14. {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/hypercli/http.py +0 -0
  15. {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/hypercli/instances.py +0 -0
  16. {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/hypercli/job/__init__.py +0 -0
  17. {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/hypercli/job/base.py +0 -0
  18. {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/hypercli/job/comfyui.py +0 -0
  19. {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/hypercli/job/gradio.py +0 -0
  20. {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/hypercli/keys.py +0 -0
  21. {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/hypercli/logs.py +0 -0
  22. {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/hypercli/renders.py +0 -0
  23. {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/hypercli/shell.py +0 -0
  24. {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/hypercli/user.py +0 -0
  25. {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/hypercli/x402.py +0 -0
  26. {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/tests/test_agents.py +0 -0
  27. {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/tests/test_apply_params.py +0 -0
  28. {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/tests/test_claw.py +0 -0
  29. {hypercli_sdk-1.0.1 → hypercli_sdk-1.0.3}/tests/test_graph_to_api.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hypercli-sdk
3
- Version: 1.0.1
3
+ Version: 1.0.3
4
4
  Summary: Python SDK for HyperCLI - GPU orchestration and LLM API
5
5
  Project-URL: Homepage, https://hypercli.com
6
6
  Project-URL: Documentation, https://docs.hypercli.com
@@ -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 = "gateway-client",
90
- client_mode: str = "backend",
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
- params: dict = {"message": message}
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._base_url.replace("https://", "wss://").replace("http://", "ws://")
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}"
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "hypercli-sdk"
7
- version = "1.0.1"
7
+ version = "1.0.3"
8
8
  description = "Python SDK for HyperCLI - GPU orchestration and LLM API"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
File without changes
File without changes