hypercli-sdk 0.10.7__tar.gz → 0.11.0__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 (77) hide show
  1. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/PKG-INFO +2 -2
  2. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/README.md +1 -1
  3. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/hypercli/__init__.py +1 -1
  4. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/hypercli/agents.py +24 -7
  5. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/hypercli/sessions.py +4 -0
  6. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/pyproject.toml +1 -1
  7. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/tests/test_coding_agents.py +12 -8
  8. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/tests/test_sessions.py +36 -0
  9. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/.gitignore +0 -0
  10. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/hypercli/acp.py +0 -0
  11. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/hypercli/agent.py +0 -0
  12. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/hypercli/billing.py +0 -0
  13. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/hypercli/chat_integrations.py +0 -0
  14. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/hypercli/client.py +0 -0
  15. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/hypercli/config.py +0 -0
  16. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/hypercli/files.py +0 -0
  17. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/hypercli/http.py +0 -0
  18. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/hypercli/instances.py +0 -0
  19. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/hypercli/job/__init__.py +0 -0
  20. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/hypercli/job/base.py +0 -0
  21. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/hypercli/job/comfyui.py +0 -0
  22. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/hypercli/job/gradio.py +0 -0
  23. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/hypercli/jobs.py +0 -0
  24. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/hypercli/keys.py +0 -0
  25. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/hypercli/logs.py +0 -0
  26. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/hypercli/mcp.py +0 -0
  27. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/hypercli/models.py +0 -0
  28. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/hypercli/renders.py +0 -0
  29. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/hypercli/routines.py +0 -0
  30. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/hypercli/runners.py +0 -0
  31. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/hypercli/shell.py +0 -0
  32. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/hypercli/user.py +0 -0
  33. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/hypercli/voice.py +0 -0
  34. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/hypercli/voice_stream.py +0 -0
  35. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/hypercli/voice_transcription.py +0 -0
  36. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/hypercli/workspaces.py +0 -0
  37. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/hypercli/x402.py +0 -0
  38. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/tests/integration/conftest.py +0 -0
  39. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/tests/integration/test_agents.py +0 -0
  40. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/tests/integration/test_auth.py +0 -0
  41. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/tests/integration/test_billing.py +0 -0
  42. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/tests/integration/test_instances.py +0 -0
  43. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/tests/integration/test_jobs_dryrun.py +0 -0
  44. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/tests/integration/test_keys.py +0 -0
  45. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/tests/integration/test_renders.py +0 -0
  46. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/tests/test_acp.py +0 -0
  47. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/tests/test_agent_files_source.py +0 -0
  48. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/tests/test_agent_lifecycle.py +0 -0
  49. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/tests/test_agents.py +0 -0
  50. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/tests/test_apply_params.py +0 -0
  51. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/tests/test_bootstrap_agents_e2e_user.py +0 -0
  52. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/tests/test_bootstrap_console_test_key.py +0 -0
  53. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/tests/test_bootstrap_dev_test_keys.py +0 -0
  54. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/tests/test_chat_integrations.py +0 -0
  55. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/tests/test_claw.py +0 -0
  56. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/tests/test_config.py +0 -0
  57. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/tests/test_exec_shell_dryrun.py +0 -0
  58. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/tests/test_file_transport.py +0 -0
  59. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/tests/test_graph_to_api.py +0 -0
  60. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/tests/test_http.py +0 -0
  61. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/tests/test_jobs.py +0 -0
  62. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/tests/test_keys.py +0 -0
  63. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/tests/test_models.py +0 -0
  64. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/tests/test_parity_audit.py +0 -0
  65. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/tests/test_public_surface.py +0 -0
  66. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/tests/test_render_catalog.py +0 -0
  67. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/tests/test_renders_subscription.py +0 -0
  68. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/tests/test_repository_integrity.py +0 -0
  69. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/tests/test_routines.py +0 -0
  70. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/tests/test_runner_control_url.py +0 -0
  71. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/tests/test_runner_placement.py +0 -0
  72. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/tests/test_runners.py +0 -0
  73. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/tests/test_status.py +0 -0
  74. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/tests/test_voice.py +0 -0
  75. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/tests/test_voice_stream.py +0 -0
  76. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/tests/test_voice_transcription.py +0 -0
  77. {hypercli_sdk-0.10.7 → hypercli_sdk-0.11.0}/tests/test_workspaces.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: hypercli-sdk
3
- Version: 0.10.7
3
+ Version: 0.11.0
4
4
  Summary: Python SDK for HyperCLI - GPU orchestration and HyperAgent API
5
5
  Project-URL: Homepage, https://hypercli.com
