managed-deepagents 0.9.3.dev27__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/_connectors/mcp/load.py +61 -2
- {managed_deepagents-0.9.3.dev27.dist-info → managed_deepagents-0.9.3.dev29.dist-info}/METADATA +1 -1
- {managed_deepagents-0.9.3.dev27.dist-info → managed_deepagents-0.9.3.dev29.dist-info}/RECORD +11 -11
- {managed_deepagents-0.9.3.dev27.dist-info → managed_deepagents-0.9.3.dev29.dist-info}/WHEEL +0 -0
- {managed_deepagents-0.9.3.dev27.dist-info → managed_deepagents-0.9.3.dev29.dist-info}/entry_points.txt +0 -0
- {managed_deepagents-0.9.3.dev27.dist-info → managed_deepagents-0.9.3.dev29.dist-info}/licenses/LICENSE +0 -0
- {managed_deepagents-0.9.3.dev27.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
|
|
|
@@ -37,6 +37,7 @@ from managed_deepagents._connectors.mcp.langsmith_url import (
|
|
|
37
37
|
)
|
|
38
38
|
from managed_deepagents._connectors.tool_selection import select_tools
|
|
39
39
|
from managed_deepagents._credential_gate import CredentialConsumer
|
|
40
|
+
from managed_deepagents._log import logger
|
|
40
41
|
from managed_deepagents._memory.async_util import await_if_needed
|
|
41
42
|
from managed_deepagents._memory.deps import optional_runtime_symbols, require_runtime_dependency
|
|
42
43
|
|
|
@@ -284,9 +285,9 @@ def _probe_langsmith_server_access(
|
|
|
284
285
|
url: str,
|
|
285
286
|
headers: Mapping[str, str],
|
|
286
287
|
) -> list[PendingCredential]:
|
|
287
|
-
"""Return pending credentials
|
|
288
|
+
"""Return pending credentials from a complete 428 or a partial kit's ``_meta``.
|
|
288
289
|
|
|
289
|
-
An empty list means the server is accessible.
|
|
290
|
+
An incomplete 428 raises. An empty list means the server is fully accessible.
|
|
290
291
|
"""
|
|
291
292
|
status, payload = request_agent_auth_json(
|
|
292
293
|
"POST",
|
|
@@ -295,6 +296,8 @@ def _probe_langsmith_server_access(
|
|
|
295
296
|
headers=headers,
|
|
296
297
|
timeout=AGENT_AUTH_TIMEOUT_SECONDS,
|
|
297
298
|
)
|
|
299
|
+
if status == HTTPStatus.OK:
|
|
300
|
+
return _pending_credentials_from_langsmith_meta(payload, server_name)
|
|
298
301
|
if status != HTTPStatus.PRECONDITION_REQUIRED:
|
|
299
302
|
return []
|
|
300
303
|
credentials = payload.get("credentials")
|
|
@@ -315,6 +318,62 @@ def _probe_langsmith_server_access(
|
|
|
315
318
|
)
|
|
316
319
|
|
|
317
320
|
|
|
321
|
+
def _pending_credentials_from_langsmith_meta(
|
|
322
|
+
payload: Mapping[str, object],
|
|
323
|
+
server_name: str,
|
|
324
|
+
) -> list[PendingCredential]:
|
|
325
|
+
"""Map the missing credentials an ALLOW_PARTIAL tool kit lists in ``_meta``.
|
|
326
|
+
|
|
327
|
+
The kit's connected tools work without these, so entries without a
|
|
328
|
+
complete link are skipped with a warning instead of failing the run.
|
|
329
|
+
"""
|
|
330
|
+
result = payload.get("result")
|
|
331
|
+
meta = result.get("_meta") if isinstance(result, Mapping) else None
|
|
332
|
+
entries = (
|
|
333
|
+
meta.get("com.langchain.langsmith/missingCredentials")
|
|
334
|
+
if isinstance(meta, Mapping)
|
|
335
|
+
else None
|
|
336
|
+
)
|
|
337
|
+
if not isinstance(entries, list):
|
|
338
|
+
return []
|
|
339
|
+
pending: list[PendingCredential] = []
|
|
340
|
+
for entry in entries:
|
|
341
|
+
credential = (
|
|
342
|
+
_pending_credential_from_langsmith_428(entry, provider=server_name)
|
|
343
|
+
if isinstance(entry, Mapping)
|
|
344
|
+
else None
|
|
345
|
+
)
|
|
346
|
+
if credential is None:
|
|
347
|
+
_warn_skipped_meta_credential(server_name, entry)
|
|
348
|
+
continue
|
|
349
|
+
pending.append(credential)
|
|
350
|
+
return pending
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
def _warn_skipped_meta_credential(server_name: str, entry: object) -> None:
|
|
354
|
+
"""Name the skipped entry's provider and missing fields, never their values."""
|
|
355
|
+
server = logger.log_identifier(server_name)
|
|
356
|
+
if not isinstance(entry, Mapping):
|
|
357
|
+
logger.warning(
|
|
358
|
+
'skipped missing credential for LangSmith MCP server "%s": entry is not an object',
|
|
359
|
+
server,
|
|
360
|
+
)
|
|
361
|
+
return
|
|
362
|
+
label = entry.get("display_name") or entry.get("slug")
|
|
363
|
+
provider = logger.log_identifier(label) if isinstance(label, str) and label else "unknown"
|
|
364
|
+
missing = [
|
|
365
|
+
field
|
|
366
|
+
for field in ("slug", "verification_url", "auth_id")
|
|
367
|
+
if not (isinstance(entry.get(field), str) and entry.get(field))
|
|
368
|
+
]
|
|
369
|
+
logger.warning(
|
|
370
|
+
'skipped missing credential for LangSmith MCP server "%s" (provider=%s): missing %s',
|
|
371
|
+
server,
|
|
372
|
+
provider,
|
|
373
|
+
", ".join(missing),
|
|
374
|
+
)
|
|
375
|
+
|
|
376
|
+
|
|
318
377
|
def _pending_credentials_from_langsmith_gateway_428(
|
|
319
378
|
credentials: list[object],
|
|
320
379
|
server_name: str,
|
{managed_deepagents-0.9.3.dev27.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.dev27.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
|
|
@@ -76,7 +76,7 @@ managed_deepagents/_connectors/__init__.py,sha256=Ei-DvDmA-F2Bord6WuM7UtWtnuVt3u
|
|
|
76
76
|
managed_deepagents/_connectors/tool_selection.py,sha256=-dtrHi8o4FsXG70V4CWgzL2UVG-89P3TU1Xk8UEdyDU,3029
|
|
77
77
|
managed_deepagents/_connectors/mcp/__init__.py,sha256=GILRaVSbQNgclmJcgmXpG6R_C63R_y2gEfvyFBlSRZM,17455
|
|
78
78
|
managed_deepagents/_connectors/mcp/langsmith_url.py,sha256=6p00_rBR9Mny72CvjnSk-BYiaORlhO3W9Ixnz8ZrP5E,1699
|
|
79
|
-
managed_deepagents/_connectors/mcp/load.py,sha256=
|
|
79
|
+
managed_deepagents/_connectors/mcp/load.py,sha256=KgeYYsNSUHhytQ29T0avwqbWRb0xr39i_umUrKKgX3g,25242
|
|
80
80
|
managed_deepagents/_memory/__init__.py,sha256=oIba6kYsaQqOa3UeuQEbKFatb0f_ETPrLrqiTOmOsnU,311
|
|
81
81
|
managed_deepagents/_memory/async_util.py,sha256=gyN1PqRp94zSC12CZjD_daihtuf4rYTws_G7OIeW86k,1783
|
|
82
82
|
managed_deepagents/_memory/context_io.py,sha256=twvf8xPBP77uipZel9EyUUxQDggD9aI_eYc34QC0SRE,1666
|
|
@@ -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.dev27.dist-info → managed_deepagents-0.9.3.dev29.dist-info}/top_level.txt
RENAMED
|
File without changes
|