eve 0.82.0 → 0.83.0

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 (480) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/NOTICE +1 -1
  3. package/dist/src/channel/pending-authorization.d.ts +5 -0
  4. package/dist/src/channel/pending-authorization.js +1 -1
  5. package/dist/src/channel/session.d.ts +2 -0
  6. package/dist/src/channel/session.js +1 -1
  7. package/dist/src/channel/types.d.ts +5 -0
  8. package/dist/src/chunks/{use-eve-agent-DlznYwQk.js → use-eve-agent-3-WRmJkd.js} +40 -5
  9. package/dist/src/chunks/{use-eve-agent-DTu78IAF.js → use-eve-agent-Ci5dr0aR.js} +40 -5
  10. package/dist/src/cli/dev/local-server-child.js +1 -1
  11. package/dist/src/cli/dev/local-server-cleanup.js +1 -1
  12. package/dist/src/cli/dev/tui/question-panel.d.ts +4 -1
  13. package/dist/src/cli/dev/tui/question-panel.js +1 -1
  14. package/dist/src/cli/dev/tui/terminal-renderer.js +4 -4
  15. package/dist/src/client/eve-agent-store.d.ts +1 -1
  16. package/dist/src/client/eve-agent-store.js +1 -1
  17. package/dist/src/client/index.d.ts +1 -0
  18. package/dist/src/client/session-controls.d.ts +6 -0
  19. package/dist/src/client/session-controls.js +1 -1
  20. package/dist/src/client/session.d.ts +4 -0
  21. package/dist/src/client/session.js +1 -1
  22. package/dist/src/compiled/.vendor-stamp.json +8 -8
  23. package/dist/src/compiled/@eve/catalog/index.js +1 -1
  24. package/dist/src/compiled/@workflow/core/events-consumer.d.ts +2 -0
  25. package/dist/src/compiled/@workflow/core/index.js +2 -2
  26. package/dist/src/compiled/@workflow/core/private.d.ts +5 -3
  27. package/dist/src/compiled/@workflow/core/private.js +1 -1
  28. package/dist/src/compiled/@workflow/core/runtime/constants.d.ts +1 -37
  29. package/dist/src/compiled/@workflow/core/runtime/event-limit-warning.d.ts +32 -0
  30. package/dist/src/compiled/@workflow/core/runtime/helpers.d.ts +5 -6
  31. package/dist/src/compiled/@workflow/core/runtime/helpers.js +1 -1
  32. package/dist/src/compiled/@workflow/core/runtime/runs.d.ts +8 -0
  33. package/dist/src/compiled/@workflow/core/runtime/start.d.ts +16 -0
  34. package/dist/src/compiled/@workflow/core/runtime/suspension-handler.d.ts +15 -18
  35. package/dist/src/compiled/@workflow/core/runtime/vm-mode.d.ts +20 -0
  36. package/dist/src/compiled/@workflow/core/runtime.js +4 -4
  37. package/dist/src/compiled/@workflow/core/seeded-nanoid.d.ts +2 -0
  38. package/dist/src/compiled/@workflow/core/serialization/compression.d.ts +14 -3
  39. package/dist/src/compiled/@workflow/core/serialization.d.ts +1 -1
  40. package/dist/src/compiled/@workflow/core/serialization.js +1 -1
  41. package/dist/src/compiled/@workflow/core/telemetry/semantic-conventions.d.ts +0 -18
  42. package/dist/src/compiled/@workflow/core/version.d.ts +1 -1
  43. package/dist/src/compiled/@workflow/core/workflow.js +1 -1
  44. package/dist/src/compiled/@workflow/errors/index.d.ts +48 -0
  45. package/dist/src/compiled/@workflow/errors/index.js +1 -1
  46. package/dist/src/compiled/@workflow/world/env-config.d.ts +24 -0
  47. package/dist/src/compiled/@workflow/world/events.d.ts +126 -7
  48. package/dist/src/compiled/@workflow/world/index.d.ts +3 -3
  49. package/dist/src/compiled/@workflow/world/interfaces.d.ts +59 -8
  50. package/dist/src/compiled/@workflow/world/queue.d.ts +71 -9
  51. package/dist/src/compiled/@workflow/world/recovery.d.ts +6 -0
  52. package/dist/src/compiled/@workflow/world/test-support/duplicate-event-fixtures.d.ts +3 -0
  53. package/dist/src/compiled/@workflow/world/test-support/in-band-fence-conformance.d.ts +46 -0
  54. package/dist/src/compiled/@workflow/world-local/index.js +5 -5
  55. package/dist/src/compiled/@workflow/world-vercel/index.js +18 -18
  56. package/dist/src/compiled/_chunks/workflow/{attribute-changes-BW-kbMMn.js → attribute-changes-7se_SE2q.js} +3 -3
  57. package/dist/src/compiled/_chunks/workflow/dist-CcnNPAp4.js +1 -0
  58. package/dist/src/compiled/_chunks/workflow/dist-S9cZRway.js +3 -0
  59. package/dist/src/compiled/_chunks/workflow/helpers-CxNRXH0a.js +1 -0
  60. package/dist/src/compiled/_chunks/workflow/private-DLYTSBbu.js +1 -0
  61. package/dist/src/compiled/_chunks/workflow/resume-hook-CPiIfe8r.js +1 -0
  62. package/dist/src/compiled/_chunks/workflow/{run-DzdAqdb1.js → run-BJSLCXR4.js} +6 -6
  63. package/dist/src/compiled/_chunks/workflow/serialization-B9gneT9Z.js +15 -0
  64. package/dist/src/compiled/_chunks/workflow/sleep-BL0oQs3R.js +1 -0
  65. package/dist/src/compiled/_chunks/workflow/{wait-until-xbRRDuUf.js → wait-until-BPou0RGO.js} +1 -1
  66. package/dist/src/compiled/_chunks/workflow/workflow-routes-BaljomCk.js +1 -0
  67. package/dist/src/compiled/{@ai-sdk/code-mode → run}/LICENSE +1 -1
  68. package/dist/src/compiled/run/index.d.ts +384 -0
  69. package/dist/src/compiled/run/index.js +650 -0
  70. package/dist/src/compiler/extension-compatibility.d.ts +21 -14
  71. package/dist/src/compiler/extension-compatibility.js +1 -1
  72. package/dist/src/compiler/manifest.js +1 -1
  73. package/dist/src/compiler/normalize-agent-config.js +1 -1
  74. package/dist/src/compiler/normalize-manifest.js +1 -1
  75. package/dist/src/compiler/normalize-sandbox.js +1 -1
  76. package/dist/src/compiler/workspace-resources.js +1 -1
  77. package/dist/src/context/build-callback-context.js +1 -1
  78. package/dist/src/context/dynamic-skill-lifecycle.js +1 -1
  79. package/dist/src/context/providers/sandbox.js +1 -1
  80. package/dist/src/discover/extension-specifier.d.ts +1 -0
  81. package/dist/src/discover/extension-specifier.js +1 -1
  82. package/dist/src/evals/cli/eval.js +2 -2
  83. package/dist/src/evals/runner/artifacts.js +1 -1
  84. package/dist/src/evals/runner/derive-run-facts.d.ts +12 -0
  85. package/dist/src/evals/runner/derive-run-facts.js +1 -1
  86. package/dist/src/evals/runner/execute-task.js +1 -1
  87. package/dist/src/evals/types.d.ts +3 -2
  88. package/dist/src/eve-channel/index.js +1 -1
  89. package/dist/src/eve-channel/request.d.ts +0 -1
  90. package/dist/src/eve-channel/request.js +2 -2
  91. package/dist/src/execution/agent-sessions/context.d.ts +1 -1
  92. package/dist/src/execution/agent-sessions/context.js +1 -1
  93. package/dist/src/execution/coordination-dispatch-shared.d.ts +3 -0
  94. package/dist/src/execution/coordination-dispatch-shared.js +1 -1
  95. package/dist/src/execution/dynamic-workflow/program-step.d.ts +7 -7
  96. package/dist/src/execution/dynamic-workflow/program-step.js +1 -1
  97. package/dist/src/execution/dynamic-workflow/schema.d.ts +18 -11
  98. package/dist/src/execution/dynamic-workflow/schema.js +1 -1
  99. package/dist/src/execution/dynamic-workflow/tool.js +1 -1
  100. package/dist/src/execution/dynamic-workflow/workflow.js +1 -1
  101. package/dist/src/execution/eve-workflow-attributes.d.ts +3 -1
  102. package/dist/src/execution/eve-workflow-attributes.js +1 -1
  103. package/dist/src/execution/invoke-tool.js +1 -1
  104. package/dist/src/execution/sandbox/abort-bound-session.js +1 -1
  105. package/dist/src/execution/sandbox/active-connections.d.ts +28 -0
  106. package/dist/src/execution/sandbox/active-connections.js +1 -0
  107. package/dist/src/execution/sandbox/bindings/docker-cli.d.ts +10 -2
  108. package/dist/src/execution/sandbox/bindings/docker-cli.js +2 -2
  109. package/dist/src/execution/sandbox/bindings/docker-connection.d.ts +15 -0
  110. package/dist/src/execution/sandbox/bindings/docker-connection.js +2 -0
  111. package/dist/src/execution/sandbox/bindings/docker-container.d.ts +2 -0
  112. package/dist/src/execution/sandbox/bindings/docker-container.js +1 -1
  113. package/dist/src/execution/sandbox/bindings/docker-network.d.ts +5 -0
  114. package/dist/src/execution/sandbox/bindings/docker-network.js +1 -1
  115. package/dist/src/execution/sandbox/bindings/docker-templates.js +1 -1
  116. package/dist/src/execution/sandbox/bindings/docker.d.ts +12 -15
  117. package/dist/src/execution/sandbox/bindings/docker.js +1 -1
  118. package/dist/src/execution/sandbox/bindings/just-bash-runtime.d.ts +19 -29
  119. package/dist/src/execution/sandbox/bindings/just-bash-runtime.js +1 -1
  120. package/dist/src/execution/sandbox/bindings/just-bash.d.ts +2 -4
  121. package/dist/src/execution/sandbox/bindings/just-bash.js +1 -1
  122. package/dist/src/execution/sandbox/bindings/local-provider-utils.d.ts +0 -20
  123. package/dist/src/execution/sandbox/bindings/local-provider-utils.js +1 -1
  124. package/dist/src/execution/sandbox/bindings/local.d.ts +4 -6
  125. package/dist/src/execution/sandbox/bindings/local.js +1 -1
  126. package/dist/src/execution/sandbox/bindings/vercel-base-runtime.d.ts +2 -0
  127. package/dist/src/execution/sandbox/bindings/vercel-base-runtime.js +2 -2
  128. package/dist/src/execution/sandbox/bindings/vercel-errors.js +2 -2
  129. package/dist/src/execution/sandbox/bindings/vercel-lifecycle.d.ts +7 -5
  130. package/dist/src/execution/sandbox/bindings/vercel-lifecycle.js +1 -1
  131. package/dist/src/execution/sandbox/bindings/vercel.d.ts +5 -11
  132. package/dist/src/execution/sandbox/bindings/vercel.js +1 -2
  133. package/dist/src/execution/sandbox/development-cleanup.d.ts +0 -1
  134. package/dist/src/execution/sandbox/development-cleanup.js +1 -1
  135. package/dist/src/execution/sandbox/development-lazy-prewarm.js +1 -1
  136. package/dist/src/execution/sandbox/development-run.d.ts +0 -2
  137. package/dist/src/execution/sandbox/development-run.js +1 -1
  138. package/dist/src/execution/sandbox/dockerfile.d.ts +0 -4
  139. package/dist/src/execution/sandbox/dockerfile.js +1 -1
  140. package/dist/src/execution/sandbox/ensure.d.ts +23 -11
  141. package/dist/src/execution/sandbox/ensure.js +1 -1
  142. package/dist/src/execution/sandbox/glob-tool.js +3 -3
  143. package/dist/src/execution/sandbox/grep-tool.js +1 -1
  144. package/dist/src/execution/sandbox/logging-session.js +1 -1
  145. package/dist/src/execution/sandbox/prewarm.d.ts +23 -3
  146. package/dist/src/execution/sandbox/prewarm.js +2 -1
  147. package/dist/src/execution/sandbox/read-file.js +1 -1
  148. package/dist/src/execution/sandbox/require-sandbox.d.ts +3 -2
  149. package/dist/src/execution/sandbox/require-sandbox.js +1 -1
  150. package/dist/src/execution/sandbox/ripgrep-probe.js +1 -1
  151. package/dist/src/execution/sandbox/session.d.ts +10 -20
  152. package/dist/src/execution/sandbox/session.js +2 -2
  153. package/dist/src/execution/session/admission.js +1 -1
  154. package/dist/src/execution/session/checkpoint-migrations.js +1 -1
  155. package/dist/src/execution/session/entry-input.d.ts +5 -4
  156. package/dist/src/execution/session/entry.js +1 -1
  157. package/dist/src/execution/session/handoff-state.d.ts +5 -0
  158. package/dist/src/execution/session/handoff-state.js +1 -0
  159. package/dist/src/execution/session/handoff-steps.d.ts +0 -5
  160. package/dist/src/execution/session/handoff-steps.js +1 -1
  161. package/dist/src/execution/session/handoff.d.ts +2 -1
  162. package/dist/src/execution/session/handoff.js +1 -1
  163. package/dist/src/execution/session/input-queue.d.ts +3 -0
  164. package/dist/src/execution/session/input-queue.js +1 -1
  165. package/dist/src/execution/session/next-input.d.ts +3 -0
  166. package/dist/src/execution/session/next-input.js +1 -1
  167. package/dist/src/execution/session/program.js +1 -1
  168. package/dist/src/execution/session/timeout-control.d.ts +4 -0
  169. package/dist/src/execution/session/timeout-control.js +1 -1
  170. package/dist/src/execution/session/turn-control.d.ts +5 -2
  171. package/dist/src/execution/session/turn-control.js +1 -1
  172. package/dist/src/execution/session/turn.js +1 -1
  173. package/dist/src/execution/session-inbox/inbox.d.ts +9 -1
  174. package/dist/src/execution/session-inbox/inbox.js +1 -1
  175. package/dist/src/execution/session-inbox/protocol.d.ts +2 -1
  176. package/dist/src/execution/session-inbox/protocol.js +1 -1
  177. package/dist/src/execution/session-inbox/resume.d.ts +2 -1
  178. package/dist/src/execution/session-inbox/resume.js +1 -1
  179. package/dist/src/execution/session-prewarm.d.ts +8 -0
  180. package/dist/src/execution/session-prewarm.js +1 -0
  181. package/dist/src/execution/skills/instructions.js +1 -1
  182. package/dist/src/execution/tools/agent-router-workflow.js +1 -1
  183. package/dist/src/execution/tools/workflow/body.js +1 -1
  184. package/dist/src/execution/tools/workflow/step-context.d.ts +11 -0
  185. package/dist/src/execution/tools/workflow/step-execution.js +1 -1
  186. package/dist/src/execution/tools/workflow/step.js +1 -1
  187. package/dist/src/execution/workflow-runtime.js +1 -1
  188. package/dist/src/extensions/git/extension/lib/github-shell-schema.js +1 -1
  189. package/dist/src/framework/sources/modules/sandbox.d.ts +1 -1
  190. package/dist/src/harness/attachment-staging.d.ts +0 -7
  191. package/dist/src/harness/attachment-staging.js +1 -1
  192. package/dist/src/harness/hitl/index.d.ts +2 -1
  193. package/dist/src/harness/hitl/index.js +1 -1
  194. package/dist/src/harness/hitl/view.d.ts +1 -0
  195. package/dist/src/harness/hitl/view.js +1 -0
  196. package/dist/src/harness/model-call/run.js +1 -1
  197. package/dist/src/harness/semantic-errors/rules/sandbox.d.ts +3 -5
  198. package/dist/src/harness/semantic-errors/rules/sandbox.js +1 -1
  199. package/dist/src/harness/step/prompt.js +1 -1
  200. package/dist/src/harness/tool-history-repair.d.ts +9 -0
  201. package/dist/src/harness/tool-history-repair.js +1 -0
  202. package/dist/src/harness/tool-model-output.d.ts +19 -3
  203. package/dist/src/harness/tool-model-output.js +1 -1
  204. package/dist/src/internal/application/compiled-artifacts.js +8 -4
  205. package/dist/src/internal/application/optional-package-import.d.ts +10 -0
  206. package/dist/src/internal/application/optional-package-import.js +1 -1
  207. package/dist/src/internal/application/stamped-package-version.js +1 -1
  208. package/dist/src/internal/attachments/limited-read.d.ts +2 -2
  209. package/dist/src/internal/authored-module-build-options.d.ts +6 -0
  210. package/dist/src/internal/authored-module-build-options.js +1 -1
  211. package/dist/src/internal/authored-module-cache.d.ts +10 -0
  212. package/dist/src/internal/authored-module-cache.js +1 -0
  213. package/dist/src/internal/authored-module-graph.js +1 -1
  214. package/dist/src/internal/authored-module-loader.js +1 -1
  215. package/dist/src/internal/authored-relative-extension-resolver.js +1 -1
  216. package/dist/src/internal/bundler/nitro-rolldown.d.ts +3 -1
  217. package/dist/src/internal/bundler/nitro-rolldown.js +1 -1
  218. package/dist/src/internal/bundler/pseudo-packages.d.ts +11 -0
  219. package/dist/src/internal/bundler/pseudo-packages.js +1 -0
  220. package/dist/src/internal/nitro/host/build-extension.d.ts +6 -0
  221. package/dist/src/internal/nitro/host/build-extension.js +2 -2
  222. package/dist/src/internal/nitro/host/compiled-sandbox-provider-prune-plugin.d.ts +3 -1
  223. package/dist/src/internal/nitro/host/compiled-sandbox-provider-prune-plugin.js +3 -5
  224. package/dist/src/internal/nitro/host/create-application-nitro.d.ts +2 -3
  225. package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
  226. package/dist/src/internal/nitro/host/dev-authored-rebuild-coordinator.d.ts +2 -0
  227. package/dist/src/internal/nitro/host/dev-authored-rebuild-coordinator.js +1 -1
  228. package/dist/src/internal/nitro/host/dev-authored-source-watcher.js +1 -1
  229. package/dist/src/internal/nitro/host/dev-build-host.d.ts +83 -0
  230. package/dist/src/internal/nitro/host/dev-build-host.js +1 -0
  231. package/dist/src/internal/nitro/host/dev-build-operations.d.ts +6 -0
  232. package/dist/src/internal/nitro/host/dev-build-operations.js +1 -0
  233. package/dist/src/internal/nitro/host/dev-build-process.d.ts +1 -0
  234. package/dist/src/internal/nitro/host/dev-build-process.js +1 -0
  235. package/dist/src/internal/nitro/host/development-runtime-prune-plugin.d.ts +4 -1
  236. package/dist/src/internal/nitro/host/development-runtime-prune-plugin.js +3 -2
  237. package/dist/src/internal/nitro/host/drained-nitro-dev-server.d.ts +13 -0
  238. package/dist/src/internal/nitro/host/drained-nitro-dev-server.js +1 -1
  239. package/dist/src/internal/nitro/host/optional-engine-dependency-plugin.js +1 -1
  240. package/dist/src/internal/nitro/host/prepare-application-host.d.ts +3 -0
  241. package/dist/src/internal/nitro/host/prepare-application-host.js +1 -1
  242. package/dist/src/internal/nitro/host/sandbox-shutdown-plugin.js +1 -1
  243. package/dist/src/internal/nitro/host/start-development-server.js +2 -2
  244. package/dist/src/internal/nitro/host/start-production-server.js +3 -3
  245. package/dist/src/internal/nitro/host/workflow-sandbox-runtime-plugin.js +1 -1
  246. package/dist/src/internal/nitro/host.js +1 -1
  247. package/dist/src/internal/workflow/local-world-delivery-auth.d.ts +17 -0
  248. package/dist/src/internal/workflow/local-world-delivery-auth.js +1 -0
  249. package/dist/src/internal/workflow/queue-namespace.d.ts +2 -0
  250. package/dist/src/internal/workflow/queue-namespace.js +1 -1
  251. package/dist/src/internal/workflow-bundle/builder-support.d.ts +0 -1
  252. package/dist/src/internal/workflow-bundle/builder-support.js +2 -2
  253. package/dist/src/internal/workflow-bundle/builder.js +2 -2
  254. package/dist/src/internal/workflow-bundle/vercel-workflow-output.d.ts +1 -1
  255. package/dist/src/internal/workflow-bundle/vercel-workflow-output.js +1 -1
  256. package/dist/src/protocol/prewarm-session.d.ts +14 -0
  257. package/dist/src/protocol/prewarm-session.js +1 -0
  258. package/dist/src/protocol/routes.d.ts +2 -2
  259. package/dist/src/public/channels/discord/authorization.d.ts +45 -0
  260. package/dist/src/public/channels/discord/authorization.js +3 -0
  261. package/dist/src/public/channels/discord/defaults.d.ts +14 -3
  262. package/dist/src/public/channels/discord/defaults.js +2 -2
  263. package/dist/src/public/channels/discord/discordChannel.d.ts +15 -1
  264. package/dist/src/public/channels/discord/discordChannel.js +1 -1
  265. package/dist/src/public/channels/discord/gateway/connection.d.ts +26 -0
  266. package/dist/src/public/channels/discord/gateway/connection.js +1 -0
  267. package/dist/src/public/channels/discord/gateway/forwarder.d.ts +14 -0
  268. package/dist/src/public/channels/discord/gateway/forwarder.js +1 -0
  269. package/dist/src/public/channels/discord/gateway/index.d.ts +59 -0
  270. package/dist/src/public/channels/discord/gateway/index.js +1 -0
  271. package/dist/src/public/channels/discord/inbound.d.ts +10 -3
  272. package/dist/src/public/channels/discord/inbound.js +2 -2
  273. package/dist/src/public/channels/discord/index.d.ts +3 -2
  274. package/dist/src/public/channels/discord/index.js +1 -1
  275. package/dist/src/public/channels/discord/messages.d.ts +116 -0
  276. package/dist/src/public/channels/discord/messages.js +2 -0
  277. package/dist/src/public/channels/github/checkout.js +1 -1
  278. package/dist/src/public/channels/linq/linqChannel.d.ts +4 -1
  279. package/dist/src/public/channels/linq/linqChannel.js +1 -1
  280. package/dist/src/public/channels/photon/photonIMessageChannel.js +1 -1
  281. package/dist/src/public/channels/same-environment-oidc.d.ts +7 -0
  282. package/dist/src/public/channels/same-environment-oidc.js +1 -0
  283. package/dist/src/public/definitions/channel.js +1 -1
  284. package/dist/src/public/definitions/sandbox.d.ts +1 -1
  285. package/dist/src/public/next/server.js +1 -1
  286. package/dist/src/public/sandbox/docker-sandbox.d.ts +6 -1
  287. package/dist/src/public/sandbox/docker.d.ts +1 -8
  288. package/dist/src/public/sandbox/index.d.ts +3 -3
  289. package/dist/src/public/sandbox/just-bash-sandbox.d.ts +87 -7
  290. package/dist/src/public/sandbox/just-bash.d.ts +1 -1
  291. package/dist/src/public/sandbox/provider.d.ts +5 -1
  292. package/dist/src/public/sandbox/provider.js +1 -1
  293. package/dist/src/public/sandbox/vercel-sandbox.d.ts +16 -9
  294. package/dist/src/public/sandbox/vercel.d.ts +0 -1
  295. package/dist/src/public/sandbox/vercel.js +1 -1
  296. package/dist/src/public/tools/agent.d.ts +8 -1
  297. package/dist/src/public/tools/agent.js +1 -1
  298. package/dist/src/react/use-eve-agent.d.ts +1 -1
  299. package/dist/src/runtime/agent/resolve-model.js +1 -1
  300. package/dist/src/runtime/connections/openapi-client.d.ts +2 -0
  301. package/dist/src/runtime/connections/openapi-client.js +1 -1
  302. package/dist/src/runtime/resolve-agent-graph.js +1 -1
  303. package/dist/src/runtime/resolve-agent.js +1 -1
  304. package/dist/src/runtime/resolve-channel.js +1 -1
  305. package/dist/src/runtime/resolve-sandbox.js +1 -1
  306. package/dist/src/runtime/sandbox/prepared-artifacts.js +1 -1
  307. package/dist/src/runtime/sandbox/registry.d.ts +2 -0
  308. package/dist/src/runtime/sandbox/registry.js +1 -1
  309. package/dist/src/runtime/subagents/workflow.d.ts +6 -0
  310. package/dist/src/runtime/subagents/workflow.js +1 -1
  311. package/dist/src/runtime/workspace/seed-files.d.ts +9 -12
  312. package/dist/src/runtime/workspace/seed-files.js +1 -1
  313. package/dist/src/runtime/workspace/spec.d.ts +1 -1
  314. package/dist/src/runtime/workspace/spec.js +1 -1
  315. package/dist/src/runtime/workspace/types.d.ts +2 -6
  316. package/dist/src/sandbox/provider.d.ts +185 -0
  317. package/dist/src/sandbox/provider.js +1 -0
  318. package/dist/src/sandbox/providers/default.d.ts +20 -19
  319. package/dist/src/sandbox/providers/default.js +1 -1
  320. package/dist/src/sandbox/providers/docker.d.ts +5 -2
  321. package/dist/src/sandbox/providers/docker.js +1 -1
  322. package/dist/src/sandbox/providers/just-bash.d.ts +4 -3
  323. package/dist/src/sandbox/providers/just-bash.js +1 -1
  324. package/dist/src/sandbox/providers/vercel.d.ts +4 -10
  325. package/dist/src/sandbox/providers/vercel.js +1 -1
  326. package/dist/src/sandbox/providers.d.ts +0 -1
  327. package/dist/src/sandbox/providers.js +1 -1
  328. package/dist/src/sandbox/state.d.ts +44 -0
  329. package/dist/src/sandbox/state.js +1 -1
  330. package/dist/src/self-modification/deployed-sandbox.d.ts +4 -9
  331. package/dist/src/self-modification/deployed-sandbox.js +1 -1
  332. package/dist/src/self-modification/filesystem.d.ts +3 -3
  333. package/dist/src/self-modification/remote/config.d.ts +2 -2
  334. package/dist/src/self-modification/remote/config.js +1 -1
  335. package/dist/src/self-modification/setup.d.ts +0 -1
  336. package/dist/src/self-modification/setup.js +8 -8
  337. package/dist/src/setup/integrations/discord/api.d.ts +7 -0
  338. package/dist/src/setup/integrations/discord/api.js +1 -1
  339. package/dist/src/setup/integrations/discord/daemon.d.ts +18 -0
  340. package/dist/src/setup/integrations/discord/daemon.js +21 -0
  341. package/dist/src/setup/integrations/discord/setup.d.ts +24 -4
  342. package/dist/src/setup/integrations/discord/setup.js +5 -4
  343. package/dist/src/setup/integrations/self-modification/setup.js +1 -1
  344. package/dist/src/setup/scaffold/create/project.js +1 -1
  345. package/dist/src/setup/scaffold/update/web-options.js +1 -1
  346. package/dist/src/setup/scaffold/version-tokens.d.ts +0 -1
  347. package/dist/src/setup/scaffold/version-tokens.js +1 -1
  348. package/dist/src/shared/agent-definition.d.ts +2 -0
  349. package/dist/src/shared/built-server-start-failure.d.ts +12 -0
  350. package/dist/src/shared/built-server-start-failure.js +3 -0
  351. package/dist/src/shared/framework-eve-server.d.ts +2 -0
  352. package/dist/src/shared/framework-eve-server.js +2 -2
  353. package/dist/src/shared/sandbox-environment.d.ts +4 -10
  354. package/dist/src/shared/sandbox-environment.js +1 -1
  355. package/dist/src/shared/sandbox-network-policy.d.ts +45 -9
  356. package/dist/src/shared/sandbox-provider.d.ts +0 -103
  357. package/dist/src/shared/sandbox-provider.js +1 -1
  358. package/dist/src/shared/sandbox-recorded-data-error.d.ts +4 -0
  359. package/dist/src/shared/sandbox-recorded-data-error.js +1 -0
  360. package/dist/src/shared/sandbox-session-gone-error.d.ts +12 -0
  361. package/dist/src/shared/sandbox-session-gone-error.js +1 -0
  362. package/dist/src/shared/sandbox-session.d.ts +97 -83
  363. package/dist/src/shared/sandbox-template-error.d.ts +19 -4
  364. package/dist/src/shared/sandbox-template-error.js +1 -1
  365. package/dist/src/shared/sandbox-tool-session-error.d.ts +4 -0
  366. package/dist/src/shared/sandbox-tool-session-error.js +1 -0
  367. package/dist/src/shared/skill-package.js +1 -1
  368. package/dist/src/shared/skill-paths.d.ts +4 -5
  369. package/dist/src/shared/skill-paths.js +2 -2
  370. package/dist/src/shared/workflow-sandbox.d.ts +4 -41
  371. package/dist/src/shared/workflow-sandbox.js +1 -1
  372. package/dist/src/svelte/index.js +1 -1
  373. package/dist/src/svelte/use-eve-agent.d.ts +1 -1
  374. package/dist/src/svelte/use-eve-agent.js +1 -1
  375. package/dist/src/tools/model-output.d.ts +23 -5
  376. package/dist/src/tools/model-output.js +1 -1
  377. package/dist/src/tools/provided/ask-question-workflow.js +1 -1
  378. package/dist/src/tools/provided/glob.js +1 -1
  379. package/dist/src/tools/provided/grep.js +1 -1
  380. package/dist/src/tools/provided/read-file.js +1 -1
  381. package/dist/src/tools/provided/sleep-workflow.js +1 -1
  382. package/dist/src/tools/provided/workflow.js +1 -1
  383. package/dist/src/tools/provided/write-file.js +1 -1
  384. package/dist/src/tools/workflow-definition.d.ts +19 -4
  385. package/dist/src/vue/index.js +1 -1
  386. package/dist/src/vue/use-eve-agent.d.ts +1 -1
  387. package/dist/src/vue/use-eve-agent.js +1 -1
  388. package/docs/channels/custom.mdx +3 -3
  389. package/docs/channels/discord.mdx +279 -7
  390. package/docs/channels/eve.mdx +13 -2
  391. package/docs/channels/linq.mdx +2 -2
  392. package/docs/channels/mcp.mdx +2 -2
  393. package/docs/channels/overview.mdx +1 -1
  394. package/docs/channels/photon.mdx +1 -1
  395. package/docs/concepts/built-in-tools.md +31 -8
  396. package/docs/concepts/execution-model-and-durability.mdx +6 -101
  397. package/docs/concepts/security-model.md +2 -0
  398. package/docs/concepts/sessions-runs-and-streaming.md +44 -36
  399. package/docs/connections/openapi.mdx +2 -0
  400. package/docs/evals/reporters.mdx +1 -1
  401. package/docs/evals/running.mdx +1 -1
  402. package/docs/guides/client/messages.mdx +1 -1
  403. package/docs/guides/deployment/overview.md +4 -4
  404. package/docs/guides/deployment/self-hosting.md +50 -1
  405. package/docs/guides/dev-tui.md +1 -1
  406. package/docs/guides/dynamic-capabilities.md +1 -1
  407. package/docs/guides/frontend/overview.mdx +26 -6
  408. package/docs/guides/instrumentation/agent-runs.mdx +16 -0
  409. package/docs/guides/self-modification.md +1 -1
  410. package/docs/guides/session-context.md +1 -1
  411. package/docs/instructions.mdx +1 -1
  412. package/docs/reference/agent-files.md +3 -3
  413. package/docs/reference/cli.md +7 -2
  414. package/docs/reference/typescript-api.md +9 -3
  415. package/docs/sandbox/custom-providers.mdx +254 -0
  416. package/docs/sandbox/default.mdx +71 -4
  417. package/docs/sandbox/docker.mdx +15 -3
  418. package/docs/sandbox/index.mdx +27 -103
  419. package/docs/sandbox/just-bash.mdx +54 -0
  420. package/docs/sandbox/meta.json +9 -1
  421. package/docs/sandbox/troubleshooting.mdx +215 -0
  422. package/docs/sandbox/vercel.mdx +48 -7
  423. package/docs/skills.mdx +1 -1
  424. package/docs/subagents/index.mdx +2 -2
  425. package/docs/tools/overview.mdx +19 -0
  426. package/docs/tools/workflows.mdx +73 -5
  427. package/docs/tutorial/run-analysis.mdx +2 -2
  428. package/package.json +14 -20
  429. package/dist/src/compiled/@ai-sdk/code-mode/_run.d.ts +0 -1
  430. package/dist/src/compiled/@ai-sdk/code-mode/index.d.ts +0 -325
  431. package/dist/src/compiled/@ai-sdk/code-mode/index.js +0 -660
  432. package/dist/src/compiled/_chunks/workflow/dist-CyBgVS7g.js +0 -1
  433. package/dist/src/compiled/_chunks/workflow/dist-T5NnW-0k.js +0 -3
  434. package/dist/src/compiled/_chunks/workflow/helpers-DlLD3ov_.js +0 -1
  435. package/dist/src/compiled/_chunks/workflow/private-tQUuwBoQ.js +0 -1
  436. package/dist/src/compiled/_chunks/workflow/resume-hook-DMsV_b4n.js +0 -1
  437. package/dist/src/compiled/_chunks/workflow/serialization-DPdYS_w2.js +0 -16
  438. package/dist/src/compiled/_chunks/workflow/sleep-BY6leHh8.js +0 -1
  439. package/dist/src/compiled/_chunks/workflow/workflow-routes-CwqB063q.js +0 -1
  440. package/dist/src/execution/sandbox/active-handles.d.ts +0 -32
  441. package/dist/src/execution/sandbox/active-handles.js +0 -1
  442. package/dist/src/execution/sandbox/bindings/docker-session.d.ts +0 -6
  443. package/dist/src/execution/sandbox/bindings/docker-session.js +0 -2
  444. package/dist/src/execution/sandbox/bindings/immutable-resources.d.ts +0 -15
  445. package/dist/src/execution/sandbox/bindings/immutable-resources.js +0 -2
  446. package/dist/src/execution/sandbox/bindings/microsandbox-create.d.ts +0 -12
  447. package/dist/src/execution/sandbox/bindings/microsandbox-create.js +0 -1
  448. package/dist/src/execution/sandbox/bindings/microsandbox-lifecycle.d.ts +0 -42
  449. package/dist/src/execution/sandbox/bindings/microsandbox-lifecycle.js +0 -1
  450. package/dist/src/execution/sandbox/bindings/microsandbox-metadata.d.ts +0 -29
  451. package/dist/src/execution/sandbox/bindings/microsandbox-metadata.js +0 -1
  452. package/dist/src/execution/sandbox/bindings/microsandbox-network.d.ts +0 -18
  453. package/dist/src/execution/sandbox/bindings/microsandbox-network.js +0 -1
  454. package/dist/src/execution/sandbox/bindings/microsandbox-options.d.ts +0 -37
  455. package/dist/src/execution/sandbox/bindings/microsandbox-options.js +0 -1
  456. package/dist/src/execution/sandbox/bindings/microsandbox-platform.d.ts +0 -21
  457. package/dist/src/execution/sandbox/bindings/microsandbox-platform.js +0 -21
  458. package/dist/src/execution/sandbox/bindings/microsandbox-process.d.ts +0 -3
  459. package/dist/src/execution/sandbox/bindings/microsandbox-process.js +0 -1
  460. package/dist/src/execution/sandbox/bindings/microsandbox-provider-state.d.ts +0 -11
  461. package/dist/src/execution/sandbox/bindings/microsandbox-provider-state.js +0 -1
  462. package/dist/src/execution/sandbox/bindings/microsandbox-runtime.d.ts +0 -82
  463. package/dist/src/execution/sandbox/bindings/microsandbox-runtime.js +0 -1
  464. package/dist/src/execution/sandbox/bindings/microsandbox-templates.d.ts +0 -12
  465. package/dist/src/execution/sandbox/bindings/microsandbox-templates.js +0 -1
  466. package/dist/src/execution/sandbox/bindings/microsandbox.d.ts +0 -16
  467. package/dist/src/execution/sandbox/bindings/microsandbox.js +0 -1
  468. package/dist/src/execution/sandbox/provider-host-development.d.ts +0 -2
  469. package/dist/src/execution/sandbox/provider-host-development.js +0 -1
  470. package/dist/src/execution/sandbox/provider-host.d.ts +0 -2
  471. package/dist/src/execution/sandbox/provider-host.js +0 -1
  472. package/dist/src/execution/tool-session/sandbox.d.ts +0 -22
  473. package/dist/src/execution/tool-session/sandbox.js +0 -1
  474. package/dist/src/public/sandbox/microsandbox-sandbox.d.ts +0 -48
  475. package/dist/src/public/sandbox/microsandbox-sandbox.js +0 -1
  476. package/dist/src/public/sandbox/microsandbox.d.ts +0 -9
  477. package/dist/src/public/sandbox/microsandbox.js +0 -1
  478. package/dist/src/sandbox/providers/microsandbox.d.ts +0 -12
  479. package/dist/src/sandbox/providers/microsandbox.js +0 -1
  480. package/docs/sandbox/microsandbox.mdx +0 -31
