managed-deepagents 0.10.3.dev3__py3-none-win_amd64.whl → 0.10.3.dev5__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/_schedule_auth.py +44 -12
- {managed_deepagents-0.10.3.dev3.dist-info → managed_deepagents-0.10.3.dev5.dist-info}/METADATA +1 -1
- {managed_deepagents-0.10.3.dev3.dist-info → managed_deepagents-0.10.3.dev5.dist-info}/RECORD +8 -8
- {managed_deepagents-0.10.3.dev3.dist-info → managed_deepagents-0.10.3.dev5.dist-info}/WHEEL +0 -0
- {managed_deepagents-0.10.3.dev3.dist-info → managed_deepagents-0.10.3.dev5.dist-info}/entry_points.txt +0 -0
- {managed_deepagents-0.10.3.dev3.dist-info → managed_deepagents-0.10.3.dev5.dist-info}/licenses/LICENSE +0 -0
- {managed_deepagents-0.10.3.dev3.dist-info → managed_deepagents-0.10.3.dev5.dist-info}/top_level.txt +0 -0
|
Binary file
|
|
@@ -377,8 +377,7 @@ async def authorize_schedule( # noqa: C901 - one branch per cron event check
|
|
|
377
377
|
if access is None:
|
|
378
378
|
if not (is_studio_auth_user(user) or _is_local_dev_operator(user)):
|
|
379
379
|
raise ValueError("Schedule access is not permitted")
|
|
380
|
-
await
|
|
381
|
-
return None
|
|
380
|
+
return await _authorize_studio_schedule(action, data)
|
|
382
381
|
filters = {"mda_schedule_owner": access["owner"], "mda_schedule_assistant": access["assistant"]}
|
|
383
382
|
if action in {"update", "delete"}:
|
|
384
383
|
filters["mda_managed_by"] = "runtime"
|
|
@@ -477,30 +476,40 @@ def _is_local_dev_operator(user: object) -> bool:
|
|
|
477
476
|
)
|
|
478
477
|
|
|
479
478
|
|
|
480
|
-
async def
|
|
481
|
-
# Studio identity is reachable by any workspace API key
|
|
482
|
-
#
|
|
483
|
-
# `mda deploy` (and `mda dev` locally) can still
|
|
479
|
+
async def _authorize_studio_schedule(action: str, data: dict[str, object]) -> FilterType | None:
|
|
480
|
+
# Studio identity is reachable by any workspace API key. It may create a deploy-managed
|
|
481
|
+
# cron or an untagged one, which is stamped "api" and is the only kind it may update.
|
|
482
|
+
# Read/search/delete stay unscoped so `mda deploy` (and `mda dev` locally) can still
|
|
483
|
+
# list and tear down managed crons.
|
|
484
484
|
if action == "update":
|
|
485
|
-
|
|
485
|
+
return _authorize_api_schedule_update(data)
|
|
486
486
|
if action != "create":
|
|
487
|
-
return
|
|
487
|
+
return None
|
|
488
488
|
metadata = data.get("metadata")
|
|
489
489
|
payload = data.get("payload")
|
|
490
|
+
if metadata is None:
|
|
491
|
+
metadata = data["metadata"] = {}
|
|
490
492
|
if (
|
|
491
493
|
not isinstance(metadata, dict)
|
|
492
|
-
or metadata.get("mda_managed") is not True
|
|
493
|
-
or metadata.get("mda_managed_by") != "deploy"
|
|
494
494
|
or not isinstance(payload, dict)
|
|
495
495
|
or not isinstance(payload.get("assistant_id"), str)
|
|
496
496
|
):
|
|
497
497
|
raise ValueError("Schedule access is not permitted")
|
|
498
|
+
api = not any(map(is_managed_key, metadata))
|
|
499
|
+
if not api and (
|
|
500
|
+
metadata.get("mda_managed") is not True or metadata.get("mda_managed_by") != "deploy"
|
|
501
|
+
):
|
|
502
|
+
raise ValueError("Schedule access is not permitted")
|
|
498
503
|
assistant = payload["assistant_id"]
|
|
499
504
|
try:
|
|
500
505
|
UUID(assistant)
|
|
501
506
|
except ValueError:
|
|
502
507
|
assistant = str(uuid5(NAMESPACE_URL, assistant))
|
|
503
|
-
|
|
508
|
+
if api:
|
|
509
|
+
# Not `mda_managed`: deploy reconciliation and runtime schedule tools leave it alone.
|
|
510
|
+
metadata["mda_managed_by"] = "api"
|
|
511
|
+
else:
|
|
512
|
+
metadata.update(mda_schedule_owner="agent", mda_schedule_assistant=assistant)
|
|
504
513
|
execution: ExecutionUser = {
|
|
505
514
|
"identity": f"mda:schedule:{assistant}",
|
|
506
515
|
"permissions": [],
|
|
@@ -518,8 +527,31 @@ async def _authorize_deploy_schedule(action: str, data: dict[str, object]) -> No
|
|
|
518
527
|
"thread": str(data["thread_id"]),
|
|
519
528
|
}
|
|
520
529
|
)
|
|
521
|
-
|
|
530
|
+
if api:
|
|
531
|
+
_check_api_context(payload)
|
|
532
|
+
else:
|
|
533
|
+
_check_context(payload, execution, "deploy")
|
|
522
534
|
_stamp_execution(payload, execution)
|
|
535
|
+
return None
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
def _authorize_api_schedule_update(data: dict[str, object]) -> FilterType:
|
|
539
|
+
"""An API cron keeps its stamped assistant and principal; only its other fields change."""
|
|
540
|
+
metadata = data.get("metadata")
|
|
541
|
+
payload = data.get("payload")
|
|
542
|
+
if (isinstance(metadata, dict) and any(map(is_managed_key, metadata))) or (
|
|
543
|
+
isinstance(payload, dict) and {"assistant_id", "config"} & payload.keys()
|
|
544
|
+
):
|
|
545
|
+
raise ValueError("Schedule access is not permitted")
|
|
546
|
+
_check_api_context(payload)
|
|
547
|
+
return {"mda_managed_by": "api"}
|
|
548
|
+
|
|
549
|
+
|
|
550
|
+
def _check_api_context(payload: object) -> None:
|
|
551
|
+
"""An API cron's context is authored only: no managed schedule or channel routing."""
|
|
552
|
+
context = _field(payload, "context")
|
|
553
|
+
if context is not None and (not isinstance(context, dict) or any(map(is_managed_key, context))):
|
|
554
|
+
raise ValueError("Invalid schedule config")
|
|
523
555
|
|
|
524
556
|
|
|
525
557
|
def _stamp_execution(payload: dict[str, object], execution: ExecutionUser) -> None:
|
{managed_deepagents-0.10.3.dev3.dist-info → managed_deepagents-0.10.3.dev5.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: managed-deepagents
|
|
3
|
-
Version: 0.10.3.
|
|
3
|
+
Version: 0.10.3.dev5
|
|
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.10.3.dev3.dist-info → managed_deepagents-0.10.3.dev5.dist-info}/RECORD
RENAMED
|
@@ -35,7 +35,7 @@ managed_deepagents/_run_input.py,sha256=VdIysM5tIFx8Fjmbr3dkNIHYovcHmSC-wtwRuqYo
|
|
|
35
35
|
managed_deepagents/_run_local.py,sha256=pKGh_JKUW8RaTFy9EpBor893KCjBV2cCJZzsiBCeaWA,2852
|
|
36
36
|
managed_deepagents/_runtime_schedules.py,sha256=EDYtFxpbj4jZjV5-1mgWZn598g86NsgvsC_pEa2rGKk,30377
|
|
37
37
|
managed_deepagents/_sandbox_proxy.py,sha256=AFrcC07nTHaAQhGCDttncv3SkGL5h1JBcfxv7Psgn6c,9835
|
|
38
|
-
managed_deepagents/_schedule_auth.py,sha256=
|
|
38
|
+
managed_deepagents/_schedule_auth.py,sha256=twu14FlXcWhs-vKgLFCE3OEva23WRZqgYpbdH246uCw,26480
|
|
39
39
|
managed_deepagents/_schedule_channel.py,sha256=r0EWl4OrBJRnwKETHjKdScYIfdi0lrUEGdajX6FGIdQ,1109
|
|
40
40
|
managed_deepagents/_schedule_time.py,sha256=uNyULRjoD0HzPVvV-W772HPb3BYCt0fwEbbT9Ec__Jc,3710
|
|
41
41
|
managed_deepagents/_static_entry.py,sha256=QgvrnBLue6elOHSWdIFosFEfYMp4V9YDwBlZSe_NyQA,635
|
|
@@ -53,7 +53,7 @@ managed_deepagents/run_context.py,sha256=IayZdcpPrKVss70Hro8qI-EWtL94HZt4JKefzec
|
|
|
53
53
|
managed_deepagents/runtime.py,sha256=M5-XlwkTfWV6Gyl4w9vClFFF0GvOWZEc6-_wPyxn5W0,136847
|
|
54
54
|
managed_deepagents/sandbox.py,sha256=cS66-vFcARsbHR3fH5jvWd4qF-MAjiGqRe-_Kocsqtg,4693
|
|
55
55
|
managed_deepagents/schedules.py,sha256=z_OlmZ7hW7LdvWLem-BiA131nHwFvUDSW_0-ObzU_G4,6039
|
|
56
|
-
managed_deepagents/_binaries/mda.exe,sha256=
|
|
56
|
+
managed_deepagents/_binaries/mda.exe,sha256=0vD5KllSI0opkJzD6Re2gncRq_PZKAhVo6ztPUpqzME,5153792
|
|
57
57
|
managed_deepagents/_channels/__init__.py,sha256=mMgqza7EWRjhJM0lXlFd-W6wBYZrFkpLQ4_30Bpij7k,249
|
|
58
58
|
managed_deepagents/_channels/actor.py,sha256=3d_1-ia6vwVjXkw7PYn5gg6BjnlPwRXW4nW2C5vAO7c,5203
|
|
59
59
|
managed_deepagents/_channels/assistant_text.py,sha256=nf00-KJXNev-e_TkAK_8SBI3J9TiOis1GkGV_zT5048,8472
|
|
@@ -156,9 +156,9 @@ managed_deepagents/identity/__init__.py,sha256=uZUKDHtfBc0n-T2xoJEFMqMplmXwAK7hb
|
|
|
156
156
|
managed_deepagents/identity/claims.py,sha256=prby7r_8Lww3MmoBm8PX6PsSGE3GwSHkr8mVIz_08nU,1180
|
|
157
157
|
managed_deepagents/identity/options.py,sha256=x_yMbXEFR7zXyehEjDHG2qjAlukXjrRBcQLcM6IndLM,2550
|
|
158
158
|
managed_deepagents/identity/supabase.py,sha256=8uobl3WCrQL_ieSXG8KTLf1th7Qjim9liZT50HeaJE0,6026
|
|
159
|
-
managed_deepagents-0.10.3.
|
|
160
|
-
managed_deepagents-0.10.3.
|
|
161
|
-
managed_deepagents-0.10.3.
|
|
162
|
-
managed_deepagents-0.10.3.
|
|
163
|
-
managed_deepagents-0.10.3.
|
|
164
|
-
managed_deepagents-0.10.3.
|
|
159
|
+
managed_deepagents-0.10.3.dev5.dist-info/licenses/LICENSE,sha256=WnPZQQ608ojZUkXl7BW6VbKloIAibZiGm1K6cjeZOL8,1066
|
|
160
|
+
managed_deepagents-0.10.3.dev5.dist-info/METADATA,sha256=Y0KsOZkdOSvJ2Qz7SIvXkg4X4FVlv2ZPDPdpsG9iXHs,95067
|
|
161
|
+
managed_deepagents-0.10.3.dev5.dist-info/WHEEL,sha256=bhMFZwp6VMtrbl2Ck6PlXryKaCggO1NzYn_HcFbBF1I,97
|
|
162
|
+
managed_deepagents-0.10.3.dev5.dist-info/entry_points.txt,sha256=ziZqkKuaDO3qHCjKmBhrx9cm3ok8bZ9xcEDpUTj4unM,53
|
|
163
|
+
managed_deepagents-0.10.3.dev5.dist-info/top_level.txt,sha256=fdBo4O0Hlol_w022tTLB5ftZpamb4yJoQ3MUvjgTGfA,19
|
|
164
|
+
managed_deepagents-0.10.3.dev5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{managed_deepagents-0.10.3.dev3.dist-info → managed_deepagents-0.10.3.dev5.dist-info}/top_level.txt
RENAMED
|
File without changes
|