@5ss/ai-tools 2.11.1

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 (342) hide show
  1. package/CHANGELOG.md +112 -0
  2. package/LICENSE +21 -0
  3. package/README.md +221 -0
  4. package/dist/ai-sdk/index.d.ts +15 -0
  5. package/dist/ai-sdk/index.d.ts.map +1 -0
  6. package/dist/ai-sdk/index.js +24 -0
  7. package/dist/ai-sdk/index.js.map +1 -0
  8. package/dist/artifact-D064mHfK.js +44 -0
  9. package/dist/artifact-D064mHfK.js.map +1 -0
  10. package/dist/artifacts-O8g-40Pw.js +404 -0
  11. package/dist/artifacts-O8g-40Pw.js.map +1 -0
  12. package/dist/aws-json-CecFqzqX.js +23 -0
  13. package/dist/aws-json-CecFqzqX.js.map +1 -0
  14. package/dist/aws-service-msttbPrz.js +58 -0
  15. package/dist/aws-service-msttbPrz.js.map +1 -0
  16. package/dist/batch-BMM5dXqL.d.ts +22 -0
  17. package/dist/batch-BMM5dXqL.d.ts.map +1 -0
  18. package/dist/batch-Co1ujeAW.js +67 -0
  19. package/dist/batch-Co1ujeAW.js.map +1 -0
  20. package/dist/bedrock-agentcore-browser-a_qOs-NR.js +182 -0
  21. package/dist/bedrock-agentcore-browser-a_qOs-NR.js.map +1 -0
  22. package/dist/bedrock-agentcore-code-interpreter-MWK-8RhA.js +357 -0
  23. package/dist/bedrock-agentcore-code-interpreter-MWK-8RhA.js.map +1 -0
  24. package/dist/bytes-BxpimpQx.js +45 -0
  25. package/dist/bytes-BxpimpQx.js.map +1 -0
  26. package/dist/client-CCKGsTeI.js +743 -0
  27. package/dist/client-CCKGsTeI.js.map +1 -0
  28. package/dist/cloudflare/index.d.ts +37 -0
  29. package/dist/cloudflare/index.d.ts.map +1 -0
  30. package/dist/cloudflare/index.js +41 -0
  31. package/dist/cloudflare/index.js.map +1 -0
  32. package/dist/cloudflare-browser-B6Yolpin.js +428 -0
  33. package/dist/cloudflare-browser-B6Yolpin.js.map +1 -0
  34. package/dist/cloudflare-email-Dy0KHeDf.js +197 -0
  35. package/dist/cloudflare-email-Dy0KHeDf.js.map +1 -0
  36. package/dist/cloudflare-sandbox-Dp_uNaqW.js +982 -0
  37. package/dist/cloudflare-sandbox-Dp_uNaqW.js.map +1 -0
  38. package/dist/content-type-CORxaxcv.js +49 -0
  39. package/dist/content-type-CORxaxcv.js.map +1 -0
  40. package/dist/core/index.d.ts +4 -0
  41. package/dist/core/index.js +204 -0
  42. package/dist/core/index.js.map +1 -0
  43. package/dist/define-CvpJ_pNP.js +115 -0
  44. package/dist/define-CvpJ_pNP.js.map +1 -0
  45. package/dist/errors-DoSpNHvs.js +20 -0
  46. package/dist/errors-DoSpNHvs.js.map +1 -0
  47. package/dist/errors-aKhko9T1.d.ts +18 -0
  48. package/dist/errors-aKhko9T1.d.ts.map +1 -0
  49. package/dist/eventbridge-scheduler-Bh6GqZY2.js +349 -0
  50. package/dist/eventbridge-scheduler-Bh6GqZY2.js.map +1 -0
  51. package/dist/framework-context-DVIIY8ZO.js +24 -0
  52. package/dist/framework-context-DVIIY8ZO.js.map +1 -0
  53. package/dist/gotenberg-NuJjxyln.js +291 -0
  54. package/dist/gotenberg-NuJjxyln.js.map +1 -0
  55. package/dist/http/index.d.ts +47 -0
  56. package/dist/http/index.d.ts.map +1 -0
  57. package/dist/http/index.js +3 -0
  58. package/dist/http-service-DDNCO1s4.js +254 -0
  59. package/dist/http-service-DDNCO1s4.js.map +1 -0
  60. package/dist/http-service-T7E5UjP8.d.ts +80 -0
  61. package/dist/http-service-T7E5UjP8.d.ts.map +1 -0
  62. package/dist/imessage-BSAFOI8Z.js +154 -0
  63. package/dist/imessage-BSAFOI8Z.js.map +1 -0
  64. package/dist/index-BU4gmYO8.d.ts +254 -0
  65. package/dist/index-BU4gmYO8.d.ts.map +1 -0
  66. package/dist/index-CCivzmxO.d.ts +188 -0
  67. package/dist/index-CCivzmxO.d.ts.map +1 -0
  68. package/dist/index-CLmTrcu5.d.ts +22 -0
  69. package/dist/index-CLmTrcu5.d.ts.map +1 -0
  70. package/dist/index-CZX5OeOF.d.ts +235 -0
  71. package/dist/index-CZX5OeOF.d.ts.map +1 -0
  72. package/dist/index-CdFmEfZO.d.ts +359 -0
  73. package/dist/index-CdFmEfZO.d.ts.map +1 -0
  74. package/dist/index-Cuh6eMWc.d.ts +285 -0
  75. package/dist/index-Cuh6eMWc.d.ts.map +1 -0
  76. package/dist/index-DuOGj7vc.d.ts +107 -0
  77. package/dist/index-DuOGj7vc.d.ts.map +1 -0
  78. package/dist/index-ccZ1XOHw.d.ts +69 -0
  79. package/dist/index-ccZ1XOHw.d.ts.map +1 -0
  80. package/dist/index-n8JTpNf1.d.ts +247 -0
  81. package/dist/index-n8JTpNf1.d.ts.map +1 -0
  82. package/dist/index-pwW1OsOx.d.ts +134 -0
  83. package/dist/index-pwW1OsOx.d.ts.map +1 -0
  84. package/dist/index-zK1ZwS4m.d.ts +347 -0
  85. package/dist/index-zK1ZwS4m.d.ts.map +1 -0
  86. package/dist/limits-hjrO8zUG.js +80 -0
  87. package/dist/limits-hjrO8zUG.js.map +1 -0
  88. package/dist/mastra/index.d.ts +14 -0
  89. package/dist/mastra/index.d.ts.map +1 -0
  90. package/dist/mastra/index.js +26 -0
  91. package/dist/mastra/index.js.map +1 -0
  92. package/dist/mastra-vector-Dhc6XZ8l.js +234 -0
  93. package/dist/mastra-vector-Dhc6XZ8l.js.map +1 -0
  94. package/dist/mcp/index.d.ts +80 -0
  95. package/dist/mcp/index.d.ts.map +1 -0
  96. package/dist/mcp/index.js +97 -0
  97. package/dist/mcp/index.js.map +1 -0
  98. package/dist/modules/artifacts/index.d.ts +337 -0
  99. package/dist/modules/artifacts/index.d.ts.map +1 -0
  100. package/dist/modules/artifacts/index.js +348 -0
  101. package/dist/modules/artifacts/index.js.map +1 -0
  102. package/dist/modules/browser/index.d.ts +516 -0
  103. package/dist/modules/browser/index.d.ts.map +1 -0
  104. package/dist/modules/browser/index.js +475 -0
  105. package/dist/modules/browser/index.js.map +1 -0
  106. package/dist/modules/calendar/index.d.ts +93 -0
  107. package/dist/modules/calendar/index.d.ts.map +1 -0
  108. package/dist/modules/calendar/index.js +131 -0
  109. package/dist/modules/calendar/index.js.map +1 -0
  110. package/dist/modules/code-sandbox/index.d.ts +317 -0
  111. package/dist/modules/code-sandbox/index.d.ts.map +1 -0
  112. package/dist/modules/code-sandbox/index.js +537 -0
  113. package/dist/modules/code-sandbox/index.js.map +1 -0
  114. package/dist/modules/content-type/index.d.ts +22 -0
  115. package/dist/modules/content-type/index.d.ts.map +1 -0
  116. package/dist/modules/content-type/index.js +66 -0
  117. package/dist/modules/content-type/index.js.map +1 -0
  118. package/dist/modules/crypto/index.d.ts +115 -0
  119. package/dist/modules/crypto/index.d.ts.map +1 -0
  120. package/dist/modules/crypto/index.js +139 -0
  121. package/dist/modules/crypto/index.js.map +1 -0
  122. package/dist/modules/document/index.d.ts +575 -0
  123. package/dist/modules/document/index.d.ts.map +1 -0
  124. package/dist/modules/document/index.js +444 -0
  125. package/dist/modules/document/index.js.map +1 -0
  126. package/dist/modules/document-extract/index.d.ts +438 -0
  127. package/dist/modules/document-extract/index.d.ts.map +1 -0
  128. package/dist/modules/document-extract/index.js +127 -0
  129. package/dist/modules/document-extract/index.js.map +1 -0
  130. package/dist/modules/document-render/index.d.ts +336 -0
  131. package/dist/modules/document-render/index.d.ts.map +1 -0
  132. package/dist/modules/document-render/index.js +155 -0
  133. package/dist/modules/document-render/index.js.map +1 -0
  134. package/dist/modules/email/index.d.ts +311 -0
  135. package/dist/modules/email/index.d.ts.map +1 -0
  136. package/dist/modules/email/index.js +167 -0
  137. package/dist/modules/email/index.js.map +1 -0
  138. package/dist/modules/email-message/index.d.ts +95 -0
  139. package/dist/modules/email-message/index.d.ts.map +1 -0
  140. package/dist/modules/email-message/index.js +264 -0
  141. package/dist/modules/email-message/index.js.map +1 -0
  142. package/dist/modules/file-convert/index.d.ts +273 -0
  143. package/dist/modules/file-convert/index.d.ts.map +1 -0
  144. package/dist/modules/file-convert/index.js +103 -0
  145. package/dist/modules/file-convert/index.js.map +1 -0
  146. package/dist/modules/files/index.d.ts +452 -0
  147. package/dist/modules/files/index.d.ts.map +1 -0
  148. package/dist/modules/files/index.js +733 -0
  149. package/dist/modules/files/index.js.map +1 -0
  150. package/dist/modules/image/index.d.ts +342 -0
  151. package/dist/modules/image/index.d.ts.map +1 -0
  152. package/dist/modules/image/index.js +281 -0
  153. package/dist/modules/image/index.js.map +1 -0
  154. package/dist/modules/messaging/index.d.ts +608 -0
  155. package/dist/modules/messaging/index.d.ts.map +1 -0
  156. package/dist/modules/messaging/index.js +1067 -0
  157. package/dist/modules/messaging/index.js.map +1 -0
  158. package/dist/modules/pdf/index.d.ts +287 -0
  159. package/dist/modules/pdf/index.d.ts.map +1 -0
  160. package/dist/modules/pdf/index.js +259 -0
  161. package/dist/modules/pdf/index.js.map +1 -0
  162. package/dist/modules/presentation/index.d.ts +247 -0
  163. package/dist/modules/presentation/index.d.ts.map +1 -0
  164. package/dist/modules/presentation/index.js +12657 -0
  165. package/dist/modules/presentation/index.js.map +1 -0
  166. package/dist/modules/queue/index.d.ts +129 -0
  167. package/dist/modules/queue/index.d.ts.map +1 -0
  168. package/dist/modules/queue/index.js +131 -0
  169. package/dist/modules/queue/index.js.map +1 -0
  170. package/dist/modules/rag/index.d.ts +250 -0
  171. package/dist/modules/rag/index.d.ts.map +1 -0
  172. package/dist/modules/rag/index.js +366 -0
  173. package/dist/modules/rag/index.js.map +1 -0
  174. package/dist/modules/scheduler/index.d.ts +216 -0
  175. package/dist/modules/scheduler/index.d.ts.map +1 -0
  176. package/dist/modules/scheduler/index.js +153 -0
  177. package/dist/modules/scheduler/index.js.map +1 -0
  178. package/dist/modules/skills/index.d.ts +205 -0
  179. package/dist/modules/skills/index.d.ts.map +1 -0
  180. package/dist/modules/skills/index.js +203 -0
  181. package/dist/modules/skills/index.js.map +1 -0
  182. package/dist/modules/tasks/index.d.ts +287 -0
  183. package/dist/modules/tasks/index.d.ts.map +1 -0
  184. package/dist/modules/tasks/index.js +207 -0
  185. package/dist/modules/tasks/index.js.map +1 -0
  186. package/dist/modules/vector-store/index.d.ts +3 -0
  187. package/dist/modules/vector-store/index.js +3 -0
  188. package/dist/modules/web-fetch/index.d.ts +99 -0
  189. package/dist/modules/web-fetch/index.d.ts.map +1 -0
  190. package/dist/modules/web-fetch/index.js +242 -0
  191. package/dist/modules/web-fetch/index.js.map +1 -0
  192. package/dist/object-artifact-store-CMTzCm_G.d.ts +7 -0
  193. package/dist/object-artifact-store-CMTzCm_G.d.ts.map +1 -0
  194. package/dist/object-artifact-store-wZ2j9cto.js +28 -0
  195. package/dist/object-artifact-store-wZ2j9cto.js.map +1 -0
  196. package/dist/pinecone-umY4t6OF.js +190 -0
  197. package/dist/pinecone-umY4t6OF.js.map +1 -0
  198. package/dist/provider-CgDAlg6K.js +34 -0
  199. package/dist/provider-CgDAlg6K.js.map +1 -0
  200. package/dist/qdrant-DMp4NhKR.js +253 -0
  201. package/dist/qdrant-DMp4NhKR.js.map +1 -0
  202. package/dist/resend-BAC38_dA.js +155 -0
  203. package/dist/resend-BAC38_dA.js.map +1 -0
  204. package/dist/s3-CsOaPWMP.js +955 -0
  205. package/dist/s3-CsOaPWMP.js.map +1 -0
  206. package/dist/schemas-ChOAhdo9.js +192 -0
  207. package/dist/schemas-ChOAhdo9.js.map +1 -0
  208. package/dist/slack-Di5BBNpt.js +1455 -0
  209. package/dist/slack-Di5BBNpt.js.map +1 -0
  210. package/dist/sqs-DCwS1i2N.js +225 -0
  211. package/dist/sqs-DCwS1i2N.js.map +1 -0
  212. package/dist/supabase-vector-Dpp9mmJR.js +218 -0
  213. package/dist/supabase-vector-Dpp9mmJR.js.map +1 -0
  214. package/dist/tanstack/index.d.ts +15 -0
  215. package/dist/tanstack/index.d.ts.map +1 -0
  216. package/dist/tanstack/index.js +28 -0
  217. package/dist/tanstack/index.js.map +1 -0
  218. package/dist/teams-DYAHNb39.js +835 -0
  219. package/dist/teams-DYAHNb39.js.map +1 -0
  220. package/dist/telegram-DDXWzkfL.js +734 -0
  221. package/dist/telegram-DDXWzkfL.js.map +1 -0
  222. package/dist/textract-CPLiB22H.js +554 -0
  223. package/dist/textract-CPLiB22H.js.map +1 -0
  224. package/dist/transport-B4vn-XiQ.js +157 -0
  225. package/dist/transport-B4vn-XiQ.js.map +1 -0
  226. package/dist/transport-i96ACAI_.d.ts +46 -0
  227. package/dist/transport-i96ACAI_.d.ts.map +1 -0
  228. package/dist/types-Ccb0DXY9.d.ts +150 -0
  229. package/dist/types-Ccb0DXY9.d.ts.map +1 -0
  230. package/dist/unique-EwBH1JPB.js +19 -0
  231. package/dist/unique-EwBH1JPB.js.map +1 -0
  232. package/dist/vector-store-C3nEO80e.js +193 -0
  233. package/dist/vector-store-C3nEO80e.js.map +1 -0
  234. package/dist/vendors/amazon-sp-api/index.d.ts +526 -0
  235. package/dist/vendors/amazon-sp-api/index.d.ts.map +1 -0
  236. package/dist/vendors/amazon-sp-api/index.js +975 -0
  237. package/dist/vendors/amazon-sp-api/index.js.map +1 -0
  238. package/dist/vendors/bedrock-agentcore-browser/index.d.ts +2 -0
  239. package/dist/vendors/bedrock-agentcore-browser/index.js +2 -0
  240. package/dist/vendors/bedrock-agentcore-code-interpreter/index.d.ts +228 -0
  241. package/dist/vendors/bedrock-agentcore-code-interpreter/index.d.ts.map +1 -0
  242. package/dist/vendors/bedrock-agentcore-code-interpreter/index.js +2 -0
  243. package/dist/vendors/cloudflare-browser/index.d.ts +2 -0
  244. package/dist/vendors/cloudflare-browser/index.js +2 -0
  245. package/dist/vendors/cloudflare-email/index.d.ts +260 -0
  246. package/dist/vendors/cloudflare-email/index.d.ts.map +1 -0
  247. package/dist/vendors/cloudflare-email/index.js +3 -0
  248. package/dist/vendors/cloudflare-sandbox/index.d.ts +565 -0
  249. package/dist/vendors/cloudflare-sandbox/index.d.ts.map +1 -0
  250. package/dist/vendors/cloudflare-sandbox/index.js +2 -0
  251. package/dist/vendors/eventbridge-scheduler/index.d.ts +2 -0
  252. package/dist/vendors/eventbridge-scheduler/index.js +2 -0
  253. package/dist/vendors/gotenberg/index.d.ts +306 -0
  254. package/dist/vendors/gotenberg/index.d.ts.map +1 -0
  255. package/dist/vendors/gotenberg/index.js +2 -0
  256. package/dist/vendors/imessage/index.d.ts +420 -0
  257. package/dist/vendors/imessage/index.d.ts.map +1 -0
  258. package/dist/vendors/imessage/index.js +4 -0
  259. package/dist/vendors/katana/index.d.ts +1570 -0
  260. package/dist/vendors/katana/index.d.ts.map +1 -0
  261. package/dist/vendors/katana/index.js +1639 -0
  262. package/dist/vendors/katana/index.js.map +1 -0
  263. package/dist/vendors/mastra-vector/index.d.ts +120 -0
  264. package/dist/vendors/mastra-vector/index.d.ts.map +1 -0
  265. package/dist/vendors/mastra-vector/index.js +3 -0
  266. package/dist/vendors/pinecone/index.d.ts +75 -0
  267. package/dist/vendors/pinecone/index.d.ts.map +1 -0
  268. package/dist/vendors/pinecone/index.js +3 -0
  269. package/dist/vendors/qdrant/index.d.ts +75 -0
  270. package/dist/vendors/qdrant/index.d.ts.map +1 -0
  271. package/dist/vendors/qdrant/index.js +3 -0
  272. package/dist/vendors/resend/index.d.ts +3 -0
  273. package/dist/vendors/resend/index.js +3 -0
  274. package/dist/vendors/s3/index.d.ts +2 -0
  275. package/dist/vendors/s3/index.js +2 -0
  276. package/dist/vendors/slack/index.d.ts +576 -0
  277. package/dist/vendors/slack/index.d.ts.map +1 -0
  278. package/dist/vendors/slack/index.js +3 -0
  279. package/dist/vendors/sqs/index.d.ts +2 -0
  280. package/dist/vendors/sqs/index.js +2 -0
  281. package/dist/vendors/supabase-vector/index.d.ts +89 -0
  282. package/dist/vendors/supabase-vector/index.d.ts.map +1 -0
  283. package/dist/vendors/supabase-vector/index.js +3 -0
  284. package/dist/vendors/teams/index.d.ts +303 -0
  285. package/dist/vendors/teams/index.d.ts.map +1 -0
  286. package/dist/vendors/teams/index.js +3 -0
  287. package/dist/vendors/telegram/index.d.ts +319 -0
  288. package/dist/vendors/telegram/index.d.ts.map +1 -0
  289. package/dist/vendors/telegram/index.js +3 -0
  290. package/dist/vendors/textract/index.d.ts +2 -0
  291. package/dist/vendors/textract/index.js +2 -0
  292. package/dist/vendors/woocommerce/index.d.ts +1700 -0
  293. package/dist/vendors/woocommerce/index.d.ts.map +1 -0
  294. package/dist/vendors/woocommerce/index.js +1427 -0
  295. package/dist/vendors/woocommerce/index.js.map +1 -0
  296. package/dist/with-auth-CpKqTrGK.js +240 -0
  297. package/dist/with-auth-CpKqTrGK.js.map +1 -0
  298. package/logos/LUCIDE-ATTRIBUTION.txt +4 -0
  299. package/logos/README.md +89 -0
  300. package/logos/amazon.svg +6 -0
  301. package/logos/artifacts.svg +9 -0
  302. package/logos/browser.svg +9 -0
  303. package/logos/calendar.svg +15 -0
  304. package/logos/cloudflare-browser.svg +5 -0
  305. package/logos/cloudflare-email.svg +5 -0
  306. package/logos/cloudflare.svg +4 -0
  307. package/logos/code-sandbox.svg +8 -0
  308. package/logos/content-type.svg +10 -0
  309. package/logos/crypto.svg +7 -0
  310. package/logos/document-extract.svg +12 -0
  311. package/logos/document-render.svg +8 -0
  312. package/logos/document.svg +10 -0
  313. package/logos/email-message.svg +8 -0
  314. package/logos/email.svg +7 -0
  315. package/logos/file-convert.svg +9 -0
  316. package/logos/files.svg +6 -0
  317. package/logos/gotenberg.svg +340 -0
  318. package/logos/image.svg +8 -0
  319. package/logos/imessage.svg +7 -0
  320. package/logos/katana.svg +13 -0
  321. package/logos/mastra.svg +7 -0
  322. package/logos/messaging.svg +7 -0
  323. package/logos/pack-logos.json +48 -0
  324. package/logos/pdf.svg +10 -0
  325. package/logos/pinecone.svg +25 -0
  326. package/logos/presentation.svg +8 -0
  327. package/logos/qdrant.svg +4 -0
  328. package/logos/queue.svg +11 -0
  329. package/logos/rag.svg +18 -0
  330. package/logos/resend.svg +5 -0
  331. package/logos/scheduler.svg +7 -0
  332. package/logos/skills.svg +10 -0
  333. package/logos/slack.svg +14 -0
  334. package/logos/supabase.svg +4 -0
  335. package/logos/tasks.svg +10 -0
  336. package/logos/teams.svg +6 -0
  337. package/logos/telegram.svg +10 -0
  338. package/logos/textract.svg +5 -0
  339. package/logos/vector-store.svg +8 -0
  340. package/logos/web-fetch.svg +8 -0
  341. package/logos/woocommerce.svg +4 -0
  342. package/package.json +373 -0
