dominus-sdk-python 6.1.2__py3-none-any.whl → 6.2.0__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.
dominus/__init__.py CHANGED
@@ -165,7 +165,7 @@ from .errors import (
165
165
  TimeoutError as DominusTimeoutError,
166
166
  )
167
167
 
168
- __version__ = "6.1.2"
168
+ __version__ = "6.2.0"
169
169
  __all__ = [
170
170
  # Main SDK instance
171
171
  "dominus",
@@ -1155,6 +1155,7 @@ class AuthorityNamespace:
1155
1155
  until: Optional[str] = None,
1156
1156
  window_hours: Optional[int] = None,
1157
1157
  limit: Optional[int] = None,
1158
+ full: bool = False,
1158
1159
  timeout: Optional[float] = None,
1159
1160
  ) -> Dict[str, Any]:
1160
1161
  """
@@ -1172,6 +1173,7 @@ class AuthorityNamespace:
1172
1173
  "until": until,
1173
1174
  "window_hours": window_hours,
1174
1175
  "limit": limit,
1176
+ "full": 1 if full else None,
1175
1177
  })
1176
1178
  return await self._get(
1177
1179
  f"/api/authority/dossiers/deploy/{quote(deploy_id, safe='')}{qs}",
@@ -117,6 +117,7 @@ class CoderNamespace:
117
117
  branch: Optional[str] = None,
118
118
  base_branch: Optional[str] = None,
119
119
  working_branch: Optional[str] = None,
120
+ executor: Optional[str] = None,
120
121
  title: Optional[str] = None,
121
122
  instructions: Optional[str] = None,
122
123
  inputs: Optional[Dict[str, Any]] = None,
@@ -140,6 +141,7 @@ class CoderNamespace:
140
141
  "branch": branch,
141
142
  "base_branch": base_branch,
142
143
  "working_branch": working_branch,
144
+ "executor": executor,
143
145
  "title": title,
144
146
  "instructions": instructions,
145
147
  "inputs": inputs,
@@ -12,16 +12,76 @@ Refs follow ``recipe://{type}/{name}[@v{N}][?tier={tier}]``.
12
12
  """
13
13
  from __future__ import annotations
14
14
 
15
+ import json
15
16
  from typing import Any, Dict, List, Optional, TYPE_CHECKING
16
17
 
17
18
  if TYPE_CHECKING:
18
19
  from ..start import Dominus
19
20
 
20
21
 
22
+ STASH_BACKED_RECIPE_TYPES = frozenset({
23
+ "envoy-bootstrap-v1",
24
+ "envoy-release-publish-v1",
25
+ "envoy-policy-v1",
26
+ "pacs-extraction-recipe-v1",
27
+ "pacs-vendor-probe-v1",
28
+ "browser-recipe",
29
+ })
30
+
31
+
21
32
  def _compact(payload: Dict[str, Any]) -> Dict[str, Any]:
22
33
  return {k: v for k, v in payload.items() if v is not None and v != ""}
23
34
 
24
35
 
36
+ def _recipe_tier_to_stash_scope(tier: Optional[str]) -> str:
37
+ if tier == "platform":
38
+ return "platform"
39
+ if tier == "group":
40
+ return "group"
41
+ return "self"
42
+
43
+
44
+ def _resolve_recipe_stash_env(client: "Dominus", env: Optional[str]) -> str:
45
+ return env or getattr(client, "_gateway_env", None) or "production"
46
+
47
+
48
+ def _recipe_body_to_text(value: Any) -> str:
49
+ if isinstance(value, str):
50
+ return value
51
+ if value is None:
52
+ raise ValueError("body is required")
53
+ return json.dumps(value, separators=(",", ":"))
54
+
55
+
56
+ def _build_recipe_payload_from_stash(
57
+ *,
58
+ type: str,
59
+ name: str,
60
+ tier: Optional[str],
61
+ data: Dict[str, Any],
62
+ ) -> Dict[str, Any]:
63
+ version = data.get("version")
64
+ try:
65
+ version_int = int(version) if version is not None else None
66
+ except (TypeError, ValueError):
67
+ version_int = None
68
+ return {
69
+ "recipe": {
70
+ "metadata": {
71
+ "type": type,
72
+ "name": name,
73
+ "tier": data.get("resolved_tier") or tier,
74
+ "version": version_int,
75
+ "schema_version": 1,
76
+ "sha256": data.get("value_hash"),
77
+ "head_ref": data.get("head_ref"),
78
+ "snapshot_ref": data.get("snapshot_ref"),
79
+ },
80
+ "body": data.get("value"),
81
+ },
82
+ }
83
+
84
+
25
85
  class RecipesNamespace:
