@struktoai/mirage-agents 0.0.7-alpha.2 → 0.0.7-alpha.3

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 (47) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +28 -29
  3. package/dist/{chunk-S6DWWJVF.js → chunk-KGSDRNVH.js} +7 -4
  4. package/dist/chunk-KGSDRNVH.js.map +1 -0
  5. package/dist/claude-agent-sdk/index.d.ts +11 -4
  6. package/dist/claude-agent-sdk/index.js +103 -41
  7. package/dist/claude-agent-sdk/index.js.map +1 -1
  8. package/dist/claude-managed-agents/index.d.ts +16 -0
  9. package/dist/claude-managed-agents/index.js +152 -0
  10. package/dist/claude-managed-agents/index.js.map +1 -0
  11. package/dist/langchain/index.d.ts +10 -1
  12. package/dist/langchain/index.js +35 -35
  13. package/dist/langchain/index.js.map +1 -1
  14. package/dist/mastra/index.d.ts +16 -47
  15. package/dist/mastra/index.js +45 -143
  16. package/dist/mastra/index.js.map +1 -1
  17. package/dist/openai_agents/index.d.ts +123 -0
  18. package/dist/openai_agents/index.js +577 -0
  19. package/dist/openai_agents/index.js.map +1 -0
  20. package/dist/opencode/index.d.ts +6 -2
  21. package/dist/opencode/index.js +30 -39
  22. package/dist/opencode/index.js.map +1 -1
  23. package/dist/pi/index.d.ts +7 -2
  24. package/dist/pi/index.js +42 -45
  25. package/dist/pi/index.js.map +1 -1
  26. package/dist/{prompt-CgKmMkVe.d.ts → prompt-J_K4KNBn.d.ts} +3 -2
  27. package/dist/vercel/index.d.ts +10 -1
  28. package/dist/vercel/index.js +60 -136
  29. package/dist/vercel/index.js.map +1 -1
  30. package/package.json +29 -19
  31. package/dist/chunk-3N5GLSL7.js +0 -33
  32. package/dist/chunk-3N5GLSL7.js.map +0 -1
  33. package/dist/chunk-DIUKTEAK.js +0 -143
  34. package/dist/chunk-DIUKTEAK.js.map +0 -1
  35. package/dist/chunk-IAXHKKR2.js +0 -130
  36. package/dist/chunk-IAXHKKR2.js.map +0 -1
  37. package/dist/chunk-S6DWWJVF.js.map +0 -1
  38. package/dist/chunk-YJS2FVEB.js +0 -97
  39. package/dist/chunk-YJS2FVEB.js.map +0 -1
  40. package/dist/file-version-CE2J_nkn.d.ts +0 -23
  41. package/dist/mcp/index.d.ts +0 -14
  42. package/dist/mcp/index.js +0 -101
  43. package/dist/mcp/index.js.map +0 -1
  44. package/dist/openai/index.d.ts +0 -36
  45. package/dist/openai/index.js +0 -165
  46. package/dist/openai/index.js.map +0 -1
  47. package/dist/tool-descriptions-C6xBOUjO.d.ts +0 -33
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 @ Strukto.AI
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md CHANGED
@@ -54,24 +54,24 @@ Here is an example of launching Mirage inside an application:
54
54
  ```python
55
55
  ws = Workspace(
56
56
  {
57
- "/tmp": (RAMResource(), MountMode.EXEC),
58
- "/redis": (RedisResource(url=redis_url), MountMode.WRITE),
59
- "/slack": (SlackResource(SlackConfig(token=slack_bot_token)), MountMode.EXEC),
57
+ "/tmp": (RAMVFS(), MountMode.EXEC),
58
+ "/redis": (RedisVFS(url=redis_url), MountMode.WRITE),
59
+ "/slack": (SlackVFS(SlackConfig(token=slack_bot_token)), MountMode.EXEC),
60
60
  },
61
61
  # monty captures python, so scripts run sandboxed inside the workspace
62
- runtimes=[MontyRuntime(captures=["python", "python3"]), "vfs"],
62
+ runtimes=[MontyRuntime(captures=["python", "python3"]), "workspace"],
63
63
  )
64
64
 
65
65
  # one grep sweeps every source
66
- await ws.execute("grep -rln session /redis /tmp")
66
+ await ws.shell("grep -rln session /redis /tmp")
67
67
 
68
68
  # run a script that lives in Slack, file the report into Redis
69
- await ws.execute("python3 /slack/channels/general_.../files/example__F....py > /redis/report.txt")
69
+ await ws.shell("python3 /slack/channels/general_.../files/example__F....py > /redis/report.txt")
70
70
 
71
71
  # install a typed CLI under a head word: dispatched by name, not by path,
72
72
  # and discoverable through `man`, `type` and `which` like any other program
73
73
  ws.register_cli("slack", SLACK, {"token": slack_bot_token})
74
- await ws.execute('slack send-message --channel general --text "report is up"')
74
+ await ws.shell('slack send-message --channel general --text "report is up"')
75
75
  ```
