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
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{frameworkTool}from"./framework-tool.js";import{defineJsonSchema}from"#tools/schema.js";import{defineTool}from"#tools/definition.js";import{toolLabel}from"#tools/tool-label.js";import{executeWriteFileOnSandbox}from"#execution/sandbox/write-file.js";const WRITE_FILE_INPUT_SCHEMA=defineJsonSchema({type:`object`,properties:{content:{type:`string`,description:`Complete replacement file contents.`},filePath:{type:`string`,description:`The
|
|
1
|
+
import{frameworkTool}from"./framework-tool.js";import{defineJsonSchema}from"#tools/schema.js";import{defineTool}from"#tools/definition.js";import{toolLabel}from"#tools/tool-label.js";import{executeWriteFileOnSandbox}from"#execution/sandbox/write-file.js";const WRITE_FILE_INPUT_SCHEMA=defineJsonSchema({type:`object`,properties:{content:{type:`string`,description:`Complete replacement file contents.`},filePath:{type:`string`,description:`The path to the file to write: absolute, relative to the workspace root, or beginning with $HOME/.`}},required:[`content`,`filePath`],additionalProperties:!1}),WRITE_FILE_OUTPUT_SCHEMA=defineJsonSchema({type:`object`,properties:{existed:{type:`boolean`},path:{type:`string`}},required:[`existed`,`path`],additionalProperties:!1}),writeFile=frameworkTool(defineTool({label:{start:e=>toolLabel(`Write`,e.filePath)},description:[`Writes a file to the local filesystem.`,``,`Usage:`,`- This tool will overwrite the existing file if there is one at the provided path.`,`- If this is an existing file, you MUST use the read_file tool first to read the file's contents. This tool will fail if you did not read the file first.`,`- ALWAYS prefer editing existing files in the codebase. NEVER write new files unless explicitly required.`,`- NEVER proactively create documentation files (*.md) or README files. Only create documentation files if explicitly requested by the User.`,`- Only use emojis if the user explicitly requests it. Avoid writing emojis to files unless asked.`].join(`
|
|
2
2
|
`),async execute(e,t){return await executeWriteFileOnSandbox(await t.getSandbox(),e)},inputSchema:WRITE_FILE_INPUT_SCHEMA,outputSchema:WRITE_FILE_OUTPUT_SCHEMA}));export{WRITE_FILE_INPUT_SCHEMA,WRITE_FILE_OUTPUT_SCHEMA,writeFile as default,writeFile};
|
|
@@ -22,8 +22,19 @@ export interface AgentSessionOptions {
|
|
|
22
22
|
/** Override the model for every turn in this local agent session. */
|
|
23
23
|
readonly model?: AgentSessionModelSelection;
|
|
24
24
|
}
|
|
25
|
-
/**
|
|
26
|
-
|
|
25
|
+
/**
|
|
26
|
+
* Context capabilities available inside an authored `"use step"` helper.
|
|
27
|
+
*
|
|
28
|
+
* `getSandbox()` opens the sandbox of the session that made the call, the
|
|
29
|
+
* same sandbox its turns use. If the session had not recorded its sandbox
|
|
30
|
+
* when it called the tool, the step opens it with the sandbox definition of
|
|
31
|
+
* the session that owns it (the parent's, for a session that shares its
|
|
32
|
+
* parent's sandbox), so make that definition safe to run again. The step does not own the sandbox: eve lets go of the
|
|
33
|
+
* step's handle when the step ends and never stops or deletes the sandbox for
|
|
34
|
+
* it, and `stop()` and `delete()` throw. The session deletes it when the
|
|
35
|
+
* session ends. Steps can retry, so make sandbox writes safe to repeat.
|
|
36
|
+
*/
|
|
37
|
+
export type WorkflowStepToolContext = Pick<ToolContext, "abortSignal" | "callId" | "session" | "toolName" | "getSandbox" | "getToken" | "requireAuth">;
|
|
27
38
|
/** Options for one message to a `ctx.agent` session. */
|
|
28
39
|
export interface AgentSendOptions<TOutput = unknown> {
|
|
29
40
|
/** Structured output for the turn, as on the client's `send`. */
|
|
@@ -61,8 +72,12 @@ export interface AgentSession {
|
|
|
61
72
|
*/
|
|
62
73
|
send<TOutput = unknown>(message: string, options?: AgentSendOptions<TOutput>): Promise<AgentResponse<TOutput>>;
|
|
63
74
|
}
|
|
64
|
-
/**
|
|
65
|
-
|
|
75
|
+
/**
|
|
76
|
+
* Members the context of every workflow tool entry point shares.
|
|
77
|
+
* `getSandbox`, `getToken`, and `requireAuth` work only after `ctx` is passed
|
|
78
|
+
* to a `"use step"` helper; the workflow body throws when it calls them.
|
|
79
|
+
*/
|
|
80
|
+
export type WorkflowSharedContext = Pick<ToolContext, "session" | "toolName" | "getSandbox" | "getToken" | "requireAuth"> & {
|
|
66
81
|
/**
|
|
67
82
|
* Returns a new session with the agent of this invocation name. Nothing
|
|
68
83
|
* starts until the first `send`.
|
package/dist/src/vue/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as conversationProjection, i as openConversationInputs, n as conversationReducer, o as callStatus, r as defaultMessageReducer, t as useEveAgent } from "../chunks/use-eve-agent-
|
|
1
|
+
import { a as conversationProjection, i as openConversationInputs, n as conversationReducer, o as callStatus, r as defaultMessageReducer, t as useEveAgent } from "../chunks/use-eve-agent-DnbG9c7c.js";
|
|
2
2
|
|
|
3
3
|
//#region src/client/tool-call-state.ts
|
|
4
4
|
function toolCallState(conversation, callId, options = {}) {
|
|
@@ -110,7 +110,7 @@ export interface UseEveAgentOptions<TData> extends EveAgentStoreCallbacks<TData>
|
|
|
110
110
|
* on the next send, answer, or resume. @default true
|
|
111
111
|
*/
|
|
112
112
|
readonly followIdle?: boolean;
|
|
113
|
-
/**
|
|
113
|
+
/** Create a session or prepare its existing idle owner on mount and after reset. @default false */
|
|
114
114
|
readonly prewarm?: boolean;
|
|
115
115
|
/**
|
|
116
116
|
* Projects stream events into `TData`.
|
package/docs/channels/custom.mdx
CHANGED
|
@@ -68,7 +68,7 @@ Each route receives these operation surfaces:
|
|
|
68
68
|
- `to(channel, target).send(message, options)` hands work to another authored channel.
|
|
69
69
|
- `params`, `waitUntil`, and `requestIp` provide request metadata and lifetime control.
|
|
70
70
|
- `describe()` returns the agent's name, description, the compiled tools a caller can run outside a turn, with their JSON schemas, and the compiled skills, each with its `name` and `description`, sorted by name. It reads the compiled manifest only, never a skill file, and carries no other paths, config, or inspection detail, so a channel can publish it to its callers. Tools that need a turn (framework tools, workflow and provider tools, tools without `execute`) and tools and skills added by dynamic resolvers or subagents are left out.
|
|
71
|
-
- `invokeTool(name, input, { auth, key })` runs one of those tools as `auth`, outside any conversation: no model, turn, or workflow run. Authored state starts from its initial value and is not kept. Without `key`, each call gets its own session, and a sandbox the tool opens is deleted when the call ends. With `key` (1 to 512 characters), calls from the same `auth` principal with the same key share a session id and a sandbox, which is kept between calls; this needs Vercel Sandbox
|
|
71
|
+
- `invokeTool(name, input, { auth, key })` runs one of those tools as `auth`, outside any conversation: no model, turn, or workflow run. Authored state starts from its initial value and is not kept. Without `key`, each call gets its own session, and a sandbox the tool opens is deleted when the call ends. With `key` (1 to 512 characters), calls from the same `auth` principal with the same key share a session id and a sandbox, which is kept between calls; this needs Vercel Sandbox, just-bash, or a custom provider that sets `toolSessions: true`, and an authenticated `auth` (a keyed call from the anonymous principal is `denied`); see [MCP tool sessions](./mcp#tool-sessions). When a trusted forwarder asserted `auth`, pass the principal your route verified as `forwardedBy`: it is part of the session, so one user reached through two forwarders gets two sessions. It resolves to `completed` with the tool's output, or to `invalid-input`, `denied`, `failed`, `approval-required` when the tool's approval policy asks a person (the tool did not run), or `authorization-required` with the connections the tool needs a sign-in to.
|
|
72
72
|
|
|
73
73
|
A direct call doesn't go through the AI SDK, so AI SDK telemetry integrations never see it. Conversation tool calls do: an integration that an `agent/instrumentation/*.ts` module registers with `registerTelemetry()` from `ai` receives `onToolExecutionStart` and `onToolExecutionEnd` for each of them. A direct call is traced by eve itself instead. It gets an `execute_tool` span under the caller's trace and emits `tool.call.started` and `tool.call.completed` to instrumentation. Over MCP, the caller's trace comes from the request's `_meta` trace context (see [Trace context](./mcp#trace-context)).
|
|
74
74
|
|
|
@@ -124,10 +124,10 @@ const currentSession = await resolveSession(threadId);
|
|
|
124
124
|
```
|
|
125
125
|
|
|
126
126
|
When the session at an address is
|
|
127
|
-
[stranded](../
|
|
127
|
+
[stranded](../guides/deployment/self-hosting#recover-a-stranded-session) because another eve version
|
|
128
128
|
built it, `send()` ends that session and starts a fresh one. The message becomes the fresh
|
|
129
129
|
session's first turn, and the fresh session can read recent text from the earlier conversation;
|
|
130
|
-
see [
|
|
130
|
+
see [Recover a stranded session](../guides/deployment/self-hosting#recover-a-stranded-session). Concurrent sends to the same stranded address still
|
|
131
131
|
produce one fresh session. A `respond()` call, or a `deliver()` that includes input responses,
|
|
132
132
|
carries answers a fresh session has no request for, so it throws `SessionStrandedError` and leaves
|
|
133
133
|
the stranded session in place.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "Discord"
|
|
3
|
-
description: "Reach your agent from Discord
|
|
3
|
+
description: "Reach your agent from Discord messages, DMs, and mentions, and from slash commands, components, and modals."
|
|
4
4
|
type: integration
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
The Discord channel wires your agent into Discord's HTTP Interactions, including slash and application commands, message components, and modal submissions. Discord enforces a three-second ACK deadline, so the channel acknowledges the command right away and runs the eve work in the background. Credentials and inbound request verification run through [Vercel Connect](../guides/auth-and-route-protection), so Discord's bot token stays out of your environment and Connect verifies Discord's signature before forwarding an interaction to eve. See [Channels](./overview) for the contract this builds on.
|
|
7
|
+
The Discord channel wires your agent into Discord's HTTP Interactions, including slash and application commands, message components, and modal submissions. Discord enforces a three-second ACK deadline, so the channel acknowledges the command right away and runs the eve work in the background. Credentials and inbound request verification run through [Vercel Connect](../guides/auth-and-route-protection), so Discord's bot token stays out of your environment and Connect verifies Discord's signature before forwarding an interaction to eve. To also answer DMs and mentions, add a [Discord Gateway relay](#reply-to-dms-and-mentions-experimental). See [Channels](./overview) for the contract this builds on.
|
|
8
8
|
|
|
9
9
|
## Set up Discord
|
|
10
10
|
|
|
@@ -14,19 +14,24 @@ Run the guided setup from your eve project:
|
|
|
14
14
|
pnpm eve add channel/discord
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
The setup guides you through creating a Discord application and bot,
|
|
17
|
+
The setup first asks how people should reach the agent: through **DMs, mentions, and threads**, or through **a slash command**. It then guides you through creating a Discord application and bot, and:
|
|
18
18
|
|
|
19
19
|
- signs you in to Vercel and creates or links a project when needed;
|
|
20
20
|
- validates the bot token;
|
|
21
21
|
- creates a Vercel Connect client and attaches `/eve/v1/discord` as its trigger destination;
|
|
22
|
-
-
|
|
23
|
-
-
|
|
22
|
+
- configures the Discord application's Interactions Endpoint URL, which buttons such as HITL choices and sign-ins use either way;
|
|
23
|
+
- for DMs, mentions, and threads, writes the [Gateway relay](#run-the-relay-as-a-vercel-daemon) in `daemon/`, registers it in `vercel.json` in the project's first function region, and turns on the bot's Message Content intent when Discord allows it;
|
|
24
|
+
- for a slash command, registers it with a required `message` option and an optional `file` attachment option;
|
|
24
25
|
- scaffolds the channel with Connect-managed credentials; and
|
|
25
26
|
- prints the bot installation URL.
|
|
26
27
|
|
|
27
|
-
The command defaults to `/ask` with the description **Ask the eve agent**. You can edit both during setup. Discord global commands can take up to an hour to appear after registration.
|
|
28
|
+
The slash command defaults to `/ask` with the description **Ask the eve agent**. You can edit both during setup. Discord global commands can take up to an hour to appear after registration. A bot that answers messages can take slash commands too: register one as described in [Configure Discord manually](#configure-discord-manually), and the channel handles it.
|
|
28
29
|
|
|
29
|
-
|
|
30
|
+
In a non-interactive run, answer `discord-messages` with `"gateway"` for DMs, mentions, and threads, or `"commands"` for a slash command. `--yes` picks the slash command, because the relay is experimental and runs as an always-on Vercel Daemon.
|
|
31
|
+
|
|
32
|
+
If your project configures Vercel in `vercel.ts`, setup leaves it alone and prints the `daemons` entry to add to it.
|
|
33
|
+
|
|
34
|
+
The generated channel looks like this, plus `gateway: {}` when the agent answers messages:
|
|
30
35
|
|
|
31
36
|
```ts title="agent/channels/discord.ts"
|
|
32
37
|
import { connectDiscordCredentials } from "@vercel/connect/eve";
|
|
@@ -53,6 +58,267 @@ curl -X PUT "https://discord.com/api/v10/applications/$DISCORD_APPLICATION_ID/co
|
|
|
53
58
|
|
|
54
59
|
Then configure the public `https://…/eve/v1/discord` route as the application's Interactions Endpoint URL. Pass `credentials: { applicationId, botToken, publicKey }` to `discordChannel`, or set the corresponding `DISCORD_APPLICATION_ID`, `DISCORD_BOT_TOKEN`, and `DISCORD_PUBLIC_KEY` environment variables.
|
|
55
60
|
|
|
61
|
+
## Reply to DMs and mentions (experimental)
|
|
62
|
+
|
|
63
|
+
Discord sends ordinary messages, such as DMs, mentions, and thread replies, only over its [Gateway WebSocket](https://discord.com/developers/docs/events/gateway), not as HTTP Interactions. Gateway support is experimental, and its API may change. To receive them, run `experimental_runDiscordGatewayRelay` from `eve/channels/discord/gateway` in a process that stays connected, and enable the matching route on the channel. The relay forwards each `MESSAGE_CREATE` dispatch to the agent unchanged, and the channel replies through the same handlers it uses for commands, including HITL buttons and error messages.
|
|
64
|
+
|
|
65
|
+
```text
|
|
66
|
+
Discord Gateway ── WebSocket ──▶ relay (Vercel Daemon) ── POST /eve/v1/discord/gateway ──▶ agent ── REST ──▶ Discord
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Enable the Gateway route
|
|
70
|
+
|
|
71
|
+
Add `gateway` to the channel. It mounts `POST /eve/v1/discord/gateway`. Because each forwarded message names its author, the route by default accepts only `localDev()` and Vercel OIDC tokens from the same project and environment, which excludes preview deployments calling production:
|
|
72
|
+
|
|
73
|
+
```ts title="agent/channels/discord.ts"
|
|
74
|
+
import { connectDiscordCredentials } from "@vercel/connect/eve";
|
|
75
|
+
import { discordChannel } from "eve/channels/discord";
|
|
76
|
+
|
|
77
|
+
export default discordChannel({
|
|
78
|
+
credentials: connectDiscordCredentials("discord/my-agent"),
|
|
79
|
+
gateway: {},
|
|
80
|
+
});
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Vercel Connect is optional here too: without `credentials`, the channel reads `DISCORD_APPLICATION_ID` and `DISCORD_BOT_TOKEN`, and the relay reads `DISCORD_BOT_TOKEN`. Pass `gateway.auth` to accept a relay that [runs outside Vercel](#run-the-relay-outside-vercel), and `gateway.route` to change the path. Whoever passes `gateway.auth` can send messages as any Discord user, so keep it as narrow as the default.
|
|
84
|
+
|
|
85
|
+
### Run the relay as a Vercel Daemon
|
|
86
|
+
|
|
87
|
+
A Vercel Daemon keeps the relay connected. Vercel Daemons are in beta. When you choose to answer messages, `eve add channel/discord` writes these files for you. To add them yourself, put the relay in its own directory with the same credentials as the agent:
|
|
88
|
+
|
|
89
|
+
```ts title="daemon/main.ts"
|
|
90
|
+
import { connectDiscordCredentials } from "@vercel/connect/eve";
|
|
91
|
+
import { experimental_runDiscordGatewayRelay } from "eve/channels/discord/gateway";
|
|
92
|
+
|
|
93
|
+
await experimental_runDiscordGatewayRelay({
|
|
94
|
+
credentials: connectDiscordCredentials("discord/my-agent"),
|
|
95
|
+
messageContent: false,
|
|
96
|
+
url: process.env.EVE_URL,
|
|
97
|
+
});
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
```json title="daemon/package.json"
|
|
101
|
+
{
|
|
102
|
+
"private": true,
|
|
103
|
+
"type": "module",
|
|
104
|
+
"dependencies": {
|
|
105
|
+
"@vercel/connect": "<same version as your agent>",
|
|
106
|
+
"eve": "<same version as your agent>"
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
The image installs from `package-lock.json` too, if you commit one in `daemon/`:
|
|
112
|
+
|
|
113
|
+
```dockerfile title="daemon/Dockerfile"
|
|
114
|
+
FROM node:24-slim
|
|
115
|
+
WORKDIR /app
|
|
116
|
+
ENV NODE_ENV=production
|
|
117
|
+
COPY package*.json ./
|
|
118
|
+
RUN npm install --omit=dev --no-audit --no-fund
|
|
119
|
+
COPY main.ts ./
|
|
120
|
+
USER node
|
|
121
|
+
CMD ["node", "main.ts"]
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Register the daemon in `vercel.json` with exactly one instance:
|
|
125
|
+
|
|
126
|
+
```json title="vercel.json"
|
|
127
|
+
{
|
|
128
|
+
"daemons": {
|
|
129
|
+
"discord-gateway": {
|
|
130
|
+
"root": "daemon",
|
|
131
|
+
"entrypoint": "Dockerfile",
|
|
132
|
+
"instances": { "iad1": 1 }
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
On Vercel, the relay sends messages to `https://$VERCEL_PROJECT_PRODUCTION_URL` and signs each request with the project's Vercel OIDC token, so the agent and relay need no shared secret. Set `url` to send them elsewhere.
|
|
139
|
+
|
|
140
|
+
The bot needs the **Send Messages in Threads** permission to reply in threads, in addition to **View Channels** and **Send Messages**, and **Create Public Threads** to [start threads](#reply-in-threads). This install URL grants all four plus **Read Message History**; replace `<APPLICATION_ID>`:
|
|
141
|
+
|
|
142
|
+
```text
|
|
143
|
+
https://discord.com/oauth2/authorize?client_id=<APPLICATION_ID>&scope=bot+applications.commands&permissions=309237713920
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### Run the relay outside Vercel
|
|
147
|
+
|
|
148
|
+
`experimental_runDiscordGatewayRelay` runs on any host that keeps a Node.js 24 process up, such as a VM, a container platform, or a home server, while the agent stays on Vercel. Run exactly one relay per bot. Three things change off Vercel:
|
|
149
|
+
|
|
150
|
+
- **Credentials.** Vercel Connect authenticates callers with your project's Vercel OIDC token, which other hosts don't have, so give the relay the bot token directly. The agent can keep using Connect.
|
|
151
|
+
- **URL.** The relay can't read `VERCEL_PROJECT_PRODUCTION_URL`, so pass the agent's URL as `url`.
|
|
152
|
+
- **Auth.** The route's default auth accepts only your Vercel project's own runtime. Use a shared secret instead: `basic()` from `eve/agents/auth` signs the relay's requests, and `httpBasic()` on `gateway.auth` checks them.
|
|
153
|
+
|
|
154
|
+
Generate a long random secret, for example with `openssl rand -hex 32`, and set it as `DISCORD_RELAY_SECRET` on both the agent's Vercel project and the relay's host. On the agent:
|
|
155
|
+
|
|
156
|
+
```ts title="agent/channels/discord.ts"
|
|
157
|
+
import { connectDiscordCredentials } from "@vercel/connect/eve";
|
|
158
|
+
import { httpBasic, localDev } from "eve/channels/auth";
|
|
159
|
+
import { discordChannel } from "eve/channels/discord";
|
|
160
|
+
|
|
161
|
+
export default discordChannel({
|
|
162
|
+
credentials: connectDiscordCredentials("discord/my-agent"),
|
|
163
|
+
gateway: {
|
|
164
|
+
auth: [
|
|
165
|
+
localDev(),
|
|
166
|
+
httpBasic({ username: "discord-relay", password: process.env.DISCORD_RELAY_SECRET! }),
|
|
167
|
+
],
|
|
168
|
+
},
|
|
169
|
+
});
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
On the relay, set `DISCORD_BOT_TOKEN` to the token from **Bot** → **Reset Token** in the Discord Developer Portal, and `EVE_URL` to the agent's production URL:
|
|
173
|
+
|
|
174
|
+
```ts title="relay/main.ts"
|
|
175
|
+
import { basic } from "eve/agents/auth";
|
|
176
|
+
import { experimental_runDiscordGatewayRelay } from "eve/channels/discord/gateway";
|
|
177
|
+
|
|
178
|
+
await experimental_runDiscordGatewayRelay({
|
|
179
|
+
// Reads DISCORD_BOT_TOKEN when `credentials` is omitted.
|
|
180
|
+
url: process.env.EVE_URL,
|
|
181
|
+
auth: basic({ username: "discord-relay", password: process.env.DISCORD_RELAY_SECRET! }),
|
|
182
|
+
});
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
The relay's `package.json` needs only `eve`. Build the image from the same Dockerfile as the [daemon](#run-the-relay-as-a-vercel-daemon), then run it with a restart policy so a crash or host reboot brings it back:
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
docker run -d --restart unless-stopped \
|
|
189
|
+
-e DISCORD_BOT_TOKEN -e DISCORD_RELAY_SECRET -e EVE_URL=https://my-agent.vercel.app \
|
|
190
|
+
discord-relay
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
The relay stops on `SIGTERM` after delivering what it has in flight. It exits with an error when Discord refuses the bot token or intents, and restarting it won't help until you fix the configuration. If Deployment Protection covers the URL the relay posts to, create a Protection Bypass for Automation secret, and pass `auth` a function that returns the Basic `authorization` header together with an `x-vercel-protection-bypass` header carrying that secret.
|
|
194
|
+
|
|
195
|
+
### Who the bot answers
|
|
196
|
+
|
|
197
|
+
By default the channel answers a message when it is a DM, mentions the bot, replies to one of the bot's messages, or arrives in a thread where the bot already has a conversation. It strips the bot's mention from the text, and it never answers messages from bots, including its own. Messages group into sessions this way:
|
|
198
|
+
|
|
199
|
+
| Message | Session |
|
|
200
|
+
| ------------------------------------ | -------------------------------------------------------------------------------------- |
|
|
201
|
+
| A DM | One per DM channel |
|
|
202
|
+
| A message in a thread | One per thread |
|
|
203
|
+
| A mention in a text channel | A new [thread](#reply-in-threads) started from the message, one session for the thread |
|
|
204
|
+
| A reply to the bot in a text channel | The session that posted the replied-to message |
|
|
205
|
+
|
|
206
|
+
A mention in a text channel starts a thread, as the Slack channel does, so each conversation stays out of the channel and two people, or one person's unrelated questions, don't share context. Every message the bot posts continues its session when someone replies to it, including slash command responses in the channel. A reply to a bot message that no live session owns starts a new thread.
|
|
207
|
+
|
|
208
|
+
Mention the bot's user, not the role with the same name that Discord creates for it. Discord's autocomplete offers both, and a role mention doesn't address the bot.
|
|
209
|
+
|
|
210
|
+
Discord sends the text of messages that neither mention the bot nor arrive as a DM only to bots with the privileged **Message Content** intent. Without it, thread follow-ups that skip the mention, and replies whose author turned off the reply ping, arrive empty and are ignored. `eve add channel/discord` turns the intent on and sets `messageContent: true` when Discord allows it, which it does for bots in fewer than 100 servers. Otherwise, enable **Message Content Intent** under **Bot** in the Discord Developer Portal, then pass `messageContent: true` to `experimental_runDiscordGatewayRelay`. Discord refuses the relay's connection if you request the intent before enabling it, and the relay stops with an error naming the close code.
|
|
211
|
+
|
|
212
|
+
To choose which messages run the agent, under what `auth`, or which session they join, set `gateway.onMessage(ctx, message)`. It runs for every message from a person and returns `{ auth }` to dispatch or `null` to ignore. `message.addressed` reports whether the default would answer, and `message.referencedMessageId` names the message it replies to. `defaultDiscordMessageAuth(message)` gives the author the same principal `defaultDiscordAuth` gives them for commands and button presses, so requester-only approvals work across both:
|
|
213
|
+
|
|
214
|
+
```ts
|
|
215
|
+
import { defaultDiscordMessageAuth, discordChannel } from "eve/channels/discord";
|
|
216
|
+
|
|
217
|
+
export default discordChannel({
|
|
218
|
+
gateway: {
|
|
219
|
+
onMessage: (_ctx, message) =>
|
|
220
|
+
message.addressed && message.guildId === "123456789012345678"
|
|
221
|
+
? { auth: defaultDiscordMessageAuth(message) }
|
|
222
|
+
: null,
|
|
223
|
+
},
|
|
224
|
+
});
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
Return `conversation` to change how messages group. Messages with the same key share a session within their Discord channel. A message ID is the key of the session that owns that message, `"channel"` is one session for the whole channel, and any other string is your own grouping. Omit it to keep the default above. For example, to give each person one ongoing session per channel:
|
|
228
|
+
|
|
229
|
+
```ts
|
|
230
|
+
import { defaultDiscordMessageAuth, discordChannel } from "eve/channels/discord";
|
|
231
|
+
|
|
232
|
+
export default discordChannel({
|
|
233
|
+
gateway: {
|
|
234
|
+
onMessage: (_ctx, message) =>
|
|
235
|
+
message.addressed
|
|
236
|
+
? { auth: defaultDiscordMessageAuth(message), conversation: `user:${message.author.id}` }
|
|
237
|
+
: null,
|
|
238
|
+
},
|
|
239
|
+
});
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### Reply in threads
|
|
243
|
+
|
|
244
|
+
By default, the bot answers a mention in a text channel in a new thread. The channel starts a public thread from the person's message, named after its first line, and adds the person to it. The thread holds one session, so later messages in it continue the conversation. Threads apply only to messages that would start a new session in a text channel. DMs, messages already in a thread, and replies that continue a session stay where they are. If Discord refuses to create the thread, for example because the bot lacks **Create Public Threads**, the bot answers in the channel instead.
|
|
245
|
+
|
|
246
|
+
To answer in the channel instead, set `gateway.startThread` to `false`. A mention then starts a session in the channel, and replies to the bot's messages continue it:
|
|
247
|
+
|
|
248
|
+
```ts title="agent/channels/discord.ts"
|
|
249
|
+
import { connectDiscordCredentials } from "@vercel/connect/eve";
|
|
250
|
+
import { discordChannel } from "eve/channels/discord";
|
|
251
|
+
|
|
252
|
+
export default discordChannel({
|
|
253
|
+
credentials: connectDiscordCredentials("discord/my-agent"),
|
|
254
|
+
gateway: { startThread: false },
|
|
255
|
+
});
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
`onMessage` can decide per message by returning `startThread`, which overrides `gateway.startThread`. Return `false` to answer in the channel, `true` for a thread, or options to name the thread and set how long Discord waits before archiving it:
|
|
259
|
+
|
|
260
|
+
```ts
|
|
261
|
+
import { defaultDiscordMessageAuth, discordChannel } from "eve/channels/discord";
|
|
262
|
+
|
|
263
|
+
export default discordChannel({
|
|
264
|
+
gateway: {
|
|
265
|
+
onMessage: (_ctx, message) =>
|
|
266
|
+
message.addressed
|
|
267
|
+
? {
|
|
268
|
+
auth: defaultDiscordMessageAuth(message),
|
|
269
|
+
startThread: message.attachments.length > 0 && {
|
|
270
|
+
name: `Review: ${message.attachments[0]!.filename}`,
|
|
271
|
+
autoArchiveMinutes: 1440,
|
|
272
|
+
},
|
|
273
|
+
}
|
|
274
|
+
: null,
|
|
275
|
+
},
|
|
276
|
+
});
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
### Forward messages from your own relay
|
|
280
|
+
|
|
281
|
+
The route accepts any relay that holds a Gateway connection, such as an existing discord.js bot, so you don't have to run `experimental_runDiscordGatewayRelay`. Forward each Gateway dispatch payload unchanged, as the JSON body of a `POST` to `/eve/v1/discord/gateway`:
|
|
282
|
+
|
|
283
|
+
```json
|
|
284
|
+
{
|
|
285
|
+
"op": 0,
|
|
286
|
+
"t": "MESSAGE_CREATE",
|
|
287
|
+
"s": 42,
|
|
288
|
+
"d": { "id": "…", "channel_id": "…", "author": { "…": "…" } }
|
|
289
|
+
}
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
The route handles `MESSAGE_CREATE` and acknowledges other dispatch types without acting on them. Authenticate the request as `gateway.auth` requires; by default, that is a Vercel OIDC token from the same project and environment. The relay needs the `GUILD_MESSAGES` (`1 << 9`) and `DIRECT_MESSAGES` (`1 << 12`) intents, plus `MESSAGE_CONTENT` (`1 << 15`) for messages that don't mention the bot. Use the response status to decide whether to retry:
|
|
293
|
+
|
|
294
|
+
| Status | Meaning | Relay should |
|
|
295
|
+
| ------ | -------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ |
|
|
296
|
+
| `202` | A turn started. The body is `{ accepted: true, sessionId }`. | Stop. |
|
|
297
|
+
| `200` | Ignored on purpose. The body is `{ accepted: false, reason }`, for example `not_accepted`. | Stop. |
|
|
298
|
+
| `400` | The body is not JSON. | Not retry. |
|
|
299
|
+
| `401` | Authentication failed. | Fix credentials, not retry. |
|
|
300
|
+
| `413` | The body is over 1 MB. | Not retry. |
|
|
301
|
+
| `429` | Rate limited before the route ran. | Retry with backoff. |
|
|
302
|
+
| `5xx` | Unknown. The route answers `500` before dispatch when `onMessage` throws, but a platform `502` or `504` can come after a turn started. | Not retry, unless your relay deduplicates. |
|
|
303
|
+
|
|
304
|
+
eve does not deduplicate messages. If the relay retries after eve already started a turn, for example because the response was lost, the agent answers twice. `experimental_runDiscordGatewayRelay` retries only a `429`, or a connection that failed before the request reached eve.
|
|
305
|
+
|
|
306
|
+
### Run the relay locally
|
|
307
|
+
|
|
308
|
+
Pull a development OIDC token with `vercel env pull .env.local`, start `eve dev`, then run the relay against it from another terminal:
|
|
309
|
+
|
|
310
|
+
```bash
|
|
311
|
+
EVE_URL=http://localhost:2000 node --env-file=.env.local daemon/main.ts
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
Scale the production daemon to zero while you do this. Every connection receives every message, so two relays make the agent answer twice.
|
|
315
|
+
|
|
316
|
+
### Limitations
|
|
317
|
+
|
|
318
|
+
- Run one relay per bot. Each connection receives every message. Bots large enough to need Discord's sharding are out of scope.
|
|
319
|
+
- Messages sent while no relay is connected are not delivered. On a deploy, Vercel sends `SIGTERM` to the old daemon and starts the new one at the same time. The old relay disconnects right away, so messages sent while the new daemon boots and connects, usually a few seconds, are lost. A crash or restart leaves the same gap. The relay does not resume the previous Gateway session in a new process, so Discord does not replay these messages.
|
|
320
|
+
- `experimental_runDiscordGatewayRelay` drops a message, rather than retrying it, when eve answers with a `5xx`, takes longer than 30 seconds to accept it, or the connection fails after the request is sent. eve may have started the turn already, and a retry could answer twice. The relay logs each dropped message.
|
|
321
|
+
|
|
56
322
|
## How the channel handles messages
|
|
57
323
|
|
|
58
324
|
### Dispatch
|
|
@@ -116,6 +382,12 @@ export default discordChannel({
|
|
|
116
382
|
});
|
|
117
383
|
```
|
|
118
384
|
|
|
385
|
+
### Connection sign-ins
|
|
386
|
+
|
|
387
|
+
When a connection needs the person to sign in, the default `authorization.required` handler posts it to the conversation. In a DM, the message includes a link button to the sign-in page and any confirmation code. In a server, the shared message only says who has to sign in and has a **Sign in** button. When someone presses it, eve identifies them the same way it does for HITL presses (`onInputResponse`). If that's the person who has to sign in, eve answers with an ephemeral message holding the link and code, which only they can see. Anyone else gets an ephemeral note that they can't open it. That way another member can't finish the sign-in with their own account and have it saved under the requester's identity. Once the sign-in completes or is cancelled, eve edits the message to say so and removes its button.
|
|
388
|
+
|
|
389
|
+
If `onCommand` or `gateway.onMessage` gives people principals other than the default, set `onInputResponse` to the same mapping. Otherwise eve can't match a press to the person who has to sign in, and nobody can open the sign-in in a server.
|
|
390
|
+
|
|
119
391
|
### Proactive sessions
|
|
120
392
|
|
|
121
393
|
Start a session without an inbound interaction through `to(discord, target).send(message, { auth })` from a schedule `run` handler, or `ctx.to(discord, target).send(message, { auth })` from another channel. The proactive target shape is `{ channelId, conversationId?, initialMessage? }`. Either path needs a bot token, supplied by Connect or `DISCORD_BOT_TOKEN`.
|
package/docs/channels/eve.mdx
CHANGED
|
@@ -91,7 +91,7 @@ The default eve channel inspects the agent, creates sessions, accepts callbacks
|
|
|
91
91
|
- `GET /eve/v1/health` (check whether the application is reachable)
|
|
92
92
|
- `GET /eve/v1/info` (inspect the agent)
|
|
93
93
|
- `POST /eve/v1/session` (create a session, optionally sending its first message)
|
|
94
|
-
- `POST /eve/v1/session/:sessionId` (send a follow-up)
|
|
94
|
+
- `POST /eve/v1/session/:sessionId` (send a follow-up, respond to an input request, or prepare an idle session with an empty body)
|
|
95
95
|
- `POST /eve/v1/session/:sessionId/cancel` (cancel the in-flight turn)
|
|
96
96
|
- `POST /eve/v1/session/:sessionId/clear` (clear the session's model history)
|
|
97
97
|
- `POST /eve/v1/session/:sessionId/compact` (compact the session's context)
|
|
@@ -100,6 +100,17 @@ The default eve channel inspects the agent, creates sessions, accepts callbacks
|
|
|
100
100
|
|
|
101
101
|
The session routes use only durable session IDs. Create a session explicitly, then put its returned ID in every follow-up, control, and stream path.
|
|
102
102
|
|
|
103
|
+
`POST /eve/v1/session/:sessionId` with no body or `{}` prepares an existing session using
|
|
104
|
+
the channel's auth policy. Non-empty bodies retain the message and input-response behavior;
|
|
105
|
+
empty or invalid messages and payloads without either input are rejected. Preparation
|
|
106
|
+
returns `{ ok: true, status }`: `ready` when the owner already uses the serving
|
|
107
|
+
deployment, `accepted` (HTTP 202) when a background preparation hint has been queued,
|
|
108
|
+
`unsupported` when the World or owner cannot prepare, or `no_active_session` when no live
|
|
109
|
+
owner exists. Other successful statuses use HTTP 200. Acceptance does not mean the handoff
|
|
110
|
+
has completed. Idle preparation preserves the session ID, stream, history, and expiry;
|
|
111
|
+
active work is not interrupted. See the [frontend guide](../guides/frontend/overview#returned-state)
|
|
112
|
+
for client usage and deployment routing.
|
|
113
|
+
|
|
103
114
|
`GET /eve/v1/health` is public and returns `{ ok: true, status: "ready", workflowId: string }`. `GET /eve/v1/info` uses the channel's auth policy and returns agent-info version 6. The TypeScript client validates both successful payloads: malformed health JSON throws `HealthResponseError`, malformed inspection JSON throws `AgentInfoResponseError`, and a non-success response from either route throws `ClientError`.
|
|
104
115
|
|
|
105
116
|
### Start and continue a session
|
|
@@ -402,7 +413,7 @@ export default defineChannel({
|
|
|
402
413
|
|
|
403
414
|
The client then resumes that session by id, for example with `useEveAgent({ initialSession: { sessionId, streamIndex: 0 }, resume: true })`. `created` is `false` when a session already owned the address, or another `create()` or `send()` claimed it first. That session comes back unchanged and your `history` was not added, so check `created` before treating the session as seeded. Use a new address for each new conversation or branch.
|
|
404
415
|
|
|
405
|
-
When the session at the address is [stranded](../
|
|
416
|
+
When the session at the address is [stranded](../guides/deployment/self-hosting#recover-a-stranded-session), `create()` throws `SessionStrandedError` instead of replacing it, because that session may hold the conversation you meant to import. Call `reset()` on the address, then `create()` again.
|
|
406
417
|
|
|
407
418
|
`create()` returns once the new session claims its address, so a `send()` right after it reaches that session. It throws if no session claims the address within 15 seconds.
|
|
408
419
|
|
package/docs/channels/linq.mdx
CHANGED
|
@@ -16,7 +16,7 @@ export default linqChannel({
|
|
|
16
16
|
});
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
The default webhook route is `/eve/v1/linq`. The channel verifies forwarded webhooks with same
|
|
19
|
+
The default webhook route is `/eve/v1/linq`. The channel verifies forwarded webhooks with Vercel OIDC from the same project and environment by default, derives user auth from each message author, marks accepted messages as read, and continues the same eve session for every message in a Linq conversation. A new accepted message steers the active turn. Before answer output or local tool execution begins, steering can interrupt pending model generation. Executing tools finish first; after answer output starts, steering waits for the next committed workflow boundary. See [Overlapping messages](./overview#overlapping-messages).
|
|
20
20
|
|
|
21
21
|
Set `turnPolicy: "queue"` when every response should finish before Linq starts the next message.
|
|
22
22
|
|
|
@@ -37,7 +37,7 @@ export default linqChannel({
|
|
|
37
37
|
});
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
Set `route` to override the webhook path or `webhookVerifier` to use a different trusted-forwarder verifier.
|
|
40
|
+
Set `route` to override the webhook path or `webhookVerifier` to use a different trusted-forwarder verifier. A verifier rejects a webhook by throwing or returning a falsy value such as `null` or `false`.
|
|
41
41
|
|
|
42
42
|
## Tapbacks
|
|
43
43
|
|
package/docs/channels/mcp.mdx
CHANGED
|
@@ -308,13 +308,13 @@ Tool sessions need an authenticated caller. With `auth: none()` every request is
|
|
|
308
308
|
In a tool session:
|
|
309
309
|
|
|
310
310
|
- The sandbox opens on the first `ctx.getSandbox()` and is kept for later calls with the same key. Concurrent first calls share one sandbox.
|
|
311
|
-
- The sandbox
|
|
311
|
+
- The sandbox is found from the session id alone. A deploy that changes the sandbox definition (the template, its snapshot, the open options in `sandbox.ts`, or its resources) keeps using the existing sandbox for the key; the current definition applies only when a sandbox is created, such as after the old one expires as below. Deployments that share a sandbox namespace, such as preview and production deployments of one Vercel project, also share the sandbox for the same principal and key.
|
|
312
312
|
- `ctx.session.id` is the same for every call with the key.
|
|
313
313
|
- Traces still show each call as its own run. Its `agent.run.id` and `gen_ai.conversation.id` are a fresh id for that call, not `ctx.session.id`, so traces do not link calls that share a key.
|
|
314
314
|
- Authored state still starts from its initial value on every call, and updates are not kept. Keep data that must outlive a call in the sandbox.
|
|
315
315
|
- Calls may still run in parallel, and nothing orders them.
|
|
316
316
|
|
|
317
|
-
Tool sessions need a sandbox provider
|
|
317
|
+
Tool sessions need a sandbox provider whose kept sandboxes stay bounded: Vercel Sandbox, just-bash, or a [custom provider](/docs/sandbox/custom-providers#keep-sandboxes-for-keyed-tool-calls) that sets `toolSessions: true`. On another provider, a call with a key fails with a `Sandbox provider "<name>" cannot keep a sandbox between invokeTool calls` error when the tool opens its sandbox. Tools that never open a sandbox still run. just-bash keeps its sandboxes on the local disk, so on Vercel Functions a just-bash tool session lasts only as long as the function instance.
|
|
318
318
|
|
|
319
319
|
A tool session has no end, so eve bounds how long its sandbox is kept. On Vercel Sandbox, a tool-session sandbox's saved filesystem expires a day after its last use, and each call that resumes it restarts that day. The next call with the key after that replaces it with a fresh, empty sandbox. If two calls with the key find the expired filesystem at the same time, each can replace the sandbox, and files the first one writes can be lost. Vercel only keeps the latest snapshot of the sandbox. Tool sessions use this one-day expiry whatever `snapshotExpiration` `sandbox.ts` sets; sessions that conversations start keep the authored setting.
|
|
320
320
|
|
|
@@ -98,7 +98,7 @@ eve's first-class channels use eve-owned runtimes for webhook handling, verifica
|
|
|
98
98
|
| Slack mentions, DMs, buttons | [Slack](./slack) |
|
|
99
99
|
| iMessage and SMS | [Linq](./linq) |
|
|
100
100
|
| iMessage | [Photon](./photon) |
|
|
101
|
-
| Discord slash commands
|
|
101
|
+
| Discord messages, DMs, slash commands | [Discord](./discord) |
|
|
102
102
|
| Microsoft Teams messages + Adaptive Cards | [Teams](./teams) |
|
|
103
103
|
| Telegram bot messages | [Telegram](./telegram) |
|
|
104
104
|
| SMS or speech-transcribed phone calls | [Twilio](./twilio) |
|
package/docs/channels/photon.mdx
CHANGED
|
@@ -22,7 +22,7 @@ export default photonIMessageChannel({
|
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
The default webhook route is `/eve/v1/photon`. The channel verifies forwarded
|
|
25
|
-
webhooks with same
|
|
25
|
+
webhooks with Vercel OIDC from the same project and environment by default, derives user auth from each
|
|
26
26
|
message author, marks accepted messages as read, and continues the same eve
|
|
27
27
|
session for every message in an iMessage conversation. A new accepted message
|
|
28
28
|
steers the active turn. Steering can interrupt pending model generation before
|
|
@@ -81,7 +81,7 @@ export default disableTool();
|
|
|
81
81
|
|
|
82
82
|
### `read_file`
|
|
83
83
|
|
|
84
|
-
`read_file` reads text files from the sandbox with line-numbered output, and shows PNG, JPEG, GIF, and WebP images up to 3 MiB and 8000 pixels per side, and PDFs up to 20 MiB, to the model as files. Images and PDFs are detected from their bytes, so a missing or mismatched filename extension does not matter, and other text files are always read as text. It accepts absolute paths and paths beginning with `$HOME/`.
|
|
84
|
+
`read_file` reads text files from the sandbox with line-numbered output, and shows PNG, JPEG, GIF, and WebP images up to 3 MiB and 8000 pixels per side, and PDFs up to 20 MiB, to the model as files. Images and PDFs are detected from their bytes, so a missing or mismatched filename extension does not matter, and other text files are always read as text. It accepts absolute paths, paths relative to the workspace root where `bash` commands start, and paths beginning with `$HOME/`. Results and errors name the resolved absolute path.
|
|
85
85
|
|
|
86
86
|
```sh
|
|
87
87
|
eve add tool/read_file
|
|
@@ -113,7 +113,7 @@ export default disableTool();
|
|
|
113
113
|
|
|
114
114
|
### `write_file`
|
|
115
115
|
|
|
116
|
-
`write_file` writes complete files in the sandbox. It enforces read-before-write and stale-read detection, and accepts
|
|
116
|
+
`write_file` writes complete files in the sandbox. It enforces read-before-write and stale-read detection, and accepts the same paths as `read_file`.
|
|
117
117
|
|
|
118
118
|
```sh
|
|
119
119
|
eve add tool/write_file
|
|
@@ -131,10 +131,15 @@ import { writeFile } from "eve/tools/write_file";
|
|
|
131
131
|
|
|
132
132
|
export default defineTool({
|
|
133
133
|
...writeFile,
|
|
134
|
-
description: "Write
|
|
134
|
+
description: "Write notes in the sandbox's notes directory.",
|
|
135
135
|
async execute(input, ctx) {
|
|
136
|
-
|
|
137
|
-
|
|
136
|
+
const sandbox = await ctx.getSandbox();
|
|
137
|
+
const notes = `${sandbox.resolvePath("notes")}/`;
|
|
138
|
+
if (
|
|
139
|
+
input.filePath.startsWith("$HOME") ||
|
|
140
|
+
!sandbox.resolvePath(input.filePath).startsWith(notes)
|
|
141
|
+
) {
|
|
142
|
+
throw new Error("write_file is limited to the notes directory");
|
|
138
143
|
}
|
|
139
144
|
return writeFile.execute(input, ctx);
|
|
140
145
|
},
|
|
@@ -291,7 +296,25 @@ eve add tool/agent
|
|
|
291
296
|
export { default } from "eve/tools/agent";
|
|
292
297
|
```
|
|
293
298
|
|
|
294
|
-
|
|
299
|
+
To let the model choose an AI Gateway model for each root-copy task, export `agentWithModel` from the same slot:
|
|
300
|
+
|
|
301
|
+
```ts title="agent/tools/agent.ts"
|
|
302
|
+
export { agentWithModel as default } from "eve/tools/agent";
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
This is a separate workflow tool that calls `ctx.agent("agent", { model })`. The default `agent` tool remains unchanged and does not gain a `model` parameter. The opt-in definition accepts:
|
|
306
|
+
|
|
307
|
+
```ts
|
|
308
|
+
{
|
|
309
|
+
message: string;
|
|
310
|
+
model: string; // AI Gateway model id for the child session
|
|
311
|
+
taskId?: string;
|
|
312
|
+
}
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
It otherwise has the default tool's task behavior: a call returns a receipt, the result arrives later, and `taskId` continues the same root-copy session. The selected model applies to every turn in that session. A continuation must repeat the original model; start a new task to use another one. Because the parent model controls this value, use this tool only when it may choose among every model your AI Gateway credentials and policies allow.
|
|
316
|
+
|
|
317
|
+
An authored tool at `agent/tools/agent.ts` replaces the framework behavior. Re-export the default definition above to restore direct root-copy delegation, export `agentWithModel` to expose model selection, export another tool such as `agentRouter()` to change the model-facing behavior, or disable the slot. `agentRouter()` runs each call as a [task](/docs/tools/workflows#run-calls-as-tasks-task), which adds `eve__task_wait` and `eve__task_cancel`:
|
|
295
318
|
|
|
296
319
|
```ts title="agent/tools/agent.ts"
|
|
297
320
|
import { disableTool } from "eve/tools";
|
|
@@ -356,7 +379,7 @@ export default askQuestion();
|
|
|
356
379
|
|
|
357
380
|
### `glob`
|
|
358
381
|
|
|
359
|
-
`glob` finds sandbox files by glob pattern. Add it:
|
|
382
|
+
`glob` finds sandbox files by glob pattern. It searches the workspace root unless the model passes a directory, which accepts the same paths as `read_file`. Add it:
|
|
360
383
|
|
|
361
384
|
```sh
|
|
362
385
|
eve add tool/glob
|
|
@@ -382,7 +405,7 @@ Remove the file to remove the tool. `disableTool()` is unnecessary because `glob
|
|
|
382
405
|
|
|
383
406
|
### `grep`
|
|
384
407
|
|
|
385
|
-
`grep` searches sandbox file contents with a regular expression. Add it:
|
|
408
|
+
`grep` searches sandbox file contents with a regular expression. It searches the workspace root unless the model passes a directory or file, which accepts the same paths as `read_file`. Add it:
|
|
386
409
|
|
|
387
410
|
```sh
|
|
388
411
|
eve add tool/grep
|