dominus-sdk-python 4.0.1__tar.gz → 4.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 (58) hide show
  1. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/PKG-INFO +11 -3
  2. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/README.md +10 -2
  3. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/dominus/namespaces/logs.py +33 -0
  4. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/dominus/start.py +11 -3
  5. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/dominus_sdk_python.egg-info/PKG-INFO +11 -3
  6. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/pyproject.toml +1 -1
  7. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/tests/test_logs.py +19 -1
  8. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/tests/test_transport_compat.py +42 -0
  9. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/dominus/__init__.py +0 -0
  10. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/dominus/config/__init__.py +0 -0
  11. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/dominus/config/endpoints.py +0 -0
  12. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/dominus/errors.py +0 -0
  13. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/dominus/helpers/__init__.py +0 -0
  14. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/dominus/helpers/auth.py +0 -0
  15. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/dominus/helpers/cache.py +0 -0
  16. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/dominus/helpers/console_capture.py +0 -0
  17. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/dominus/helpers/core.py +0 -0
  18. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/dominus/helpers/crypto.py +0 -0
  19. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/dominus/helpers/sse.py +0 -0
  20. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/dominus/helpers/trace.py +0 -0
  21. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/dominus/namespaces/__init__.py +0 -0
  22. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/dominus/namespaces/admin.py +0 -0
  23. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/dominus/namespaces/ai.py +0 -0
  24. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/dominus/namespaces/artifacts.py +0 -0
  25. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/dominus/namespaces/auth.py +0 -0
  26. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/dominus/namespaces/authority.py +0 -0
  27. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/dominus/namespaces/courier.py +0 -0
  28. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/dominus/namespaces/db.py +0 -0
  29. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/dominus/namespaces/ddl.py +0 -0
  30. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/dominus/namespaces/deployer.py +0 -0
  31. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/dominus/namespaces/fastapi.py +0 -0
  32. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/dominus/namespaces/files.py +0 -0
  33. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/dominus/namespaces/health.py +0 -0
  34. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/dominus/namespaces/jobs.py +0 -0
  35. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/dominus/namespaces/portal.py +0 -0
  36. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/dominus/namespaces/processor.py +0 -0
  37. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/dominus/namespaces/redis.py +0 -0
  38. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/dominus/namespaces/secrets.py +0 -0
  39. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/dominus/namespaces/secure.py +0 -0
  40. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/dominus/namespaces/sync.py +0 -0
  41. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/dominus/namespaces/warden.py +0 -0
  42. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/dominus/namespaces/workflow.py +0 -0
  43. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/dominus/services/__init__.py +0 -0
  44. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/dominus_sdk_python.egg-info/SOURCES.txt +0 -0
  45. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/dominus_sdk_python.egg-info/dependency_links.txt +0 -0
  46. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/dominus_sdk_python.egg-info/requires.txt +0 -0
  47. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/dominus_sdk_python.egg-info/top_level.txt +0 -0
  48. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/setup.cfg +0 -0
  49. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/tests/test_auth.py +0 -0
  50. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/tests/test_authority_public_vocabulary.py +0 -0
  51. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/tests/test_control_plane_namespaces.py +0 -0
  52. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/tests/test_errors.py +0 -0
  53. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/tests/test_flat_commands.py +0 -0
  54. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/tests/test_health.py +0 -0
  55. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/tests/test_provisioning_parity.py +0 -0
  56. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/tests/test_public_exports.py +0 -0
  57. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/tests/test_workflow_lifecycle.py +0 -0
  58. {dominus_sdk_python-4.0.1 → dominus_sdk_python-4.0.3}/tests/test_workflow_refs.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dominus-sdk-python
3
- Version: 4.0.1
3
+ Version: 4.0.3
4
4
  Summary: Python SDK for the Dominus gateway-first platform
5
5
  Author-email: CareBridge Systems <dev@carebridge.io>
6
6
  License: Proprietary
@@ -40,8 +40,9 @@ Async Python SDK for the Dominus gateway-first service plane.
40
40
  - Python 3.9+ asyncio client for Dominus services
41
41
  - Namespace-first API with a small root shortcut surface
42
42
  - Gateway-scoped client mode for MCP and other user-JWT sessions
43
+ - Transport compatibility for wrapped `{success,data}` responses and unwrapped Warden/control-plane success objects
43
44
  - Local helpers for JWT verification, trace propagation, retries, and console capture
