eve 0.63.0 → 0.64.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 +44 -0
- package/dist/src/ai/evaluate.js +1 -1
- package/dist/src/channel/channel-address.d.ts +4 -1
- package/dist/src/channel/channel-address.js +1 -1
- package/dist/src/channel/channel-operations.d.ts +4 -1
- package/dist/src/channel/cross-channel-receive.d.ts +4 -1
- package/dist/src/channel/cross-channel-receive.js +1 -1
- package/dist/src/channel/session.d.ts +3 -1
- package/dist/src/channel/session.js +1 -1
- package/dist/src/channel/types.d.ts +7 -0
- package/dist/src/chunks/{use-eve-agent-C5-yqRuq.js → use-eve-agent-BdKlQF32.js} +8 -8
- package/dist/src/chunks/{use-eve-agent-CVWk5KKy.js → use-eve-agent-IIuxkn6y.js} +8 -8
- package/dist/src/cli/commands/build.js +1 -1
- package/dist/src/cli/commands/init-agent-workspace.d.ts +2 -0
- package/dist/src/cli/commands/init.js +1 -1
- package/dist/src/cli/commands/registry-pnpm-build-policy-flow.d.ts +1 -1
- package/dist/src/cli/commands/registry-pnpm-build-policy-flow.js +1 -1
- package/dist/src/cli/dev/tui/line-editor.d.ts +11 -1
- package/dist/src/cli/dev/tui/line-editor.js +3 -3
- package/dist/src/cli/dev/tui/model-picker.d.ts +2 -0
- package/dist/src/cli/dev/tui/model-picker.js +1 -1
- package/dist/src/cli/dev/tui/runner.d.ts +0 -1
- package/dist/src/cli/dev/tui/runner.js +2 -2
- package/dist/src/cli/dev/tui/setup-panel.js +1 -1
- package/dist/src/cli/dev/tui/setup-selection-input.js +1 -1
- package/dist/src/cli/dev/tui/stream-format.d.ts +6 -0
- package/dist/src/cli/dev/tui/stream-format.js +2 -2
- package/dist/src/cli/dev/tui/terminal-renderer.d.ts +0 -1
- package/dist/src/cli/dev/tui/terminal-renderer.js +12 -12
- package/dist/src/cli/run.js +1 -1
- package/dist/src/client/agent-info-schema.d.ts +8 -14
- package/dist/src/client/agent-info-schema.js +1 -1
- package/dist/src/client/eve-agent-store.js +1 -1
- package/dist/src/client/session.js +1 -1
- package/dist/src/client/types.d.ts +4 -2
- package/dist/src/compiled/.vendor-stamp.json +11 -11
- package/dist/src/compiled/@chat-adapter/slack/_chat-adapter-shared.d.ts +1 -0
- package/dist/src/compiled/@chat-adapter/slack/api.d.ts +3 -2
- package/dist/src/compiled/@chat-adapter/slack/api.js +1 -1
- package/dist/src/compiled/@chat-adapter/slack/blocks.js +1 -1
- package/dist/src/compiled/@chat-adapter/slack/format.js +1 -1
- package/dist/src/compiled/@chat-adapter/slack/index.d.ts +410 -63
- package/dist/src/compiled/@chat-adapter/slack/index.js +47 -25
- package/dist/src/compiled/@chat-adapter/twilio/api.d.ts +5 -1
- package/dist/src/compiled/@chat-adapter/twilio/api.js +1 -1
- package/dist/src/compiled/@chat-adapter/twilio/index.d.ts +37 -3
- package/dist/src/compiled/@chat-adapter/twilio/index.js +5 -1
- package/dist/src/compiled/@chat-adapter/twilio/webhook.d.ts +2 -2
- package/dist/src/compiled/@chat-adapter/twilio/webhook.js +1 -1
- package/dist/src/compiled/@linqapp/chat-sdk-adapter/index.js +6 -6
- package/dist/src/compiled/@photon-ai/chat-adapter-imessage/index.js +50 -50
- package/dist/src/compiled/@vercel/sandbox/index.js +4 -4
- package/dist/src/compiled/@workflow/core/attribute-changes.d.ts +2 -1
- package/dist/src/compiled/@workflow/core/events-consumer.d.ts +6 -3
- package/dist/src/compiled/@workflow/core/index.js +2 -2
- package/dist/src/compiled/@workflow/core/private.d.ts +37 -5
- package/dist/src/compiled/@workflow/core/private.js +1 -1
- package/dist/src/compiled/@workflow/core/runtime/deployment-guard.d.ts +2 -1
- package/dist/src/compiled/@workflow/core/runtime/helpers.js +1 -1
- package/dist/src/compiled/@workflow/core/runtime/invocations.d.ts +35 -0
- package/dist/src/compiled/@workflow/core/runtime/lifecycle-hooks.d.ts +90 -0
- package/dist/src/compiled/@workflow/core/runtime/quickjs-runtime.d.ts +2 -1
- package/dist/src/compiled/@workflow/core/runtime/resume-hook.d.ts +8 -6
- package/dist/src/compiled/@workflow/core/runtime/step-single-flight.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/runtime.js +4 -4
- package/dist/src/compiled/@workflow/core/serialization.d.ts +5 -1
- package/dist/src/compiled/@workflow/core/serialization.js +1 -1
- package/dist/src/compiled/@workflow/core/version.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/workflow/set-attributes.d.ts +4 -0
- package/dist/src/compiled/@workflow/core/workflow.js +1 -1
- package/dist/src/compiled/@workflow/world/analytics.d.ts +1 -1
- package/dist/src/compiled/@workflow/world/attributes-validation.d.ts +5 -0
- package/dist/src/compiled/@workflow/world/events.d.ts +2 -2
- package/dist/src/compiled/@workflow/world/index.d.ts +2 -1
- package/dist/src/compiled/@workflow/world/interfaces.d.ts +12 -1
- package/dist/src/compiled/@workflow/world/invocation.d.ts +19 -0
- package/dist/src/compiled/@workflow/world/queue.d.ts +24 -3
- package/dist/src/compiled/@workflow/world-local/index.js +3 -3
- package/dist/src/compiled/@workflow/world-vercel/index.js +16 -16
- package/dist/src/compiled/_chunks/node/chunk-6QHBXN7B-gl4n6nmi.js +12 -0
- package/dist/src/compiled/_chunks/node/chunk-7WDLOIRP-B_IWkVtZ.js +1 -0
- package/dist/src/compiled/_chunks/node/chunk-KBOOTKHF-DJqFk2r1.js +1 -0
- package/dist/src/compiled/_chunks/node/chunk-TREVQR3E-CLsTAn-O.js +1 -0
- package/dist/src/compiled/_chunks/node/dist-DYDVZ-FS.js +98 -0
- package/dist/src/compiled/_chunks/node/dist-iEFkK9qw.js +6 -0
- package/dist/src/compiled/_chunks/workflow/attribute-changes-DFx4eluc.js +6 -0
- package/dist/src/compiled/_chunks/workflow/{dist-D38gP7YF.js → dist-DjECvUyK.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{frames-QcJfYHmh.js → frames-D_Q-7A1N.js} +2 -2
- package/dist/src/compiled/_chunks/workflow/{helpers-6kObVbfS.js → helpers-Bw52uyzw.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{logger-NN5YHpYy.js → logger-DFNCa8Nl.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/resume-hook-BhA_nDEV.js +1 -0
- package/dist/src/compiled/_chunks/workflow/{run-DJevv8zz.js → run-BT6SQv5f.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{serialization-C5KgPESk.js → serialization-Cl0SYU0I.js} +3 -3
- package/dist/src/compiled/_chunks/workflow/sleep-DB4AH9-A.js +1 -0
- package/dist/src/compiled/_chunks/workflow/{wait-until-BMY_tOr-.js → wait-until-Dzhr6tzf.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{ws-transport-DSDcKH08.js → ws-transport-BpTMh40s.js} +1 -1
- package/dist/src/compiled/chat/index.d.ts +1 -725
- package/dist/src/compiled/chat/index.js +1 -1
- package/dist/src/compiler/artifacts.d.ts +1 -0
- package/dist/src/compiler/artifacts.js +1 -1
- package/dist/src/compiler/extension-compatibility.d.ts +23 -15
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/compiler/manifest.d.ts +14 -18
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/normalize-helpers.js +1 -1
- package/dist/src/compiler/normalize-sandbox.d.ts +2 -7
- 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.d.ts +2 -0
- package/dist/src/context/build-callback-context.js +1 -1
- package/dist/src/context/container.d.ts +1 -1
- package/dist/src/context/container.js +1 -1
- package/dist/src/context/key-names.d.ts +1 -0
- package/dist/src/context/key-names.js +1 -1
- package/dist/src/context/keys.d.ts +7 -2
- package/dist/src/context/keys.js +1 -1
- package/dist/src/context/providers/sandbox.js +1 -1
- package/dist/src/context/providers/session.d.ts +19 -2
- package/dist/src/context/session-context.d.ts +1 -1
- package/dist/src/discover/sandbox.js +1 -1
- package/dist/src/evals/cli/eval.js +1 -1
- package/dist/src/evals/context.d.ts +1 -0
- package/dist/src/evals/context.js +1 -1
- package/dist/src/evals/define-eval-config.d.ts +7 -7
- package/dist/src/evals/define-eval-config.js +1 -1
- package/dist/src/evals/define-eval.d.ts +5 -2
- package/dist/src/evals/index.d.ts +1 -1
- package/dist/src/evals/runner/execute-eval.d.ts +2 -0
- package/dist/src/evals/runner/execute-eval.js +1 -1
- package/dist/src/evals/runner/execute-task.d.ts +2 -0
- package/dist/src/evals/runner/execute-task.js +1 -1
- package/dist/src/evals/runner/run-evals.d.ts +2 -0
- package/dist/src/evals/runner/run-evals.js +1 -1
- package/dist/src/evals/target.js +1 -1
- package/dist/src/evals/types.d.ts +22 -6
- package/dist/src/eve-channel/create-request.d.ts +2 -1
- package/dist/src/eve-channel/delivery-policy-request.d.ts +4 -0
- package/dist/src/eve-channel/delivery-policy-request.js +1 -0
- package/dist/src/eve-channel/index.js +1 -1
- package/dist/src/eve-channel/request.d.ts +2 -1
- package/dist/src/eve-channel/request.js +1 -1
- package/dist/src/execution/coordination-dispatch-shared.d.ts +2 -1
- package/dist/src/execution/coordination-dispatch-shared.js +1 -1
- package/dist/src/execution/dynamic-workflow/tool.js +1 -1
- package/dist/src/execution/runtime-context.js +1 -1
- package/dist/src/execution/sandbox/active-handles.d.ts +7 -8
- package/dist/src/execution/sandbox/active-handles.js +1 -1
- package/dist/src/execution/sandbox/bash.js +1 -1
- package/dist/src/execution/sandbox/bindings/docker-cli.d.ts +1 -1
- package/dist/src/execution/sandbox/bindings/docker-cli.js +1 -1
- package/dist/src/execution/sandbox/bindings/docker-container.d.ts +2 -2
- package/dist/src/execution/sandbox/bindings/docker-container.js +1 -1
- package/dist/src/execution/sandbox/bindings/docker-network.d.ts +1 -1
- package/dist/src/execution/sandbox/bindings/docker-network.js +1 -1
- package/dist/src/execution/sandbox/bindings/docker-options.d.ts +4 -5
- package/dist/src/execution/sandbox/bindings/docker-options.js +1 -1
- package/dist/src/execution/sandbox/bindings/docker-session.d.ts +0 -1
- package/dist/src/execution/sandbox/bindings/docker-session.js +2 -2
- package/dist/src/execution/sandbox/bindings/docker.d.ts +16 -18
- package/dist/src/execution/sandbox/bindings/docker.js +1 -1
- package/dist/src/execution/sandbox/bindings/immutable-resources.d.ts +21 -0
- package/dist/src/execution/sandbox/bindings/immutable-resources.js +2 -0
- package/dist/src/execution/sandbox/bindings/just-bash-runtime.d.ts +9 -5
- package/dist/src/execution/sandbox/bindings/just-bash-runtime.js +1 -1
- package/dist/src/execution/sandbox/bindings/just-bash.d.ts +13 -26
- package/dist/src/execution/sandbox/bindings/just-bash.js +1 -1
- package/dist/src/execution/sandbox/bindings/{local-backend-utils.d.ts → local-provider-utils.d.ts} +7 -5
- package/dist/src/execution/sandbox/bindings/local-provider-utils.js +1 -0
- package/dist/src/execution/sandbox/bindings/local.d.ts +3 -3
- package/dist/src/execution/sandbox/bindings/local.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-create.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-lifecycle.d.ts +30 -8
- package/dist/src/execution/sandbox/bindings/microsandbox-lifecycle.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-metadata.d.ts +9 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-metadata.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-network.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-options.d.ts +10 -4
- package/dist/src/execution/sandbox/bindings/microsandbox-options.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-platform.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-runtime.d.ts +7 -5
- package/dist/src/execution/sandbox/bindings/microsandbox-runtime.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-templates.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox.d.ts +11 -21
- package/dist/src/execution/sandbox/bindings/microsandbox.js +1 -1
- package/dist/src/execution/sandbox/bindings/vercel-base-runtime.js +2 -2
- package/dist/src/execution/sandbox/bindings/vercel-credentials.js +1 -1
- package/dist/src/execution/sandbox/bindings/vercel-errors.js +1 -1
- package/dist/src/execution/sandbox/bindings/vercel-lifecycle.d.ts +2 -2
- package/dist/src/execution/sandbox/bindings/vercel-lifecycle.js +1 -1
- package/dist/src/execution/sandbox/bindings/vercel-lookup.js +1 -1
- package/dist/src/execution/sandbox/bindings/vercel-options.d.ts +1 -2
- package/dist/src/execution/sandbox/bindings/vercel-options.js +1 -1
- package/dist/src/execution/sandbox/bindings/vercel.d.ts +20 -12
- package/dist/src/execution/sandbox/bindings/vercel.js +2 -2
- package/dist/src/execution/sandbox/development-cleanup.js +1 -1
- package/dist/src/execution/sandbox/development-lazy-prewarm.d.ts +7 -0
- package/dist/src/execution/sandbox/development-lazy-prewarm.js +1 -0
- package/dist/src/execution/sandbox/development-run.d.ts +2 -3
- package/dist/src/execution/sandbox/dockerfile.d.ts +25 -0
- package/dist/src/execution/sandbox/dockerfile.js +1 -0
- package/dist/src/execution/sandbox/ensure.d.ts +0 -17
- package/dist/src/execution/sandbox/ensure.js +1 -1
- package/dist/src/execution/sandbox/logging-session.js +1 -1
- package/dist/src/execution/sandbox/prewarm.d.ts +23 -27
- package/dist/src/execution/sandbox/prewarm.js +1 -2
- package/dist/src/execution/sandbox/provider-files.d.ts +2 -0
- package/dist/src/execution/sandbox/provider-files.js +1 -0
- package/dist/src/execution/sandbox/provider-host-development.d.ts +2 -0
- package/dist/src/execution/sandbox/provider-host-development.js +1 -0
- package/dist/src/execution/sandbox/provider-host.d.ts +2 -0
- package/dist/src/execution/sandbox/provider-host.js +1 -0
- package/dist/src/execution/sandbox/provider-identity.d.ts +1 -0
- package/dist/src/execution/sandbox/provider-identity.js +1 -0
- package/dist/src/execution/sandbox/ripgrep-probe.d.ts +0 -7
- package/dist/src/execution/sandbox/ripgrep-probe.js +1 -1
- package/dist/src/execution/sandbox/session.d.ts +8 -8
- package/dist/src/execution/sandbox/session.js +1 -1
- package/dist/src/execution/session/handoff-steps.js +1 -1
- package/dist/src/execution/session/handoff.d.ts +1 -1
- package/dist/src/execution/session/handoff.js +1 -1
- package/dist/src/execution/session/input-queue.d.ts +2 -1
- package/dist/src/execution/session/input-queue.js +1 -1
- package/dist/src/execution/session/next-input.js +1 -1
- package/dist/src/execution/session/program.js +1 -1
- package/dist/src/execution/session/turn-step.js +1 -1
- package/dist/src/execution/session-inbox/protocol.js +1 -1
- package/dist/src/execution/tasks/parent/tool-execution.js +1 -1
- package/dist/src/execution/tools/agent-router-workflow.js +1 -1
- package/dist/src/execution/tools/sleep-workflow.js +1 -1
- package/dist/src/execution/tools/subagent/emit-event-step.js +1 -1
- package/dist/src/execution/tools/subagent/invoke-preparation.js +1 -1
- package/dist/src/execution/tools/subagent/start.d.ts +1 -0
- package/dist/src/framework/sources/modules/sandbox.d.ts +2 -1
- package/dist/src/framework/sources/modules/sandbox.js +1 -1
- package/dist/src/harness/approval-delivery-coordinator.js +1 -1
- package/dist/src/harness/hitl/approval-input-requests.d.ts +1 -1
- package/dist/src/harness/hitl/approval-input-requests.js +1 -1
- package/dist/src/harness/input-requests.d.ts +6 -0
- package/dist/src/harness/input-requests.js +1 -1
- package/dist/src/harness/messages.d.ts +2 -1
- package/dist/src/harness/messages.js +1 -1
- package/dist/src/harness/pending-input-batches.d.ts +1 -0
- package/dist/src/harness/pending-input-batches.js +1 -1
- package/dist/src/harness/tool-loop.js +2 -2
- package/dist/src/instrumentation/ai-sdk-warnings.d.ts +6 -0
- package/dist/src/instrumentation/ai-sdk-warnings.js +1 -0
- package/dist/src/instrumentation/runtime.d.ts +1 -0
- package/dist/src/instrumentation/runtime.js +1 -1
- package/dist/src/internal/application/compiled-artifacts.d.ts +2 -0
- package/dist/src/internal/application/compiled-artifacts.js +2 -2
- package/dist/src/internal/application/optional-package-install.d.ts +3 -0
- package/dist/src/internal/application/optional-package-install.js +2 -2
- package/dist/src/internal/application/output-publication-lock.d.ts +6 -0
- package/dist/src/internal/application/output-publication-lock.js +1 -1
- package/dist/src/internal/application/output-publication.js +1 -1
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/authored-module-loader.d.ts +1 -0
- package/dist/src/internal/authored-module-loader.js +1 -1
- package/dist/src/internal/authored-runtime-modules.d.ts +1 -0
- package/dist/src/internal/nitro/development-generation.js +1 -1
- package/dist/src/internal/nitro/host/artifacts-config.d.ts +6 -1
- package/dist/src/internal/nitro/host/artifacts-config.js +1 -1
- package/dist/src/internal/nitro/host/build-application.js +1 -1
- package/dist/src/internal/nitro/host/compiled-sandbox-provider-prune-plugin.d.ts +16 -0
- package/dist/src/internal/nitro/host/compiled-sandbox-provider-prune-plugin.js +5 -0
- package/dist/src/internal/nitro/host/configure-nitro-routes.js +2 -2
- package/dist/src/internal/nitro/host/create-application-nitro.d.ts +3 -3
- package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
- package/dist/src/internal/nitro/host/dev-authored-rebuild-coordinator.js +1 -1
- package/dist/src/internal/nitro/host/dev-host-fingerprint.js +1 -1
- package/dist/src/internal/nitro/host/development-runtime-prune-plugin.d.ts +9 -0
- package/dist/src/internal/nitro/host/development-runtime-prune-plugin.js +2 -0
- package/dist/src/internal/nitro/host/prepare-application-host.d.ts +1 -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 +2 -2
- package/dist/src/internal/nitro/host/types.d.ts +1 -1
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.js +1 -1
- package/dist/src/internal/nitro/routes/runtime-artifacts.d.ts +1 -0
- package/dist/src/internal/nitro/routes/runtime-artifacts.js +1 -1
- package/dist/src/internal/runtime-registry.d.ts +2 -2
- package/dist/src/internal/vercel/build-agent-workspace.d.ts +3 -1
- package/dist/src/internal/vercel/build-agent-workspace.js +1 -1
- package/dist/src/public/channels/chat-sdk/chatSdkChannel.d.ts +4 -5
- package/dist/src/public/channels/chat-sdk/chatSdkChannel.js +2 -2
- package/dist/src/public/channels/github/checkout.js +1 -1
- package/dist/src/public/channels/index.d.ts +1 -1
- package/dist/src/public/channels/slack/slackChannel.d.ts +3 -1
- package/dist/src/public/channels/slack/slackChannel.js +1 -1
- package/dist/src/public/definitions/channel.d.ts +1 -1
- package/dist/src/public/definitions/sandbox.d.ts +5 -43
- package/dist/src/public/definitions/sandbox.js +1 -1
- package/dist/src/public/local-dev.d.ts +4 -5
- package/dist/src/public/next/vercel-output-config.js +1 -1
- package/dist/src/public/sandbox/docker-sandbox.d.ts +16 -40
- package/dist/src/public/sandbox/docker.d.ts +2 -2
- package/dist/src/public/sandbox/docker.js +1 -1
- package/dist/src/public/sandbox/index.d.ts +4 -9
- package/dist/src/public/sandbox/index.js +1 -1
- package/dist/src/public/sandbox/just-bash-sandbox.d.ts +11 -6
- package/dist/src/public/sandbox/just-bash.d.ts +2 -2
- package/dist/src/public/sandbox/just-bash.js +1 -1
- package/dist/src/public/sandbox/microsandbox-sandbox.d.ts +11 -17
- package/dist/src/public/sandbox/microsandbox.d.ts +2 -2
- package/dist/src/public/sandbox/microsandbox.js +1 -1
- package/dist/src/public/sandbox/provider.d.ts +1 -0
- package/dist/src/public/sandbox/provider.js +1 -0
- package/dist/src/public/sandbox/vercel-sandbox.d.ts +10 -41
- package/dist/src/public/sandbox/vercel.d.ts +2 -2
- package/dist/src/public/sandbox/vercel.js +1 -1
- package/dist/src/runtime/cache-key.js +1 -1
- package/dist/src/runtime/compiled-artifacts-source.d.ts +6 -1
- package/dist/src/runtime/compiled-artifacts-source.js +1 -1
- package/dist/src/runtime/loaders/artifact-paths.d.ts +1 -0
- package/dist/src/runtime/loaders/artifact-paths.js +1 -1
- package/dist/src/runtime/loaders/bundled-artifacts.d.ts +3 -0
- package/dist/src/runtime/loaders/bundled-artifacts.js +1 -1
- package/dist/src/runtime/loaders/compile-metadata.js +1 -1
- package/dist/src/runtime/loaders/manifest.js +1 -1
- package/dist/src/runtime/loaders/module-map.js +1 -1
- package/dist/src/runtime/local-dev-capability.d.ts +14 -12
- package/dist/src/runtime/local-dev-capability.js +1 -1
- package/dist/src/runtime/resolve-agent-graph.js +1 -1
- package/dist/src/runtime/resolve-sandbox.d.ts +1 -10
- package/dist/src/runtime/resolve-sandbox.js +1 -1
- package/dist/src/runtime/sandbox/prepared-artifacts.d.ts +13 -0
- package/dist/src/runtime/sandbox/prepared-artifacts.js +1 -0
- package/dist/src/runtime/sandbox/registry.d.ts +2 -9
- package/dist/src/runtime/sandbox/registry.js +1 -1
- package/dist/src/runtime/sessions/runtime-session.js +1 -1
- package/dist/src/runtime/types.d.ts +13 -26
- package/dist/src/runtime/workspace/types.d.ts +1 -1
- package/dist/src/sandbox/providers/default.d.ts +27 -0
- package/dist/src/sandbox/providers/default.js +1 -0
- package/dist/src/sandbox/providers/docker.d.ts +11 -0
- package/dist/src/sandbox/providers/docker.js +1 -0
- package/dist/src/sandbox/providers/just-bash.d.ts +4 -0
- package/dist/src/sandbox/providers/just-bash.js +1 -0
- package/dist/src/sandbox/providers/microsandbox.d.ts +12 -0
- package/dist/src/sandbox/providers/microsandbox.js +1 -0
- package/dist/src/sandbox/providers/vercel.d.ts +12 -0
- package/dist/src/sandbox/providers/vercel.js +1 -0
- package/dist/src/sandbox/providers.d.ts +5 -0
- package/dist/src/sandbox/providers.js +1 -0
- package/dist/src/sandbox/state.d.ts +6 -25
- package/dist/src/self-modification/extension/subagents/agent/agent.d.ts +1 -1
- package/dist/src/self-modification/extension/subagents/agent/agent.js +1 -1
- package/dist/src/self-modification/extension/subagents/agent/sandbox.d.ts +2 -25
- package/dist/src/self-modification/extension/subagents/agent/sandbox.js +1 -1
- package/dist/src/self-modification/extension/subagents/agent/tools/publish.js +1 -1
- package/dist/src/self-modification/extension/subagents/agent/tools/registry_add.js +1 -1
- package/dist/src/self-modification/filesystem.d.ts +3 -1
- package/dist/src/self-modification/filesystem.js +1 -1
- package/dist/src/self-modification/git-workspace.d.ts +1 -1
- package/dist/src/self-modification/git.d.ts +1 -1
- package/dist/src/self-modification/sandbox.d.ts +14 -9
- package/dist/src/self-modification/sandbox.js +1 -1
- package/dist/src/setup/boxes/select-model.js +1 -1
- package/dist/src/setup/cli/select-state.d.ts +4 -2
- package/dist/src/setup/cli/select-state.js +1 -1
- package/dist/src/setup/flows/model-login.js +1 -1
- package/dist/src/{cli/commands/registry-pnpm-build-policy.d.ts → setup/primitives/pm/pnpm-build-policy.d.ts} +4 -0
- package/dist/src/setup/primitives/pm/pnpm-build-policy.js +8 -0
- package/dist/src/setup/primitives/pm/pnpm.js +3 -2
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/dist/src/shared/default-agent-model.d.ts +1 -1
- package/dist/src/shared/default-agent-model.js +1 -1
- package/dist/src/shared/sandbox-environment.d.ts +45 -0
- package/dist/src/shared/sandbox-environment.js +1 -0
- package/dist/src/shared/sandbox-network-policy.d.ts +8 -3
- package/dist/src/shared/sandbox-network-policy.js +1 -1
- package/dist/src/shared/sandbox-prepared-artifacts.d.ts +16 -0
- package/dist/src/shared/sandbox-prepared-artifacts.js +1 -0
- package/dist/src/shared/sandbox-provider.d.ts +112 -0
- package/dist/src/shared/sandbox-provider.js +1 -0
- package/dist/src/shared/sandbox-session.d.ts +18 -41
- package/dist/src/shared/sandbox-template-error.d.ts +9 -0
- package/dist/src/shared/sandbox-template-error.js +1 -0
- package/dist/src/subagents/tool.d.ts +1 -1
- package/dist/src/subagents/tool.js +1 -1
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/tasks/delivery-context.d.ts +6 -4
- package/dist/src/tasks/delivery-context.js +1 -1
- package/dist/src/tasks/delivery-policy.d.ts +2 -0
- package/dist/src/tasks/delivery-policy.js +1 -1
- package/dist/src/tools/framework/agent-contract.js +1 -1
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/README.md +40 -45
- package/docs/agent-config.md +2 -2
- package/docs/channels/eve.mdx +1 -1
- package/docs/channels/overview.mdx +48 -0
- package/docs/channels/slack.mdx +1 -1
- package/docs/concepts/execution-model-and-durability.mdx +1 -1
- package/docs/concepts/sessions-runs-and-streaming.md +3 -3
- package/docs/dynamic-configuration/meta.json +5 -0
- package/docs/evals/overview.mdx +43 -0
- package/docs/getting-started.mdx +1 -1
- package/docs/guides/client/overview.mdx +1 -1
- package/docs/guides/deployment/overview.md +1 -1
- package/docs/guides/deployment/self-hosting.md +5 -5
- package/docs/guides/deployment/vercel.mdx +10 -18
- package/docs/guides/dev-tui.md +1 -1
- package/docs/guides/hooks.md +4 -0
- package/docs/guides/instrumentation/instrumentation.mdx +1 -1
- package/docs/guides/instrumentation/migration.md +1 -6
- package/docs/guides/instrumentation/otel.mdx +15 -47
- package/docs/memory/meta.json +1 -1
- package/docs/memory/overview.mdx +4 -0
- package/docs/meta.json +13 -16
- package/docs/patterns/meta.json +2 -2
- package/docs/protocols/acp.md +1 -1
- package/docs/protocols/ucp.mdx +1 -1
- package/docs/reference/cli.md +10 -9
- package/docs/reference/meta.json +4 -1
- package/docs/reference/typescript-api.md +2 -25
- package/docs/sandbox/default.mdx +17 -0
- package/docs/sandbox/docker.mdx +29 -0
- package/docs/sandbox/index.mdx +218 -0
- package/docs/sandbox/just-bash.mdx +24 -0
- package/docs/sandbox/meta.json +5 -0
- package/docs/sandbox/microsandbox.mdx +31 -0
- package/docs/sandbox/vercel.mdx +106 -0
- package/docs/schedules.mdx +35 -1
- package/docs/subagents/index.mdx +31 -13
- package/docs/subagents/meta.json +1 -1
- package/docs/tools/overview.mdx +14 -6
- package/docs/tutorial/run-analysis.mdx +6 -5
- package/package.json +20 -11
- package/dist/src/cli/commands/registry-pnpm-build-policy.js +0 -6
- package/dist/src/compiled/_chunks/node/chunk-5OX2R7AJ-CxVV-owP.js +0 -1
- package/dist/src/compiled/_chunks/node/chunk-AYN7QRWH-B__hKQV7.js +0 -1
- package/dist/src/compiled/_chunks/node/chunk-QZV7YRVM-Dzw4WEBv.js +0 -1
- package/dist/src/compiled/_chunks/node/dist-CweJdVFE.js +0 -6
- package/dist/src/compiled/_chunks/node/dist-Da54NuK8.js +0 -96
- package/dist/src/compiled/_chunks/workflow/attribute-changes-A6HfMNG3.js +0 -6
- package/dist/src/compiled/_chunks/workflow/resume-hook-CAqlhwic.js +0 -1
- package/dist/src/compiled/_chunks/workflow/sleep-CbUwdv6O.js +0 -1
- package/dist/src/compiled/chat/_mdast.d.ts +0 -24
- package/dist/src/compiled/chat/_workflow-serde.d.ts +0 -3
- package/dist/src/compiled/chat/jsx-runtime-_JEEAotp.d.ts +0 -907
- package/dist/src/execution/sandbox/bindings/local-backend-utils.js +0 -1
- package/dist/src/execution/sandbox/development-prewarm.d.ts +0 -15
- package/dist/src/execution/sandbox/development-prewarm.js +0 -1
- package/dist/src/execution/sandbox/lazy-backend.d.ts +0 -15
- package/dist/src/execution/sandbox/lazy-backend.js +0 -1
- package/dist/src/execution/sandbox/template-prewarm-lock.d.ts +0 -8
- package/dist/src/execution/sandbox/template-prewarm-lock.js +0 -1
- package/dist/src/internal/authored-definition/sandbox.d.ts +0 -17
- package/dist/src/internal/authored-definition/sandbox.js +0 -1
- package/dist/src/internal/nitro/host/compiled-sandbox-backend-prune-plugin.d.ts +0 -16
- package/dist/src/internal/nitro/host/compiled-sandbox-backend-prune-plugin.js +0 -2
- package/dist/src/public/definitions/sandbox-backend.d.ts +0 -17
- package/dist/src/public/definitions/sandbox-backend.js +0 -1
- package/dist/src/public/sandbox/backends/default.d.ts +0 -1
- package/dist/src/public/sandbox/backends/default.js +0 -1
- package/dist/src/public/sandbox/backends/docker.d.ts +0 -1
- package/dist/src/public/sandbox/backends/docker.js +0 -1
- package/dist/src/public/sandbox/backends/just-bash.d.ts +0 -1
- package/dist/src/public/sandbox/backends/just-bash.js +0 -1
- package/dist/src/public/sandbox/backends/microsandbox.d.ts +0 -1
- package/dist/src/public/sandbox/backends/microsandbox.js +0 -1
- package/dist/src/public/sandbox/backends/vercel.d.ts +0 -1
- package/dist/src/public/sandbox/backends/vercel.js +0 -1
- package/dist/src/runtime/sandbox/keys.d.ts +0 -42
- package/dist/src/runtime/sandbox/keys.js +0 -1
- package/dist/src/runtime/sandbox/template-plan.d.ts +0 -24
- package/dist/src/runtime/sandbox/template-plan.js +0 -1
- package/dist/src/sandbox/backends/default.d.ts +0 -42
- package/dist/src/sandbox/backends/default.js +0 -1
- package/dist/src/sandbox/backends/docker.d.ts +0 -14
- package/dist/src/sandbox/backends/docker.js +0 -1
- package/dist/src/sandbox/backends/just-bash.d.ts +0 -17
- package/dist/src/sandbox/backends/just-bash.js +0 -1
- package/dist/src/sandbox/backends/microsandbox.d.ts +0 -17
- package/dist/src/sandbox/backends/microsandbox.js +0 -1
- package/dist/src/sandbox/backends/vercel.d.ts +0 -30
- package/dist/src/sandbox/backends/vercel.js +0 -1
- package/dist/src/shared/sandbox-backend.d.ts +0 -176
- package/dist/src/shared/sandbox-backend.js +0 -1
- package/dist/src/shared/sandbox-definition.d.ts +0 -112
- package/dist/src/shared/sandbox-definition.js +0 -1
- package/docs/sandbox.mdx +0 -342
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{DockerSandbox}from"#sandbox/providers/docker.js";export{DockerSandbox};
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export { defineSandbox, type SandboxAncestorReference, type SandboxBootstrapContext, type SandboxBootstrapUseFn, type SandboxCommandResult, type SandboxDefinition, type SandboxParentDefinition, type SandboxParentDefinitionContext, type SandboxParentValue, type SandboxProcess, type SandboxReadBinaryFileOptions, type SandboxReadFileOptions, type SandboxReadTextFileOptions, type SandboxRevalidationKeyFn, type SandboxRunOptions, type SandboxSession, type RuntimeSandboxSession, type SandboxSpawnOptions, type SandboxSessionContext, type SandboxSessionUseFn, type SandboxWriteBinaryFileOptions, type SandboxWriteFileOptions, type SandboxWriteTextFileOptions, } from "#public/definitions/sandbox.js";
|
|
6
|
-
export type { SandboxBackend, SandboxBackendCreateInput, SandboxBackendHandle, SandboxBackendPrewarmInput, SandboxBackendRuntimeContext, SandboxBackendSessionState, SandboxDeleteOptions, SandboxSeedFile, } from "#public/definitions/sandbox-backend.js";
|
|
7
|
-
export type { SandboxNetworkPolicy } from "#shared/sandbox-network-policy.js";
|
|
8
|
-
export { SandboxTemplateNotProvisionedError } from "#public/definitions/sandbox-backend.js";
|
|
9
|
-
export { defaultSandbox as defaultBackend, type DefaultSandboxOptions as DefaultBackendOptions, } from "#public/sandbox/backends/default.js";
|
|
1
|
+
export { defineParentSandbox, defineSandbox, type SandboxOpenArguments, type SandboxEnvironment, type SandboxSelector, type SandboxSelectorContext, type SandboxCommandResult, type FixedNetworkSandboxSession, type MutableNetworkSandboxSession, type SandboxProcess, type SandboxReadBinaryFileOptions, type SandboxReadFileOptions, type SandboxReadTextFileOptions, type SandboxRunOptions, type SandboxSession, type RuntimeSandboxSession, type RuntimeSandboxSessionFor, type SandboxSpawnOptions, type SandboxWriteBinaryFileOptions, type SandboxWriteFileOptions, type SandboxWriteTextFileOptions, } from "#public/definitions/sandbox.js";
|
|
2
|
+
export { DefaultSandbox } from "#sandbox/providers/default.js";
|
|
3
|
+
export type { DefaultSandboxEnvironmentOptions } from "#sandbox/providers/default.js";
|
|
4
|
+
export type { SandboxNetworkOptions, SandboxNetworkPolicy, } from "#shared/sandbox-network-policy.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{defineParentSandbox,defineSandbox}from"#public/definitions/sandbox.js";import{DefaultSandbox}from"#sandbox/providers/default.js";export{DefaultSandbox,defineParentSandbox,defineSandbox};
|
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
import type { CustomCommand, IFileSystem } from "just-bash";
|
|
2
|
+
import type { SandboxSession } from "#shared/sandbox-session.js";
|
|
2
3
|
/**
|
|
3
4
|
* Context passed to a custom just-bash filesystem factory for each live handle.
|
|
4
5
|
*/
|
|
5
6
|
export interface JustBashFilesystemContext {
|
|
6
|
-
/**
|
|
7
|
-
|
|
7
|
+
/** Resolves an application-relative path without exposing project layout. */
|
|
8
|
+
resolveProjectPath(path: string): string;
|
|
9
|
+
/** Stable provider-private storage directory for this sandbox. */
|
|
10
|
+
readonly storagePath: string;
|
|
8
11
|
/** eve's durable, session-owned filesystem, including `/workspace`. */
|
|
9
12
|
readonly defaultFilesystem: IFileSystem;
|
|
10
13
|
/** The just-bash engine resolved by eve after its optional installation check. */
|
|
11
14
|
readonly justBash: typeof import("just-bash");
|
|
12
15
|
}
|
|
13
16
|
/**
|
|
14
|
-
* Options accepted by
|
|
17
|
+
* Options accepted by just-bash environment constructors.
|
|
15
18
|
*
|
|
16
|
-
* The just-bash
|
|
19
|
+
* The just-bash provider runs the workspace under the pure-JS `just-bash`
|
|
17
20
|
* interpreter with a virtual filesystem — no daemon or VM required, but
|
|
18
21
|
* no real binaries either. The `just-bash` package is not bundled with
|
|
19
22
|
* eve; it is loaded lazily from the application install.
|
|
@@ -31,7 +34,7 @@ export interface JustBashSandboxCreateOptions {
|
|
|
31
34
|
* just-bash interpreter. Custom commands can participate in normal shell
|
|
32
35
|
* composition, including pipelines and redirections.
|
|
33
36
|
*
|
|
34
|
-
* Custom commands are not available during
|
|
37
|
+
* Custom commands are not available during environment preparation. They run in
|
|
35
38
|
* eve's host process, outside the virtual filesystem security boundary, and
|
|
36
39
|
* are responsible for validating their own inputs and cleaning up host
|
|
37
40
|
* resources.
|
|
@@ -45,7 +48,9 @@ export interface JustBashSandboxCreateOptions {
|
|
|
45
48
|
*
|
|
46
49
|
* This just-bash-specific escape hatch requires the application to install
|
|
47
50
|
* a compatible `just-bash` version. It is not invoked during template
|
|
48
|
-
*
|
|
51
|
+
* preparation.
|
|
49
52
|
*/
|
|
50
53
|
readonly filesystem?: (context: JustBashFilesystemContext) => IFileSystem | Promise<IFileSystem>;
|
|
54
|
+
/** Idempotent setup captured in the prepared virtual filesystem. */
|
|
55
|
+
readonly prepare?: (sandbox: SandboxSession) => Promise<void> | void;
|
|
51
56
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export type { JustBashFilesystemContext
|
|
1
|
+
export { JustBashSandbox, type JustBashEnvironmentOptions } from "#sandbox/providers/just-bash.js";
|
|
2
|
+
export type { JustBashFilesystemContext } from "#public/sandbox/just-bash-sandbox.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{JustBashSandbox}from"#sandbox/providers/just-bash.js";export{JustBashSandbox};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SandboxSession } from "#shared/sandbox-session.js";
|
|
2
|
+
import type { SandboxNetworkOptions, SandboxNetworkPolicy } from "#shared/sandbox-network-policy.js";
|
|
2
3
|
/**
|
|
3
|
-
* Options accepted by
|
|
4
|
+
* Options accepted by microsandbox environment constructors.
|
|
4
5
|
*
|
|
5
|
-
* The microsandbox
|
|
6
|
+
* The microsandbox provider runs sandboxes in lightweight local VMs via
|
|
6
7
|
* [microsandbox](https://www.npmjs.com/package/microsandbox). Options
|
|
7
8
|
* are eve-owned rather than a raw passthrough so the public surface can
|
|
8
9
|
* stay stable while the underlying runtime evolves. Supported hosts:
|
|
@@ -12,8 +13,8 @@ export interface MicrosandboxSandboxCreateOptions {
|
|
|
12
13
|
/**
|
|
13
14
|
* OCI image used as the base runtime. eve prepares this image with
|
|
14
15
|
* Bash, the framework workspace, and the sandbox user before authored
|
|
15
|
-
*
|
|
16
|
-
* Python, or ripgrep
|
|
16
|
+
* environment preparation runs. Install authored runtime tools such as Node,
|
|
17
|
+
* Python, or ripgrep during preparation or provide them through a
|
|
17
18
|
* custom image.
|
|
18
19
|
*
|
|
19
20
|
* @default The `ghcr.io/vercel/eve` tag matching the installed eve version without build metadata, or `EVE_SANDBOX_IMAGE_TAG` when set.
|
|
@@ -27,6 +28,8 @@ export interface MicrosandboxSandboxCreateOptions {
|
|
|
27
28
|
readonly env?: Readonly<Record<string, string>>;
|
|
28
29
|
/** OCI image pull policy. @default "if-missing" */
|
|
29
30
|
readonly pullPolicy?: "always" | "if-missing" | "never";
|
|
31
|
+
/** Idempotent setup captured in the prepared VM snapshot. */
|
|
32
|
+
readonly prepare?: (sandbox: SandboxSession) => Promise<void> | void;
|
|
30
33
|
/**
|
|
31
34
|
* Installation behavior for the microsandbox npm package and its VM
|
|
32
35
|
* runtime. By default eve installs both automatically when missing —
|
|
@@ -37,18 +40,9 @@ export interface MicrosandboxSandboxCreateOptions {
|
|
|
37
40
|
readonly autoInstall?: boolean;
|
|
38
41
|
readonly skipVerify?: boolean;
|
|
39
42
|
};
|
|
40
|
-
/** Initial network policy applied to sandboxes after framework setup. */
|
|
41
|
-
readonly networkPolicy?: SandboxNetworkPolicy;
|
|
42
43
|
}
|
|
43
|
-
/**
|
|
44
|
-
|
|
45
|
-
*/
|
|
46
|
-
export interface MicrosandboxBootstrapUseOptions {
|
|
47
|
-
readonly networkPolicy?: SandboxNetworkPolicy;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Options accepted by the microsandbox backend's `onSession({ use })` hook.
|
|
51
|
-
*/
|
|
52
|
-
export interface MicrosandboxSessionUseOptions {
|
|
44
|
+
/** Options applied when eve creates one live microsandbox VM. */
|
|
45
|
+
export interface MicrosandboxSandboxRuntimeOptions extends SandboxNetworkOptions {
|
|
46
|
+
/** Initial network policy for this VM. @default "allow-all" */
|
|
53
47
|
readonly networkPolicy?: SandboxNetworkPolicy;
|
|
54
48
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export type {
|
|
1
|
+
export { MicrosandboxSandbox, type MicrosandboxEnvironmentOptions, } from "#sandbox/providers/microsandbox.js";
|
|
2
|
+
export type { MicrosandboxSandboxRuntimeOptions } from "#public/sandbox/microsandbox-sandbox.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{MicrosandboxSandbox}from"#sandbox/providers/microsandbox.js";export{MicrosandboxSandbox};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { defineSandboxProvider, type SandboxDeleteOptions, type SandboxPreparedArtifact, type SandboxProvider, type SandboxProviderDefinition, type SandboxProviderFiles, type SandboxProviderHandle, type SandboxProviderImplementation, type SandboxProviderPrepareContext, type SandboxProviderResourceFile, type SandboxProviderResources, type SandboxProviderResourceSource, type SandboxProviderResourceTree, type SandboxProviderSessionContext, type SandboxProviderTargetFile, } from "#shared/sandbox-provider.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineSandboxProvider}from"#shared/sandbox-provider.js";export{defineSandboxProvider};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import type * as Vercel from "#compiled/@vercel/sandbox/index.js";
|
|
2
|
+
import type { SandboxNetworkOptions } from "#shared/sandbox-network-policy.js";
|
|
2
3
|
type VercelCreateOptions = NonNullable<Parameters<typeof Vercel.Sandbox.create>[0]>;
|
|
3
|
-
type VercelUpdateOptions = Parameters<Vercel.Sandbox["update"]>[0];
|
|
4
4
|
type VercelSandboxInternalCreateOptions = {
|
|
5
5
|
readonly [key: `__${string}`]: unknown;
|
|
6
6
|
};
|
|
7
7
|
type VercelSandboxAuthorCreateOptions<T> = T extends unknown ? Omit<T, "mounts" | "name" | "onResume" | "persistent" | "runtime" | "signal"> & VercelSandboxInternalCreateOptions : never;
|
|
8
8
|
/**
|
|
9
|
-
* Options accepted by
|
|
9
|
+
* Options accepted by Vercel sandbox environment constructors. Forwarded to Vercel
|
|
10
10
|
* Sandbox creation for every fresh sandbox the framework creates
|
|
11
|
-
* (template
|
|
11
|
+
* (template during preparation, session at first creation).
|
|
12
12
|
* Skipped on resume (`Sandbox.get`) since no create happens there.
|
|
13
13
|
*
|
|
14
14
|
* `networkPolicy` is deferred until after framework-owned base setup
|
|
15
15
|
* for fresh templates and template-less sessions, so eve can install
|
|
16
|
-
* required packages before authored
|
|
16
|
+
* required packages before authored environment preparation runs. Template-backed
|
|
17
17
|
* session creates receive it at creation time because the template
|
|
18
18
|
* already contains the prepared base runtime.
|
|
19
19
|
*
|
|
@@ -22,7 +22,7 @@ type VercelSandboxAuthorCreateOptions<T> = T extends unknown ? Omit<T, "mounts"
|
|
|
22
22
|
* author-supplied values.
|
|
23
23
|
*
|
|
24
24
|
* `runtime` is excluded: eve defaults to its published
|
|
25
|
-
* `vcr.vercel.com/vercel/eve/base` image tagged with the installed eve version
|
|
25
|
+
* `vcr.vercel.com/vercel/eve/base` image tagged with the installed eve version
|
|
26
26
|
* or `EVE_SANDBOX_IMAGE_TAG` when `image` is not supplied. Both are mutually
|
|
27
27
|
* exclusive with a stock runtime.
|
|
28
28
|
*
|
|
@@ -30,9 +30,9 @@ type VercelSandboxAuthorCreateOptions<T> = T extends unknown ? Omit<T, "mounts"
|
|
|
30
30
|
* snapshot `source` takes precedence because the Vercel SDK makes it mutually
|
|
31
31
|
* exclusive with `image`.
|
|
32
32
|
*
|
|
33
|
-
* `source` is honored only on the template
|
|
33
|
+
* `source` is honored only on the template creation during preparation, so
|
|
34
34
|
* an author-supplied snapshot, git revision, or tarball becomes the
|
|
35
|
-
* base layer for the template. Framework setup,
|
|
35
|
+
* base layer for the template. Framework setup, preparation, and seed
|
|
36
36
|
* files all run on top, and the resulting
|
|
37
37
|
* framework-owned snapshot is what every later session derives from,
|
|
38
38
|
* so `source` is stripped from the session-create path. eve does not
|
|
@@ -48,40 +48,9 @@ export type VercelSandboxMount = Vercel.SandboxMounts[string];
|
|
|
48
48
|
/** Drive mounts keyed by absolute sandbox path. */
|
|
49
49
|
export type VercelSandboxMounts = Vercel.SandboxMounts;
|
|
50
50
|
/** Options resolved when eve creates a fresh live session sandbox. */
|
|
51
|
-
export interface
|
|
51
|
+
export interface VercelSandboxMountOptions {
|
|
52
52
|
readonly mounts?: VercelSandboxMounts;
|
|
53
53
|
}
|
|
54
|
-
/**
|
|
55
|
-
export
|
|
56
|
-
readonly session: {
|
|
57
|
-
readonly id: string;
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
/** Options accepted by `vercel(opts)`. */
|
|
61
|
-
export type VercelSandboxOptions = VercelSandboxCreateOptions & {
|
|
62
|
-
/**
|
|
63
|
-
* Resolves options that apply only to fresh live sessions. It is not called
|
|
64
|
-
* while prewarming templates or resuming an existing sandbox.
|
|
65
|
-
*/
|
|
66
|
-
readonly sessionCreateOptions?: (context: VercelSandboxSessionCreateContext) => Promise<VercelSandboxSessionCreateOptions> | VercelSandboxSessionCreateOptions;
|
|
67
|
-
};
|
|
68
|
-
/**
|
|
69
|
-
* Options accepted by the Vercel backend's `bootstrap({ use })` hook.
|
|
70
|
-
* Tracks the Vercel SDK's `Sandbox.update(...)` parameter because bootstrap
|
|
71
|
-
* applies its options to the template via `sandbox.update(...)` after
|
|
72
|
-
* `Sandbox.create()` and before the snapshot is captured. The Vercel
|
|
73
|
-
* SDK persists `update`-d settings on the sandbox so they survive into
|
|
74
|
-
* the snapshot, which becomes the seed for every later session.
|
|
75
|
-
*
|
|
76
|
-
* Today this is the same shape as
|
|
77
|
-
* {@link VercelSandboxSessionUseOptions}; both are exposed as separate
|
|
78
|
-
* named aliases so future divergence is non-breaking.
|
|
79
|
-
*/
|
|
80
|
-
export type VercelSandboxBootstrapUseOptions = VercelUpdateOptions;
|
|
81
|
-
/**
|
|
82
|
-
* Options accepted by the Vercel backend's `onSession({ use })` hook.
|
|
83
|
-
* Tracks the Vercel SDK's `Sandbox.update(...)` parameter; passed values are
|
|
84
|
-
* applied to the live session via the SDK's `update`.
|
|
85
|
-
*/
|
|
86
|
-
export type VercelSandboxSessionUseOptions = VercelUpdateOptions;
|
|
54
|
+
/** Options accepted when creating one live Vercel sandbox from an environment. */
|
|
55
|
+
export type VercelSandboxRuntimeOptions = Omit<VercelSandboxCreateOptions, "fetch" | "image" | "projectId" | "source" | "tags" | "teamId" | "token"> & SandboxNetworkOptions & VercelSandboxMountOptions;
|
|
87
56
|
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { VercelSandbox, type VercelSandboxEnvironmentOptions, type VercelSandboxRuntimeOptions, } from "#sandbox/providers/vercel.js";
|
|
2
2
|
export { Drive } from "#compiled/@vercel/sandbox/index.js";
|
|
3
|
-
export type {
|
|
3
|
+
export type { VercelSandboxMount, VercelSandboxMountMode, VercelSandboxMounts, } from "#public/sandbox/vercel-sandbox.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{VercelSandbox}from"#sandbox/providers/vercel.js";import{Drive}from"#compiled/@vercel/sandbox/index.js";export{Drive,VercelSandbox};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{resolveRuntimeCompilerArtifactPaths}from"#runtime/loaders/artifact-paths.js";import{getRuntimeCompiledArtifactsCacheKey}from"#runtime/compiled-artifacts-source.js";import{loadCompileMetadata}from"#runtime/loaders/compile-metadata.js";async function resolveRuntimeCompiledArtifactsVersionedCacheKey(e){let t=getRuntimeCompiledArtifactsCacheKey(e),n=await resolveCompileMetadataMtimeMs(e);try{let r=(await loadCompileMetadata({compiledArtifactsSource:e}))?.discovery.sourceGraphHash;return r===void 0||r.length===0?n===void 0?t:`${t}:mtime-${formatMtimeMsForCacheKey(n)}`:n===void 0?`${t}:${r}`:`${t}:${r}:mtime-${formatMtimeMsForCacheKey(n)}`}catch{return n===void 0?t:`${t}:mtime-${formatMtimeMsForCacheKey(n)}`}}async function resolveCompileMetadataMtimeMs(e){if(e.kind!==`disk`)return;let{stat:t}=await import(`node:fs/promises`),{compileMetadataPath:n}=resolveRuntimeCompilerArtifactPaths(e.appRoot);try{return(await t(n)).mtimeMs}catch{return}}function formatMtimeMsForCacheKey(e){return Math.floor(e).toString(36)}export{resolveRuntimeCompiledArtifactsVersionedCacheKey};
|
|
@@ -8,6 +8,8 @@ export type RuntimeCompiledArtifactsSource = RuntimeBundledCompiledArtifactsSour
|
|
|
8
8
|
*/
|
|
9
9
|
export interface RuntimeBundledCompiledArtifactsSource {
|
|
10
10
|
readonly kind: "bundled";
|
|
11
|
+
/** Stable app partition embedded by a production build for local providers. */
|
|
12
|
+
readonly sandboxScope?: string;
|
|
11
13
|
}
|
|
12
14
|
/**
|
|
13
15
|
* Disk-backed compiled artifacts rooted at one authored application.
|
|
@@ -23,6 +25,8 @@ export interface RuntimeDiskCompiledArtifactsSource {
|
|
|
23
25
|
* emitted by the build.
|
|
24
26
|
*/
|
|
25
27
|
readonly moduleMapLoaderPath?: string;
|
|
28
|
+
/** Stable app partition shared by production build preparation and runtime. */
|
|
29
|
+
readonly sandboxScope?: string;
|
|
26
30
|
/**
|
|
27
31
|
* Stable application root used for local sandbox template/session caches.
|
|
28
32
|
* In development, `appRoot` can point at an immutable runtime snapshot
|
|
@@ -41,7 +45,7 @@ export interface RuntimeDiskCompiledArtifactsSource {
|
|
|
41
45
|
/**
|
|
42
46
|
* Creates the bundled compiled-artifact source.
|
|
43
47
|
*/
|
|
44
|
-
export declare function createBundledRuntimeCompiledArtifactsSource(): RuntimeBundledCompiledArtifactsSource;
|
|
48
|
+
export declare function createBundledRuntimeCompiledArtifactsSource(sandboxScope?: string): RuntimeBundledCompiledArtifactsSource;
|
|
45
49
|
/**
|
|
46
50
|
* Creates the disk-backed compiled-artifact source for one authored app root.
|
|
47
51
|
*/
|
|
@@ -49,6 +53,7 @@ export declare function createDiskRuntimeCompiledArtifactsSource(appRoot: string
|
|
|
49
53
|
readonly durableReference?: "development-generation";
|
|
50
54
|
readonly moduleMapLoaderPath?: string;
|
|
51
55
|
readonly sandboxAppRoot?: string;
|
|
56
|
+
readonly sandboxScope?: string;
|
|
52
57
|
}): RuntimeDiskCompiledArtifactsSource;
|
|
53
58
|
/**
|
|
54
59
|
* Returns the disk-backed app root when one exists for the artifact source.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function createBundledRuntimeCompiledArtifactsSource(){return{kind:`bundled`}}function createDiskRuntimeCompiledArtifactsSource(e,t={}){return t.moduleMapLoaderPath!==void 0||t.sandboxAppRoot!==void 0||t.durableReference!==void 0?{appRoot:e,durableReference:t.durableReference,kind:`disk`,moduleMapLoaderPath:t.moduleMapLoaderPath,sandboxAppRoot:t.sandboxAppRoot}:{appRoot:e,kind:`disk`}}function getRuntimeCompiledArtifactsAppRoot(e){return e.kind===`disk`?e.appRoot:void 0}function getRuntimeCompiledArtifactsSandboxAppRoot(e){return e.kind===`disk`?e.sandboxAppRoot??e.appRoot:void 0}function getRuntimeCompiledArtifactsCacheKey(e){return e.kind===`disk`?e.moduleMapLoaderPath===void 0?`disk:${e.appRoot}`:`disk:${e.appRoot}:authored-source:${e.moduleMapLoaderPath}`:`bundled`}export{createBundledRuntimeCompiledArtifactsSource,createDiskRuntimeCompiledArtifactsSource,getRuntimeCompiledArtifactsAppRoot,getRuntimeCompiledArtifactsCacheKey,getRuntimeCompiledArtifactsSandboxAppRoot};
|
|
1
|
+
function createBundledRuntimeCompiledArtifactsSource(e){return e===void 0?{kind:`bundled`}:{kind:`bundled`,sandboxScope:e}}function createDiskRuntimeCompiledArtifactsSource(e,t={}){return t.moduleMapLoaderPath!==void 0||t.sandboxAppRoot!==void 0||t.sandboxScope!==void 0||t.durableReference!==void 0?{appRoot:e,durableReference:t.durableReference,kind:`disk`,moduleMapLoaderPath:t.moduleMapLoaderPath,sandboxAppRoot:t.sandboxAppRoot,sandboxScope:t.sandboxScope}:{appRoot:e,kind:`disk`}}function getRuntimeCompiledArtifactsAppRoot(e){return e.kind===`disk`?e.appRoot:void 0}function getRuntimeCompiledArtifactsSandboxAppRoot(e){return e.kind===`disk`?e.sandboxAppRoot??e.appRoot:void 0}function getRuntimeCompiledArtifactsCacheKey(e){return e.kind===`disk`?e.moduleMapLoaderPath===void 0?`disk:${e.appRoot}`:`disk:${e.appRoot}:authored-source:${e.moduleMapLoaderPath}`:`bundled`}export{createBundledRuntimeCompiledArtifactsSource,createDiskRuntimeCompiledArtifactsSource,getRuntimeCompiledArtifactsAppRoot,getRuntimeCompiledArtifactsCacheKey,getRuntimeCompiledArtifactsSandboxAppRoot};
|
|
@@ -10,6 +10,7 @@ export interface RuntimeCompilerArtifactPaths {
|
|
|
10
10
|
readonly discoveryManifestPath: string;
|
|
11
11
|
readonly discoveryDirectoryPath: string;
|
|
12
12
|
readonly moduleMapPath: string;
|
|
13
|
+
readonly sandboxPreparedArtifactsPath: string;
|
|
13
14
|
}
|
|
14
15
|
/**
|
|
15
16
|
* Resolves the stable eve artifact paths for one application root without
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function resolveRuntimeCompilerArtifactPaths(e){let t=normalizeFilesystemPath(e),n=`${t}/.eve/discovery`,r=`${t}/.eve/compile`;return{appRoot:t,compiledManifestPath:`${r}/compiled-agent-manifest.json`,compileDirectoryPath:r,compileMetadataPath:`${r}/compile-metadata.json`,diagnosticsPath:`${n}/diagnostics.json`,discoveryDirectoryPath:n,discoveryManifestPath:`${n}/agent-discovery-manifest.json`,moduleMapPath:`${r}/module-map.mjs`}}function normalizeFilesystemPath(e){let t=e.replaceAll(`\\`,`/`);return t===`/`?t:t.replace(/\/+$/,``)}export{resolveRuntimeCompilerArtifactPaths};
|
|
1
|
+
function resolveRuntimeCompilerArtifactPaths(e){let t=normalizeFilesystemPath(e),n=`${t}/.eve/discovery`,r=`${t}/.eve/compile`;return{appRoot:t,compiledManifestPath:`${r}/compiled-agent-manifest.json`,compileDirectoryPath:r,compileMetadataPath:`${r}/compile-metadata.json`,diagnosticsPath:`${n}/diagnostics.json`,discoveryDirectoryPath:n,discoveryManifestPath:`${n}/agent-discovery-manifest.json`,moduleMapPath:`${r}/module-map.mjs`,sandboxPreparedArtifactsPath:`${r}/sandbox-prepared-artifacts.json`}}function normalizeFilesystemPath(e){let t=e.replaceAll(`\\`,`/`);return t===`/`?t:t.replace(/\/+$/,``)}export{resolveRuntimeCompilerArtifactPaths};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { CompileMetadata } from "#compiler/artifacts.js";
|
|
2
2
|
import type { CompiledAgentManifest } from "#compiler/manifest.js";
|
|
3
3
|
import type { CompiledModuleMap } from "#compiler/module-map.js";
|
|
4
|
+
import type { SandboxPreparedArtifactsManifest } from "#shared/sandbox-prepared-artifacts.js";
|
|
4
5
|
/**
|
|
5
6
|
* Bundled compiled artifacts installed by Nitro when authored runtime state is
|
|
6
7
|
* embedded directly into the server bundle.
|
|
@@ -9,6 +10,7 @@ export interface BundledCompiledArtifacts {
|
|
|
9
10
|
manifest: CompiledAgentManifest;
|
|
10
11
|
metadata?: CompileMetadata;
|
|
11
12
|
moduleMap: CompiledModuleMap;
|
|
13
|
+
sandboxPreparedArtifacts?: SandboxPreparedArtifactsManifest;
|
|
12
14
|
}
|
|
13
15
|
/**
|
|
14
16
|
* Input for running code against one isolated bundled compiled-artifact
|
|
@@ -33,4 +35,5 @@ export declare function withBundledCompiledArtifacts<T>(input: WithBundledCompil
|
|
|
33
35
|
* Reads the bundled compiled-artifact snapshot for the active runtime
|
|
34
36
|
* session, or `null` if none has been installed.
|
|
35
37
|
*/
|
|
38
|
+
export declare function updateBundledSandboxPreparedArtifacts(sandboxPreparedArtifacts: SandboxPreparedArtifactsManifest): boolean;
|
|
36
39
|
export declare function readBundledCompiledArtifacts(): BundledCompiledArtifacts | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRuntimeSession,getActiveRuntimeSession,setRuntimeSessionCompiledArtifacts,withRuntimeSession}from"#runtime/sessions/runtime-session.js";function installBundledCompiledArtifacts(e){setRuntimeSessionCompiledArtifacts(getActiveRuntimeSession(),{manifest:e.manifest,metadata:e.metadata,moduleMap:e.moduleMap})}async function withBundledCompiledArtifacts(e,t){let n=createRuntimeSession(e.sessionId??`bundled-compiled-artifacts`);return await withRuntimeSession(n,async()=>(installBundledCompiledArtifacts(e),await t()))}function readBundledCompiledArtifacts(){return getActiveRuntimeSession().compiledArtifacts}export{installBundledCompiledArtifacts,readBundledCompiledArtifacts,withBundledCompiledArtifacts};
|
|
1
|
+
import{createRuntimeSession,getActiveRuntimeSession,setRuntimeSessionCompiledArtifacts,withRuntimeSession}from"#runtime/sessions/runtime-session.js";function installBundledCompiledArtifacts(e){setRuntimeSessionCompiledArtifacts(getActiveRuntimeSession(),{manifest:e.manifest,metadata:e.metadata,moduleMap:e.moduleMap,sandboxPreparedArtifacts:e.sandboxPreparedArtifacts})}async function withBundledCompiledArtifacts(e,t){let n=createRuntimeSession(e.sessionId??`bundled-compiled-artifacts`);return await withRuntimeSession(n,async()=>(installBundledCompiledArtifacts(e),await t()))}function updateBundledSandboxPreparedArtifacts(e){let t=getActiveRuntimeSession(),n=t.compiledArtifacts;return n!==null&&(setRuntimeSessionCompiledArtifacts(t,{...n,sandboxPreparedArtifacts:e}),!0)}function readBundledCompiledArtifacts(){return getActiveRuntimeSession().compiledArtifacts}export{installBundledCompiledArtifacts,readBundledCompiledArtifacts,updateBundledSandboxPreparedArtifacts,withBundledCompiledArtifacts};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z}from"#compiled/zod/index.js";import{COMPILE_METADATA_KIND,COMPILE_METADATA_VERSION}from"#compiler/artifacts.js";import{formatValidationError}from"#runtime/validation.js";import{
|
|
1
|
+
import{z}from"#compiled/zod/index.js";import{COMPILE_METADATA_KIND,COMPILE_METADATA_VERSION}from"#compiler/artifacts.js";import{formatValidationError}from"#runtime/validation.js";import{resolveRuntimeCompilerArtifactPaths}from"#runtime/loaders/artifact-paths.js";import{readBundledCompiledArtifacts}from"#runtime/loaders/bundled-artifacts.js";const compileArtifactDigestSchema=z.object({path:z.string(),sha256:z.string()}).strict(),compileMetadataSchema=z.object({compile:z.object({manifest:compileArtifactDigestSchema,moduleMap:compileArtifactDigestSchema}).strict(),discovery:z.object({diagnostics:compileArtifactDigestSchema,manifest:compileArtifactDigestSchema,sourceGraphHash:z.string(),summary:z.object({errors:z.number().finite(),warnings:z.number().finite()}).strict()}).strict(),generator:z.object({name:z.string(),version:z.string()}).strict(),kind:z.literal(COMPILE_METADATA_KIND),status:z.union([z.literal(`failed`),z.literal(`ready`)]),version:z.literal(COMPILE_METADATA_VERSION)}).strict();var LoadCompileMetadataError=class extends Error{metadataPath;constructor(e,t){super(e),this.name=`LoadCompileMetadataError`,t!==void 0&&(this.metadataPath=t)}};async function loadCompileMetadata(e){let t=e.compiledArtifactsSource.kind===`disk`?resolveRuntimeCompilerArtifactPaths(e.compiledArtifactsSource.appRoot).compileMetadataPath:void 0;if(t!==void 0){let{readFile:e}=await import(`node:fs/promises`),n;try{n=JSON.parse(await e(t,`utf8`))}catch(e){throw new LoadCompileMetadataError(formatLoadErrorMessage(e),t)}return parseCompileMetadata(n,t)}let n=readBundledCompiledArtifacts()?.metadata;return n===void 0?null:parseCompileMetadata(n,`bundled compile metadata`)}function parseCompileMetadata(e,t){let n=compileMetadataSchema.safeParse(e);if(!n.success)throw new LoadCompileMetadataError(`Expected "${t}" to contain valid eve compile metadata. ${formatValidationError(n.error)}`,t);return n.data}function formatLoadErrorMessage(e){return e instanceof Error?e.message:`Unknown compile metadata load failure.`}export{loadCompileMetadata};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{compiledAgentManifestSchema}from"#compiler/manifest.js";import{formatValidationError}from"#runtime/validation.js";import{validateCompiledAgentManifest}from"#compiler/validate-artifact.js";import{
|
|
1
|
+
import{compiledAgentManifestSchema}from"#compiler/manifest.js";import{formatValidationError}from"#runtime/validation.js";import{validateCompiledAgentManifest}from"#compiler/validate-artifact.js";import{resolveRuntimeCompilerArtifactPaths}from"#runtime/loaders/artifact-paths.js";import{readBundledCompiledArtifacts}from"#runtime/loaders/bundled-artifacts.js";const BUNDLED_MANIFEST_SOURCE=`bundled compiled manifest`;var LoadCompiledManifestError=class extends Error{manifestPath;constructor(e,t){super(e),this.name=`LoadCompiledManifestError`,t!==void 0&&(this.manifestPath=t)}};async function loadCompiledManifest(e){let t=e.compiledArtifactsSource.kind===`disk`?resolveRuntimeCompilerArtifactPaths(e.compiledArtifactsSource.appRoot).compiledManifestPath:void 0;if(t!==void 0){let{readFile:e}=await import(`node:fs/promises`),n;try{n=JSON.parse(await e(t,`utf8`))}catch(e){throw new LoadCompiledManifestError(formatLoadErrorMessage(e),t)}return parseCompiledManifest(n,t)}let n=readBundledCompiledArtifacts();if(n!==null)return parseCompiledManifest(n.manifest,BUNDLED_MANIFEST_SOURCE);throw new LoadCompiledManifestError(`Compiled manifest is unavailable without an app root or bundled compiled artifacts.`,BUNDLED_MANIFEST_SOURCE)}function parseCompiledManifest(e,t){let n=compiledAgentManifestSchema.safeParse(e);if(!n.success)throw new LoadCompiledManifestError(`Expected "${t}" to contain a valid compiled eve agent manifest. ${formatValidationError(n.error)}`,t);try{validateCompiledAgentManifest(n.data)}catch(e){throw new LoadCompiledManifestError(`Expected "${t}" to contain a semantically valid compiled eve agent manifest. ${formatLoadErrorMessage(e)}`,t)}return n.data}function formatLoadErrorMessage(e){return e instanceof Error?e.message:`Unknown manifest load failure.`}export{LoadCompiledManifestError,loadCompiledManifest};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{compiledModuleMapSchema}from"#compiler/module-map.js";import{formatValidationError}from"#runtime/validation.js";import{
|
|
1
|
+
import{compiledModuleMapSchema}from"#compiler/module-map.js";import{formatValidationError}from"#runtime/validation.js";import{resolveRuntimeCompilerArtifactPaths}from"#runtime/loaders/artifact-paths.js";import{readBundledCompiledArtifacts}from"#runtime/loaders/bundled-artifacts.js";const BUNDLED_MODULE_MAP_SOURCE=`bundled compiled module map`;var LoadCompiledModuleMapError=class extends Error{moduleMapPath;constructor(e,t){super(e),this.name=`LoadCompiledModuleMapError`,t!==void 0&&(this.moduleMapPath=t)}};async function loadCompiledModuleMap(e){let t=e.compiledArtifactsSource.kind===`disk`?resolveRuntimeCompilerArtifactPaths(e.compiledArtifactsSource.appRoot).moduleMapPath:void 0;if(t!==void 0){let e=createFileImportSpecifier(t);try{let n=await import(e);return parseCompiledModuleMap(n.moduleMap??n.default,t)}catch(e){throw new LoadCompiledModuleMapError(formatLoadErrorMessage(e),t)}}let n=readBundledCompiledArtifacts();if(n!==null)return parseCompiledModuleMap(n.moduleMap,BUNDLED_MODULE_MAP_SOURCE);throw new LoadCompiledModuleMapError(`Compiled module map is unavailable without an app root or bundled compiled artifacts.`,BUNDLED_MODULE_MAP_SOURCE)}function parseCompiledModuleMap(e,t){let n=compiledModuleMapSchema.safeParse(e);if(!n.success)throw new LoadCompiledModuleMapError(`Expected "${t}" to export a valid compiled eve module map. ${formatValidationError(n.error)}`,t);return n.data}function formatLoadErrorMessage(e){return e instanceof Error?e.message:`Unknown module-map load failure.`}function createFileImportSpecifier(e){let t=e.replaceAll(`\\`,`/`);return/^[A-Za-z]:\//.test(t)?`file:///${encodeURI(t)}`:t.startsWith(`/`)?`file://${encodeURI(t)}`:t}export{LoadCompiledModuleMapError,loadCompiledModuleMap};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
export declare const LOCAL_DEV_INTERACTIVE_CLIENT_HEADER = "x-eve-dev-interactive-client";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
* same-machine request to `eve dev`.
|
|
3
|
+
* Host facilities available to authored code running on an `eve dev` server.
|
|
5
4
|
*
|
|
6
|
-
* Absence
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
5
|
+
* Absence means this host has no authored tree to mutate or watcher to pause.
|
|
6
|
+
* When present, the capability is available to every execution on that host;
|
|
7
|
+
* callers admitted to the development server are trusted with enabled local
|
|
8
|
+
* editing tools.
|
|
10
9
|
*/
|
|
11
10
|
export interface LocalDevCapability {
|
|
12
11
|
/**
|
|
@@ -15,8 +14,9 @@ export interface LocalDevCapability {
|
|
|
15
14
|
*/
|
|
16
15
|
readonly appRoot: string;
|
|
17
16
|
/**
|
|
18
|
-
* Whether the
|
|
19
|
-
*
|
|
17
|
+
* Whether the originating client is the dev TUI and can run a flow that asks
|
|
18
|
+
* questions in its terminal. This inherited hint is not proof that the
|
|
19
|
+
* current sender has a live terminal.
|
|
20
20
|
*/
|
|
21
21
|
readonly interactiveClient: boolean;
|
|
22
22
|
/**
|
|
@@ -39,13 +39,15 @@ export declare function installLocalDevCapabilityEnvironment(input: {
|
|
|
39
39
|
readonly serverUrl: string;
|
|
40
40
|
}): () => void;
|
|
41
41
|
/**
|
|
42
|
-
* Seeds
|
|
43
|
-
*
|
|
42
|
+
* Seeds the inherited dev-TUI hint only when the dev host signed a loopback
|
|
43
|
+
* peer address. Client-supplied address headers cannot create that hint.
|
|
44
44
|
*/
|
|
45
45
|
export declare function withLocalDevRequestScope<T>(request: Request, callback: () => Promise<T>): Promise<T>;
|
|
46
46
|
/**
|
|
47
|
-
* Resolves
|
|
48
|
-
*
|
|
47
|
+
* Resolves local development host facilities, or `undefined` when this host
|
|
48
|
+
* lacks the authored root or watcher control origin installed by `eve dev`.
|
|
49
|
+
* Request provenance affects only the optional dev-TUI hint, never access to
|
|
50
|
+
* the authored tree.
|
|
49
51
|
*
|
|
50
52
|
* This is deliberately not a {@link import("#public/definitions/tool.js").ToolContext}
|
|
51
53
|
* field: both values are meaningless in a deployed runtime, and a capability
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{randomUUID}from"node:crypto";import{isLoopbackHostname}from"#shared/network-address.js";import{ContextContainer,contextStorage}from"#context/container.js";import{resumeDevelopmentRuntimeArtifacts,suspendDevelopmentRuntimeArtifacts}from"#services/dev-client/runtime-artifacts.js";import{DEVELOPMENT_WORKFLOW_SECRET_ENV}from"#internal/workflow/development-world-protocol.js";import{DEVELOPMENT_CLIENT_ADDRESS_SIGNATURE_HEADER,isTrustedDevelopmentClientAddress,readTrustedDevelopmentClientAddress}from"#internal/nitro/dev-client-address.js";const LOCAL_DEV_APP_ROOT_ENV=`EVE_DEV_APP_ROOT`,LOCAL_DEV_CONTROL_URL_ENV=`EVE_DEV_CONTROL_URL`,LOCAL_DEV_INTERACTIVE_CLIENT_HEADER=`x-eve-dev-interactive-client`;function installLocalDevCapabilityEnvironment(e){let t=process.env[LOCAL_DEV_APP_ROOT_ENV],n=process.env[LOCAL_DEV_CONTROL_URL_ENV];return process.env[LOCAL_DEV_APP_ROOT_ENV]=e.appRoot,process.env[LOCAL_DEV_CONTROL_URL_ENV]=new URL(e.serverUrl).origin,()=>{restore(LOCAL_DEV_APP_ROOT_ENV,t),restore(LOCAL_DEV_CONTROL_URL_ENV,n)}}async function withLocalDevRequestScope(e,t){let n=process.env[DEVELOPMENT_WORKFLOW_SECRET_ENV],r=readTrustedDevelopmentClientAddress(e.headers,n),i=e.headers.get(DEVELOPMENT_CLIENT_ADDRESS_SIGNATURE_HEADER);return r===void 0||i===null||!isLoopbackHostname(r)?await
|
|
1
|
+
import{randomUUID}from"node:crypto";import{isLoopbackHostname}from"#shared/network-address.js";import{ContextContainer,contextStorage}from"#context/container.js";import{resumeDevelopmentRuntimeArtifacts,suspendDevelopmentRuntimeArtifacts}from"#services/dev-client/runtime-artifacts.js";import{DEVELOPMENT_WORKFLOW_SECRET_ENV}from"#internal/workflow/development-world-protocol.js";import{DEVELOPMENT_CLIENT_ADDRESS_SIGNATURE_HEADER,isTrustedDevelopmentClientAddress,readTrustedDevelopmentClientAddress}from"#internal/nitro/dev-client-address.js";const LOCAL_DEV_APP_ROOT_ENV=`EVE_DEV_APP_ROOT`,LOCAL_DEV_CONTROL_URL_ENV=`EVE_DEV_CONTROL_URL`,LOCAL_DEV_INTERACTIVE_CLIENT_HEADER=`x-eve-dev-interactive-client`;function installLocalDevCapabilityEnvironment(e){let t=process.env[LOCAL_DEV_APP_ROOT_ENV],n=process.env[LOCAL_DEV_CONTROL_URL_ENV];return process.env[LOCAL_DEV_APP_ROOT_ENV]=e.appRoot,process.env[LOCAL_DEV_CONTROL_URL_ENV]=new URL(e.serverUrl).origin,()=>{restore(LOCAL_DEV_APP_ROOT_ENV,t),restore(LOCAL_DEV_CONTROL_URL_ENV,n)}}async function withLocalDevRequestScope(e,t){let n=process.env[DEVELOPMENT_WORKFLOW_SECRET_ENV],r=readTrustedDevelopmentClientAddress(e.headers,n),i=e.headers.get(DEVELOPMENT_CLIENT_ADDRESS_SIGNATURE_HEADER);return r===void 0||i===null||!isLoopbackHostname(r)?await contextStorage.run(new ContextContainer({localDevRequest:void 0}),t):await contextStorage.run(new ContextContainer({localDevRequest:{address:r,interactiveClient:e.headers.get(LOCAL_DEV_INTERACTIVE_CLIENT_HEADER)===`1`,signature:i}}),t)}function getLocalDevCapability(e=process.env){let t=e[LOCAL_DEV_APP_ROOT_ENV],n=e[LOCAL_DEV_CONTROL_URL_ENV];if(t===void 0||t===``||n===void 0||n===``)return;let r=contextStorage.getStore()?.localDevRequest;return{appRoot:t,interactiveClient:r!==void 0&&typeof r.address==`string`&&typeof r.signature==`string`&&typeof r.interactiveClient==`boolean`&&isLoopbackHostname(r.address)&&isTrustedDevelopmentClientAddress(r.address,r.signature,process.env[DEVELOPMENT_WORKFLOW_SECRET_ENV])?r.interactiveClient:!1,async withSuspendedSource(e){let t=randomUUID();if(!await suspendDevelopmentRuntimeArtifacts({leaseId:t,serverUrl:n}))throw Error(`Could not pause the eve development server. Its authored-source watcher must be suspended before the authored tree is modified.`);let r;try{r={ok:!0,value:await e()}}catch(e){r={error:e,ok:!1}}if(await resumeDevelopmentRuntimeArtifacts({leaseId:t,serverUrl:n})===void 0&&await resumeDevelopmentRuntimeArtifacts({leaseId:t,serverUrl:n})===void 0)throw Error(`Could not resume the eve development server after modifying the authored tree. Restart eve dev before making further source changes.`,r.ok?void 0:{cause:r.error});if(!r.ok)throw r.error;return r.value}}}function restore(e,t){t===void 0?delete process.env[e]:process.env[e]=t}export{LOCAL_DEV_INTERACTIVE_CLIENT_HEADER,getLocalDevCapability,installLocalDevCapabilityEnvironment,withLocalDevRequestScope};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{expectObjectRecord}from"#internal/authored-module.js";import{stripLogicalPathExtension}from"#discover/filesystem.js";import{ROOT_COMPILED_AGENT_NODE_ID}from"#compiler/manifest.js";import{validateCompiledModuleMap}from"#compiler/validate-artifact.js";import{createRuntimeSubagentRegistry}from"#runtime/subagents/registry.js";import{LOAD_SKILL_TOOL_NAME}from"#runtime/skills/fragment-context.js";import{createRuntimeToolRegistry}from"#runtime/tools/registry.js";import{ROOT_RUNTIME_AGENT_NODE_ID}from"#runtime/graph.js";import{loadResolvedModuleExport}from"#runtime/resolve-helpers.js";import{createResolvedRuntimeTurnAgent}from"#runtime/agent/bootstrap.js";import{createWorkspacePromptSection}from"#runtime/workspace/spec.js";import{createRuntimeHookRegistry}from"#runtime/hooks/registry.js";import{resolveAgent}from"#runtime/resolve-agent.js";import{resolveDynamicSubagentDefinition}from"#runtime/resolve-dynamic-subagent.js";import{createRuntimeSandboxRegistry}from"#runtime/sandbox/registry.js";var ResolveRuntimeAgentGraphError=class extends Error{logicalPath;nodeId;sourceId;constructor(e,t={}){super(e),this.name=`ResolveRuntimeAgentGraphError`,t.logicalPath!==void 0&&(this.logicalPath=t.logicalPath),t.nodeId!==void 0&&(this.nodeId=t.nodeId),t.sourceId!==void 0&&(this.sourceId=t.sourceId)}};async function resolveRuntimeAgentGraph(e){validateCompiledModuleMap(e.manifest,e.moduleMap);let t=new Map,n=createChildNodeIdsByParentNodeId(e.manifest),r=new Map(e.manifest.subagents.map(e=>[e.nodeId,e])),i=await resolveRuntimeAgentNode({childNodeIdsByParentNodeId:n,manifest:e.manifest,moduleMap:e.moduleMap,nodeId:ROOT_COMPILED_AGENT_NODE_ID,nodesByNodeId:t,subagentNodesById:r});return attachInheritedSandboxWorkspaceResources({manifest:e.manifest,nodesByNodeId:t}),{nodesByNodeId:t,root:i}}async function resolveRuntimeAgentNode(e){let t=toRuntimeNodeId(e.nodeId);if(e.nodesByNodeId.has(t))throw new ResolveRuntimeAgentGraphError(`Found multiple runtime agent nodes for node id "${t}".`,{nodeId:t,sourceId:e.sourceId});let n=await resolveAgent({manifest:e.manifest,moduleMap:e.moduleMap,nodeId:e.nodeId}),r=await createRuntimeToolRegistry({tools:n.tools},{nodeId:t}),i=createRuntimeSandboxRegistry({sandbox:n.sandbox,workspaceResourceRoot:n.workspaceResourceRoot}),a=createRuntimeSubagentRegistry({disabledToolNames:e.manifest.sourceComposition.entries.flatMap(e=>e.kind!==`disabled`||!e.source.logicalPath.startsWith(`tools/`)?[]:[stripLogicalPathExtension(e.source.logicalPath).replace(/^tools\//,``).replaceAll(`/`,`-`)]),reservedToolNames:[LOAD_SKILL_TOOL_NAME,...r.preparedTools.map(e=>e.name)],subagents:await resolveRuntimeSubagents({childNodeIdsByParentNodeId:e.childNodeIdsByParentNodeId,manifest:e.manifest,moduleMap:e.moduleMap,nodesByNodeId:e.nodesByNodeId,parentNodeId:e.nodeId,subagentNodesById:e.subagentNodesById})}),o={agent:n,channels:n.channels,hookRegistry:createRuntimeHookRegistry(n.hooks),nodeId:t,sandboxRegistry:i,sourceId:e.sourceId,subagentRegistry:a,toolRegistry:r,turnAgent:createResolvedRuntimeTurnAgent({agent:n,dynamicSubagentsAvailable:a.dynamicResolvers.length>0,id:e.agentId,nodeId:t,tools:[...r.preparedTools,...a.preparedTools]})};return e.nodesByNodeId.set(t,o),o}async function resolveRuntimeSubagents(e){let t=[],n=e.childNodeIdsByParentNodeId.get(e.parentNodeId)??[];for(let r of n){let n=e.subagentNodesById.get(r);if(n===void 0)throw new ResolveRuntimeAgentGraphError(`Missing compiled subagent node "${r}" while resolving runtime subagents.`,{nodeId:toRuntimeNodeId(e.parentNodeId),sourceId:r});t.push(await resolveRuntimeSubagent({childNodeIdsByParentNodeId:e.childNodeIdsByParentNodeId,moduleMap:e.moduleMap,nodesByNodeId:e.nodesByNodeId,sourceRef:n,subagentNodesById:e.subagentNodesById}))}for(let n of e.manifest.remoteAgents)t.push(await resolveRuntimeRemoteAgent({moduleMap:e.moduleMap,nodeScopeId:e.parentNodeId,sourceRef:n}));return t}async function resolveRuntimeSubagent(e){let t={...e.sourceRef.configResolver===void 0?{description:e.sourceRef.description,tool:e.sourceRef.agent.config.tool}:{dynamic:await resolveDynamicSubagentDefinition({definition:e.sourceRef.configResolver,moduleMap:e.moduleMap,nodeId:e.sourceRef.nodeId})},kind:`subagent`,logicalPath:e.sourceRef.logicalPath,name:e.sourceRef.name,nodeId:toRuntimeNodeId(e.sourceRef.nodeId),sourceId:e.sourceRef.sourceId,sourceKind:`module`};return await resolveRuntimeAgentNode({agentId:e.sourceRef.name,childNodeIdsByParentNodeId:e.childNodeIdsByParentNodeId,manifest:e.sourceRef.agent,moduleMap:e.moduleMap,nodeId:e.sourceRef.nodeId,nodesByNodeId:e.nodesByNodeId,sourceId:e.sourceRef.sourceId,subagentNodesById:e.subagentNodesById}),t}async function resolveRuntimeRemoteAgent(e){let t=await loadResolvedModuleExport({definition:e.sourceRef,kindLabel:`remote agent`,moduleMap:e.moduleMap,nodeId:e.nodeScopeId}),n=expectObjectRecord(t,`Expected remote agent source "${e.sourceRef.logicalPath}" to export an object.`),r={description:e.sourceRef.description,kind:`remote`,logicalPath:e.sourceRef.logicalPath,name:e.sourceRef.name,nodeId:toRuntimeNodeId(e.sourceRef.nodeId),outputSchema:e.sourceRef.outputSchema,path:e.sourceRef.path,sourceId:e.sourceRef.sourceId,sourceKind:`module`,tool:e.sourceRef.tool,url:await resolveRemoteAgentUrl({bakedUrl:e.sourceRef.url,logicalPath:e.sourceRef.logicalPath,resolvedUrl:n.url})};typeof n.auth==`function`&&(r.auth=n.auth),n.forwardPrincipal===!0&&(r.forwardPrincipal=!0);let i=resolveRemoteAgentHeaders(n.headers);return i!==void 0&&(r.headers=i),r}async function resolveRemoteAgentUrl(e){if(typeof e.resolvedUrl==`function`){let t=await e.resolvedUrl();if(typeof t!=`string`||t.length===0)throw Error(`Remote agent "${e.logicalPath}" url function must return a non-empty string.`);return t}let t=e.bakedUrl??(typeof e.resolvedUrl==`string`?e.resolvedUrl:``);if(t.length===0)throw Error(`Remote agent "${e.logicalPath}" is missing a url.`);return t}function resolveRemoteAgentHeaders(e){if(e===void 0)return;if(typeof e==`function`)return e;if(typeof e!=`object`||!e||Array.isArray(e))return;let t={};for(let[n,r]of Object.entries(e))typeof r==`string`&&(t[n]=r);return t}function attachInheritedSandboxWorkspaceResources(e){let t=new Map(e.manifest.subagents.map(e=>[e.nodeId,e.parentNodeId]));for(let[n,r]of e.nodesByNodeId){if(r.sandboxRegistry.sandbox.definition.
|
|
1
|
+
import{expectObjectRecord}from"#internal/authored-module.js";import{stripLogicalPathExtension}from"#discover/filesystem.js";import{ROOT_COMPILED_AGENT_NODE_ID}from"#compiler/manifest.js";import{validateCompiledModuleMap}from"#compiler/validate-artifact.js";import{createRuntimeSubagentRegistry}from"#runtime/subagents/registry.js";import{LOAD_SKILL_TOOL_NAME}from"#runtime/skills/fragment-context.js";import{createRuntimeToolRegistry}from"#runtime/tools/registry.js";import{ROOT_RUNTIME_AGENT_NODE_ID}from"#runtime/graph.js";import{loadResolvedModuleExport}from"#runtime/resolve-helpers.js";import{createResolvedRuntimeTurnAgent}from"#runtime/agent/bootstrap.js";import{createWorkspacePromptSection}from"#runtime/workspace/spec.js";import{createRuntimeHookRegistry}from"#runtime/hooks/registry.js";import{resolveAgent}from"#runtime/resolve-agent.js";import{resolveDynamicSubagentDefinition}from"#runtime/resolve-dynamic-subagent.js";import{createRuntimeSandboxRegistry}from"#runtime/sandbox/registry.js";var ResolveRuntimeAgentGraphError=class extends Error{logicalPath;nodeId;sourceId;constructor(e,t={}){super(e),this.name=`ResolveRuntimeAgentGraphError`,t.logicalPath!==void 0&&(this.logicalPath=t.logicalPath),t.nodeId!==void 0&&(this.nodeId=t.nodeId),t.sourceId!==void 0&&(this.sourceId=t.sourceId)}};async function resolveRuntimeAgentGraph(e){validateCompiledModuleMap(e.manifest,e.moduleMap);let t=new Map,n=createChildNodeIdsByParentNodeId(e.manifest),r=new Map(e.manifest.subagents.map(e=>[e.nodeId,e])),i=await resolveRuntimeAgentNode({childNodeIdsByParentNodeId:n,manifest:e.manifest,moduleMap:e.moduleMap,nodeId:ROOT_COMPILED_AGENT_NODE_ID,nodesByNodeId:t,subagentNodesById:r});return attachInheritedSandboxWorkspaceResources({manifest:e.manifest,nodesByNodeId:t}),{nodesByNodeId:t,root:i}}async function resolveRuntimeAgentNode(e){let t=toRuntimeNodeId(e.nodeId);if(e.nodesByNodeId.has(t))throw new ResolveRuntimeAgentGraphError(`Found multiple runtime agent nodes for node id "${t}".`,{nodeId:t,sourceId:e.sourceId});let n=await resolveAgent({manifest:e.manifest,moduleMap:e.moduleMap,nodeId:e.nodeId}),r=await createRuntimeToolRegistry({tools:n.tools},{nodeId:t}),i=createRuntimeSandboxRegistry({sandbox:n.sandbox,workspaceResourceRoot:n.workspaceResourceRoot}),a=createRuntimeSubagentRegistry({disabledToolNames:e.manifest.sourceComposition.entries.flatMap(e=>e.kind!==`disabled`||!e.source.logicalPath.startsWith(`tools/`)?[]:[stripLogicalPathExtension(e.source.logicalPath).replace(/^tools\//,``).replaceAll(`/`,`-`)]),reservedToolNames:[LOAD_SKILL_TOOL_NAME,...r.preparedTools.map(e=>e.name)],subagents:await resolveRuntimeSubagents({childNodeIdsByParentNodeId:e.childNodeIdsByParentNodeId,manifest:e.manifest,moduleMap:e.moduleMap,nodesByNodeId:e.nodesByNodeId,parentNodeId:e.nodeId,subagentNodesById:e.subagentNodesById})}),o={agent:n,channels:n.channels,hookRegistry:createRuntimeHookRegistry(n.hooks),nodeId:t,sandboxRegistry:i,sourceId:e.sourceId,subagentRegistry:a,toolRegistry:r,turnAgent:createResolvedRuntimeTurnAgent({agent:n,dynamicSubagentsAvailable:a.dynamicResolvers.length>0,id:e.agentId,nodeId:t,tools:[...r.preparedTools,...a.preparedTools]})};return e.nodesByNodeId.set(t,o),o}async function resolveRuntimeSubagents(e){let t=[],n=e.childNodeIdsByParentNodeId.get(e.parentNodeId)??[];for(let r of n){let n=e.subagentNodesById.get(r);if(n===void 0)throw new ResolveRuntimeAgentGraphError(`Missing compiled subagent node "${r}" while resolving runtime subagents.`,{nodeId:toRuntimeNodeId(e.parentNodeId),sourceId:r});t.push(await resolveRuntimeSubagent({childNodeIdsByParentNodeId:e.childNodeIdsByParentNodeId,moduleMap:e.moduleMap,nodesByNodeId:e.nodesByNodeId,sourceRef:n,subagentNodesById:e.subagentNodesById}))}for(let n of e.manifest.remoteAgents)t.push(await resolveRuntimeRemoteAgent({moduleMap:e.moduleMap,nodeScopeId:e.parentNodeId,sourceRef:n}));return t}async function resolveRuntimeSubagent(e){let t={...e.sourceRef.configResolver===void 0?{description:e.sourceRef.description,tool:e.sourceRef.agent.config.tool}:{dynamic:await resolveDynamicSubagentDefinition({definition:e.sourceRef.configResolver,moduleMap:e.moduleMap,nodeId:e.sourceRef.nodeId})},kind:`subagent`,logicalPath:e.sourceRef.logicalPath,name:e.sourceRef.name,nodeId:toRuntimeNodeId(e.sourceRef.nodeId),sourceId:e.sourceRef.sourceId,sourceKind:`module`};return await resolveRuntimeAgentNode({agentId:e.sourceRef.name,childNodeIdsByParentNodeId:e.childNodeIdsByParentNodeId,manifest:e.sourceRef.agent,moduleMap:e.moduleMap,nodeId:e.sourceRef.nodeId,nodesByNodeId:e.nodesByNodeId,sourceId:e.sourceRef.sourceId,subagentNodesById:e.subagentNodesById}),t}async function resolveRuntimeRemoteAgent(e){let t=await loadResolvedModuleExport({definition:e.sourceRef,kindLabel:`remote agent`,moduleMap:e.moduleMap,nodeId:e.nodeScopeId}),n=expectObjectRecord(t,`Expected remote agent source "${e.sourceRef.logicalPath}" to export an object.`),r={description:e.sourceRef.description,kind:`remote`,logicalPath:e.sourceRef.logicalPath,name:e.sourceRef.name,nodeId:toRuntimeNodeId(e.sourceRef.nodeId),outputSchema:e.sourceRef.outputSchema,path:e.sourceRef.path,sourceId:e.sourceRef.sourceId,sourceKind:`module`,tool:e.sourceRef.tool,url:await resolveRemoteAgentUrl({bakedUrl:e.sourceRef.url,logicalPath:e.sourceRef.logicalPath,resolvedUrl:n.url})};typeof n.auth==`function`&&(r.auth=n.auth),n.forwardPrincipal===!0&&(r.forwardPrincipal=!0);let i=resolveRemoteAgentHeaders(n.headers);return i!==void 0&&(r.headers=i),r}async function resolveRemoteAgentUrl(e){if(typeof e.resolvedUrl==`function`){let t=await e.resolvedUrl();if(typeof t!=`string`||t.length===0)throw Error(`Remote agent "${e.logicalPath}" url function must return a non-empty string.`);return t}let t=e.bakedUrl??(typeof e.resolvedUrl==`string`?e.resolvedUrl:``);if(t.length===0)throw Error(`Remote agent "${e.logicalPath}" is missing a url.`);return t}function resolveRemoteAgentHeaders(e){if(e===void 0)return;if(typeof e==`function`)return e;if(typeof e!=`object`||!e||Array.isArray(e))return;let t={};for(let[n,r]of Object.entries(e))typeof r==`string`&&(t[n]=r);return t}function attachInheritedSandboxWorkspaceResources(e){let t=new Map(e.manifest.subagents.map(e=>[e.nodeId,e.parentNodeId]));for(let[n,r]of e.nodesByNodeId){if(r.sandboxRegistry.sandbox.definition.kind!==`parent`)continue;if(r.agent.dynamicSkillResolvers.length>0)throw new ResolveRuntimeAgentGraphError(`Sandbox "${r.sandboxRegistry.sandbox.definition.logicalPath}" selects parent.sandbox but agent node "${n}" defines dynamic skills. Remove the child dynamic skills or give the child its own sandbox.`,{nodeId:n});let i=t.get(n);if(i===void 0)throw new ResolveRuntimeAgentGraphError(`Sandbox "${r.sandboxRegistry.sandbox.definition.logicalPath}" selects parent.sandbox but agent node "${n}" has no parent.`,{nodeId:n});let a=resolveSandboxOwnerNode({nodeId:i,nodesByNodeId:e.nodesByNodeId,parentNodeIdByChildNodeId:t});r.sandboxRegistry.sandbox.inheritance={definition:a.sandboxRegistry.sandbox.definition,nodeId:a.nodeId,workspaceResourceRoot:a.sandboxRegistry.sandbox.workspaceResourceRoot};let o=createWorkspacePromptSection(a.agent.workspaceSpec);o!==void 0&&(r.turnAgent.instructions=[...r.turnAgent.instructions,o])}}function resolveSandboxOwnerNode(e){let t=e.nodesByNodeId.get(toRuntimeNodeId(e.nodeId));if(t===void 0)throw new ResolveRuntimeAgentGraphError(`Missing parent runtime node "${e.nodeId}".`,{nodeId:e.nodeId});if(t.sandboxRegistry.sandbox.definition.kind!==`parent`)return t;let n=e.parentNodeIdByChildNodeId.get(e.nodeId);if(n===void 0)throw new ResolveRuntimeAgentGraphError(`Inherited sandbox node "${e.nodeId}" has no parent.`,{nodeId:e.nodeId});return resolveSandboxOwnerNode({...e,nodeId:n})}function createChildNodeIdsByParentNodeId(e){let t=new Map;for(let n of e.subagents){let e=t.get(n.parentNodeId);if(e===void 0){t.set(n.parentNodeId,[n.nodeId]);continue}e.push(n.nodeId)}return t}function toRuntimeNodeId(e){return e===ROOT_COMPILED_AGENT_NODE_ID?ROOT_RUNTIME_AGENT_NODE_ID:e}export{resolveRuntimeAgentGraph};
|
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type CompiledSandboxDefinition } from "#compiler/manifest.js";
|
|
2
2
|
import type { CompiledModuleMap } from "#compiler/module-map.js";
|
|
3
3
|
import type { ResolvedSandboxDefinition } from "#runtime/types.js";
|
|
4
|
-
/**
|
|
5
|
-
* Resolves one compiled sandbox entry into a runtime-owned definition
|
|
6
|
-
* with live `backend`, `bootstrap`, and `onSession` lifecycle handlers
|
|
7
|
-
* (when present) attached from the authored module.
|
|
8
|
-
*
|
|
9
|
-
* If the authored module omits `backend`, the resolver substitutes
|
|
10
|
-
* {@link defaultSandbox} so the rest of the runtime can rely on a
|
|
11
|
-
* non-null backend value.
|
|
12
|
-
*/
|
|
13
4
|
export declare function resolveSandboxDefinition(definition: CompiledSandboxDefinition, moduleMap: CompiledModuleMap, nodeId: string | undefined): Promise<ResolvedSandboxDefinition>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{expectObjectRecord}from"#internal/authored-module.js";import{
|
|
1
|
+
import{expectObjectRecord,getAuthoredModuleExport}from"#internal/authored-module.js";import{ROOT_COMPILED_AGENT_NODE_ID}from"#compiler/manifest.js";import{getBoundSandboxEnvironment,isSandboxEnvironment}from"#shared/sandbox-environment.js";import{defineParentSandbox}from"#public/definitions/sandbox.js";import{ResolveAgentError}from"#runtime/resolve-helpers.js";async function resolveSandboxDefinition(e,t,n){if(e.inheritsParent===!0)return{exportName:e.exportName,kind:`parent`,logicalPath:e.logicalPath,revisionHash:e.revisionHash,selector:defineParentSandbox(),sourceId:e.sourceId,sourceKind:`module`};let r=t.nodes[n??ROOT_COMPILED_AGENT_NODE_ID]?.modules[e.sourceId],i=expectObjectRecord(r,`Missing sandbox module "${e.logicalPath}".`),a=getAuthoredModuleExport(i,e);if(typeof a!=`function`)throw new ResolveAgentError(`Sandbox "${e.logicalPath}" does not export a selector.`);let o=e.environmentExportName?i[e.environmentExportName]:getBoundSandboxEnvironment(a),s={exportName:e.exportName,logicalPath:e.logicalPath,revisionHash:e.revisionHash,selector:a,sourceId:e.sourceId,sourceKind:`module`};if(!isSandboxEnvironment(o))throw new ResolveAgentError(`Sandbox "${e.logicalPath}" has no environment.`);return{...s,environment:o,kind:`independent`}}export{resolveSandboxDefinition};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { RuntimeCompiledArtifactsSource } from "#runtime/compiled-artifacts-source.js";
|
|
2
|
+
import { type SandboxPreparedArtifactEntry, type SandboxPreparedArtifactsManifest } from "#shared/sandbox-prepared-artifacts.js";
|
|
3
|
+
import type { SandboxPreparedArtifact } from "#shared/sandbox-provider.js";
|
|
4
|
+
export declare function writeSandboxPreparedArtifactsManifest(input: {
|
|
5
|
+
readonly compileDirectoryPath: string;
|
|
6
|
+
readonly entries: readonly SandboxPreparedArtifactEntry[];
|
|
7
|
+
}): Promise<void>;
|
|
8
|
+
export declare function loadSandboxPreparedArtifact(input: {
|
|
9
|
+
readonly compiledArtifactsSource: RuntimeCompiledArtifactsSource;
|
|
10
|
+
readonly nodeId: string;
|
|
11
|
+
readonly providerName: string;
|
|
12
|
+
}): Promise<SandboxPreparedArtifact | undefined>;
|
|
13
|
+
export declare function loadSandboxPreparedArtifactsManifest(source: RuntimeCompiledArtifactsSource): Promise<SandboxPreparedArtifactsManifest | null>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{randomUUID}from"node:crypto";import{readFile,rename,rm,writeFile}from"node:fs/promises";import{createSandboxPreparedArtifactsManifest,sandboxPreparedArtifactsManifestSchema}from"#shared/sandbox-prepared-artifacts.js";import{resolveRuntimeCompilerArtifactPaths}from"#runtime/loaders/artifact-paths.js";import{readBundledCompiledArtifacts}from"#runtime/loaders/bundled-artifacts.js";async function writeSandboxPreparedArtifactsManifest(e){if(e.entries.length===0)return;let t=`${e.compileDirectoryPath}/sandbox-prepared-artifacts.json`,n=null;try{n=sandboxPreparedArtifactsManifestSchema.parse(JSON.parse(await readFile(t,`utf8`)))}catch(e){if(!(e instanceof Error&&`code`in e&&e.code===`ENOENT`))throw e}let r=new Map(n?.entries.map(e=>[e.nodeId,e]));for(let t of e.entries)r.set(t.nodeId,t);let i=`${t}.${randomUUID()}.tmp`;try{await writeFile(i,`${JSON.stringify(createSandboxPreparedArtifactsManifest([...r.values()]),null,2)}\n`),await rename(i,t)}finally{await rm(i,{force:!0})}}async function loadSandboxPreparedArtifact(e){let t=(await loadSandboxPreparedArtifactsManifest(e.compiledArtifactsSource))?.entries.find(t=>t.nodeId===e.nodeId);if(t!==void 0&&t.providerName!==e.providerName)throw Error(`Prepared sandbox artifact for node "${e.nodeId}" belongs to provider "${t.providerName}", not "${e.providerName}".`);return t?.artifact}async function loadSandboxPreparedArtifactsManifest(e){if(e.kind===`bundled`)return readBundledCompiledArtifacts()?.sandboxPreparedArtifacts??null;let t=resolveRuntimeCompilerArtifactPaths(e.appRoot).sandboxPreparedArtifactsPath;try{return sandboxPreparedArtifactsManifestSchema.parse(JSON.parse(await readFile(t,`utf8`)))}catch(e){if(e instanceof Error&&`code`in e&&e.code===`ENOENT`)return null;throw e}}export{loadSandboxPreparedArtifact,loadSandboxPreparedArtifactsManifest,writeSandboxPreparedArtifactsManifest};
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import type { CompiledWorkspaceResourceRoot } from "#compiler/manifest.js";
|
|
2
2
|
import type { ResolvedSandboxDefinition } from "#runtime/types.js";
|
|
3
|
-
/**
|
|
4
|
-
* Stable internal source id for the framework-owned default sandbox.
|
|
5
|
-
*
|
|
6
|
-
* Used by the runtime template/session key derivation and by prewarm
|
|
7
|
-
* to distinguish the shared framework sandbox from per-node authored
|
|
8
|
-
* overrides.
|
|
9
|
-
*/
|
|
10
3
|
/**
|
|
11
4
|
* Resolved sandbox tracked by the runtime-owned registry.
|
|
12
5
|
*
|
|
@@ -17,8 +10,8 @@ import type { ResolvedSandboxDefinition } from "#runtime/types.js";
|
|
|
17
10
|
* compiled workspace resource tree owned by this graph node. The
|
|
18
11
|
* prewarm orchestrator resolves the descriptor's logical path against
|
|
19
12
|
* the active compiled artifacts source and writes the contents into
|
|
20
|
-
* the sandbox template
|
|
21
|
-
*
|
|
13
|
+
* the sandbox template artifact. Runtime provider `open(...)` never reads these
|
|
14
|
+
* files.
|
|
22
15
|
*/
|
|
23
16
|
export interface RuntimeRegisteredSandbox {
|
|
24
17
|
readonly definition: ResolvedSandboxDefinition;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function createRuntimeSandboxRegistry(e){let t=e.sandbox;if(t.
|
|
1
|
+
function createRuntimeSandboxRegistry(e){let t=e.sandbox;if(t.kind===`parent`&&(e.workspaceResourceRoot.contentHash!==void 0||e.workspaceResourceRoot.rootEntries.length>0))throw Error(`Sandbox "${t.logicalPath}" selects parent.sandbox but has managed workspace resources. Remove the child workspace or give the child its own sandbox.`);return{sandbox:{definition:t,workspaceResourceRoot:e.workspaceResourceRoot}}}export{createRuntimeSandboxRegistry};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{AsyncLocalStorage}from"node:async_hooks";function createRuntimeSession(e=`test-session`){return{bundleCache:new Map,bundleCacheKeyBySourceKey:new Map,compiledArtifacts:null,id:e}}function setRuntimeSessionCompiledArtifacts(e,t){let n=e.compiledArtifacts;(n===null||!isSameCompiledArtifactSnapshot(n,t))&&(e.bundleCache.clear(),e.bundleCacheKeyBySourceKey.clear()),e.compiledArtifacts=t}function isSameCompiledArtifactSnapshot(e,t){let n=e.metadata?.discovery.sourceGraphHash,r=t.metadata?.discovery.sourceGraphHash;return n&&r?n===r:e.manifest===t.manifest&&e.moduleMap===t.moduleMap&&e.metadata===t.metadata}const RUNTIME_SESSION_STORAGE_GLOBAL_KEY=Symbol.for(`eve.runtime-session-storage`),RUNTIME_SESSION_DEFAULT_GLOBAL_KEY=Symbol.for(`eve.runtime-session-default`),globalContainer=globalThis;globalContainer[RUNTIME_SESSION_STORAGE_GLOBAL_KEY]===void 0&&(globalContainer[RUNTIME_SESSION_STORAGE_GLOBAL_KEY]=new AsyncLocalStorage);const runtimeSessionStorage=globalContainer[RUNTIME_SESSION_STORAGE_GLOBAL_KEY];function resolveProcessDefaultSession(){return globalContainer[RUNTIME_SESSION_DEFAULT_GLOBAL_KEY]===void 0&&(globalContainer[RUNTIME_SESSION_DEFAULT_GLOBAL_KEY]=createRuntimeSession(`process-default`)),globalContainer[RUNTIME_SESSION_DEFAULT_GLOBAL_KEY]}function getActiveRuntimeSession(){return runtimeSessionStorage.getStore()??resolveProcessDefaultSession()}async function withRuntimeSession(e,t){return await runtimeSessionStorage.run(e,async()=>await t())}export{createRuntimeSession,getActiveRuntimeSession,setRuntimeSessionCompiledArtifacts,withRuntimeSession};
|
|
1
|
+
import{AsyncLocalStorage}from"node:async_hooks";function createRuntimeSession(e=`test-session`){return{bundleCache:new Map,bundleCacheKeyBySourceKey:new Map,compiledArtifacts:null,id:e}}function setRuntimeSessionCompiledArtifacts(e,t){let n=e.compiledArtifacts;(n===null||!isSameCompiledArtifactSnapshot(n,t))&&(e.bundleCache.clear(),e.bundleCacheKeyBySourceKey.clear()),e.compiledArtifacts=t}function isSameCompiledArtifactSnapshot(e,t){let n=e.metadata?.discovery.sourceGraphHash,r=t.metadata?.discovery.sourceGraphHash;return n&&r?n===r&&JSON.stringify(e.sandboxPreparedArtifacts)===JSON.stringify(t.sandboxPreparedArtifacts):e.manifest===t.manifest&&e.moduleMap===t.moduleMap&&e.metadata===t.metadata}const RUNTIME_SESSION_STORAGE_GLOBAL_KEY=Symbol.for(`eve.runtime-session-storage`),RUNTIME_SESSION_DEFAULT_GLOBAL_KEY=Symbol.for(`eve.runtime-session-default`),globalContainer=globalThis;globalContainer[RUNTIME_SESSION_STORAGE_GLOBAL_KEY]===void 0&&(globalContainer[RUNTIME_SESSION_STORAGE_GLOBAL_KEY]=new AsyncLocalStorage);const runtimeSessionStorage=globalContainer[RUNTIME_SESSION_STORAGE_GLOBAL_KEY];function resolveProcessDefaultSession(){return globalContainer[RUNTIME_SESSION_DEFAULT_GLOBAL_KEY]===void 0&&(globalContainer[RUNTIME_SESSION_DEFAULT_GLOBAL_KEY]=createRuntimeSession(`process-default`)),globalContainer[RUNTIME_SESSION_DEFAULT_GLOBAL_KEY]}function getActiveRuntimeSession(){return runtimeSessionStorage.getStore()??resolveProcessDefaultSession()}async function withRuntimeSession(e,t){return await runtimeSessionStorage.run(e,async()=>await t())}export{createRuntimeSession,getActiveRuntimeSession,setRuntimeSessionCompiledArtifacts,withRuntimeSession};
|