managed-deepagents 0.9.3.dev28__py3-none-win_amd64.whl → 0.9.3.dev29__py3-none-win_amd64.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.
- managed_deepagents/_agent_auth.py +6 -3
- managed_deepagents/_agent_auth_http.py +11 -0
- managed_deepagents/_binaries/mda.exe +0 -0
- managed_deepagents/_connections.py +25 -9
- {managed_deepagents-0.9.3.dev28.dist-info → managed_deepagents-0.9.3.dev29.dist-info}/METADATA +1 -1
- {managed_deepagents-0.9.3.dev28.dist-info → managed_deepagents-0.9.3.dev29.dist-info}/RECORD +10 -10
- {managed_deepagents-0.9.3.dev28.dist-info → managed_deepagents-0.9.3.dev29.dist-info}/WHEEL +0 -0
- {managed_deepagents-0.9.3.dev28.dist-info → managed_deepagents-0.9.3.dev29.dist-info}/entry_points.txt +0 -0
- {managed_deepagents-0.9.3.dev28.dist-info → managed_deepagents-0.9.3.dev29.dist-info}/licenses/LICENSE +0 -0
- {managed_deepagents-0.9.3.dev28.dist-info → managed_deepagents-0.9.3.dev29.dist-info}/top_level.txt +0 -0
|
@@ -13,6 +13,7 @@ from typing import NotRequired, Protocol, TypedDict
|
|
|
13
13
|
|
|
14
14
|
from managed_deepagents._agent_auth_http import (
|
|
15
15
|
AGENT_AUTH_TIMEOUT_SECONDS,
|
|
16
|
+
ConnectionsNotConfiguredError,
|
|
16
17
|
CredentialStoreError,
|
|
17
18
|
agent_auth_credential_query,
|
|
18
19
|
agent_auth_headers,
|
|
@@ -20,6 +21,10 @@ from managed_deepagents._agent_auth_http import (
|
|
|
20
21
|
request_agent_auth_json,
|
|
21
22
|
)
|
|
22
23
|
|
|
24
|
+
#: How a missing workspace is named in errors: deployments get it as
|
|
25
|
+
#: ``LANGSMITH_TENANT_ID``, everything else should set ``LANGSMITH_WORKSPACE_ID``.
|
|
26
|
+
WORKSPACE_SETTING = "LANGSMITH_WORKSPACE_ID (or LANGSMITH_TENANT_ID)"
|
|
27
|
+
|
|
23
28
|
AGENT_AUTH_PROVIDER_PAGE_SIZE = 100
|
|
24
29
|
AGENT_AUTH_MAX_PROVIDER_PAGES = 20
|
|
25
30
|
|
|
@@ -187,9 +192,7 @@ class AgentAuth:
|
|
|
187
192
|
def find_workspace_connection(self, slug: str) -> WorkspaceConnection | None:
|
|
188
193
|
"""List workspace connections and return the row for ``slug``, if any."""
|
|
189
194
|
if not (self.context.workspace_id or "").strip():
|
|
190
|
-
raise
|
|
191
|
-
"connections are not configured: LANGSMITH_WORKSPACE_ID is not set"
|
|
192
|
-
)
|
|
195
|
+
raise ConnectionsNotConfiguredError(WORKSPACE_SETTING)
|
|
193
196
|
cursor: str | None = None
|
|
194
197
|
for _ in range(AGENT_AUTH_MAX_PROVIDER_PAGES):
|
|
195
198
|
query: dict[str, str] = {
|
|
@@ -73,6 +73,17 @@ class CredentialStoreError(RuntimeError):
|
|
|
73
73
|
super().__init__(with_status if hint is None else f"{with_status}: {hint}")
|
|
74
74
|
|
|
75
75
|
|
|
76
|
+
class ConnectionsNotConfiguredError(CredentialStoreError):
|
|
77
|
+
"""The runtime lacks a setting every Agent Auth call needs.
|
|
78
|
+
|
|
79
|
+
The message only names the missing setting, never a value, so it is safe to
|
|
80
|
+
log.
|
|
81
|
+
"""
|
|
82
|
+
|
|
83
|
+
def __init__(self, setting: str) -> None:
|
|
84
|
+
super().__init__(f"connections are not configured: {setting} is not set")
|
|
85
|
+
|
|
86
|
+
|
|
76
87
|
# Each runtime quotes the slug its own way: repr() here, JSON.stringify in npm.
|
|
77
88
|
_MISSING_WORKSPACE_CONNECTION = re.compile(
|
|
78
89
|
r"""workspace connection ['"]([A-Za-z0-9][A-Za-z0-9._-]*)['"] is not configured"""
|
|
Binary file
|
|
@@ -23,6 +23,7 @@ from dataclasses import dataclass
|
|
|
23
23
|
from typing import TYPE_CHECKING, Literal, TypedDict, TypeGuard
|
|
24
24
|
|
|
25
25
|
from managed_deepagents._agent_auth import (
|
|
26
|
+
WORKSPACE_SETTING,
|
|
26
27
|
AgentAuth,
|
|
27
28
|
AgentAuthContext,
|
|
28
29
|
CredentialAuthorizationRequiredError,
|
|
@@ -32,6 +33,7 @@ from managed_deepagents._agent_auth import (
|
|
|
32
33
|
)
|
|
33
34
|
from managed_deepagents._agent_auth_http import (
|
|
34
35
|
AGENT_AUTH_TIMEOUT_SECONDS,
|
|
36
|
+
ConnectionsNotConfiguredError,
|
|
35
37
|
CredentialStoreError,
|
|
36
38
|
agent_auth_headers,
|
|
37
39
|
)
|
|
@@ -126,6 +128,9 @@ _DEFAULT_LANGSMITH_ENDPOINT = "https://api.smith.langchain.com"
|
|
|
126
128
|
DEPLOYMENT_ID_ENV = "LANGSMITH_HOST_PROJECT_ID"
|
|
127
129
|
_API_KEY_ENV = "LANGSMITH_API_KEY"
|
|
128
130
|
_WORKSPACE_ID_ENV = "LANGSMITH_WORKSPACE_ID"
|
|
131
|
+
#: The workspace a hosted LangSmith deployment runs in. The platform sets it on
|
|
132
|
+
#: every revision; ``LANGSMITH_WORKSPACE_ID`` is what users should set.
|
|
133
|
+
_TENANT_ID_ENV = "LANGSMITH_TENANT_ID"
|
|
129
134
|
_LOCAL_DEV_USER = "mda:local-dev"
|
|
130
135
|
_LOCAL_DEV_PRINCIPAL_ENV = "MDA_AGENT_AUTH_PRINCIPAL_ID"
|
|
131
136
|
|
|
@@ -178,9 +183,7 @@ class AgentAuthConnectionStore:
|
|
|
178
183
|
return _fetch_local_dev_agent_connection(resolved, request["slug"])
|
|
179
184
|
config = _resolve_agent_auth_config(self._env)
|
|
180
185
|
if owner["type"] == "agent" and not config.deployment_id:
|
|
181
|
-
raise
|
|
182
|
-
f"connections are not configured: {DEPLOYMENT_ID_ENV} is not set"
|
|
183
|
-
)
|
|
186
|
+
raise ConnectionsNotConfiguredError(DEPLOYMENT_ID_ENV)
|
|
184
187
|
# Source-identity match still uses JWT sub / channel actor.
|
|
185
188
|
resolve_owner_id(owner, request["identity"], config.deployment_id)
|
|
186
189
|
if owner["type"] == "user":
|
|
@@ -526,12 +529,10 @@ def _resolve_agent_auth_config(env: Mapping[str, str] | None) -> _AgentAuthConfi
|
|
|
526
529
|
resolved = os.environ if env is None else env
|
|
527
530
|
api_key = (resolved.get(_API_KEY_ENV) or "").strip()
|
|
528
531
|
if not api_key:
|
|
529
|
-
raise
|
|
530
|
-
workspace_id = (resolved
|
|
531
|
-
if
|
|
532
|
-
raise
|
|
533
|
-
f"connections are not configured: {_WORKSPACE_ID_ENV} is not set"
|
|
534
|
-
)
|
|
532
|
+
raise ConnectionsNotConfiguredError(_API_KEY_ENV)
|
|
533
|
+
workspace_id = resolve_workspace_id(resolved)
|
|
534
|
+
if workspace_id is None:
|
|
535
|
+
raise ConnectionsNotConfiguredError(WORKSPACE_SETTING)
|
|
535
536
|
return _AgentAuthConfig(
|
|
536
537
|
base_url=resolve_agent_auth_base_url(resolved),
|
|
537
538
|
api_key=api_key,
|
|
@@ -545,6 +546,21 @@ def _resolve_agent_auth_config(env: Mapping[str, str] | None) -> _AgentAuthConfi
|
|
|
545
546
|
)
|
|
546
547
|
|
|
547
548
|
|
|
549
|
+
def resolve_workspace_id(env: Mapping[str, str] | None = None) -> str | None:
|
|
550
|
+
"""The LangSmith workspace Agent Auth calls are scoped to.
|
|
551
|
+
|
|
552
|
+
Users set ``LANGSMITH_WORKSPACE_ID``, which wins. A hosted deployment
|
|
553
|
+
always runs with ``LANGSMITH_TENANT_ID``, which the platform sets, so a
|
|
554
|
+
deploy that never named a workspace still has one.
|
|
555
|
+
"""
|
|
556
|
+
resolved = os.environ if env is None else env
|
|
557
|
+
for name in (_WORKSPACE_ID_ENV, _TENANT_ID_ENV):
|
|
558
|
+
value = (resolved.get(name) or "").strip()
|
|
559
|
+
if value:
|
|
560
|
+
return value
|
|
561
|
+
return None
|
|
562
|
+
|
|
563
|
+
|
|
548
564
|
def resolve_agent_auth_base_url(env: Mapping[str, str] | None = None) -> str:
|
|
549
565
|
"""Origin for Agent Auth HTTP calls from ``LANGSMITH_ENDPOINT``.
|
|
550
566
|
|
{managed_deepagents-0.9.3.dev28.dist-info → managed_deepagents-0.9.3.dev29.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: managed-deepagents
|
|
3
|
-
Version: 0.9.3.
|
|
3
|
+
Version: 0.9.3.dev29
|
|
4
4
|
Summary: Managed Deep Agents — the define_deep_agent authoring interface plus the CLI that compiles and deploys a code-first Deep Agent repository to a managed LangGraph runtime.
|
|
5
5
|
Author: LangChain
|
|
6
6
|
License: MIT
|
{managed_deepagents-0.9.3.dev28.dist-info → managed_deepagents-0.9.3.dev29.dist-info}/RECORD
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
managed_deepagents/__init__.py,sha256=RSGo4MRHRSjZssj3IhD6wR4lZ90q7BMhMoKQjg-qi1U,4256
|
|
2
2
|
managed_deepagents/__main__.py,sha256=GcjmqN0Ea5v8OHKMxYToasm3eCX_doSLOlpEzAi1tAw,67
|
|
3
|
-
managed_deepagents/_agent_auth.py,sha256=
|
|
4
|
-
managed_deepagents/_agent_auth_http.py,sha256=
|
|
3
|
+
managed_deepagents/_agent_auth.py,sha256=eJQFW8CdK-Y0jkFsC7aqWWpg_PvfBF_TIDo5AqneCvw,20811
|
|
4
|
+
managed_deepagents/_agent_auth_http.py,sha256=ehA3cuALtjHD3mRYnZmXgiE0UEfb9q-7dcgDLYGzWmw,6027
|
|
5
5
|
managed_deepagents/_channel.py,sha256=_DUm3O40U8M9MxGADu-WpxG8APuKPepbEBznCeoCnzo,5468
|
|
6
6
|
managed_deepagents/_cli.py,sha256=jVaw2i1ysdRoWziMdPFmRXtKry_baYGRspyzyIeGWoU,1688
|
|
7
7
|
managed_deepagents/_connection_authorization.py,sha256=J_aIsTebFjZi_Klc5_Fw2hvAEfPWzfd3T3BvrfWI55s,4660
|
|
8
|
-
managed_deepagents/_connections.py,sha256=
|
|
8
|
+
managed_deepagents/_connections.py,sha256=Qy3-BlldxvzrCmfs1K4eifh6vj2zwc_RZgrQJUIC2KE,21260
|
|
9
9
|
managed_deepagents/_connector.py,sha256=f5TS8sMhx65gThmkkpqDCfwNPdbWNDKEEuEswWdG8-s,8286
|
|
10
10
|
managed_deepagents/_cors.py,sha256=V96RPrqewdRWG5RpEMEBnPuRq9_zF8nf4vf99k5dkuI,7597
|
|
11
11
|
managed_deepagents/_credential_gate.py,sha256=2BsZ13jJns7qFMxD89JnQoujXmkfoOBelRQEx0A8WBE,12208
|
|
@@ -40,7 +40,7 @@ managed_deepagents/run_context.py,sha256=1Nc3pew_nROgKi18PAKhn7vOAed-PmxArqUTpce
|
|
|
40
40
|
managed_deepagents/runtime.py,sha256=88QmwIzEVCyq4p2BWOmw20xJJLSyemfbPneVfNnx7C0,95214
|
|
41
41
|
managed_deepagents/sandbox.py,sha256=8qaswX6F2LYJX1uGq_7XwAGHZjGOD9VQ0WISqPK_ohs,4734
|
|
42
42
|
managed_deepagents/schedules.py,sha256=XROsDs-QwCWH0yEwakIN5Rhl5aM06eZX5-JFJ-KG1To,5898
|
|
43
|
-
managed_deepagents/_binaries/mda.exe,sha256=
|
|
43
|
+
managed_deepagents/_binaries/mda.exe,sha256=HDXvbv8p3vUpzCwNxrhhTmmTJpUIvVMwED2hASKKTqw,4537856
|
|
44
44
|
managed_deepagents/_channels/__init__.py,sha256=tY94zltWKNw-FIzbGjrh0cSAc2JIHCEAvcY7hzoRED0,801
|
|
45
45
|
managed_deepagents/_channels/assistant_text.py,sha256=ZLYAF1MQVE5_EN49MoPJdB8Ckf3vNPpXNBhkdA4egF0,3414
|
|
46
46
|
managed_deepagents/_channels/binding.py,sha256=DnxB7FXkbY5B3PCEAGz3JJBCCnQSdWz8PU8ze4fdcZU,5302
|
|
@@ -103,9 +103,9 @@ managed_deepagents/identity/__init__.py,sha256=YMB5p2DRyyY_82gGNVfGHjfjnUFRTtMne
|
|
|
103
103
|
managed_deepagents/identity/claims.py,sha256=prby7r_8Lww3MmoBm8PX6PsSGE3GwSHkr8mVIz_08nU,1180
|
|
104
104
|
managed_deepagents/identity/options.py,sha256=x_yMbXEFR7zXyehEjDHG2qjAlukXjrRBcQLcM6IndLM,2550
|
|
105
105
|
managed_deepagents/identity/supabase.py,sha256=8uobl3WCrQL_ieSXG8KTLf1th7Qjim9liZT50HeaJE0,6026
|
|
106
|
-
managed_deepagents-0.9.3.
|
|
107
|
-
managed_deepagents-0.9.3.
|
|
108
|
-
managed_deepagents-0.9.3.
|
|
109
|
-
managed_deepagents-0.9.3.
|
|
110
|
-
managed_deepagents-0.9.3.
|
|
111
|
-
managed_deepagents-0.9.3.
|
|
106
|
+
managed_deepagents-0.9.3.dev29.dist-info/licenses/LICENSE,sha256=WnPZQQ608ojZUkXl7BW6VbKloIAibZiGm1K6cjeZOL8,1066
|
|
107
|
+
managed_deepagents-0.9.3.dev29.dist-info/METADATA,sha256=QyePLTL3tlaWm1KjiS0U1_jE18NMT_Gs_-BpjT8FkSU,33888
|
|
108
|
+
managed_deepagents-0.9.3.dev29.dist-info/WHEEL,sha256=3I5VVWZdsFlU417aCS2bMRuerS8wsfvBq99MyatBV3A,97
|
|
109
|
+
managed_deepagents-0.9.3.dev29.dist-info/entry_points.txt,sha256=ziZqkKuaDO3qHCjKmBhrx9cm3ok8bZ9xcEDpUTj4unM,53
|
|
110
|
+
managed_deepagents-0.9.3.dev29.dist-info/top_level.txt,sha256=fdBo4O0Hlol_w022tTLB5ftZpamb4yJoQ3MUvjgTGfA,19
|
|
111
|
+
managed_deepagents-0.9.3.dev29.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{managed_deepagents-0.9.3.dev28.dist-info → managed_deepagents-0.9.3.dev29.dist-info}/top_level.txt
RENAMED
|
File without changes
|