managed-deepagents 0.9.2.dev17__py3-none-win_amd64.whl → 0.9.2.dev18__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.
Binary file
@@ -352,6 +352,56 @@ def _peek_managed_host_name(key: str) -> str | None:
352
352
  return entry.host_name if entry is not None else None
353
353
 
354
354
 
355
+ def _bake_base(sandbox: SandboxDefinition | None) -> tuple[str, str] | None:
356
+ """The ``(option, value)`` bake base a sandbox sets, if any."""
357
+ if sandbox is None:
358
+ return None
359
+ for key in ("snapshot_id", "snapshot_name", "docker_image"):
360
+ value = _string_option(sandbox.options.get(key))
361
+ if value:
362
+ return key, value
363
+ return None
364
+
365
+
366
+ def _inherit_setup_recipe(
367
+ selected: SandboxDefinition,
368
+ declared: SandboxDefinition | None,
369
+ ) -> SandboxDefinition:
370
+ """Keep a factory's sandbox selection on the ``setup.sh`` recipe snapshot.
371
+
372
+ The recipe is baked on the base declared in ``sandbox/__init__.py``, or on
373
+ Host's default image when none is declared. A selection without a base, or
374
+ with that same base, clones the recipe. Any other base was never baked, so
375
+ the run fails instead of starting a sandbox without ``setup.sh``.
376
+ """
377
+ if not _string_option(os.environ.get(RECIPE_SNAPSHOT_ENV)):
378
+ return selected
379
+ base = _bake_base(selected)
380
+ if base is None:
381
+ return selected
382
+ declared_base = _bake_base(declared)
383
+ if base == declared_base:
384
+ from managed_deepagents.sandbox import SandboxDefinition # noqa: PLC0415
385
+
386
+ return SandboxDefinition(
387
+ {
388
+ key: value
389
+ for key, value in selected.options.items()
390
+ if key not in _BAKE_BASE_OPTION_KEYS
391
+ }
392
+ )
393
+ baked_on = (
394
+ f"{declared_base[0]} {json.dumps(declared_base[1])}"
395
+ if declared_base
396
+ else "the default sandbox image"
397
+ )
398
+ raise TypeError(
399
+ f"sandbox/setup.sh is baked on {baked_on}, but this run selected "
400
+ f"{base[0]} {json.dumps(base[1])}. Remove {base[0]} from the selected sandbox, "
401
+ "or declare the same base in sandbox/__init__.py."
402
+ )
403
+
404
+
355
405
  def _sandbox_create_kwargs(
356
406
  sandbox: SandboxDefinition,
357
407
  selection_fingerprint: str | None = None,
@@ -498,6 +548,7 @@ def compile_managed_agent(
498
548
  system_prompt: str | None = None,
499
549
  has_skills: bool = False,
500
550
  sandbox: SandboxDefinition | None = None,
551
+ sandbox_setup: bool = False,
501
552
  connectors: list[Connector] | None = None,
502
553
  channels: list[Channel] | None = None,
503
554
  identity: IdentityDefinitionLike | None = None,
@@ -518,6 +569,7 @@ def compile_managed_agent(
518
569
  system_prompt=system_prompt,
519
570
  has_skills=has_skills,
520
571
  sandbox=sandbox,
572
+ sandbox_setup=sandbox_setup,
521
573
  connectors=connectors,
522
574
  channels=channels,
523
575
  identity=identity,
@@ -540,6 +592,7 @@ async def compile_managed_agent_async(
540
592
  system_prompt: str | None = None,
541
593
  has_skills: bool = False,
542
594
  sandbox: SandboxDefinition | None = None,
595
+ sandbox_setup: bool = False,
543
596
  connectors: list[Connector] | None = None,
544
597
  channels: list[Channel] | None = None,
545
598
  identity: IdentityDefinitionLike | None = None,
@@ -583,6 +636,7 @@ async def compile_managed_agent_async(
583
636
  system_prompt=system_prompt,
584
637
  has_skills=has_skills,
585
638
  sandbox=sandbox,
639
+ sandbox_setup=sandbox_setup,
586
640
  connectors=connectors,
587
641
  channels=channels,
588
642
  identity=identity,
@@ -605,6 +659,7 @@ async def _compile_resolved_managed_agent_async(
605
659
  system_prompt: str | None = None,
606
660
  has_skills: bool = False,
607
661
  sandbox: SandboxDefinition | None = None,
662
+ sandbox_setup: bool = False,
608
663
  connectors: list[Connector] | None = None,
609
664
  channels: list[Channel] | None = None,
610
665
  identity: IdentityDefinitionLike | None = None,
@@ -628,6 +683,8 @@ async def _compile_resolved_managed_agent_async(
628
683
  if factory_entry and run_sandbox is not None and "sandbox" in definition.config
629
684
  else None
630
685
  )
686
+ if run_sandbox is not None and sandbox_selection_fingerprint and is_run and sandbox_setup:
687
+ run_sandbox = _inherit_setup_recipe(run_sandbox, sandbox)
631
688
  register_channel_messaging(channels or [])
632
689
  memory_selected_by_dynamic_resolver = "memory" in definition.config
633
690
  run_memory = (
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: managed-deepagents
3
- Version: 0.9.2.dev17
3
+ Version: 0.9.2.dev18
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
@@ -557,6 +557,12 @@ If `sandbox/setup.sh` exists, `mda deploy` / `mda dev` bake it into a recipe
557
557
  snapshot once; thread sandboxes clone that snapshot and do not re-run setup.
558
558
  MDA owns sandbox naming, image/snapshot selection, reuse, and lifecycle.
559
559
 
560
+ `setup.sh` is baked on the base in `sandbox/__init__.py`, or on the default
561
+ image when there is no declaration. A dynamic agent that selects a sandbox
562
+ gets the baked setup as long as its `define_sandbox(...)` sets no
563
+ `docker_image`, `snapshot_name`, or `snapshot_id`, or sets the same one. A run
564
+ that selects a different base fails, because `setup.sh` was never baked on it.
565
+
560
566
  Authored tools and middleware can use the Deep Agents backend interface at
561
567
  `runtime.backend`. It is `None` when the project has no sandbox:
562
568
 
@@ -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=ssw_r6UV_9XcvZVZqnYtM0AE8HmxmQheUGCqFEsCe4g,91880
40
+ managed_deepagents/runtime.py,sha256=f6B6JsMSsHJct-e1bVWaKgLmzXhgB8Pm0lFFHH9ysqg,94046
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=SgNk7BChi1ucwoUQaX0nuYGgJ095hJSlZVxP6Ik_5LU,4453888
43
+ managed_deepagents/_binaries/mda.exe,sha256=vTO5gMhdO6WZDwybMTlCMzgtkvZdPAkyDmwt4QosgVk,4499968
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
@@ -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.2.dev17.dist-info/licenses/LICENSE,sha256=WnPZQQ608ojZUkXl7BW6VbKloIAibZiGm1K6cjeZOL8,1066
105
- managed_deepagents-0.9.2.dev17.dist-info/METADATA,sha256=4qlaKPC42g7Tib49OgOfsRj1and1kGoCkwv4DBTeLvs,33049
106
- managed_deepagents-0.9.2.dev17.dist-info/WHEEL,sha256=3I5VVWZdsFlU417aCS2bMRuerS8wsfvBq99MyatBV3A,97
107
- managed_deepagents-0.9.2.dev17.dist-info/entry_points.txt,sha256=ziZqkKuaDO3qHCjKmBhrx9cm3ok8bZ9xcEDpUTj4unM,53
108
- managed_deepagents-0.9.2.dev17.dist-info/top_level.txt,sha256=fdBo4O0Hlol_w022tTLB5ftZpamb4yJoQ3MUvjgTGfA,19
109
- managed_deepagents-0.9.2.dev17.dist-info/RECORD,,
104
+ managed_deepagents-0.9.2.dev18.dist-info/licenses/LICENSE,sha256=WnPZQQ608ojZUkXl7BW6VbKloIAibZiGm1K6cjeZOL8,1066
105
+ managed_deepagents-0.9.2.dev18.dist-info/METADATA,sha256=xEzKp4mZS6cU7v4vJDnW1lnCvTMgxjjaOuXaMc8xu8w,33425
106
+ managed_deepagents-0.9.2.dev18.dist-info/WHEEL,sha256=3I5VVWZdsFlU417aCS2bMRuerS8wsfvBq99MyatBV3A,97
107
+ managed_deepagents-0.9.2.dev18.dist-info/entry_points.txt,sha256=ziZqkKuaDO3qHCjKmBhrx9cm3ok8bZ9xcEDpUTj4unM,53
108
+ managed_deepagents-0.9.2.dev18.dist-info/top_level.txt,sha256=fdBo4O0Hlol_w022tTLB5ftZpamb4yJoQ3MUvjgTGfA,19
109
+ managed_deepagents-0.9.2.dev18.dist-info/RECORD,,