managed-deepagents 0.9.3.dev5__py3-none-win_amd64.whl → 0.9.3.dev7__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/_binaries/mda.exe +0 -0
- managed_deepagents/_connectors/mcp/langsmith_url.py +1 -1
- managed_deepagents/_sandbox_proxy.py +13 -7
- managed_deepagents/runtime.py +36 -0
- {managed_deepagents-0.9.3.dev5.dist-info → managed_deepagents-0.9.3.dev7.dist-info}/METADATA +1 -1
- {managed_deepagents-0.9.3.dev5.dist-info → managed_deepagents-0.9.3.dev7.dist-info}/RECORD +10 -10
- {managed_deepagents-0.9.3.dev5.dist-info → managed_deepagents-0.9.3.dev7.dist-info}/WHEEL +0 -0
- {managed_deepagents-0.9.3.dev5.dist-info → managed_deepagents-0.9.3.dev7.dist-info}/entry_points.txt +0 -0
- {managed_deepagents-0.9.3.dev5.dist-info → managed_deepagents-0.9.3.dev7.dist-info}/licenses/LICENSE +0 -0
- {managed_deepagents-0.9.3.dev5.dist-info → managed_deepagents-0.9.3.dev7.dist-info}/top_level.txt +0 -0
|
Binary file
|
|
@@ -6,7 +6,7 @@ import re
|
|
|
6
6
|
from urllib.parse import ParseResult, urlparse
|
|
7
7
|
|
|
8
8
|
_LANGSMITH_MCP_PATH = re.compile(
|
|
9
|
-
r"^/v1/managed-tools/(?:servers|gateways)/[A-Za-z0-9][A-Za-z0-9_-]{0,127}/mcp/?$"
|
|
9
|
+
r"^/v1/managed-tools/(?:servers|kits|gateways)/[A-Za-z0-9][A-Za-z0-9_-]{0,127}/mcp/?$"
|
|
10
10
|
)
|
|
11
11
|
_DEFAULT_PORT = {"http": 80, "https": 443}
|
|
12
12
|
|
|
@@ -153,23 +153,29 @@ def patch_sandbox_proxy_config(
|
|
|
153
153
|
) -> None:
|
|
154
154
|
from langsmith.sandbox import ResourceNotFoundError # noqa: PLC0415
|
|
155
155
|
|
|
156
|
-
from managed_deepagents.runtime import
|
|
156
|
+
from managed_deepagents.runtime import ( # noqa: PLC0415
|
|
157
|
+
_configured_sandbox_api_endpoint,
|
|
158
|
+
_sandbox_client_kwargs,
|
|
159
|
+
)
|
|
157
160
|
|
|
158
161
|
kwargs = _sandbox_client_kwargs(sandbox)
|
|
159
162
|
headers = dict(cast("Mapping[str, str]", kwargs.get("headers") or {}))
|
|
160
163
|
api_key = kwargs.get("api_key") or os.environ.get("LANGCHAIN_API_KEY")
|
|
161
164
|
if isinstance(api_key, str):
|
|
162
165
|
headers["X-Api-Key"] = api_key
|
|
163
|
-
endpoint = (
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
166
|
+
endpoint = _configured_sandbox_api_endpoint()
|
|
167
|
+
if endpoint is None:
|
|
168
|
+
base = (
|
|
169
|
+
os.environ.get("LANGSMITH_ENDPOINT")
|
|
170
|
+
or os.environ.get("LANGCHAIN_ENDPOINT")
|
|
171
|
+
or "https://api.smith.langchain.com"
|
|
172
|
+
)
|
|
173
|
+
endpoint = f"{base.rstrip('/')}/v2/sandboxes"
|
|
168
174
|
httpx = import_module("httpx")
|
|
169
175
|
try:
|
|
170
176
|
with httpx.Client(timeout=30, follow_redirects=False) as client:
|
|
171
177
|
response = client.patch(
|
|
172
|
-
f"{endpoint}/
|
|
178
|
+
f"{endpoint}/boxes/{quote(name, safe='')}",
|
|
173
179
|
headers=headers,
|
|
174
180
|
json={"proxy_config": config},
|
|
175
181
|
)
|
managed_deepagents/runtime.py
CHANGED
|
@@ -25,6 +25,7 @@ from collections.abc import Awaitable, Callable, Iterable, Mapping, Sequence
|
|
|
25
25
|
from functools import partial
|
|
26
26
|
from http import HTTPStatus
|
|
27
27
|
from typing import TYPE_CHECKING, Any, Literal, TypedDict, TypeVar, cast
|
|
28
|
+
from urllib.parse import urlsplit
|
|
28
29
|
|
|
29
30
|
from deepagents import FilesystemPermission, create_deep_agent
|
|
30
31
|
from deepagents.backends import (
|
|
@@ -254,6 +255,10 @@ MANAGED_DEEP_AGENT_INSTRUCTIONS = (
|
|
|
254
255
|
#: Mirrors TypeScript ``RECIPE_SNAPSHOT_ENV``.
|
|
255
256
|
RECIPE_SNAPSHOT_ENV = "MDA_SANDBOX_RECIPE_SNAPSHOT"
|
|
256
257
|
|
|
258
|
+
#: Full sandbox API endpoint resolved and owned by ``mda deploy``.
|
|
259
|
+
#: Mirrors TypeScript ``SANDBOX_API_ENDPOINT_ENV``.
|
|
260
|
+
SANDBOX_API_ENDPOINT_ENV = "MDA_SANDBOX_API_ENDPOINT"
|
|
261
|
+
|
|
257
262
|
#: Env var naming the workspace the CLI baked the recipe snapshot into.
|
|
258
263
|
#: ``mda deploy`` sets it on the deployment and ``mda dev`` stages it into the
|
|
259
264
|
#: local ``.env``. Sandboxes and snapshots are workspace-scoped, so the runtime
|
|
@@ -438,6 +443,7 @@ def _sandbox_create_kwargs(
|
|
|
438
443
|
class _SandboxClientKwargs(TypedDict, total=False):
|
|
439
444
|
"""Subset of ``SandboxClient`` constructor keywords the runtime pins."""
|
|
440
445
|
|
|
446
|
+
api_endpoint: str
|
|
441
447
|
api_key: str
|
|
442
448
|
headers: dict[str, str]
|
|
443
449
|
|
|
@@ -445,6 +451,9 @@ class _SandboxClientKwargs(TypedDict, total=False):
|
|
|
445
451
|
def _sandbox_client_kwargs(sandbox: SandboxDefinition) -> _SandboxClientKwargs:
|
|
446
452
|
"""Client kwargs pinning the API key and the workspace holding the recipe."""
|
|
447
453
|
kwargs: _SandboxClientKwargs = {}
|
|
454
|
+
api_endpoint = _configured_sandbox_api_endpoint()
|
|
455
|
+
if api_endpoint:
|
|
456
|
+
kwargs["api_endpoint"] = api_endpoint
|
|
448
457
|
api_key = _string_option(sandbox.options.get("api_key")) or _string_option(
|
|
449
458
|
os.environ.get("LANGSMITH_API_KEY")
|
|
450
459
|
)
|
|
@@ -456,6 +465,33 @@ def _sandbox_client_kwargs(sandbox: SandboxDefinition) -> _SandboxClientKwargs:
|
|
|
456
465
|
return kwargs
|
|
457
466
|
|
|
458
467
|
|
|
468
|
+
def _configured_sandbox_api_endpoint() -> str | None:
|
|
469
|
+
"""Return the validated deploy-owned sandbox endpoint, when configured."""
|
|
470
|
+
raw = _string_option(os.environ.get(SANDBOX_API_ENDPOINT_ENV))
|
|
471
|
+
if raw is None:
|
|
472
|
+
return None
|
|
473
|
+
try:
|
|
474
|
+
parsed = urlsplit(raw)
|
|
475
|
+
hostname = parsed.hostname
|
|
476
|
+
except ValueError:
|
|
477
|
+
parsed = None
|
|
478
|
+
hostname = None
|
|
479
|
+
if (
|
|
480
|
+
parsed is None
|
|
481
|
+
or parsed.scheme not in {"http", "https"}
|
|
482
|
+
or hostname is None
|
|
483
|
+
or parsed.username is not None
|
|
484
|
+
or parsed.password is not None
|
|
485
|
+
or parsed.query
|
|
486
|
+
or parsed.fragment
|
|
487
|
+
):
|
|
488
|
+
raise RuntimeError(
|
|
489
|
+
f"{SANDBOX_API_ENDPOINT_ENV} must be an HTTP(S) URL without credentials, "
|
|
490
|
+
"query, or fragment"
|
|
491
|
+
)
|
|
492
|
+
return raw.rstrip("/")
|
|
493
|
+
|
|
494
|
+
|
|
459
495
|
def _sandbox_client_for(sandbox: SandboxDefinition) -> LangSmithSandboxClient:
|
|
460
496
|
"""Build a LangSmith sandbox client using the definition's API key."""
|
|
461
497
|
# Loaded lazily through the optional-provider boundary below.
|
{managed_deepagents-0.9.3.dev5.dist-info → managed_deepagents-0.9.3.dev7.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.dev7
|
|
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
|
|
@@ -25,7 +25,7 @@ managed_deepagents/_managed_tools.py,sha256=fr_fJkk8wN0PZrRnihBsLTLW2Q3L-sFnRz54
|
|
|
25
25
|
managed_deepagents/_memory_instructions.py,sha256=s69Shu6vGCXbynozC-SRSJeZrpH5PNowh0sIRKH65XQ,6763
|
|
26
26
|
managed_deepagents/_run_input.py,sha256=heaTTLd9i9D-1blrH-GIi5KmSpQrhrD9_mrtz9bhy48,6613
|
|
27
27
|
managed_deepagents/_runtime_schedules.py,sha256=DG40VLIyDodKI0SpE8xf0-BvlkbsCLKsQQEUGxrOaD0,25241
|
|
28
|
-
managed_deepagents/_sandbox_proxy.py,sha256=
|
|
28
|
+
managed_deepagents/_sandbox_proxy.py,sha256=h8EOnBD6F_jH_7ESsO-EzEUDuEPQNorUrIEV1LZASdQ,9567
|
|
29
29
|
managed_deepagents/_schedule_auth.py,sha256=VS-bL9wHnRZhubDH44hmHnp75gy0VzPq0mPQ43gHQCE,13724
|
|
30
30
|
managed_deepagents/_schedule_channel.py,sha256=P--isfzDBxJ4C2smFS-uuM3A5IwHn9byJxxVXgWDseo,998
|
|
31
31
|
managed_deepagents/_schedule_time.py,sha256=uNyULRjoD0HzPVvV-W772HPb3BYCt0fwEbbT9Ec__Jc,3710
|
|
@@ -37,10 +37,10 @@ managed_deepagents/define_memory.py,sha256=0DzI9jxr83YJ6mEhqXRbIYzgWpl259-PdAMoA
|
|
|
37
37
|
managed_deepagents/namespaces.py,sha256=7jNvJ18p6xL4_FKCqW4QZ4sYVYlMd6Nuw9Zw8H_0Zb4,4896
|
|
38
38
|
managed_deepagents/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
39
39
|
managed_deepagents/run_context.py,sha256=1Nc3pew_nROgKi18PAKhn7vOAed-PmxArqUTpceZLLg,3430
|
|
40
|
-
managed_deepagents/runtime.py,sha256=
|
|
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=S8X2W8Juk-V4vQ95ctl0P7yRjoVeTbgjEDBV9ererI4,4522496
|
|
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
|
|
@@ -73,7 +73,7 @@ managed_deepagents/_channels/trigger/types.py,sha256=K8uvaNKzpx-zn3hd1GBZOMQPDqL
|
|
|
73
73
|
managed_deepagents/_connectors/__init__.py,sha256=Ei-DvDmA-F2Bord6WuM7UtWtnuVt3u7CRSPKFqpHFhA,537
|
|
74
74
|
managed_deepagents/_connectors/tool_selection.py,sha256=-dtrHi8o4FsXG70V4CWgzL2UVG-89P3TU1Xk8UEdyDU,3029
|
|
75
75
|
managed_deepagents/_connectors/mcp/__init__.py,sha256=GILRaVSbQNgclmJcgmXpG6R_C63R_y2gEfvyFBlSRZM,17455
|
|
76
|
-
managed_deepagents/_connectors/mcp/langsmith_url.py,sha256=
|
|
76
|
+
managed_deepagents/_connectors/mcp/langsmith_url.py,sha256=6p00_rBR9Mny72CvjnSk-BYiaORlhO3W9Ixnz8ZrP5E,1699
|
|
77
77
|
managed_deepagents/_connectors/mcp/load.py,sha256=qOoUnOMk7K3jSNdbIC9t5Pglwmqem7Kx2TDkJwBzoAI,23050
|
|
78
78
|
managed_deepagents/_memory/__init__.py,sha256=oIba6kYsaQqOa3UeuQEbKFatb0f_ETPrLrqiTOmOsnU,311
|
|
79
79
|
managed_deepagents/_memory/async_util.py,sha256=gyN1PqRp94zSC12CZjD_daihtuf4rYTws_G7OIeW86k,1783
|
|
@@ -101,9 +101,9 @@ managed_deepagents/identity/__init__.py,sha256=YMB5p2DRyyY_82gGNVfGHjfjnUFRTtMne
|
|
|
101
101
|
managed_deepagents/identity/claims.py,sha256=prby7r_8Lww3MmoBm8PX6PsSGE3GwSHkr8mVIz_08nU,1180
|
|
102
102
|
managed_deepagents/identity/options.py,sha256=x_yMbXEFR7zXyehEjDHG2qjAlukXjrRBcQLcM6IndLM,2550
|
|
103
103
|
managed_deepagents/identity/supabase.py,sha256=8uobl3WCrQL_ieSXG8KTLf1th7Qjim9liZT50HeaJE0,6026
|
|
104
|
-
managed_deepagents-0.9.3.
|
|
105
|
-
managed_deepagents-0.9.3.
|
|
106
|
-
managed_deepagents-0.9.3.
|
|
107
|
-
managed_deepagents-0.9.3.
|
|
108
|
-
managed_deepagents-0.9.3.
|
|
109
|
-
managed_deepagents-0.9.3.
|
|
104
|
+
managed_deepagents-0.9.3.dev7.dist-info/licenses/LICENSE,sha256=WnPZQQ608ojZUkXl7BW6VbKloIAibZiGm1K6cjeZOL8,1066
|
|
105
|
+
managed_deepagents-0.9.3.dev7.dist-info/METADATA,sha256=iiUDIv8Sx0aC7CKQ8zpq2qpmoOLVFWVEV8ncJf54Q4A,33509
|
|
106
|
+
managed_deepagents-0.9.3.dev7.dist-info/WHEEL,sha256=3I5VVWZdsFlU417aCS2bMRuerS8wsfvBq99MyatBV3A,97
|
|
107
|
+
managed_deepagents-0.9.3.dev7.dist-info/entry_points.txt,sha256=ziZqkKuaDO3qHCjKmBhrx9cm3ok8bZ9xcEDpUTj4unM,53
|
|
108
|
+
managed_deepagents-0.9.3.dev7.dist-info/top_level.txt,sha256=fdBo4O0Hlol_w022tTLB5ftZpamb4yJoQ3MUvjgTGfA,19
|
|
109
|
+
managed_deepagents-0.9.3.dev7.dist-info/RECORD,,
|
|
File without changes
|
{managed_deepagents-0.9.3.dev5.dist-info → managed_deepagents-0.9.3.dev7.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{managed_deepagents-0.9.3.dev5.dist-info → managed_deepagents-0.9.3.dev7.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
{managed_deepagents-0.9.3.dev5.dist-info → managed_deepagents-0.9.3.dev7.dist-info}/top_level.txt
RENAMED
|
File without changes
|