44
- - Current package version: `4.0.1`
45
+ - Current package version: `4.0.3`
45
46
 
46
47
  ## Install
47
48
 
@@ -79,7 +80,11 @@ timeline_archive = await dominus.authority.get_timeline_archive_status(
79
80
  app_slug="carebridge-summit",
80
81
  env="production",
81
82
  )
82
- logs_archive = await dominus.logs.get_archive_status(all_scopes=True, limit=5)
83
+ logs_archive = await dominus.logs.get_archive_status(
84
+ all_scopes=True,
85
+ include_buffer=True,
86
+ limit=5,
87
+ )
83
88
 
84
89
  # Archive maintenance is explicit and dry-run first.
85
90
  verify = await dominus.authority.verify_timeline_archive_manifests(
@@ -90,6 +95,9 @@ prune = await dominus.logs.prune_archive_retention(
90
95
  retention_days=90,
91
96
  dry_run=True,
92
97
  )
98
+ buffer_proof = await dominus.logs.dry_run_archive_buffer_maintenance(
99
+ sample_limit=100,
100
+ )
93
101
  ```
94
102
 
95
103
  ## Session-Scoped Clients
@@ -7,8 +7,9 @@ Async Python SDK for the Dominus gateway-first service plane.
7
7
  - Python 3.9+ asyncio client for Dominus services
8
8
  - Namespace-first API with a small root shortcut surface
9
9
  - Gateway-scoped client mode for MCP and other user-JWT sessions
10
+ - Transport compatibility for wrapped `{success,data}` responses and unwrapped Warden/control-plane success objects
10
11
  - Local helpers for JWT verification, trace propagation, retries, and console capture
11
- - Current package version: `4.0.1`
12
+ - Current package version: `4.0.3`
12
13
 
13
14
  ## Install
14
15
 
@@ -46,7 +47,11 @@ timeline_archive = await dominus.authority.get_timeline_archive_status(
46
47
  app_slug="carebridge-summit",
47
48
  env="production",
48
49
  )
49
- logs_archive = await dominus.logs.get_archive_status(all_scopes=True, limit=5)
50
+ logs_archive = await dominus.logs.get_archive_status(
51
+ all_scopes=True,
52
+ include_buffer=True,
53
+ limit=5,
54
+ )
50
55
 
51
56
  # Archive maintenance is explicit and dry-run first.
52
57
  verify = await dominus.authority.verify_timeline_archive_manifests(
@@ -57,6 +62,9 @@ prune = await dominus.logs.prune_archive_retention(
57
62
  retention_days=90,
58
63
  dry_run=True,
59
64
  )
65
+ buffer_proof = await dominus.logs.dry_run_archive_buffer_maintenance(
66
+ sample_limit=100,
67
+ )
60
68
  ```
61
69
 
62
70
  ## Session-Scoped Clients
@@ -407,6 +407,7 @@ class LogsNamespace:
407
407
  target_org_id: Optional[str] = None,
408
408
  target_env: Optional[str] = None,
409
409
  use_shared: Optional[bool] = None,
410
+ include_buffer: Optional[bool] = None,
410
411
  limit: Optional[int] = None,
411
412
  ) -> Dict[str, Any]:
412
413
  """Get Logs Worker archive backlog state. ``GET /api/logs/archive-status``."""
@@ -419,6 +420,8 @@ class LogsNamespace:
419
420
  params["target_env"] = target_env
420
421
  if use_shared is True:
421
422
  params["use_shared"] = "true"
423
+ if include_buffer is not None:
424
+ params["include_buffer"] = "true" if include_buffer else "false"
422
425
  if limit is not None:
423
426
  params["limit"] = limit
424
427
  qs = urlencode(params)
@@ -510,6 +513,36 @@ class LogsNamespace:
510
513
  use_gateway=True,
511
514
  )
512
515
 