6
6
  Project-URL: Documentation, https://docs.hypercli.com
@@ -279,7 +279,7 @@ Native Buzz Agent, OpenCode, Codex, Claude Code, Goose, and Kimi Code use
279
279
  canonical managed-runtime images.
280
280
  They have no public runtime port: lifecycle, exec, shell, workspace sync, and
281
281
  authentication all use the existing authenticated deployment APIs. OpenCode
282
- and Goose default to HyperCLI's Anthropic-native `default-anthropic` route (currently `kimi-k3-anthropic`).
282
+ and Goose default to HyperCLI's Anthropic-native `default-anthropic` route.
283
283
  Kimi Code keeps Moonshot's upstream device login and service.
284
284
  Claude Code, Codex, and Kimi Code are native-login-first. For Buzz-managed
285
285
  launches, `HYPERCLI_RUNTIME_INFERENCE=hypercli` is an explicit compatibility
@@ -241,7 +241,7 @@ Native Buzz Agent, OpenCode, Codex, Claude Code, Goose, and Kimi Code use
241
241
  canonical managed-runtime images.
242
242
  They have no public runtime port: lifecycle, exec, shell, workspace sync, and
243
243
  authentication all use the existing authenticated deployment APIs. OpenCode
244
- and Goose default to HyperCLI's Anthropic-native `default-anthropic` route (currently `kimi-k3-anthropic`).
244
+ and Goose default to HyperCLI's Anthropic-native `default-anthropic` route.
245
245
  Kimi Code keeps Moonshot's upstream device login and service.
246
246
  Claude Code, Codex, and Kimi Code are native-login-first. For Buzz-managed
247
247
  launches, `HYPERCLI_RUNTIME_INFERENCE=hypercli` is an explicit compatibility
@@ -158,7 +158,7 @@ from .acp import (
158
158
  AmbiguousDeliveryError,
159
159
  RetryableACPError,
160
160
  )
