agentenv-vfs 0.4.2__tar.gz

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.
Files changed (49) hide show
  1. agentenv_vfs-0.4.2/.github/workflows/image.yml +44 -0
  2. agentenv_vfs-0.4.2/.github/workflows/publish.yml +26 -0
  3. agentenv_vfs-0.4.2/.github/workflows/test.yml +18 -0
  4. agentenv_vfs-0.4.2/.gitignore +6 -0
  5. agentenv_vfs-0.4.2/LICENSE +202 -0
  6. agentenv_vfs-0.4.2/NOTICE +30 -0
  7. agentenv_vfs-0.4.2/PKG-INFO +155 -0
  8. agentenv_vfs-0.4.2/README.md +140 -0
  9. agentenv_vfs-0.4.2/examples/notes/artifacts/notes-check/artifact.toml +1 -0
  10. agentenv_vfs-0.4.2/examples/notes/artifacts/notes-check/check.py +15 -0
  11. agentenv_vfs-0.4.2/examples/notes/envs/notes/Dockerfile +6 -0
  12. agentenv_vfs-0.4.2/examples/notes/envs/notes/env.toml +3 -0
  13. agentenv_vfs-0.4.2/examples/notes/envs/notes/server.py +46 -0
  14. agentenv_vfs-0.4.2/examples/notes/tasks/notes.json +9 -0
  15. agentenv_vfs-0.4.2/examples/notes-and-contacts/artifacts/contacts-check/artifact.toml +1 -0
  16. agentenv_vfs-0.4.2/examples/notes-and-contacts/artifacts/contacts-check/check.py +14 -0
  17. agentenv_vfs-0.4.2/examples/notes-and-contacts/artifacts/notes-check/artifact.toml +1 -0
  18. agentenv_vfs-0.4.2/examples/notes-and-contacts/artifacts/notes-check/check.py +14 -0
  19. agentenv_vfs-0.4.2/examples/notes-and-contacts/envs/contacts/Dockerfile +6 -0
  20. agentenv_vfs-0.4.2/examples/notes-and-contacts/envs/contacts/env.toml +3 -0
  21. agentenv_vfs-0.4.2/examples/notes-and-contacts/envs/contacts/server.py +37 -0
  22. agentenv_vfs-0.4.2/examples/notes-and-contacts/envs/notes/Dockerfile +6 -0
  23. agentenv_vfs-0.4.2/examples/notes-and-contacts/envs/notes/env.toml +3 -0
  24. agentenv_vfs-0.4.2/examples/notes-and-contacts/envs/notes/server.py +46 -0
  25. agentenv_vfs-0.4.2/examples/notes-and-contacts/tasks/notes-and-contacts.json +12 -0
  26. agentenv_vfs-0.4.2/pyproject.toml +30 -0
  27. agentenv_vfs-0.4.2/src/agentenv_vfs/__init__.py +1 -0
  28. agentenv_vfs-0.4.2/src/agentenv_vfs/calls/artifact.toml +1 -0
  29. agentenv_vfs-0.4.2/src/agentenv_vfs/calls/calls.py +25 -0
  30. agentenv_vfs-0.4.2/src/agentenv_vfs/cli.py +46 -0
  31. agentenv_vfs-0.4.2/src/agentenv_vfs/env.py +72 -0
  32. agentenv_vfs-0.4.2/src/agentenv_vfs/server/.dockerignore +3 -0
  33. agentenv_vfs-0.4.2/src/agentenv_vfs/server/Dockerfile +14 -0
  34. agentenv_vfs-0.4.2/src/agentenv_vfs/server/cli.ts +219 -0
  35. agentenv_vfs-0.4.2/src/agentenv_vfs/server/listing.py +31 -0
  36. agentenv_vfs-0.4.2/src/agentenv_vfs/server/package-lock.json +2789 -0
  37. agentenv_vfs-0.4.2/src/agentenv_vfs/server/package.json +11 -0
  38. agentenv_vfs-0.4.2/src/agentenv_vfs/server/preload.ts +49 -0
  39. agentenv_vfs-0.4.2/src/agentenv_vfs/server/server.py +417 -0
  40. agentenv_vfs-0.4.2/src/agentenv_vfs/wrap.py +238 -0
  41. agentenv_vfs-0.4.2/tests/integration/Dockerfile.fake +4 -0
  42. agentenv_vfs-0.4.2/tests/integration/drive.py +47 -0
  43. agentenv_vfs-0.4.2/tests/integration/drive_multi.py +39 -0
  44. agentenv_vfs-0.4.2/tests/integration/drive_norole.py +16 -0
  45. agentenv_vfs-0.4.2/tests/integration/fake_env.py +58 -0
  46. agentenv_vfs-0.4.2/tests/integration/run.sh +26 -0
  47. agentenv_vfs-0.4.2/tests/test_env.py +22 -0
  48. agentenv_vfs-0.4.2/tests/test_listing.py +21 -0
  49. agentenv_vfs-0.4.2/tests/test_wrap.py +224 -0
