eve 0.81.1 → 0.83.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +93 -0
- package/NOTICE +1 -1
- package/dist/src/channel/channel-address.d.ts +21 -2
- package/dist/src/channel/channel-address.js +1 -1
- package/dist/src/channel/channel-operations.d.ts +32 -1
- package/dist/src/channel/channel-operations.js +1 -1
- package/dist/src/channel/delivery-idempotency.d.ts +4 -0
- package/dist/src/channel/delivery-idempotency.js +1 -0
- package/dist/src/channel/pending-authorization.d.ts +5 -0
- package/dist/src/channel/pending-authorization.js +1 -1
- package/dist/src/channel/routes.d.ts +6 -0
- package/dist/src/channel/session.d.ts +7 -0
- package/dist/src/channel/session.js +1 -1
- package/dist/src/channel/types.d.ts +19 -11
- package/dist/src/chunks/{use-eve-agent-DLkjJIm3.js → use-eve-agent-3-WRmJkd.js} +76 -5
- package/dist/src/chunks/{use-eve-agent-Bp6nbhfV.js → use-eve-agent-Ci5dr0aR.js} +76 -5
- package/dist/src/cli/dev/command-options.d.ts +1 -0
- package/dist/src/cli/dev/diagnostic-dump.js +1 -1
- package/dist/src/cli/dev/local-server-child.js +1 -1
- package/dist/src/cli/dev/local-server-cleanup.js +1 -1
- package/dist/src/cli/dev/tui/question-panel.d.ts +4 -1
- package/dist/src/cli/dev/tui/question-panel.js +1 -1
- package/dist/src/cli/dev/tui/terminal-renderer.js +4 -4
- package/dist/src/cli/run.d.ts +1 -0
- package/dist/src/cli/run.js +1 -1
- package/dist/src/client/eve-agent-store.d.ts +1 -1
- package/dist/src/client/eve-agent-store.js +1 -1
- package/dist/src/client/index.d.ts +2 -1
- package/dist/src/client/message-reducer-types.d.ts +7 -3
- package/dist/src/client/message-reducer.js +1 -1
- package/dist/src/client/session-controls.d.ts +6 -0
- package/dist/src/client/session-controls.js +1 -1
- package/dist/src/client/session.d.ts +4 -0
- package/dist/src/client/session.js +1 -1
- package/dist/src/client/transcript-reducer.d.ts +6 -3
- package/dist/src/client/transcript-reducer.js +1 -1
- package/dist/src/compiled/.vendor-stamp.json +8 -8
- package/dist/src/compiled/@eve/catalog/index.js +1 -1
- package/dist/src/compiled/@workflow/core/events-consumer.d.ts +2 -0
- package/dist/src/compiled/@workflow/core/index.js +2 -2
- package/dist/src/compiled/@workflow/core/private.d.ts +5 -3
- package/dist/src/compiled/@workflow/core/private.js +1 -1
- package/dist/src/compiled/@workflow/core/runtime/constants.d.ts +1 -37
- package/dist/src/compiled/@workflow/core/runtime/event-limit-warning.d.ts +32 -0
- package/dist/src/compiled/@workflow/core/runtime/helpers.d.ts +5 -6
- package/dist/src/compiled/@workflow/core/runtime/helpers.js +1 -1
- package/dist/src/compiled/@workflow/core/runtime/runs.d.ts +8 -0
- package/dist/src/compiled/@workflow/core/runtime/start.d.ts +16 -0
- package/dist/src/compiled/@workflow/core/runtime/suspension-handler.d.ts +15 -18
- package/dist/src/compiled/@workflow/core/runtime/vm-mode.d.ts +20 -0
- package/dist/src/compiled/@workflow/core/runtime.js +4 -4
- package/dist/src/compiled/@workflow/core/seeded-nanoid.d.ts +2 -0
- package/dist/src/compiled/@workflow/core/serialization/compression.d.ts +14 -3
- package/dist/src/compiled/@workflow/core/serialization.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/serialization.js +1 -1
- package/dist/src/compiled/@workflow/core/telemetry/semantic-conventions.d.ts +0 -18
- package/dist/src/compiled/@workflow/core/version.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/workflow.js +1 -1
- package/dist/src/compiled/@workflow/errors/index.d.ts +48 -0
- package/dist/src/compiled/@workflow/errors/index.js +1 -1
- package/dist/src/compiled/@workflow/world/env-config.d.ts +24 -0
- package/dist/src/compiled/@workflow/world/events.d.ts +126 -7
- package/dist/src/compiled/@workflow/world/index.d.ts +3 -3
- package/dist/src/compiled/@workflow/world/interfaces.d.ts +59 -8
- package/dist/src/compiled/@workflow/world/queue.d.ts +71 -9
- package/dist/src/compiled/@workflow/world/recovery.d.ts +6 -0
- package/dist/src/compiled/@workflow/world/test-support/duplicate-event-fixtures.d.ts +3 -0
- package/dist/src/compiled/@workflow/world/test-support/in-band-fence-conformance.d.ts +46 -0
- package/dist/src/compiled/@workflow/world-local/index.js +5 -5
- package/dist/src/compiled/@workflow/world-vercel/index.js +18 -18
- package/dist/src/compiled/_chunks/workflow/{attribute-changes-BW-kbMMn.js → attribute-changes-7se_SE2q.js} +3 -3
- package/dist/src/compiled/_chunks/workflow/dist-CcnNPAp4.js +1 -0
- package/dist/src/compiled/_chunks/workflow/dist-S9cZRway.js +3 -0
- package/dist/src/compiled/_chunks/workflow/helpers-CxNRXH0a.js +1 -0
- package/dist/src/compiled/_chunks/workflow/private-DLYTSBbu.js +1 -0
- package/dist/src/compiled/_chunks/workflow/resume-hook-CPiIfe8r.js +1 -0
- package/dist/src/compiled/_chunks/workflow/{run-DzdAqdb1.js → run-BJSLCXR4.js} +6 -6
- package/dist/src/compiled/_chunks/workflow/serialization-B9gneT9Z.js +15 -0
- package/dist/src/compiled/_chunks/workflow/sleep-BL0oQs3R.js +1 -0
- package/dist/src/compiled/_chunks/workflow/{wait-until-xbRRDuUf.js → wait-until-BPou0RGO.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/workflow-routes-BaljomCk.js +1 -0
- package/dist/src/compiled/{@ai-sdk/code-mode → run}/LICENSE +1 -1
- package/dist/src/compiled/run/index.d.ts +384 -0
- package/dist/src/compiled/run/index.js +650 -0
- package/dist/src/compiler/extension-compatibility.d.ts +28 -20
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/compiler/load-binding-namespace.d.ts +2 -0
- package/dist/src/compiler/load-binding-namespace.js +1 -1
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/module-lifecycle.d.ts +1 -1
- package/dist/src/compiler/module-lifecycle.js +1 -1
- package/dist/src/compiler/module-map.js +1 -1
- package/dist/src/compiler/normalize-agent-config.js +1 -1
- package/dist/src/compiler/normalize-manifest.js +1 -1
- package/dist/src/compiler/normalize-sandbox.js +1 -1
- package/dist/src/compiler/project-sources.d.ts +6 -0
- package/dist/src/compiler/project-sources.js +1 -1
- package/dist/src/compiler/workspace-resources.js +1 -1
- package/dist/src/context/build-callback-context.js +1 -1
- package/dist/src/context/dynamic-skill-lifecycle.js +1 -1
- package/dist/src/context/keys.d.ts +2 -0
- package/dist/src/context/keys.js +1 -1
- package/dist/src/context/providers/sandbox.js +1 -1
- package/dist/src/discover/extension-specifier.d.ts +1 -0
- package/dist/src/discover/extension-specifier.js +1 -1
- package/dist/src/evals/cli/eval-state-directory.d.ts +7 -0
- package/dist/src/evals/cli/eval-state-directory.js +1 -0
- package/dist/src/evals/cli/eval.js +2 -2
- package/dist/src/evals/runner/artifacts.js +1 -1
- package/dist/src/evals/runner/derive-run-facts.d.ts +12 -0
- package/dist/src/evals/runner/derive-run-facts.js +1 -1
- package/dist/src/evals/runner/execute-task.js +1 -1
- package/dist/src/evals/types.d.ts +3 -2
- package/dist/src/eve-channel/index.js +1 -1
- package/dist/src/eve-channel/request.d.ts +0 -1
- package/dist/src/eve-channel/request.js +2 -2
- package/dist/src/eve-channel/support.d.ts +2 -0
- package/dist/src/eve-channel/support.js +1 -1
- package/dist/src/eve-channel/types.d.ts +7 -0
- package/dist/src/execution/agent-sessions/context.d.ts +3 -14
- package/dist/src/execution/agent-sessions/context.js +1 -1
- package/dist/src/execution/agent-sessions/runtime-overrides.d.ts +5 -0
- package/dist/src/execution/agent-sessions/session.d.ts +2 -2
- package/dist/src/execution/agent-sessions/session.js +1 -1
- package/dist/src/execution/agent-sessions/steps.d.ts +2 -0
- package/dist/src/execution/agent-sessions/steps.js +1 -1
- package/dist/src/execution/coordination-dispatch-shared.d.ts +8 -5
- package/dist/src/execution/coordination-dispatch-shared.js +1 -1
- package/dist/src/execution/coordination-dispatch-step.d.ts +17 -2
- package/dist/src/execution/coordination-dispatch-step.js +1 -1
- package/dist/src/execution/create-session-step.d.ts +5 -2
- package/dist/src/execution/create-session-step.js +1 -1
- package/dist/src/execution/deliver-payloads.js +1 -1
- package/dist/src/execution/durable-session-store.d.ts +0 -1
- package/dist/src/execution/dynamic-connection-recovery.js +1 -1
- package/dist/src/execution/dynamic-workflow/program-step.d.ts +7 -7
- package/dist/src/execution/dynamic-workflow/program-step.js +1 -1
- package/dist/src/execution/dynamic-workflow/schema.d.ts +18 -11
- package/dist/src/execution/dynamic-workflow/schema.js +1 -1
- package/dist/src/execution/dynamic-workflow/tool.js +1 -1
- package/dist/src/execution/dynamic-workflow/workflow.js +1 -1
- package/dist/src/execution/effective-agent-config.d.ts +8 -2
- package/dist/src/execution/effective-agent-config.js +1 -1
- package/dist/src/execution/eve-workflow-attributes.d.ts +3 -1
- package/dist/src/execution/eve-workflow-attributes.js +1 -1
- package/dist/src/execution/install-workflow-deployment-id.d.ts +3 -0
- package/dist/src/execution/install-workflow-deployment-id.js +1 -0
- package/dist/src/execution/invoke-tool.js +1 -1
- package/dist/src/execution/legacy-session/turn-workflow.js +1 -1
- package/dist/src/execution/node-step.d.ts +1 -0
- package/dist/src/execution/node-step.js +1 -1
- package/dist/src/execution/runtime-context.d.ts +2 -0
- package/dist/src/execution/runtime-context.js +1 -1
- package/dist/src/execution/sandbox/abort-bound-session.js +1 -1
- package/dist/src/execution/sandbox/active-connections.d.ts +28 -0
- package/dist/src/execution/sandbox/active-connections.js +1 -0
- package/dist/src/execution/sandbox/bindings/docker-cli.d.ts +10 -2
- package/dist/src/execution/sandbox/bindings/docker-cli.js +2 -2
- package/dist/src/execution/sandbox/bindings/docker-connection.d.ts +15 -0
- package/dist/src/execution/sandbox/bindings/docker-connection.js +2 -0
- package/dist/src/execution/sandbox/bindings/docker-container.d.ts +2 -0
- package/dist/src/execution/sandbox/bindings/docker-container.js +1 -1
- package/dist/src/execution/sandbox/bindings/docker-network.d.ts +5 -0
- package/dist/src/execution/sandbox/bindings/docker-network.js +1 -1
- package/dist/src/execution/sandbox/bindings/docker-templates.js +1 -1
- package/dist/src/execution/sandbox/bindings/docker.d.ts +12 -15
- package/dist/src/execution/sandbox/bindings/docker.js +1 -1
- package/dist/src/execution/sandbox/bindings/just-bash-runtime.d.ts +19 -29
- package/dist/src/execution/sandbox/bindings/just-bash-runtime.js +1 -1
- package/dist/src/execution/sandbox/bindings/just-bash.d.ts +2 -4
- package/dist/src/execution/sandbox/bindings/just-bash.js +1 -1
- package/dist/src/execution/sandbox/bindings/local-provider-utils.d.ts +0 -20
- package/dist/src/execution/sandbox/bindings/local-provider-utils.js +1 -1
- package/dist/src/execution/sandbox/bindings/local.d.ts +4 -6
- package/dist/src/execution/sandbox/bindings/local.js +1 -1
- package/dist/src/execution/sandbox/bindings/vercel-base-runtime.d.ts +2 -0
- package/dist/src/execution/sandbox/bindings/vercel-base-runtime.js +2 -2
- package/dist/src/execution/sandbox/bindings/vercel-errors.js +2 -2
- package/dist/src/execution/sandbox/bindings/vercel-lifecycle.d.ts +7 -5
- package/dist/src/execution/sandbox/bindings/vercel-lifecycle.js +1 -1
- package/dist/src/execution/sandbox/bindings/vercel.d.ts +5 -11
- package/dist/src/execution/sandbox/bindings/vercel.js +1 -2
- package/dist/src/execution/sandbox/development-cleanup.d.ts +0 -1
- package/dist/src/execution/sandbox/development-cleanup.js +1 -1
- package/dist/src/execution/sandbox/development-lazy-prewarm.js +1 -1
- package/dist/src/execution/sandbox/development-run.d.ts +0 -2
- package/dist/src/execution/sandbox/development-run.js +1 -1
- package/dist/src/execution/sandbox/dockerfile.d.ts +0 -4
- package/dist/src/execution/sandbox/dockerfile.js +1 -1
- package/dist/src/execution/sandbox/ensure.d.ts +23 -11
- package/dist/src/execution/sandbox/ensure.js +1 -1
- package/dist/src/execution/sandbox/glob-tool.js +3 -3
- package/dist/src/execution/sandbox/grep-tool.js +1 -1
- package/dist/src/execution/sandbox/logging-session.js +1 -1
- package/dist/src/execution/sandbox/prewarm.d.ts +23 -3
- package/dist/src/execution/sandbox/prewarm.js +2 -1
- package/dist/src/execution/sandbox/read-file.js +1 -1
- package/dist/src/execution/sandbox/require-sandbox.d.ts +3 -2
- package/dist/src/execution/sandbox/require-sandbox.js +1 -1
- package/dist/src/execution/sandbox/ripgrep-probe.js +1 -1
- package/dist/src/execution/sandbox/session.d.ts +10 -20
- package/dist/src/execution/sandbox/session.js +2 -2
- package/dist/src/execution/session/active-turn.js +1 -1
- package/dist/src/execution/session/admission.js +1 -1
- package/dist/src/execution/session/checkpoint-migrations.js +1 -1
- package/dist/src/execution/session/entry-input.d.ts +5 -6
- package/dist/src/execution/session/entry.js +1 -1
- package/dist/src/execution/session/finalization.js +1 -1
- package/dist/src/execution/session/handoff-state.d.ts +5 -0
- package/dist/src/execution/session/handoff-state.js +1 -0
- package/dist/src/execution/session/handoff-steps.d.ts +0 -5
- package/dist/src/execution/session/handoff-steps.js +1 -1
- package/dist/src/execution/session/handoff.d.ts +7 -9
- package/dist/src/execution/session/handoff.js +1 -1
- package/dist/src/execution/session/input-queue.d.ts +8 -1
- package/dist/src/execution/session/input-queue.js +1 -1
- package/dist/src/execution/session/next-input.d.ts +3 -0
- package/dist/src/execution/session/next-input.js +1 -1
- package/dist/src/execution/session/pending-history.d.ts +5 -0
- package/dist/src/execution/session/pending-history.js +1 -0
- package/dist/src/execution/session/pending-turn-state.js +1 -1
- package/dist/src/execution/session/program.d.ts +1 -1
- package/dist/src/execution/session/program.js +1 -1
- package/dist/src/execution/session/timeout-control.d.ts +22 -4
- package/dist/src/execution/session/timeout-control.js +1 -1
- package/dist/src/execution/session/timeout.d.ts +1 -2
- package/dist/src/execution/session/timeout.js +1 -1
- package/dist/src/execution/session/turn-control.d.ts +5 -2
- package/dist/src/execution/session/turn-control.js +1 -1
- package/dist/src/execution/session/turn-event-handler.js +1 -1
- package/dist/src/execution/session/turn-step-result.js +1 -1
- package/dist/src/execution/session/turn-step.js +1 -1
- package/dist/src/execution/session/turn-waiting-step.js +1 -1
- package/dist/src/execution/session/turn.js +1 -1
- package/dist/src/execution/session-inbox/inbox.d.ts +9 -1
- package/dist/src/execution/session-inbox/inbox.js +1 -1
- package/dist/src/execution/session-inbox/protocol.d.ts +2 -1
- package/dist/src/execution/session-inbox/protocol.js +1 -1
- package/dist/src/execution/session-inbox/resume.d.ts +2 -1
- package/dist/src/execution/session-inbox/resume.js +1 -1
- package/dist/src/execution/session-prewarm.d.ts +8 -0
- package/dist/src/execution/session-prewarm.js +1 -0
- package/dist/src/execution/session.d.ts +0 -12
- package/dist/src/execution/session.js +2 -2
- package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
- package/dist/src/execution/skills/instructions.js +1 -1
- package/dist/src/execution/tasks/model-step.js +1 -1
- package/dist/src/execution/tasks/start.d.ts +4 -4
- package/dist/src/execution/tasks/start.js +1 -1
- package/dist/src/execution/tasks/steps.js +1 -1
- package/dist/src/execution/terminate-child-sessions-step.js +1 -1
- package/dist/src/execution/tools/agent-router-workflow.js +1 -1
- package/dist/src/execution/tools/workflow/body.d.ts +2 -2
- package/dist/src/execution/tools/workflow/body.js +1 -1
- package/dist/src/execution/tools/workflow/step-context.d.ts +11 -0
- package/dist/src/execution/tools/workflow/step-execution.js +1 -1
- package/dist/src/execution/tools/workflow/step.js +1 -1
- package/dist/src/execution/workflow-runtime.d.ts +5 -1
- package/dist/src/execution/workflow-runtime.js +1 -1
- package/dist/src/extensions/git/extension/lib/github-shell-schema.js +1 -1
- package/dist/src/framework/sources/modules/sandbox.d.ts +1 -1
- package/dist/src/harness/attachment-staging.d.ts +0 -7
- package/dist/src/harness/attachment-staging.js +1 -1
- package/dist/src/harness/hitl/approvals.js +1 -1
- package/dist/src/harness/hitl/budget-request.d.ts +12 -6
- package/dist/src/harness/hitl/budget-request.js +1 -1
- package/dist/src/harness/hitl/budget.d.ts +7 -1
- package/dist/src/harness/hitl/budget.js +1 -1
- package/dist/src/harness/hitl/coordinator.js +1 -1
- package/dist/src/harness/hitl/delivery.d.ts +1 -1
- package/dist/src/harness/hitl/delivery.js +1 -1
- package/dist/src/harness/hitl/index.d.ts +2 -1
- package/dist/src/harness/hitl/index.js +1 -1
- package/dist/src/harness/hitl/intake.d.ts +2 -2
- package/dist/src/harness/hitl/intake.js +1 -1
- package/dist/src/harness/hitl/view.d.ts +1 -0
- package/dist/src/harness/hitl/view.js +1 -0
- package/dist/src/harness/messages.d.ts +5 -0
- package/dist/src/harness/messages.js +1 -1
- package/dist/src/harness/model-call/call.d.ts +2 -2
- package/dist/src/harness/model-call/request.d.ts +2 -2
- package/dist/src/harness/model-call/run.js +1 -1
- package/dist/src/harness/semantic-errors/rules/sandbox.d.ts +3 -5
- package/dist/src/harness/semantic-errors/rules/sandbox.js +1 -1
- package/dist/src/harness/session-machine/transitions.d.ts +3 -1
- package/dist/src/harness/session-machine/transitions.js +1 -1
- package/dist/src/harness/step/context.d.ts +3 -0
- package/dist/src/harness/step/context.js +1 -1
- package/dist/src/harness/step/intake.d.ts +5 -2
- package/dist/src/harness/step/intake.js +1 -1
- package/dist/src/harness/step/prompt.js +1 -1
- package/dist/src/harness/tool-history-repair.d.ts +9 -0
- package/dist/src/harness/tool-history-repair.js +1 -0
- package/dist/src/harness/tool-loop.js +1 -1
- package/dist/src/harness/tool-model-output.d.ts +19 -3
- package/dist/src/harness/tool-model-output.js +1 -1
- package/dist/src/harness/turn-tag-state.d.ts +7 -26
- package/dist/src/harness/turn-tag-state.js +1 -1
- package/dist/src/harness/types.d.ts +10 -25
- package/dist/src/internal/application/build-profile.d.ts +3 -0
- package/dist/src/internal/application/build-profile.js +1 -1
- package/dist/src/internal/application/compiled-artifacts.js +10 -6
- package/dist/src/internal/application/dev-environment.d.ts +13 -0
- package/dist/src/internal/application/dev-environment.js +1 -1
- package/dist/src/internal/application/optional-package-import.d.ts +10 -0
- package/dist/src/internal/application/optional-package-import.js +1 -1
- package/dist/src/internal/application/stamped-package-version.js +1 -1
- package/dist/src/internal/attachments/limited-read.d.ts +2 -2
- package/dist/src/internal/authored-definition/core.js +1 -1
- package/dist/src/internal/authored-module-build-options.d.ts +13 -0
- package/dist/src/internal/authored-module-build-options.js +1 -0
- package/dist/src/internal/authored-module-cache.d.ts +10 -0
- package/dist/src/internal/authored-module-cache.js +1 -0
- package/dist/src/internal/authored-module-graph.d.ts +13 -0
- package/dist/src/internal/authored-module-graph.js +1 -0
- package/dist/src/internal/authored-module-loader.d.ts +22 -1
- package/dist/src/internal/authored-module-loader.js +1 -3
- package/dist/src/internal/authored-module.d.ts +7 -0
- package/dist/src/internal/authored-module.js +1 -1
- package/dist/src/internal/authored-package-boundary.js +1 -1
- package/dist/src/internal/authored-relative-extension-resolver.js +1 -1
- package/dist/src/internal/bundler/nitro-rolldown.d.ts +8 -2
- package/dist/src/internal/bundler/nitro-rolldown.js +1 -1
- package/dist/src/internal/bundler/pseudo-packages.d.ts +11 -0
- package/dist/src/internal/bundler/pseudo-packages.js +1 -0
- package/dist/src/internal/development-programmatic-source-loader.d.ts +1 -0
- package/dist/src/internal/development-programmatic-source-loader.js +1 -1
- package/dist/src/internal/nitro/dev-runtime-artifacts.js +1 -1
- package/dist/src/internal/nitro/dev-runtime-generation-metadata.js +1 -1
- package/dist/src/internal/nitro/host/build-application.js +1 -1
- package/dist/src/internal/nitro/host/build-deployment-id.d.ts +8 -0
- package/dist/src/internal/nitro/host/build-deployment-id.js +1 -0
- package/dist/src/internal/nitro/host/build-extension.d.ts +6 -0
- package/dist/src/internal/nitro/host/build-extension.js +2 -2
- package/dist/src/internal/nitro/host/compiled-sandbox-provider-prune-plugin.d.ts +3 -1
- package/dist/src/internal/nitro/host/compiled-sandbox-provider-prune-plugin.js +3 -5
- package/dist/src/internal/nitro/host/create-application-nitro.d.ts +2 -3
- package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
- package/dist/src/internal/nitro/host/dev-authored-rebuild-coordinator.d.ts +2 -0
- package/dist/src/internal/nitro/host/dev-authored-rebuild-coordinator.js +1 -1
- package/dist/src/internal/nitro/host/dev-authored-source-watcher.js +1 -1
- package/dist/src/internal/nitro/host/dev-build-host.d.ts +83 -0
- package/dist/src/internal/nitro/host/dev-build-host.js +1 -0
- package/dist/src/internal/nitro/host/dev-build-operations.d.ts +6 -0
- package/dist/src/internal/nitro/host/dev-build-operations.js +1 -0
- package/dist/src/internal/nitro/host/dev-build-process.d.ts +1 -0
- package/dist/src/internal/nitro/host/dev-build-process.js +1 -0
- package/dist/src/internal/nitro/host/dev-server-state.js +1 -1
- package/dist/src/internal/nitro/host/development-runtime-prune-plugin.d.ts +4 -1
- package/dist/src/internal/nitro/host/development-runtime-prune-plugin.js +3 -2
- package/dist/src/internal/nitro/host/drained-nitro-dev-server.d.ts +13 -0
- package/dist/src/internal/nitro/host/drained-nitro-dev-server.js +1 -1
- package/dist/src/internal/nitro/host/optional-engine-dependency-plugin.js +1 -1
- package/dist/src/internal/nitro/host/prepare-application-host.d.ts +3 -0
- package/dist/src/internal/nitro/host/prepare-application-host.js +1 -1
- package/dist/src/internal/nitro/host/sandbox-shutdown-plugin.js +1 -1
- package/dist/src/internal/nitro/host/skill-server-assets.js +1 -1
- package/dist/src/internal/nitro/host/stage-build-deployment-id.d.ts +2 -0
- package/dist/src/internal/nitro/host/stage-build-deployment-id.js +1 -0
- package/dist/src/internal/nitro/host/start-development-server.js +2 -2
- package/dist/src/internal/nitro/host/start-production-server.d.ts +1 -0
- package/dist/src/internal/nitro/host/start-production-server.js +3 -3
- package/dist/src/internal/nitro/host/workflow-sandbox-runtime-plugin.js +1 -1
- package/dist/src/internal/nitro/host.js +1 -1
- package/dist/src/internal/nitro/routes/schedule-task.d.ts +3 -0
- package/dist/src/internal/nitro/routes/schedule-task.js +1 -1
- package/dist/src/internal/programmatic-source-loader.d.ts +1 -0
- package/dist/src/internal/programmatic-source-loader.js +1 -1
- package/dist/src/internal/schedules/disabled.d.ts +2 -0
- package/dist/src/internal/schedules/disabled.js +1 -0
- package/dist/src/internal/workflow/development-world-server.js +1 -1
- package/dist/src/internal/workflow/local-world-data-directory.d.ts +2 -1
- package/dist/src/internal/workflow/local-world-data-directory.js +1 -1
- package/dist/src/internal/workflow/local-world-delivery-auth.d.ts +17 -0
- package/dist/src/internal/workflow/local-world-delivery-auth.js +1 -0
- package/dist/src/internal/workflow/queue-namespace.d.ts +2 -0
- package/dist/src/internal/workflow/queue-namespace.js +1 -1
- package/dist/src/internal/workflow-bundle/builder-support.d.ts +0 -1
- package/dist/src/internal/workflow-bundle/builder-support.js +2 -2
- package/dist/src/internal/workflow-bundle/builder.js +2 -2
- package/dist/src/internal/workflow-bundle/vercel-workflow-output.d.ts +1 -1
- package/dist/src/internal/workflow-bundle/vercel-workflow-output.js +1 -1
- package/dist/src/protocol/message.d.ts +27 -1
- package/dist/src/protocol/message.js +2 -2
- package/dist/src/protocol/prewarm-session.d.ts +14 -0
- package/dist/src/protocol/prewarm-session.js +1 -0
- package/dist/src/protocol/routes.d.ts +2 -2
- package/dist/src/public/channels/chat-sdk/chatSdkChannel.d.ts +13 -0
- package/dist/src/public/channels/chat-sdk/chatSdkChannel.js +2 -2
- package/dist/src/public/channels/chat-sdk/fetch-message.d.ts +10 -0
- package/dist/src/public/channels/chat-sdk/fetch-message.js +1 -0
- package/dist/src/public/channels/chat-sdk/index.d.ts +1 -1
- package/dist/src/public/channels/chat-sdk/reply-context.d.ts +15 -0
- package/dist/src/public/channels/chat-sdk/reply-context.js +2 -0
- package/dist/src/public/channels/discord/authorization.d.ts +45 -0
- package/dist/src/public/channels/discord/authorization.js +3 -0
- package/dist/src/public/channels/discord/defaults.d.ts +14 -3
- package/dist/src/public/channels/discord/defaults.js +2 -2
- package/dist/src/public/channels/discord/discordChannel.d.ts +18 -1
- package/dist/src/public/channels/discord/discordChannel.js +1 -1
- package/dist/src/public/channels/discord/gateway/connection.d.ts +26 -0
- package/dist/src/public/channels/discord/gateway/connection.js +1 -0
- package/dist/src/public/channels/discord/gateway/forwarder.d.ts +14 -0
- package/dist/src/public/channels/discord/gateway/forwarder.js +1 -0
- package/dist/src/public/channels/discord/gateway/index.d.ts +59 -0
- package/dist/src/public/channels/discord/gateway/index.js +1 -0
- package/dist/src/public/channels/discord/inbound.d.ts +10 -3
- package/dist/src/public/channels/discord/inbound.js +2 -2
- package/dist/src/public/channels/discord/index.d.ts +3 -2
- package/dist/src/public/channels/discord/index.js +1 -1
- package/dist/src/public/channels/discord/messages.d.ts +116 -0
- package/dist/src/public/channels/discord/messages.js +2 -0
- package/dist/src/public/channels/github/checkout.js +1 -1
- package/dist/src/public/channels/github/dispatch.js +1 -1
- package/dist/src/public/channels/github/githubChannel.d.ts +3 -0
- package/dist/src/public/channels/imessage-tapbacks.d.ts +74 -0
- package/dist/src/public/channels/imessage-tapbacks.js +1 -0
- package/dist/src/public/channels/index.d.ts +2 -1
- package/dist/src/public/channels/index.js +1 -1
- package/dist/src/public/channels/linear/linearChannel.d.ts +3 -0
- package/dist/src/public/channels/linear/linearChannel.js +1 -1
- package/dist/src/public/channels/linq/inboundContent.d.ts +7 -0
- package/dist/src/public/channels/linq/inboundContent.js +1 -1
- package/dist/src/public/channels/linq/index.d.ts +1 -0
- package/dist/src/public/channels/linq/index.js +1 -1
- package/dist/src/public/channels/linq/linqChannel.d.ts +21 -2
- package/dist/src/public/channels/linq/linqChannel.js +1 -1
- package/dist/src/public/channels/photon/inboundContent.d.ts +7 -0
- package/dist/src/public/channels/photon/inboundContent.js +2 -1
- package/dist/src/public/channels/photon/index.d.ts +1 -0
- package/dist/src/public/channels/photon/index.js +1 -1
- package/dist/src/public/channels/photon/photonIMessageChannel.d.ts +17 -1
- package/dist/src/public/channels/photon/photonIMessageChannel.js +1 -1
- package/dist/src/public/channels/same-environment-oidc.d.ts +7 -0
- package/dist/src/public/channels/same-environment-oidc.js +1 -0
- package/dist/src/public/channels/slack/api.d.ts +6 -0
- package/dist/src/public/channels/slack/api.js +1 -1
- package/dist/src/public/channels/slack/model-context.d.ts +7 -0
- package/dist/src/public/channels/slack/model-context.js +1 -1
- package/dist/src/public/channels/slack/reply-delivery.d.ts +5 -0
- package/dist/src/public/channels/slack/reply-delivery.js +1 -1
- package/dist/src/public/channels/slack/slackChannel.d.ts +17 -3
- package/dist/src/public/channels/slack/slackChannel.js +1 -1
- package/dist/src/public/channels/teams/teamsChannel.d.ts +3 -0
- package/dist/src/public/channels/teams/teamsChannel.js +1 -1
- package/dist/src/public/channels/telegram/telegramChannel.d.ts +3 -0
- package/dist/src/public/channels/telegram/telegramChannel.js +1 -1
- package/dist/src/public/definitions/agent.d.ts +1 -1
- package/dist/src/public/definitions/channel.d.ts +2 -2
- package/dist/src/public/definitions/channel.js +1 -1
- package/dist/src/public/definitions/hook.d.ts +1 -0
- package/dist/src/public/definitions/sandbox.d.ts +1 -1
- package/dist/src/public/index.d.ts +1 -1
- package/dist/src/public/next/server.js +1 -1
- package/dist/src/public/sandbox/docker-sandbox.d.ts +6 -1
- package/dist/src/public/sandbox/docker.d.ts +1 -8
- package/dist/src/public/sandbox/index.d.ts +3 -3
- package/dist/src/public/sandbox/just-bash-sandbox.d.ts +87 -7
- package/dist/src/public/sandbox/just-bash.d.ts +1 -1
- package/dist/src/public/sandbox/provider.d.ts +5 -1
- package/dist/src/public/sandbox/provider.js +1 -1
- package/dist/src/public/sandbox/vercel-sandbox.d.ts +16 -9
- package/dist/src/public/sandbox/vercel.d.ts +0 -1
- package/dist/src/public/sandbox/vercel.js +1 -1
- package/dist/src/public/tools/agent.d.ts +8 -1
- package/dist/src/public/tools/agent.js +1 -1
- package/dist/src/public/tools/index.d.ts +1 -1
- package/dist/src/react/use-eve-agent.d.ts +1 -1
- package/dist/src/runtime/agent/resolve-model.d.ts +4 -0
- package/dist/src/runtime/agent/resolve-model.js +1 -1
- package/dist/src/runtime/connections/openapi-client.d.ts +2 -0
- package/dist/src/runtime/connections/openapi-client.js +1 -1
- package/dist/src/runtime/resolve-agent-graph.js +1 -1
- package/dist/src/runtime/resolve-agent.js +1 -1
- package/dist/src/runtime/resolve-channel.js +1 -1
- package/dist/src/runtime/resolve-sandbox.js +1 -1
- package/dist/src/runtime/sandbox/prepared-artifacts.js +1 -1
- package/dist/src/runtime/sandbox/registry.d.ts +2 -0
- package/dist/src/runtime/sandbox/registry.js +1 -1
- package/dist/src/runtime/sessions/compiled-agent-cache.js +1 -1
- package/dist/src/runtime/subagents/dynamic-agent-config.d.ts +2 -1
- package/dist/src/runtime/subagents/dynamic-agent-config.js +1 -1
- package/dist/src/runtime/subagents/workflow.d.ts +6 -0
- package/dist/src/runtime/subagents/workflow.js +1 -1
- package/dist/src/runtime/types.d.ts +3 -2
- package/dist/src/runtime/workspace/seed-files.d.ts +9 -12
- package/dist/src/runtime/workspace/seed-files.js +1 -1
- package/dist/src/runtime/workspace/spec.d.ts +1 -1
- package/dist/src/runtime/workspace/spec.js +1 -1
- package/dist/src/runtime/workspace/types.d.ts +2 -6
- package/dist/src/sandbox/provider.d.ts +185 -0
- package/dist/src/sandbox/provider.js +1 -0
- package/dist/src/sandbox/providers/default.d.ts +20 -19
- package/dist/src/sandbox/providers/default.js +1 -1
- package/dist/src/sandbox/providers/docker.d.ts +5 -2
- package/dist/src/sandbox/providers/docker.js +1 -1
- package/dist/src/sandbox/providers/just-bash.d.ts +4 -3
- package/dist/src/sandbox/providers/just-bash.js +1 -1
- package/dist/src/sandbox/providers/vercel.d.ts +4 -10
- package/dist/src/sandbox/providers/vercel.js +1 -1
- package/dist/src/sandbox/providers.d.ts +0 -1
- package/dist/src/sandbox/providers.js +1 -1
- package/dist/src/sandbox/state.d.ts +44 -0
- package/dist/src/sandbox/state.js +1 -1
- package/dist/src/self-modification/deployed-sandbox.d.ts +4 -9
- package/dist/src/self-modification/deployed-sandbox.js +1 -1
- package/dist/src/self-modification/filesystem.d.ts +3 -3
- package/dist/src/self-modification/remote/config.d.ts +2 -2
- package/dist/src/self-modification/remote/config.js +1 -1
- package/dist/src/self-modification/setup.d.ts +0 -1
- package/dist/src/self-modification/setup.js +8 -8
- package/dist/src/setup/integrations/discord/api.d.ts +7 -0
- package/dist/src/setup/integrations/discord/api.js +1 -1
- package/dist/src/setup/integrations/discord/daemon.d.ts +18 -0
- package/dist/src/setup/integrations/discord/daemon.js +21 -0
- package/dist/src/setup/integrations/discord/setup.d.ts +24 -4
- package/dist/src/setup/integrations/discord/setup.js +5 -4
- package/dist/src/setup/integrations/self-modification/setup.js +1 -1
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/dist/src/setup/scaffold/update/web-options.js +1 -1
- package/dist/src/setup/scaffold/version-tokens.d.ts +0 -1
- package/dist/src/setup/scaffold/version-tokens.js +1 -1
- package/dist/src/shared/agent-definition.d.ts +33 -42
- package/dist/src/shared/built-server-start-failure.d.ts +12 -0
- package/dist/src/shared/built-server-start-failure.js +3 -0
- package/dist/src/shared/framework-eve-server.d.ts +2 -0
- package/dist/src/shared/framework-eve-server.js +2 -2
- package/dist/src/shared/sandbox-environment.d.ts +4 -10
- package/dist/src/shared/sandbox-environment.js +1 -1
- package/dist/src/shared/sandbox-network-policy.d.ts +45 -9
- package/dist/src/shared/sandbox-provider.d.ts +0 -103
- package/dist/src/shared/sandbox-provider.js +1 -1
- package/dist/src/shared/sandbox-recorded-data-error.d.ts +4 -0
- package/dist/src/shared/sandbox-recorded-data-error.js +1 -0
- package/dist/src/shared/sandbox-session-gone-error.d.ts +12 -0
- package/dist/src/shared/sandbox-session-gone-error.js +1 -0
- package/dist/src/shared/sandbox-session.d.ts +97 -83
- package/dist/src/shared/sandbox-template-error.d.ts +19 -4
- package/dist/src/shared/sandbox-template-error.js +1 -1
- package/dist/src/shared/sandbox-tool-session-error.d.ts +4 -0
- package/dist/src/shared/sandbox-tool-session-error.js +1 -0
- package/dist/src/shared/session-history.d.ts +22 -0
- package/dist/src/shared/session-history.js +1 -0
- package/dist/src/shared/skill-package.js +1 -1
- package/dist/src/shared/skill-paths.d.ts +4 -5
- package/dist/src/shared/skill-paths.js +2 -2
- package/dist/src/shared/workflow-sandbox.d.ts +4 -41
- package/dist/src/shared/workflow-sandbox.js +1 -1
- package/dist/src/subagents/tool.d.ts +1 -3
- package/dist/src/subagents/tool.js +1 -1
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.d.ts +1 -1
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/tools/model-output.d.ts +23 -5
- package/dist/src/tools/model-output.js +1 -1
- package/dist/src/tools/provided/ask-question-workflow.js +1 -1
- package/dist/src/tools/provided/glob.js +1 -1
- package/dist/src/tools/provided/grep.js +1 -1
- package/dist/src/tools/provided/read-file.js +1 -1
- package/dist/src/tools/provided/sleep-workflow.js +1 -1
- package/dist/src/tools/provided/workflow.js +1 -1
- package/dist/src/tools/provided/write-file.js +1 -1
- package/dist/src/tools/workflow-definition.d.ts +33 -5
- package/dist/src/tracing/eve/conversation-context.d.ts +4 -1
- package/dist/src/tracing/eve/conversation-context.js +1 -1
- package/dist/src/tracing/eve/invoke-tool-span.js +1 -1
- package/dist/src/tracing/eve/operation-input.d.ts +0 -5
- package/dist/src/tracing/eve/operation-input.js +1 -1
- package/dist/src/tracing/eve/otel-registration.js +1 -1
- package/dist/src/tracing/eve/session.d.ts +3 -2
- package/dist/src/tracing/eve/session.js +1 -1
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.d.ts +1 -1
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/agent-config.md +86 -65
- package/docs/channels/chat-sdk.mdx +6 -1
- package/docs/channels/custom.mdx +41 -9
- package/docs/channels/discord.mdx +279 -7
- package/docs/channels/eve.mdx +58 -1
- package/docs/channels/linq.mdx +53 -2
- package/docs/channels/mcp.mdx +2 -2
- package/docs/channels/overview.mdx +1 -1
- package/docs/channels/photon.mdx +65 -1
- package/docs/channels/slack.mdx +4 -2
- package/docs/concepts/built-in-tools.md +32 -9
- package/docs/concepts/execution-model-and-durability.mdx +15 -103
- package/docs/concepts/security-model.md +2 -0
- package/docs/concepts/sessions-runs-and-streaming.md +52 -43
- package/docs/connections/openapi.mdx +2 -0
- package/docs/connections/overview.mdx +1 -1
- package/docs/evals/reporters.mdx +1 -1
- package/docs/evals/running.mdx +1 -1
- package/docs/experimental/dynamic-schedules.mdx +186 -0
- package/docs/experimental/meta.json +4 -0
- package/docs/guides/client/messages.mdx +1 -1
- package/docs/guides/client/streaming.mdx +1 -0
- package/docs/guides/deployment/overview.md +4 -4
- package/docs/guides/deployment/self-hosting.md +53 -1
- package/docs/guides/dev-tui.md +1 -1
- package/docs/guides/dynamic-capabilities.md +1 -1
- package/docs/guides/frontend/overview.mdx +26 -6
- package/docs/guides/hooks.md +21 -1
- package/docs/guides/instrumentation/agent-runs.mdx +16 -0
- package/docs/guides/self-modification.md +1 -1
- package/docs/guides/session-context.md +1 -1
- package/docs/instructions.mdx +1 -1
- package/docs/memory/overview.mdx +2 -1
- package/docs/patterns/dynamic-scheduling.md +3 -1
- package/docs/reference/agent-files.md +3 -3
- package/docs/reference/cli.md +21 -9
- package/docs/reference/typescript-api.md +9 -3
- package/docs/sandbox/custom-providers.mdx +254 -0
- package/docs/sandbox/default.mdx +71 -4
- package/docs/sandbox/docker.mdx +15 -3
- package/docs/sandbox/index.mdx +27 -103
- package/docs/sandbox/just-bash.mdx +54 -0
- package/docs/sandbox/meta.json +9 -1
- package/docs/sandbox/troubleshooting.mdx +215 -0
- package/docs/sandbox/vercel.mdx +48 -7
- package/docs/schedules.mdx +2 -0
- package/docs/skills.mdx +1 -1
- package/docs/subagents/index.mdx +3 -1
- package/docs/tools/overview.mdx +21 -1
- package/docs/tools/tasks-upgrade.md +12 -7
- package/docs/tools/tasks.md +10 -6
- package/docs/tools/workflows.mdx +109 -10
- package/docs/tutorial/connect-a-warehouse.mdx +1 -1
- package/docs/tutorial/run-analysis.mdx +3 -3
- package/package.json +14 -20
- package/dist/src/compiled/@ai-sdk/code-mode/_run.d.ts +0 -1
- package/dist/src/compiled/@ai-sdk/code-mode/index.d.ts +0 -325
- package/dist/src/compiled/@ai-sdk/code-mode/index.js +0 -660
- package/dist/src/compiled/_chunks/workflow/dist-CyBgVS7g.js +0 -1
- package/dist/src/compiled/_chunks/workflow/dist-T5NnW-0k.js +0 -3
- package/dist/src/compiled/_chunks/workflow/helpers-DlLD3ov_.js +0 -1
- package/dist/src/compiled/_chunks/workflow/private-tQUuwBoQ.js +0 -1
- package/dist/src/compiled/_chunks/workflow/resume-hook-DMsV_b4n.js +0 -1
- package/dist/src/compiled/_chunks/workflow/serialization-DPdYS_w2.js +0 -16
- package/dist/src/compiled/_chunks/workflow/sleep-BY6leHh8.js +0 -1
- package/dist/src/compiled/_chunks/workflow/workflow-routes-CwqB063q.js +0 -1
- package/dist/src/execution/run-session-limits.d.ts +0 -12
- package/dist/src/execution/run-session-limits.js +0 -1
- package/dist/src/execution/sandbox/active-handles.d.ts +0 -32
- package/dist/src/execution/sandbox/active-handles.js +0 -1
- package/dist/src/execution/sandbox/bindings/docker-session.d.ts +0 -6
- package/dist/src/execution/sandbox/bindings/docker-session.js +0 -2
- package/dist/src/execution/sandbox/bindings/immutable-resources.d.ts +0 -15
- package/dist/src/execution/sandbox/bindings/immutable-resources.js +0 -2
- package/dist/src/execution/sandbox/bindings/microsandbox-create.d.ts +0 -12
- package/dist/src/execution/sandbox/bindings/microsandbox-create.js +0 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-lifecycle.d.ts +0 -42
- package/dist/src/execution/sandbox/bindings/microsandbox-lifecycle.js +0 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-metadata.d.ts +0 -29
- package/dist/src/execution/sandbox/bindings/microsandbox-metadata.js +0 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-network.d.ts +0 -18
- package/dist/src/execution/sandbox/bindings/microsandbox-network.js +0 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-options.d.ts +0 -37
- package/dist/src/execution/sandbox/bindings/microsandbox-options.js +0 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-platform.d.ts +0 -21
- package/dist/src/execution/sandbox/bindings/microsandbox-platform.js +0 -21
- package/dist/src/execution/sandbox/bindings/microsandbox-process.d.ts +0 -3
- package/dist/src/execution/sandbox/bindings/microsandbox-process.js +0 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-provider-state.d.ts +0 -11
- package/dist/src/execution/sandbox/bindings/microsandbox-provider-state.js +0 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-runtime.d.ts +0 -82
- package/dist/src/execution/sandbox/bindings/microsandbox-runtime.js +0 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-templates.d.ts +0 -12
- package/dist/src/execution/sandbox/bindings/microsandbox-templates.js +0 -1
- package/dist/src/execution/sandbox/bindings/microsandbox.d.ts +0 -16
- package/dist/src/execution/sandbox/bindings/microsandbox.js +0 -1
- package/dist/src/execution/sandbox/provider-host-development.d.ts +0 -2
- package/dist/src/execution/sandbox/provider-host-development.js +0 -1
- package/dist/src/execution/sandbox/provider-host.d.ts +0 -2
- package/dist/src/execution/sandbox/provider-host.js +0 -1
- package/dist/src/execution/tool-session/sandbox.d.ts +0 -22
- package/dist/src/execution/tool-session/sandbox.js +0 -1
- package/dist/src/harness/session-usage-limits.d.ts +0 -49
- package/dist/src/harness/session-usage-limits.js +0 -1
- package/dist/src/public/sandbox/microsandbox-sandbox.d.ts +0 -48
- package/dist/src/public/sandbox/microsandbox.d.ts +0 -9
- package/dist/src/public/sandbox/microsandbox.js +0 -1
- package/dist/src/sandbox/providers/microsandbox.d.ts +0 -12
- package/dist/src/sandbox/providers/microsandbox.js +0 -1
- package/dist/src/subagents/token-budget.d.ts +0 -15
- package/dist/src/subagents/token-budget.js +0 -1
- package/docs/sandbox/microsandbox.mdx +0 -31
- /package/dist/src/{public/sandbox/microsandbox-sandbox.js → execution/agent-sessions/runtime-overrides.js} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{mkdir,open,readFile,rm,stat,writeFile}from"node:fs/promises";import{isLoopbackHostname}from"#shared/network-address.js";import{existsSync}from"node:fs";import{join}from"node:path";import{resolvePackageRoot}from"#internal/application/package.js";import{spawn}from"node:child_process";import{readDevelopmentRuntimeArtifactsRevision}from"#services/dev-client/runtime-artifacts.js";const DEFAULT_EVE_SERVER_TIMEOUT_MS=18e4,ANSI_ESCAPE_PATTERN=RegExp(`\x1B\\[[0-?]*[ -/]*[@-~]`,`g`),SERVER_URL_CANDIDATE_PATTERN=/https?:\/\/[^\s"'<>]+/g;function normalizeOrigin(e){return new URL(e).origin}function isNodeErrorWithCode(e,t){return e instanceof Error&&`code`in e&&e.code===t}function delay(e){return new Promise(t=>setTimeout(t,e))}function isRecord(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function resolveEveCacheDirectory(e){return join(e,`.eve`)}function resolveEveDevServerRegistryPath(e,t){return join(resolveEveCacheDirectory(e),`${t.slug}-dev-server.json`)}function resolveEveDevServerLockPath(e,t){return join(resolveEveCacheDirectory(e),`${t.slug}-dev-server.lock`)}function resolveDevServerTimeout(e,t){if(e!==void 0){if(!Number.isFinite(e)||e<=0)throw Error(`eve ${t.label} development server timeout must be a positive number.`);return e}}function normalizeDevServerRegistry(e){if(isRecord(e)&&typeof e.appRoot==`string`&&typeof e.origin==`string`&&typeof e.updatedAt==`string`&&(e.pid===null||typeof e.pid==`number`))try{return{appRoot:e.appRoot,origin:normalizeOrigin(e.origin),pid:e.pid,updatedAt:e.updatedAt}}catch{return}}async function readUsableEveDevServerRegistry(e,t){try{let n=normalizeDevServerRegistry(JSON.parse(await readFile(resolveEveDevServerRegistryPath(e,t),`utf8`)));return n===void 0||n.appRoot!==e||await readDevelopmentRuntimeArtifactsRevision({serverUrl:n.origin,timeoutMs:1e3})===void 0?void 0:n.origin}catch(e){if(isNodeErrorWithCode(e,`ENOENT`))return;throw e}}async function writeEveDevServerRegistry(e,t,n){await mkdir(resolveEveCacheDirectory(e),{recursive:!0}),await writeFile(resolveEveDevServerRegistryPath(e,t),`${JSON.stringify({appRoot:e,origin:n.origin,pid:n.process?.pid??null,updatedAt:new Date().toISOString()},null,2)}\n`)}async function removeStaleEveDevServerLock(e){try{let t=await stat(e);Date.now()-t.mtimeMs>3e4&&await rm(e,{force:!0})}catch(e){if(!isNodeErrorWithCode(e,`ENOENT`))throw e}}async function acquireEveDevServerLock(e,t,n){let r=resolveEveCacheDirectory(e),i=resolveEveDevServerLockPath(e,t),a=Date.now()+n;for(await mkdir(r,{recursive:!0});;)try{let e=await open(i,`wx`);return await e.writeFile(`${String(process.pid)}\n`),await e.close(),async()=>{await rm(i,{force:!0})}}catch(r){if(!isNodeErrorWithCode(r,`EEXIST`))throw r;if(await readUsableEveDevServerRegistry(e,t)!==void 0)return async()=>{};if(await removeStaleEveDevServerLock(i),Date.now()>a)throw Error(`Timed out after ${n}ms waiting for another ${t.label} process to start eve.`);await delay(100)}}function createEveBinaryPath(){return join(resolvePackageRoot(),`bin`,`eve.js`)}function parseLocalServerOrigin(e){let t=URL.parse(e);if(!(t===null||t.protocol!==`http:`&&t.protocol!==`https:`||!isLoopbackHostname(t.hostname)||t.port.length===0))return t.origin}function findLocalServerOrigin(e){for(let t of e.matchAll(SERVER_URL_CANDIDATE_PATTERN)){let e=parseLocalServerOrigin(t[0]);if(e!==void 0)return e}}function formatEveDevOutputLine(e,t){let n=e.replace(/\r$/,``),r=n.replace(ANSI_ESCAPE_PATTERN,``).trim();if(r.length===0||/^☰eve\b/.test(r)||r===`CONFIGURATION_FIELD_CONFLICT`||r.startsWith(`[CONFIGURATION_FIELD_CONFLICT]`))return;let i=t===void 0?`[eve:dev]`:`[eve:dev:${t}]`,a=/server listening at\s+(https?:\/\/[^\s]+)/i.exec(n);return a===null?`${i} ${n}`:`${i} server listening at ${a[1]}`}function createEveDevOutputWriter(e){let t=``,writeLine=t=>{let n=formatEveDevOutputLine(t,e.logLabel);n!==void 0&&e.stream.write(`${n}\n`)};return{flush(){t.length!==0&&(writeLine(t),t=``)},write(e){t+=e.toString(`utf8`);let n=t.split(`
|
|
2
|
-
`);t=n.pop()??``;for(let e of n)writeLine(e)}}}function startServerProcess(e){let t=e.timeoutMs??18e4;return new Promise((n,r)=>{let i=spawn(e.command,e.args,{cwd:e.cwd,env:{...process.env,...e.env},stdio:[`ignore`,`pipe`,`pipe`]}),a=createEveDevOutputWriter({logLabel:e.logLabel,stream:process.stderr}),o=createEveDevOutputWriter({logLabel:e.logLabel,stream:process.stdout}),s=setTimeout(()=>{i.kill(),r(Error(`Timed out after ${t}ms waiting for eve to print its server URL.`))},t),cleanup=()=>{clearTimeout(s),i.off(`error`,handleError),i.off(`exit`,handleEarlyExit)},flushOutput=()=>{o.flush(),a.flush()},handleError=e=>{flushOutput(),cleanup(),r(e)},handleEarlyExit=(e,t)=>{flushOutput(),cleanup(),r(Error(`eve server process exited before printing its server URL (code ${String(e)}, signal ${String(t)}).`))},handleOutput=
|
|
1
|
+
import{mkdir,open,readFile,rm,stat,writeFile}from"node:fs/promises";import{isLoopbackHostname}from"#shared/network-address.js";import{existsSync}from"node:fs";import{join}from"node:path";import{resolvePackageRoot}from"#internal/application/package.js";import{spawn}from"node:child_process";import{readDevelopmentRuntimeArtifactsRevision}from"#services/dev-client/runtime-artifacts.js";import{readBuiltServerStartFailure}from"#shared/built-server-start-failure.js";const DEFAULT_EVE_SERVER_TIMEOUT_MS=18e4,ANSI_ESCAPE_PATTERN=RegExp(`\x1B\\[[0-?]*[ -/]*[@-~]`,`g`),SERVER_URL_CANDIDATE_PATTERN=/https?:\/\/[^\s"'<>]+/g;function normalizeOrigin(e){return new URL(e).origin}function isNodeErrorWithCode(e,t){return e instanceof Error&&`code`in e&&e.code===t}function delay(e){return new Promise(t=>setTimeout(t,e))}function isRecord(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function resolveEveCacheDirectory(e){return join(e,`.eve`)}function resolveEveDevServerRegistryPath(e,t){return join(resolveEveCacheDirectory(e),`${t.slug}-dev-server.json`)}function resolveEveDevServerLockPath(e,t){return join(resolveEveCacheDirectory(e),`${t.slug}-dev-server.lock`)}function resolveDevServerTimeout(e,t){if(e!==void 0){if(!Number.isFinite(e)||e<=0)throw Error(`eve ${t.label} development server timeout must be a positive number.`);return e}}function normalizeDevServerRegistry(e){if(isRecord(e)&&typeof e.appRoot==`string`&&typeof e.origin==`string`&&typeof e.updatedAt==`string`&&(e.pid===null||typeof e.pid==`number`))try{return{appRoot:e.appRoot,origin:normalizeOrigin(e.origin),pid:e.pid,updatedAt:e.updatedAt}}catch{return}}async function readUsableEveDevServerRegistry(e,t){try{let n=normalizeDevServerRegistry(JSON.parse(await readFile(resolveEveDevServerRegistryPath(e,t),`utf8`)));return n===void 0||n.appRoot!==e||await readDevelopmentRuntimeArtifactsRevision({serverUrl:n.origin,timeoutMs:1e3})===void 0?void 0:n.origin}catch(e){if(isNodeErrorWithCode(e,`ENOENT`))return;throw e}}async function writeEveDevServerRegistry(e,t,n){await mkdir(resolveEveCacheDirectory(e),{recursive:!0}),await writeFile(resolveEveDevServerRegistryPath(e,t),`${JSON.stringify({appRoot:e,origin:n.origin,pid:n.process?.pid??null,updatedAt:new Date().toISOString()},null,2)}\n`)}async function removeStaleEveDevServerLock(e){try{let t=await stat(e);Date.now()-t.mtimeMs>3e4&&await rm(e,{force:!0})}catch(e){if(!isNodeErrorWithCode(e,`ENOENT`))throw e}}async function acquireEveDevServerLock(e,t,n){let r=resolveEveCacheDirectory(e),i=resolveEveDevServerLockPath(e,t),a=Date.now()+n;for(await mkdir(r,{recursive:!0});;)try{let e=await open(i,`wx`);return await e.writeFile(`${String(process.pid)}\n`),await e.close(),async()=>{await rm(i,{force:!0})}}catch(r){if(!isNodeErrorWithCode(r,`EEXIST`))throw r;if(await readUsableEveDevServerRegistry(e,t)!==void 0)return async()=>{};if(await removeStaleEveDevServerLock(i),Date.now()>a)throw Error(`Timed out after ${n}ms waiting for another ${t.label} process to start eve.`);await delay(100)}}function createEveBinaryPath(){return join(resolvePackageRoot(),`bin`,`eve.js`)}function parseLocalServerOrigin(e){let t=URL.parse(e);if(!(t===null||t.protocol!==`http:`&&t.protocol!==`https:`||!isLoopbackHostname(t.hostname)||t.port.length===0))return t.origin}function findLocalServerOrigin(e){for(let t of e.matchAll(SERVER_URL_CANDIDATE_PATTERN)){let e=parseLocalServerOrigin(t[0]);if(e!==void 0)return e}}function formatEveDevOutputLine(e,t){let n=e.replace(/\r$/,``),r=n.replace(ANSI_ESCAPE_PATTERN,``).trim();if(r.length===0||/^☰eve\b/.test(r)||r===`CONFIGURATION_FIELD_CONFLICT`||r.startsWith(`[CONFIGURATION_FIELD_CONFLICT]`))return;let i=t===void 0?`[eve:dev]`:`[eve:dev:${t}]`,a=/server listening at\s+(https?:\/\/[^\s]+)/i.exec(n);return a===null?`${i} ${n}`:`${i} server listening at ${a[1]}`}function createEveDevOutputWriter(e){let t=``,writeLine=t=>{let n=formatEveDevOutputLine(t,e.logLabel);n!==void 0&&e.stream.write(`${n}\n`)};return{flush(){t.length!==0&&(writeLine(t),t=``)},write(e){t+=e.toString(`utf8`);let n=t.split(`
|
|
2
|
+
`);t=n.pop()??``;for(let e of n)writeLine(e)}}}function startServerProcess(e){let t=e.timeoutMs??18e4;return new Promise((n,r)=>{let i=spawn(e.command,e.args,{cwd:e.cwd,env:{...process.env,...e.env},stdio:[`ignore`,`pipe`,`pipe`]}),a=createEveDevOutputWriter({logLabel:e.logLabel,stream:process.stderr}),o=createEveDevOutputWriter({logLabel:e.logLabel,stream:process.stdout}),s=setTimeout(()=>{i.kill(),r(Error(`Timed out after ${t}ms waiting for eve to print its server URL.`))},t),c=!1,l=``,cleanup=()=>{c=!0,l=``,clearTimeout(s),i.off(`error`,handleError),i.off(`exit`,handleEarlyExit)},flushOutput=()=>{o.flush(),a.flush()},handleError=e=>{flushOutput(),cleanup(),r(e)},handleEarlyExit=(e,t)=>{flushOutput(),cleanup(),r(Error(`eve server process exited before printing its server URL (code ${String(e)}, signal ${String(t)}).`))},handleOutput=t=>{if(c)return;let a=t.toString(`utf8`);l+=a;let o=e.listen===void 0?void 0:readBuiltServerStartFailure(l,e.listen);if(o!==void 0){flushOutput(),cleanup(),i.kill(),r(o);return}let s=findLocalServerOrigin(a);s!==void 0&&(cleanup(),n({origin:s,process:i}))};i.once(`error`,handleError),i.once(`exit`,handleEarlyExit),i.stdout.on(`data`,e=>{o.write(e),handleOutput(e)}),i.stderr.on(`data`,e=>{a.write(e),handleOutput(e)})})}function installProcessShutdown(e){let t=e.process;if(t===void 0)return e;let close=()=>{t.killed||t.kill()};return process.once(`beforeExit`,close),process.once(`exit`,close),e}function startEveDevServer(e){return startServerProcess({args:[createEveBinaryPath(),`dev`,`--no-ui`,`--port`,`0`,...e.workspaceAgentName===void 0?[]:[`--agent`,e.workspaceAgentName]],command:process.execPath,cwd:e.appRoot,logLabel:e.logLabel,timeoutMs:e.timeoutMs}).then(installProcessShutdown)}function startEveProductionServer(e){let t=new URL(e.origin),n=t.port,r=join(e.appRoot,`.output`,`server`,`index.mjs`);if(!existsSync(r))throw Error(`eve production output is missing at ${r}. Run eve build from ${e.appRoot} before starting ${e.host.label}.`);return startServerProcess({args:[r],command:process.execPath,cwd:e.appRoot,env:{HOST:t.hostname,NITRO_HOST:t.hostname,NITRO_PORT:n,PORT:n},listen:{host:t.hostname,port:n,retryHint:e.portRetryHint}}).then(installProcessShutdown)}async function resolveSharedEveDevServer(e){let t=e.timeoutMs??18e4,n=await readUsableEveDevServerRegistry(e.appRoot,e.host);if(n!==void 0)return{origin:n};let r=await acquireEveDevServerLock(e.appRoot,e.host,t);try{let n=await readUsableEveDevServerRegistry(e.appRoot,e.host);if(n!==void 0)return{origin:n};let r=await startEveDevServer({appRoot:e.appRoot,logLabel:e.logLabel,timeoutMs:t,workspaceAgentName:e.workspaceAgentName});return await writeEveDevServerRegistry(e.appRoot,e.host,r),r}finally{await r()}}export{DEFAULT_EVE_SERVER_TIMEOUT_MS,resolveDevServerTimeout,resolveSharedEveDevServer,startEveProductionServer};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { SessionAuth, SessionParent, SessionTurn } from "#context/keys.js";
|
|
2
|
-
import type { SandboxProviderRuntime } from "#
|
|
2
|
+
import type { SandboxProviderRuntime } from "#sandbox/provider.js";
|
|
3
3
|
import type { RuntimeSandboxSession, RuntimeSandboxSessionFor, SandboxSession } from "#shared/sandbox-session.js";
|
|
4
4
|
declare const ENVIRONMENT: unique symbol;
|
|
5
5
|
declare const PROVIDER_RUNTIME: unique symbol;
|
|
6
|
-
declare const CONFIGURATION_HASH: unique symbol;
|
|
7
6
|
export interface SandboxSelectorContext {
|
|
8
7
|
readonly session: {
|
|
9
8
|
readonly auth: SessionAuth;
|
|
@@ -15,9 +14,9 @@ export interface SandboxSelectorContext {
|
|
|
15
14
|
export type SandboxSelector = (context: SandboxSelectorContext) => Promise<RuntimeSandboxSession> | RuntimeSandboxSession;
|
|
16
15
|
export type SandboxOpenArguments<Options> = Options extends undefined ? [] : Record<never, never> extends Options ? [options?: Options] : [options: Options];
|
|
17
16
|
export interface SandboxEnvironmentIdentity {
|
|
18
|
-
readonly [CONFIGURATION_HASH]: string;
|
|
19
17
|
readonly [ENVIRONMENT]: true;
|
|
20
|
-
|
|
18
|
+
/** A {@link SandboxProviderRuntime}, opaque so the public type does not carry core internals. */
|
|
19
|
+
readonly [PROVIDER_RUNTIME]: unknown;
|
|
21
20
|
readonly provider: string;
|
|
22
21
|
}
|
|
23
22
|
export interface SandboxEnvironment<Options extends object | undefined = object, Session extends SandboxSession = SandboxSession> extends SandboxEnvironmentIdentity {
|
|
@@ -25,17 +24,12 @@ export interface SandboxEnvironment<Options extends object | undefined = object,
|
|
|
25
24
|
}
|
|
26
25
|
interface ConstructorRuntime {
|
|
27
26
|
open(input: {
|
|
28
|
-
readonly configurationHash: string;
|
|
29
27
|
readonly environment: object;
|
|
30
|
-
readonly environmentConfigurationHash: string;
|
|
31
28
|
readonly options: object | undefined;
|
|
32
29
|
readonly provider: SandboxProviderRuntime;
|
|
33
30
|
}): Promise<RuntimeSandboxSession>;
|
|
34
31
|
}
|
|
35
|
-
export declare function createSandboxEnvironment<Options extends object | undefined = object, Session extends SandboxSession = SandboxSession>(
|
|
36
|
-
readonly configuration?: unknown;
|
|
37
|
-
readonly runtime: SandboxProviderRuntime;
|
|
38
|
-
}): SandboxEnvironment<Options, Session>;
|
|
32
|
+
export declare function createSandboxEnvironment<Options extends object | undefined = object, Session extends SandboxSession = SandboxSession>(runtime: SandboxProviderRuntime): SandboxEnvironment<Options, Session>;
|
|
39
33
|
export declare function getSandboxEnvironmentRuntime(environment: SandboxEnvironmentIdentity): SandboxProviderRuntime;
|
|
40
34
|
export declare function bindSandboxEnvironment(selector: SandboxSelector, environment: SandboxEnvironmentIdentity): SandboxSelector;
|
|
41
35
|
export declare function getBoundSandboxEnvironment(value: unknown): SandboxEnvironmentIdentity | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ContextContainer,contextStorage}from"#context/container.js";const ENVIRONMENT=Symbol.for(`eve.sandbox-environment`),PROVIDER_RUNTIME=Symbol.for(`eve.sandbox-provider-runtime`),SELECTOR_ENVIRONMENT=Symbol.for(`eve.sandbox-selector-environment`),RUNTIMES=Symbol.for(`eve.sandbox-constructor-runtimes`),globals=globalThis,runtimes=globals[RUNTIMES]??=new WeakMap;function createSandboxEnvironment(e){let t={[ENVIRONMENT]:!0,[PROVIDER_RUNTIME]:e,provider:e.providerName,async open(...n){let r=n[0],i=contextStorage.getStore(),a=i===void 0?void 0:runtimes.get(i);if(a===void 0)throw Error("Sandbox environments can only open sandboxes inside defineSandbox(). Use `ctx.getSandbox()` to reach the session's sandbox from tools and other runtime code.");return await a.open({environment:t,options:r,provider:e})}};return t}function getSandboxEnvironmentRuntime(e){return e[PROVIDER_RUNTIME]}function bindSandboxEnvironment(e,t){return Object.defineProperty(e,SELECTOR_ENVIRONMENT,{value:t}),e}function getBoundSandboxEnvironment(e){let t=typeof e==`function`?Reflect.get(e,SELECTOR_ENVIRONMENT):void 0;return isSandboxEnvironment(t)?t:void 0}function isSandboxEnvironment(e){return typeof e==`object`&&!!e&&Reflect.get(e,ENVIRONMENT)===!0&&typeof Reflect.get(e,`provider`)==`string`&&typeof Reflect.get(e,`open`)==`function`}async function runWithSandboxConstructorRuntime(e,t){let n=contextStorage.getStore(),r=n??new ContextContainer,i=runtimes.get(r);runtimes.set(r,e);try{return n===void 0?await contextStorage.run(r,t):await t()}finally{i===void 0?runtimes.delete(r):runtimes.set(r,i)}}export{bindSandboxEnvironment,createSandboxEnvironment,getBoundSandboxEnvironment,getSandboxEnvironmentRuntime,isSandboxEnvironment,runWithSandboxConstructorRuntime};
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import type * as Vercel from "#compiled/@vercel/sandbox/index.js";
|
|
2
1
|
/**
|
|
3
2
|
* Firewall network policy applied to a live sandbox session.
|
|
4
3
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* firewall so secrets never enter the sandbox process:
|
|
4
|
+
* Use it to restrict egress (`"deny-all"`, an allow-list) or to broker
|
|
5
|
+
* credentials onto outgoing requests. A per-domain `transform` injects
|
|
6
|
+
* headers at the firewall so secrets never enter the sandbox process:
|
|
9
7
|
*
|
|
10
8
|
* ```ts
|
|
11
9
|
* import { environment } from "../sandbox";
|
|
@@ -19,11 +17,49 @@ import type * as Vercel from "#compiled/@vercel/sandbox/index.js";
|
|
|
19
17
|
* });
|
|
20
18
|
* ```
|
|
21
19
|
*
|
|
22
|
-
*
|
|
23
|
-
* `"
|
|
24
|
-
* `
|
|
20
|
+
* A provider rejects any part of a policy it cannot enforce instead of
|
|
21
|
+
* weakening it. The Docker provider honors only `"allow-all"` and
|
|
22
|
+
* `"deny-all"`.
|
|
25
23
|
*/
|
|
26
|
-
export type SandboxNetworkPolicy =
|
|
24
|
+
export type SandboxNetworkPolicy = "allow-all" | "deny-all" | {
|
|
25
|
+
/** Allowed domains, or a map from domain to the rules applied to its requests. */
|
|
26
|
+
readonly allow?: readonly string[] | Readonly<Record<string, readonly SandboxNetworkRule[]>>;
|
|
27
|
+
readonly subnets?: {
|
|
28
|
+
readonly allow?: readonly string[];
|
|
29
|
+
readonly deny?: readonly string[];
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
/** Exactly one of `transform` (inject headers) or `forwardURL` (proxy the request). */
|
|
33
|
+
export type SandboxNetworkRule = {
|
|
34
|
+
readonly match?: SandboxNetworkMatch;
|
|
35
|
+
} & ({
|
|
36
|
+
readonly transform: readonly {
|
|
37
|
+
readonly headers?: Readonly<Record<string, string>>;
|
|
38
|
+
}[];
|
|
39
|
+
} | {
|
|
40
|
+
readonly forwardURL: string;
|
|
41
|
+
});
|
|
42
|
+
/** Which requests a {@link SandboxNetworkRule} applies to. */
|
|
43
|
+
export interface SandboxNetworkMatch {
|
|
44
|
+
readonly headers?: readonly {
|
|
45
|
+
readonly key?: SandboxNetworkMatcher;
|
|
46
|
+
readonly value?: SandboxNetworkMatcher;
|
|
47
|
+
}[];
|
|
48
|
+
readonly method?: readonly string[];
|
|
49
|
+
readonly path?: SandboxNetworkMatcher;
|
|
50
|
+
readonly queryString?: readonly {
|
|
51
|
+
readonly key?: SandboxNetworkMatcher;
|
|
52
|
+
readonly value?: SandboxNetworkMatcher;
|
|
53
|
+
}[];
|
|
54
|
+
}
|
|
55
|
+
/** Sets exactly one of `exact`, `startsWith`, or `regex`. */
|
|
56
|
+
export type SandboxNetworkMatcher = {
|
|
57
|
+
readonly exact: string;
|
|
58
|
+
} | {
|
|
59
|
+
readonly startsWith: string;
|
|
60
|
+
} | {
|
|
61
|
+
readonly regex: string;
|
|
62
|
+
};
|
|
27
63
|
/** Initial network configuration shared by network-capable sandbox providers. */
|
|
28
64
|
export interface SandboxNetworkOptions {
|
|
29
65
|
readonly networkPolicy?: SandboxNetworkPolicy;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { type SandboxEnvironment, type SandboxSelectorContext } from "#shared/sandbox-environment.js";
|
|
2
|
-
import type { SandboxSession } from "#shared/sandbox-session.js";
|
|
3
1
|
export interface SandboxDeleteOptions {
|
|
4
2
|
readonly abortSignal?: AbortSignal;
|
|
5
3
|
}
|
|
@@ -7,113 +5,12 @@ export interface SandboxProviderResourceFile {
|
|
|
7
5
|
readonly content: string | Uint8Array;
|
|
8
6
|
readonly relativePath: string;
|
|
9
7
|
}
|
|
10
|
-
export interface SandboxProviderResourceTree {
|
|
11
|
-
readonly files: readonly SandboxProviderResourceFile[];
|
|
12
|
-
readonly key: string;
|
|
13
|
-
readonly mountPath: string;
|
|
14
|
-
readonly targetPath: string;
|
|
15
|
-
}
|
|
16
|
-
export type SandboxProviderResourceSource = {
|
|
17
|
-
readonly kind: "none";
|
|
18
|
-
} | {
|
|
19
|
-
readonly key: string;
|
|
20
|
-
readonly kind: "inline";
|
|
21
|
-
} | {
|
|
22
|
-
readonly key: string;
|
|
23
|
-
readonly kind: "materialized";
|
|
24
|
-
readonly path: string;
|
|
25
|
-
};
|
|
26
|
-
export interface SandboxProviderResources {
|
|
27
|
-
readonly skills?: SandboxProviderResourceTree;
|
|
28
|
-
readonly source: SandboxProviderResourceSource;
|
|
29
|
-
readonly workspace?: SandboxProviderResourceTree;
|
|
30
|
-
}
|
|
31
|
-
export declare function sandboxProviderResourceIdentity(resources: SandboxProviderResources): object;
|
|
32
|
-
export interface SandboxProviderTargetFile {
|
|
33
|
-
readonly content: string | Uint8Array;
|
|
34
|
-
readonly path: string;
|
|
35
|
-
}
|
|
36
|
-
export declare function providerResourceTargetFiles(resources: SandboxProviderResources): SandboxProviderTargetFile[];
|
|
37
8
|
export type SandboxPreparedArtifact = null | boolean | number | string | readonly SandboxPreparedArtifact[] | {
|
|
38
9
|
readonly [key: string]: SandboxPreparedArtifact;
|
|
39
10
|
};
|
|
40
11
|
export declare function isSandboxPreparedArtifact(value: unknown): value is SandboxPreparedArtifact;
|
|
41
|
-
export declare function isSandboxPreparedArtifactRecord(artifact: unknown): artifact is {
|
|
42
|
-
readonly [key: string]: SandboxPreparedArtifact;
|
|
43
|
-
};
|
|
44
12
|
export interface SandboxProviderFiles {
|
|
45
13
|
list(): Promise<readonly string[]>;
|
|
46
14
|
read(path: string): Promise<Uint8Array>;
|
|
47
15
|
readText(path: string): Promise<string>;
|
|
48
16
|
}
|
|
49
|
-
export interface SandboxProviderHost {
|
|
50
|
-
loadOptionalPackage<T>(input: {
|
|
51
|
-
readonly autoInstall: boolean;
|
|
52
|
-
readonly importModule: () => Promise<T>;
|
|
53
|
-
readonly installPackageName?: string;
|
|
54
|
-
readonly ignoredOptionalDependencies?: readonly string[];
|
|
55
|
-
readonly missingMessage: string;
|
|
56
|
-
readonly packageName: string;
|
|
57
|
-
}): Promise<T>;
|
|
58
|
-
resolveProjectPath(path: string): string;
|
|
59
|
-
}
|
|
60
|
-
export interface SandboxProviderPrepareContext {
|
|
61
|
-
readonly files: SandboxProviderFiles;
|
|
62
|
-
readonly host: SandboxProviderHost;
|
|
63
|
-
readonly log?: (message: string) => void;
|
|
64
|
-
readonly resources: SandboxProviderResources;
|
|
65
|
-
readonly sourceRevision: string;
|
|
66
|
-
readonly storagePath: string;
|
|
67
|
-
}
|
|
68
|
-
export interface SandboxProviderSessionContext {
|
|
69
|
-
readonly host: SandboxProviderHost;
|
|
70
|
-
readonly session: SandboxSelectorContext["session"];
|
|
71
|
-
readonly storagePath: string;
|
|
72
|
-
}
|
|
73
|
-
export interface SandboxProviderHandle<Session extends SandboxSession = SandboxSession> {
|
|
74
|
-
readonly sandbox: Session;
|
|
75
|
-
onRuntimeShutdown(): Promise<void>;
|
|
76
|
-
onSandboxDelete(options?: SandboxDeleteOptions): Promise<void>;
|
|
77
|
-
onSandboxStop(): Promise<void>;
|
|
78
|
-
}
|
|
79
|
-
export interface SandboxProviderImplementation<OpenOptions extends object | undefined, PreparedArtifact extends SandboxPreparedArtifact, SessionState, Session extends SandboxSession = SandboxSession> {
|
|
80
|
-
/**
|
|
81
|
-
* Permanently releases resources owned by a durable session after its terminal outcome.
|
|
82
|
-
* Implementations must be idempotent because the cleanup step may retry.
|
|
83
|
-
*/
|
|
84
|
-
onSessionEnd?(context: SandboxProviderSessionContext, artifact: Readonly<PreparedArtifact>, state: Readonly<SessionState>, options: {
|
|
85
|
-
readonly reason: "completed" | "expired" | "failed";
|
|
86
|
-
}): Promise<void>;
|
|
87
|
-
prepare(context: SandboxProviderPrepareContext): Promise<PreparedArtifact>;
|
|
88
|
-
resume(context: SandboxProviderSessionContext, artifact: Readonly<PreparedArtifact>, state: Readonly<SessionState>): Promise<SandboxProviderHandle<Session>>;
|
|
89
|
-
start(context: SandboxProviderSessionContext, options: Readonly<OpenOptions> | undefined, artifact: Readonly<PreparedArtifact>): Promise<{
|
|
90
|
-
readonly handle: SandboxProviderHandle<Session>;
|
|
91
|
-
readonly state: SessionState;
|
|
92
|
-
}>;
|
|
93
|
-
}
|
|
94
|
-
type SandboxOptionArguments<Options extends object | undefined> = Options extends undefined ? [options?: undefined] : Record<never, never> extends Options ? [options?: Readonly<Options>] : [options: Readonly<Options>];
|
|
95
|
-
export type SandboxProviderDefinition<EnvironmentOptions extends object | undefined, OpenOptions extends object | undefined, PreparedArtifact extends SandboxPreparedArtifact, SessionState, Session extends SandboxSession> = {
|
|
96
|
-
readonly name: string;
|
|
97
|
-
readonly stateProtocolVersion?: number;
|
|
98
|
-
environment(...args: SandboxOptionArguments<EnvironmentOptions>): SandboxProviderImplementation<OpenOptions, PreparedArtifact, SessionState, Session>;
|
|
99
|
-
};
|
|
100
|
-
export interface SandboxProvider<EnvironmentOptions extends object | undefined, OpenOptions extends object | undefined, Session extends SandboxSession> {
|
|
101
|
-
readonly name: string;
|
|
102
|
-
environment(...args: SandboxOptionArguments<EnvironmentOptions>): SandboxEnvironment<OpenOptions, Session>;
|
|
103
|
-
}
|
|
104
|
-
type ErasedSandboxProviderImplementation = SandboxProviderImplementation<object | undefined, SandboxPreparedArtifact, SandboxPreparedArtifact, SandboxSession>;
|
|
105
|
-
export interface SandboxProviderRuntime {
|
|
106
|
-
readonly implementation: ErasedSandboxProviderImplementation;
|
|
107
|
-
readonly providerName: string;
|
|
108
|
-
readonly stateProtocolVersion: number;
|
|
109
|
-
}
|
|
110
|
-
export declare function defineSandboxProvider<EnvironmentOptions extends object | undefined = undefined, OpenOptions extends object | undefined = undefined, PreparedArtifact extends SandboxPreparedArtifact = SandboxPreparedArtifact, SessionState = SandboxPreparedArtifact, Session extends SandboxSession = SandboxSession>(definition: SandboxProviderDefinition<EnvironmentOptions, OpenOptions, PreparedArtifact, SessionState, Session>): SandboxProvider<EnvironmentOptions, OpenOptions, Session>;
|
|
111
|
-
export declare function createSandboxProviderResources(input: {
|
|
112
|
-
readonly resourcesKey?: string;
|
|
113
|
-
readonly resourcesPath?: string;
|
|
114
|
-
readonly seedFiles?: readonly {
|
|
115
|
-
readonly content: string | Uint8Array;
|
|
116
|
-
readonly path: string;
|
|
117
|
-
}[];
|
|
118
|
-
}): SandboxProviderResources;
|
|
119
|
-
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function isSandboxPreparedArtifact(e){return e===null||typeof e==`boolean`||typeof e==`number`||typeof e==`string`?!0:Array.isArray(e)?e.every(isSandboxPreparedArtifact):typeof e==`object`&&!!e&&Object.values(e).every(isSandboxPreparedArtifact)}export{isSandboxPreparedArtifact};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** A provider's recorded session state does not match the shape this eve version writes. */
|
|
2
|
+
export declare function invalidSandboxSessionStateError(label: string): Error;
|
|
3
|
+
/** A provider's prepared artifact from `eve build` does not match the shape this eve version writes. */
|
|
4
|
+
export declare function invalidPreparedSandboxArtifactError(label: string): Error;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function invalidSandboxSessionStateError(e){return Error(`Invalid ${e} session state. This session's recorded sandbox state does not match the format this eve version expects, usually because the session started under a different eve version. Start a new session to get a fresh sandbox.`)}function invalidPreparedSandboxArtifactError(e){return Error(`Invalid prepared ${e} artifact. The artifact recorded by \`eve build\` does not match the format this eve version expects, usually because the build used a different eve version. Run \`eve build\` with the eve version this runtime uses, then redeploy.`)}export{invalidPreparedSandboxArtifactError,invalidSandboxSessionStateError};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thrown by a provider's `resume()` when the session's native sandbox no
|
|
3
|
+
* longer exists. eve then clears the session's sandbox state and reruns the
|
|
4
|
+
* sandbox selector, which starts a fresh sandbox, as it would after
|
|
5
|
+
* `sandbox.delete()`. Throw it only for a sandbox that is gone; other
|
|
6
|
+
* failures must surface unchanged.
|
|
7
|
+
*/
|
|
8
|
+
export declare class SandboxSessionGoneError extends Error {
|
|
9
|
+
constructor(message: string);
|
|
10
|
+
/** Also matches an error from another copy of this class, such as one a provider bundles. */
|
|
11
|
+
static is(error: unknown): error is SandboxSessionGoneError;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var SandboxSessionGoneError=class SandboxSessionGoneError extends Error{constructor(e){super(e),this.name=`SandboxSessionGoneError`}static is(e){return e instanceof SandboxSessionGoneError||e instanceof Error&&e.name===`SandboxSessionGoneError`}};export{SandboxSessionGoneError};
|
|
@@ -1,59 +1,88 @@
|
|
|
1
|
-
import type { Experimental_SandboxSession as AiSdkSandbox } from "ai";
|
|
2
1
|
import type { SandboxDeleteOptions } from "#shared/sandbox-provider.js";
|
|
3
2
|
/**
|
|
4
|
-
* Options for running one command in a sandbox.
|
|
5
|
-
*
|
|
6
|
-
*
|
|
3
|
+
* Options for running one command, or spawning one process, in a sandbox.
|
|
4
|
+
* `env` holds per-call variables, merged over the sandbox's environment.
|
|
5
|
+
* Aborting kills the process.
|
|
7
6
|
*/
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
7
|
+
export interface SandboxRunOptions {
|
|
8
|
+
readonly abortSignal?: AbortSignal;
|
|
9
|
+
readonly command: string;
|
|
10
|
+
readonly env?: Readonly<Record<string, string>>;
|
|
11
|
+
/** Relative directories resolve from the workspace root, which is also the default. */
|
|
12
|
+
readonly workingDirectory?: string;
|
|
13
|
+
}
|
|
14
|
+
/** Options for spawning one long-running process in a sandbox. */
|
|
15
|
+
export type SandboxSpawnOptions = SandboxRunOptions;
|
|
16
|
+
/** Result of one finished sandbox command. A nonzero `exitCode` does not throw. */
|
|
17
|
+
export interface SandboxCommandResult {
|
|
18
|
+
readonly exitCode: number;
|
|
19
|
+
readonly stderr: string;
|
|
20
|
+
readonly stdout: string;
|
|
21
|
+
}
|
|
22
|
+
/** Handle to a long-running process spawned via {@link SandboxSession.spawn}. */
|
|
23
|
+
export interface SandboxProcess {
|
|
24
|
+
readonly pid?: number;
|
|
25
|
+
readonly stderr: ReadableStream<Uint8Array>;
|
|
26
|
+
readonly stdout: ReadableStream<Uint8Array>;
|
|
27
|
+
/** Terminates the process. Idempotent. */
|
|
28
|
+
kill(): Promise<void>;
|
|
29
|
+
wait(): Promise<{
|
|
30
|
+
readonly exitCode: number;
|
|
31
|
+
}>;
|
|
32
|
+
}
|
|
33
|
+
/** Options for reading one file as a stream of bytes. */
|
|
34
|
+
export interface SandboxReadFileOptions {
|
|
35
|
+
readonly abortSignal?: AbortSignal;
|
|
36
|
+
readonly path: string;
|
|
37
|
+
}
|
|
38
|
+
/** Options for reading one file as raw bytes. */
|
|
39
|
+
export type SandboxReadBinaryFileOptions = SandboxReadFileOptions;
|
|
31
40
|
/**
|
|
32
41
|
* Options for reading one text file from a sandbox.
|
|
33
42
|
*
|
|
34
|
-
* `
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* count returns through EOF without error.
|
|
43
|
+
* `"utf-8"` decodes with `TextDecoder` in fatal mode; other encodings fall
|
|
44
|
+
* back to Node's `Buffer.toString(encoding)`. Line ranges are 1-based and
|
|
45
|
+
* inclusive; `endLine` past the file's line count returns through EOF
|
|
46
|
+
* without error.
|
|
39
47
|
*/
|
|
40
|
-
export
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
48
|
+
export interface SandboxReadTextFileOptions extends SandboxReadFileOptions {
|
|
49
|
+
readonly encoding?: string;
|
|
50
|
+
readonly endLine?: number;
|
|
51
|
+
readonly startLine?: number;
|
|
52
|
+
}
|
|
53
|
+
/** Options for writing one file from a stream of bytes. */
|
|
54
|
+
export interface SandboxWriteFileOptions {
|
|
55
|
+
readonly abortSignal?: AbortSignal;
|
|
56
|
+
readonly content: ReadableStream<Uint8Array>;
|
|
57
|
+
readonly path: string;
|
|
58
|
+
}
|
|
59
|
+
/** Options for writing one file from raw bytes. */
|
|
60
|
+
export interface SandboxWriteBinaryFileOptions {
|
|
61
|
+
readonly abortSignal?: AbortSignal;
|
|
62
|
+
readonly content: Uint8Array;
|
|
63
|
+
readonly path: string;
|
|
64
|
+
}
|
|
65
|
+
/** Options for writing one text file to a sandbox. Encodes as UTF-8 unless `encoding` is set. */
|
|
66
|
+
export interface SandboxWriteTextFileOptions {
|
|
67
|
+
readonly abortSignal?: AbortSignal;
|
|
68
|
+
readonly content: string;
|
|
69
|
+
readonly encoding?: string;
|
|
70
|
+
readonly path: string;
|
|
71
|
+
}
|
|
49
72
|
/**
|
|
50
|
-
* Options for writing
|
|
73
|
+
* Options for writing several files from raw bytes in one batch.
|
|
51
74
|
*/
|
|
52
|
-
export
|
|
75
|
+
export interface SandboxWriteFilesOptions {
|
|
76
|
+
readonly abortSignal?: AbortSignal;
|
|
77
|
+
readonly files: readonly {
|
|
78
|
+
readonly content: Uint8Array;
|
|
79
|
+
readonly path: string;
|
|
80
|
+
}[];
|
|
81
|
+
}
|
|
53
82
|
/**
|
|
54
83
|
* Options for removing a path from a sandbox.
|
|
55
84
|
*
|
|
56
|
-
* Relative paths resolve from
|
|
85
|
+
* Relative paths resolve from the workspace root; absolute paths pass through.
|
|
57
86
|
* `force` ignores missing paths. `recursive` permits removing non-empty
|
|
58
87
|
* directories.
|
|
59
88
|
*/
|
|
@@ -64,32 +93,37 @@ export interface SandboxRemovePathOptions {
|
|
|
64
93
|
readonly recursive?: boolean;
|
|
65
94
|
}
|
|
66
95
|
/**
|
|
67
|
-
*
|
|
96
|
+
* The sandbox session that authored tools, hooks, and `prepare` receive.
|
|
68
97
|
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
* is an eve-specific extension for `/workspace` path anchoring.
|
|
74
|
-
*
|
|
75
|
-
* Relative paths resolve from `/workspace`, the live working directory
|
|
76
|
-
* for every provider. Absolute paths pass through unchanged.
|
|
98
|
+
* Relative paths resolve from the workspace root, where commands start by
|
|
99
|
+
* default: `/workspace` on every built-in provider. Absolute paths pass
|
|
100
|
+
* through unchanged. Writes create missing parent directories and overwrite
|
|
101
|
+
* existing files. Reads resolve to `null` only when the path does not exist.
|
|
77
102
|
*
|
|
103
|
+
* The method set stays assignable to the AI SDK's
|
|
104
|
+
* `Experimental_SandboxSession`, apart from its `description`.
|
|
78
105
|
*/
|
|
79
|
-
export interface SandboxSession
|
|
106
|
+
export interface SandboxSession {
|
|
107
|
+
run(options: SandboxRunOptions): Promise<SandboxCommandResult>;
|
|
108
|
+
spawn(options: SandboxSpawnOptions): Promise<SandboxProcess>;
|
|
109
|
+
readFile(options: SandboxReadFileOptions): Promise<ReadableStream<Uint8Array> | null>;
|
|
110
|
+
readBinaryFile(options: SandboxReadBinaryFileOptions): Promise<Uint8Array | null>;
|
|
111
|
+
readTextFile(options: SandboxReadTextFileOptions): Promise<string | null>;
|
|
112
|
+
writeFile(options: SandboxWriteFileOptions): Promise<void>;
|
|
113
|
+
writeBinaryFile(options: SandboxWriteBinaryFileOptions): Promise<void>;
|
|
114
|
+
writeTextFile(options: SandboxWriteTextFileOptions): Promise<void>;
|
|
80
115
|
/**
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
* Relative paths resolve from `/workspace`; absolute paths pass through.
|
|
85
|
-
* The read and write methods already apply this internally.
|
|
116
|
+
* Writes several files in as few provider calls as the provider allows. A
|
|
117
|
+
* batch is not atomic: a rejected batch may leave earlier files written.
|
|
86
118
|
*/
|
|
87
|
-
|
|
119
|
+
writeFiles(options: SandboxWriteFilesOptions): Promise<void>;
|
|
88
120
|
/**
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
121
|
+
* Anchors a sandbox-relative path to the workspace root and returns the
|
|
122
|
+
* resulting absolute path, so `resolvePath(".")` is the root itself. The
|
|
123
|
+
* read and write methods already apply it.
|
|
92
124
|
*/
|
|
125
|
+
resolvePath(path: string): string;
|
|
126
|
+
/** Removes one file or directory from the sandbox filesystem. */
|
|
93
127
|
removePath(options: SandboxRemovePathOptions): Promise<void>;
|
|
94
128
|
}
|
|
95
129
|
export interface RuntimeSandboxSession extends SandboxSession {
|
|
@@ -103,23 +137,3 @@ export interface RuntimeSandboxSession extends SandboxSession {
|
|
|
103
137
|
stop(): Promise<void>;
|
|
104
138
|
}
|
|
105
139
|
export type RuntimeSandboxSessionFor<Session extends SandboxSession> = Session & Pick<RuntimeSandboxSession, "delete" | "stop">;
|
|
106
|
-
/**
|
|
107
|
-
* Internal sandbox session, used to construct the public {@link SandboxSession}.
|
|
108
|
-
*
|
|
109
|
-
* Provider implementations only need to provide byte-oriented file I/O and
|
|
110
|
-
* a `spawn` primitive; the public surface (binary and text variants,
|
|
111
|
-
* line-range slicing, encoding handling, the `run` wrapper) is built on
|
|
112
|
-
* top of these primitives by `buildSandboxSession`.
|
|
113
|
-
*
|
|
114
|
-
* Each method's signature mirrors its public counterpart (and the AI
|
|
115
|
-
* SDK {@link AiSdkSandbox} surface) so providers look symmetric with
|
|
116
|
-
* what authored code sees. The `path` field on `readFile`/`writeFile`
|
|
117
|
-
* here is the **already-resolved** path: the public-surface builder
|
|
118
|
-
* calls `resolvePath` before delegating.
|
|
119
|
-
*/
|
|
120
|
-
export interface InternalSandboxSession extends Pick<AiSdkSandbox, "spawn" | "readFile" | "writeFile"> {
|
|
121
|
-
/** Removes an already-resolved path from the provider filesystem. */
|
|
122
|
-
removePath(options: SandboxRemovePathOptions): Promise<void>;
|
|
123
|
-
/** Translates a user-facing path to the provider's native path. */
|
|
124
|
-
resolvePath(path: string): string;
|
|
125
|
-
}
|
|
@@ -1,9 +1,24 @@
|
|
|
1
|
+
type SandboxTemplateNotProvisionedInput =
|
|
2
|
+
/** The build recorded no prepared artifact for this agent node. */
|
|
3
|
+
{
|
|
4
|
+
readonly nodeId: string;
|
|
5
|
+
readonly providerName: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* The provider cannot use the recorded template. Callers that know why pass
|
|
9
|
+
* `reason`; the default message names no cause, because callers raise this for
|
|
10
|
+
* several different ones.
|
|
11
|
+
*/
|
|
12
|
+
| {
|
|
13
|
+
readonly providerName: string;
|
|
14
|
+
readonly reason?: string;
|
|
15
|
+
readonly templateKey: string;
|
|
16
|
+
};
|
|
1
17
|
export declare class SandboxTemplateNotProvisionedError extends Error {
|
|
2
18
|
readonly providerName: string;
|
|
19
|
+
/** The provider's template identifier, or the agent node id when the build recorded no artifact. */
|
|
3
20
|
readonly templateKey: string;
|
|
4
|
-
constructor(input:
|
|
5
|
-
readonly providerName: string;
|
|
6
|
-
readonly templateKey: string;
|
|
7
|
-
});
|
|
21
|
+
constructor(input: SandboxTemplateNotProvisionedInput);
|
|
8
22
|
static is(error: unknown): error is SandboxTemplateNotProvisionedError;
|
|
9
23
|
}
|
|
24
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var SandboxTemplateNotProvisionedError=class SandboxTemplateNotProvisionedError extends Error{providerName;templateKey;constructor(e){super(`
|
|
1
|
+
var SandboxTemplateNotProvisionedError=class SandboxTemplateNotProvisionedError extends Error{providerName;templateKey;constructor(e){super(`nodeId`in e?`No prepared "${e.providerName}" sandbox environment is recorded for agent node "${e.nodeId}". eve prepares sandbox environments during \`eve build\` and never prepares them in production. Run \`eve build\` without \`--skip-sandbox-prewarm\` and deploy that output with this runtime.`:`Sandbox template "${e.templateKey}" for provider "${e.providerName}" is not available to this runtime. `+(e.reason===void 0?``:`${e.reason} `)+"The runtime only uses templates that `eve build` prepared and never recreates them. Run `eve build` again and deploy its output."),this.name=`SandboxTemplateNotProvisionedError`,this.providerName=e.providerName,this.templateKey=`nodeId`in e?e.nodeId:e.templateKey}static is(e){return e instanceof SandboxTemplateNotProvisionedError||typeof e==`object`&&!!e&&Reflect.get(e,`name`)===`SandboxTemplateNotProvisionedError`&&typeof Reflect.get(e,`providerName`)==`string`&&typeof Reflect.get(e,`templateKey`)==`string`}};export{SandboxTemplateNotProvisionedError};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var ToolSessionSandboxUnsupportedError=class extends Error{constructor(e){super(`Sandbox provider "${e}" cannot keep a sandbox between invokeTool calls, so a call with a key cannot open one. Call without a key for a sandbox that lasts one call, or use Vercel Sandbox, just-bash, or a custom provider that sets \`toolSessions: true\`.`),this.name=`ToolSessionSandboxUnsupportedError`}};export{ToolSessionSandboxUnsupportedError};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One prior message passed as `history` to `send()` or `create()`.
|
|
3
|
+
*
|
|
4
|
+
* Entries become real user and assistant turns in the session's model history
|
|
5
|
+
* and are published in the `history.imported` stream event.
|
|
6
|
+
*/
|
|
7
|
+
export interface SessionHistoryMessage {
|
|
8
|
+
/** Optional app-owned id, echoed in `history.imported` so clients can join annotations. */
|
|
9
|
+
readonly id?: string;
|
|
10
|
+
readonly role: "user" | "assistant";
|
|
11
|
+
/** Plain text. Channels render speaker attribution into this text when needed. */
|
|
12
|
+
readonly text: string;
|
|
13
|
+
}
|
|
14
|
+
/** Thrown when `history` passed to a send does not satisfy the seeding contract. */
|
|
15
|
+
export declare class InvalidSessionHistoryError extends Error {
|
|
16
|
+
readonly name = "InvalidSessionHistoryError";
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Validates `history` at the send boundary and returns a normalized copy that
|
|
20
|
+
* carries only contract fields. Returns `undefined` when `history` is omitted.
|
|
21
|
+
*/
|
|
22
|
+
export declare function validateSessionHistory(history: unknown): readonly SessionHistoryMessage[] | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isObject}from"#shared/guards.js";var InvalidSessionHistoryError=class extends Error{name=`InvalidSessionHistoryError`};function validateSessionHistory(e){if(e===void 0)return;if(!Array.isArray(e))throw new InvalidSessionHistoryError(`history must be an array of messages.`);let t=new Set;return e.map((e,n)=>{let r=`history[${n}]`;if(!isObject(e))throw new InvalidSessionHistoryError(`${r} must be an object.`);let{id:i,role:a,text:o}=e;if(a!==`user`&&a!==`assistant`)throw new InvalidSessionHistoryError(`${r}.role must be "user" or "assistant".`);if(typeof o!=`string`||o.trim().length===0)throw new InvalidSessionHistoryError(`${r}.text must be a non-empty string.`);let s={role:a,text:o};if(i===void 0)return s;if(typeof i!=`string`||i.length===0)throw new InvalidSessionHistoryError(`${r}.id must be a non-empty string.`);if(t.has(i))throw new InvalidSessionHistoryError(`${r}.id "${i}" is not unique.`);return t.add(i),{...s,id:i}})}export{InvalidSessionHistoryError,validateSessionHistory};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createHash}from"node:crypto";import{mkdir,writeFile}from"node:fs/promises";import{dirname,join}from"node:path";import{resolveSandboxSkillRoot,resolveSandboxSkillWritePath}from"#shared/skill-paths.js";import{
|
|
1
|
+
import{createHash}from"node:crypto";import{mkdir,writeFile}from"node:fs/promises";import{dirname,join}from"node:path";import{resolveSandboxSkillRoot,resolveSandboxSkillWritePath}from"#shared/skill-paths.js";import{Buffer}from"node:buffer";function stripSkillFrontmatter(e){return e.replace(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/,``)}function skillPackageRevision(e){let t=createHash(`sha256`);for(let n of e.files)t.update(`${n.relativePath}\0${n.content.byteLength}\0`).update(n.content);return t.digest(`hex`)}function normalizeSkillPackage(e){assertSafeSkillPackageName(e.name);let t=[{content:Buffer.from(e.markdown,`utf8`),relativePath:`SKILL.md`}];for(let[n,r]of Object.entries(e.files??{}))assertSafeSkillPackageFilePath(n),t.push({content:contentToBuffer(r),relativePath:n});return t.sort((e,t)=>comparePaths(e.relativePath,t.relativePath)),{deferred:e.deferred,description:e.description,files:t,license:e.license,markdown:e.markdown,metadata:e.metadata===void 0?void 0:{...e.metadata},name:e.name}}async function writeSkillPackageDirectory(e){for(let t of e.skill.files){let n=join(e.rootPath,`skills`,e.skill.name,t.relativePath);await mkdir(dirname(n),{recursive:!0}),await writeFile(n,t.content)}}async function writeSkillPackageToSandbox(e){let t=await Promise.all(e.skill.files.map(async t=>({content:t.content,path:await resolveSandboxSkillWritePath({name:e.skill.name,relativePath:t.relativePath,sandbox:e.sandbox})})));await e.sandbox.writeFiles({files:t})}async function removeSkillPackageFromSandbox(e){assertSafeSkillPackageName(e.name);let t=await resolveSandboxSkillRoot({sandbox:e.sandbox});await e.sandbox.removePath({force:!0,path:`${t}/${e.name}`,recursive:!0})}function assertSafeSkillPackageName(e){if(e.length===0||e.startsWith(`.`)||e.includes(`/`)||e.includes(`\\`)||e.includes(`..`)||!/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(e)||/^[A-Za-z]:/.test(e))throw Error(`Expected skill name to be a non-empty shell-safe path segment starting with an alphanumeric character and containing only alphanumerics, ".", "_", or "-".`)}function assertSafeSkillPackageFilePath(e){if(e===`SKILL.md`)throw Error(`Skill package files must not include "SKILL.md"; eve generates it.`);if(e.length===0||e.startsWith(`/`)||e.includes(`\\`)||/^[A-Za-z]:/.test(e)||e.split(`/`).some(e=>e.length===0||e===`.`||e===`..`))throw Error(`Expected skill package file paths to be relative POSIX paths.`)}function contentToBuffer(e){return typeof e==`string`?Buffer.from(e,`utf8`):Buffer.from(e)}function comparePaths(e,t){return e<t?-1:+(e>t)}export{normalizeSkillPackage,removeSkillPackageFromSandbox,skillPackageRevision,stripSkillFrontmatter,writeSkillPackageDirectory,writeSkillPackageToSandbox};
|