@@ -0,0 +1,982 @@
1
+ import { t as ToolError } from "./errors-DoSpNHvs.js";
2
+ import { n as defineModule, r as defineTool } from "./define-CvpJ_pNP.js";
3
+ import { n as requireAuth } from "./provider-CgDAlg6K.js";
4
+ import { t as HttpService } from "./http-service-DDNCO1s4.js";
5
+ import { a as toArrayBuffer, n as bytesToBase64, o as utf8ToBytes, r as bytesToUtf8, t as base64ToBytes } from "./bytes-BxpimpQx.js";
6
+ import { m as s3AuthSchema, p as S3Client } from "./s3-CsOaPWMP.js";
7
+ import { isPlainObject, isString, trimEnd } from "es-toolkit";
8
+ import { z } from "zod";
9
+ //#region src/vendors/cloudflare-sandbox/contracts.ts
10
+ /**
11
+ * Cloudflare Sandbox Bridge HTTP API contracts.
12
+ * Host deploys the bridge Worker; this pack is a Bearer client.
13
+ * @see https://developers.cloudflare.com/sandbox/bridge/http-api/
14
+ */
15
+ const MAX_ARGV = 64;
16
+ const MAX_ARG_CHARS = 1e5;
17
+ const MAX_FILE_PATH = 1024;
18
+ const MAX_FILE_TEXT = 2e6;
19
+ /** Bridge hard cap is 32 MiB; package tool path uses the same bound. */
20
+ const MAX_FILE_BYTES = 32 * 1024 * 1024;
21
+ const MAX_WRITE_FILES = 20;
22
+ const MAX_READ_PATHS = 50;
23
+ const MAX_LIST_FILES = 500;
24
+ const DEFAULT_EXEC_TIMEOUT_MS = 3e4;
25
+ const MAX_EXEC_TIMEOUT_MS = 6e5;
26
+ const cloudflareSandboxAuthSchema = z.object({
27
+ base_url: z.string().min(1).describe("Sandbox bridge Worker origin, for example https://sandbox-bridge.example.workers.dev"),
28
+ api_key: z.string().min(1).describe("Bridge SANDBOX_API_KEY Bearer token"),
29
+ storage: s3AuthSchema.optional().describe("Optional S3-compatible storage for importArtifact / exportArtifact (ArtifactRef)")
30
+ });
31
+ /** Object-store ArtifactRef for sandbox import/export. */
32
+ const sandboxObjectArtifactRefSchema = z.object({
33
+ store: z.literal("object").describe("Object store containing the artifact"),
34
+ key: z.string().min(1).describe("Object key"),
35
+ media_type: z.string().min(1).optional().describe("MIME or format hint when known"),
36
+ filename: z.string().min(1).optional().describe("Original or display file name"),
37
+ byte_length: z.int().min(0).optional().describe("Size in bytes when known")
38
+ });
39
+ const sandboxId = z.string().min(1).max(200).describe("Sandbox id returned by create");
40
+ const sandboxIdInputSchema = z.object({ sandbox_id: sandboxId });
41
+ const createSandboxOutputSchema = z.object({ sandbox_id: z.string().describe("Created sandbox id") });
42
+ const destroySandboxOutputSchema = z.object({
43
+ sandbox_id: z.string(),
44
+ destroyed: z.literal(true)
45
+ });
46
+ const runningOutputSchema = z.object({
47
+ sandbox_id: z.string(),
48
+ running: z.boolean().describe("Whether the container is live")
49
+ });
50
+ const healthOutputSchema = z.object({ ok: z.boolean() });
51
+ const execInputSchema = z.object({
52
+ sandbox_id: sandboxId,
53
+ argv: z.array(z.string().min(1).max(MAX_ARG_CHARS)).min(1).max(64).describe("Command argv array (not a shell string). Example: [\"python3\",\"-c\",\"print(1)\"]"),
54
+ timeout_ms: z.int().min(1).max(MAX_EXEC_TIMEOUT_MS).optional().describe(`Exec timeout in ms (default ${DEFAULT_EXEC_TIMEOUT_MS})`),
55
+ cwd: z.string().min(1).max(MAX_FILE_PATH).optional().describe("Working directory (default /workspace)"),
56
+ session_id: z.string().min(1).max(200).optional().describe("Optional bridge session id for isolated working directory and runtime state"),
57
+ env: z.record(z.string().min(1).max(128), z.string().max(8192)).optional().describe("Optional environment variables for the process when the bridge supports env")
58
+ });
59
+ const execOutputSchema = z.object({
60
+ sandbox_id: z.string(),
61
+ stdout: z.string().describe("Decoded standard output"),
62
+ stderr: z.string().describe("Decoded standard error"),
63
+ exit_code: z.number().int().optional().describe("Process exit code when the stream ends with exit"),
64
+ success: z.boolean().describe("True when exit_code is 0"),
65
+ error: z.string().optional().describe("Bridge error message when the stream ends with error"),
66
+ error_code: z.string().optional().describe("Bridge error code when present")
67
+ });
68
+ const filePathField = z.string().min(1).max(MAX_FILE_PATH).describe("Path under workspace (with or without /workspace/ prefix)");
69
+ const sessionIdField = z.string().min(1).max(200).optional().describe("Optional Session-Id header");
70
+ const writeFileBodyFields = {
71
+ text: z.string().max(MAX_FILE_TEXT).optional().describe("Utf-8 file contents (omit when body_base64 is set)"),
72
+ body_base64: z.string().min(1).optional().describe("Base64 file bytes for binary content (omit when text is set; max 32 MiB decoded)")
73
+ };
74
+ function refineExactlyOneBody(val, ctx) {
75
+ if (val.text !== void 0 === (val.body_base64 !== void 0)) ctx.addIssue({
76
+ code: "custom",
77
+ message: "Provide exactly one of text or body_base64"
78
+ });
79
+ }
80
+ const writeFileInputSchema = z.object({
81
+ sandbox_id: sandboxId,
82
+ path: filePathField,
83
+ ...writeFileBodyFields,
84
+ session_id: sessionIdField
85
+ }).superRefine(refineExactlyOneBody);
86
+ const writeFileOutputSchema = z.object({
87
+ sandbox_id: z.string(),
88
+ path: z.string(),
89
+ ok: z.literal(true),
90
+ byte_length: z.number().int().nonnegative().optional().describe("Decoded byte length written when known")
91
+ });
92
+ const readFileInputSchema = z.object({
93
+ sandbox_id: sandboxId,
94
+ path: filePathField,
95
+ encoding: z.enum(["utf8", "base64"]).optional().describe("Response encoding (default utf8 for text; use base64 for binary)"),
96
+ session_id: sessionIdField
97
+ });
98
+ const readFileOutputSchema = z.object({
99
+ sandbox_id: z.string(),
100
+ path: z.string(),
101
+ text: z.string().optional().describe("Utf-8 contents when encoding is utf8 (default)"),
102
+ body_base64: z.string().optional().describe("Base64 contents when encoding is base64"),
103
+ byte_length: z.number().int().nonnegative().optional().describe("Decoded byte length")
104
+ });
105
+ const writeFilesInputSchema = z.object({
106
+ sandbox_id: sandboxId,
107
+ files: z.array(z.object({
108
+ path: z.string().min(1).max(MAX_FILE_PATH).describe("Path under workspace"),
109
+ ...writeFileBodyFields
110
+ }).superRefine(refineExactlyOneBody)).min(1).max(20).describe("Files to write under workspace (text or body_base64 each)"),
111
+ session_id: sessionIdField
112
+ });
113
+ const writeFilesOutputSchema = z.object({
114
+ sandbox_id: z.string(),
115
+ paths: z.array(z.string()),
116
+ ok: z.literal(true)
117
+ });
118
+ const readFilesInputSchema = z.object({
119
+ sandbox_id: sandboxId,
120
+ paths: z.array(z.string().min(1).max(MAX_FILE_PATH).describe("Path under workspace")).min(1).max(50).describe("Paths to read under workspace"),
121
+ encoding: z.enum(["utf8", "base64"]).optional().describe("Response encoding for all files (default utf8)"),
122
+ session_id: sessionIdField
123
+ });
124
+ const readFilesOutputSchema = z.object({
125
+ sandbox_id: z.string(),
126
+ files: z.array(z.object({
127
+ path: z.string(),
128
+ text: z.string().optional(),
129
+ body_base64: z.string().optional(),
130
+ byte_length: z.number().int().nonnegative().optional()
131
+ }))
132
+ });
133
+ const listFilesInputSchema = z.object({
134
+ sandbox_id: sandboxId,
135
+ directory_path: z.string().max(MAX_FILE_PATH).optional().describe("Directory to list (default /workspace)"),
136
+ session_id: sessionIdField
137
+ });
138
+ const listFilesOutputSchema = z.object({
139
+ sandbox_id: z.string(),
140
+ paths: z.array(z.string()).describe("Absolute or workspace-relative file paths found"),
141
+ raw: z.unknown().optional().describe("Provider listing payload when available")
142
+ });
143
+ const removeFilesInputSchema = z.object({
144
+ sandbox_id: sandboxId,
145
+ paths: z.array(z.string().min(1).max(MAX_FILE_PATH)).min(1).max(50).describe("Paths to remove under workspace"),
146
+ session_id: sessionIdField
147
+ });
148
+ const removeFilesOutputSchema = z.object({
149
+ sandbox_id: z.string(),
150
+ paths: z.array(z.string()),
151
+ ok: z.literal(true)
152
+ });
153
+ const importArtifactInputSchema = z.object({
154
+ sandbox_id: sandboxId,
155
+ path: filePathField,
156
+ source: sandboxObjectArtifactRefSchema.describe("Object-store ArtifactRef to copy into the sandbox"),
157
+ session_id: sessionIdField
158
+ });
159
+ const importArtifactOutputSchema = z.object({
160
+ sandbox_id: z.string(),
161
+ path: z.string(),
162
+ ok: z.literal(true),
163
+ byte_length: z.number().int().nonnegative()
164
+ });
165
+ const exportArtifactInputSchema = z.object({
166
+ sandbox_id: sandboxId,
167
+ path: filePathField,
168
+ destination_key: z.string().min(1).describe("Object key to write under bound storage"),
169
+ session_id: sessionIdField
170
+ });
171
+ const exportArtifactOutputSchema = z.object({
172
+ sandbox_id: z.string(),
173
+ path: z.string(),
174
+ artifact: sandboxObjectArtifactRefSchema
175
+ });
176
+ const createBridgeSessionOutputSchema = z.object({
177
+ sandbox_id: z.string(),
178
+ session_id: z.string().describe("Bridge session id for Session-Id header")
179
+ });
180
+ const deleteBridgeSessionInputSchema = z.object({
181
+ sandbox_id: sandboxId,
182
+ session_id: z.string().min(1).max(200).describe("Bridge session id to delete")
183
+ });
184
+ const deleteBridgeSessionOutputSchema = z.object({
185
+ sandbox_id: z.string(),
186
+ session_id: z.string(),
187
+ deleted: z.literal(true)
188
+ });
189
+ const executeCodeInputSchema = z.object({
190
+ sandbox_id: sandboxId,
191
+ code: z.string().min(1).max(MAX_ARG_CHARS).describe("Source code to run"),
192
+ language: z.enum([
193
+ "python",
194
+ "javascript",
195
+ "typescript",
196
+ "shell"
197
+ ]).optional().describe("Runtime language (default python)"),
198
+ timeout_ms: z.int().min(1).max(MAX_EXEC_TIMEOUT_MS).optional().describe(`Exec timeout in ms (default ${DEFAULT_EXEC_TIMEOUT_MS})`),
199
+ session_id: z.string().min(1).max(200).optional().describe("Optional bridge session id for isolated working directory and runtime state")
200
+ });
201
+ /**
202
+ * Mount an S3-compatible bucket into the sandbox filesystem.
203
+ * @see https://developers.cloudflare.com/sandbox/bridge/http-api/#bucket-mounts
204
+ *
205
+ * Two bridge modes:
206
+ * - **R2 binding:** omit `endpoint`; `bucket` is the Worker R2 binding name.
207
+ * - **Remote S3/R2/GCS:** set `endpoint` (+ optional credentials; bridge may use Worker secrets).
208
+ */
209
+ const mountBucketInputSchema = z.object({
210
+ sandbox_id: sandboxId,
211
+ bucket: z.string().min(1).max(256).describe("R2 Worker binding name when endpoint is omitted; otherwise the remote bucket name (e.g. for S3/R2 endpoint mounts)"),
212
+ mount_path: z.string().min(1).max(MAX_FILE_PATH).refine((p) => p.startsWith("/"), { message: "mount_path must be an absolute path (start with /)" }).describe("Absolute path inside the sandbox to mount at (e.g. /data or /mnt/workspace)"),
213
+ endpoint: z.url().optional().describe("S3-compatible endpoint URL (e.g. https://s3.amazonaws.com or https://ACCOUNT.r2.cloudflarestorage.com). Omit for Worker R2 binding mounts"),
214
+ provider: z.enum([
215
+ "r2",
216
+ "s3",
217
+ "gcs"
218
+ ]).optional().describe("Provider hint for s3fs optimizations when using endpoint mounts"),
219
+ read_only: z.boolean().optional().describe("Mount read-only (default false)"),
220
+ prefix: z.string().min(1).max(MAX_FILE_PATH).optional().describe("Bucket prefix/subdirectory to expose at the mount (must start with / when set)"),
221
+ access_key_id: z.string().min(1).optional().describe("Access key for endpoint mounts (maps to bridge credentials.accessKeyId)"),
222
+ secret_access_key: z.string().min(1).optional().describe("Secret key for endpoint mounts (maps to bridge credentials.secretAccessKey)"),
223
+ credential_proxy: z.boolean().optional().describe("When true, bridge keeps credentials out of the container (egress signing). Endpoint mounts only; requires ContainerProxy on the bridge Worker"),
224
+ local_bucket: z.boolean().optional().describe("When true, use local R2 binding sync (wrangler dev). Mutually exclusive with endpoint"),
225
+ s3fs_options: z.array(z.string().min(1).max(256)).max(32).optional().describe("Advanced s3fs mount flags (e.g. use_cache=/tmp/cache)")
226
+ });
227
+ const mountBucketOutputSchema = z.object({
228
+ sandbox_id: z.string(),
229
+ bucket: z.string(),
230
+ mount_path: z.string(),
231
+ ok: z.literal(true)
232
+ });
233
+ const unmountBucketInputSchema = z.object({
234
+ sandbox_id: sandboxId,
235
+ mount_path: z.string().min(1).max(MAX_FILE_PATH).refine((p) => p.startsWith("/"), { message: "mount_path must be an absolute path (start with /)" }).describe("Absolute mount path previously passed to mount")
236
+ });
237
+ const unmountBucketOutputSchema = z.object({
238
+ sandbox_id: z.string(),
239
+ mount_path: z.string(),
240
+ ok: z.literal(true)
241
+ });
242
+ //#endregion
243
+ //#region src/vendors/cloudflare-sandbox/domain.ts
244
+ /**
245
+ * Cloudflare Sandbox Bridge pure helpers (no HTTP).
246
+ */
247
+ /** Normalize a host path to the bridge URL segment under /file/… (no leading slash). */
248
+ function workspaceFileKey(path) {
249
+ const trimmed = path.trim();
250
+ if (!trimmed) throw new ToolError("File path is empty", { code: "bad_input" });
251
+ const noLead = trimmed.replace(/^\/+/, "");
252
+ const under = noLead.startsWith("workspace/") ? noLead : `workspace/${noLead}`;
253
+ if (under.split("/").some((p) => p === ".." || p === "")) throw new ToolError("File path must stay under workspace", {
254
+ code: "bad_input",
255
+ details: { path: trimmed }
256
+ });
257
+ return under;
258
+ }
259
+ /** Absolute workspace path for shell list/rm (leading slash). */
260
+ function workspaceAbsolutePath(path) {
261
+ return `/${workspaceFileKey(path)}`;
262
+ }
263
+ /** Shell-safe single-quoted string. */
264
+ function shellQuote(value) {
265
+ return `'${value.replaceAll("'", `'\\''`)}'`;
266
+ }
267
+ /**
268
+ * Resolve write-file body to raw bytes (text UTF-8 or base64).
269
+ * Enforces MAX_FILE_BYTES (bridge limit).
270
+ */
271
+ function resolveWriteFileBytes(input) {
272
+ if (input.body_base64 !== void 0 && input.text !== void 0) throw new ToolError("Provide exactly one of text or body_base64", { code: "bad_input" });
273
+ if (input.body_base64 !== void 0) {
274
+ const bytes = base64ToBytes(input.body_base64);
275
+ if (bytes.byteLength > 33554432) throw new ToolError("Sandbox file exceeds max byte limit", {
276
+ code: "too_large",
277
+ details: {
278
+ max_bytes: MAX_FILE_BYTES,
279
+ content_length: bytes.byteLength
280
+ }
281
+ });
282
+ return bytes;
283
+ }
284
+ if (input.text !== void 0) {
285
+ const bytes = utf8ToBytes(input.text);
286
+ if (bytes.byteLength > 33554432) throw new ToolError("Sandbox file exceeds max byte limit", {
287
+ code: "too_large",
288
+ details: {
289
+ max_bytes: MAX_FILE_BYTES,
290
+ content_length: bytes.byteLength
291
+ }
292
+ });
293
+ return bytes;
294
+ }
295
+ throw new ToolError("Provide exactly one of text or body_base64", { code: "bad_input" });
296
+ }
297
+ /**
298
+ * Parse bridge /exec text/event-stream body.
299
+ * Events: stdout/stderr (base64 data), exit ({"exit_code":N}), error ({"error","code"}).
300
+ */
301
+ function parseExecSse(body, options = {}) {
302
+ const stdoutChunks = [];
303
+ const stderrChunks = [];
304
+ let exit_code;
305
+ let error;
306
+ let error_code;
307
+ const blocks = body.replaceAll("\r\n", "\n").split("\n\n");
308
+ for (const block of blocks) {
309
+ const lines = block.split("\n").filter((line) => line.length > 0);
310
+ if (lines.length === 0) continue;
311
+ let event = "message";
312
+ const dataLines = [];
313
+ for (const line of lines) if (line.startsWith("event:")) event = line.slice(6).trim();
314
+ else if (line.startsWith("data:")) dataLines.push(line.slice(5).trimStart());
315
+ const data = dataLines.join("\n");
316
+ if (event === "stdout" && data.length > 0) {
317
+ const chunk = decodeBase64Chunk(data);
318
+ stdoutChunks.push(chunk);
319
+ options.onStdout?.(chunk);
320
+ } else if (event === "stderr" && data.length > 0) {
321
+ const chunk = decodeBase64Chunk(data);
322
+ stderrChunks.push(chunk);
323
+ options.onStderr?.(chunk);
324
+ } else if (event === "exit" && data.length > 0) {
325
+ const parsed = safeJson(data);
326
+ if (isPlainObject(parsed)) {
327
+ const code = parsed["exit_code"];
328
+ if (typeof code === "number" && Number.isFinite(code)) exit_code = code;
329
+ }
330
+ } else if (event === "error" && data.length > 0) {
331
+ const parsed = safeJson(data);
332
+ if (isPlainObject(parsed)) {
333
+ if (isString(parsed["error"])) error = parsed["error"];
334
+ if (isString(parsed["code"])) error_code = parsed["code"];
335
+ } else error = data;
336
+ }
337
+ }
338
+ const out = {
339
+ stdout: stdoutChunks.join(""),
340
+ stderr: stderrChunks.join("")
341
+ };
342
+ if (exit_code !== void 0) out.exit_code = exit_code;
343
+ if (error !== void 0) out.error = error;
344
+ if (error_code !== void 0) out.error_code = error_code;
345
+ return out;
346
+ }
347
+ function decodeBase64Chunk(data) {
348
+ try {
349
+ if (typeof Buffer !== "undefined") return Buffer.from(data, "base64").toString("utf8");
350
+ const binary = atob(data);
351
+ const bytes = new Uint8Array(binary.length);
352
+ for (let i = 0; i < binary.length; i += 1) bytes[i] = binary.charCodeAt(i);
353
+ return new TextDecoder().decode(bytes);
354
+ } catch {
355
+ return data;
356
+ }
357
+ }
358
+ function safeJson(text) {
359
+ try {
360
+ return JSON.parse(text);
361
+ } catch {
362
+ return;
363
+ }
364
+ }
365
+ /** Build argv for executeCode over the bridge (no native runCode route). */
366
+ function executeCodeArgv(language, code) {
367
+ switch (language) {
368
+ case "javascript":
369
+ case "typescript": return [
370
+ "node",
371
+ "-e",
372
+ code
373
+ ];
374
+ case "shell": return [
375
+ "sh",
376
+ "-lc",
377
+ code
378
+ ];
379
+ default: return [
380
+ "python3",
381
+ "-c",
382
+ code
383
+ ];
384
+ }
385
+ }
386
+ //#endregion
387
+ //#region src/vendors/cloudflare-sandbox/client.ts
388
+ /**
389
+ * Cloudflare Sandbox Bridge vendor client (HttpService + Bearer).
390
+ * Host: `new CloudflareSandboxClient(auth)`. Agent: `fromContext(ctx)`.
391
+ * Gold: `src/vendors/resend/client.ts` + messaging ArtifactRef storage pattern.
392
+ * @see https://developers.cloudflare.com/sandbox/bridge/http-api/
393
+ */
394
+ var CloudflareSandboxClient = class CloudflareSandboxClient {
395
+ #http;
396
+ #storage;
397
+ /** Optional S3 auth fields for endpoint mount credential fallback (Mastra workspace FS). */
398
+ #storageAuth;
399
+ constructor(auth, options = {}) {
400
+ const parsed = cloudflareSandboxAuthSchema.safeParse(auth);
401
+ if (!parsed.success) throw new ToolError("Invalid Cloudflare Sandbox auth credentials", {
402
+ code: "bad_auth",
403
+ details: { issues: parsed.error.issues.map((issue) => issue.message) }
404
+ });
405
+ this.#http = new HttpService({
406
+ baseURL: trimEnd(parsed.data.base_url, "/"),
407
+ headers: { Authorization: `Bearer ${parsed.data.api_key}` },
408
+ timeout: 12e4,
409
+ label: "Cloudflare Sandbox",
410
+ ...options.fetch && { fetch: options.fetch },
411
+ ...options.signal && { signal: options.signal }
412
+ });
413
+ this.#storage = parsed.data.storage ? new S3Client(parsed.data.storage, {
414
+ ...options.fetch && { fetch: options.fetch },
415
+ ...options.signal && { signal: options.signal }
416
+ }) : void 0;
417
+ this.#storageAuth = parsed.data.storage ? {
418
+ access_key_id: parsed.data.storage.access_key_id,
419
+ secret_access_key: parsed.data.storage.secret_access_key,
420
+ ...parsed.data.storage.endpoint && { endpoint: parsed.data.storage.endpoint }
421
+ } : void 0;
422
+ }
423
+ static fromContext(ctx) {
424
+ return new CloudflareSandboxClient(requireAuth(ctx, cloudflareSandboxAuthSchema), {
425
+ ...ctx.fetch && { fetch: ctx.fetch },
426
+ ...ctx.signal && { signal: ctx.signal }
427
+ });
428
+ }
429
+ /** Liveness probe on the bridge. */
430
+ async health() {
431
+ const { data } = await this.#http.get("/health", { label: "Cloudflare Sandbox health" });
432
+ if (isPlainObject(data) && data["ok"] === true) return { ok: true };
433
+ if (isPlainObject(data) && data["ok"] === false) return { ok: false };
434
+ return { ok: true };
435
+ }
436
+ async create() {
437
+ const { data } = await this.#http.post("/v1/sandbox", void 0, { label: "Cloudflare Sandbox create" });
438
+ if (!isPlainObject(data) || !isString(data["id"])) throw new ToolError("Unexpected create sandbox response", { code: "upstream" });
439
+ return { sandbox_id: data["id"] };
440
+ }
441
+ async destroy(input) {
442
+ await this.#http.delete(`/v1/sandbox/${encodeURIComponent(input.sandbox_id)}`, { label: "Cloudflare Sandbox destroy" });
443
+ return {
444
+ sandbox_id: input.sandbox_id,
445
+ destroyed: true
446
+ };
447
+ }
448
+ async running(input) {
449
+ const { data } = await this.#http.get(`/v1/sandbox/${encodeURIComponent(input.sandbox_id)}/running`, { label: "Cloudflare Sandbox running" });
450
+ if (!isPlainObject(data) || typeof data["running"] !== "boolean") throw new ToolError("Unexpected running response", { code: "upstream" });
451
+ return {
452
+ sandbox_id: input.sandbox_id,
453
+ running: data["running"]
454
+ };
455
+ }
456
+ /**
457
+ * Run a command. Bridge returns text/event-stream (stdout/stderr base64 + exit).
458
+ * Uses HttpService.bytes so ofetch does not try to JSON-parse the SSE body.
459
+ * Optional onStdout/onStderr fire while walking the buffered SSE (not true wire streaming).
460
+ */
461
+ async exec(input, stream = {}) {
462
+ const body = {
463
+ argv: input.argv,
464
+ timeout_ms: input.timeout_ms ?? 3e4
465
+ };
466
+ if (input.cwd) body["cwd"] = input.cwd;
467
+ if (input.env && Object.keys(input.env).length > 0) body["env"] = input.env;
468
+ const headers = {
469
+ "Content-Type": "application/json",
470
+ Accept: "text/event-stream"
471
+ };
472
+ if (input.session_id) headers["Session-Id"] = input.session_id;
473
+ const { bytes } = await this.#http.bytes("POST", `/v1/sandbox/${encodeURIComponent(input.sandbox_id)}/exec`, {
474
+ body,
475
+ headers,
476
+ label: "Cloudflare Sandbox exec"
477
+ });
478
+ const parsed = parseExecSse(new TextDecoder().decode(bytes), {
479
+ ...stream.onStdout && { onStdout: stream.onStdout },
480
+ ...stream.onStderr && { onStderr: stream.onStderr }
481
+ });
482
+ if (parsed.error && parsed.exit_code === void 0) throw new ToolError(parsed.error, {
483
+ code: "upstream",
484
+ details: {
485
+ ...parsed.error_code && { error_code: parsed.error_code },
486
+ sandbox_id: input.sandbox_id
487
+ }
488
+ });
489
+ const exit_code = parsed.exit_code ?? (parsed.error ? 1 : 0);
490
+ const out = {
491
+ sandbox_id: input.sandbox_id,
492
+ stdout: parsed.stdout,
493
+ stderr: parsed.stderr,
494
+ exit_code,
495
+ success: exit_code === 0
496
+ };
497
+ if (parsed.error) out.error = parsed.error;
498
+ if (parsed.error_code) out.error_code = parsed.error_code;
499
+ return out;
500
+ }
501
+ /** Execute source via python3/node/sh on the bridge (no native runCode route). */
502
+ async executeCode(input) {
503
+ const language = input.language ?? "python";
504
+ return this.exec({
505
+ sandbox_id: input.sandbox_id,
506
+ argv: executeCodeArgv(language, input.code),
507
+ ...input.timeout_ms !== void 0 && { timeout_ms: input.timeout_ms },
508
+ ...input.session_id && { session_id: input.session_id }
509
+ });
510
+ }
511
+ async writeFile(input) {
512
+ const bytes = resolveWriteFileBytes(input);
513
+ await this.#putFileBytes(input.sandbox_id, input.path, bytes, input.session_id);
514
+ return {
515
+ sandbox_id: input.sandbox_id,
516
+ path: input.path,
517
+ ok: true,
518
+ byte_length: bytes.byteLength
519
+ };
520
+ }
521
+ async readFile(input) {
522
+ const bytes = await this.#getFileBytes(input.sandbox_id, input.path, input.session_id);
523
+ const encoding = input.encoding ?? "utf8";
524
+ const out = {
525
+ sandbox_id: input.sandbox_id,
526
+ path: input.path,
527
+ byte_length: bytes.byteLength
528
+ };
529
+ if (encoding === "base64") out.body_base64 = bytesToBase64(bytes);
530
+ else out.text = bytesToUtf8(bytes);
531
+ return out;
532
+ }
533
+ async writeFiles(input) {
534
+ const paths = [];
535
+ for (const file of input.files) {
536
+ await this.writeFile({
537
+ sandbox_id: input.sandbox_id,
538
+ path: file.path,
539
+ ...file.text !== void 0 && { text: file.text },
540
+ ...file.body_base64 !== void 0 && { body_base64: file.body_base64 },
541
+ ...input.session_id && { session_id: input.session_id }
542
+ });
543
+ paths.push(file.path);
544
+ }
545
+ return {
546
+ sandbox_id: input.sandbox_id,
547
+ paths,
548
+ ok: true
549
+ };
550
+ }
551
+ async readFiles(input) {
552
+ const files = [];
553
+ for (const path of input.paths) {
554
+ const row = await this.readFile({
555
+ sandbox_id: input.sandbox_id,
556
+ path,
557
+ ...input.encoding && { encoding: input.encoding },
558
+ ...input.session_id && { session_id: input.session_id }
559
+ });
560
+ files.push({
561
+ path: row.path,
562
+ ...row.text !== void 0 && { text: row.text },
563
+ ...row.body_base64 !== void 0 && { body_base64: row.body_base64 },
564
+ ...row.byte_length !== void 0 && { byte_length: row.byte_length }
565
+ });
566
+ }
567
+ return {
568
+ sandbox_id: input.sandbox_id,
569
+ files
570
+ };
571
+ }
572
+ /** List files via find in the workspace (bridge has no list route). */
573
+ async listFiles(input) {
574
+ const dir = input.directory_path?.trim() || "/workspace";
575
+ const abs = dir.startsWith("/") ? dir : workspaceAbsolutePath(dir);
576
+ const out = await this.exec({
577
+ sandbox_id: input.sandbox_id,
578
+ argv: [
579
+ "sh",
580
+ "-lc",
581
+ `find ${shellQuote(abs)} -maxdepth 4 -type f 2>/dev/null | head -n 500`
582
+ ],
583
+ ...input.session_id && { session_id: input.session_id }
584
+ });
585
+ const paths = out.stdout.split("\n").map((line) => line.trim()).filter((line) => line.length > 0);
586
+ return {
587
+ sandbox_id: input.sandbox_id,
588
+ paths,
589
+ raw: {
590
+ stdout: out.stdout,
591
+ stderr: out.stderr,
592
+ exit_code: out.exit_code
593
+ }
594
+ };
595
+ }
596
+ /** Remove files via rm (bridge has no delete-file route). */
597
+ async removeFiles(input) {
598
+ for (const path of input.paths) {
599
+ const abs = path.startsWith("/") ? path : workspaceAbsolutePath(path);
600
+ await this.exec({
601
+ sandbox_id: input.sandbox_id,
602
+ argv: [
603
+ "rm",
604
+ "-f",
605
+ "--",
606
+ abs
607
+ ],
608
+ ...input.session_id && { session_id: input.session_id }
609
+ });
610
+ }
611
+ return {
612
+ sandbox_id: input.sandbox_id,
613
+ paths: input.paths,
614
+ ok: true
615
+ };
616
+ }
617
+ /**
618
+ * Copy an object-store ArtifactRef into the sandbox workspace.
619
+ * Requires auth.storage.
620
+ */
621
+ async importArtifact(input) {
622
+ const storage = this.#requireStorage("importArtifact");
623
+ if (input.source.store !== "object") throw new ToolError("Sandbox importArtifact only supports store=object ArtifactRefs", { code: "bad_input" });
624
+ const bytes = await storage.getBytes(input.source.key, { maxBytes: MAX_FILE_BYTES });
625
+ await this.#putFileBytes(input.sandbox_id, input.path, bytes, input.session_id);
626
+ return {
627
+ sandbox_id: input.sandbox_id,
628
+ path: input.path,
629
+ ok: true,
630
+ byte_length: bytes.byteLength
631
+ };
632
+ }
633
+ /**
634
+ * Copy a sandbox workspace file to object storage and return an ArtifactRef.
635
+ * Requires auth.storage.
636
+ */
637
+ async exportArtifact(input) {
638
+ const storage = this.#requireStorage("exportArtifact");
639
+ const bytes = await this.#getFileBytes(input.sandbox_id, input.path, input.session_id);
640
+ await storage.putBytes(input.destination_key, bytes);
641
+ return {
642
+ sandbox_id: input.sandbox_id,
643
+ path: input.path,
644
+ artifact: {
645
+ store: "object",
646
+ key: input.destination_key,
647
+ byte_length: bytes.byteLength
648
+ }
649
+ };
650
+ }
651
+ async createSession(input) {
652
+ const { data } = await this.#http.post(`/v1/sandbox/${encodeURIComponent(input.sandbox_id)}/session`, void 0, { label: "Cloudflare Sandbox createSession" });
653
+ if (!isPlainObject(data) || !isString(data["id"])) throw new ToolError("Unexpected create session response", { code: "upstream" });
654
+ return {
655
+ sandbox_id: input.sandbox_id,
656
+ session_id: data["id"]
657
+ };
658
+ }
659
+ async deleteSession(input) {
660
+ await this.#http.delete(`/v1/sandbox/${encodeURIComponent(input.sandbox_id)}/session/${encodeURIComponent(input.session_id)}`, { label: "Cloudflare Sandbox deleteSession" });
661
+ return {
662
+ sandbox_id: input.sandbox_id,
663
+ session_id: input.session_id,
664
+ deleted: true
665
+ };
666
+ }
667
+ /**
668
+ * Mount an S3-compatible bucket (or Worker R2 binding) at an absolute path in the sandbox.
669
+ * Bridge: `POST /v1/sandbox/:id/mount`.
670
+ * For Mastra / host workspace S3 FS: pass `endpoint` + credentials (or rely on auth.storage).
671
+ * @see https://developers.cloudflare.com/sandbox/bridge/http-api/#bucket-mounts
672
+ */
673
+ async mount(input) {
674
+ const parsed = mountBucketInputSchema.safeParse(input);
675
+ if (!parsed.success) throw new ToolError("Invalid sandbox mount input", {
676
+ code: "bad_input",
677
+ details: { issues: parsed.error.issues.map((issue) => issue.message) }
678
+ });
679
+ const data = parsed.data;
680
+ if (data.local_bucket && data.endpoint) throw new ToolError("local_bucket and endpoint are mutually exclusive on mount", { code: "bad_input" });
681
+ if (data.prefix !== void 0 && !data.prefix.startsWith("/")) throw new ToolError("mount prefix must start with /", { code: "bad_input" });
682
+ const endpoint = data.local_bucket ? void 0 : data.endpoint;
683
+ const accessKeyId = data.access_key_id ?? (endpoint !== void 0 ? this.#storageAuth?.access_key_id : void 0);
684
+ const secretAccessKey = data.secret_access_key ?? (endpoint !== void 0 ? this.#storageAuth?.secret_access_key : void 0);
685
+ const options = {};
686
+ if (endpoint) options["endpoint"] = endpoint;
687
+ if (data.provider) options["provider"] = data.provider;
688
+ if (data.read_only !== void 0) options["readOnly"] = data.read_only;
689
+ if (data.prefix) options["prefix"] = data.prefix;
690
+ if (data.credential_proxy !== void 0) options["credentialProxy"] = data.credential_proxy;
691
+ if (data.local_bucket) options["localBucket"] = true;
692
+ if (data.s3fs_options && data.s3fs_options.length > 0) options["s3fsOptions"] = data.s3fs_options;
693
+ if (endpoint && accessKeyId && secretAccessKey) options["credentials"] = {
694
+ accessKeyId,
695
+ secretAccessKey
696
+ };
697
+ const body = {
698
+ bucket: data.bucket,
699
+ mountPath: data.mount_path
700
+ };
701
+ if (Object.keys(options).length > 0) body["options"] = options;
702
+ await this.#http.post(`/v1/sandbox/${encodeURIComponent(data.sandbox_id)}/mount`, body, { label: "Cloudflare Sandbox mount" });
703
+ return {
704
+ sandbox_id: data.sandbox_id,
705
+ bucket: data.bucket,
706
+ mount_path: data.mount_path,
707
+ ok: true
708
+ };
709
+ }
710
+ /**
711
+ * Unmount a previously mounted bucket path.
712
+ * Bridge: `POST /v1/sandbox/:id/unmount` with `{ mountPath }`.
713
+ * Mounts are also cleared when the sandbox is destroyed.
714
+ */
715
+ async unmount(input) {
716
+ const parsed = unmountBucketInputSchema.safeParse(input);
717
+ if (!parsed.success) throw new ToolError("Invalid sandbox unmount input", {
718
+ code: "bad_input",
719
+ details: { issues: parsed.error.issues.map((issue) => issue.message) }
720
+ });
721
+ const data = parsed.data;
722
+ await this.#http.post(`/v1/sandbox/${encodeURIComponent(data.sandbox_id)}/unmount`, { mountPath: data.mount_path }, { label: "Cloudflare Sandbox unmount" });
723
+ return {
724
+ sandbox_id: data.sandbox_id,
725
+ mount_path: data.mount_path,
726
+ ok: true
727
+ };
728
+ }
729
+ #requireStorage(op) {
730
+ if (!this.#storage) throw new ToolError(`${op} requires storage credentials on sandbox auth`, { code: "bad_auth" });
731
+ return this.#storage;
732
+ }
733
+ async #putFileBytes(sandboxId, path, bytes, sessionId) {
734
+ const key = workspaceFileKey(path);
735
+ const headers = { "Content-Type": "application/octet-stream" };
736
+ if (sessionId) headers["Session-Id"] = sessionId;
737
+ const { data } = await this.#http.put(`/v1/sandbox/${encodeURIComponent(sandboxId)}/file/${key.split("/").map(encodeURIComponent).join("/")}`, toArrayBuffer(bytes), {
738
+ headers,
739
+ label: "Cloudflare Sandbox writeFile"
740
+ });
741
+ if (isPlainObject(data) && data["ok"] === false) throw new ToolError("Sandbox writeFile failed", { code: "upstream" });
742
+ }
743
+ async #getFileBytes(sandboxId, path, sessionId) {
744
+ const key = workspaceFileKey(path);
745
+ const headers = {};
746
+ if (sessionId) headers["Session-Id"] = sessionId;
747
+ const { bytes } = await this.#http.bytes("GET", `/v1/sandbox/${encodeURIComponent(sandboxId)}/file/${key.split("/").map(encodeURIComponent).join("/")}`, {
748
+ headers,
749
+ label: "Cloudflare Sandbox readFile",
750
+ maxBytes: MAX_FILE_BYTES
751
+ });
752
+ return bytes;
753
+ }
754
+ };
755
+ //#endregion
756
+ //#region src/vendors/cloudflare-sandbox/module.ts
757
+ const id = "cloudflare-sandbox";
758
+ const emptyInputSchema = z.object({});
759
+ const cloudflareSandboxHealthTool = defineTool({
760
+ id: `${id}-health`,
761
+ name: "cloudflareSandboxHealth",
762
+ description: "Check whether the Cloudflare Sandbox bridge is reachable. Use only for explicit availability diagnostics; ordinary sandbox work should begin with cloudflare-sandbox-create.",
763
+ inputSchema: emptyInputSchema,
764
+ outputSchema: healthOutputSchema,
765
+ sideEffect: "read",
766
+ runtime: "both",
767
+ network: true,
768
+ execute: async (_input, ctx) => CloudflareSandboxClient.fromContext(ctx).health()
769
+ });
770
+ const cloudflareSandboxCreateTool = defineTool({
771
+ id: `${id}-create`,
772
+ name: "cloudflareSandboxCreate",
773
+ description: "Create an isolated Cloudflare sandbox and return sandbox_id. Use only when arbitrary code, commands, or temporary files are required and no purpose-built tool covers the task. Do not create a sandbox to build or edit supported deliverables.",
774
+ inputSchema: emptyInputSchema,
775
+ outputSchema: createSandboxOutputSchema,
776
+ sideEffect: "write",
777
+ runtime: "both",
778
+ network: true,
779
+ execute: async (_input, ctx) => CloudflareSandboxClient.fromContext(ctx).create()
780
+ });
781
+ const cloudflareSandboxDestroyTool = defineTool({
782
+ id: `${id}-destroy`,
783
+ name: "cloudflareSandboxDestroy",
784
+ description: "Destroy a Cloudflare sandbox by sandbox_id and release its temporary files and resources. Call after the sandbox workflow is complete and any required output file has been exported.",
785
+ inputSchema: sandboxIdInputSchema,
786
+ outputSchema: destroySandboxOutputSchema,
787
+ sideEffect: "write",
788
+ runtime: "both",
789
+ network: true,
790
+ execute: async (input, ctx) => CloudflareSandboxClient.fromContext(ctx).destroy(input)
791
+ });
792
+ const cloudflareSandboxRunningTool = defineTool({
793
+ id: `${id}-running`,
794
+ name: "cloudflareSandboxRunning",
795
+ description: "Check whether a Cloudflare sandbox is currently running. Use before continuing work on an existing sandbox_id; this does not execute code or inspect files.",
796
+ inputSchema: sandboxIdInputSchema,
797
+ outputSchema: runningOutputSchema,
798
+ sideEffect: "read",
799
+ runtime: "both",
800
+ network: true,
801
+ execute: async (input, ctx) => CloudflareSandboxClient.fromContext(ctx).running(input)
802
+ });
803
+ const cloudflareSandboxExecTool = defineTool({
804
+ id: `${id}-exec`,
805
+ name: "cloudflareSandboxExec",
806
+ description: "One-shot argv exec in a Cloudflare sandbox (stdout/stderr/exit_code). Prefer a host workspace agent for multi-step shell; use tools for workflow one-shots. Optional env when the bridge supports it.",
807
+ inputSchema: execInputSchema,
808
+ outputSchema: execOutputSchema,
809
+ sideEffect: "write",
810
+ runtime: "both",
811
+ network: true,
812
+ tags: [
813
+ "exec",
814
+ "one-shot",
815
+ "compute"
816
+ ],
817
+ execute: async (input, ctx) => CloudflareSandboxClient.fromContext(ctx).exec(input)
818
+ });
819
+ const cloudflareSandboxExecuteCodeTool = defineTool({
820
+ id: `${id}-execute-code`,
821
+ name: "cloudflareSandboxExecuteCode",
822
+ description: "Execute Python, JavaScript, or shell source in a Cloudflare sandbox. Use as a fallback for computation or automation with no dedicated tool. Do not generate or edit supported documents, spreadsheets, presentations, PDFs, or images here when a purpose-built tool is available.",
823
+ inputSchema: executeCodeInputSchema,
824
+ outputSchema: execOutputSchema,
825
+ sideEffect: "write",
826
+ runtime: "both",
827
+ network: true,
828
+ execute: async (input, ctx) => CloudflareSandboxClient.fromContext(ctx).executeCode(input)
829
+ });
830
+ const cloudflareSandboxWriteFileTool = defineTool({
831
+ id: `${id}-write-file`,
832
+ name: "cloudflareSandboxWriteFile",
833
+ description: "Write one temporary file under the Cloudflare sandbox workspace from UTF-8 text or base64 bytes, up to 32 MiB decoded. Use for sandbox intermediates. This is not durable delivery; export a genuinely sandbox-produced final file with cloudflare-sandbox-export-artifact.",
834
+ inputSchema: writeFileInputSchema,
835
+ outputSchema: writeFileOutputSchema,
836
+ sideEffect: "write",
837
+ runtime: "both",
838
+ network: true,
839
+ execute: async (input, ctx) => CloudflareSandboxClient.fromContext(ctx).writeFile(input)
840
+ });
841
+ const cloudflareSandboxReadFileTool = defineTool({
842
+ id: `${id}-read-file`,
843
+ name: "cloudflareSandboxReadFile",
844
+ description: "Read one temporary file from the Cloudflare sandbox workspace as UTF-8 or base64. Use for sandbox intermediates; use format-aware readers for supported ArtifactRefs.",
845
+ inputSchema: readFileInputSchema,
846
+ outputSchema: readFileOutputSchema,
847
+ sideEffect: "read",
848
+ runtime: "both",
849
+ network: true,
850
+ execute: async (input, ctx) => CloudflareSandboxClient.fromContext(ctx).readFile(input)
851
+ });
852
+ const cloudflareSandboxWriteFilesTool = defineTool({
853
+ id: `${id}-write-files`,
854
+ name: "cloudflareSandboxWriteFiles",
855
+ description: "Write multiple temporary files under the Cloudflare sandbox workspace from text or base64. Use for sandbox intermediates, not final document generation. Export only a final file that the sandbox genuinely had to produce.",
856
+ inputSchema: writeFilesInputSchema,
857
+ outputSchema: writeFilesOutputSchema,
858
+ sideEffect: "write",
859
+ runtime: "both",
860
+ network: true,
861
+ execute: async (input, ctx) => CloudflareSandboxClient.fromContext(ctx).writeFiles(input)
862
+ });
863
+ const cloudflareSandboxReadFilesTool = defineTool({
864
+ id: `${id}-read-files`,
865
+ name: "cloudflareSandboxReadFiles",
866
+ description: "Read multiple temporary files from the Cloudflare sandbox workspace as UTF-8 or base64. Use only within an active sandbox workflow; use format-aware readers for supported ArtifactRefs.",
867
+ inputSchema: readFilesInputSchema,
868
+ outputSchema: readFilesOutputSchema,
869
+ sideEffect: "read",
870
+ runtime: "both",
871
+ network: true,
872
+ execute: async (input, ctx) => CloudflareSandboxClient.fromContext(ctx).readFiles(input)
873
+ });
874
+ const cloudflareSandboxListFilesTool = defineTool({
875
+ id: `${id}-list-files`,
876
+ name: "cloudflareSandboxListFiles",
877
+ description: "List temporary files under a Cloudflare sandbox directory, defaulting to /workspace. Use to locate sandbox intermediates, not durable workspace files or ArtifactRefs.",
878
+ inputSchema: listFilesInputSchema,
879
+ outputSchema: listFilesOutputSchema,
880
+ sideEffect: "read",
881
+ runtime: "both",
882
+ network: true,
883
+ execute: async (input, ctx) => CloudflareSandboxClient.fromContext(ctx).listFiles(input)
884
+ });
885
+ const cloudflareSandboxRemoveFilesTool = defineTool({
886
+ id: `${id}-remove-files`,
887
+ name: "cloudflareSandboxRemoveFiles",
888
+ description: "Remove temporary files from the Cloudflare sandbox workspace by path. Use only for sandbox cleanup; this does not delete durable workspace files or ArtifactRefs.",
889
+ inputSchema: removeFilesInputSchema,
890
+ outputSchema: removeFilesOutputSchema,
891
+ sideEffect: "delete",
892
+ runtime: "both",
893
+ network: true,
894
+ execute: async (input, ctx) => CloudflareSandboxClient.fromContext(ctx).removeFiles(input)
895
+ });
896
+ const cloudflareSandboxImportArtifactTool = defineTool({
897
+ id: `${id}-import-artifact`,
898
+ name: "cloudflareSandboxImportArtifact",
899
+ description: "Copy an existing object-store ArtifactRef into a Cloudflare sandbox workspace. Use only when arbitrary sandbox computation must consume that file. Do not import a supported document merely to read or edit it with general code.",
900
+ inputSchema: importArtifactInputSchema,
901
+ outputSchema: importArtifactOutputSchema,
902
+ sideEffect: "write",
903
+ runtime: "both",
904
+ network: true,
905
+ execute: async (input, ctx) => CloudflareSandboxClient.fromContext(ctx).importArtifact(input)
906
+ });
907
+ const cloudflareSandboxExportArtifactTool = defineTool({
908
+ id: `${id}-export-artifact`,
909
+ name: "cloudflareSandboxExportArtifact",
910
+ description: "Persist a final file that was genuinely created inside the Cloudflare sandbox and return its ArtifactRef for delivery. Use only after sandbox work. Do not call for files returned by document, presentation, PDF, image, render, or conversion tools; those ArtifactRefs are already final.",
911
+ inputSchema: exportArtifactInputSchema,
912
+ outputSchema: exportArtifactOutputSchema,
913
+ sideEffect: "write",
914
+ runtime: "both",
915
+ network: true,
916
+ execute: async (input, ctx) => CloudflareSandboxClient.fromContext(ctx).exportArtifact(input)
917
+ });
918
+ const cloudflareSandboxCreateSessionTool = defineTool({
919
+ id: `${id}-create-session`,
920
+ name: "cloudflareSandboxCreateSession",
921
+ description: "Create an isolated execution session inside an existing Cloudflare sandbox and return session_id. Use only when separate working directories or runtime state are needed; pass the id to later command and file calls.",
922
+ inputSchema: sandboxIdInputSchema,
923
+ outputSchema: createBridgeSessionOutputSchema,
924
+ sideEffect: "write",
925
+ runtime: "both",
926
+ network: true,
927
+ execute: async (input, ctx) => CloudflareSandboxClient.fromContext(ctx).createSession(input)
928
+ });
929
+ const cloudflareSandboxDeleteSessionTool = defineTool({
930
+ id: `${id}-delete-session`,
931
+ name: "cloudflareSandboxDeleteSession",
932
+ description: "Delete an isolated execution session inside a Cloudflare sandbox. Use after session-specific work is complete; this does not destroy the parent sandbox.",
933
+ inputSchema: deleteBridgeSessionInputSchema,
934
+ outputSchema: deleteBridgeSessionOutputSchema,
935
+ sideEffect: "write",
936
+ runtime: "both",
937
+ network: true,
938
+ execute: async (input, ctx) => CloudflareSandboxClient.fromContext(ctx).deleteSession(input)
939
+ });
940
+ const cloudflareSandboxModule = defineModule({
941
+ id,
942
+ title: "Cloudflare Sandbox",
943
+ description: "Cloudflare sandbox bridge: one-shot exec/files/sessions for workflows. Prefer a host workspace agent for multi-step shell. Client export remains first-class for Workspace hybrids. Prefer purpose-built document tools over sandbox for office formats.",
944
+ runtime: "both",
945
+ auth: {
946
+ type: "custom",
947
+ schema: cloudflareSandboxAuthSchema
948
+ },
949
+ categories: [
950
+ "compute",
951
+ "sandbox",
952
+ "cloudflare"
953
+ ],
954
+ classification: "standard",
955
+ tags: [
956
+ "exec",
957
+ "workspace",
958
+ "bridge"
959
+ ],
960
+ tools: [
961
+ cloudflareSandboxHealthTool,
962
+ cloudflareSandboxCreateTool,
963
+ cloudflareSandboxDestroyTool,
964
+ cloudflareSandboxRunningTool,
965
+ cloudflareSandboxExecTool,
966
+ cloudflareSandboxExecuteCodeTool,
967
+ cloudflareSandboxWriteFileTool,
968
+ cloudflareSandboxReadFileTool,
969
+ cloudflareSandboxWriteFilesTool,
970
+ cloudflareSandboxReadFilesTool,
971
+ cloudflareSandboxListFilesTool,
972
+ cloudflareSandboxRemoveFilesTool,
973
+ cloudflareSandboxImportArtifactTool,
974
+ cloudflareSandboxExportArtifactTool,
975
+ cloudflareSandboxCreateSessionTool,
976
+ cloudflareSandboxDeleteSessionTool
977
+ ]
978
+ });
979
+ //#endregion
980
+ export { readFileInputSchema as $, MAX_FILE_PATH as A, destroySandboxOutputSchema as B, workspaceAbsolutePath as C, MAX_ARG_CHARS as D, MAX_ARGV as E, cloudflareSandboxAuthSchema as F, exportArtifactOutputSchema as G, execOutputSchema as H, createBridgeSessionOutputSchema as I, importArtifactOutputSchema as J, healthOutputSchema as K, createSandboxOutputSchema as L, MAX_LIST_FILES as M, MAX_READ_PATHS as N, MAX_EXEC_TIMEOUT_MS as O, MAX_WRITE_FILES as P, mountBucketOutputSchema as Q, deleteBridgeSessionInputSchema as R, shellQuote as S, DEFAULT_EXEC_TIMEOUT_MS as T, executeCodeInputSchema as U, execInputSchema as V, exportArtifactInputSchema as W, listFilesOutputSchema as X, listFilesInputSchema as Y, mountBucketInputSchema as Z, cloudflareSandboxWriteFilesTool as _, cloudflareSandboxExecTool as a, runningOutputSchema as at, parseExecSse as b, cloudflareSandboxHealthTool as c, unmountBucketInputSchema as ct, cloudflareSandboxModule as d, writeFileOutputSchema as dt, readFileOutputSchema as et, cloudflareSandboxReadFileTool as f, writeFilesInputSchema as ft, cloudflareSandboxWriteFileTool as g, cloudflareSandboxRunningTool as h, cloudflareSandboxDestroyTool as i, removeFilesOutputSchema as it, MAX_FILE_TEXT as j, MAX_FILE_BYTES as k, cloudflareSandboxImportArtifactTool as l, unmountBucketOutputSchema as lt, cloudflareSandboxRemoveFilesTool as m, cloudflareSandboxCreateTool as n, readFilesOutputSchema as nt, cloudflareSandboxExecuteCodeTool as o, sandboxIdInputSchema as ot, cloudflareSandboxReadFilesTool as p, writeFilesOutputSchema as pt, importArtifactInputSchema as q, cloudflareSandboxDeleteSessionTool as r, removeFilesInputSchema as rt, cloudflareSandboxExportArtifactTool as s, sandboxObjectArtifactRefSchema as st, cloudflareSandboxCreateSessionTool as t, readFilesInputSchema as tt, cloudflareSandboxListFilesTool as u, writeFileInputSchema as ut, CloudflareSandboxClient as v, workspaceFileKey as w, resolveWriteFileBytes as x, executeCodeArgv as y, deleteBridgeSessionOutputSchema as z };
981
+
982
+ //# sourceMappingURL=cloudflare-sandbox-Dp_uNaqW.js.map