@@ -0,0 +1,44 @@
1
+ name: image
2
+ # The agentvfs server image, public at ghcr.io/<owner>/agentenv-vfs: :main and :sha-<commit> from main, and
3
+ # :<version> from a v<version> tag, the tag `agent-env vfs wrap` of that version points bundles at.
4
+ on:
5
+ push:
6
+ branches: [main]
7
+ tags: ["v*"]
8
+ permissions:
9
+ contents: read
10
+ packages: write
11
+ jobs:
12
+ image:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+ - name: The tag is the package's version
17
+ if: startsWith(github.ref, 'refs/tags/v')
18
+ run: test "${GITHUB_REF_NAME#v}" = "$(sed -n 's/^version = "\(.*\)"/\1/p' pyproject.toml)"
19
+ - uses: docker/setup-qemu-action@v3
20
+ - uses: docker/setup-buildx-action@v3
21
+ - uses: docker/login-action@v3
22
+ with:
23
+ registry: ghcr.io
24
+ username: ${{ github.actor }}
25
+ password: ${{ secrets.GITHUB_TOKEN }}
26
+ - id: meta
27
+ uses: docker/metadata-action@v5
28
+ with:
29
+ images: ghcr.io/${{ github.repository_owner }}/agentenv-vfs
30
+ tags: |
31
+ type=ref,event=branch
32
+ type=sha,prefix=sha-
33
+ type=semver,pattern={{version}}
34
+ labels: |
35
+ org.opencontainers.image.description=agentenv-vfs server: an agent-env env's MCP tools as shell commands in a Mirage workspace
36
+ - uses: docker/build-push-action@v6
37
+ with:
38
+ context: src/agentenv_vfs/server
39
+ platforms: linux/amd64,linux/arm64
40
+ push: true
41
+ tags: ${{ steps.meta.outputs.tags }}
42
+ labels: ${{ steps.meta.outputs.labels }}
43
+ cache-from: type=gha
44
+ cache-to: type=gha,mode=max
@@ -0,0 +1,26 @@
1
+ name: publish
2
+ # The package on PyPI (pypi.org/project/agentenv-vfs) from a v<version> tag, through PyPI trusted publishing: PyPI
3
+ # trusts this workflow in the `pypi` environment, so no token is stored anywhere.
4
+ on:
5
+ push:
6
+ tags: ["v*"]
7
+ jobs:
8
+ pypi:
9
+ runs-on: ubuntu-latest
10
+ environment: pypi
11
+ permissions:
12
+ contents: read
13
+ id-token: write
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+ - uses: astral-sh/setup-uv@v6
17
+ - name: The tag is the package's version
18
+ run: test "${GITHUB_REF_NAME#v}" = "$(sed -n 's/^version = "\(.*\)"/\1/p' pyproject.toml)"
19
+ - name: Unit tests
20
+ run: |
21
+ uv venv --python 3.12
22
+ uv pip install -e . 'agentenv-framework>=0.9.1637' pytest
23
+ .venv/bin/python -m pytest -q tests
24
+ - name: Build
25
+ run: uv build
26
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,18 @@
1
+ name: test
2
+ on:
3
+ push:
4
+ pull_request:
5
+ jobs:
6
+ test:
7
+ runs-on: ubuntu-latest
8
+ steps:
9
+ - uses: actions/checkout@v4
10
+ - uses: astral-sh/setup-uv@v6
11
+ - name: Install
12
+ run: |
13
+ uv venv --python 3.12
14
+ uv pip install -e . 'agentenv-framework>=0.9.1637' pytest
15
+ - name: Unit tests
16
+ run: .venv/bin/python -m pytest -q tests
17
+ - name: Integration test (the server image against a plain MCP server)
18
+ run: PATH=$PWD/.venv/bin:$PATH tests/integration/run.sh
@@ -0,0 +1,6 @@
1
+ __pycache__/
2
+ *.egg-info/
3
+ .venv/
4
+ dist/
5
+ node_modules/
6
+ .pytest_cache/
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright 2026 Scale AI
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,30 @@
1
+ agentenv-vfs
2
+
3
+ This product includes software adapted from agentvfs/vfs-bench (https://github.com/agentvfs/vfs-bench):
4
+ src/agentenv_vfs/server/cli.ts, preload.ts and server.py adapt its workspace/cli.ts, workspace/preload.ts,
5
+ workspace/tools.ts and formats/agentenv server. Its license:
6
+
7
+ MIT License
8
+
9
+ Copyright (c) 2026 Strukto.AI
10
+
11
+ Permission is hereby granted, free of charge, to any person obtaining a copy
12
+ of this software and associated documentation files (the "Software"), to deal
13
+ in the Software without restriction, including without limitation the rights
14
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
+ copies of the Software, and to permit persons to whom the Software is
16
+ furnished to do so, subject to the following conditions:
17
+
18
+ The above copyright notice and this permission notice shall be included in all
19
+ copies or substantial portions of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ SOFTWARE.
28
+
29
+ The agentvfs server image installs Mirage (https://github.com/strukto-ai/mirage), Apache-2.0, from npm
30
+ (@struktoai/mirage-server, @struktoai/mirage-core, @struktoai/mirage-node).
@@ -0,0 +1,155 @@
1
+ Metadata-Version: 2.5
2
+ Name: agentenv-vfs
3
+ Version: 0.4.2
4
+ Summary: agent-env plugin: any env's MCP tools as shell commands in a Mirage workspace (agentvfs)
5
+ Project-URL: Homepage, https://github.com/earakely-scale/agentenv-vfs
6
+ Project-URL: Issues, https://github.com/earakely-scale/agentenv-vfs/issues
7
+ License-Expression: Apache-2.0
8
+ License-File: LICENSE
9
+ License-File: NOTICE
10
+ Keywords: agent-env,agents,agentvfs,mcp,mirage
11
+ Requires-Python: >=3.12
12
+ Requires-Dist: agentenv-framework>=0.9.1637
13
+ Requires-Dist: click>=8
14
+ Description-Content-Type: text/markdown
15
+
16
+ # agentenv-vfs
17
+
18
+ [![tests](https://github.com/earakely-scale/agentenv-vfs/actions/workflows/test.yml/badge.svg)](https://github.com/earakely-scale/agentenv-vfs/actions/workflows/test.yml)
19
+
20
+ An [agent-env](https://pypi.org/project/agentenv-framework/) plugin that gives an agent any env's tools through
21
+ [agentvfs](https://github.com/agentvfs/vfs-bench): a shell in a [Mirage](https://github.com/strukto-ai/mirage)
22
+ workspace, where each of the env's MCP tools is a command of the same name, instead of MCP tool calls.
23
+
24
+ ```
25
+ $ add_note --title "Budget sync" --body "Q3 budget is flat" --tags finance
26
+ {"id": 2, "title": "Budget sync", ...}
27
+ $ list_notes | jq -r '.[] | select(.tags | index("finance")) | .title'
28
+ Budget sync
29
+ ```
30
+
31
+ It works with any env that serves MCP tools, a plain MCP server or a gateway env, and needs no change to the env, its
32
+ tasks' other steps or agent-env itself.
33
+
34
+ ## Install
35
+
36
+ ```bash
37
+ uv tool install --python 3.12 agentenv-framework --with agentenv-vfs
38
+ agent-env vfs --help
39
+ ```
40
+
41
+ Or `pip install agentenv-vfs` into an environment of your own, which brings agent-env with it. Pin a release with
42
+ `agentenv-vfs==<version>`: `wrap` points bundles at the server image of the same version.
43
+
44
+ You need Docker, as for any local agent-env run.
45
+
46
+ ## Use it on a bundle
47
+
48
+ ```bash
49
+ agent-env vfs wrap my-bundle --out my-bundle-vfs
50
+ agent-env run my-bundle-vfs
51
+ ```
52
+
53
+ `wrap` copies the bundle and, in each task, puts an `agentvfs` env in front of the agent's envs:
54
+
55
+ - a `deploy_env` of `agentvfs` names the envs it fronts (`env_params.env`, one id or a list) and the agent's role, and
56
+ waits for those envs, for every tool lock on the role, and for whatever the agent's own deploy waits for;
57
+ - the agent's `env_ids` become `["agentvfs"]`, and its built-in tools go off (`builtin_tools: {"disable": "*"}`);
58
+ - the agent's instructions gain one paragraph on working through commands (`--no-note` leaves them as they are).
59
+
60
+ After the steps that send the agent work, a step copies the agentvfs env's log of the agent's shell lines and the tool
61
+ calls each made into the run's record, as `script_results.agentvfs_calls` (`--no-call-log` leaves it out). Every other
62
+ step (other agents, judges, verifiers) is kept as it is. Keep the agent's built-in tools with `--keep-builtins` (see
63
+ [Agents](#agents) for which agents can have them turned off).
64
+
65
+ ### Choosing the agents
66
+
67
+ The agent to wrap is the one the tasks prompt. Name others with `--agent`, by their `agent_name`, once per agent:
68
+
69
+ ```bash
70
+ agent-env vfs wrap my-bundle --out my-bundle-vfs --agent judge --agent judge-b # only the judges work through agentvfs
71
+ ```
72
+
73
+ Any agent a `deploy_agent` deploys can be wrapped, whatever sends it work:
74
+
75
+ | The agent | Its paragraph goes in | Its log is copied |
76
+ |---|---|---|
77
+ | prompted by `prompt_agent` steps | their `system_prompt` | after its prompts |
78
+ | a judge for verifier steps | their `grading_policy_prompt` (a configured system prompt would replace the agent's own) | after those verifiers |
79
+ | sent work some other way, such as by an env's triggers | its `deploy_agent` `system_prompt`, if it has one | at the end of the run |
80
+
81
+ Each wrapped agent gets its own agentvfs env, so two agents of one role (two judges, say) don't share a workspace.
82
+ With one agent wrapped its env is `agentvfs` and its log `agentvfs_calls`; with several, each agent's env is
83
+ `agentvfs-<agent>` and its log `agentvfs_calls_<agent>`.
84
+
85
+ To wire tasks yourself, add the env with `agent-env vfs add-env my-bundle` and deploy it after the env it fronts:
86
+
87
+ ```json
88
+ {"id": "vfs", "type": "deploy_env", "env_id": "agentvfs", "env_params": {"env": "notes", "role": "alice"},
89
+ "depends_on": ["env"]},
90
+ {"id": "agent", "type": "deploy_agent", "env_ids": ["agentvfs"], "builtin_tools": {"disable": "*"},
91
+ "depends_on": ["vfs"]}
92
+ ```
93
+
94
+ [`examples/notes`](examples/notes) is a small bundle to try it on: a notes env, a task, and a check that reads the
95
+ notes back. [`examples/notes-and-contacts`](examples/notes-and-contacts) gives one agent two envs, which `wrap` fronts
96
+ from one workspace.
97
+
98
+ ## Agents
99
+
100
+ It works with any agent-env agent: agentvfs is an env, and the agent reaches it over MCP as it reaches any env. Pass
101
+ `wrap --for-agent NAME` when you run with `agent-env run --agent NAME`, so the bundle fits that agent:
102
+
103
+ | Agent | Built-in tools | Checked with |
104
+ |---|---|---|
105
+ | claude-code (the default), codex, opencode, antigravity (agent-env 0.9.1650+) | turned off: the shell is the agent's only tool | the notes example; claude-code and codex on a gateway env's tasks too |
106
+ | gemini, hermes, letta-code, openhands, pi | kept: agent-env can't turn them off | the notes example; gemini on a gateway env's task too |
107
+ | pydantic-ai | kept | not yet: its own coding tools include one named `shell`, which agent-env adds MCP tools beside without a prefix |
108
+
109
+ ## How it works
110
+
111
+ - **One tool.** The agent's only tool is `shell`, a bash line in its role's workspace. `/SKILL.md` lists the commands,
112
+ `<command> --help` shows one, and `/workspace` and `/tmp` are its own. `python3` is CPython in Pyodide, inside the
113
+ workspace: its standard library, the workspace's files and commands, no network. `curl` and `wget` are refused: the
114
+ env is reached through its commands.
115
+ - **Commands are the envs' tools.** One workspace serves the tools of every env it fronts, each call going to the env
116
+ that serves its tool; two envs that serve a tool of the same name are refused. Each tool is a command named as the
117
+ tool is, each parameter a flag of the same name
118
+ (`--channel_id`, or `--channel-id`); a list or an object is one JSON value. The `shell` tool's description lists every
119
+ command for the role named at deploy, so the agent sees them up front, as it would see MCP tools.
120
+ - **Calls go to the env as the agent.** A command's call goes to the fronted env's MCP endpoint with the agent's
121
+ `AgentEnv-Role`, which the agent sends with every call. So the env sees the calls an MCP agent of that role would
122
+ make: its tool locks, triggers and logs all apply, and each role gets its own workspace.
123
+ - **What a run keeps.** The env logs every shell line and every tool call a line makes (role, tool, arguments,
124
+ outcome, timing), in order. `data/get` of `calls.jsonl` returns it, and the step `wrap` adds copies it into the run.
125
+ - **Where it runs.** The env is an MCP server env. Its image (Python, Node 24, Mirage's npm packages and Pyodide) is
126
+ published at `ghcr.io/earakely-scale/agentenv-vfs`, tagged with the plugin's version, for linux/amd64 and
127
+ linux/arm64. A wrapped bundle pulls it, and keeps its build context in `envs/agentvfs`, which a deploy builds only
128
+ where it can't pull the image (`--build` always builds it). The env reaches the fronted env at the address
129
+ agent-env gives for its sandbox. Checked locally (Docker) and on Modal (`agent-env run --sandbox modal`), where the
130
+ image is pulled and the fronted envs are reached over their Modal tunnels.
131
+
132
+ ## Not covered yet
133
+
134
+ - Python packages beyond the standard library (Pyodide fetches them from the network, which the workspace refuses).
135
+ - Mounting an env's data as files: reads are commands, as writes are.
136
+ - Waiting for the world: a shell-only agent waits with `sleep`.
137
+ - Remote sandbox providers other than Modal have not been tried.
138
+
139
+ ## Development
140
+
141
+ ```bash
142
+ uv venv && uv pip install -e . 'agentenv-framework>=0.9.1637' pytest
143
+ .venv/bin/python -m pytest tests # unit tests
144
+ PATH=.venv/bin:$PATH tests/integration/run.sh # the server image against a plain MCP server (Docker)
145
+ ```
146
+
147
+ ## Releasing
148
+
149
+ Set `version` in `pyproject.toml`, push to `main`, then tag `v<version>` and push the tag. The `image` workflow
150
+ publishes `ghcr.io/earakely-scale/agentenv-vfs:<version>`, which `wrap` of that version points bundles at, and the
151
+ `publish` workflow publishes the package to PyPI through trusted publishing (no token).
152
+
153
+ ## License
154
+
155
+ Apache-2.0. Parts are adapted from agentvfs/vfs-bench (MIT); see [NOTICE](NOTICE).
@@ -0,0 +1,140 @@
1
+ # agentenv-vfs
2
+
3
+ [![tests](https://github.com/earakely-scale/agentenv-vfs/actions/workflows/test.yml/badge.svg)](https://github.com/earakely-scale/agentenv-vfs/actions/workflows/test.yml)
4
+
5
+ An [agent-env](https://pypi.org/project/agentenv-framework/) plugin that gives an agent any env's tools through
6
+ [agentvfs](https://github.com/agentvfs/vfs-bench): a shell in a [Mirage](https://github.com/strukto-ai/mirage)
7
+ workspace, where each of the env's MCP tools is a command of the same name, instead of MCP tool calls.
8
+
9
+ ```
10
+ $ add_note --title "Budget sync" --body "Q3 budget is flat" --tags finance
11
+ {"id": 2, "title": "Budget sync", ...}
12
+ $ list_notes | jq -r '.[] | select(.tags | index("finance")) | .title'
13
+ Budget sync
14
+ ```
15
+
16
+ It works with any env that serves MCP tools, a plain MCP server or a gateway env, and needs no change to the env, its
17
+ tasks' other steps or agent-env itself.
18
+
19
+ ## Install
20
+
21
+ ```bash
22
+ uv tool install --python 3.12 agentenv-framework --with agentenv-vfs
23
+ agent-env vfs --help
24
+ ```
25
+
26
+ Or `pip install agentenv-vfs` into an environment of your own, which brings agent-env with it. Pin a release with
27
+ `agentenv-vfs==<version>`: `wrap` points bundles at the server image of the same version.
28
+
29
+ You need Docker, as for any local agent-env run.
30
+
31
+ ## Use it on a bundle
32
+
33
+ ```bash
34
+ agent-env vfs wrap my-bundle --out my-bundle-vfs
35
+ agent-env run my-bundle-vfs
36
+ ```
37
+
38
+ `wrap` copies the bundle and, in each task, puts an `agentvfs` env in front of the agent's envs:
39
+
40
+ - a `deploy_env` of `agentvfs` names the envs it fronts (`env_params.env`, one id or a list) and the agent's role, and
41
+ waits for those envs, for every tool lock on the role, and for whatever the agent's own deploy waits for;
42
+ - the agent's `env_ids` become `["agentvfs"]`, and its built-in tools go off (`builtin_tools: {"disable": "*"}`);
43
+ - the agent's instructions gain one paragraph on working through commands (`--no-note` leaves them as they are).
44
+
45
+ After the steps that send the agent work, a step copies the agentvfs env's log of the agent's shell lines and the tool
46
+ calls each made into the run's record, as `script_results.agentvfs_calls` (`--no-call-log` leaves it out). Every other
47
+ step (other agents, judges, verifiers) is kept as it is. Keep the agent's built-in tools with `--keep-builtins` (see
48
+ [Agents](#agents) for which agents can have them turned off).
49
+
50
+ ### Choosing the agents
51
+
52
+ The agent to wrap is the one the tasks prompt. Name others with `--agent`, by their `agent_name`, once per agent:
53
+
54
+ ```bash
55
+ agent-env vfs wrap my-bundle --out my-bundle-vfs --agent judge --agent judge-b # only the judges work through agentvfs
56
+ ```
57
+
58
+ Any agent a `deploy_agent` deploys can be wrapped, whatever sends it work:
59
+
60
+ | The agent | Its paragraph goes in | Its log is copied |
61
+ |---|---|---|
62
+ | prompted by `prompt_agent` steps | their `system_prompt` | after its prompts |
63
+ | a judge for verifier steps | their `grading_policy_prompt` (a configured system prompt would replace the agent's own) | after those verifiers |
64
+ | sent work some other way, such as by an env's triggers | its `deploy_agent` `system_prompt`, if it has one | at the end of the run |
65
+
66
+ Each wrapped agent gets its own agentvfs env, so two agents of one role (two judges, say) don't share a workspace.
67
+ With one agent wrapped its env is `agentvfs` and its log `agentvfs_calls`; with several, each agent's env is
68
+ `agentvfs-<agent>` and its log `agentvfs_calls_<agent>`.
69
+
70
+ To wire tasks yourself, add the env with `agent-env vfs add-env my-bundle` and deploy it after the env it fronts:
71
+
72
+ ```json
73
+ {"id": "vfs", "type": "deploy_env", "env_id": "agentvfs", "env_params": {"env": "notes", "role": "alice"},
74
+ "depends_on": ["env"]},
75
+ {"id": "agent", "type": "deploy_agent", "env_ids": ["agentvfs"], "builtin_tools": {"disable": "*"},
76
+ "depends_on": ["vfs"]}
77
+ ```
78
+
79
+ [`examples/notes`](examples/notes) is a small bundle to try it on: a notes env, a task, and a check that reads the
80
+ notes back. [`examples/notes-and-contacts`](examples/notes-and-contacts) gives one agent two envs, which `wrap` fronts
81
+ from one workspace.
82
+
83
+ ## Agents
84
+
85
+ It works with any agent-env agent: agentvfs is an env, and the agent reaches it over MCP as it reaches any env. Pass
86
+ `wrap --for-agent NAME` when you run with `agent-env run --agent NAME`, so the bundle fits that agent:
87
+
88
+ | Agent | Built-in tools | Checked with |
89
+ |---|---|---|
90
+ | claude-code (the default), codex, opencode, antigravity (agent-env 0.9.1650+) | turned off: the shell is the agent's only tool | the notes example; claude-code and codex on a gateway env's tasks too |
91
+ | gemini, hermes, letta-code, openhands, pi | kept: agent-env can't turn them off | the notes example; gemini on a gateway env's task too |
92
+ | pydantic-ai | kept | not yet: its own coding tools include one named `shell`, which agent-env adds MCP tools beside without a prefix |
93
+
94
+ ## How it works
95
+
96
+ - **One tool.** The agent's only tool is `shell`, a bash line in its role's workspace. `/SKILL.md` lists the commands,
97
+ `<command> --help` shows one, and `/workspace` and `/tmp` are its own. `python3` is CPython in Pyodide, inside the
98
+ workspace: its standard library, the workspace's files and commands, no network. `curl` and `wget` are refused: the
99
+ env is reached through its commands.
100
+ - **Commands are the envs' tools.** One workspace serves the tools of every env it fronts, each call going to the env
101
+ that serves its tool; two envs that serve a tool of the same name are refused. Each tool is a command named as the
102
+ tool is, each parameter a flag of the same name
103
+ (`--channel_id`, or `--channel-id`); a list or an object is one JSON value. The `shell` tool's description lists every
104
+ command for the role named at deploy, so the agent sees them up front, as it would see MCP tools.
105
+ - **Calls go to the env as the agent.** A command's call goes to the fronted env's MCP endpoint with the agent's
106
+ `AgentEnv-Role`, which the agent sends with every call. So the env sees the calls an MCP agent of that role would
107
+ make: its tool locks, triggers and logs all apply, and each role gets its own workspace.
108
+ - **What a run keeps.** The env logs every shell line and every tool call a line makes (role, tool, arguments,
109
+ outcome, timing), in order. `data/get` of `calls.jsonl` returns it, and the step `wrap` adds copies it into the run.
110
+ - **Where it runs.** The env is an MCP server env. Its image (Python, Node 24, Mirage's npm packages and Pyodide) is
111
+ published at `ghcr.io/earakely-scale/agentenv-vfs`, tagged with the plugin's version, for linux/amd64 and
112
+ linux/arm64. A wrapped bundle pulls it, and keeps its build context in `envs/agentvfs`, which a deploy builds only
113
+ where it can't pull the image (`--build` always builds it). The env reaches the fronted env at the address
114
+ agent-env gives for its sandbox. Checked locally (Docker) and on Modal (`agent-env run --sandbox modal`), where the
115
+ image is pulled and the fronted envs are reached over their Modal tunnels.
116
+
117
+ ## Not covered yet
118
+
119
+ - Python packages beyond the standard library (Pyodide fetches them from the network, which the workspace refuses).
120
+ - Mounting an env's data as files: reads are commands, as writes are.
121
+ - Waiting for the world: a shell-only agent waits with `sleep`.
122
+ - Remote sandbox providers other than Modal have not been tried.
123
+
124
+ ## Development
125
+
126
+ ```bash
127
+ uv venv && uv pip install -e . 'agentenv-framework>=0.9.1637' pytest
128
+ .venv/bin/python -m pytest tests # unit tests
129
+ PATH=.venv/bin:$PATH tests/integration/run.sh # the server image against a plain MCP server (Docker)
130
+ ```
131
+
132
+ ## Releasing
133
+
134
+ Set `version` in `pyproject.toml`, push to `main`, then tag `v<version>` and push the tag. The `image` workflow
135
+ publishes `ghcr.io/earakely-scale/agentenv-vfs:<version>`, which `wrap` of that version points bundles at, and the
136
+ `publish` workflow publishes the package to PyPI through trusted publishing (no token).
137
+
138
+ ## License
139
+
140
+ Apache-2.0. Parts are adapted from agentvfs/vfs-bench (MIT); see [NOTICE](NOTICE).
@@ -0,0 +1 @@
1
+ type = "file_artifact_universe"
@@ -0,0 +1,15 @@
1
+ """Read the notes env's notes back (data/get) and check the task's three notes are there, tagged."""
2
+ import json
3
+ import urllib.request
4
+
5
+
6
+ def run(input):
7
+ env = input["env"]
8
+ body = json.dumps({"jsonrpc": "2.0", "id": 1, "method": "data/get", "params": {}}).encode()
9
+ req = urllib.request.Request(f"{env['url'].rstrip('/')}/agentenv", data=body, method="POST",
10
+ headers={"Content-Type": "application/json", **(env.get("headers") or {})})
11
+ with urllib.request.urlopen(req, timeout=60) as r:
12
+ notes = next(p["data"] for p in json.loads(r.read())["result"]["parts"] if p.get("kind") == "data")["notes"]
13
+ want = {"Design review": "design", "Budget sync": "finance", "Hiring loop": "people"}
14
+ found = {t: any(n["title"] == t and tag in n["tags"] for n in notes) for t, tag in want.items()}
15
+ return {"notes": len(notes), "found": found, "score": sum(found.values()) / len(found)}
@@ -0,0 +1,6 @@
1
+ FROM python:3.12-slim
2
+ RUN pip install --no-cache-dir 'agentenv-framework-protocol[agent]>=0.1.652,<0.2'
3
+ COPY server.py /opt/notes/server.py
4
+ ENV MCP_PORT=18765
5
+ EXPOSE 18765
6
+ CMD ["python", "/opt/notes/server.py"]
@@ -0,0 +1,3 @@
1
+ environment_name = "notes"
2
+ env_provider_type = "server"
3
+ image = { dockerfile = "Dockerfile" }