26
86
  """
27
87
  Recipe worker namespace.
@@ -86,16 +146,41 @@ class RecipesNamespace:
86
146
  body: str,
87
147
  description: Optional[str] = None,
88
148
  actor_context: Optional[Dict[str, str]] = None,
149
+ env: Optional[str] = None,
89
150
  timeout: float = 30.0,
90
151
  ) -> Dict[str, Any]:
91
- """Publish a recipe. ``POST /api/recipe/recipes/publish``."""
152
+ """Publish a recipe. Stash-backed recipe types accept optional ``env``."""
153
+ body_text = _recipe_body_to_text(body)
154
+ if type in STASH_BACKED_RECIPE_TYPES:
155
+ result = await self._client._request(
156
+ endpoint="/svc/stash/put",
157
+ method="POST",
158
+ body={
159
+ "env": _resolve_recipe_stash_env(self._client, env),
160
+ "kind": type,
161
+ "scope": _recipe_tier_to_stash_scope(tier),
162
+ "key": name,
163
+ "value": body_text,
164
+ "versioned": True,
165
+ "purpose": description or "sdk-recipe-publish",
166
+ },
167
+ use_gateway=True,
168
+ actor=actor_context,
169
+ timeout=timeout,
170
+ )
171
+ return _build_recipe_payload_from_stash(
172
+ type=type,
173
+ name=name,
174
+ tier=tier,
175
+ data=result,
176
+ )
92
177
  return await self._post(
93
178
  "/api/recipe/recipes/publish",
94
179
  _compact({
95
180
  "type": type,
96
181
  "tier": tier,
97
182
  "name": name,
98
- "body": body,
183
+ "body": body_text,
99
184
  "description": description,
100
185
  }),
101
186
  actor_context=actor_context,
@@ -167,9 +252,30 @@ class RecipesNamespace:
167
252
  name: str,
168
253
  version: Optional[int] = None,
169
254
  tier: Optional[str] = None,
255
+ env: Optional[str] = None,
170
256
  timeout: float = 15.0,
171
257
  ) -> Dict[str, Any]:
172
- """Resolve a recipe through the three-tier chain. ``GET /api/recipe/recipes/{type}/{name}[@v{N}]``."""
258
+ """Resolve a recipe. Stash-backed recipe types accept optional ``env``."""
259
+ if type in STASH_BACKED_RECIPE_TYPES:
260
+ result = await self._client._request(
261
+ endpoint="/svc/stash/get",
262
+ method="POST",
263
+ body={
264
+ "env": _resolve_recipe_stash_env(self._client, env),
265
+ "kind": type,
266
+ "scope": _recipe_tier_to_stash_scope(tier),
267
+ "key": name,
268
+ "version": version if version is not None else "head",
269
+ },
270
+ use_gateway=True,
271
+ timeout=timeout,
272
+ )
273
+ return _build_recipe_payload_from_stash(
274
+ type=type,
275
+ name=name,
276
+ tier=tier,
277
+ data=result,
278
+ )
173
279
  path = f"/api/recipe/recipes/{type}/{name}"
174
280
  if version is not None:
175
281
  path += f"@v{version}"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dominus-sdk-python
3
- Version: 6.1.2
3
+ Version: 6.2.0
4
4
  Summary: Python SDK for the Dominus gateway-first platform
5
5
  Author-email: CareBridge Systems <dev@carebridge.io>
6
6
  License-Expression: LicenseRef-Proprietary
@@ -105,6 +105,7 @@ coder_run = await dominus.coder.ensure_run(
105
105
  policy_decision_id=policy["data"]["policy_decision"]["decision_id"],
106
106
  workflow_recipe_ref="recipe://workflow-recipe-v1/coder-feature@head",
107
107
  repository="carebridgesystems/dominus-platform-worker",
108
+ executor="managed_anthropic",
108
109
  instructions="Fix failing tests",
109
110
  actor_context={"type": "user", "id": "operator-1"},
110
111
  )
@@ -1,4 +1,4 @@
1
- dominus/__init__.py,sha256=SvQkS7jWs0hJZQR1j9SaR_7ucvrLX6ZV0wBxfyZTPl4,7116
1
+ dominus/__init__.py,sha256=YN_EQvrVr1Sl96vmxGQAJhmglFG1A-nUZp6zEjj6X8A,7116
2
2
  dominus/errors.py,sha256=NthcR-o1Q1nQsE3ZSHStcW_RdZ8LQ06mPDSenY1txgM,8547
3
3
  dominus/start.py,sha256=ofvuNx6aNRijs3qRBI9r2UOzw2LV59ncZP8BoIOj2UU,50385
4
4
  dominus/config/__init__.py,sha256=nvLLNh4dM_MCqcfF3XFS2NnVn44q0RYHEfAPP-2G5To,434
@@ -16,9 +16,9 @@ dominus/namespaces/admin.py,sha256=qkGoteAJ6cqdNub4zL1mtyxAQtsM3-nUplRSgw2fMZY,1
16
16
  dominus/namespaces/ai.py,sha256=Kr_eY-SkEfC-b1fhVVv40pXn_GHkxRzMGD47WoTgu9M,48555
17
17
  dominus/namespaces/artifacts.py,sha256=Kt1-YBnGAGZmzxG12KOvwENKZ-fGM0SPb_gFknGDZW8,21752
18
18
  dominus/namespaces/auth.py,sha256=YA61WjeRewatrz6BTPhRC95jDgYk3b2QDlH0xdGUceg,67795
19
- dominus/namespaces/authority.py,sha256=8h_n64dweaju2yvrOYda5DYwlAsIW9ZTBe6c34LnL_I,78571
19
+ dominus/namespaces/authority.py,sha256=eIki7V-vC6W_4WHCOaoGAh5GBxubaO1sLSKyD2FaJBQ,78640
20
20
  dominus/namespaces/browser.py,sha256=mFxQCvwFy5XmSVIXwwOP2B5WpDnm62U-n-nDlCVn_e8,9042
21
- dominus/namespaces/coder.py,sha256=TX1fM0Sbd5OW5Tkbz28A0DGFq5wRkXAKCnWmwFz__qo,8722
21
+ dominus/namespaces/coder.py,sha256=1INudnMNXp972BVds6zecZoPJ3O83hGELFacgzUKeik,8800
22
22
  dominus/namespaces/courier.py,sha256=7ZuwTWzVGBPTnqPV1VqPdme6PkPyhQOddwaI1wxrlE8,8324
23
23
  dominus/namespaces/db.py,sha256=dv4IZACziub7OE8i_4q_Z31uVYJglE12TFkFIbFnYjw,15157
24
24
  dominus/namespaces/ddl.py,sha256=NTpd3V3595qcBheUZfFq4tQiAZsyYH9O8GR9OZ_czK8,25844
@@ -32,7 +32,7 @@ dominus/namespaces/platform.py,sha256=x70gANgTyAsSbqPyYix5tlgFCrbo2xa3bEJrUi8cKp
32
32
  dominus/namespaces/portal.py,sha256=vf0Vu_12yS4_fto7sVCau5vQtghml7Wh7J2-XJnO2zA,15595
33
33
  dominus/namespaces/processor.py,sha256=gk-vvWfBTU9LkV34OaB4VdftArhTE67tfhlUtY0YglI,2678
34
34
  dominus/namespaces/publisher.py,sha256=god3_U02HD4QxtjnpyNTargejwpbMgpXcGHIKaOXs-M,9296
35
- dominus/namespaces/recipes.py,sha256=yCaxoLrwGa2zUcJjenk2CB8QmVpMR9vD2EvDgcy_gpw,6586
35
+ dominus/namespaces/recipes.py,sha256=vBe09bnqP4p9DCoYll3yXk81PPGyBj0thw746wyV8AI,9878
36
36
  dominus/namespaces/redis.py,sha256=1joYhewLGdN4-OCYJu5rvhsF5yORUUfVtBrgjzLKAzs,19337
37
37
  dominus/namespaces/secrets.py,sha256=od8AKgENwW6U-kVfIX3DSphXKeJA6XC-SxbGqsxhhUk,6253
38
38
  dominus/namespaces/secure.py,sha256=9idGY5R6k7b-JM1SAF_1Gt-YV5OempyxFBflgLJieLo,7168
@@ -41,7 +41,7 @@ dominus/namespaces/sync.py,sha256=mGwMNwc_iWoKgS94n1staPdsKBHNvliMG7omokl7Qmk,21
41
41
  dominus/namespaces/warden.py,sha256=ebbCeBJJwK9uALEj2aDbvWJ5HTlOXOpXJOwzokH1cso,1139
42
42
  dominus/namespaces/workflow.py,sha256=_PF7-9HtkCWhSAvBAq4g-e_43eTb7KjPHAKWmToHvBo,48474
43
43
  dominus/services/__init__.py,sha256=LQl5sx6DHhX1xCN3MRoUgffxqwm3Mfm525hijyFods8,43
44
- dominus_sdk_python-6.1.2.dist-info/METADATA,sha256=j57jgOD0aWH0P1GudXmhqTj3kRRckDCS5YSVaofRirg,9818
45
- dominus_sdk_python-6.1.2.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
46
- dominus_sdk_python-6.1.2.dist-info/top_level.txt,sha256=515zxMIbX0DpheRbjvNqKIt_AFqdFjX41jtyp_SqLf4,8
47
- dominus_sdk_python-6.1.2.dist-info/RECORD,,
44
+ dominus_sdk_python-6.2.0.dist-info/METADATA,sha256=HFgaoiX3QunTO0IZ05ML4oZSKrQR8aCoW4DkqC7V07A,9852
45
+ dominus_sdk_python-6.2.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
46
+ dominus_sdk_python-6.2.0.dist-info/top_level.txt,sha256=515zxMIbX0DpheRbjvNqKIt_AFqdFjX41jtyp_SqLf4,8
47
+ dominus_sdk_python-6.2.0.dist-info/RECORD,,