161
- __version__ = "0.10.7"
161
+ __version__ = "0.11.0"
162
162
  __all__ = [
163
163
  "CHAT_INTEGRATIONS",
164
164
  "build_chat_integration_config",
@@ -99,11 +99,11 @@ OPENCLAW_TRUSTED_PROXIES_ENV = "OPENCLAW_TRUSTED_PROXIES"
99
99
  HERMES_CRON_ENV_DEFAULTS = {
100
100
  "HERMES_CRON_ENABLED": "1",
101
101
  }
102
- DEFAULT_OPENCLAW_MODEL_ENV = {
103
- "HYPER_MODELS": "default-anthropic",
104
- "HYPER_EMBEDDING_MODELS": "qwen3-embedding-4b",
105
- }
106
- DEFAULT_HERMES_MODEL_ENV = DEFAULT_OPENCLAW_MODEL_ENV
102
+ # Model env (HYPER_MODELS / HYPER_EMBEDDING_MODELS) defaults are image-owned:
103
+ # CI (AGENT_HYPER_MODELS / AGENT_HYPER_EMBEDDING_MODELS) and
104
+ # pulumi/pulumi-docker bake them as image ENV via Dockerfile build args. The
105
+ # SDK does not inject them at create time; caller env remains the only
106
+ # per-launch override.
107
107
  DEFAULT_OPENCLAW_SYNC_EXCLUDE = (
108
108
  "shared/**",
109
109
  ".openclaw/npm/**/node_modules/**",
@@ -2665,7 +2665,8 @@ class Deployments:
2665
2665
  **build_openclaw_workspaces_sync_env(knobs["workspaces_sync"]),
2666
2666
  **build_openclaw_cron_env(knobs["cron_enabled"]),
2667
2667
  **build_openclaw_memory_index_env(knobs["memory_index"]),
2668
- **DEFAULT_OPENCLAW_MODEL_ENV,
2668
+ # No model env defaults here: HYPER_MODELS / HYPER_EMBEDDING_MODELS
2669
+ # are image-owned; caller env is the only per-launch override.
2669
2670
  **dict(launch["env"] or {}),
2670
2671
  # OpenClaw treats this env as a full replace for
2671
2672
  # gateway.controlUi.allowedOrigins, and every HyperCLI surface
@@ -2689,7 +2690,8 @@ class Deployments:
2689
2690
  def _create_hermes_agent_deployment(self, runtime: str, *, launch: dict, **knobs: Any) -> Agent:
2690
2691
  launch["env"] = {
2691
2692
  **build_hermes_cron_env(knobs["cron_enabled"]),
2692
- **DEFAULT_HERMES_MODEL_ENV,
2693
+ # No model env defaults here: HYPER_MODELS / HYPER_EMBEDDING_MODELS
2694
+ # are image-owned; caller env is the only per-launch override.
2693
2695
  **dict(launch["env"] or {}),
2694
2696
  }
2695
2697
  launch["image"] = launch["image"] or DEFAULT_HERMES_AGENT_IMAGE
@@ -3696,6 +3698,21 @@ class Deployments:
3696
3698
  self._get(f"/sessions/{quote(platform_session_id, safe='')}")
3697
3699
  )
3698
3700
 
3701
+ def update_session(
3702
+ self, platform_session_id: str, *, title: str | None | object = _UNSET,
3703
+ mode: str | object = _UNSET, meta: dict[str, Any] | object = _UNSET,
3704
+ ) -> SessionRecord:
3705
+ """Update stored fields. Omission preserves; meta merges top-level keys.
3706
+
3707
+ Null meta values delete keys, nested values replace. Whole-meta null is
3708
+ rejected by the server; stored compact UTF-8 JSON is limited to 16 KiB.
3709
+ """
3710
+ body = {key: value for key, value in {"title": title, "mode": mode, "meta": meta}.items()
3711
+ if value is not _UNSET}
3712
+ return SessionRecord.from_dict(
3713
+ self._post(f"/sessions/{quote(platform_session_id, safe='')}", json=body)
3714
+ )
3715
+
3699
3716
  def list_sessions(
3700
3717
  self, *, agent_id: str | None = None, cursor: str | None = None, limit: int = 50,
3701
3718
  ) -> SessionPage:
@@ -55,12 +55,16 @@ class SessionRecord:
55
55
  receipts: list[dict[str, Any]] = field(default_factory=list)
56
56
  agent_state: str | None = None # computed per request ("live"|"archived"|"deleted"); None on old servers
57
57
  external_url: str | None = None # opaque external reference, independent of source
58
+ meta: dict[str, Any] = field(default_factory=dict)
59
+ mode: str | None = None
58
60
 
59
61
  @classmethod
60
62
  def from_dict(cls, data: dict[str, Any]) -> "SessionRecord":
61
63
  agent_state = data.get("agentState", data.get("agent_state"))
62
64
  return cls(
63
65
  id=str(data["id"]),
66
+ meta=deepcopy(data.get("meta", {})),
67
+ mode=data.get("mode"),
64
68
  source=data.get("source") if isinstance(data.get("source"), str) else None,
65
69
  external_url=data.get("external_url"),
66
70
  summary_text=data.get("summary_text"),
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "hypercli-sdk"
7
- version = "0.10.7"
7
+ version = "0.11.0"
8
8
  description = "Python SDK for HyperCLI - GPU orchestration and HyperAgent API"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -604,8 +604,10 @@ class TestCreateAgentOpenClawRuntimes:
604
604
  env = body["env"]
605
605
  assert env["HYPER_WORKSPACES_BOOT_SYNC"] == "1"
606
606
  assert env["OPENCLAW_CRON_ENABLED"] == "1"
607
- assert env["HYPER_MODELS"] == "default-anthropic"
608
- assert env["HYPER_EMBEDDING_MODELS"] == "qwen3-embedding-4b"
607
+ # Model env defaults are image-owned; the SDK never injects
608
+ # HYPER_MODELS / HYPER_EMBEDDING_MODELS at create time.
609
+ assert "HYPER_MODELS" not in env
610
+ assert "HYPER_EMBEDDING_MODELS" not in env
609
611
  assert env["OPENCLAW_CONTROL_UI_ALLOWED_ORIGIN"] == "*"
610
612
  assert "HYPER_DESKTOP_ENABLED" not in env
611
613
  assert "HYPER_ACP_PERMISSIONS" not in env
@@ -663,15 +665,15 @@ class TestCreateAgentOpenClawRuntimes:
663
665
  ".openclaw/browser/**/optimization_guide_model_store/**",
664
666
  )
665
667
 
666
- def test_caller_env_overrides_model_env_defaults(self, monkeypatch):
668
+ def test_caller_model_env_passes_through_without_injection(self, monkeypatch):
667
669
  deployments, posts = _capture_create(monkeypatch, "openclaw_acp")
668
670
 
669
671
  deployments.create_agent("openclaw_acp", env={"HYPER_MODELS": "custom-model", "X": "1"})
670
672
 
671
673
  env = posts[0][1]["env"]
672
674
  assert env["HYPER_MODELS"] == "custom-model"
673
- assert env["HYPER_EMBEDDING_MODELS"] == "qwen3-embedding-4b"
674
675
  assert env["X"] == "1"
676
+ assert "HYPER_EMBEDDING_MODELS" not in env
675
677
 
676
678
  def test_control_ui_allowed_origin_wildcard_is_unconditional(self, monkeypatch):
677
679
  deployments, posts = _capture_create(monkeypatch, "openclaw_acp")
@@ -723,17 +725,19 @@ class TestCreateAgentHermesRuntimes:
723
725
  assert body["runtime_scopes"] == list(DEFAULT_AGENT_RUNTIME_SCOPES)
724
726
  env = body["env"]
725
727
  assert env["HERMES_CRON_ENABLED"] == "1"
726
- assert env["HYPER_MODELS"] == "default-anthropic"
727
- assert env["HYPER_EMBEDDING_MODELS"] == "qwen3-embedding-4b"
728
+ # Model env defaults are image-owned; the SDK never injects
729
+ # HYPER_MODELS / HYPER_EMBEDDING_MODELS at create time.
730
+ assert "HYPER_MODELS" not in env
731
+ assert "HYPER_EMBEDDING_MODELS" not in env
728
732
 
729
- def test_caller_env_overrides_model_env_defaults(self, monkeypatch):
733
+ def test_caller_model_env_passes_through_without_injection(self, monkeypatch):
730
734
  deployments, posts = _capture_create(monkeypatch, "hermes_acp")
731
735
 
732
736
  deployments.create_agent("hermes_acp", env={"HYPER_MODELS": "custom-model"})
733
737
 
734
738
  env = posts[0][1]["env"]
735
739
  assert env["HYPER_MODELS"] == "custom-model"
736
- assert env["HYPER_EMBEDDING_MODELS"] == "qwen3-embedding-4b"
740
+ assert "HYPER_EMBEDDING_MODELS" not in env
737
741
 
738
742
  def test_explicit_cors_passes_through(self, monkeypatch):
739
743
  deployments, posts = _capture_create(monkeypatch, "hermes_acp")
@@ -1,4 +1,5 @@
1
1
  from unittest.mock import MagicMock
2
+ import json
2
3
 
3
4
  import httpx
4
5
  import pytest
@@ -27,6 +28,41 @@ def test_catalog_decodes_source_and_keeps_pagination(source):
27
28
 
28
29
  def test_old_server_missing_source_is_null():
29
30
  assert SessionRecord.from_dict({"id": "old-session"}).source is None
31
+ assert SessionRecord.from_dict({"id": "old-session"}).meta == {}
32
+
33
+
34
+ @pytest.mark.parametrize("patch", [{}, {"meta": {}}, {"meta": {"resolved": ["a"], "remove": None}},
35
+ {"title": None, "mode": "auto", "meta": {"nested": {"x": None}}},
36
+ {"meta": None}])
37
+ def test_session_update_wire_and_read_meta(monkeypatch, patch):
38
+ requests = []
39
+ row = {"id": "s/id", "meta": {"resolved": ["a"], "nested": {"x": None}}, "mode": "auto"}
40
+
41
+ def send(self, request, **kwargs):
42
+ requests.append(request)
43
+ payload = {"items": [row]} if request.url.path == "/agents/sessions" else row
44
+ return httpx.Response(200, json=payload, request=request)
45
+
46
+ monkeypatch.setattr(httpx.Client, "send", send)
47
+ api = HyperCLI(api_key="caller-key", api_url="https://example.com").deployments
48
+ updated = api.update_session("s/id", **patch)
49
+ assert requests[0].method == "POST"
50
+ assert str(requests[0].url) == "https://example.com/agents/sessions/s%2Fid"
51
+ assert requests[0].headers["Authorization"] == "Bearer caller-key"
52
+ assert json.loads(requests[0].content) == patch
53
+ assert updated.meta == row["meta"] and updated.mode == "auto"
54
+ assert api.get_session("s/id").meta == updated.meta
55
+ assert api.list_sessions().items[0].meta == updated.meta
56
+
57
+
58
+ def test_session_update_propagates_rejection(monkeypatch):
59
+ def send(self, request, **kwargs):
60
+ return httpx.Response(422, json={"detail": "meta must be an object"}, request=request)
61
+ monkeypatch.setattr(httpx.Client, "send", send)
62
+ api = HyperCLI(api_key="caller-key", api_url="https://example.com").deployments
63
+ with pytest.raises(APIError) as exc:
64
+ api.update_session("s", meta=None)
65
+ assert exc.value.status_code == 422
30
66
 
31
67
 
32
68
  def test_setup_type_distinguishes_unknown_and_copies_nested_setup():
File without changes