76
76
 
77
77
  ## About
@@ -90,7 +90,7 @@ await ws.execute('slack send-message --channel general --text "report is up"')
90
90
  Everything [Mirage](https://www.strukto.ai/mirage) "mounts" as one unified virtual filesystem for AI agents. Each
91
91
  service sits side-by-side under a single root and answers the same POSIX semantics.
92
92
 
93
- | | Resources |
93
+ | | VFS |
94
94
  | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
95
95
  | **Object Storage** | <a href="https://aws.amazon.com/s3/"><img src="https://api.iconify.design/logos/aws-s3.svg" width="20" height="20" alt="Amazon S3" title="Amazon S3" /></a>  <a href="https://developers.cloudflare.com/r2/"><img src="https://cdn.simpleicons.org/cloudflare" width="20" height="20" alt="Cloudflare R2" title="Cloudflare R2" /></a>  <a href="https://cloud.google.com/storage"><img src="https://api.iconify.design/logos/google-cloud.svg" width="25" height="20" alt="Google Cloud Storage" title="Google Cloud Storage" /></a>  <a href="https://www.oracle.com/cloud/storage/"><img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/oracle.svg" width="32" height="20" alt="Oracle OCI" title="Oracle OCI" /></a>  <a href="https://supabase.com/storage"><img src="https://api.iconify.design/logos/supabase-icon.svg" width="19" height="20" alt="Supabase Storage" title="Supabase Storage" /></a>  <a href="https://min.io"><img src="https://cdn.simpleicons.org/minio" width="20" height="20" alt="MinIO" title="MinIO" /></a>  <a href="https://ceph.io/en/discover/technology/"><img src="https://cdn.simpleicons.org/ceph" width="20" height="20" alt="Ceph" title="Ceph" /></a>  <a href="https://github.com/seaweedfs/seaweedfs"><img src="https://raw.githubusercontent.com/strukto-ai/mirage/main/assets/icons/seaweedfs.svg" width="20" height="20" alt="SeaweedFS" title="SeaweedFS" /></a>  <a href="https://wasabi.com/cloud-object-storage"><img src="https://cdn.simpleicons.org/wasabi" width="20" height="20" alt="Wasabi" title="Wasabi" /></a>  <a href="https://www.backblaze.com/cloud-storage"><img src="https://cdn.simpleicons.org/backblaze" width="20" height="20" alt="Backblaze B2" title="Backblaze B2" /></a>  <a href="https://www.digitalocean.com/products/spaces"><img src="https://cdn.simpleicons.org/digitalocean" width="20" height="20" alt="DigitalOcean Spaces" title="DigitalOcean Spaces" /></a>  <a href="https://www.alibabacloud.com/product/oss"><img src="https://cdn.simpleicons.org/alibabacloud" width="20" height="20" alt="Alibaba Cloud OSS" title="Alibaba Cloud OSS" /></a>  <a href="https://www.tencentcloud.com/products/cos"><img src="https://raw.githubusercontent.com/strukto-ai/mirage/main/assets/icons/tencent.png" width="20" height="20" alt="Tencent Cloud COS" title="Tencent Cloud COS" /></a>  <a href="https://www.scaleway.com/en/object-storage/"><img src="https://cdn.simpleicons.org/scaleway" width="20" height="20" alt="Scaleway" title="Scaleway" /></a>  <a href="https://www.qingcloud.com/products/qingstor"><img src="https://raw.githubusercontent.com/strukto-ai/mirage/main/assets/icons/qingstor.png" width="20" height="20" alt="QingStor" title="QingStor" /></a>  <a href="https://huggingface.co/docs/hub/storage-buckets"><img src="https://cdn.simpleicons.org/huggingface" width="20" height="20" alt="Hugging Face Buckets" title="Hugging Face Buckets" /></a>  <a href="https://www.mongodb.com/docs/manual/core/gridfs/"><img src="https://cdn.simpleicons.org/mongodb" width="20" height="20" alt="GridFS" title="GridFS" /></a> |
96
96
  | **Files and Documents** | <a href="https://workspace.google.com/products/drive/"><img src="https://cdn.simpleicons.org/googledrive" width="20" height="20" alt="Google Drive" title="Google Drive" /></a>  <a href="https://docs.google.com"><img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/google-docs.svg" width="14" height="20" alt="Google Docs" title="Google Docs" /></a>  <a href="https://sheets.google.com"><img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/google-sheets.svg" width="15" height="20" alt="Google Sheets" title="Google Sheets" /></a>  <a href="https://slides.google.com"><img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/google-slides.svg" width="15" height="20" alt="Google Slides" title="Google Slides" /></a>  <a href="https://www.microsoft.com/microsoft-365/onedrive/online-cloud-storage"><img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/microsoft-onedrive.svg" width="30" height="20" alt="OneDrive" title="OneDrive" /></a>  <a href="https://www.microsoft.com/microsoft-365/sharepoint/collaboration"><img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/microsoft-sharepoint.svg" width="20" height="20" alt="SharePoint" title="SharePoint" /></a>  <a href="https://www.box.com"><img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/box.svg" width="20" height="20" alt="Box" title="Box" /></a>  <a href="https://www.dropbox.com"><img src="https://cdn.simpleicons.org/dropbox" width="20" height="20" alt="Dropbox" title="Dropbox" /></a>  <a href="https://nextcloud.com/files/"><img src="https://cdn.simpleicons.org/nextcloud" width="20" height="20" alt="Nextcloud" title="Nextcloud" /></a> |
@@ -125,13 +125,13 @@ command on the line can be redirected to a configured runtime, so Python might
125
125
  run in-process with [Monty](https://pydantic.dev/articles/pydantic-monty) while
126
126
  another command, say `kubectl`, is sent to a remote machine over SSH. Which runtime
127
127
  serves a given line can be decided by a
128
- [scripted runtime router](https://docs.mirage.strukto.ai/home/route-policy).
128
+ [scripted runtime router](https://docs.mirage.strukto.ai/home/policy/route-policy).
129
129
 
130
- | | Runtimes |
131
- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
132
- | **Python** | <a href="https://pydantic.dev/articles/pydantic-monty"><img src="https://cdn.simpleicons.org/pydantic" width="20" height="20" alt="Monty" title="Monty" /></a>  <a href="https://wasi.dev"><img src="https://cdn.simpleicons.org/webassembly" width="20" height="20" alt="WASI CPython on wasmtime" title="WASI CPython on wasmtime" /></a>  <a href="https://pyodide.org"><img src="https://raw.githubusercontent.com/strukto-ai/mirage/main/assets/icons/pyodide.svg" width="56" height="20" alt="Pyodide" title="Pyodide" /></a>  <a href="https://pypi.org/project/sandlock/"><img src="https://raw.githubusercontent.com/strukto-ai/mirage/main/docs/images/sandlock-logo.svg" width="20" height="20" alt="sandlock" title="sandlock" /></a>  <a href="https://www.python.org"><img src="https://cdn.simpleicons.org/python" width="20" height="20" alt="Host CPython" title="Host CPython" /></a> |
133
- | **JavaScript** | <a href="https://docs.mirage.strukto.ai/home/setup/runtime/javascript"><img src="https://raw.githubusercontent.com/strukto-ai/mirage/main/assets/icons/quickjs.png" width="20" height="20" alt="QuickJS, serving node and js" title="QuickJS, serving node and js" /></a> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript"><img src="https://cdn.simpleicons.org/javascript" width="20" height="20" alt="JavaScript" title="JavaScript" /></a> <a href="https://www.typescriptlang.org"><img src="https://cdn.simpleicons.org/typescript" width="20" height="20" alt="TypeScript" title="TypeScript" /></a> |
134
- | **Sandboxes** | <a href="https://www.docker.com"><img src="https://cdn.simpleicons.org/docker" width="20" height="20" alt="Docker" title="Docker" /></a>  <a href="https://e2b.dev"><img src="https://raw.githubusercontent.com/strukto-ai/mirage/main/docs/images/e2b-logo.svg" width="20" height="20" alt="E2B" title="E2B" /></a>  <a href="https://www.daytona.io"><img src="https://raw.githubusercontent.com/strukto-ai/mirage/main/docs/images/daytona-logo.svg" width="20" height="20" alt="Daytona" title="Daytona" /></a>  <a href="https://smolmachines.com"><img src="https://raw.githubusercontent.com/strukto-ai/mirage/main/docs/images/smolvm-logo.svg" width="20" height="20" alt="smolVM" title="smolVM" /></a>  <a href="https://en.wikipedia.org/wiki/Secure_Shell"><img src="https://raw.githubusercontent.com/strukto-ai/mirage/main/docs/images/ssh-logo.svg" width="20" height="20" alt="SSH" title="SSH" /></a> |
130
+ | | Runtimes |
131
+ | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
132
+ | **Python** | <a href="https://pydantic.dev/articles/pydantic-monty"><img src="https://cdn.simpleicons.org/pydantic" width="20" height="20" alt="Monty" title="Monty" /></a>  <a href="https://wasi.dev"><img src="https://cdn.simpleicons.org/webassembly" width="20" height="20" alt="WASI CPython on wasmtime" title="WASI CPython on wasmtime" /></a>  <a href="https://pyodide.org"><img src="https://raw.githubusercontent.com/strukto-ai/mirage/main/assets/icons/pyodide.svg" width="56" height="20" alt="Pyodide" title="Pyodide" /></a>  <a href="https://pypi.org/project/sandlock/"><img src="https://raw.githubusercontent.com/strukto-ai/mirage/main/docs/images/sandlock-logo.svg" width="20" height="20" alt="sandlock" title="sandlock" /></a>  <a href="https://www.python.org"><img src="https://cdn.simpleicons.org/python" width="20" height="20" alt="Host CPython" title="Host CPython" /></a> |
133
+ | **JavaScript** | <a href="https://docs.mirage.strukto.ai/home/setup/runtime/javascript"><img src="https://raw.githubusercontent.com/strukto-ai/mirage/main/assets/icons/quickjs.png" width="20" height="20" alt="QuickJS, serving node and js" title="QuickJS, serving node and js" /></a> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript"><img src="https://cdn.simpleicons.org/javascript" width="20" height="20" alt="JavaScript" title="JavaScript" /></a> <a href="https://www.typescriptlang.org"><img src="https://cdn.simpleicons.org/typescript" width="20" height="20" alt="TypeScript" title="TypeScript" /></a> |
134
+ | **Sandboxes** | <a href="https://www.docker.com"><img src="https://cdn.simpleicons.org/docker" width="20" height="20" alt="Docker" title="Docker" /></a>  <a href="https://e2b.dev"><img src="https://raw.githubusercontent.com/strukto-ai/mirage/main/docs/images/e2b-logo.svg" width="20" height="20" alt="E2B" title="E2B" /></a>  <a href="https://www.daytona.io"><img src="https://raw.githubusercontent.com/strukto-ai/mirage/main/docs/images/daytona-logo.svg" width="20" height="20" alt="Daytona" title="Daytona" /></a>  <a href="https://smolmachines.com"><img src="https://raw.githubusercontent.com/strukto-ai/mirage/main/docs/images/smolvm-logo.svg" width="20" height="20" alt="smolVM" title="smolVM" /></a> <a href="https://github.com/apple/container"><img src="https://cdn.simpleicons.org/apple/000000/e6edf3" width="20" height="20" alt="Apple Container" title="Apple Container" /></a>  <a href="https://en.wikipedia.org/wiki/Secure_Shell"><img src="https://raw.githubusercontent.com/strukto-ai/mirage/main/docs/images/ssh-logo.svg" width="20" height="20" alt="SSH" title="SSH" /></a> |
135
135
 
136
136
  ## Security
137
137
 
@@ -141,9 +141,9 @@ hidden file is not merely unreadable but absent from the filesystem the agent se
141
141
  For anything those rules cannot express, a profile can name a policy script that runs
142
142
  at the gate on every command and answers allow, deny or ask itself, though like every
143
143
  rule it can only restrict and never grant. Separately, a host can register its own
144
- policies on the [policy engine](https://docs.mirage.strukto.ai/home/policy-engine), an
144
+ policies on the [policy engine](https://docs.mirage.strukto.ai/home/policy/policies), an
145
145
  ordered stack the workspace consults on every command, VFS op and session write. See
146
- the [permissions docs](https://docs.mirage.strukto.ai/home/permissions).
146
+ the [policy docs](https://docs.mirage.strukto.ai/home/policy/overview).
147
147
 
148
148
  ## Authentication
149
149
 
@@ -195,16 +195,16 @@ npx @struktoai/mirage-cli
195
195
 
196
196
  ```python
197
197
  from mirage import Workspace
198
- from mirage.resource.ram import RAMResource
199
- from mirage.resource.s3 import S3Config, S3Resource
198
+ from mirage.vfs.ram import RAMVFS
199
+ from mirage.vfs.s3 import S3Config, S3VFS
200
200
 
201
201
  ws = Workspace({
202
- "/data": RAMResource(),
203
- "/s3": S3Resource(S3Config(bucket="my-bucket")),
202
+ "/data": RAMVFS(),
203
+ "/s3": S3VFS(S3Config(bucket="my-bucket")),
204
204
  })
205
205
 
206
- await ws.execute("cp /s3/report.csv /data/report.csv")
207
- await ws.execute("grep alert /s3/data/log.jsonl | wc -l")
206
+ await ws.shell("cp /s3/report.csv /data/report.csv")
207
+ await ws.shell("grep alert /s3/data/log.jsonl | wc -l")
208
208
 
209
209
  await ws.snapshot("demo.tar")
210
210
  ```
@@ -212,15 +212,15 @@ await ws.snapshot("demo.tar")
212
212
  ### TypeScript
213
213
 
214
214
  ```ts
215
- import { Workspace, RAMResource, S3Resource } from '@struktoai/mirage-node'
215
+ import { Workspace, RAMVFS, S3VFS } from '@struktoai/mirage-node'
216
216
 
217
217
  const ws = new Workspace({
218
- '/data': new RAMResource(),
219
- '/s3': new S3Resource({ bucket: 'my-bucket' }),
218
+ '/data': new RAMVFS(),
219
+ '/s3': new S3VFS({ bucket: 'my-bucket' }),
220
220
  })
221
221
 
222
- await ws.execute('cp /s3/report.csv /data/report.csv')
223
- await ws.execute('grep alert /s3/data/log.jsonl | wc -l')
222
+ await ws.shell('cp /s3/report.csv /data/report.csv')
223
+ await ws.shell('grep alert /s3/data/log.jsonl | wc -l')
224
224
 
225
225
  await ws.snapshot('demo.tar')
226
226
  ```
@@ -229,8 +229,7 @@ await ws.snapshot('demo.tar')
229
229
 
230
230
  ```bash
231
231
  mirage workspace create ws.yaml --id demo
232
- mirage execute --workspace_id demo --command "cp /s3/report.csv /data/report.csv"
233
- mirage provision --workspace_id demo --command "cat /s3/data/large.jsonl"
232
+ mirage shell --workspace_id demo --command "cp /s3/report.csv /data/report.csv"
234
233
  mirage workspace snapshot demo demo.tar
235
234
  mirage workspace load demo.tar --id demo-restored
236
235
  ```
@@ -6,15 +6,18 @@ Capabilities beyond standard filesystem:
6
6
  - grep works on structured text such as CSV and JSON, not just plain text
7
7
  - Pipes work: cat data.csv | grep error | sort | uniq | wc -l
8
8
  - head, tail, cut, wc, sort, uniq, tee, xargs are all available
9
+ - Start a recursive grep or rg inside the mount you mean, not at /: a mount searches with its own index only when the search starts inside it
9
10
 
10
11
  You can write Python code and execute it. The workspace is pre-configured with your data sources mounted at their respective paths.
11
12
 
12
- Use the execute tool for complex operations. Use read/write/edit for simple file operations.
13
+ Use the shell tool for complex operations. Use read/write/edit for simple file operations.
13
14
  `;
14
- function buildSystemPrompt(opts = {}) {
15
+ async function buildSystemPrompt(opts = {}) {
15
16
  const parts = [MIRAGE_SYSTEM_PROMPT];
16
17
  if (opts.workspace !== void 0) {
17
- parts.push("Mounted data sources:\n" + opts.workspace.filePrompt);
18
+ parts.push(
19
+ "Mounted data sources:\n" + await opts.workspace.vfsMd(void 0, { sessionId: opts.sessionId })
20
+ );
18
21
  } else if (opts.mountInfo !== void 0 && Object.keys(opts.mountInfo).length > 0) {
19
22
  parts.push("\nMounted data sources:");
20
23
  for (const [prefix, description] of Object.entries(opts.mountInfo)) {
@@ -32,4 +35,4 @@ export {
32
35
  MIRAGE_SYSTEM_PROMPT,
33
36
  buildSystemPrompt
34
37
  };
35
- //# sourceMappingURL=chunk-S6DWWJVF.js.map
38
+ //# sourceMappingURL=chunk-KGSDRNVH.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/prompt.ts"],"sourcesContent":["// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========\n\nimport type { Workspace } from '@struktoai/mirage-core/workspace/workspace/workspace'\n\nexport const MIRAGE_SYSTEM_PROMPT = `Your filesystem is powered by Mirage — a virtual filesystem that mounts cloud storage, local files, and in-memory data as a unified file tree.\n\nCapabilities beyond standard filesystem:\n- head -n 5 on data files returns the first 5 rows\n- grep works on structured text such as CSV and JSON, not just plain text\n- Pipes work: cat data.csv | grep error | sort | uniq | wc -l\n- head, tail, cut, wc, sort, uniq, tee, xargs are all available\n- Start a recursive grep or rg inside the mount you mean, not at /: a mount searches with its own index only when the search starts inside it\n\nYou can write Python code and execute it. The workspace is pre-configured with your data sources mounted at their respective paths.\n\nUse the shell tool for complex operations. Use read/write/edit for simple file operations.\n`\n\nexport interface BuildSystemPromptOptions {\n workspace?: Workspace\n sessionId?: string | undefined\n mountInfo?: Record<string, string>\n extraInstructions?: string\n}\n\nexport async function buildSystemPrompt(opts: BuildSystemPromptOptions = {}): Promise<string> {\n const parts: string[] = [MIRAGE_SYSTEM_PROMPT]\n if (opts.workspace !== undefined) {\n parts.push(\n 'Mounted data sources:\\n' +\n (await opts.workspace.vfsMd(undefined, { sessionId: opts.sessionId })),\n )\n } else if (opts.mountInfo !== undefined && Object.keys(opts.mountInfo).length > 0) {\n parts.push('\\nMounted data sources:')\n for (const [prefix, description] of Object.entries(opts.mountInfo)) {\n parts.push(`- ${prefix} — ${description}`)\n }\n parts.push('')\n }\n if (opts.extraInstructions !== undefined && opts.extraInstructions.length > 0) {\n parts.push(opts.extraInstructions)\n }\n return parts.join('\\n')\n}\n"],"mappings":";AAgBO,IAAM,uBAAuB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAqBpC,eAAsB,kBAAkB,OAAiC,CAAC,GAAoB;AAC5F,QAAM,QAAkB,CAAC,oBAAoB;AAC7C,MAAI,KAAK,cAAc,QAAW;AAChC,UAAM;AAAA,MACJ,4BACG,MAAM,KAAK,UAAU,MAAM,QAAW,EAAE,WAAW,KAAK,UAAU,CAAC;AAAA,IACxE;AAAA,EACF,WAAW,KAAK,cAAc,UAAa,OAAO,KAAK,KAAK,SAAS,EAAE,SAAS,GAAG;AACjF,UAAM,KAAK,yBAAyB;AACpC,eAAW,CAAC,QAAQ,WAAW,KAAK,OAAO,QAAQ,KAAK,SAAS,GAAG;AAClE,YAAM,KAAK,KAAK,MAAM,WAAM,WAAW,EAAE;AAAA,IAC3C;AACA,UAAM,KAAK,EAAE;AAAA,EACf;AACA,MAAI,KAAK,sBAAsB,UAAa,KAAK,kBAAkB,SAAS,GAAG;AAC7E,UAAM,KAAK,KAAK,iBAAiB;AAAA,EACnC;AACA,SAAO,MAAM,KAAK,IAAI;AACxB;","names":[]}
@@ -1,15 +1,22 @@
1
1
  import * as _anthropic_ai_claude_agent_sdk from '@anthropic-ai/claude-agent-sdk';
2
2
  import { Options } from '@anthropic-ai/claude-agent-sdk';
3
3
  import { Workspace } from '@struktoai/mirage-core/workspace/workspace/workspace';
4
- import { M as MirageToolOperationsOptions } from '../tool-descriptions-C6xBOUjO.js';
5
- export { E as EDIT_DESCRIPTION, a as EXECUTE_DESCRIPTION, G as GREP_DESCRIPTION, L as LS_DESCRIPTION, R as READ_DESCRIPTION, W as WRITE_DESCRIPTION } from '../tool-descriptions-C6xBOUjO.js';
6
- export { M as MIRAGE_SYSTEM_PROMPT, b as buildSystemPrompt } from '../prompt-CgKmMkVe.js';
4
+ import { MirageToolOperationsOptions } from '@struktoai/mirage-core/workspace/tools/tool_operations';
5
+ export { M as MIRAGE_SYSTEM_PROMPT, b as buildSystemPrompt } from '../prompt-J_K4KNBn.js';
6
+ export { EDIT_DESCRIPTION, GLOB_DESCRIPTION, GREP_DESCRIPTION, LS_DESCRIPTION, READ_DESCRIPTION, SHELL_DESCRIPTION, WRITE_DESCRIPTION } from '@struktoai/mirage-core/workspace/tools/tool_descriptions';
7
7
 
8
+ /**
9
+ * The SDK takes zod shapes, so each one restates its tool's input schema
10
+ * from `tool_descriptions`, descriptions read off the same constants. The
11
+ * server carries the tools the session's profile leaves it
12
+ * (`MirageToolOperations.names`).
13
+ */
8
14
  declare function MirageServer(workspace: Workspace, options?: MirageToolOperationsOptions): _anthropic_ai_claude_agent_sdk.McpSdkServerConfigWithInstance;
9
15
 
10
16
  interface BuildOptionsOptions {
11
17
  systemPrompt?: string;
18
+ sessionId?: string | undefined;
12
19
  }
13
- declare function buildOptions(workspace: Workspace, opts?: BuildOptionsOptions): Options;
20
+ declare function buildOptions(workspace: Workspace, opts?: BuildOptionsOptions): Promise<Options>;
14
21
 
15
22
  export { type BuildOptionsOptions, MirageServer, buildOptions };