@@ -78,7 +78,7 @@ export function Chat() {
78
78
  | `error` | The latest session creation, stream, resume, or turn failure. |
79
79
  | `events` | Raw eve stream events for this session. |
80
80
  | `session` | Serializable fixed session cursor (`sessionId`, `streamIndex`). |
81
- | `prewarm` | Create the durable session without starting a turn. |
81
+ | `prewarm` | Create a session or prepare its idle owner without starting a turn. |
82
82
  | `send` | Send text or a multi-part message, with per-turn options. |
83
83
  | `respond` | Answer pending HITL input requests, with per-turn options. |
84
84
  | `resume` | Replay an attached session and follow its in-flight turn. |
@@ -131,7 +131,7 @@ An initial `true` value or a later `false` to `true` change prepares the current
131
131
  Changing `prewarm` back to `false` does not abort creation or discard an existing session. If
132
132
  a reset and state update happen in the same event, React applies both before deciding whether
133
133
  to prepare the next session. Vue and Svelte read `prewarm` when their binding is created; call
134
- their returned `prewarm()` method for interaction-driven creation.
134
+ their returned `prewarm()` method when typing starts.
135
135
 
136
136
  Prewarming defaults to `false`: the first send creates the session. Set it to `true` only after
137
137
  your application's auth, headers, and any chat-record binding are ready. Applications that
@@ -141,15 +141,35 @@ Prewarming starts the workflow and establishes its inbox, then parks before sess
141
141
  dynamic definitions, or sandbox setup run. The first message passes through the channel's
142
142
  `onMessage` hook and supplies the identity and context for initialization and `turn_0`.
143
143
 
144
- The explicit `prewarm()` method resolves on `202 Accepted`, as does `client.sessions.create()`.
145
- It does not wait for an initialization event; concurrent calls share the same create request.
144
+ For an existing session, `prewarm()` checks the owner against the exact deployment accepting
145
+ that request. On Vercel, an idle owner on another deployment can transfer in the background
146
+ before Send. The session ID, history, stream, and expiry stay the same; no model call runs.
147
+ An owner already serving that deployment needs no workflow wake-up. Active turns are never
148
+ interrupted; an active turn can finish before preparation, and a queued real message takes priority.
149
+ An owner with pending tasks or input requests can skip the hint.
150
+ Older owners without preparation support and Worlds without deployment affinity are left alone.
151
+
152
+ Call `agent.prewarm()` once when a new typing burst begins, with an application-level cooldown
153
+ if you also retry during long drafts. eve shares concurrent calls; it does not listen to inputs
154
+ or poll deployments. `prewarm: true` also prepares a restored session when the binding mounts.
155
+ A production alias targets its current deployment; a preview alias targets that preview.
156
+ Requests pinned to an immutable deployment (including deployment-skew routing) cannot discover
157
+ a newer deployment. Local development retains session-creation behavior.
158
+
159
+ `client.sessions.attach(sessionId).prewarm({ signal })` returns `ready`, `accepted`,
160
+ `unsupported`, or `no_active_session`. `accepted` means the hint was persisted, not that handoff
161
+ has finished. It never replaces an expired session. Send retains its existing retry and
162
+ handoff behavior if preparation is unavailable, fails, or has not finished.
163
+
164
+ The explicit `prewarm()` method resolves after ingress acceptance, as does `client.sessions.create()`.
165
+ It does not wait for an initialization event; concurrent calls share the same preparation request.
146
166
  The composer stays `"ready"`, meaning it can accept input, and prewarming does not run
147
- `prepareSend`. A concurrent `send()` waits only for acceptance, then posts the message.
167
+ `prepareSend`. A concurrent `send()` waits for initial creation acceptance when needed, but never waits for existing-session preparation.
148
168
  If the inbox is still starting, the client retries `409 session_not_ready` with bounded
149
169
  exponential backoff for up to 20 seconds. The caller's abort signal cancels the wait. Stream
150
170
  events are not a prerequisite for sending.
151
171
 
152
- A failed create sets `error` and calls `onError` when no send is waiting. A waiting send can
172
+ An existing-session preparation failure rejects the explicit call without setting the composer's error or blocking Send. A failed create sets `error` and calls `onError` when no send is waiting. A waiting send can
153
173
  fall back to creating a session with its message. After creation succeeds, initialization
154
174
  failures arrive on the stream during the first turn. The configured session timeout starts
155
175
  at creation, so an unused prewarmed session can expire before its first message. React does not
@@ -40,6 +40,22 @@ Tracing starts as soon as you save the rule. You can also manage sampling
40
40
  rules with [`vercel traces config`](https://vercel.com/docs/cli/traces#manage-trace-sampling-rules).
41
41
  The CLI accepts rates from 1 to 100%; add a 0% rule from the dashboard.
42
42
 
43
+ ## Trace selected paths
44
+
45
+ If you prefer path-scoped sampling, replace the all-path rule with 100% rules
46
+ for each required **Request Path Prefix**. For a single agent at the default
47
+ mount, start with:
48
+
49
+ - `/eve/v1`: eve's HTTP API and default channel endpoints.
50
+ - `/.well-known/workflow`: workflow execution and webhooks.
51
+
52
+ For named agents, use their deployed prefixes, such as `/eve/support/v1`,
53
+ instead of `/eve/v1`. Include custom channel routes and, for Vercel-backed
54
+ schedule collections,
55
+ `/.well-known/eve/v1/schedules/consumer`. Missing paths can leave traces
56
+ incomplete. The workflow prefix also includes non-eve workflows in the same
57
+ project.
58
+
43
59
  ## Configure Agent Runs
44
60
 
45
61
  Preview and production deployments export to Vercel Agent Runs by default.
@@ -74,7 +74,7 @@ export default selfModification({
74
74
  | `credentials` | Required. An object with a `resolve({ capability, repository })` function that returns a GitHub token, or `{ pat: true }` to read `EVE_SELF_MODIFICATION_GITHUB_TOKEN` from the deployment environment. |
75
75
  | `model`, `reasoning` | Optional model and reasoning level for the deployed subagent. It defaults to the parent agent's model. |
76
76
 
77
- The deployed subagent is never offered during `eve dev`. In a deployment, it needs a sandbox provider that supports runtime credential transforms: Vercel Sandbox on Vercel, or microsandbox on a supported self-hosted system. eve applies the GitHub token as a sandbox network credential only while it checks out or publishes, so commands in the sandbox cannot read it.
77
+ The deployed subagent is never offered during `eve dev`. It requires deploying on Vercel, where Vercel Sandbox provides the runtime credential transforms that keep the GitHub token out of the sandbox. Builds succeed on any host, but in a deployment outside Vercel the deployed subagent fails with an error that names this requirement when it opens its sandbox. Don't mount `eve/self-modification/remote` in self-hosted deployments. eve applies the GitHub token as a sandbox network credential only while it checks out or publishes, so commands in the sandbox cannot read it.
78
78
 
79
79
  ## Run without self-modification
80
80
 
@@ -46,7 +46,7 @@ Public fields include:
46
46
  - `auth.current`: the caller for the active inbound turn.
47
47
  - `auth.initiator`: the caller that started the session.
48
48
  - `parent`: the parent call, session, root session, and turn for a child subagent session.
49
- - `predecessor`: present when eve started this session in place of a [stranded session](../concepts/execution-model-and-durability#stranded-sessions). Its `sessionId` names the session this one replaced. Read the earlier conversation with `sessions.attach(predecessor.sessionId)` from `eve/server`. See [What a replacement session receives](../concepts/execution-model-and-durability#what-a-replacement-session-receives).
49
+ - `predecessor`: present only when this session replaced a stranded one; `sessionId` names that earlier session. See [Recover a stranded session](./deployment/self-hosting#recover-a-stranded-session) to read its earlier conversation.
50
50
 
51
51
  Unprotected agents expose `auth.current` and `auth.initiator` as `null`. Top-level schedule sessions use the framework app principal (`principalId: "eve:app"`, `principalType: "runtime"`). See [Authentication](./auth-and-route-protection#what-reaches-ctxsessionauth) for how inbound identity becomes session auth.
52
52
 
@@ -80,7 +80,7 @@ A dynamic system result applies at its lifecycle scope. A dynamic user result is
80
80
 
81
81
  The `messages` snapshot passed to a `session.started` resolver includes static user instructions. A `turn.started` resolver additionally sees user instructions produced at `session.started`. Other dynamic capability resolvers keep their existing snapshots.
82
82
 
83
- See [Dynamic capabilities](./guides/dynamic-capabilities) for examples and failure behavior. To give a session that replaced a [stranded session](./concepts/execution-model-and-durability#what-a-replacement-session-receives) the earlier conversation, read its stream with `sessions.attach()` and `transcriptReducer()` in a `session.started` user-role instruction.
83
+ See [Dynamic capabilities](./guides/dynamic-capabilities) for examples and failure behavior. For a `session.started` instruction that reads the earlier conversation into a replacement session, see [Recover a stranded session](./guides/deployment/self-hosting#recover-a-stranded-session).
84
84
 
85
85
  ## History controls and prompt caching
86
86
 
@@ -58,8 +58,8 @@ Paths below are relative to the agent directory. Root agents can use every path;
58
58
  | `skills/` | On-demand procedures and capability packs | Yes | Flat Markdown, module-backed skills, or packaged skills. |
59
59
  | `lib/` | Shared authored helper code | Yes | Import-only; not copied into the sandbox. |
60
60
  | `memory.ts` or `memory/<name>.ts` | Cross-session memory | Yes | Provider-backed slots. See [Memory](/docs/memory). |
61
- | `sandbox.ts` or `sandbox/sandbox.ts` | The agent's sandbox | Yes | The framework default applies when neither is authored. |
62
- | `sandbox/workspace/**` | Files seeded into the sandbox | Yes | Mirrored into `/workspace/` when a session starts. |
61
+ | `sandbox.ts` or `sandbox/sandbox.ts` | The agent's sandbox | Yes | The framework default applies when neither is authored. When `sandbox/` exists, only `sandbox/sandbox.ts` is read. |
62
+ | `sandbox/workspace/**` | Files seeded into the sandbox | Yes | Copied into the prepared environment; each new session sandbox starts with them in the workspace root. |
63
63
  | `tools/` | Typed executable integrations | Yes | Module-backed only. |
64
64
  | `schedules/` | Recurring jobs | No | `defineSchedule` modules or Markdown prompts with `cron` frontmatter; recursive nesting is supported. |
65
65
  | `subagents/` | Specialist child agents | Yes | Local directories or remote-agent definitions; nested subagents are supported. |
@@ -82,7 +82,7 @@ Explicit imports, sandbox workspace files, and packaged skill resources are unaf
82
82
 
83
83
  ## Files available in the sandbox
84
84
 
85
- Agent source files are not automatically available to shell commands. Put files to copy into the sandbox's `/workspace/` under `agent/sandbox/workspace/`. Skill runtime files are seeded separately under `$HOME/.agents/skills/`, with `/workspace/skills/` as a fallback. See [Sandboxes](/docs/sandbox) and [Skills](/docs/skills).
85
+ Agent source files are not automatically available to shell commands. Put files to copy into the sandbox's workspace root (`/workspace/` on built-in providers) under `agent/sandbox/workspace/`. Skill runtime files are seeded separately under `$HOME/.agents/skills/`, with `skills/` under the workspace root as the fallback when the sandbox has no usable `$HOME`. See [Sandboxes](/docs/sandbox) and [Skills](/docs/skills).
86
86
 
87
87
  ## Local subagents
88
88
 
@@ -210,8 +210,13 @@ eve build [--profile <path>] [--skip-sandbox-prewarm]
210
210
  Compiles and bundles in an invocation-owned directory under `.eve/builds/`, prepares sandbox artifacts, then publishes the completed host output and prints its path. Scratch workspaces are removed after success or failure. Pass `--skip-sandbox-prewarm` when you only need compiled output, such as before a separate typecheck. Skipping preparation can produce output that cannot start its configured sandbox, so do not deploy that output.
211
211
 
212
212
  Authored bundles preserve custom Node.js resolution conditions supplied through `--conditions`,
213
- `-C`, or `NODE_OPTIONS`. For example, `NODE_OPTIONS="--conditions=react-server" eve build`
214
- keeps a channel's `server-only` imports on the same export used during compilation.
213
+ `-C`, or `NODE_OPTIONS`, so compilation and the bundle resolve each package to the same export.
214
+ For example, `NODE_OPTIONS="--conditions=react-server" eve build` selects the `react-server`
215
+ export of packages that publish one.
216
+
217
+ eve loads `server-only` and `client-only` imports as empty modules in every bundle it builds. Code
218
+ shared with a Next.js app can keep these imports without a resolution condition, and your app does
219
+ not need to depend on either package.
215
220
 
216
221
  | Flag | Type | Default | Description |
217
222
  | ------------------------ | ------ | ------- | --------------------------------------------------------------------------------------------- |
@@ -48,7 +48,9 @@ export default defineTool({
48
48
  | `defineHook` | `eve/hooks` | `agent/hooks/<slug>.ts` | [Hooks](../guides/hooks) |
49
49
  | `defineSchedule` | `eve/schedules` | `agent/schedules/<name>.ts` | [Schedules](../schedules) |
50
50
  | `defineState` | `eve/context` | tools, hooks, lifecycle | [Session context](../guides/session-context) |
51
- | `defineSandbox` | `eve/sandbox` | `agent/sandbox.ts` | [Sandbox](../sandbox) |
51
+ | `defineSandbox` | `eve/sandbox` | `agent/sandbox.ts` or `agent/sandbox/sandbox.ts` | [Sandbox](../sandbox) |
52
+ | `defineParentSandbox` | `eve/sandbox` | `agent/subagents/<name>/sandbox.ts` | [Sandbox](../sandbox#share-a-parent-sandbox) |
53
+ | `defineSandboxProvider` | `eve/sandbox/provider` | custom sandbox provider modules | [Custom providers](../sandbox/custom-providers) |
52
54
  | `defineInstrumentation` | `eve/instrumentation` | `agent/instrumentation/<name>.ts` | [Instrumentation](../observability/instrumentation) |
53
55
  | `otel`, `otelIntegration` | `eve/instrumentation/otel` | `agent/instrumentation/<destination>.ts` | [OpenTelemetry](../observability/otel) |
54
56
  | `defineRemoteAgent` | `eve` | `agent/subagents/<id>/agent.ts` | [Remote agents](../guides/remote-agents) |
@@ -111,7 +113,7 @@ import template from "../../prompts/template.txt?raw";
111
113
  | `ctx.requireAuth(provider)` | Evict and re-authorize an inline provider, commonly after a downstream `401` |
112
114
  | `ctx.approval` | Present only while a call runs after a person approved it: `responder` is who approved it and `responder.getToken(provider)` resolves their token. The call still runs as `ctx.session.auth.current`; see [Human-in-the-loop](/docs/human-in-the-loop) |
113
115
 
114
- Tool definitions accept `availableInSubagents: false` to restrict the tool to top-level root sessions, and `deferred: true` to keep the tool out of the model's tool list so the model finds it with `eve__search` and calls it with `eve__tool`; see [Tools](../tools#keep-a-tool-out-of-the-tool-list). `defineTool` definitions accept `endsTurn: true`, or a function that receives the `execute` output, to end the turn without a reply after a successful call; see [Tools](../tools#end-the-turn-after-a-tool-call). Authored workflow bodies also receive `ctx.agents`, a replay-stable map of callable-agent metadata, and `ctx.agent(name)`, which returns an `AgentSession` whose `send(message, options?)` resolves to a response with `result()`. A `"use step"` helper that receives the context directly should type it as `WorkflowStepToolContext`, which excludes `agents`, `agent`, and `ask`. The root-copy `agent` entry has an empty description when the root omits `description`. See [Workflows as tools](../tools/workflows#delegate-work-ctxagent) for the workflow-only context.
116
+ Tool definitions accept `availableInSubagents: false` to restrict the tool to top-level root sessions, and `deferred: true` to keep the tool out of the model's tool list so the model finds it with `eve__search` and calls it with `eve__tool`; see [Tools](../tools#keep-a-tool-out-of-the-tool-list). `defineTool` definitions accept `endsTurn: true`, or a function that receives the `execute` output, to end the turn without a reply after a successful call; see [Tools](../tools#end-the-turn-after-a-tool-call). Authored workflow bodies also receive `ctx.agents`, a replay-stable map of callable-agent metadata, and `ctx.agent(name)`, which returns an `AgentSession` whose `send(message, options?)` resolves to a response with `result()`. A `"use step"` helper that receives the context directly should type it as `WorkflowStepToolContext`, which excludes `agents`, `agent`, and `ask`; its `getSandbox()` opens the sandbox of the session that called the tool (see [Use the session sandbox in a step](../tools/workflows#use-the-session-sandbox-in-a-step)). The root-copy `agent` entry has an empty description when the root omits `description`. See [Workflows as tools](../tools/workflows#delegate-work-ctxagent) for the workflow-only context.
115
117
 
116
118
  ## Imports at a glance
117
119
 
@@ -140,7 +142,11 @@ Tool definitions accept `availableInSubagents: false` to restrict the tool to to
140
142
  | `eve/memory/file` | `fileMemory`, `inMemory`, and the conditional document backend contract |
141
143
  | `eve/memory/file/vercel` | `vercelBlob` and Vercel Blob backend options |
142
144
  | `eve/context` | `defineState`, session and state types |
143
- | `eve/sandbox` | `defineSandbox`, provider environments, and sandbox session types |
145
+ | `eve/sandbox` | `defineSandbox`, `defineParentSandbox`, `DefaultSandbox`, and sandbox session and network policy types |
146
+ | [`eve/sandbox/provider`](../sandbox/custom-providers) | `defineSandboxProvider`, provider errors, `SANDBOX_AGENT_ENV`, and connection and lifecycle types |
147
+ | [`eve/sandbox/docker`](../sandbox/docker) | `DockerSandbox` and Docker environment and session types |
148
+ | [`eve/sandbox/vercel`](../sandbox/vercel) | `VercelSandbox` and Vercel environment, session, and mount types |
149
+ | [`eve/sandbox/just-bash`](../sandbox/just-bash) | `JustBashSandbox` and just-bash environment types |
144
150
  | `eve/instrumentation` | `defineInstrumentation`, `disableInstrumentation`, `isChannel`, lifecycle provider types |
145
151
  | `eve/instrumentation/otel` | `otel`, `otelIntegration`, `localTraces`, `agentRuns`, OpenTelemetry policy types |
146
152
  | `eve/local-dev` | `getLocalDevCapability`, `LocalDevCapability` |
@@ -0,0 +1,254 @@
1
+ ---
2
+ title: "Custom Sandbox Providers"
3
+ description: "Connect eve to your own sandbox backend with defineSandboxProvider()."
4
+ ---
5
+
6
+ A custom sandbox provider connects eve to a backend that eve does not ship, such as your own container service or virtual machine pool. You implement a byte-level connection to one sandbox and four lifecycle methods. eve derives the full sandbox session from the connection, seeds workspace and skill files into templates, hashes template keys, and maps `sandbox.stop()`, `sandbox.delete()`, and server shutdown onto the lifecycle.
7
+
8
+ ## Define a provider
9
+
10
+ `defineSandboxProvider()` from `eve/sandbox/provider` takes a name and an `environment()` function that returns the lifecycle. This example targets `@acme/sdk`, a hypothetical client for a snapshot-capable machine service:
11
+
12
+ ```ts title="agent/lib/acme-sandbox.ts"
13
+ import { createHash } from "node:crypto";
14
+ import {
15
+ defineSandboxProvider,
16
+ SANDBOX_AGENT_ENV,
17
+ SandboxSessionGoneError,
18
+ type SandboxConnection,
19
+ } from "eve/sandbox/provider";
20
+ import { AcmeClient, type AcmeMachine } from "@acme/sdk";
21
+
22
+ export const AcmeSandbox = defineSandboxProvider({
23
+ name: "acme",
24
+ environment(options: { readonly project: string }) {
25
+ const acme = new AcmeClient({ project: options.project });
26
+ // Session ids can be long, so hash them into a bounded machine name.
27
+ const nameFor = (sessionId: string) =>
28
+ `eve-${createHash("sha256").update(sessionId).digest("hex").slice(0, 32)}`;
29
+ return {
30
+ async prepare(ctx) {
31
+ const template = `eve-tpl-${ctx.templateKey({ project: options.project, version: 1 }).slice(0, 32)}`;
32
+ const cached = await acme.snapshots.find(template);
33
+ if (cached !== null) return { snapshotId: cached.id };
34
+ const machine = await acme.machines.create({
35
+ env: SANDBOX_AGENT_ENV,
36
+ image: "ubuntu:24.04",
37
+ });
38
+ try {
39
+ await ctx.populate(connect(machine));
40
+ return { snapshotId: (await machine.snapshot({ name: template })).id };
41
+ } finally {
42
+ await machine.destroy();
43
+ }
44
+ },
45
+ async start(ctx, open: { readonly egress?: "allow-all" | "deny-all" } | undefined, artifact) {
46
+ const name = nameFor(ctx.session.id);
47
+ // Atomic create-if-absent: an existing machine is returned unchanged,
48
+ // so `egress` and the snapshot apply only on creation.
49
+ const machine = await acme.machines.createIfAbsent({
50
+ egress: open?.egress ?? "allow-all",
51
+ env: SANDBOX_AGENT_ENV,
52
+ name,
53
+ snapshotId: artifact.snapshotId,
54
+ });
55
+ return { connection: connect(machine), state: { name, version: 1 } };
56
+ },
57
+ async resume(_ctx, _artifact, state) {
58
+ const machine = await acme.machines.get(state.name);
59
+ if (machine === null)
60
+ throw new SandboxSessionGoneError(`Acme machine "${state.name}" is gone.`);
61
+ return connect(machine);
62
+ },
63
+ async onSessionEnd(ctx, state, { abortSignal }) {
64
+ await acme.machines.destroyIfExists(state?.name ?? nameFor(ctx.session.id), {
65
+ signal: abortSignal,
66
+ });
67
+ },
68
+ };
69
+ },
70
+ });
71
+
72
+ function connect(machine: AcmeMachine): SandboxConnection {
73
+ return {
74
+ spawn: ({ abortSignal, command, env, workingDirectory }) =>
75
+ machine.exec({
76
+ argv: ["bash", "-lc", command],
77
+ cwd: workingDirectory,
78
+ env,
79
+ signal: abortSignal,
80
+ }),
81
+ // Acme returns `null` for a missing path and rejects for a directory.
82
+ readFile: ({ abortSignal, path }) => machine.files.read(path, { signal: abortSignal }),
83
+ writeFiles: ({ abortSignal, files }) =>
84
+ machine.files.write(files, { mkdirs: true, signal: abortSignal }),
85
+ removePath: ({ abortSignal, force, path, recursive }) =>
86
+ machine.files.remove(path, { force, recursive, signal: abortSignal }),
87
+ stop: () => machine.suspend(),
88
+ };
89
+ }
90
+ ```
91
+
92
+ Use the provider from a sandbox file like any built-in environment. Every provider accepts the standard `prepare` option:
93
+
94
+ ```ts title="agent/sandbox.ts"
95
+ import { defineSandbox } from "eve/sandbox";
96
+ import { AcmeSandbox } from "./lib/acme-sandbox";
97
+
98
+ export const environment = AcmeSandbox.environment({
99
+ project: "agents",
100
+ prepare: async (sandbox) => {
101
+ await sandbox.run({ command: "apt-get install -y ripgrep" });
102
+ },
103
+ });
104
+
105
+ export default defineSandbox(() => environment.open({ egress: "deny-all" }));
106
+ ```
107
+
108
+ `environment(options)` always receives an object, without `prepare`: `{}` when the sandbox file passes no options, so make every field optional or require the caller to pass it. TypeScript infers the environment options, open options, artifact, state, and connection extensions from the implementation, so you do not pass type arguments. Write `start()` before `resume()` so the state type comes from `start()`'s return value, or annotate `resume()`'s `state` parameter.
109
+
110
+ ## Implement the connection
111
+
112
+ A `SandboxConnection` is the byte-level link to one sandbox. Each method has a fixed contract:
113
+
114
+ - `spawn({ command, workingDirectory, env, abortSignal })` runs `command` as a Bash login-shell script (`bash -lc`) in `workingDirectory`, with the sandbox's environment plus `env`. `env` holds only the per-call variables. Aborting kills the process tree. It resolves to a process with `stdout` and `stderr` byte streams, `wait()`, and `kill()`.
115
+ - `readFile({ path, abortSignal })` resolves to the file's bytes or a byte stream, or to `null` only when the path does not exist. A directory or an unreadable path rejects.
116
+ - `writeFiles({ files, abortSignal })` writes every file, creating missing parent directories and overwriting existing files. It is the only write primitive.
117
+ - `removePath({ path, force, recursive, abortSignal })` removes a file or directory. `force` ignores a missing path, and `recursive` removes a non-empty directory.
118
+ - `stop()` releases compute and keeps the sandbox's files.
119
+ - `close()` is optional. It releases what this process holds for the connection, such as a local interpreter or child processes, without touching the sandbox. eve calls it whenever it lets go of a connection: when the step that opened it ends, after `stop()`, and before deletion. A connection lasts at most one step, so the next step resumes the sandbox through a new connection.
120
+ - `extensions` is optional. It is a plain object whose own properties eve merges onto the session, such as `setNetworkPolicy()`. Use closures rather than class methods, because eve does not copy inherited members.
121
+ - `workspaceRoot` is optional. It is the session's workspace root: the absolute sandbox directory where commands start by default. It defaults to `/workspace`, which every built-in provider uses. Set it when your sandbox keeps its working files somewhere else, such as `/home/user/project`. The directory must exist before eve runs a command in it.
122
+
123
+ Every path a connection receives is absolute, and `workingDirectory` is always set. eve resolves relative paths and a missing or relative working directory from the workspace root before it calls the connection, and `session.resolvePath(".")` returns the root. The built-in file tools, attachment staging, and GitHub checkouts use the same root. eve throws when it opens a connection whose `workspaceRoot` is not absolute:
124
+
125
+ ```text
126
+ Sandbox connection workspaceRoot must be an absolute path, but received "project".
127
+ ```
128
+
129
+ eve builds the rest of the session from these methods: `run()` over `spawn()`, the binary and text read and write variants, encodings and line ranges, `writeFiles()`, `resolvePath()`, and abort-signal binding. An extension member named like a session method, or `stop` or `delete`, is a type error, and eve throws when it opens the connection:
130
+
131
+ ```text
132
+ Sandbox connection extensions cannot replace the session members eve provides: run. Rename them.
133
+ ```
134
+
135
+ Type the connection with its extensions, such as `SandboxConnection<{ setNetworkPolicy(policy: SandboxNetworkPolicy): Promise<void> }>`, and `environment.open()` and `ctx.getSandbox(environment)` return a session that includes them.
136
+
137
+ ## Implement the lifecycle
138
+
139
+ eve calls the lifecycle methods at these points:
140
+
141
+ | When | eve calls |
142
+ | ----------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
143
+ | `eve build`, or the first sandbox access in `eve dev` | `prepare(ctx)`, and stores the artifact it returns with the deployment |
144
+ | The first sandbox access in a session | `start(ctx, options, artifact)` from `environment.open(options)` in the selector |
145
+ | A later workflow step or process | `resume(ctx, artifact, state)` |
146
+ | The step that opened a connection ends | `connection.close()`, for a turn's step, a `"use step"` function, or an `invokeTool` call |
147
+ | `sandbox.stop()` | `connection.stop()`, then `connection.close()` |
148
+ | `sandbox.delete()` | `connection.close()`, then `onSessionEnd(ctx, state, { reason: "deleted" })` |
149
+ | The eve server shuts down | `connection.stop()`, then `connection.close()`, on every connection eve still holds: any connection mid-step, and between steps a connection without `close()`; eve logs failures and does not throw them |
150
+ | The owning session reaches a terminal outcome | `connection.close()` on a connection the ending step still holds, then `onSessionEnd(ctx, state, { reason })` with `"completed"`, `"expired"`, or `"failed"` |
151
+
152
+ eve calls `close()` at most once per connection, retrying only after a failure. After a turn's step ends, eve keeps a connection without `close()` registered, so server shutdown still stops the session's sandbox. eve lets go of a connection with `close()` at the end of its step or after `stop()`, so server shutdown between steps does not stop that sandbox. If your provider defines `close()` and runs remote compute, bound idle compute yourself, for example with an idle timeout. `stop()` can run again after the session uses a stopped connection, so make it a no-op when the sandbox is already stopped. A failed `close()` never prevents `onSessionEnd()` from deleting the sandbox.
153
+
154
+ ### `prepare()`
155
+
156
+ `prepare()` builds a reusable template and returns a JSON-compatible artifact, such as a snapshot or image id. It runs during `eve build`, so the deployment ships with the artifact, and the production runtime never calls it. A running sandbox keeps the template it started from: `resume()` receives the current deployment's artifact, but reconnects existing state.
157
+
158
+ `ctx.isEmpty` is `true` when the agent has no workspace files, no skill files, and no authored `prepare`. A provider can skip building a template in that case. See [Bake files into templates](#bake-files-into-templates) for `ctx.populate()` and `ctx.templateKey()`.
159
+
160
+ ### `start()`
161
+
162
+ `start()` returns the sandbox for `ctx.session.id`, creating it when none exists, together with the minimal JSON-compatible state eve checkpoints for the session. It must be an idempotent upsert: repeated, concurrent, cross-process, and cross-deployment calls for one session id return the same sandbox while it exists and is usable. A subagent that shares its parent's sandbox can open it before the parent does, and two processes can race to create it.
163
+
164
+ Derive the sandbox's native identity from `ctx.session.id` and a provider-level namespace, such as a project or account, only. Never derive it from the open options or the artifact, which can differ between callers and deployments. Apply them only when `start()` creates the sandbox.
165
+
166
+ `ctx.session.id` is the id of the session that owns the sandbox. For a subagent that shares its parent's sandbox it is the parent's id. `ctx.kind` is `"tool-session"` for a keyed `invokeTool` call's sandbox and `"session"` otherwise.
167
+
168
+ ### `resume()`
169
+
170
+ `resume()` reconnects to the sandbox that `state` names and never recreates it. Open options are not passed to `resume()`, so put anything reconnection needs in the state. When the sandbox no longer exists, throw `SandboxSessionGoneError`: eve clears the session's state and reruns the selector, which starts a fresh sandbox without the lost sandbox's files. Let other failures, such as an outage, surface unchanged.
171
+
172
+ Validate the shape of your own state in `resume()`. When you change it incompatibly, raise `stateProtocolVersion` in the provider definition: state recorded under another version starts a fresh sandbox instead of reaching `resume()`.
173
+
174
+ ### `onSessionEnd()`
175
+
176
+ `onSessionEnd()` deletes whatever exists for `ctx.session.id`. `state` is `null` when the session never recorded it, for example when only a subagent that shares the sandbox opened it, or when a step failed before its checkpoint, so find the sandbox from the session id. The method must succeed when nothing exists and must be idempotent, because eve retries the cleanup step. eve logs an exhausted failure without replacing the session's outcome.
177
+
178
+ `sandbox.delete()` uses the same method with `reason: "deleted"` and the caller's `abortSignal`, so a provider has one deletion path. A subagent that shares its parent's sandbox never calls it, because cleanup belongs to the parent. An `invokeTool` call without a key calls it when the call ends if the tool requested the sandbox.
179
+
180
+ ## Bake files into templates
181
+
182
+ Call `ctx.populate(connection)` on the build instance before you capture it. `populate()` writes the agent's workspace files to the connection's workspace root and its skill files to `$HOME/.agents/skills` in one `writeFiles()` batch, then runs the authored `prepare` callback with a session over the same connection. eve finds `$HOME` by running a command through `spawn()`. When the sandbox has no usable home directory, skills go to `skills/` under the workspace root.
183
+
184
+ A provider that can mount host directories can avoid writing every file. `ctx.resourcesDirectory()` resolves to a stable read-only host directory that contains `workspace/` and `skills/`, or to `undefined` when there is none. Mount it in the build instance and pass its sandbox path:
185
+
186
+ ```ts
187
+ const resources = await ctx.resourcesDirectory();
188
+ const machine = await acme.machines.create({
189
+ mounts:
190
+ resources === undefined ? [] : [{ host: resources, path: "/eve/resources", readOnly: true }],
191
+ });
192
+ await ctx.populate(
193
+ connect(machine),
194
+ resources === undefined ? undefined : { mountedAt: "/eve/resources" },
195
+ );
196
+ ```
197
+
198
+ With `mountedAt`, `populate()` copies `<mountedAt>/workspace/.` into the workspace root and `<mountedAt>/skills/.` into `$HOME/.agents/skills` with `cp -a`. When eve has no resource directory, `populate()` ignores `mountedAt` and writes the files instead.
199
+
200
+ `ctx.templateKey(identity)` returns a SHA-256 hex key that changes whenever `identity`, the workspace files, the skill files, or the sandbox file's source changes. Pass every option that affects the template, such as the base image, and use the key to name or look up a cached template. `identity` accepts JSON values, `undefined` (omitted), plain objects and arrays, and functions (hashed by their source). `resources` and `sourceRevision` are reserved, and eve throws if `identity` sets either one. The source revision covers only the sandbox file, so a `prepare` callback imported from another module does not change the key.
201
+
202
+ Only build time seeds files. A sandbox that `start()` creates gets them from the template, so a provider whose templates cannot hold files cannot provide workspace or skill files.
203
+
204
+ ## Keep sandboxes for keyed tool calls
205
+
206
+ Set `toolSessions: true` on the implementation to let keyed `invokeTool` calls keep their sandbox between calls, as Vercel Sandbox and just-bash do. A keyed call does not own its sandbox: eve runs the selector and `start()` on every call, calls `connection.close()` when the call ends, and never calls `onSessionEnd()`. Because nothing ever ends a keyed sandbox, the provider must bound its retention, for example with snapshot expiration.
207
+
208
+ Without `toolSessions`, a keyed call fails when its tool requests the sandbox:
209
+
210
+ ```text
211
+ Sandbox provider "acme" cannot keep a sandbox between invokeTool calls, so a call with a key cannot open one.
212
+ ```
213
+
214
+ A keyed call whose tool never requests the sandbox runs normally. See [MCP tool sessions](/docs/channels/mcp#tool-sessions).
215
+
216
+ ## Enforce network policy
217
+
218
+ eve has no built-in network control for custom providers. To offer one, accept a `SandboxNetworkPolicy` from `eve/sandbox` as an open option, as a `setNetworkPolicy()` extension, or both. Reject any part of a policy that the backend cannot enforce instead of weakening it. For example, a backend that can only switch egress on or off accepts `"allow-all"` and `"deny-all"` and throws on allow-lists, subnets, and header transforms, as the Docker provider does.
219
+
220
+ ## Set environment variables
221
+
222
+ `SANDBOX_AGENT_ENV` is `{ AI_AGENT: "eve" }`, which tells agent-aware CLIs to skip interactive prompts. Apply it beneath your environment-level variables when you create the sandbox, as the built-in providers do. A per-call `env` passed to `spawn()` overrides both. If the backend has no sandbox-level environment, merge it beneath the per-call `env` in `spawn()` instead, as in `{ ...SANDBOX_AGENT_ENV, ...env }`.
223
+
224
+ ## Report missing templates
225
+
226
+ Throw `SandboxTemplateNotProvisionedError` from `start()` or `resume()` when the artifact names an image, snapshot, or template that no longer exists:
227
+
228
+ ```ts
229
+ import { SandboxTemplateNotProvisionedError } from "eve/sandbox/provider";
230
+
231
+ throw new SandboxTemplateNotProvisionedError({
232
+ providerName: "acme",
233
+ reason: "The snapshot expired.",
234
+ templateKey: artifact.snapshotId,
235
+ });
236
+ ```
237
+
238
+ eve surfaces the error to the caller and never retries or rebuilds the template at runtime. eve throws the same error when a deployment has no artifact for the sandbox. Template retention and pruning stay with the provider. See [Sandbox troubleshooting](/docs/sandbox/troubleshooting#sandbox-template--is-not-available-to-this-runtime).
239
+
240
+ ## Migrate from the handle-based API
241
+
242
+ Earlier releases asked a provider to return a handle with a complete sandbox session. To move a provider to the current API:
243
+
244
+ - Return `{ connection, state }` from `start()` and a connection from `resume()`, instead of a handle. Move provider-specific session methods to `extensions`.
245
+ - Remove `onSandboxStop()` and `onRuntimeShutdown()`; implement `connection.stop()`. Move `onSandboxDelete()` into `onSessionEnd()`, which receives `reason: "deleted"`.
246
+ - Replace hashes of `ctx.resources` and `ctx.sourceRevision` with `ctx.templateKey()`, and replace writes of resource files plus your own `prepare` call with `ctx.populate()`. Remove `prepare` from your environment options; eve owns it.
247
+ - Replace `ctx.host.resolveProjectPath()` with `ctx.resolveProjectPath()`. `ctx.host.loadOptionalPackage()` is no longer available; import your SDK directly.
248
+ - Drop the explicit type arguments to `defineSandboxProvider()` and let TypeScript infer them. `environment()` now receives `{}` instead of `undefined` when the sandbox file passes no options.
249
+ - Rename `SandboxPreparedArtifact` to `SandboxJson`, `SandboxProviderSessionContext` to `SandboxSessionContext`, and `SandboxProviderPrepareContext` to `SandboxPrepareContext`. `SandboxProviderHandle`, `SandboxProviderResources`, `SandboxProviderResourceTree`, `SandboxProviderResourceFile`, `SandboxProviderResourceSource`, and `SandboxProviderTargetFile` are removed.
250
+
251
+ Two changes in `eve/sandbox` also affect code outside providers:
252
+
253
+ - `SandboxSession` has a required `writeFiles()` method, so an object you build by hand as a `SandboxSession`, such as a test double, needs one.
254
+ - `SandboxNetworkPolicy` is an eve-owned type with `readonly` members instead of the Vercel Sandbox SDK's `NetworkPolicy`. Code that passes a policy to the SDK directly needs its own conversion.
@@ -1,9 +1,9 @@
1
1
  ---
2
2
  title: "Default Sandbox"
3
- description: "Let eve select the sandbox provider for the current environment."
3
+ description: "Let eve select the sandbox provider when it prepares the sandbox."
4
4
  ---
5
5
 
6
- `DefaultSandbox.environment()` preserves eve's standard behavior without exposing provider-specific live creation options.
6
+ `DefaultSandbox.environment()` selects a sandbox provider when eve prepares the sandbox, records the choice, and uses that provider for every session the build serves.
7
7
 
8
8
  ```ts
9
9
  import { DefaultSandbox, defineSandbox } from "eve/sandbox";
@@ -12,6 +12,73 @@ export const environment = DefaultSandbox.environment();
12
12
  export default defineSandbox(() => environment.open());
13
13
  ```
14
14
 
15
- On Vercel, it selects [Vercel Sandbox](/docs/sandbox/vercel). Elsewhere, it tries [Docker](/docs/sandbox/docker), [microsandbox](/docs/sandbox/microsandbox), and [just-bash](/docs/sandbox/just-bash), in that order, according to host support.
15
+ On Vercel, it selects [Vercel Sandbox](/docs/sandbox/vercel). Elsewhere, it selects [Docker](/docs/sandbox/docker) when a Docker daemon is reachable, and [just-bash](/docs/sandbox/just-bash) only during `eve dev` and `eve eval`.
16
16
 
17
- Use a provider directly when you need its image, VM, network, compute, or mount options.
17
+ ## How eve selects the provider
18
+
19
+ eve selects the provider when it prepares the sandbox: during `eve build`, or during `eve dev` the first time a session opens the sandbox. It checks in this order:
20
+
21
+ 1. If the `VERCEL` environment variable is set, it selects Vercel.
22
+ 2. Otherwise, if `docker version` reports a running Linux Docker daemon within five seconds, it selects Docker.
23
+ 3. Otherwise, during `eve dev` and `eve eval`, it selects just-bash.
24
+ 4. Otherwise, in a production `eve build`, it selects no provider.
25
+
26
+ | Where eve prepares the sandbox | Selected provider |
27
+ | ------------------------------------------------- | --------------------------------------------- |
28
+ | On Vercel (`vercel build` or a Vercel deploy) | [Vercel Sandbox](/docs/sandbox/vercel) |
29
+ | Anywhere a Linux Docker daemon is reachable | [Docker](/docs/sandbox/docker) |
30
+ | `eve dev` or `eve eval` without Docker | [just-bash](/docs/sandbox/just-bash) |
31
+ | A production `eve build` without Vercel or Docker | None: opening the sandbox fails with an error |
32
+
33
+ Production builds never fall back to just-bash, because just-bash runs no native processes and provides no network isolation. When no provider is available, `eve build` still succeeds and logs that no provider is available. The first session that opens the sandbox fails with an error that asks you to start Docker and rebuild, deploy to Vercel, or select a provider explicitly in your sandbox file. See [Sandbox troubleshooting](/docs/sandbox/troubleshooting).
34
+
35
+ ## The build records the choice
36
+
37
+ `eve build` stores the selected provider in the build's prepared sandbox artifact. At runtime, `DefaultSandbox` reads the recorded provider and does not check for Vercel or Docker again, so the build and the server it produces always use the same provider, even when the server runs on a different host. To change the provider, rebuild where the provider you want is available.
38
+
39
+ Each session also records the provider that created its sandbox. If a later build selects a different provider, a session that resumes on the new build starts a fresh sandbox from the new provider, without the old sandbox's files. eve does not delete the old sandbox: a Vercel Sandbox stays in your Vercel project, and a Docker container stays on the Docker host until you remove it.
40
+
41
+ ## Environment options
42
+
43
+ `DefaultSandbox.environment()` accepts options for each provider it might select. eve passes only the selected provider's options and ignores the rest:
44
+
45
+ ```ts
46
+ import { DefaultSandbox, defineSandbox } from "eve/sandbox";
47
+
48
+ export const environment = DefaultSandbox.environment({
49
+ prepare: async (sandbox) => {
50
+ await sandbox.writeTextFile({ path: "notes/README.md", content: "Analysis notes\n" });
51
+ },
52
+ docker: { env: { APP_MODE: "agent" } },
53
+ vercel: { region: "iad1" },
54
+ justBash: { autoInstall: false },
55
+ });
56
+
57
+ export default defineSandbox(() => environment.open());
58
+ ```
59
+
60
+ | Option | Used when | Accepts |
61
+ | ---------- | --------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
62
+ | `prepare` | Any provider | Setup captured in the prepared environment. Replaces a `prepare` set inside the provider options. |
63
+ | `docker` | Docker is selected | The options of [`DockerSandbox.environment()`](/docs/sandbox/docker#environment-options), such as `image`, `env`, and `pullPolicy`. |
64
+ | `vercel` | Vercel is selected | The options of [`VercelSandbox.environment()`](/docs/sandbox/vercel), such as `region`, `resources`, and credentials. |
65
+ | `justBash` | just-bash is selected | The options of [`JustBashSandbox.environment()`](/docs/sandbox/just-bash), such as `autoInstall` and `customCommands`. |
66
+
67
+ Keep a shared `prepare` callback portable, because it runs on whichever provider eve selects. just-bash runs no native binaries, so commands such as `apt-get` fail there during `eve dev`.
68
+
69
+ On Vercel, when the environment has no `prepare` callback, workspace seed, skill files, or `source`, eve skips the snapshot and creates each session sandbox directly from the configured `image`, or from eve's base image when none is set. See [Vercel Sandbox](/docs/sandbox/vercel#snapshot-preparation).
70
+
71
+ ## Network policy
72
+
73
+ Pass `networkPolicy` to `open()`, or call `setNetworkPolicy()` on the session from `ctx.getSandbox(environment)`. eve forwards the policy to the selected provider:
74
+
75
+ ```ts
76
+ import { DefaultSandbox, defineSandbox } from "eve/sandbox";
77
+
78
+ export const environment = DefaultSandbox.environment();
79
+ export default defineSandbox(() => environment.open({ networkPolicy: "deny-all" }));
80
+ ```
81
+
82
+ Vercel Sandbox accepts every network policy, including domain allow-lists and credential transforms. Docker accepts only `"allow-all"` and `"deny-all"` and rejects any other policy with an error. just-bash always allows network access, so it accepts only `"allow-all"` and rejects any other policy with an error. Use [Vercel Sandbox](/docs/sandbox/vercel) directly when you need domain-level policies in every environment.
83
+
84
+ Use a provider directly when you need its other `open()` options, such as Vercel compute resources or Drive `mounts`.
@@ -14,16 +14,28 @@ export const environment = DockerSandbox.image("ghcr.io/acme/agent@sha256:...");
14
14
  export default defineSandbox(() => environment.open({ networkPolicy: "deny-all" }));
15
15
  ```
16
16
 
17
- Use `DockerSandbox.environment()` for the default image or `DockerSandbox.dockerfile()` for the colocated Dockerfile convention.
17
+ ## Choose the base image
18
+
19
+ `DockerSandbox.environment()`, `DockerSandbox.image()`, and `DockerSandbox.dockerfile()` all create the same Docker environment. They differ only in how you pass the base image:
20
+
21
+ | Constructor | Base image without a Dockerfile |
22
+ | ------------------------------------------- | ---------------------------------------- |
23
+ | `DockerSandbox.environment({ image })` | `image`, or eve's default image if unset |
24
+ | `DockerSandbox.image("ghcr.io/acme/agent")` | The image reference you pass |
25
+ | `DockerSandbox.dockerfile()` | eve's default image |
26
+
27
+ When `agent/sandbox/Dockerfile` exists, eve builds it during preparation and uses the result as the base image for every constructor. The Dockerfile takes precedence over any `image` you pass, including `DockerSandbox.image(ref)`. eve uses the files under `agent/sandbox/` as the Docker build context. To use an existing image instead, remove the Dockerfile.
28
+
29
+ `DockerSandbox.dockerfile()` does not accept an `image` option, which makes the Dockerfile convention explicit in your sandbox file.
18
30
 
19
31
  ## Environment options
20
32
 
21
- Image, pull policy, environment variables, and `prepare` belong to the reusable environment. During preparation, eve starts a temporary container, hydrates managed resources, runs authored preparation, and commits the result as the recorded template image.
33
+ Image, pull policy, environment variables, and `prepare` belong to the reusable environment. During preparation, eve starts a temporary container, seeds workspace and skill files, runs your `prepare`, and commits the result as the recorded template image.
22
34
 
23
35
  ## Live container options
24
36
 
25
37
  Pass `networkPolicy` to `open()`. Docker supports only `"allow-all"` and `"deny-all"`. The policy applies to the live container, not the prepared image.
26
38
 
27
- A session-owned container keeps writable `/workspace` state in its container filesystem. A stopped container restarts with that state.
39
+ A session-owned container keeps writable `/workspace` state in its container filesystem. A stopped container restarts with that state. `sandbox.delete()` removes the session's container by name and succeeds when the container is already gone.
28
40
 
29
41
  See the [sandbox overview](/docs/sandbox) for managed workspace, skills, parent inheritance, and custom providers.