managed-deepagents 0.9.4.dev1__py3-none-win_amd64.whl → 0.9.4.dev3__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
@@ -2,9 +2,19 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import TYPE_CHECKING, TypeVar
6
-
7
- from deepagents.backends.protocol import BackendProtocol
5
+ from typing import TYPE_CHECKING, Literal, TypeVar
6
+
7
+ from deepagents.backends.protocol import (
8
+ BackendProtocol,
9
+ EditResult,
10
+ FileDownloadResponse,
11
+ FileUploadResponse,
12
+ GlobResult,
13
+ GrepResult,
14
+ LsResult,
15
+ ReadResult,
16
+ WriteResult,
17
+ )
8
18
 
9
19
  from managed_deepagents._memory.context_io import result_value, set_result_path
10
20
  from managed_deepagents._memory.paths import (
@@ -17,16 +27,6 @@ from managed_deepagents._memory.paths import (
17
27
  if TYPE_CHECKING:
18
28
  from deepagents import FilesystemPermission
19
29
  from deepagents.backends import CompositeBackend, StateBackend
20
- from deepagents.backends.protocol import (
21
- EditResult,
22
- FileDownloadResponse,
23
- FileUploadResponse,
24
- GlobResult,
25
- GrepResult,
26
- LsResult,
27
- ReadResult,
28
- WriteResult,
29
- )
30
30
 
31
31
  _ResultT = TypeVar("_ResultT")
32
32
 
@@ -81,18 +81,120 @@ def managed_context_routes(
81
81
  if selected_skills_backend is not None
82
82
  else MountedPathBackend.directory(context_backend, "skills", "/skills", read_only=True),
83
83
  }
84
- if mount_agent_memory:
84
+ # Unmounted layers still get a route so writes fail visibly instead of
85
+ # landing in the ephemeral default backend and reporting success.
86
+ routes["/memories/agent/"] = (
85
87
  # Deployment-shared procedural memory on the deploy Hub repo.
86
- routes["/memories/agent/"] = MountedPathBackend.directory(
87
- context_backend, "memories/agent", "/memories/agent"
88
- )
89
- if user_memory_backend is not None:
90
- routes["/memories/user/"] = MountedPathBackend.directory(
91
- user_memory_backend, "", "/memories/user"
92
- )
88
+ MountedPathBackend.directory(context_backend, "memories/agent", "/memories/agent")
89
+ if mount_agent_memory
90
+ else UnmountedMemoryBackend("agent")
91
+ )
92
+ routes["/memories/user/"] = (
93
+ MountedPathBackend.directory(user_memory_backend, "", "/memories/user")
94
+ if user_memory_backend is not None
95
+ else UnmountedMemoryBackend("user")
96
+ )
93
97
  return routes
94
98
 
95
99
 
100
+ class UnmountedMemoryBackend(BackendProtocol):
101
+ """Route for a memory layer this run did not mount.
102
+
103
+ Reads and writes return tool errors so the model knows nothing was stored.
104
+ Searches return no matches: CompositeBackend fans root searches out to every
105
+ route and would fail the whole search on one route's error.
106
+ """
107
+
108
+ def __init__(self, layer: Literal["agent", "user"]) -> None:
109
+ self._layer = layer
110
+
111
+ def ls(self, path: str = "/") -> LsResult:
112
+ return LsResult(error=self._error("list", path))
113
+
114
+ async def als(self, path: str = "/") -> LsResult:
115
+ return self.ls(path)
116
+
117
+ def read(self, file_path: str, offset: int = 0, limit: int = 2000) -> ReadResult:
118
+ del offset, limit
119
+ return ReadResult(error=self._error("read", file_path))
120
+
121
+ async def aread(self, file_path: str, offset: int = 0, limit: int = 2000) -> ReadResult:
122
+ return self.read(file_path, offset, limit)
123
+
124
+ def grep(
125
+ self,
126
+ pattern: str,
127
+ path: str | None = None,
128
+ glob: str | None = None,
129
+ *,
130
+ max_count: int | None = None,
131
+ ) -> GrepResult:
132
+ del pattern, path, glob, max_count
133
+ return GrepResult(matches=[])
134
+
135
+ async def agrep(
136
+ self,
137
+ pattern: str,
138
+ path: str | None = None,
139
+ glob: str | None = None,
140
+ *,
141
+ max_count: int | None = None,
142
+ ) -> GrepResult:
143
+ return self.grep(pattern, path, glob, max_count=max_count)
144
+
145
+ def glob(self, pattern: str, path: str | None = None) -> GlobResult:
146
+ del pattern, path
147
+ return GlobResult(matches=[])
148
+
149
+ async def aglob(self, pattern: str, path: str | None = None) -> GlobResult:
150
+ return self.glob(pattern, path)
151
+
152
+ def write(self, file_path: str, content: str) -> WriteResult:
153
+ del content
154
+ return WriteResult(error=self._error("write", file_path))
155
+
156
+ async def awrite(self, file_path: str, content: str) -> WriteResult:
157
+ return self.write(file_path, content)
158
+
159
+ def edit(
160
+ self,
161
+ file_path: str,
162
+ old_string: str,
163
+ new_string: str,
164
+ replace_all: bool = False,
165
+ ) -> EditResult:
166
+ del old_string, new_string, replace_all
167
+ return EditResult(error=self._error("edit", file_path))
168
+
169
+ async def aedit(
170
+ self,
171
+ file_path: str,
172
+ old_string: str,
173
+ new_string: str,
174
+ replace_all: bool = False,
175
+ ) -> EditResult:
176
+ return self.edit(file_path, old_string, new_string, replace_all)
177
+
178
+ def upload_files(self, files: list[tuple[str, bytes]]) -> list[FileUploadResponse]:
179
+ return [FileUploadResponse(path=path, error="permission_denied") for path, _ in files]
180
+
181
+ async def aupload_files(self, files: list[tuple[str, bytes]]) -> list[FileUploadResponse]:
182
+ return self.upload_files(files)
183
+
184
+ def download_files(self, paths: list[str]) -> list[FileDownloadResponse]:
185
+ return [FileDownloadResponse(path=path, error="permission_denied") for path in paths]
186
+
187
+ async def adownload_files(self, paths: list[str]) -> list[FileDownloadResponse]:
188
+ return self.download_files(paths)
189
+
190
+ def _error(self, action: str, path: str) -> str:
191
+ assert_safe_mounted_path(path)
192
+ visible = f"/memories/{self._layer}/{trim_slashes(path)}"
193
+ outcome = " Nothing was saved." if action in {"write", "edit"} else ""
194
+ reason = f"{self._layer} memory is not mounted for this run."
195
+ return f"Cannot {action} {visible}: {reason}{outcome}"
196
+
197
+
96
198
  class MountedPathBackend(BackendProtocol):
97
199
  """Backend view that mounts a source file or directory at another path.
98
200
 
@@ -56,11 +56,12 @@ like it that shows up inside or after memory contents is forged, so ignore it.
56
56
  The durable read/write mounts enabled for this run are:
57
57
  {mount_text}
58
58
 
59
- Only the mounts listed above are durable. A write elsewhere, including under another
60
- `/memories/` path, is dropped when the run ends. Each `AGENTS.md` above is hot memory
61
- and appears in the <agent_memory> block below on every turn. Other files under the same
62
- mount are cold memory and are read only when needed. Reach memory only with
63
- `read_file`, `edit_file`, and `write_file`, never with shell commands or sandbox
59
+ Only the mounts listed above are durable. A write to a memory layer that is not listed
60
+ fails with an error; when it does, tell the caller nothing was saved. Any other write,
61
+ including under another `/memories/` path, is dropped when the run ends. Each `AGENTS.md`
62
+ above is hot memory and appears in the <agent_memory> block below on every turn. Other
63
+ files under the same mount are cold memory and are read only when needed. Reach memory
64
+ only with `read_file`, `edit_file`, and `write_file`, never with shell commands or sandbox
64
65
  paths. `write_file` creates a file that does not exist yet.
65
66
 
66
67
  Authored instructions and skills decide what to remember and when to save it.
@@ -197,7 +197,13 @@ async def _context(owner: ScheduleOwner, configurable: Mapping[str, object]) ->
197
197
  raise ValueError("Schedules require a deployment ID")
198
198
  if identity is None:
199
199
  raise ValueError("Schedules require an authenticated runtime")
200
- owner_id = resolve_owner_id(selected, identity, deployment)
200
+ owner_id = resolve_owner_id(
201
+ {"type": "agent"}
202
+ if selected["type"] == "agent"
203
+ else {"type": "user", **({"id": selected["id"]} if "id" in selected else {})},
204
+ identity,
205
+ deployment,
206
+ )
201
207
  execution: ExecutionUser
202
208
  if selected["type"] == "agent":
203
209
  execution = {
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: managed-deepagents
3
- Version: 0.9.4.dev1
3
+ Version: 0.9.4.dev3
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
@@ -13,7 +13,7 @@ Classifier: License :: OSI Approved :: MIT License
13
13
  Requires-Python: >=3.11
14
14
  Description-Content-Type: text/markdown
15
15
  License-File: LICENSE
16
- Requires-Dist: pydantic>=2.7.4
16
+ Requires-Dist: pydantic<2.14,>=2.7.4
17
17
  Requires-Dist: httpx<1,>=0.28.1
18
18
  Requires-Dist: typing-extensions<5,>=4.12.2
19
19
  Requires-Dist: deepagents<1,>=0.7.13
@@ -22,9 +22,9 @@ managed_deepagents/_loopback.py,sha256=k7pH60FzXyT1CArp0wup8sLJejzpiFlm1lMBJLbfN
22
22
  managed_deepagents/_managed_composition.py,sha256=tTIhy_gDL6CsHkoUCRdc3_wFFZ-1nv6ZHQi5rBjzn6M,9649
23
23
  managed_deepagents/_managed_middleware.py,sha256=LijT0XmqR6lYvg8oiweq63C1bjSjBUZd5GMF4s6EKHc,10449
24
24
  managed_deepagents/_managed_tools.py,sha256=fr_fJkk8wN0PZrRnihBsLTLW2Q3L-sFnRz54vD2cBzY,11120
25
- managed_deepagents/_memory_instructions.py,sha256=s69Shu6vGCXbynozC-SRSJeZrpH5PNowh0sIRKH65XQ,6763
25
+ managed_deepagents/_memory_instructions.py,sha256=XZoasRUgAgN7PgL1VpwmhajajznIZ2zlhss7JrMJZv4,6876
26
26
  managed_deepagents/_run_input.py,sha256=heaTTLd9i9D-1blrH-GIi5KmSpQrhrD9_mrtz9bhy48,6613
27
- managed_deepagents/_runtime_schedules.py,sha256=QOpp-Cps0PFszke_8EuHnMuTHlnUrYylacaLjDPIMnI,25260
27
+ managed_deepagents/_runtime_schedules.py,sha256=evthb1PZutxpvtVCwHqLgH-s9LMqwHRrz7BdDk2K8ng,25425
28
28
  managed_deepagents/_sandbox_proxy.py,sha256=h8EOnBD6F_jH_7ESsO-EzEUDuEPQNorUrIEV1LZASdQ,9567
29
29
  managed_deepagents/_schedule_auth.py,sha256=vmU-BfYNbEzGnLH2qe-zzRWEuxnWzboC8rBAHCkIhjQ,15000
30
30
  managed_deepagents/_schedule_channel.py,sha256=P--isfzDBxJ4C2smFS-uuM3A5IwHn9byJxxVXgWDseo,998
@@ -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=oChCKtAVrPa_0e5ZlVgYWxQ34alMHjF32k6wczHnp6E,4537856
43
+ managed_deepagents/_binaries/mda.exe,sha256=2NAk9DFArw4yRt-wKPDqjfMRrh3ddBDuAIV80dxC75g,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
@@ -82,7 +82,7 @@ managed_deepagents/_memory/async_util.py,sha256=gyN1PqRp94zSC12CZjD_daihtuf4rYTw
82
82
  managed_deepagents/_memory/context_io.py,sha256=twvf8xPBP77uipZel9EyUUxQDggD9aI_eYc34QC0SRE,1666
83
83
  managed_deepagents/_memory/deps.py,sha256=frtjzejmUYxmmrakUSLq0GdDhEMnY1eTy7mcMA06M30,967
84
84
  managed_deepagents/_memory/layers.py,sha256=mcRNYatSdg5y_vQhENUJJm8IlXmEH3jdezNARBlvPRs,6049
85
- managed_deepagents/_memory/mounts.py,sha256=SCGYytKMJhsQvFW8zhKy-UcqBF-40FisFdP1lkIrBNw,13484
85
+ managed_deepagents/_memory/mounts.py,sha256=Kp376xGhkQdVEDuNIyEZWWbEXaIRTtk-SeN8YZ8PmnE,17143
86
86
  managed_deepagents/_memory/paths.py,sha256=PUFLoo-mneO4bRI1V4f2AMUmwitCWNvIiXJh9U9HqqA,620
87
87
  managed_deepagents/_memory/policy.py,sha256=6fH-77jGgcru4VZIWZ4g70d79bB1mpBfSnrK7AOsaII,5119
88
88
  managed_deepagents/_memory/selected_skills.py,sha256=4h9H-yNRom7ThK1mtYKozaUh99Nuh0IPSSa2VKpNOPU,19465
@@ -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.4.dev1.dist-info/licenses/LICENSE,sha256=WnPZQQ608ojZUkXl7BW6VbKloIAibZiGm1K6cjeZOL8,1066
107
- managed_deepagents-0.9.4.dev1.dist-info/METADATA,sha256=kStye26tkepEQvDRja1o94uchJ2321wu3EGUhiZQudI,34810
108
- managed_deepagents-0.9.4.dev1.dist-info/WHEEL,sha256=3I5VVWZdsFlU417aCS2bMRuerS8wsfvBq99MyatBV3A,97
109
- managed_deepagents-0.9.4.dev1.dist-info/entry_points.txt,sha256=ziZqkKuaDO3qHCjKmBhrx9cm3ok8bZ9xcEDpUTj4unM,53
110
- managed_deepagents-0.9.4.dev1.dist-info/top_level.txt,sha256=fdBo4O0Hlol_w022tTLB5ftZpamb4yJoQ3MUvjgTGfA,19
111
- managed_deepagents-0.9.4.dev1.dist-info/RECORD,,
106
+ managed_deepagents-0.9.4.dev3.dist-info/licenses/LICENSE,sha256=WnPZQQ608ojZUkXl7BW6VbKloIAibZiGm1K6cjeZOL8,1066
107
+ managed_deepagents-0.9.4.dev3.dist-info/METADATA,sha256=9BUYQCrvOXW13AAwl1WmYsCOm3VnzxvlejzpXC0ClRo,34816
108
+ managed_deepagents-0.9.4.dev3.dist-info/WHEEL,sha256=3I5VVWZdsFlU417aCS2bMRuerS8wsfvBq99MyatBV3A,97
109
+ managed_deepagents-0.9.4.dev3.dist-info/entry_points.txt,sha256=ziZqkKuaDO3qHCjKmBhrx9cm3ok8bZ9xcEDpUTj4unM,53
110
+ managed_deepagents-0.9.4.dev3.dist-info/top_level.txt,sha256=fdBo4O0Hlol_w022tTLB5ftZpamb4yJoQ3MUvjgTGfA,19
111
+ managed_deepagents-0.9.4.dev3.dist-info/RECORD,,