516
+ async def dry_run_archive_buffer_maintenance(
517
+ self,
518
+ *,
519
+ sample_limit: Optional[int] = None,
520
+ max_archive_buckets: Optional[int] = None,
521
+ target_org_id: Optional[str] = None,
522
+ target_env: Optional[str] = None,
523
+ use_shared: Optional[bool] = None,
524
+ ) -> Dict[str, Any]:
525
+ """Dry-run Redis archive buffer/payload residue cleanup proof. ``POST /api/logs/archive-buffer-maintenance``.
526
+
527
+ This is intentionally read-only. The Logs Worker rejects destructive
528
+ cleanup attempts on this route.
529
+ """
530
+ body = {
531
+ "dry_run": True,
532
+ "sample_limit": sample_limit,
533
+ "max_archive_buckets": max_archive_buckets,
534
+ "target_org_id": target_org_id,
535
+ "target_env": target_env,
536
+ }
537
+ if use_shared is not None:
538
+ body["use_shared"] = use_shared
539
+ return await self._client._request(
540
+ endpoint="/api/logs/archive-buffer-maintenance",
541
+ method="POST",
542
+ body={k: v for k, v in body.items() if v is not None and v != ""},
543
+ use_gateway=True,
544
+ )
545
+
513
546
  async def query(
514
547
  self,
515
548
  minutes: int = 10,
@@ -468,8 +468,12 @@ class Dominus:
468
468
 
469
469
  result = _decode_json_or_b64_json(response.text)
470
470
 
471
- # Check for success
472
- if not result.get("success"):
471
+ if not isinstance(result, dict):
472
+ return {"result": result}
473
+
474
+ # Kernel routes historically returned {success,data}; some modern
475
+ # Warden control-plane routes return a decoded domain object directly.
476
+ if result.get("success") is False:
473
477
  error_msg = result.get("error") or result.get("message") or "Unknown error"
474
478
  error_details = result.get("details")
475
479
  if not isinstance(error_details, dict):
@@ -479,7 +483,11 @@ class Dominus:
479
483
  error_details[key] = result[key]
480
484
  raise DominusError(str(error_msg), details=error_details, endpoint=endpoint)
481
485
 
482
- return result.get("data", {})
486
+ if result.get("success") is True:
487
+ return result.get("data", {})
488
+ if "data" in result and len(result) <= 3:
489
+ return result.get("data", {})
490
+ return result
483
491
 
484
492
  async def gateway_fetch(
485
493
  self,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dominus-sdk-python
3
- Version: 4.0.1
3
+ Version: 4.0.3
4
4
  Summary: Python SDK for the Dominus gateway-first platform
5
5
  Author-email: CareBridge Systems <dev@carebridge.io>
6
6
  License: Proprietary
@@ -40,8 +40,9 @@ Async Python SDK for the Dominus gateway-first service plane.
40
40
  - Python 3.9+ asyncio client for Dominus services
41
41
  - Namespace-first API with a small root shortcut surface
42
42
  - Gateway-scoped client mode for MCP and other user-JWT sessions
43
+ - Transport compatibility for wrapped `{success,data}` responses and unwrapped Warden/control-plane success objects
43
44
  - Local helpers for JWT verification, trace propagation, retries, and console capture
44
- - Current package version: `4.0.1`
45
+ - Current package version: `4.0.3`
45
46
 
46
47
  ## Install
47
48
 
@@ -79,7 +80,11 @@ timeline_archive = await dominus.authority.get_timeline_archive_status(
79
80
  app_slug="carebridge-summit",
80
81
  env="production",
81
82
  )
82
- logs_archive = await dominus.logs.get_archive_status(all_scopes=True, limit=5)
83
+ logs_archive = await dominus.logs.get_archive_status(
84
+ all_scopes=True,
85
+ include_buffer=True,
86
+ limit=5,
87
+ )
83
88
 
84
89
  # Archive maintenance is explicit and dry-run first.
85
90
  verify = await dominus.authority.verify_timeline_archive_manifests(
@@ -90,6 +95,9 @@ prune = await dominus.logs.prune_archive_retention(
90
95
  retention_days=90,
91
96
  dry_run=True,
92
97
  )
98
+ buffer_proof = await dominus.logs.dry_run_archive_buffer_maintenance(
99
+ sample_limit=100,
100
+ )
93
101
  ```
94
102
 
95
103
  ## Session-Scoped Clients
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "dominus-sdk-python"
7
- version = "4.0.1"
7
+ version = "4.0.3"
8
8
  description = "Python SDK for the Dominus gateway-first platform"
9
9
  readme = "README.md"
10
10
  license = {text = "Proprietary"}
@@ -81,13 +81,14 @@ async def test_logs_get_archive_status_forwards_filters():
81
81
  target_org_id="org-123",
82
82
  target_env="production",
83
83
  use_shared=True,
84
+ include_buffer=True,
84
85
  limit=5,
85
86
  )
86
87
 
87
88
  assert payload["events"][0]["event_id"] == "log-1"
88
89
  assert client.calls[0]["endpoint"] == (
89
90
  "/api/logs/archive-status?"
90
- "all_scopes=true&target_org_id=org-123&target_env=production&use_shared=true&limit=5"
91
+ "all_scopes=true&target_org_id=org-123&target_env=production&use_shared=true&include_buffer=true&limit=5"
91
92
  )
92
93
  assert client.calls[0]["method"] == "GET"
93
94
  assert client.calls[0]["use_gateway"] is True
@@ -122,6 +123,13 @@ async def test_logs_archive_maintenance_helpers_forward_canonical_body():
122
123
  target_env="production",
123
124
  use_shared=True,
124
125
  )
126
+ await namespace.dry_run_archive_buffer_maintenance(
127
+ sample_limit=25,
128
+ max_archive_buckets=3,
129
+ target_org_id="org-123",
130
+ target_env="production",
131
+ use_shared=True,
132
+ )
125
133
 
126
134
  assert client.calls[0]["endpoint"] == "/api/logs/archive-repair"
127
135
  assert client.calls[0]["method"] == "POST"
@@ -146,3 +154,13 @@ async def test_logs_archive_maintenance_helpers_forward_canonical_body():
146
154
  "target_env": "production",
147
155
  "use_shared": True,
148
156
  }
157
+ assert client.calls[3]["endpoint"] == "/api/logs/archive-buffer-maintenance"
158
+ assert client.calls[3]["method"] == "POST"
159
+ assert client.calls[3]["body"] == {
160
+ "dry_run": True,
161
+ "sample_limit": 25,
162
+ "max_archive_buckets": 3,
163
+ "target_org_id": "org-123",
164
+ "target_env": "production",
165
+ "use_shared": True,
166
+ }
@@ -55,6 +55,32 @@ class RequestClient:
55
55
  return FakeResponse(json.dumps({"success": True, "data": {"ok": True}}))
56
56
 
57
57
 
58
+ class UnwrappedRequestClient:
59
+ calls = []
60
+
61
+ def __init__(self, *, base_url, headers, timeout):
62
+ self.base_url = base_url
63
+ self.headers = headers
64
+ self.timeout = timeout
65
+
66
+ async def __aenter__(self):
67
+ return self
68
+
69
+ async def __aexit__(self, exc_type, exc, tb):
70
+ return False
71
+
72
+ async def get(self, endpoint):
73
+ self.calls.append(
74
+ {
75
+ "endpoint": endpoint,
76
+ "base_url": self.base_url,
77
+ "headers": self.headers,
78
+ "timeout": self.timeout,
79
+ }
80
+ )
81
+ return FakeResponse(json.dumps({"secret": {"key": "PROVISION_REDIS_URL_REST", "value": "redis-url"}}))
82
+
83
+
58
84
  class ServiceJwtClient:
59
85
  def __init__(self, *, base_url, headers, timeout, proxy):
60
86
  self.base_url = base_url
@@ -132,6 +158,22 @@ async def test_request_accepts_raw_json_success_envelope(monkeypatch, sdk):
132
158
  assert RequestClient.calls[0]["endpoint"] == "/svc/health"
133
159
 
134
160
 
161
+ @pytest.mark.asyncio
162
+ async def test_request_accepts_unwrapped_control_plane_success(monkeypatch, sdk):
163
+ UnwrappedRequestClient.calls = []
164
+
165
+ async def fake_ensure_valid_jwt(psk_token, base_url):
166
+ return "jwt-abc"
167
+
168
+ monkeypatch.setattr(core_module, "_ensure_valid_jwt", fake_ensure_valid_jwt)
169
+ monkeypatch.setattr(start_module.httpx, "AsyncClient", UnwrappedRequestClient)
170
+
171
+ result = await sdk._request("/api/warden/secrets/PROVISION_REDIS_URL_REST", method="GET", use_gateway=True)
172
+
173
+ assert result == {"secret": {"key": "PROVISION_REDIS_URL_REST", "value": "redis-url"}}
174
+ assert UnwrappedRequestClient.calls[0]["endpoint"] == "/svc/warden/secrets/PROVISION_REDIS_URL_REST"
175
+
176
+
135
177
  def test_dominus_constructor_accepts_gateway_context_keywords():
136
178
  sdk = start_module.Dominus(
137
179
  gateway_user_token="user-jwt",