eve 0.82.0 → 0.83.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.
- package/CHANGELOG.md +81 -0
- package/NOTICE +1 -1
- package/dist/src/channel/pending-authorization.d.ts +5 -0
- package/dist/src/channel/pending-authorization.js +1 -1
- package/dist/src/channel/session.d.ts +2 -0
- package/dist/src/channel/session.js +1 -1
- package/dist/src/channel/types.d.ts +5 -0
- package/dist/src/chunks/{use-eve-agent-DTu78IAF.js → use-eve-agent-DnbG9c7c.js} +73 -14
- package/dist/src/chunks/{use-eve-agent-DlznYwQk.js → use-eve-agent-ZY7NQ2VW.js} +73 -14
- package/dist/src/cli/dev/local-server-child.js +1 -1
- package/dist/src/cli/dev/local-server-cleanup.js +1 -1
- package/dist/src/cli/dev/tui/question-panel.d.ts +4 -1
- package/dist/src/cli/dev/tui/question-panel.js +1 -1
- package/dist/src/cli/dev/tui/terminal-renderer.js +4 -4
- package/dist/src/cli/run.js +1 -1
- package/dist/src/client/eve-agent-store.d.ts +1 -1
- package/dist/src/client/eve-agent-store.js +1 -1
- package/dist/src/client/index.d.ts +1 -0
- package/dist/src/client/message-response.d.ts +18 -0
- package/dist/src/client/message-response.js +1 -1
- package/dist/src/client/session-controls.d.ts +6 -0
- package/dist/src/client/session-controls.js +1 -1
- package/dist/src/client/session.d.ts +4 -0
- package/dist/src/client/session.js +1 -1
- package/dist/src/compiled/.vendor-stamp.json +8 -8
- package/dist/src/compiled/@eve/catalog/index.js +1 -1
- package/dist/src/compiled/@workflow/core/events-consumer.d.ts +2 -0
- package/dist/src/compiled/@workflow/core/index.js +2 -2
- package/dist/src/compiled/@workflow/core/private.d.ts +5 -3
- package/dist/src/compiled/@workflow/core/private.js +1 -1
- package/dist/src/compiled/@workflow/core/runtime/constants.d.ts +1 -37
- package/dist/src/compiled/@workflow/core/runtime/event-limit-warning.d.ts +32 -0
- package/dist/src/compiled/@workflow/core/runtime/helpers.d.ts +5 -6
- package/dist/src/compiled/@workflow/core/runtime/helpers.js +1 -1
- package/dist/src/compiled/@workflow/core/runtime/runs.d.ts +8 -0
- package/dist/src/compiled/@workflow/core/runtime/start.d.ts +16 -0
- package/dist/src/compiled/@workflow/core/runtime/suspension-handler.d.ts +15 -18
- package/dist/src/compiled/@workflow/core/runtime/vm-mode.d.ts +20 -0
- package/dist/src/compiled/@workflow/core/runtime.js +4 -4
- package/dist/src/compiled/@workflow/core/seeded-nanoid.d.ts +2 -0
- package/dist/src/compiled/@workflow/core/serialization/compression.d.ts +14 -3
- package/dist/src/compiled/@workflow/core/serialization.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/serialization.js +1 -1
- package/dist/src/compiled/@workflow/core/telemetry/semantic-conventions.d.ts +0 -18
- package/dist/src/compiled/@workflow/core/version.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/workflow.js +1 -1
- package/dist/src/compiled/@workflow/errors/index.d.ts +48 -0
- package/dist/src/compiled/@workflow/errors/index.js +1 -1
- package/dist/src/compiled/@workflow/world/env-config.d.ts +24 -0
- package/dist/src/compiled/@workflow/world/events.d.ts +126 -7
- package/dist/src/compiled/@workflow/world/index.d.ts +3 -3
- package/dist/src/compiled/@workflow/world/interfaces.d.ts +59 -8
- package/dist/src/compiled/@workflow/world/queue.d.ts +71 -9
- package/dist/src/compiled/@workflow/world/recovery.d.ts +6 -0
- package/dist/src/compiled/@workflow/world/test-support/duplicate-event-fixtures.d.ts +3 -0
- package/dist/src/compiled/@workflow/world/test-support/in-band-fence-conformance.d.ts +46 -0
- package/dist/src/compiled/@workflow/world-local/index.js +5 -5
- package/dist/src/compiled/@workflow/world-vercel/index.js +18 -18
- package/dist/src/compiled/_chunks/workflow/{attribute-changes-BW-kbMMn.js → attribute-changes-7se_SE2q.js} +3 -3
- package/dist/src/compiled/_chunks/workflow/dist-CcnNPAp4.js +1 -0
- package/dist/src/compiled/_chunks/workflow/dist-S9cZRway.js +3 -0
- package/dist/src/compiled/_chunks/workflow/helpers-CxNRXH0a.js +1 -0
- package/dist/src/compiled/_chunks/workflow/private-DLYTSBbu.js +1 -0
- package/dist/src/compiled/_chunks/workflow/resume-hook-CPiIfe8r.js +1 -0
- package/dist/src/compiled/_chunks/workflow/{run-DzdAqdb1.js → run-BJSLCXR4.js} +6 -6
- package/dist/src/compiled/_chunks/workflow/serialization-B9gneT9Z.js +15 -0
- package/dist/src/compiled/_chunks/workflow/sleep-BL0oQs3R.js +1 -0
- package/dist/src/compiled/_chunks/workflow/{wait-until-xbRRDuUf.js → wait-until-BPou0RGO.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/workflow-routes-BaljomCk.js +1 -0
- package/dist/src/compiled/{@ai-sdk/code-mode → run}/LICENSE +1 -1
- package/dist/src/compiled/run/index.d.ts +384 -0
- package/dist/src/compiled/run/index.js +650 -0
- package/dist/src/compiler/extension-compatibility.d.ts +21 -14
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/normalize-agent-config.js +1 -1
- package/dist/src/compiler/normalize-manifest.js +1 -1
- package/dist/src/compiler/normalize-sandbox.js +1 -1
- package/dist/src/compiler/workspace-resources.js +1 -1
- package/dist/src/context/build-callback-context.js +1 -1
- package/dist/src/context/build-dynamic-tools.js +1 -1
- package/dist/src/context/dynamic-skill-lifecycle.d.ts +2 -2
- package/dist/src/context/dynamic-skill-lifecycle.js +1 -1
- package/dist/src/context/dynamic-tool-lifecycle.js +1 -1
- package/dist/src/context/prewarm.d.ts +27 -0
- package/dist/src/context/prewarm.js +1 -0
- package/dist/src/context/providers/sandbox.d.ts +7 -0
- package/dist/src/context/providers/sandbox.js +1 -1
- package/dist/src/context/run-step.js +1 -1
- package/dist/src/discover/extension-specifier.d.ts +1 -0
- package/dist/src/discover/extension-specifier.js +1 -1
- package/dist/src/discover/lib.d.ts +4 -3
- package/dist/src/discover/lib.js +1 -1
- package/dist/src/discover/named-source-directory.d.ts +3 -2
- package/dist/src/evals/cli/eval.d.ts +2 -0
- package/dist/src/evals/cli/eval.js +2 -2
- package/dist/src/evals/define-eval-config.d.ts +5 -4
- package/dist/src/evals/define-eval-config.js +1 -1
- package/dist/src/evals/index.d.ts +1 -1
- package/dist/src/evals/runner/artifacts.js +2 -2
- package/dist/src/evals/runner/attempt-label.d.ts +2 -0
- package/dist/src/evals/runner/attempt-label.js +1 -0
- package/dist/src/evals/runner/derive-run-facts.d.ts +12 -0
- package/dist/src/evals/runner/derive-run-facts.js +1 -1
- package/dist/src/evals/runner/execute-task.js +1 -1
- package/dist/src/evals/runner/reporters/braintrust.js +1 -1
- package/dist/src/evals/runner/reporters/console.js +1 -1
- package/dist/src/evals/runner/reporters/datadog.js +1 -1
- package/dist/src/evals/runner/reporters/junit.js +2 -2
- package/dist/src/evals/runner/reporters/types.d.ts +2 -0
- package/dist/src/evals/runner/run-evals.d.ts +5 -0
- package/dist/src/evals/runner/run-evals.js +1 -1
- package/dist/src/evals/session-manager.js +1 -1
- package/dist/src/evals/session.d.ts +4 -1
- package/dist/src/evals/session.js +2 -2
- package/dist/src/evals/types.d.ts +39 -2
- package/dist/src/eve-channel/index.js +1 -1
- package/dist/src/eve-channel/request.d.ts +0 -1
- package/dist/src/eve-channel/request.js +2 -2
- package/dist/src/execution/agent-sessions/context.d.ts +1 -1
- package/dist/src/execution/agent-sessions/context.js +1 -1
- package/dist/src/execution/coordination-dispatch-shared.d.ts +3 -0
- package/dist/src/execution/coordination-dispatch-shared.js +1 -1
- package/dist/src/execution/dynamic-workflow/program-step.d.ts +7 -7
- package/dist/src/execution/dynamic-workflow/program-step.js +1 -1
- package/dist/src/execution/dynamic-workflow/schema.d.ts +18 -11
- package/dist/src/execution/dynamic-workflow/schema.js +1 -1
- package/dist/src/execution/dynamic-workflow/tool.js +1 -1
- package/dist/src/execution/dynamic-workflow/workflow.js +1 -1
- package/dist/src/execution/eve-workflow-attributes.d.ts +3 -1
- package/dist/src/execution/eve-workflow-attributes.js +1 -1
- package/dist/src/execution/invoke-tool.js +1 -1
- package/dist/src/execution/sandbox/abort-bound-session.js +1 -1
- package/dist/src/execution/sandbox/active-connections.d.ts +28 -0
- package/dist/src/execution/sandbox/active-connections.js +1 -0
- package/dist/src/execution/sandbox/bindings/docker-cli.d.ts +10 -2
- package/dist/src/execution/sandbox/bindings/docker-cli.js +2 -2
- package/dist/src/execution/sandbox/bindings/docker-connection.d.ts +15 -0
- package/dist/src/execution/sandbox/bindings/docker-connection.js +2 -0
- package/dist/src/execution/sandbox/bindings/docker-container.d.ts +2 -0
- package/dist/src/execution/sandbox/bindings/docker-container.js +1 -1
- package/dist/src/execution/sandbox/bindings/docker-network.d.ts +5 -0
- package/dist/src/execution/sandbox/bindings/docker-network.js +1 -1
- package/dist/src/execution/sandbox/bindings/docker-templates.js +1 -1
- package/dist/src/execution/sandbox/bindings/docker.d.ts +12 -15
- package/dist/src/execution/sandbox/bindings/docker.js +1 -1
- package/dist/src/execution/sandbox/bindings/just-bash-runtime.d.ts +19 -29
- package/dist/src/execution/sandbox/bindings/just-bash-runtime.js +1 -1
- package/dist/src/execution/sandbox/bindings/just-bash.d.ts +2 -4
- package/dist/src/execution/sandbox/bindings/just-bash.js +1 -1
- package/dist/src/execution/sandbox/bindings/local-provider-utils.d.ts +0 -20
- package/dist/src/execution/sandbox/bindings/local-provider-utils.js +1 -1
- package/dist/src/execution/sandbox/bindings/local.d.ts +4 -6
- package/dist/src/execution/sandbox/bindings/local.js +1 -1
- package/dist/src/execution/sandbox/bindings/vercel-base-runtime.d.ts +2 -0
- package/dist/src/execution/sandbox/bindings/vercel-base-runtime.js +2 -2
- package/dist/src/execution/sandbox/bindings/vercel-errors.js +2 -2
- package/dist/src/execution/sandbox/bindings/vercel-lifecycle.d.ts +7 -5
- package/dist/src/execution/sandbox/bindings/vercel-lifecycle.js +1 -1
- package/dist/src/execution/sandbox/bindings/vercel.d.ts +5 -11
- package/dist/src/execution/sandbox/bindings/vercel.js +1 -2
- package/dist/src/execution/sandbox/development-cleanup.d.ts +0 -1
- package/dist/src/execution/sandbox/development-cleanup.js +1 -1
- package/dist/src/execution/sandbox/development-lazy-prewarm.js +1 -1
- package/dist/src/execution/sandbox/development-run.d.ts +0 -2
- package/dist/src/execution/sandbox/development-run.js +1 -1
- package/dist/src/execution/sandbox/dockerfile.d.ts +0 -4
- package/dist/src/execution/sandbox/dockerfile.js +1 -1
- package/dist/src/execution/sandbox/ensure.d.ts +31 -11
- package/dist/src/execution/sandbox/ensure.js +1 -1
- package/dist/src/execution/sandbox/glob-tool.js +3 -3
- package/dist/src/execution/sandbox/grep-tool.js +1 -1
- package/dist/src/execution/sandbox/logging-session.js +1 -1
- package/dist/src/execution/sandbox/prewarm.d.ts +23 -3
- package/dist/src/execution/sandbox/prewarm.js +2 -1
- package/dist/src/execution/sandbox/read-file.js +1 -1
- package/dist/src/execution/sandbox/require-sandbox.d.ts +3 -2
- package/dist/src/execution/sandbox/require-sandbox.js +1 -1
- package/dist/src/execution/sandbox/ripgrep-probe.js +1 -1
- package/dist/src/execution/sandbox/session.d.ts +10 -20
- package/dist/src/execution/sandbox/session.js +2 -2
- package/dist/src/execution/session/admission.js +1 -1
- package/dist/src/execution/session/checkpoint-migrations.js +1 -1
- package/dist/src/execution/session/entry-input.d.ts +5 -4
- package/dist/src/execution/session/entry.js +1 -1
- package/dist/src/execution/session/handoff-state.d.ts +5 -0
- package/dist/src/execution/session/handoff-state.js +1 -0
- package/dist/src/execution/session/handoff-steps.d.ts +1 -5
- package/dist/src/execution/session/handoff-steps.js +1 -1
- package/dist/src/execution/session/handoff.d.ts +2 -1
- package/dist/src/execution/session/handoff.js +1 -1
- package/dist/src/execution/session/handover-tracing.d.ts +3 -0
- package/dist/src/execution/session/handover-tracing.js +1 -0
- package/dist/src/execution/session/input-queue.d.ts +3 -0
- package/dist/src/execution/session/input-queue.js +1 -1
- package/dist/src/execution/session/next-input.d.ts +3 -0
- package/dist/src/execution/session/next-input.js +1 -1
- package/dist/src/execution/session/prewarm-step.d.ts +13 -0
- package/dist/src/execution/session/prewarm-step.js +1 -0
- package/dist/src/execution/session/program.d.ts +4 -1
- package/dist/src/execution/session/program.js +1 -1
- package/dist/src/execution/session/state-cursor.d.ts +11 -0
- package/dist/src/execution/session/state-cursor.js +1 -1
- package/dist/src/execution/session/timeout-control.d.ts +4 -0
- package/dist/src/execution/session/timeout-control.js +1 -1
- package/dist/src/execution/session/turn-control.d.ts +5 -2
- package/dist/src/execution/session/turn-control.js +1 -1
- package/dist/src/execution/session/turn-step-types.d.ts +2 -0
- package/dist/src/execution/session/turn-step.js +1 -1
- package/dist/src/execution/session/turn.d.ts +1 -0
- package/dist/src/execution/session/turn.js +1 -1
- package/dist/src/execution/session-inbox/inbox.d.ts +17 -1
- package/dist/src/execution/session-inbox/inbox.js +1 -1
- package/dist/src/execution/session-inbox/protocol.d.ts +2 -1
- package/dist/src/execution/session-inbox/protocol.js +1 -1
- package/dist/src/execution/session-inbox/resume.d.ts +2 -1
- package/dist/src/execution/session-inbox/resume.js +1 -1
- package/dist/src/execution/session-prewarm.d.ts +8 -0
- package/dist/src/execution/session-prewarm.js +1 -0
- package/dist/src/execution/skills/instructions.js +1 -1
- package/dist/src/execution/tools/agent-router-workflow.js +1 -1
- package/dist/src/execution/tools/workflow/body.js +1 -1
- package/dist/src/execution/tools/workflow/step-context.d.ts +11 -0
- package/dist/src/execution/tools/workflow/step-execution.js +1 -1
- package/dist/src/execution/tools/workflow/step.js +1 -1
- package/dist/src/execution/workflow-runtime.js +1 -1
- package/dist/src/extensions/git/extension/lib/github-shell-schema.js +1 -1
- package/dist/src/framework/sources/modules/sandbox.d.ts +1 -1
- package/dist/src/harness/attachment-staging.d.ts +3 -7
- package/dist/src/harness/attachment-staging.js +1 -1
- package/dist/src/harness/hitl/index.d.ts +2 -1
- package/dist/src/harness/hitl/index.js +1 -1
- package/dist/src/harness/hitl/view.d.ts +1 -0
- package/dist/src/harness/hitl/view.js +1 -0
- package/dist/src/harness/model-call/run.js +1 -1
- package/dist/src/harness/semantic-errors/rules/sandbox.d.ts +3 -5
- package/dist/src/harness/semantic-errors/rules/sandbox.js +1 -1
- package/dist/src/harness/step/prompt.js +1 -1
- package/dist/src/harness/tool-history-repair.d.ts +9 -0
- package/dist/src/harness/tool-history-repair.js +1 -0
- package/dist/src/harness/tool-model-output.d.ts +19 -3
- package/dist/src/harness/tool-model-output.js +1 -1
- package/dist/src/internal/application/compiled-artifacts.js +8 -4
- package/dist/src/internal/application/optional-package-import.d.ts +10 -0
- package/dist/src/internal/application/optional-package-import.js +1 -1
- package/dist/src/internal/application/stamped-package-version.js +1 -1
- package/dist/src/internal/attachments/limited-read.d.ts +2 -2
- package/dist/src/internal/authored-module-build-options.d.ts +6 -0
- package/dist/src/internal/authored-module-build-options.js +1 -1
- package/dist/src/internal/authored-module-cache.d.ts +10 -0
- package/dist/src/internal/authored-module-cache.js +1 -0
- package/dist/src/internal/authored-module-graph.js +1 -1
- package/dist/src/internal/authored-module-loader.js +1 -1
- package/dist/src/internal/authored-relative-extension-resolver.js +1 -1
- package/dist/src/internal/bundler/nitro-rolldown.d.ts +3 -1
- package/dist/src/internal/bundler/nitro-rolldown.js +1 -1
- package/dist/src/internal/bundler/pseudo-packages.d.ts +11 -0
- package/dist/src/internal/bundler/pseudo-packages.js +1 -0
- package/dist/src/internal/nitro/host/build-extension.d.ts +6 -0
- package/dist/src/internal/nitro/host/build-extension.js +2 -2
- package/dist/src/internal/nitro/host/compiled-sandbox-provider-prune-plugin.d.ts +3 -1
- package/dist/src/internal/nitro/host/compiled-sandbox-provider-prune-plugin.js +3 -5
- package/dist/src/internal/nitro/host/create-application-nitro.d.ts +2 -3
- package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
- package/dist/src/internal/nitro/host/dev-authored-rebuild-coordinator.d.ts +2 -0
- package/dist/src/internal/nitro/host/dev-authored-rebuild-coordinator.js +1 -1
- package/dist/src/internal/nitro/host/dev-authored-source-watcher.js +1 -1
- package/dist/src/internal/nitro/host/dev-build-host.d.ts +83 -0
- package/dist/src/internal/nitro/host/dev-build-host.js +1 -0
- package/dist/src/internal/nitro/host/dev-build-operations.d.ts +6 -0
- package/dist/src/internal/nitro/host/dev-build-operations.js +1 -0
- package/dist/src/internal/nitro/host/dev-build-process.d.ts +1 -0
- package/dist/src/internal/nitro/host/dev-build-process.js +1 -0
- package/dist/src/internal/nitro/host/development-runtime-prune-plugin.d.ts +4 -1
- package/dist/src/internal/nitro/host/development-runtime-prune-plugin.js +3 -2
- package/dist/src/internal/nitro/host/drained-nitro-dev-server.d.ts +13 -0
- package/dist/src/internal/nitro/host/drained-nitro-dev-server.js +1 -1
- package/dist/src/internal/nitro/host/optional-engine-dependency-plugin.js +1 -1
- package/dist/src/internal/nitro/host/prepare-application-host.d.ts +3 -0
- package/dist/src/internal/nitro/host/prepare-application-host.js +1 -1
- package/dist/src/internal/nitro/host/sandbox-shutdown-plugin.js +1 -1
- package/dist/src/internal/nitro/host/start-development-server.js +2 -2
- package/dist/src/internal/nitro/host/start-production-server.js +3 -3
- package/dist/src/internal/nitro/host/workflow-sandbox-runtime-plugin.js +1 -1
- package/dist/src/internal/nitro/host.js +1 -1
- package/dist/src/internal/workflow/local-world-delivery-auth.d.ts +17 -0
- package/dist/src/internal/workflow/local-world-delivery-auth.js +1 -0
- package/dist/src/internal/workflow/queue-namespace.d.ts +2 -0
- package/dist/src/internal/workflow/queue-namespace.js +1 -1
- package/dist/src/internal/workflow-bundle/builder-support.d.ts +0 -1
- package/dist/src/internal/workflow-bundle/builder-support.js +2 -2
- package/dist/src/internal/workflow-bundle/builder.js +2 -2
- package/dist/src/internal/workflow-bundle/dynamic-tool-transform.js +1 -1
- package/dist/src/internal/workflow-bundle/vercel-workflow-output.d.ts +1 -1
- package/dist/src/internal/workflow-bundle/vercel-workflow-output.js +1 -1
- package/dist/src/protocol/prewarm-session.d.ts +14 -0
- package/dist/src/protocol/prewarm-session.js +1 -0
- package/dist/src/protocol/routes.d.ts +2 -2
- package/dist/src/public/channels/discord/authorization.d.ts +45 -0
- package/dist/src/public/channels/discord/authorization.js +3 -0
- package/dist/src/public/channels/discord/defaults.d.ts +14 -3
- package/dist/src/public/channels/discord/defaults.js +2 -2
- package/dist/src/public/channels/discord/discordChannel.d.ts +15 -1
- package/dist/src/public/channels/discord/discordChannel.js +1 -1
- package/dist/src/public/channels/discord/gateway/connection.d.ts +26 -0
- package/dist/src/public/channels/discord/gateway/connection.js +1 -0
- package/dist/src/public/channels/discord/gateway/forwarder.d.ts +14 -0
- package/dist/src/public/channels/discord/gateway/forwarder.js +1 -0
- package/dist/src/public/channels/discord/gateway/index.d.ts +59 -0
- package/dist/src/public/channels/discord/gateway/index.js +1 -0
- package/dist/src/public/channels/discord/inbound.d.ts +10 -3
- package/dist/src/public/channels/discord/inbound.js +2 -2
- package/dist/src/public/channels/discord/index.d.ts +3 -2
- package/dist/src/public/channels/discord/index.js +1 -1
- package/dist/src/public/channels/discord/messages.d.ts +116 -0
- package/dist/src/public/channels/discord/messages.js +2 -0
- package/dist/src/public/channels/github/checkout.js +1 -1
- package/dist/src/public/channels/linq/linqChannel.d.ts +4 -1
- package/dist/src/public/channels/linq/linqChannel.js +1 -1
- package/dist/src/public/channels/photon/photonIMessageChannel.js +1 -1
- package/dist/src/public/channels/same-environment-oidc.d.ts +7 -0
- package/dist/src/public/channels/same-environment-oidc.js +1 -0
- package/dist/src/public/definitions/channel.js +1 -1
- package/dist/src/public/definitions/sandbox.d.ts +1 -1
- package/dist/src/public/next/server.js +1 -1
- package/dist/src/public/sandbox/docker-sandbox.d.ts +6 -1
- package/dist/src/public/sandbox/docker.d.ts +1 -8
- package/dist/src/public/sandbox/index.d.ts +3 -3
- package/dist/src/public/sandbox/just-bash-sandbox.d.ts +87 -7
- package/dist/src/public/sandbox/just-bash.d.ts +1 -1
- package/dist/src/public/sandbox/provider.d.ts +5 -1
- package/dist/src/public/sandbox/provider.js +1 -1
- package/dist/src/public/sandbox/vercel-sandbox.d.ts +16 -9
- package/dist/src/public/sandbox/vercel.d.ts +0 -1
- package/dist/src/public/sandbox/vercel.js +1 -1
- package/dist/src/public/tools/agent.d.ts +8 -1
- package/dist/src/public/tools/agent.js +1 -1
- package/dist/src/react/use-eve-agent.d.ts +1 -1
- package/dist/src/runtime/agent/resolve-model.js +1 -1
- package/dist/src/runtime/connections/openapi-client.d.ts +2 -0
- package/dist/src/runtime/connections/openapi-client.js +1 -1
- package/dist/src/runtime/resolve-agent-graph.js +1 -1
- package/dist/src/runtime/resolve-agent.js +1 -1
- package/dist/src/runtime/resolve-channel.js +1 -1
- package/dist/src/runtime/resolve-sandbox.js +1 -1
- package/dist/src/runtime/sandbox/prepared-artifacts.js +1 -1
- package/dist/src/runtime/sandbox/registry.d.ts +2 -0
- package/dist/src/runtime/sandbox/registry.js +1 -1
- package/dist/src/runtime/subagents/workflow.d.ts +6 -0
- package/dist/src/runtime/subagents/workflow.js +1 -1
- package/dist/src/runtime/workspace/seed-files.d.ts +9 -12
- package/dist/src/runtime/workspace/seed-files.js +1 -1
- package/dist/src/runtime/workspace/spec.d.ts +1 -1
- package/dist/src/runtime/workspace/spec.js +1 -1
- package/dist/src/runtime/workspace/types.d.ts +2 -6
- package/dist/src/sandbox/provider.d.ts +185 -0
- package/dist/src/sandbox/provider.js +1 -0
- package/dist/src/sandbox/providers/default.d.ts +20 -19
- package/dist/src/sandbox/providers/default.js +1 -1
- package/dist/src/sandbox/providers/docker.d.ts +5 -2
- package/dist/src/sandbox/providers/docker.js +1 -1
- package/dist/src/sandbox/providers/just-bash.d.ts +4 -3
- package/dist/src/sandbox/providers/just-bash.js +1 -1
- package/dist/src/sandbox/providers/vercel.d.ts +4 -10
- package/dist/src/sandbox/providers/vercel.js +1 -1
- package/dist/src/sandbox/providers.d.ts +0 -1
- package/dist/src/sandbox/providers.js +1 -1
- package/dist/src/sandbox/state.d.ts +61 -0
- package/dist/src/sandbox/state.js +1 -1
- package/dist/src/self-modification/deployed-sandbox.d.ts +4 -9
- package/dist/src/self-modification/deployed-sandbox.js +1 -1
- package/dist/src/self-modification/filesystem.d.ts +3 -3
- package/dist/src/self-modification/remote/config.d.ts +2 -2
- package/dist/src/self-modification/remote/config.js +1 -1
- package/dist/src/self-modification/setup.d.ts +0 -1
- package/dist/src/self-modification/setup.js +8 -8
- package/dist/src/setup/integrations/discord/api.d.ts +7 -0
- package/dist/src/setup/integrations/discord/api.js +1 -1
- package/dist/src/setup/integrations/discord/daemon.d.ts +18 -0
- package/dist/src/setup/integrations/discord/daemon.js +21 -0
- package/dist/src/setup/integrations/discord/setup.d.ts +24 -4
- package/dist/src/setup/integrations/discord/setup.js +5 -4
- package/dist/src/setup/integrations/self-modification/setup.js +1 -1
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/dist/src/setup/scaffold/update/web-options.js +1 -1
- package/dist/src/setup/scaffold/version-tokens.d.ts +0 -1
- package/dist/src/setup/scaffold/version-tokens.js +1 -1
- package/dist/src/shared/agent-definition.d.ts +2 -0
- package/dist/src/shared/built-server-start-failure.d.ts +12 -0
- package/dist/src/shared/built-server-start-failure.js +3 -0
- package/dist/src/shared/framework-eve-server.d.ts +2 -0
- package/dist/src/shared/framework-eve-server.js +2 -2
- package/dist/src/shared/sandbox-environment.d.ts +4 -10
- package/dist/src/shared/sandbox-environment.js +1 -1
- package/dist/src/shared/sandbox-network-policy.d.ts +45 -9
- package/dist/src/shared/sandbox-provider.d.ts +0 -103
- package/dist/src/shared/sandbox-provider.js +1 -1
- package/dist/src/shared/sandbox-recorded-data-error.d.ts +4 -0
- package/dist/src/shared/sandbox-recorded-data-error.js +1 -0
- package/dist/src/shared/sandbox-session-gone-error.d.ts +12 -0
- package/dist/src/shared/sandbox-session-gone-error.js +1 -0
- package/dist/src/shared/sandbox-session.d.ts +97 -83
- package/dist/src/shared/sandbox-template-error.d.ts +19 -4
- package/dist/src/shared/sandbox-template-error.js +1 -1
- package/dist/src/shared/sandbox-tool-session-error.d.ts +4 -0
- package/dist/src/shared/sandbox-tool-session-error.js +1 -0
- package/dist/src/shared/skill-package.js +1 -1
- package/dist/src/shared/skill-paths.d.ts +4 -5
- package/dist/src/shared/skill-paths.js +2 -2
- package/dist/src/shared/workflow-sandbox.d.ts +4 -41
- package/dist/src/shared/workflow-sandbox.js +1 -1
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.d.ts +1 -1
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/tools/definition.js +1 -1
- package/dist/src/tools/durable-callbacks.d.ts +5 -1
- package/dist/src/tools/durable-callbacks.js +1 -1
- package/dist/src/tools/dynamic.d.ts +3 -3
- package/dist/src/tools/model-output.d.ts +23 -5
- package/dist/src/tools/model-output.js +1 -1
- package/dist/src/tools/provided/ask-question-workflow.js +1 -1
- package/dist/src/tools/provided/glob.js +1 -1
- package/dist/src/tools/provided/grep.js +1 -1
- package/dist/src/tools/provided/read-file.js +1 -1
- package/dist/src/tools/provided/sleep-workflow.js +1 -1
- package/dist/src/tools/provided/workflow.js +1 -1
- package/dist/src/tools/provided/write-file.js +1 -1
- package/dist/src/tools/workflow-definition.d.ts +19 -4
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.d.ts +1 -1
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/channels/custom.mdx +3 -3
- package/docs/channels/discord.mdx +279 -7
- package/docs/channels/eve.mdx +13 -2
- package/docs/channels/linq.mdx +2 -2
- package/docs/channels/mcp.mdx +2 -2
- package/docs/channels/overview.mdx +1 -1
- package/docs/channels/photon.mdx +1 -1
- package/docs/concepts/built-in-tools.md +31 -8
- package/docs/concepts/execution-model-and-durability.mdx +6 -101
- package/docs/concepts/security-model.md +2 -0
- package/docs/concepts/sessions-runs-and-streaming.md +44 -36
- package/docs/connections/openapi.mdx +2 -0
- package/docs/evals/overview.mdx +1 -1
- package/docs/evals/reporters.mdx +5 -5
- package/docs/evals/running.mdx +19 -1
- package/docs/guides/client/messages.mdx +1 -1
- package/docs/guides/deployment/overview.md +4 -4
- package/docs/guides/deployment/self-hosting.md +50 -1
- package/docs/guides/dev-tui.md +1 -1
- package/docs/guides/dynamic-capabilities.md +2 -2
- package/docs/guides/frontend/overview.mdx +34 -10
- package/docs/guides/instrumentation/agent-runs.mdx +16 -0
- package/docs/guides/instrumentation/otel.mdx +23 -0
- package/docs/guides/self-modification.md +1 -1
- package/docs/guides/session-context.md +1 -1
- package/docs/instructions.mdx +1 -1
- package/docs/meta.json +1 -0
- package/docs/reference/agent-files.md +4 -4
- package/docs/reference/cli.md +24 -17
- package/docs/reference/typescript-api.md +9 -3
- package/docs/sandbox/custom-providers.mdx +254 -0
- package/docs/sandbox/default.mdx +71 -4
- package/docs/sandbox/docker.mdx +15 -3
- package/docs/sandbox/index.mdx +32 -106
- package/docs/sandbox/just-bash.mdx +54 -0
- package/docs/sandbox/meta.json +9 -1
- package/docs/sandbox/troubleshooting.mdx +215 -0
- package/docs/sandbox/vercel.mdx +48 -7
- package/docs/skills.mdx +1 -1
- package/docs/subagents/index.mdx +2 -2
- package/docs/tools/overview.mdx +20 -1
- package/docs/tools/workflows.mdx +73 -5
- package/docs/tutorial/run-analysis.mdx +2 -2
- package/docs/use-cases.mdx +250 -0
- package/package.json +14 -20
- package/dist/src/compiled/@ai-sdk/code-mode/_run.d.ts +0 -1
- package/dist/src/compiled/@ai-sdk/code-mode/index.d.ts +0 -325
- package/dist/src/compiled/@ai-sdk/code-mode/index.js +0 -660
- package/dist/src/compiled/_chunks/workflow/dist-CyBgVS7g.js +0 -1
- package/dist/src/compiled/_chunks/workflow/dist-T5NnW-0k.js +0 -3
- package/dist/src/compiled/_chunks/workflow/helpers-DlLD3ov_.js +0 -1
- package/dist/src/compiled/_chunks/workflow/private-tQUuwBoQ.js +0 -1
- package/dist/src/compiled/_chunks/workflow/resume-hook-DMsV_b4n.js +0 -1
- package/dist/src/compiled/_chunks/workflow/serialization-DPdYS_w2.js +0 -16
- package/dist/src/compiled/_chunks/workflow/sleep-BY6leHh8.js +0 -1
- package/dist/src/compiled/_chunks/workflow/workflow-routes-CwqB063q.js +0 -1
- package/dist/src/execution/sandbox/active-handles.d.ts +0 -32
- package/dist/src/execution/sandbox/active-handles.js +0 -1
- package/dist/src/execution/sandbox/bindings/docker-session.d.ts +0 -6
- package/dist/src/execution/sandbox/bindings/docker-session.js +0 -2
- package/dist/src/execution/sandbox/bindings/immutable-resources.d.ts +0 -15
- package/dist/src/execution/sandbox/bindings/immutable-resources.js +0 -2
- package/dist/src/execution/sandbox/bindings/microsandbox-create.d.ts +0 -12
- package/dist/src/execution/sandbox/bindings/microsandbox-create.js +0 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-lifecycle.d.ts +0 -42
- package/dist/src/execution/sandbox/bindings/microsandbox-lifecycle.js +0 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-metadata.d.ts +0 -29
- package/dist/src/execution/sandbox/bindings/microsandbox-metadata.js +0 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-network.d.ts +0 -18
- package/dist/src/execution/sandbox/bindings/microsandbox-network.js +0 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-options.d.ts +0 -37
- package/dist/src/execution/sandbox/bindings/microsandbox-options.js +0 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-platform.d.ts +0 -21
- package/dist/src/execution/sandbox/bindings/microsandbox-platform.js +0 -21
- package/dist/src/execution/sandbox/bindings/microsandbox-process.d.ts +0 -3
- package/dist/src/execution/sandbox/bindings/microsandbox-process.js +0 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-provider-state.d.ts +0 -11
- package/dist/src/execution/sandbox/bindings/microsandbox-provider-state.js +0 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-runtime.d.ts +0 -82
- package/dist/src/execution/sandbox/bindings/microsandbox-runtime.js +0 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-templates.d.ts +0 -12
- package/dist/src/execution/sandbox/bindings/microsandbox-templates.js +0 -1
- package/dist/src/execution/sandbox/bindings/microsandbox.d.ts +0 -16
- package/dist/src/execution/sandbox/bindings/microsandbox.js +0 -1
- package/dist/src/execution/sandbox/provider-host-development.d.ts +0 -2
- package/dist/src/execution/sandbox/provider-host-development.js +0 -1
- package/dist/src/execution/sandbox/provider-host.d.ts +0 -2
- package/dist/src/execution/sandbox/provider-host.js +0 -1
- package/dist/src/execution/tool-session/sandbox.d.ts +0 -22
- package/dist/src/execution/tool-session/sandbox.js +0 -1
- package/dist/src/public/sandbox/microsandbox-sandbox.d.ts +0 -48
- package/dist/src/public/sandbox/microsandbox-sandbox.js +0 -1
- package/dist/src/public/sandbox/microsandbox.d.ts +0 -9
- package/dist/src/public/sandbox/microsandbox.js +0 -1
- package/dist/src/sandbox/providers/microsandbox.d.ts +0 -12
- package/dist/src/sandbox/providers/microsandbox.js +0 -1
- 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
|
|
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,25 +131,49 @@ 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
|
|
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
|
|
138
138
|
prepare those in the submit handler should keep the default until then.
|
|
139
139
|
|
|
140
|
-
Prewarming starts the workflow and establishes its inbox, then parks before session hooks
|
|
141
|
-
dynamic definitions
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
140
|
+
Prewarming starts the workflow and establishes its inbox, then parks before session hooks or
|
|
141
|
+
dynamic definitions run. Meanwhile, it starts the agent's [sandbox](/docs/sandbox) in the
|
|
142
|
+
background. The first message passes through the channel's `onMessage` hook and supplies the
|
|
143
|
+
identity and context for initialization and `turn_0`. That turn does not wait for the sandbox;
|
|
144
|
+
only a tool or hook that uses the sandbox waits for the rest of its start. If the sandbox fails
|
|
145
|
+
to start during prewarming, the first turn that uses it starts it instead. eve deletes the
|
|
146
|
+
sandbox when the session ends, including when an unused prewarmed session times out.
|
|
147
|
+
|
|
148
|
+
For an existing session, `prewarm()` checks the owner against the exact deployment accepting
|
|
149
|
+
that request. On Vercel, an idle owner on another deployment can transfer in the background
|
|
150
|
+
before Send. The session ID, history, stream, and expiry stay the same; no model call runs.
|
|
151
|
+
An owner already serving that deployment needs no workflow wake-up. Active turns are never
|
|
152
|
+
interrupted; an active turn can finish before preparation, and a queued real message takes priority.
|
|
153
|
+
An owner with pending tasks or input requests can skip the hint.
|
|
154
|
+
Older owners without preparation support and Worlds without deployment affinity are left alone.
|
|
155
|
+
|
|
156
|
+
Call `agent.prewarm()` once when a new typing burst begins, with an application-level cooldown
|
|
157
|
+
if you also retry during long drafts. eve shares concurrent calls; it does not listen to inputs
|
|
158
|
+
or poll deployments. `prewarm: true` also prepares a restored session when the binding mounts.
|
|
159
|
+
A production alias targets its current deployment; a preview alias targets that preview.
|
|
160
|
+
Requests pinned to an immutable deployment (including deployment-skew routing) cannot discover
|
|
161
|
+
a newer deployment. Local development retains session-creation behavior.
|
|
162
|
+
|
|
163
|
+
`client.sessions.attach(sessionId).prewarm({ signal })` returns `ready`, `accepted`,
|
|
164
|
+
`unsupported`, or `no_active_session`. `accepted` means the hint was persisted, not that handoff
|
|
165
|
+
has finished. It never replaces an expired session. Send retains its existing retry and
|
|
166
|
+
handoff behavior if preparation is unavailable, fails, or has not finished.
|
|
167
|
+
|
|
168
|
+
The explicit `prewarm()` method resolves after ingress acceptance, as does `client.sessions.create()`.
|
|
169
|
+
It does not wait for an initialization event; concurrent calls share the same preparation request.
|
|
146
170
|
The composer stays `"ready"`, meaning it can accept input, and prewarming does not run
|
|
147
|
-
`prepareSend`. A concurrent `send()` waits
|
|
171
|
+
`prepareSend`. A concurrent `send()` waits for initial creation acceptance when needed, but never waits for existing-session preparation.
|
|
148
172
|
If the inbox is still starting, the client retries `409 session_not_ready` with bounded
|
|
149
173
|
exponential backoff for up to 20 seconds. The caller's abort signal cancels the wait. Stream
|
|
150
174
|
events are not a prerequisite for sending.
|
|
151
175
|
|
|
152
|
-
A failed create sets `error` and calls `onError` when no send is waiting. A waiting send can
|
|
176
|
+
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
177
|
fall back to creating a session with its message. After creation succeeds, initialization
|
|
154
178
|
failures arrive on the stream during the first turn. The configured session timeout starts
|
|
155
179
|
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.
|
|
@@ -7,6 +7,29 @@ url: "/observability/otel"
|
|
|
7
7
|
`eve dev` records local traces by default. Use `otel()` for process-wide
|
|
8
8
|
settings and `otelIntegration()` for third-party destinations.
|
|
9
9
|
|
|
10
|
+
## Session handover events
|
|
11
|
+
|
|
12
|
+
Existing Workflow step spans include these events when tracing is active:
|
|
13
|
+
|
|
14
|
+
- `eve.session.handover.forwarding_started`: the previous owner starts submitting its buffered messages, including an empty buffer.
|
|
15
|
+
- `eve.session.handover.part_submitted`: a buffered part was durably submitted.
|
|
16
|
+
- `eve.session.handover.final_submitted`: the final marker was durably submitted. This does not confirm that the successor has processed it.
|
|
17
|
+
- `eve.session.handover.inbox_unblocked`: an existing turn step observes that the inbox applied every buffered part and the final marker.
|
|
18
|
+
|
|
19
|
+
Join both owners with `eve.session.id` and `eve.handoff.attempt_key`.
|
|
20
|
+
`workflow.run.id` identifies the emitting owner; submission events also include
|
|
21
|
+
`eve.handoff.destination_run_id`. Counts and part indexes describe the transfer
|
|
22
|
+
without recording message content. Step IDs and `eve.handoff.step_attempt`
|
|
23
|
+
distinguish retries; these events are not exactly-once counters.
|
|
24
|
+
|
|
25
|
+
The receiver records `eve.handoff.applied_at_ms` using Workflow's replay-stable
|
|
26
|
+
clock, identified by `eve.handoff.applied_at_clock: workflow`. This is logical
|
|
27
|
+
event time, not the host time when replay applied the marker. The event's own
|
|
28
|
+
timestamp is when the next turn step exports the observation. No receiver
|
|
29
|
+
observation is exported if no subsequent turn step runs. An abandoned handover
|
|
30
|
+
does not emit a successful receipt. No additional Workflow steps or writes are
|
|
31
|
+
created for tracing.
|
|
32
|
+
|
|
10
33
|
## Configure OpenTelemetry
|
|
11
34
|
|
|
12
35
|
`otel()` and `otelIntegration()` are optional:
|
|
@@ -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`.
|
|
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
|
|
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
|
|
package/docs/instructions.mdx
CHANGED
|
@@ -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.
|
|
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
|
|
package/docs/meta.json
CHANGED
|
@@ -56,10 +56,10 @@ Paths below are relative to the agent directory. Root agents can use every path;
|
|
|
56
56
|
| `extensions/` | Mounted reusable capabilities | Yes | File or directory mounts. See [Extensions](/docs/extensions). |
|
|
57
57
|
| `hooks/` | Lifecycle and stream-event subscribers | Yes | Module-backed only; recursive directories are supported. |
|
|
58
58
|
| `skills/` | On-demand procedures and capability packs | Yes | Flat Markdown, module-backed skills, or packaged skills. |
|
|
59
|
-
| `lib/` | Shared authored helper code | Yes | Import-only; not copied into the sandbox.
|
|
59
|
+
| `lib/` | Shared authored helper code | Yes | Import-only; not copied into the sandbox. Helpers can import data files such as JSON from here. |
|
|
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 |
|
|
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
|
|
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
|
|
package/docs/reference/cli.md
CHANGED
|
@@ -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
|
|
214
|
-
|
|
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
|
| ------------------------ | ------ | ------- | --------------------------------------------------------------------------------------------- |
|
|
@@ -454,21 +459,23 @@ eve eval [evalId...] [--url <url>] [options]
|
|
|
454
459
|
|
|
455
460
|
Runs all discovered evals when no eval ids are given; ids match exactly or by directory prefix (`eve eval weather` runs everything under `evals/weather/`). Exits `0` when every eval passed its checks, `1` when any eval failed (a failed check, an execution error, or a `--strict` threshold miss), `2` on configuration errors.
|
|
456
461
|
|
|
457
|
-
Without `--url`, `eve eval` starts its own local server on a free port with state under `.eve/eval-servers/<run id>/`, removed when the run ends.
|
|
458
|
-
|
|
459
|
-
| Flag | Type | Default | Description
|
|
460
|
-
| ------------------------ | ------ | ------- |
|
|
461
|
-
| `--url <url>` | string | none | Remote agent URL (skip local host startup)
|
|
462
|
-
| `--tag <tag...>` | string | none | Run only evals carrying a tag
|
|
463
|
-
| `--exclude-tag <tag...>` | string | none | Skip evals carrying a tag
|
|
464
|
-
| `--strict` | flag | off | Below-threshold scores also fail the exit code
|
|
465
|
-
| `--list` | flag | off | Print evals selected by the tag filters, without running them
|
|
466
|
-
| `--timeout <ms>` | number | none | Per-eval timeout in milliseconds
|
|
467
|
-
| `--max-concurrency <n>` | number | 8 | Max concurrent eval executions
|
|
468
|
-
| `--
|
|
469
|
-
| `--
|
|
470
|
-
| `--
|
|
471
|
-
| `--
|
|
462
|
+
Without `--url`, `eve eval` starts its own local server on a free port with state under `.eve/eval-servers/<run id>/`, removed when the run ends unless you pass `--keep-state`. A kept directory, including the server's Workflow data in `.workflow-data/`, stays until a later `eve eval` in the same app cleans it up. The local server runs beside an `eve dev` session for the same agent without attaching to it or changing it.
|
|
463
|
+
|
|
464
|
+
| Flag | Type | Default | Description |
|
|
465
|
+
| ------------------------ | ------ | ------- | -------------------------------------------------------------- |
|
|
466
|
+
| `--url <url>` | string | none | Remote agent URL (skip local host startup) |
|
|
467
|
+
| `--tag <tag...>` | string | none | Run only evals carrying a tag |
|
|
468
|
+
| `--exclude-tag <tag...>` | string | none | Skip evals carrying a tag |
|
|
469
|
+
| `--strict` | flag | off | Below-threshold scores also fail the exit code |
|
|
470
|
+
| `--list` | flag | off | Print evals selected by the tag filters, without running them |
|
|
471
|
+
| `--timeout <ms>` | number | none | Per-eval timeout in milliseconds |
|
|
472
|
+
| `--max-concurrency <n>` | number | 8 | Max concurrent eval executions |
|
|
473
|
+
| `--repeat <n>` | number | 1 | Run every eval n times to measure repeatability |
|
|
474
|
+
| `--json` | flag | off | Output results as JSON |
|
|
475
|
+
| `--junit <path>` | string | none | Write JUnit XML results to a file |
|
|
476
|
+
| `--skip-report` | flag | off | Skip eval-defined reporters (e.g. Braintrust) |
|
|
477
|
+
| `--keep-state` | flag | off | Keep the local eval server's state after the run (not `--url`) |
|
|
478
|
+
| `--verbose` | flag | off | Stream per-eval logs and workflow run IDs to stdout |
|
|
472
479
|
|
|
473
480
|
See [Evals](../evals/overview) for authoring evals.
|
|
474
481
|
|
|
@@ -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`
|
|
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
|
|
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`,
|
|
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, or prewarming | `start(ctx, options, artifact)` from `environment.open(options)` in the selector. A prewarmed session calls it in the background before its first message, and its first turn can call it again concurrently |
|
|
145
|
+
| A later workflow step or process, or a turn starting | `resume(ctx, artifact, state)`. Each turn of a session that recorded a sandbox calls it in the background as the turn starts, whether or not the turn uses the sandbox |
|
|
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.
|