eve 0.82.0 → 0.83.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +81 -0
- package/NOTICE +1 -1
- package/dist/src/channel/pending-authorization.d.ts +5 -0
- package/dist/src/channel/pending-authorization.js +1 -1
- package/dist/src/channel/session.d.ts +2 -0
- package/dist/src/channel/session.js +1 -1
- package/dist/src/channel/types.d.ts +5 -0
- package/dist/src/chunks/{use-eve-agent-DTu78IAF.js → use-eve-agent-DnbG9c7c.js} +73 -14
- package/dist/src/chunks/{use-eve-agent-DlznYwQk.js → use-eve-agent-ZY7NQ2VW.js} +73 -14
- package/dist/src/cli/dev/local-server-child.js +1 -1
- package/dist/src/cli/dev/local-server-cleanup.js +1 -1
- package/dist/src/cli/dev/tui/question-panel.d.ts +4 -1
- package/dist/src/cli/dev/tui/question-panel.js +1 -1
- package/dist/src/cli/dev/tui/terminal-renderer.js +4 -4
- package/dist/src/cli/run.js +1 -1
- package/dist/src/client/eve-agent-store.d.ts +1 -1
- package/dist/src/client/eve-agent-store.js +1 -1
- package/dist/src/client/index.d.ts +1 -0
- package/dist/src/client/message-response.d.ts +18 -0
- package/dist/src/client/message-response.js +1 -1
- package/dist/src/client/session-controls.d.ts +6 -0
- package/dist/src/client/session-controls.js +1 -1
- package/dist/src/client/session.d.ts +4 -0
- package/dist/src/client/session.js +1 -1
- package/dist/src/compiled/.vendor-stamp.json +8 -8
- package/dist/src/compiled/@eve/catalog/index.js +1 -1
- package/dist/src/compiled/@workflow/core/events-consumer.d.ts +2 -0
- package/dist/src/compiled/@workflow/core/index.js +2 -2
- package/dist/src/compiled/@workflow/core/private.d.ts +5 -3
- package/dist/src/compiled/@workflow/core/private.js +1 -1
- package/dist/src/compiled/@workflow/core/runtime/constants.d.ts +1 -37
- package/dist/src/compiled/@workflow/core/runtime/event-limit-warning.d.ts +32 -0
- package/dist/src/compiled/@workflow/core/runtime/helpers.d.ts +5 -6
- package/dist/src/compiled/@workflow/core/runtime/helpers.js +1 -1
- package/dist/src/compiled/@workflow/core/runtime/runs.d.ts +8 -0
- package/dist/src/compiled/@workflow/core/runtime/start.d.ts +16 -0
- package/dist/src/compiled/@workflow/core/runtime/suspension-handler.d.ts +15 -18
- package/dist/src/compiled/@workflow/core/runtime/vm-mode.d.ts +20 -0
- package/dist/src/compiled/@workflow/core/runtime.js +4 -4
- package/dist/src/compiled/@workflow/core/seeded-nanoid.d.ts +2 -0
- package/dist/src/compiled/@workflow/core/serialization/compression.d.ts +14 -3
- package/dist/src/compiled/@workflow/core/serialization.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/serialization.js +1 -1
- package/dist/src/compiled/@workflow/core/telemetry/semantic-conventions.d.ts +0 -18
- package/dist/src/compiled/@workflow/core/version.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/workflow.js +1 -1
- package/dist/src/compiled/@workflow/errors/index.d.ts +48 -0
- package/dist/src/compiled/@workflow/errors/index.js +1 -1
- package/dist/src/compiled/@workflow/world/env-config.d.ts +24 -0
- package/dist/src/compiled/@workflow/world/events.d.ts +126 -7
- package/dist/src/compiled/@workflow/world/index.d.ts +3 -3
- package/dist/src/compiled/@workflow/world/interfaces.d.ts +59 -8
- package/dist/src/compiled/@workflow/world/queue.d.ts +71 -9
- package/dist/src/compiled/@workflow/world/recovery.d.ts +6 -0
- package/dist/src/compiled/@workflow/world/test-support/duplicate-event-fixtures.d.ts +3 -0
- package/dist/src/compiled/@workflow/world/test-support/in-band-fence-conformance.d.ts +46 -0
- package/dist/src/compiled/@workflow/world-local/index.js +5 -5
- package/dist/src/compiled/@workflow/world-vercel/index.js +18 -18
- package/dist/src/compiled/_chunks/workflow/{attribute-changes-BW-kbMMn.js → attribute-changes-7se_SE2q.js} +3 -3
- package/dist/src/compiled/_chunks/workflow/dist-CcnNPAp4.js +1 -0
- package/dist/src/compiled/_chunks/workflow/dist-S9cZRway.js +3 -0
- package/dist/src/compiled/_chunks/workflow/helpers-CxNRXH0a.js +1 -0
- package/dist/src/compiled/_chunks/workflow/private-DLYTSBbu.js +1 -0
- package/dist/src/compiled/_chunks/workflow/resume-hook-CPiIfe8r.js +1 -0
- package/dist/src/compiled/_chunks/workflow/{run-DzdAqdb1.js → run-BJSLCXR4.js} +6 -6
- package/dist/src/compiled/_chunks/workflow/serialization-B9gneT9Z.js +15 -0
- package/dist/src/compiled/_chunks/workflow/sleep-BL0oQs3R.js +1 -0
- package/dist/src/compiled/_chunks/workflow/{wait-until-xbRRDuUf.js → wait-until-BPou0RGO.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/workflow-routes-BaljomCk.js +1 -0
- package/dist/src/compiled/{@ai-sdk/code-mode → run}/LICENSE +1 -1
- package/dist/src/compiled/run/index.d.ts +384 -0
- package/dist/src/compiled/run/index.js +650 -0
- package/dist/src/compiler/extension-compatibility.d.ts +21 -14
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/normalize-agent-config.js +1 -1
- package/dist/src/compiler/normalize-manifest.js +1 -1
- package/dist/src/compiler/normalize-sandbox.js +1 -1
- package/dist/src/compiler/workspace-resources.js +1 -1
- package/dist/src/context/build-callback-context.js +1 -1
- package/dist/src/context/build-dynamic-tools.js +1 -1
- package/dist/src/context/dynamic-skill-lifecycle.d.ts +2 -2
- package/dist/src/context/dynamic-skill-lifecycle.js +1 -1
- package/dist/src/context/dynamic-tool-lifecycle.js +1 -1
- package/dist/src/context/prewarm.d.ts +27 -0
- package/dist/src/context/prewarm.js +1 -0
- package/dist/src/context/providers/sandbox.d.ts +7 -0
- package/dist/src/context/providers/sandbox.js +1 -1
- package/dist/src/context/run-step.js +1 -1
- package/dist/src/discover/extension-specifier.d.ts +1 -0
- package/dist/src/discover/extension-specifier.js +1 -1
- package/dist/src/discover/lib.d.ts +4 -3
- package/dist/src/discover/lib.js +1 -1
- package/dist/src/discover/named-source-directory.d.ts +3 -2
- package/dist/src/evals/cli/eval.d.ts +2 -0
- package/dist/src/evals/cli/eval.js +2 -2
- package/dist/src/evals/define-eval-config.d.ts +5 -4
- package/dist/src/evals/define-eval-config.js +1 -1
- package/dist/src/evals/index.d.ts +1 -1
- package/dist/src/evals/runner/artifacts.js +2 -2
- package/dist/src/evals/runner/attempt-label.d.ts +2 -0
- package/dist/src/evals/runner/attempt-label.js +1 -0
- package/dist/src/evals/runner/derive-run-facts.d.ts +12 -0
- package/dist/src/evals/runner/derive-run-facts.js +1 -1
- package/dist/src/evals/runner/execute-task.js +1 -1
- package/dist/src/evals/runner/reporters/braintrust.js +1 -1
- package/dist/src/evals/runner/reporters/console.js +1 -1
- package/dist/src/evals/runner/reporters/datadog.js +1 -1
- package/dist/src/evals/runner/reporters/junit.js +2 -2
- package/dist/src/evals/runner/reporters/types.d.ts +2 -0
- package/dist/src/evals/runner/run-evals.d.ts +5 -0
- package/dist/src/evals/runner/run-evals.js +1 -1
- package/dist/src/evals/session-manager.js +1 -1
- package/dist/src/evals/session.d.ts +4 -1
- package/dist/src/evals/session.js +2 -2
- package/dist/src/evals/types.d.ts +39 -2
- package/dist/src/eve-channel/index.js +1 -1
- package/dist/src/eve-channel/request.d.ts +0 -1
- package/dist/src/eve-channel/request.js +2 -2
- package/dist/src/execution/agent-sessions/context.d.ts +1 -1
- package/dist/src/execution/agent-sessions/context.js +1 -1
- package/dist/src/execution/coordination-dispatch-shared.d.ts +3 -0
- package/dist/src/execution/coordination-dispatch-shared.js +1 -1
- package/dist/src/execution/dynamic-workflow/program-step.d.ts +7 -7
- package/dist/src/execution/dynamic-workflow/program-step.js +1 -1
- package/dist/src/execution/dynamic-workflow/schema.d.ts +18 -11
- package/dist/src/execution/dynamic-workflow/schema.js +1 -1
- package/dist/src/execution/dynamic-workflow/tool.js +1 -1
- package/dist/src/execution/dynamic-workflow/workflow.js +1 -1
- package/dist/src/execution/eve-workflow-attributes.d.ts +3 -1
- package/dist/src/execution/eve-workflow-attributes.js +1 -1
- package/dist/src/execution/invoke-tool.js +1 -1
- package/dist/src/execution/sandbox/abort-bound-session.js +1 -1
- package/dist/src/execution/sandbox/active-connections.d.ts +28 -0
- package/dist/src/execution/sandbox/active-connections.js +1 -0
- package/dist/src/execution/sandbox/bindings/docker-cli.d.ts +10 -2
- package/dist/src/execution/sandbox/bindings/docker-cli.js +2 -2
- package/dist/src/execution/sandbox/bindings/docker-connection.d.ts +15 -0
- package/dist/src/execution/sandbox/bindings/docker-connection.js +2 -0
- package/dist/src/execution/sandbox/bindings/docker-container.d.ts +2 -0
- package/dist/src/execution/sandbox/bindings/docker-container.js +1 -1
- package/dist/src/execution/sandbox/bindings/docker-network.d.ts +5 -0
- package/dist/src/execution/sandbox/bindings/docker-network.js +1 -1
- package/dist/src/execution/sandbox/bindings/docker-templates.js +1 -1
- package/dist/src/execution/sandbox/bindings/docker.d.ts +12 -15
- package/dist/src/execution/sandbox/bindings/docker.js +1 -1
- package/dist/src/execution/sandbox/bindings/just-bash-runtime.d.ts +19 -29
- package/dist/src/execution/sandbox/bindings/just-bash-runtime.js +1 -1
- package/dist/src/execution/sandbox/bindings/just-bash.d.ts +2 -4
- package/dist/src/execution/sandbox/bindings/just-bash.js +1 -1
- package/dist/src/execution/sandbox/bindings/local-provider-utils.d.ts +0 -20
- package/dist/src/execution/sandbox/bindings/local-provider-utils.js +1 -1
- package/dist/src/execution/sandbox/bindings/local.d.ts +4 -6
- package/dist/src/execution/sandbox/bindings/local.js +1 -1
- package/dist/src/execution/sandbox/bindings/vercel-base-runtime.d.ts +2 -0
- package/dist/src/execution/sandbox/bindings/vercel-base-runtime.js +2 -2
- package/dist/src/execution/sandbox/bindings/vercel-errors.js +2 -2
- package/dist/src/execution/sandbox/bindings/vercel-lifecycle.d.ts +7 -5
- package/dist/src/execution/sandbox/bindings/vercel-lifecycle.js +1 -1
- package/dist/src/execution/sandbox/bindings/vercel.d.ts +5 -11
- package/dist/src/execution/sandbox/bindings/vercel.js +1 -2
- package/dist/src/execution/sandbox/development-cleanup.d.ts +0 -1
- package/dist/src/execution/sandbox/development-cleanup.js +1 -1
- package/dist/src/execution/sandbox/development-lazy-prewarm.js +1 -1
- package/dist/src/execution/sandbox/development-run.d.ts +0 -2
- package/dist/src/execution/sandbox/development-run.js +1 -1
- package/dist/src/execution/sandbox/dockerfile.d.ts +0 -4
- package/dist/src/execution/sandbox/dockerfile.js +1 -1
- package/dist/src/execution/sandbox/ensure.d.ts +31 -11
- package/dist/src/execution/sandbox/ensure.js +1 -1
- package/dist/src/execution/sandbox/glob-tool.js +3 -3
- package/dist/src/execution/sandbox/grep-tool.js +1 -1
- package/dist/src/execution/sandbox/logging-session.js +1 -1
- package/dist/src/execution/sandbox/prewarm.d.ts +23 -3
- package/dist/src/execution/sandbox/prewarm.js +2 -1
- package/dist/src/execution/sandbox/read-file.js +1 -1
- package/dist/src/execution/sandbox/require-sandbox.d.ts +3 -2
- package/dist/src/execution/sandbox/require-sandbox.js +1 -1
- package/dist/src/execution/sandbox/ripgrep-probe.js +1 -1
- package/dist/src/execution/sandbox/session.d.ts +10 -20
- package/dist/src/execution/sandbox/session.js +2 -2
- package/dist/src/execution/session/admission.js +1 -1
- package/dist/src/execution/session/checkpoint-migrations.js +1 -1
- package/dist/src/execution/session/entry-input.d.ts +5 -4
- package/dist/src/execution/session/entry.js +1 -1
- package/dist/src/execution/session/handoff-state.d.ts +5 -0
- package/dist/src/execution/session/handoff-state.js +1 -0
- package/dist/src/execution/session/handoff-steps.d.ts +1 -5
- package/dist/src/execution/session/handoff-steps.js +1 -1
- package/dist/src/execution/session/handoff.d.ts +2 -1
- package/dist/src/execution/session/handoff.js +1 -1
- package/dist/src/execution/session/handover-tracing.d.ts +3 -0
- package/dist/src/execution/session/handover-tracing.js +1 -0
- package/dist/src/execution/session/input-queue.d.ts +3 -0
- package/dist/src/execution/session/input-queue.js +1 -1
- package/dist/src/execution/session/next-input.d.ts +3 -0
- package/dist/src/execution/session/next-input.js +1 -1
- package/dist/src/execution/session/prewarm-step.d.ts +13 -0
- package/dist/src/execution/session/prewarm-step.js +1 -0
- package/dist/src/execution/session/program.d.ts +4 -1
- package/dist/src/execution/session/program.js +1 -1
- package/dist/src/execution/session/state-cursor.d.ts +11 -0
- package/dist/src/execution/session/state-cursor.js +1 -1
- package/dist/src/execution/session/timeout-control.d.ts +4 -0
- package/dist/src/execution/session/timeout-control.js +1 -1
- package/dist/src/execution/session/turn-control.d.ts +5 -2
- package/dist/src/execution/session/turn-control.js +1 -1
- package/dist/src/execution/session/turn-step-types.d.ts +2 -0
- package/dist/src/execution/session/turn-step.js +1 -1
- package/dist/src/execution/session/turn.d.ts +1 -0
- package/dist/src/execution/session/turn.js +1 -1
- package/dist/src/execution/session-inbox/inbox.d.ts +17 -1
- package/dist/src/execution/session-inbox/inbox.js +1 -1
- package/dist/src/execution/session-inbox/protocol.d.ts +2 -1
- package/dist/src/execution/session-inbox/protocol.js +1 -1
- package/dist/src/execution/session-inbox/resume.d.ts +2 -1
- package/dist/src/execution/session-inbox/resume.js +1 -1
- package/dist/src/execution/session-prewarm.d.ts +8 -0
- package/dist/src/execution/session-prewarm.js +1 -0
- package/dist/src/execution/skills/instructions.js +1 -1
- package/dist/src/execution/tools/agent-router-workflow.js +1 -1
- package/dist/src/execution/tools/workflow/body.js +1 -1
- package/dist/src/execution/tools/workflow/step-context.d.ts +11 -0
- package/dist/src/execution/tools/workflow/step-execution.js +1 -1
- package/dist/src/execution/tools/workflow/step.js +1 -1
- package/dist/src/execution/workflow-runtime.js +1 -1
- package/dist/src/extensions/git/extension/lib/github-shell-schema.js +1 -1
- package/dist/src/framework/sources/modules/sandbox.d.ts +1 -1
- package/dist/src/harness/attachment-staging.d.ts +3 -7
- package/dist/src/harness/attachment-staging.js +1 -1
- package/dist/src/harness/hitl/index.d.ts +2 -1
- package/dist/src/harness/hitl/index.js +1 -1
- package/dist/src/harness/hitl/view.d.ts +1 -0
- package/dist/src/harness/hitl/view.js +1 -0
- package/dist/src/harness/model-call/run.js +1 -1
- package/dist/src/harness/semantic-errors/rules/sandbox.d.ts +3 -5
- package/dist/src/harness/semantic-errors/rules/sandbox.js +1 -1
- package/dist/src/harness/step/prompt.js +1 -1
- package/dist/src/harness/tool-history-repair.d.ts +9 -0
- package/dist/src/harness/tool-history-repair.js +1 -0
- package/dist/src/harness/tool-model-output.d.ts +19 -3
- package/dist/src/harness/tool-model-output.js +1 -1
- package/dist/src/internal/application/compiled-artifacts.js +8 -4
- package/dist/src/internal/application/optional-package-import.d.ts +10 -0
- package/dist/src/internal/application/optional-package-import.js +1 -1
- package/dist/src/internal/application/stamped-package-version.js +1 -1
- package/dist/src/internal/attachments/limited-read.d.ts +2 -2
- package/dist/src/internal/authored-module-build-options.d.ts +6 -0
- package/dist/src/internal/authored-module-build-options.js +1 -1
- package/dist/src/internal/authored-module-cache.d.ts +10 -0
- package/dist/src/internal/authored-module-cache.js +1 -0
- package/dist/src/internal/authored-module-graph.js +1 -1
- package/dist/src/internal/authored-module-loader.js +1 -1
- package/dist/src/internal/authored-relative-extension-resolver.js +1 -1
- package/dist/src/internal/bundler/nitro-rolldown.d.ts +3 -1
- package/dist/src/internal/bundler/nitro-rolldown.js +1 -1
- package/dist/src/internal/bundler/pseudo-packages.d.ts +11 -0
- package/dist/src/internal/bundler/pseudo-packages.js +1 -0
- package/dist/src/internal/nitro/host/build-extension.d.ts +6 -0
- package/dist/src/internal/nitro/host/build-extension.js +2 -2
- package/dist/src/internal/nitro/host/compiled-sandbox-provider-prune-plugin.d.ts +3 -1
- package/dist/src/internal/nitro/host/compiled-sandbox-provider-prune-plugin.js +3 -5
- package/dist/src/internal/nitro/host/create-application-nitro.d.ts +2 -3
- package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
- package/dist/src/internal/nitro/host/dev-authored-rebuild-coordinator.d.ts +2 -0
- package/dist/src/internal/nitro/host/dev-authored-rebuild-coordinator.js +1 -1
- package/dist/src/internal/nitro/host/dev-authored-source-watcher.js +1 -1
- package/dist/src/internal/nitro/host/dev-build-host.d.ts +83 -0
- package/dist/src/internal/nitro/host/dev-build-host.js +1 -0
- package/dist/src/internal/nitro/host/dev-build-operations.d.ts +6 -0
- package/dist/src/internal/nitro/host/dev-build-operations.js +1 -0
- package/dist/src/internal/nitro/host/dev-build-process.d.ts +1 -0
- package/dist/src/internal/nitro/host/dev-build-process.js +1 -0
- package/dist/src/internal/nitro/host/development-runtime-prune-plugin.d.ts +4 -1
- package/dist/src/internal/nitro/host/development-runtime-prune-plugin.js +3 -2
- package/dist/src/internal/nitro/host/drained-nitro-dev-server.d.ts +13 -0
- package/dist/src/internal/nitro/host/drained-nitro-dev-server.js +1 -1
- package/dist/src/internal/nitro/host/optional-engine-dependency-plugin.js +1 -1
- package/dist/src/internal/nitro/host/prepare-application-host.d.ts +3 -0
- package/dist/src/internal/nitro/host/prepare-application-host.js +1 -1
- package/dist/src/internal/nitro/host/sandbox-shutdown-plugin.js +1 -1
- package/dist/src/internal/nitro/host/start-development-server.js +2 -2
- package/dist/src/internal/nitro/host/start-production-server.js +3 -3
- package/dist/src/internal/nitro/host/workflow-sandbox-runtime-plugin.js +1 -1
- package/dist/src/internal/nitro/host.js +1 -1
- package/dist/src/internal/workflow/local-world-delivery-auth.d.ts +17 -0
- package/dist/src/internal/workflow/local-world-delivery-auth.js +1 -0
- package/dist/src/internal/workflow/queue-namespace.d.ts +2 -0
- package/dist/src/internal/workflow/queue-namespace.js +1 -1
- package/dist/src/internal/workflow-bundle/builder-support.d.ts +0 -1
- package/dist/src/internal/workflow-bundle/builder-support.js +2 -2
- package/dist/src/internal/workflow-bundle/builder.js +2 -2
- package/dist/src/internal/workflow-bundle/dynamic-tool-transform.js +1 -1
- package/dist/src/internal/workflow-bundle/vercel-workflow-output.d.ts +1 -1
- package/dist/src/internal/workflow-bundle/vercel-workflow-output.js +1 -1
- package/dist/src/protocol/prewarm-session.d.ts +14 -0
- package/dist/src/protocol/prewarm-session.js +1 -0
- package/dist/src/protocol/routes.d.ts +2 -2
- package/dist/src/public/channels/discord/authorization.d.ts +45 -0
- package/dist/src/public/channels/discord/authorization.js +3 -0
- package/dist/src/public/channels/discord/defaults.d.ts +14 -3
- package/dist/src/public/channels/discord/defaults.js +2 -2
- package/dist/src/public/channels/discord/discordChannel.d.ts +15 -1
- package/dist/src/public/channels/discord/discordChannel.js +1 -1
- package/dist/src/public/channels/discord/gateway/connection.d.ts +26 -0
- package/dist/src/public/channels/discord/gateway/connection.js +1 -0
- package/dist/src/public/channels/discord/gateway/forwarder.d.ts +14 -0
- package/dist/src/public/channels/discord/gateway/forwarder.js +1 -0
- package/dist/src/public/channels/discord/gateway/index.d.ts +59 -0
- package/dist/src/public/channels/discord/gateway/index.js +1 -0
- package/dist/src/public/channels/discord/inbound.d.ts +10 -3
- package/dist/src/public/channels/discord/inbound.js +2 -2
- package/dist/src/public/channels/discord/index.d.ts +3 -2
- package/dist/src/public/channels/discord/index.js +1 -1
- package/dist/src/public/channels/discord/messages.d.ts +116 -0
- package/dist/src/public/channels/discord/messages.js +2 -0
- package/dist/src/public/channels/github/checkout.js +1 -1
- package/dist/src/public/channels/linq/linqChannel.d.ts +4 -1
- package/dist/src/public/channels/linq/linqChannel.js +1 -1
- package/dist/src/public/channels/photon/photonIMessageChannel.js +1 -1
- package/dist/src/public/channels/same-environment-oidc.d.ts +7 -0
- package/dist/src/public/channels/same-environment-oidc.js +1 -0
- package/dist/src/public/definitions/channel.js +1 -1
- package/dist/src/public/definitions/sandbox.d.ts +1 -1
- package/dist/src/public/next/server.js +1 -1
- package/dist/src/public/sandbox/docker-sandbox.d.ts +6 -1
- package/dist/src/public/sandbox/docker.d.ts +1 -8
- package/dist/src/public/sandbox/index.d.ts +3 -3
- package/dist/src/public/sandbox/just-bash-sandbox.d.ts +87 -7
- package/dist/src/public/sandbox/just-bash.d.ts +1 -1
- package/dist/src/public/sandbox/provider.d.ts +5 -1
- package/dist/src/public/sandbox/provider.js +1 -1
- package/dist/src/public/sandbox/vercel-sandbox.d.ts +16 -9
- package/dist/src/public/sandbox/vercel.d.ts +0 -1
- package/dist/src/public/sandbox/vercel.js +1 -1
- package/dist/src/public/tools/agent.d.ts +8 -1
- package/dist/src/public/tools/agent.js +1 -1
- package/dist/src/react/use-eve-agent.d.ts +1 -1
- package/dist/src/runtime/agent/resolve-model.js +1 -1
- package/dist/src/runtime/connections/openapi-client.d.ts +2 -0
- package/dist/src/runtime/connections/openapi-client.js +1 -1
- package/dist/src/runtime/resolve-agent-graph.js +1 -1
- package/dist/src/runtime/resolve-agent.js +1 -1
- package/dist/src/runtime/resolve-channel.js +1 -1
- package/dist/src/runtime/resolve-sandbox.js +1 -1
- package/dist/src/runtime/sandbox/prepared-artifacts.js +1 -1
- package/dist/src/runtime/sandbox/registry.d.ts +2 -0
- package/dist/src/runtime/sandbox/registry.js +1 -1
- package/dist/src/runtime/subagents/workflow.d.ts +6 -0
- package/dist/src/runtime/subagents/workflow.js +1 -1
- package/dist/src/runtime/workspace/seed-files.d.ts +9 -12
- package/dist/src/runtime/workspace/seed-files.js +1 -1
- package/dist/src/runtime/workspace/spec.d.ts +1 -1
- package/dist/src/runtime/workspace/spec.js +1 -1
- package/dist/src/runtime/workspace/types.d.ts +2 -6
- package/dist/src/sandbox/provider.d.ts +185 -0
- package/dist/src/sandbox/provider.js +1 -0
- package/dist/src/sandbox/providers/default.d.ts +20 -19
- package/dist/src/sandbox/providers/default.js +1 -1
- package/dist/src/sandbox/providers/docker.d.ts +5 -2
- package/dist/src/sandbox/providers/docker.js +1 -1
- package/dist/src/sandbox/providers/just-bash.d.ts +4 -3
- package/dist/src/sandbox/providers/just-bash.js +1 -1
- package/dist/src/sandbox/providers/vercel.d.ts +4 -10
- package/dist/src/sandbox/providers/vercel.js +1 -1
- package/dist/src/sandbox/providers.d.ts +0 -1
- package/dist/src/sandbox/providers.js +1 -1
- package/dist/src/sandbox/state.d.ts +61 -0
- package/dist/src/sandbox/state.js +1 -1
- package/dist/src/self-modification/deployed-sandbox.d.ts +4 -9
- package/dist/src/self-modification/deployed-sandbox.js +1 -1
- package/dist/src/self-modification/filesystem.d.ts +3 -3
- package/dist/src/self-modification/remote/config.d.ts +2 -2
- package/dist/src/self-modification/remote/config.js +1 -1
- package/dist/src/self-modification/setup.d.ts +0 -1
- package/dist/src/self-modification/setup.js +8 -8
- package/dist/src/setup/integrations/discord/api.d.ts +7 -0
- package/dist/src/setup/integrations/discord/api.js +1 -1
- package/dist/src/setup/integrations/discord/daemon.d.ts +18 -0
- package/dist/src/setup/integrations/discord/daemon.js +21 -0
- package/dist/src/setup/integrations/discord/setup.d.ts +24 -4
- package/dist/src/setup/integrations/discord/setup.js +5 -4
- package/dist/src/setup/integrations/self-modification/setup.js +1 -1
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/dist/src/setup/scaffold/update/web-options.js +1 -1
- package/dist/src/setup/scaffold/version-tokens.d.ts +0 -1
- package/dist/src/setup/scaffold/version-tokens.js +1 -1
- package/dist/src/shared/agent-definition.d.ts +2 -0
- package/dist/src/shared/built-server-start-failure.d.ts +12 -0
- package/dist/src/shared/built-server-start-failure.js +3 -0
- package/dist/src/shared/framework-eve-server.d.ts +2 -0
- package/dist/src/shared/framework-eve-server.js +2 -2
- package/dist/src/shared/sandbox-environment.d.ts +4 -10
- package/dist/src/shared/sandbox-environment.js +1 -1
- package/dist/src/shared/sandbox-network-policy.d.ts +45 -9
- package/dist/src/shared/sandbox-provider.d.ts +0 -103
- package/dist/src/shared/sandbox-provider.js +1 -1
- package/dist/src/shared/sandbox-recorded-data-error.d.ts +4 -0
- package/dist/src/shared/sandbox-recorded-data-error.js +1 -0
- package/dist/src/shared/sandbox-session-gone-error.d.ts +12 -0
- package/dist/src/shared/sandbox-session-gone-error.js +1 -0
- package/dist/src/shared/sandbox-session.d.ts +97 -83
- package/dist/src/shared/sandbox-template-error.d.ts +19 -4
- package/dist/src/shared/sandbox-template-error.js +1 -1
- package/dist/src/shared/sandbox-tool-session-error.d.ts +4 -0
- package/dist/src/shared/sandbox-tool-session-error.js +1 -0
- package/dist/src/shared/skill-package.js +1 -1
- package/dist/src/shared/skill-paths.d.ts +4 -5
- package/dist/src/shared/skill-paths.js +2 -2
- package/dist/src/shared/workflow-sandbox.d.ts +4 -41
- package/dist/src/shared/workflow-sandbox.js +1 -1
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.d.ts +1 -1
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/tools/definition.js +1 -1
- package/dist/src/tools/durable-callbacks.d.ts +5 -1
- package/dist/src/tools/durable-callbacks.js +1 -1
- package/dist/src/tools/dynamic.d.ts +3 -3
- package/dist/src/tools/model-output.d.ts +23 -5
- package/dist/src/tools/model-output.js +1 -1
- package/dist/src/tools/provided/ask-question-workflow.js +1 -1
- package/dist/src/tools/provided/glob.js +1 -1
- package/dist/src/tools/provided/grep.js +1 -1
- package/dist/src/tools/provided/read-file.js +1 -1
- package/dist/src/tools/provided/sleep-workflow.js +1 -1
- package/dist/src/tools/provided/workflow.js +1 -1
- package/dist/src/tools/provided/write-file.js +1 -1
- package/dist/src/tools/workflow-definition.d.ts +19 -4
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.d.ts +1 -1
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/channels/custom.mdx +3 -3
- package/docs/channels/discord.mdx +279 -7
- package/docs/channels/eve.mdx +13 -2
- package/docs/channels/linq.mdx +2 -2
- package/docs/channels/mcp.mdx +2 -2
- package/docs/channels/overview.mdx +1 -1
- package/docs/channels/photon.mdx +1 -1
- package/docs/concepts/built-in-tools.md +31 -8
- package/docs/concepts/execution-model-and-durability.mdx +6 -101
- package/docs/concepts/security-model.md +2 -0
- package/docs/concepts/sessions-runs-and-streaming.md +44 -36
- package/docs/connections/openapi.mdx +2 -0
- package/docs/evals/overview.mdx +1 -1
- package/docs/evals/reporters.mdx +5 -5
- package/docs/evals/running.mdx +19 -1
- package/docs/guides/client/messages.mdx +1 -1
- package/docs/guides/deployment/overview.md +4 -4
- package/docs/guides/deployment/self-hosting.md +50 -1
- package/docs/guides/dev-tui.md +1 -1
- package/docs/guides/dynamic-capabilities.md +2 -2
- package/docs/guides/frontend/overview.mdx +34 -10
- package/docs/guides/instrumentation/agent-runs.mdx +16 -0
- package/docs/guides/instrumentation/otel.mdx +23 -0
- package/docs/guides/self-modification.md +1 -1
- package/docs/guides/session-context.md +1 -1
- package/docs/instructions.mdx +1 -1
- package/docs/meta.json +1 -0
- package/docs/reference/agent-files.md +4 -4
- package/docs/reference/cli.md +24 -17
- package/docs/reference/typescript-api.md +9 -3
- package/docs/sandbox/custom-providers.mdx +254 -0
- package/docs/sandbox/default.mdx +71 -4
- package/docs/sandbox/docker.mdx +15 -3
- package/docs/sandbox/index.mdx +32 -106
- package/docs/sandbox/just-bash.mdx +54 -0
- package/docs/sandbox/meta.json +9 -1
- package/docs/sandbox/troubleshooting.mdx +215 -0
- package/docs/sandbox/vercel.mdx +48 -7
- package/docs/skills.mdx +1 -1
- package/docs/subagents/index.mdx +2 -2
- package/docs/tools/overview.mdx +20 -1
- package/docs/tools/workflows.mdx +73 -5
- package/docs/tutorial/run-analysis.mdx +2 -2
- package/docs/use-cases.mdx +250 -0
- package/package.json +14 -20
- package/dist/src/compiled/@ai-sdk/code-mode/_run.d.ts +0 -1
- package/dist/src/compiled/@ai-sdk/code-mode/index.d.ts +0 -325
- package/dist/src/compiled/@ai-sdk/code-mode/index.js +0 -660
- package/dist/src/compiled/_chunks/workflow/dist-CyBgVS7g.js +0 -1
- package/dist/src/compiled/_chunks/workflow/dist-T5NnW-0k.js +0 -3
- package/dist/src/compiled/_chunks/workflow/helpers-DlLD3ov_.js +0 -1
- package/dist/src/compiled/_chunks/workflow/private-tQUuwBoQ.js +0 -1
- package/dist/src/compiled/_chunks/workflow/resume-hook-DMsV_b4n.js +0 -1
- package/dist/src/compiled/_chunks/workflow/serialization-DPdYS_w2.js +0 -16
- package/dist/src/compiled/_chunks/workflow/sleep-BY6leHh8.js +0 -1
- package/dist/src/compiled/_chunks/workflow/workflow-routes-CwqB063q.js +0 -1
- package/dist/src/execution/sandbox/active-handles.d.ts +0 -32
- package/dist/src/execution/sandbox/active-handles.js +0 -1
- package/dist/src/execution/sandbox/bindings/docker-session.d.ts +0 -6
- package/dist/src/execution/sandbox/bindings/docker-session.js +0 -2
- package/dist/src/execution/sandbox/bindings/immutable-resources.d.ts +0 -15
- package/dist/src/execution/sandbox/bindings/immutable-resources.js +0 -2
- package/dist/src/execution/sandbox/bindings/microsandbox-create.d.ts +0 -12
- package/dist/src/execution/sandbox/bindings/microsandbox-create.js +0 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-lifecycle.d.ts +0 -42
- package/dist/src/execution/sandbox/bindings/microsandbox-lifecycle.js +0 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-metadata.d.ts +0 -29
- package/dist/src/execution/sandbox/bindings/microsandbox-metadata.js +0 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-network.d.ts +0 -18
- package/dist/src/execution/sandbox/bindings/microsandbox-network.js +0 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-options.d.ts +0 -37
- package/dist/src/execution/sandbox/bindings/microsandbox-options.js +0 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-platform.d.ts +0 -21
- package/dist/src/execution/sandbox/bindings/microsandbox-platform.js +0 -21
- package/dist/src/execution/sandbox/bindings/microsandbox-process.d.ts +0 -3
- package/dist/src/execution/sandbox/bindings/microsandbox-process.js +0 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-provider-state.d.ts +0 -11
- package/dist/src/execution/sandbox/bindings/microsandbox-provider-state.js +0 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-runtime.d.ts +0 -82
- package/dist/src/execution/sandbox/bindings/microsandbox-runtime.js +0 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-templates.d.ts +0 -12
- package/dist/src/execution/sandbox/bindings/microsandbox-templates.js +0 -1
- package/dist/src/execution/sandbox/bindings/microsandbox.d.ts +0 -16
- package/dist/src/execution/sandbox/bindings/microsandbox.js +0 -1
- package/dist/src/execution/sandbox/provider-host-development.d.ts +0 -2
- package/dist/src/execution/sandbox/provider-host-development.js +0 -1
- package/dist/src/execution/sandbox/provider-host.d.ts +0 -2
- package/dist/src/execution/sandbox/provider-host.js +0 -1
- package/dist/src/execution/tool-session/sandbox.d.ts +0 -22
- package/dist/src/execution/tool-session/sandbox.js +0 -1
- package/dist/src/public/sandbox/microsandbox-sandbox.d.ts +0 -48
- package/dist/src/public/sandbox/microsandbox-sandbox.js +0 -1
- package/dist/src/public/sandbox/microsandbox.d.ts +0 -9
- package/dist/src/public/sandbox/microsandbox.js +0 -1
- package/dist/src/sandbox/providers/microsandbox.d.ts +0 -12
- package/dist/src/sandbox/providers/microsandbox.js +0 -1
- package/docs/sandbox/microsandbox.mdx +0 -31
|
@@ -1,5 +1,86 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* The filesystem a just-bash interpreter runs on. just-bash's own filesystems,
|
|
3
|
+
* such as `ReadWriteFs`, `OverlayFs`, and `MountableFs`, satisfy it.
|
|
4
|
+
*/
|
|
5
|
+
export interface JustBashFilesystem {
|
|
6
|
+
readFile(path: string, options?: {
|
|
7
|
+
encoding?: JustBashEncoding | null;
|
|
8
|
+
} | JustBashEncoding): Promise<string>;
|
|
9
|
+
readFileBuffer(path: string): Promise<Uint8Array>;
|
|
10
|
+
writeFile(path: string, content: string | Uint8Array, options?: {
|
|
11
|
+
encoding?: JustBashEncoding;
|
|
12
|
+
} | JustBashEncoding): Promise<void>;
|
|
13
|
+
appendFile(path: string, content: string | Uint8Array, options?: {
|
|
14
|
+
encoding?: JustBashEncoding;
|
|
15
|
+
} | JustBashEncoding): Promise<void>;
|
|
16
|
+
exists(path: string): Promise<boolean>;
|
|
17
|
+
stat(path: string): Promise<JustBashFileStat>;
|
|
18
|
+
lstat(path: string): Promise<JustBashFileStat>;
|
|
19
|
+
mkdir(path: string, options?: {
|
|
20
|
+
recursive?: boolean;
|
|
21
|
+
}): Promise<void>;
|
|
22
|
+
readdir(path: string): Promise<string[]>;
|
|
23
|
+
readdirWithFileTypes?(path: string): Promise<JustBashDirectoryEntry[]>;
|
|
24
|
+
rm(path: string, options?: {
|
|
25
|
+
force?: boolean;
|
|
26
|
+
recursive?: boolean;
|
|
27
|
+
}): Promise<void>;
|
|
28
|
+
cp(source: string, destination: string, options?: {
|
|
29
|
+
recursive?: boolean;
|
|
30
|
+
}): Promise<void>;
|
|
31
|
+
mv(source: string, destination: string): Promise<void>;
|
|
32
|
+
resolvePath(base: string, path: string): string;
|
|
33
|
+
getAllPaths(): string[];
|
|
34
|
+
chmod(path: string, mode: number): Promise<void>;
|
|
35
|
+
symlink(target: string, linkPath: string): Promise<void>;
|
|
36
|
+
link(existingPath: string, newPath: string): Promise<void>;
|
|
37
|
+
readlink(path: string): Promise<string>;
|
|
38
|
+
realpath(path: string): Promise<string>;
|
|
39
|
+
utimes(path: string, accessTime: Date, modificationTime: Date): Promise<void>;
|
|
40
|
+
}
|
|
41
|
+
type JustBashEncoding = "ascii" | "base64" | "binary" | "hex" | "latin1" | "utf-8" | "utf8";
|
|
42
|
+
export interface JustBashFileStat {
|
|
43
|
+
isDirectory: boolean;
|
|
44
|
+
isFile: boolean;
|
|
45
|
+
isSymbolicLink: boolean;
|
|
46
|
+
mode: number;
|
|
47
|
+
mtime: Date;
|
|
48
|
+
size: number;
|
|
49
|
+
}
|
|
50
|
+
export interface JustBashDirectoryEntry {
|
|
51
|
+
isDirectory: boolean;
|
|
52
|
+
isFile: boolean;
|
|
53
|
+
isSymbolicLink: boolean;
|
|
54
|
+
name: string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* A command registered in each live just-bash interpreter. just-bash's
|
|
58
|
+
* `defineCommand()` returns one; use it when a command needs the rest of
|
|
59
|
+
* just-bash's command context, such as standard input or `exec`.
|
|
60
|
+
*/
|
|
61
|
+
export interface JustBashCommand {
|
|
62
|
+
readonly name: string;
|
|
63
|
+
/** Runs the command with direct access to Node.js globals, as `defineCommand()` does. */
|
|
64
|
+
readonly trusted?: boolean;
|
|
65
|
+
execute(args: string[], context: JustBashCommandContext): Promise<JustBashCommandResult>;
|
|
66
|
+
}
|
|
67
|
+
/** A command that just-bash loads on its first run. */
|
|
68
|
+
export interface JustBashLazyCommand {
|
|
69
|
+
readonly name: string;
|
|
70
|
+
load(): Promise<JustBashCommand>;
|
|
71
|
+
}
|
|
72
|
+
export type JustBashCustomCommand = JustBashCommand | JustBashLazyCommand;
|
|
73
|
+
export interface JustBashCommandContext {
|
|
74
|
+
readonly cwd: string;
|
|
75
|
+
readonly env: ReadonlyMap<string, string>;
|
|
76
|
+
readonly fs: JustBashFilesystem;
|
|
77
|
+
readonly signal?: AbortSignal;
|
|
78
|
+
}
|
|
79
|
+
export interface JustBashCommandResult {
|
|
80
|
+
readonly exitCode: number;
|
|
81
|
+
readonly stderr: string;
|
|
82
|
+
readonly stdout: string;
|
|
83
|
+
}
|
|
3
84
|
/**
|
|
4
85
|
* Context passed to a custom just-bash filesystem factory for each live handle.
|
|
5
86
|
*/
|
|
@@ -9,7 +90,7 @@ export interface JustBashFilesystemContext {
|
|
|
9
90
|
/** Stable provider-private storage directory for this sandbox. */
|
|
10
91
|
readonly storagePath: string;
|
|
11
92
|
/** eve's durable, session-owned filesystem, including `/workspace`. */
|
|
12
|
-
readonly defaultFilesystem:
|
|
93
|
+
readonly defaultFilesystem: JustBashFilesystem;
|
|
13
94
|
/** The just-bash engine resolved by eve after its optional installation check. */
|
|
14
95
|
readonly justBash: typeof import("just-bash");
|
|
15
96
|
}
|
|
@@ -39,7 +120,7 @@ export interface JustBashSandboxCreateOptions {
|
|
|
39
120
|
* are responsible for validating their own inputs and cleaning up host
|
|
40
121
|
* resources.
|
|
41
122
|
*/
|
|
42
|
-
readonly customCommands?: ReadonlyArray<
|
|
123
|
+
readonly customCommands?: ReadonlyArray<JustBashCustomCommand>;
|
|
43
124
|
/**
|
|
44
125
|
* Composes the filesystem used by each live sandbox handle. The factory is
|
|
45
126
|
* called when a handle opens with eve's durable default filesystem; return a
|
|
@@ -50,7 +131,6 @@ export interface JustBashSandboxCreateOptions {
|
|
|
50
131
|
* a compatible `just-bash` version. It is not invoked during template
|
|
51
132
|
* preparation.
|
|
52
133
|
*/
|
|
53
|
-
readonly filesystem?: (context: JustBashFilesystemContext) =>
|
|
54
|
-
/** Idempotent setup captured in the prepared virtual filesystem. */
|
|
55
|
-
readonly prepare?: (sandbox: SandboxSession) => Promise<void> | void;
|
|
134
|
+
readonly filesystem?: (context: JustBashFilesystemContext) => JustBashFilesystem | Promise<JustBashFilesystem>;
|
|
56
135
|
}
|
|
136
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { JustBashSandbox, type JustBashEnvironmentOptions } from "#sandbox/providers/just-bash.js";
|
|
2
|
-
export type { JustBashFilesystemContext } from "#public/sandbox/just-bash-sandbox.js";
|
|
2
|
+
export type { JustBashCommand, JustBashCommandContext, JustBashCommandResult, JustBashCustomCommand, JustBashDirectoryEntry, JustBashFileStat, JustBashFilesystem, JustBashFilesystemContext, JustBashLazyCommand, } from "#public/sandbox/just-bash-sandbox.js";
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
export { defineSandboxProvider, type
|
|
1
|
+
export { defineSandboxProvider, type SandboxConnection, type SandboxIdentity, type SandboxJson, type SandboxPrepareContext, type SandboxPrepareOption, type SandboxProvider, type SandboxProviderDefinition, type SandboxProviderImplementation, type SandboxSessionContext, type SandboxSessionEndOptions, type WithPrepareOption, } from "#sandbox/provider.js";
|
|
2
|
+
export type { SandboxDeleteOptions, SandboxProviderFiles } from "#shared/sandbox-provider.js";
|
|
3
|
+
export { SANDBOX_AGENT_ENV } from "#execution/sandbox/session.js";
|
|
4
|
+
export { SandboxSessionGoneError } from "#shared/sandbox-session-gone-error.js";
|
|
5
|
+
export { SandboxTemplateNotProvisionedError } from "#shared/sandbox-template-error.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{SANDBOX_AGENT_ENV}from"#execution/sandbox/session.js";import{SandboxSessionGoneError}from"#shared/sandbox-session-gone-error.js";import{SandboxTemplateNotProvisionedError}from"#shared/sandbox-template-error.js";import{defineSandboxProvider}from"#sandbox/provider.js";export{SANDBOX_AGENT_ENV,SandboxSessionGoneError,SandboxTemplateNotProvisionedError,defineSandboxProvider};
|
|
@@ -42,15 +42,22 @@ type VercelSandboxAuthorCreateOptions<T> = T extends unknown ? Omit<T, "mounts"
|
|
|
42
42
|
*/
|
|
43
43
|
export type VercelSandboxCreateOptions = VercelSandboxAuthorCreateOptions<VercelCreateOptions>;
|
|
44
44
|
/** Access mode for a Drive mounted into a Vercel Sandbox. */
|
|
45
|
-
export type VercelSandboxMountMode =
|
|
46
|
-
/**
|
|
47
|
-
|
|
45
|
+
export type VercelSandboxMountMode = "read-write" | "snapshot";
|
|
46
|
+
/**
|
|
47
|
+
* A Drive mounted at one absolute path in a Vercel Sandbox: a `Drive` from
|
|
48
|
+
* `@vercel/sandbox`, mounted read-write, or a `{ drive, mode }` reference to
|
|
49
|
+
* a Drive by name, such as the one `drive.snapshot()` returns.
|
|
50
|
+
*/
|
|
51
|
+
export type VercelSandboxMount = {
|
|
52
|
+
readonly name: string;
|
|
53
|
+
} | {
|
|
54
|
+
readonly drive: string;
|
|
55
|
+
readonly mode: VercelSandboxMountMode;
|
|
56
|
+
};
|
|
48
57
|
/** Drive mounts keyed by absolute sandbox path. */
|
|
49
|
-
export type VercelSandboxMounts =
|
|
50
|
-
/** Options resolved when eve creates a fresh live session sandbox. */
|
|
51
|
-
export interface VercelSandboxMountOptions {
|
|
52
|
-
readonly mounts?: VercelSandboxMounts;
|
|
53
|
-
}
|
|
58
|
+
export type VercelSandboxMounts = Readonly<Record<string, VercelSandboxMount>>;
|
|
54
59
|
/** 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 &
|
|
60
|
+
export type VercelSandboxRuntimeOptions = Omit<VercelSandboxCreateOptions, "fetch" | "image" | "projectId" | "source" | "tags" | "teamId" | "token"> & SandboxNetworkOptions & {
|
|
61
|
+
readonly mounts?: VercelSandboxMounts;
|
|
62
|
+
};
|
|
56
63
|
export {};
|
|
@@ -8,5 +8,4 @@ export interface VercelSandboxSession extends SandboxSession {
|
|
|
8
8
|
setNetworkPolicy(policy: SandboxNetworkPolicy): Promise<void>;
|
|
9
9
|
}
|
|
10
10
|
export { VercelSandbox, type VercelSandboxEnvironmentOptions, type VercelSandboxRuntimeOptions, } from "#sandbox/providers/vercel.js";
|
|
11
|
-
export { Drive } from "#compiled/@vercel/sandbox/index.js";
|
|
12
11
|
export type { VercelSandboxMount, VercelSandboxMountMode, VercelSandboxMounts, } from "#public/sandbox/vercel-sandbox.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{VercelSandbox}from"#sandbox/providers/vercel.js";
|
|
1
|
+
import{VercelSandbox}from"#sandbox/providers/vercel.js";export{VercelSandbox};
|
|
@@ -1 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { type AgentWithModelToolInput } from "#runtime/subagents/workflow.js";
|
|
2
|
+
import { agent } from "#tools/framework/agent.js";
|
|
3
|
+
import { type WorkflowServeToolDefinition } from "#tools/workflow-definition.js";
|
|
4
|
+
export { agent, agent as default };
|
|
5
|
+
export type { AgentWithModelToolInput };
|
|
6
|
+
export type AgentWithModelTool = WorkflowServeToolDefinition<AgentWithModelToolInput, unknown>;
|
|
7
|
+
/** Root-copy agent tool whose model-facing input selects the model for each new task. */
|
|
8
|
+
export declare const agentWithModel: AgentWithModelTool;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{agent
|
|
1
|
+
import{defineJsonSchema}from"#tools/schema.js";import{frameworkTool}from"#tools/provided/framework-tool.js";import{defineWorkflowTool}from"#tools/workflow-definition.js";import{agentWithModelServeWorkflow}from"#runtime/subagents/workflow.js";import{agent}from"#tools/framework/agent.js";const inputSchema=defineJsonSchema({type:`object`,properties:{message:{type:`string`,description:`The message to send to the agent, with everything it needs to do the work.`},model:{type:`string`,minLength:1,description:`AI Gateway model id for a new child session. When continuing a task, use its original model.`}},required:[`message`,`model`],additionalProperties:!1}),agentWithModel=frameworkTool(defineWorkflowTool({availableInSubagents:!1,description:[`Delegate a focused subtask to a copy of yourself using the selected AI Gateway model.`,`Each call starts a task, so start independent tasks before waiting for them.`,`A continuation keeps its task's original model.`,`In message, state the goal, what to return, and whether it may change files.`].join(` `),inputSchema,serve:agentWithModelServeWorkflow}));export{agent,agent as default,agentWithModel};
|
|
@@ -91,7 +91,7 @@ export interface UseEveAgentOptions<TData> extends EveAgentStoreCallbacks<TData>
|
|
|
91
91
|
*/
|
|
92
92
|
readonly followIdle?: boolean;
|
|
93
93
|
/**
|
|
94
|
-
*
|
|
94
|
+
* Create a session or prepare its existing idle owner when true. React observes this value across renders;
|
|
95
95
|
* changing it from false to true prepares the current session, and reset checks
|
|
96
96
|
* the latest rendered value before preparing the next session.
|
|
97
97
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{localGatewayModel}from"#internal/model-auth/transport.js";import{RuntimeModelMetadataCacheKey}from"#context/keys.js";import{parseJsonObject}from"#shared/json.js";import{isDynamicModelDefinition}from"#shared/agent-definition.js";import{normalizeAgentDefinition,normalizeAgentPromptCache}from"#internal/authored-definition/core.js";import{formatLanguageModelGatewayId,isAgentReasoningDefinition,isRuntimeLanguageModel}from"#internal/runtime-model.js";import{loadResolvedModuleExport}from"#runtime/resolve-helpers.js";import{resolveBootstrapRuntimeModel}from"#runtime/agent/bootstrap-model.js";import{resolveMockAuthoredRuntimeModel,shouldMockAuthoredRuntimeModels}from"#runtime/agent/mock-model-adapter.js";import{createRuntimeModelCatalog}from"#runtime/agent/model-catalog.js";var InvalidRuntimeModelSelectionError=class extends Error{constructor(e,t){super(e,t),this.name=`InvalidRuntimeModelSelectionError`}};async function resolveRuntimeModelReference(e,t){let n=resolveBootstrapRuntimeModel(e);if(n!==null)return n;let r=resolveMockAuthoredRuntimeModel(e);return r===null?isSourceBackedRuntimeModelReference(e)?await loadSourceBackedRuntimeModelReference(e,t):localGatewayModel(e.id)??e.id:r}async function loadSourceBackedRuntimeModelReference(e,t){if(t===void 0)throw Error(`Expected a compiled module-map scope to resolve the authored runtime model "${e.id}".`);let n=await loadResolvedModuleExport({definition:e.source,kindLabel:`runtime model "${e.id}"`,moduleMap:t.moduleMap,nodeId:t.nodeId}),r=normalizeAgentDefinition(n,`Expected the authored agent config export "${e.source.exportName??`default`}" from "${e.source.logicalPath}" to match the public eve shape.`).model;if(
|
|
1
|
+
import{localGatewayModel}from"#internal/model-auth/transport.js";import{RuntimeModelMetadataCacheKey}from"#context/keys.js";import{parseJsonObject}from"#shared/json.js";import{isDynamicModelDefinition}from"#shared/agent-definition.js";import{normalizeAgentDefinition,normalizeAgentPromptCache}from"#internal/authored-definition/core.js";import{formatLanguageModelGatewayId,isAgentReasoningDefinition,isRuntimeLanguageModel}from"#internal/runtime-model.js";import{loadResolvedModuleExport}from"#runtime/resolve-helpers.js";import{resolveBootstrapRuntimeModel}from"#runtime/agent/bootstrap-model.js";import{resolveMockAuthoredRuntimeModel,shouldMockAuthoredRuntimeModels}from"#runtime/agent/mock-model-adapter.js";import{createRuntimeModelCatalog}from"#runtime/agent/model-catalog.js";var InvalidRuntimeModelSelectionError=class extends Error{constructor(e,t){super(e,t),this.name=`InvalidRuntimeModelSelectionError`}};async function resolveRuntimeModelReference(e,t){let n=resolveBootstrapRuntimeModel(e);if(n!==null)return n;let r=resolveMockAuthoredRuntimeModel(e);return r===null?isSourceBackedRuntimeModelReference(e)?await loadSourceBackedRuntimeModelReference(e,t):localGatewayModel(e.id)??e.id:r}async function loadSourceBackedRuntimeModelReference(e,t){if(t===void 0)throw Error(`Expected a compiled module-map scope to resolve the authored runtime model "${e.id}".`);let n=await loadResolvedModuleExport({definition:e.source,kindLabel:`runtime model "${e.id}"`,moduleMap:t.moduleMap,nodeId:t.nodeId}),r=normalizeAgentDefinition(n,`Expected the authored agent config export "${e.source.exportName??`default`}" from "${e.source.logicalPath}" to match the public eve shape.`),i=e.sourceField===`compaction.model`?r.compaction?.model:r.model;if(i===void 0)throw Error(`Expected the authored agent config export "${e.source.exportName??`default`}" from "${e.source.logicalPath}" to provide a runtime model at "${e.sourceField??`model`}".`);if(isDynamicModelDefinition(i))throw Error(`Expected the authored agent config export "${e.source.exportName??`default`}" from "${e.source.logicalPath}" to provide a static runtime model.`);return i}function isSourceBackedRuntimeModelReference(e){return e.source!==void 0}async function loadDynamicRuntimeModelDefinition(e){let t=await loadResolvedModuleExport({definition:e.dynamicModel,kindLabel:`dynamic runtime model`,moduleMap:e.scope.moduleMap,nodeId:e.scope.nodeId}),n=normalizeAgentDefinition(t,`Expected the authored agent config export "${e.dynamicModel.exportName??`default`}" from "${e.dynamicModel.logicalPath}" to match the public eve shape.`).model;if(!isDynamicModelDefinition(n))throw Error(`Expected the authored agent config export "${e.dynamicModel.exportName??`default`}" from "${e.dynamicModel.logicalPath}" to provide a dynamic model definition.`);return n}async function resolveRuntimeModelSelection(e){if(e.selection===null||e.selection===void 0)throw new InvalidRuntimeModelSelectionError(`Dynamic model resolver returned no model. Every matching dynamic model handler must return a concrete model selection.`);let t,n,r;try{t=normalizeDynamicModelSelection(e.selection),validateDynamicModelSelection(t),n=t.modelOptions?.providerOptions===void 0?void 0:parseProviderOptionsRecord(t.modelOptions.providerOptions),r=t.modelOptions?.promptCache===void 0?void 0:normalizeAgentPromptCache(t.modelOptions.promptCache,`Dynamic model resolver returned an invalid selection.`)}catch(e){throw invalidSelectionError(e)}let i=t.model,a=e.catalog??runtimeModelCatalogForState(e.state);if(typeof i==`string`){let o=formatLanguageModelGatewayId(i);if(r!==void 0)throw gatewayPromptCacheError(o);let s=await resolveSelectionMetadata({cacheKey:`gateway:${o}`,catalog:a,contextWindowTokens:t.modelContextWindowTokens,load:e=>e.getByGatewayId(o),modelLabel:o,state:e.state});return{reference:{id:s.resolvedModelId,contextWindowTokens:s.contextWindowTokens,maxOutputTokens:s.maxOutputTokens,providerOptions:n,reasoning:t.reasoning}}}if(validateRuntimeLanguageModel(i),e.durability===`durable`)throw new InvalidRuntimeModelSelectionError(`Dynamic model selection returned a provider object, but durable model selections must be serializable. Return a model id string, or use a "step.started" model resolver.`);let o=formatLanguageModelGatewayId(i),s=i.provider.split(`.`)[0];if(r!==void 0&&s===`gateway`)throw gatewayPromptCacheError(o);let c=await resolveSelectionMetadata({cacheKey:s===`gateway`?`gateway:${i.modelId}`:`provider:${i.provider}:${i.modelId}`,catalog:a,contextWindowTokens:t.modelContextWindowTokens,load:e=>s===`gateway`?e.getByGatewayId(i.modelId):e.getByProviderModelId(i.provider,i.modelId),modelLabel:o,state:e.state});return{model:i,reference:{id:c.resolvedModelId,contextWindowTokens:c.contextWindowTokens,maxOutputTokens:c.maxOutputTokens,promptCache:r,providerOptions:n,reasoning:t.reasoning}}}function invalidSelectionError(e){return e instanceof InvalidRuntimeModelSelectionError?e:new InvalidRuntimeModelSelectionError(e instanceof Error?e.message:String(e),{cause:e})}function gatewayPromptCacheError(e){return new InvalidRuntimeModelSelectionError(`Dynamic model resolver returned modelOptions.promptCache for "${e}", which routes through AI Gateway. promptCache applies only to models eve calls directly; Gateway manages its own prompt caching through providerOptions.gateway.caching.`)}const runtimeModelCatalogsByState=new WeakMap;function runtimeModelCatalogForState(e){let t=runtimeModelCatalogsByState.get(e);if(t!==void 0)return t;let n=createRuntimeModelCatalog();return runtimeModelCatalogsByState.set(e,n),n}async function resolveSelectionMetadata(e){if(e.contextWindowTokens!==void 0)return{contextWindowTokens:e.contextWindowTokens,resolvedModelId:e.modelLabel};let t=Date.now(),n=e.state.get(RuntimeModelMetadataCacheKey)?.[e.cacheKey];if(n!==void 0&&n.expiresAt>t)return n;let r=await e.load(e.catalog);if(r===null)throw new InvalidRuntimeModelSelectionError(`Cannot select model "${e.modelLabel}" because AI Gateway did not provide context window metadata. Return modelContextWindowTokens with this selection for an unlisted or custom model.`);let i={...r,expiresAt:t+864e5};return e.state.set(RuntimeModelMetadataCacheKey,n=>({...Object.fromEntries(Object.entries(n??{}).filter(([,e])=>e.expiresAt>t)),[e.cacheKey]:i})),i}const DYNAMIC_MODEL_SELECTION_KEYS=new Set([`model`,`modelContextWindowTokens`,`modelOptions`,`reasoning`]);function validateDynamicModelSelection(e){let t=Object.keys(e).filter(e=>!DYNAMIC_MODEL_SELECTION_KEYS.has(e));if(t.length>0)throw Error(`Dynamic model resolver returned a selection with unknown key(s): ${t.join(`, `)}. Expected { model, reasoning?, modelContextWindowTokens?, modelOptions? }.`);if(e.reasoning!==void 0&&!isAgentReasoningDefinition(e.reasoning))throw Error(`Dynamic model resolver returned an invalid reasoning effort. Expected provider-default, none, minimal, low, medium, high, or xhigh.`);let n=e.modelContextWindowTokens;if(n!==void 0&&(!Number.isInteger(n)||n<=0))throw Error(`Dynamic model resolver returned an invalid modelContextWindowTokens value. Expected a positive integer.`);if(typeof e.model==`string`&&e.model.trim()===``)throw Error(`Dynamic model resolver returned an empty model id.`)}function normalizeDynamicModelSelection(e){return isModelSelectionDefinition(e)?e:{model:e}}function isModelSelectionDefinition(e){return typeof e==`object`&&!!e&&`model`in e&&!isRuntimeLanguageModel(e)}function validateRuntimeLanguageModel(e){if(!isRuntimeLanguageModel(e))throw new InvalidRuntimeModelSelectionError(`Dynamic model resolver returned an invalid model. Return an AI Gateway model id string, an AI SDK language model, or { model, modelContextWindowTokens?, modelOptions? }.`)}function parseProviderOptionsRecord(e){if(e===void 0)return;let t={};for(let[n,r]of Object.entries(e))t[n]=parseJsonObject(r);return t}export{InvalidRuntimeModelSelectionError,loadDynamicRuntimeModelDefinition,resolveRuntimeModelReference,resolveRuntimeModelSelection,shouldMockAuthoredRuntimeModels};
|
|
@@ -15,6 +15,8 @@ interface OpenApiToolResult {
|
|
|
15
15
|
readonly status: number;
|
|
16
16
|
readonly statusText: string;
|
|
17
17
|
readonly body: unknown;
|
|
18
|
+
/** Target of a redirect to another origin, which eve returns instead of following. */
|
|
19
|
+
location?: string;
|
|
18
20
|
}
|
|
19
21
|
/**
|
|
20
22
|
* A {@link ConnectionClient} that turns an OpenAPI 3.x or Swagger 2.0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createLogger}from"#internal/logging.js";import{isObject}from"#shared/guards.js";import{isLoopbackHostname}from"#shared/network-address.js";import{parseJsonObject}from"#shared/json.js";import{resolveHeaders}from"#runtime/connections/mcp-client.js";import{omitProvidedArgumentsFromSchema,resolveProvidedArguments}from"#runtime/connections/provided-arguments.js";import{HTTP_METHODS,operationDescription,operationName,uniqueName}from"#runtime/connections/openapi-operations.js";import{buildInputSchema,deref,derefSchema,isArray}from"#runtime/connections/openapi-schema.js";import{applySecurity,resolveSecurity}from"#runtime/connections/openapi-security.js";import{extractServerUrl,parseSpecDocument}from"#runtime/connections/openapi-spec.js";const log=createLogger(`runtime.connections.openapi-client`),SWAGGER_PARAMETER_SCHEMA_KEYS=[`default`,`enum`,`exclusiveMaximum`,`exclusiveMinimum`,`format`,`items`,`maximum`,`maxItems`,`maxLength`,`minimum`,`minItems`,`minLength`,`multipleOf`,`pattern`,`type`,`uniqueItems`];var OpenApiConnectionClient=class{#e;#t;#n;constructor(e){this.#n=e}async connect(){return this.#r()}async getToolMetadata(){return(await this.#r()).metadata}async executeTool(e,t,n){let r=await this.#r(),i=r.operations.get(e);if(i===void 0)throw Error(`Tool "${e}" not found in connection "${this.#n.connectionName}".`);return this.#f(i,r.baseUrl,isObject(t)?t:{},{abortSignal:n.abortSignal,callId:n.callId})}async close(){this.#e=void 0,this.#t=void 0}async#r(){if(this.#t!==void 0)return this.#t;if(this.#e!==void 0)return this.#e;this.#e=this.#i();try{return this.#t=await this.#e,this.#t}catch(e){throw this.#e=void 0,e}}async#i(){let e=await this.#o(),t=this.#a(e),n=this.#s(e),r=[],i=new Map,a=Object.keys(this.#n.toolCall?.providedArguments??{});for(let e of n){let t;try{t=parseJsonObject(omitProvidedArgumentsFromSchema(e.inputSchema,a))}catch(t){log.warn(`omitting OpenAPI operation with an invalid input schema`,{connectionName:this.#n.connectionName,error:t,toolName:e.toolName});continue}i.set(e.toolName,e),r.push({description:e.description,inputSchema:t,name:e.toolName})}return{metadata:r,operations:i,baseUrl:t}}#a(e){let t=this.#n.url,n=typeof t==`string`&&t.trim().length>0?t:extractServerUrl(e,this.#n.spec);if(n===void 0)throw Error(`OpenAPI connection "${this.#n.connectionName}" has no base URL: set "baseUrl" or ensure the document declares an absolute "servers" entry or Swagger "host".`);return assertSecureUrl(n,this.#n.connectionName,`base`),n}async#o(){let e=this.#n.spec;if(e===void 0)throw Error(`OpenAPI connection "${this.#n.connectionName}" is missing its "spec" source.`);if(typeof e!=`string`)return e;assertSecureUrl(e,this.#n.connectionName,`spec`);let t;try{t=await fetch(e,{headers:{accept:`application/json, application/yaml, text/yaml, */*`}})}catch(t){throw Error(`OpenAPI connection "${this.#n.connectionName}" failed to fetch its spec from "${e}": ${String(t)}`)}if(t.redirected&&assertSecureUrl(t.url,this.#n.connectionName,`spec`),!t.ok)throw Error(`OpenAPI connection "${this.#n.connectionName}" failed to fetch its spec from "${e}": HTTP ${t.status}.`);let n=await t.text(),r;try{r=parseSpecDocument(n)}catch(t){throw Error(`OpenAPI connection "${this.#n.connectionName}" spec at "${e}" could not be parsed as JSON or YAML: ${String(t)}`)}if(!isObject(r))throw Error(`OpenAPI connection "${this.#n.connectionName}" spec at "${e}" is not an OpenAPI document object.`);return r}#s(e){let t=e.paths;if(!isObject(t))return[];let n=[],r=new Set;for(let[i,a]of Object.entries(t)){if(!isObject(a))continue;let t=isArray(a.parameters)?a.parameters:[];for(let o of HTTP_METHODS){let s=a[o];if(!isObject(s))continue;let c=uniqueName(operationName(s,o,i),r),l=isArray(s.parameters)?s.parameters:[],u=[...t,...l],d=this.#c(e,u),f=this.#l(e,s.requestBody,u);n.push({toolName:c,method:o,pathTemplate:i,description:operationDescription(s),parameters:d,requestBody:f,inputSchema:buildInputSchema(d,f),security:resolveSecurity(e,s)})}}return n}#c(e,t){let n=[];for(let r of t){let t=isObject(r)?deref(e,r):r;if(!isObject(t))continue;let i=t.in;if(i!==`path`&&i!==`query`&&i!==`header`&&i!==`cookie`||typeof t.name!=`string`)continue;let a=this.#u(e,t);n.push({name:t.name,location:i,required:t.required===!0||i===`path`,schema:a,description:typeof t.description==`string`?t.description:void 0})}return n}#l(e,t,n=[]){if(isObject(t)){let n=deref(e,t);if(isObject(n)&&isObject(n.content)){let t=n.content,r=`application/json`in t?`application/json`:Object.keys(t)[0];if(r!==void 0){let i=t[r],a=isObject(i)&&isObject(i.schema)?derefSchema(e,i.schema):{};return{required:n.required===!0,contentType:r,schema:a}}}}return this.#d(e,n)}#u(e,t){if(isObject(t.schema))return derefSchema(e,t.schema);let n={};for(let e of SWAGGER_PARAMETER_SCHEMA_KEYS)t[e]!==void 0&&(n[e]=t[e]);return derefSchema(e,n)}#d(e,t){for(let n of t){let t=isObject(n)?deref(e,n):n;if(!isObject(t)||t.in!==`body`)continue;let r=isObject(t.schema)?derefSchema(e,t.schema):{};return{required:t.required===!0,contentType:`application/json`,schema:r}}}async#f(e,t,n,r){let i=await resolveProvidedArguments({args:n,callId:r.callId,connection:this.#n,toolName:e.toolName}),a=await resolveHeaders(this.#n),o=e.pathTemplate,s=new URLSearchParams,c=[];for(let t of e.parameters){let n=i[t.name];if(n!=null){if(t.location===`path`){let r=String(n);if(r===`.`||r===`..`)throw Error(`Path parameter "${t.name}" for tool "${e.toolName}" in connection "${this.#n.connectionName}" must not be "." or "..".`);o=o.replace(`{${t.name}}`,encodeURIComponent(r))}else t.location===`query`?appendQuery(s,t.name,n):t.location===`cookie`?c.push(`${t.name}=${encodeURIComponent(String(n))}`):a[t.name]=String(n)}}if(applySecurity(e.security,this.#n,a,s,c),c.length>0){let e=a.cookie??a.Cookie;delete a.Cookie,a.cookie=[e,...c].filter(e=>!!e).join(`; `)}let l=new URL(joinPath(t,o));l.search=s.toString();let u;e.requestBody!==void 0&&i.body!==void 0&&(u=JSON.stringify(i.body),a[`content-type`]=e.requestBody.contentType);let
|
|
1
|
+
import{createLogger}from"#internal/logging.js";import{isObject}from"#shared/guards.js";import{isLoopbackHostname}from"#shared/network-address.js";import{parseJsonObject}from"#shared/json.js";import{resolveHeaders}from"#runtime/connections/mcp-client.js";import{omitProvidedArgumentsFromSchema,resolveProvidedArguments}from"#runtime/connections/provided-arguments.js";import{HTTP_METHODS,operationDescription,operationName,uniqueName}from"#runtime/connections/openapi-operations.js";import{buildInputSchema,deref,derefSchema,isArray}from"#runtime/connections/openapi-schema.js";import{applySecurity,resolveSecurity}from"#runtime/connections/openapi-security.js";import{extractServerUrl,parseSpecDocument}from"#runtime/connections/openapi-spec.js";const log=createLogger(`runtime.connections.openapi-client`),SWAGGER_PARAMETER_SCHEMA_KEYS=[`default`,`enum`,`exclusiveMaximum`,`exclusiveMinimum`,`format`,`items`,`maximum`,`maxItems`,`maxLength`,`minimum`,`minItems`,`minLength`,`multipleOf`,`pattern`,`type`,`uniqueItems`];var OpenApiConnectionClient=class{#e;#t;#n;constructor(e){this.#n=e}async connect(){return this.#r()}async getToolMetadata(){return(await this.#r()).metadata}async executeTool(e,t,n){let r=await this.#r(),i=r.operations.get(e);if(i===void 0)throw Error(`Tool "${e}" not found in connection "${this.#n.connectionName}".`);return this.#f(i,r.baseUrl,isObject(t)?t:{},{abortSignal:n.abortSignal,callId:n.callId})}async close(){this.#e=void 0,this.#t=void 0}async#r(){if(this.#t!==void 0)return this.#t;if(this.#e!==void 0)return this.#e;this.#e=this.#i();try{return this.#t=await this.#e,this.#t}catch(e){throw this.#e=void 0,e}}async#i(){let e=await this.#o(),t=this.#a(e),n=this.#s(e),r=[],i=new Map,a=Object.keys(this.#n.toolCall?.providedArguments??{});for(let e of n){let t;try{t=parseJsonObject(omitProvidedArgumentsFromSchema(e.inputSchema,a))}catch(t){log.warn(`omitting OpenAPI operation with an invalid input schema`,{connectionName:this.#n.connectionName,error:t,toolName:e.toolName});continue}i.set(e.toolName,e),r.push({description:e.description,inputSchema:t,name:e.toolName})}return{metadata:r,operations:i,baseUrl:t}}#a(e){let t=this.#n.url,n=typeof t==`string`&&t.trim().length>0?t:extractServerUrl(e,this.#n.spec);if(n===void 0)throw Error(`OpenAPI connection "${this.#n.connectionName}" has no base URL: set "baseUrl" or ensure the document declares an absolute "servers" entry or Swagger "host".`);return assertSecureUrl(n,this.#n.connectionName,`base`),n}async#o(){let e=this.#n.spec;if(e===void 0)throw Error(`OpenAPI connection "${this.#n.connectionName}" is missing its "spec" source.`);if(typeof e!=`string`)return e;assertSecureUrl(e,this.#n.connectionName,`spec`);let t;try{t=await fetch(e,{headers:{accept:`application/json, application/yaml, text/yaml, */*`}})}catch(t){throw Error(`OpenAPI connection "${this.#n.connectionName}" failed to fetch its spec from "${e}": ${String(t)}`)}if(t.redirected&&assertSecureUrl(t.url,this.#n.connectionName,`spec`),!t.ok)throw Error(`OpenAPI connection "${this.#n.connectionName}" failed to fetch its spec from "${e}": HTTP ${t.status}.`);let n=await t.text(),r;try{r=parseSpecDocument(n)}catch(t){throw Error(`OpenAPI connection "${this.#n.connectionName}" spec at "${e}" could not be parsed as JSON or YAML: ${String(t)}`)}if(!isObject(r))throw Error(`OpenAPI connection "${this.#n.connectionName}" spec at "${e}" is not an OpenAPI document object.`);return r}#s(e){let t=e.paths;if(!isObject(t))return[];let n=[],r=new Set;for(let[i,a]of Object.entries(t)){if(!isObject(a))continue;let t=isArray(a.parameters)?a.parameters:[];for(let o of HTTP_METHODS){let s=a[o];if(!isObject(s))continue;let c=uniqueName(operationName(s,o,i),r),l=isArray(s.parameters)?s.parameters:[],u=[...t,...l],d=this.#c(e,u),f=this.#l(e,s.requestBody,u);n.push({toolName:c,method:o,pathTemplate:i,description:operationDescription(s),parameters:d,requestBody:f,inputSchema:buildInputSchema(d,f),security:resolveSecurity(e,s)})}}return n}#c(e,t){let n=[];for(let r of t){let t=isObject(r)?deref(e,r):r;if(!isObject(t))continue;let i=t.in;if(i!==`path`&&i!==`query`&&i!==`header`&&i!==`cookie`||typeof t.name!=`string`)continue;let a=this.#u(e,t);n.push({name:t.name,location:i,required:t.required===!0||i===`path`,schema:a,description:typeof t.description==`string`?t.description:void 0})}return n}#l(e,t,n=[]){if(isObject(t)){let n=deref(e,t);if(isObject(n)&&isObject(n.content)){let t=n.content,r=`application/json`in t?`application/json`:Object.keys(t)[0];if(r!==void 0){let i=t[r],a=isObject(i)&&isObject(i.schema)?derefSchema(e,i.schema):{};return{required:n.required===!0,contentType:r,schema:a}}}}return this.#d(e,n)}#u(e,t){if(isObject(t.schema))return derefSchema(e,t.schema);let n={};for(let e of SWAGGER_PARAMETER_SCHEMA_KEYS)t[e]!==void 0&&(n[e]=t[e]);return derefSchema(e,n)}#d(e,t){for(let n of t){let t=isObject(n)?deref(e,n):n;if(!isObject(t)||t.in!==`body`)continue;let r=isObject(t.schema)?derefSchema(e,t.schema):{};return{required:t.required===!0,contentType:`application/json`,schema:r}}}async#f(e,t,n,r){let i=await resolveProvidedArguments({args:n,callId:r.callId,connection:this.#n,toolName:e.toolName}),a=await resolveHeaders(this.#n),o=e.pathTemplate,s=new URLSearchParams,c=[];for(let t of e.parameters){let n=i[t.name];if(n!=null){if(t.location===`path`){let r=String(n);if(r===`.`||r===`..`)throw Error(`Path parameter "${t.name}" for tool "${e.toolName}" in connection "${this.#n.connectionName}" must not be "." or "..".`);o=o.replace(`{${t.name}}`,encodeURIComponent(r))}else t.location===`query`?appendQuery(s,t.name,n):t.location===`cookie`?c.push(`${t.name}=${encodeURIComponent(String(n))}`):a[t.name]=String(n)}}if(applySecurity(e.security,this.#n,a,s,c),c.length>0){let e=a.cookie??a.Cookie;delete a.Cookie,a.cookie=[e,...c].filter(e=>!!e).join(`; `)}let l=new URL(joinPath(t,o));l.search=s.toString();let u;e.requestBody!==void 0&&i.body!==void 0&&(u=JSON.stringify(i.body),a[`content-type`]=e.requestBody.contentType);let{response:d,location:f}=await fetchWithinOrigin(l,{method:e.method.toUpperCase(),headers:a,body:u,signal:r?.abortSignal},this.#n.connectionName),p={status:d.status,statusText:d.statusText,body:await readResponseBody(d)};return f!==void 0&&(p.location=f),p}};const REDIRECT_STATUSES=new Set([301,302,303,307,308]);async function fetchWithinOrigin(e,t,n){let r=e,i=t;for(let t=0;;t++){let a=await fetch(r,{...i,redirect:`manual`}),o=a.headers.get(`location`);if(!REDIRECT_STATUSES.has(a.status)||o===null)return{response:a};let s=URL.parse(o,r.href);if(s===null)return{response:a};if(s.origin!==e.origin)return{response:a,location:s.href};if(await a.body?.cancel(),t>=10)throw Error(`OpenAPI connection "${n}" stopped after 10 redirects from "${e.origin}${e.pathname}", last to "${s.pathname}". The API may be redirecting in a loop.`);r=s,i=redirectedRequest(i,a.status)}}function redirectedRequest(e,t){if(!(t===303&&e.method!==`GET`&&e.method!==`HEAD`||(t===301||t===302)&&e.method===`POST`))return e;let n=Object.fromEntries(Object.entries(e.headers).filter(([e])=>e.toLowerCase()!==`content-type`));return{...e,method:`GET`,headers:n,body:void 0}}function appendQuery(e,t,n){if(isArray(n)){for(let r of n)e.append(t,String(r));return}e.append(t,String(n))}function joinPath(e,t){return`${e.endsWith(`/`)?e.slice(0,-1):e}${t.startsWith(`/`)?t:`/${t}`}`}function assertSecureUrl(e,t,n){let r;try{r=new URL(e)}catch{throw Error(`OpenAPI connection "${t}" has an invalid ${n} URL "${e}".`)}if(r.protocol!==`https:`&&!(r.protocol===`http:`&&isLoopbackHostname(r.hostname)))throw Error(`OpenAPI connection "${t}" must use https for its ${n} (got "${r.protocol}//${r.host}").`)}async function readResponseBody(e){let t=await e.text();if(t.length===0)return null;if((e.headers.get(`content-type`)??``).includes(`application/json`))try{return JSON.parse(t)}catch{return t}return t}export{OpenApiConnectionClient};
|
|
@@ -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{ROOT_RUNTIME_AGENT_NODE_ID}from"#runtime/graph.js";import{createRuntimeToolRegistry}from"#runtime/tools/registry.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";
|
|
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{ROOT_RUNTIME_AGENT_NODE_ID}from"#runtime/graph.js";import{createRuntimeToolRegistry}from"#runtime/tools/registry.js";import{createRuntimeSandboxRegistry}from"#runtime/sandbox/registry.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";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},{deferSelfAgent:n.config?.tool===`deferred`,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: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,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),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. Only a declared subagent can share its parent's sandbox with defineParentSandbox(). Give this agent its own sandbox with defineSandbox() and an exported environment.`,{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 +1 @@
|
|
|
1
|
-
import{normalizeAgentDefinition}from"#internal/authored-definition/core.js";import{resolveConnectionDefinition}from"#runtime/resolve-connection.js";import{createResolvedModuleSourceRef,loadResolvedModuleExport}from"#runtime/resolve-helpers.js";import{resolveChannelDefinition}from"#runtime/resolve-channel.js";import{resolveDynamicConnectionDefinition}from"#runtime/resolve-dynamic-connection.js";import{resolveHookDefinition}from"#runtime/resolve-hook.js";import{resolveSandboxDefinition}from"#runtime/resolve-sandbox.js";import{resolveDynamicInstructionsDefinition}from"#runtime/resolve-dynamic-instructions.js";import{resolveDynamicSkillDefinition}from"#runtime/resolve-dynamic-skill.js";import{resolveDynamicToolDefinition}from"#runtime/resolve-dynamic-tool.js";import{resolveToolDefinition}from"#runtime/resolve-tool.js";import{resolveMemoryDefinition}from"#runtime/resolve-memory.js";async function resolveAgent(e){let t=e.manifest.skills.map(t=>({...t,owner:requireCompiledSourceOwner(e.manifest,t),metadata:t.metadata===void 0?void 0:{...t.metadata}})),n=await Promise.all(e.manifest.channelRoutes.effective.map(t=>resolveChannelDefinition(t,e.moduleMap,e.nodeId))),r=await Promise.all(e.manifest.tools.map(t=>resolveToolDefinition(t,e.moduleMap,e.nodeId,requireBindingOwner(e.manifest,t.sourceId)))),i=await Promise.all(e.manifest.dynamicConnections.map(t=>resolveDynamicConnectionDefinition(t,e.moduleMap,e.nodeId))),a=await Promise.all((e.manifest.dynamicInstructions??[]).map(t=>resolveDynamicInstructionsDefinition(t,e.moduleMap,e.nodeId))),o=await Promise.all((e.manifest.dynamicSkills??[]).map(t=>resolveDynamicSkillDefinition(t,e.moduleMap,e.nodeId))),s=await Promise.all(e.manifest.dynamicTools.map(t=>resolveDynamicToolDefinition(t,e.moduleMap,e.nodeId))),c=await Promise.all(e.manifest.hooks.map(t=>resolveHookDefinition(t,e.moduleMap,e.nodeId))),l=await Promise.all(e.manifest.connections.map(t=>resolveConnectionDefinition(t,e.moduleMap,e.nodeId))),u=await Promise.all(e.manifest.memories.map(t=>resolveMemoryDefinition(t,e.moduleMap,e.nodeId))),d=await resolveSandboxDefinition(e.manifest.sandbox,e.moduleMap,e.nodeId),f=e.manifest.instructions.map(t=>createResolvedInstructionsDefinition(e.manifest,t)),p=e.manifest.workspaceResourceRoot,m={channels:n,connections:l,dynamicConnectionResolvers:i,dynamicInstructionsResolvers:a,dynamicSkillResolvers:o,dynamicToolResolvers:s,hooks:c,instructions:f,metadata:{agentRoot:e.manifest.agentRoot,appRoot:e.manifest.appRoot,diagnosticsSummary:e.manifest.diagnosticsSummary},memories:u,sandbox:d,workspaceResourceRoot:p,skills:t,tools:r,workspaceSpec:{rootEntries:[...p.rootEntries]}};return`config`in e.manifest?{...m,config:createResolvedAgentConfig(e.manifest,await loadSessionUsageLimit(e.manifest,e.moduleMap,e.nodeId))}:m}async function loadSessionUsageLimit(e,t,n){let r=e.config.source;if(e.config.limits?.sessionUsage!==!0||r===void 0)return;let i=await loadResolvedModuleExport({definition:r,kindLabel:`agent config`,moduleMap:t,nodeId:n});return normalizeAgentDefinition(i,`Expected the authored agent config export "${r.exportName??`default`}" from "${r.logicalPath}" to match the public eve shape.`).limits?.sessionUsage}function requireBindingOwner(e,t){let n=e.bindings[t];if(n===void 0)throw Error(`Compiled source "${t}" has no binding.`);return n.owner}function createResolvedInstructionsDefinition(e,t){return{content:t.content,name:t.name,owner:requireCompiledSourceOwner(e,t),logicalPath:t.logicalPath,role:t.role,sourceId:t.sourceId,sourceKind:t.sourceKind}}function requireCompiledSourceOwner(e,t){let n=e.bindings[t.sourceId]?.owner??t.owner;if(n===void 0)throw Error(`Compiled source "${t.sourceId}" has no owner.`);return n}function createResolvedAgentConfig(e,t){let n={name:e.config.name};if(e.config.defaultTools!==void 0&&(n.defaultTools=e.config.defaultTools),e.config.description!==void 0&&(n.description=e.config.description),e.config.compaction!==void 0){let t={};e.config.compaction.model!==void 0&&(t.model=e.config.compaction.model.source===void 0?{contextWindowTokens:e.config.compaction.model.contextWindowTokens,id:e.config.compaction.model.id,maxOutputTokens:e.config.compaction.model.maxOutputTokens,providerOptions:e.config.compaction.model.providerOptions}:{contextWindowTokens:e.config.compaction.model.contextWindowTokens,id:e.config.compaction.model.id,maxOutputTokens:e.config.compaction.model.maxOutputTokens,providerOptions:e.config.compaction.model.providerOptions,source:{exportName:e.config.compaction.model.source.exportName,sourceKind:`module`,logicalPath:e.config.compaction.model.source.logicalPath,sourceId:e.config.compaction.model.source.sourceId}}),e.config.compaction.thresholdPercent!==void 0&&(t.thresholdPercent=e.config.compaction.thresholdPercent),n.compaction=t}if(e.config.experimental!==void 0&&(n.experimental={workflow:e.config.experimental.workflow===void 0?void 0:{modelCallsPerStep:e.config.experimental.workflow.modelCallsPerStep,retention:e.config.experimental.workflow.retention,world:e.config.experimental.workflow.world}}),e.config.reasoning!==void 0&&(n.reasoning=e.config.reasoning),e.config.source!==void 0&&(n.source=createResolvedModuleSourceRef(e.config.source)),e.config.tool!==void 0&&(n.tool=e.config.tool),e.config.limits!==void 0&&(n.limits={sessionTimeoutMs:e.config.limits.sessionTimeoutMs,sessionUsage:t}),e.config.dynamicModel!==void 0)return{...n,dynamicModel:{...createResolvedModuleSourceRef(e.config.dynamicModel),eventNames:[...e.config.dynamicModel.eventNames]}};let r=e.config.model;return{...n,model:r.source===void 0?{id:r.id,contextWindowTokens:r.contextWindowTokens,maxOutputTokens:r.maxOutputTokens,providerOptions:r.providerOptions}:{contextWindowTokens:r.contextWindowTokens,id:r.id,maxOutputTokens:r.maxOutputTokens,promptCache:r.promptCache,providerOptions:r.providerOptions,source:{exportName:r.source.exportName,sourceKind:`module`,logicalPath:r.source.logicalPath,sourceId:r.source.sourceId}}}}export{resolveAgent};
|
|
1
|
+
import{normalizeAgentDefinition}from"#internal/authored-definition/core.js";import{resolveConnectionDefinition}from"#runtime/resolve-connection.js";import{createResolvedModuleSourceRef,loadResolvedModuleExport}from"#runtime/resolve-helpers.js";import{resolveChannelDefinition}from"#runtime/resolve-channel.js";import{resolveDynamicConnectionDefinition}from"#runtime/resolve-dynamic-connection.js";import{resolveHookDefinition}from"#runtime/resolve-hook.js";import{resolveSandboxDefinition}from"#runtime/resolve-sandbox.js";import{resolveDynamicInstructionsDefinition}from"#runtime/resolve-dynamic-instructions.js";import{resolveDynamicSkillDefinition}from"#runtime/resolve-dynamic-skill.js";import{resolveDynamicToolDefinition}from"#runtime/resolve-dynamic-tool.js";import{resolveToolDefinition}from"#runtime/resolve-tool.js";import{resolveMemoryDefinition}from"#runtime/resolve-memory.js";async function resolveAgent(e){let t=e.manifest.skills.map(t=>({...t,owner:requireCompiledSourceOwner(e.manifest,t),metadata:t.metadata===void 0?void 0:{...t.metadata}})),n=await Promise.all(e.manifest.channelRoutes.effective.map(t=>resolveChannelDefinition(t,e.moduleMap,e.nodeId))),r=await Promise.all(e.manifest.tools.map(t=>resolveToolDefinition(t,e.moduleMap,e.nodeId,requireBindingOwner(e.manifest,t.sourceId)))),i=await Promise.all(e.manifest.dynamicConnections.map(t=>resolveDynamicConnectionDefinition(t,e.moduleMap,e.nodeId))),a=await Promise.all((e.manifest.dynamicInstructions??[]).map(t=>resolveDynamicInstructionsDefinition(t,e.moduleMap,e.nodeId))),o=await Promise.all((e.manifest.dynamicSkills??[]).map(t=>resolveDynamicSkillDefinition(t,e.moduleMap,e.nodeId))),s=await Promise.all(e.manifest.dynamicTools.map(t=>resolveDynamicToolDefinition(t,e.moduleMap,e.nodeId))),c=await Promise.all(e.manifest.hooks.map(t=>resolveHookDefinition(t,e.moduleMap,e.nodeId))),l=await Promise.all(e.manifest.connections.map(t=>resolveConnectionDefinition(t,e.moduleMap,e.nodeId))),u=await Promise.all(e.manifest.memories.map(t=>resolveMemoryDefinition(t,e.moduleMap,e.nodeId))),d=await resolveSandboxDefinition(e.manifest.sandbox,e.moduleMap,e.nodeId),f=e.manifest.instructions.map(t=>createResolvedInstructionsDefinition(e.manifest,t)),p=e.manifest.workspaceResourceRoot,m={channels:n,connections:l,dynamicConnectionResolvers:i,dynamicInstructionsResolvers:a,dynamicSkillResolvers:o,dynamicToolResolvers:s,hooks:c,instructions:f,metadata:{agentRoot:e.manifest.agentRoot,appRoot:e.manifest.appRoot,diagnosticsSummary:e.manifest.diagnosticsSummary},memories:u,sandbox:d,workspaceResourceRoot:p,skills:t,tools:r,workspaceSpec:{rootEntries:[...p.rootEntries]}};return`config`in e.manifest?{...m,config:createResolvedAgentConfig(e.manifest,await loadSessionUsageLimit(e.manifest,e.moduleMap,e.nodeId))}:m}async function loadSessionUsageLimit(e,t,n){let r=e.config.source;if(e.config.limits?.sessionUsage!==!0||r===void 0)return;let i=await loadResolvedModuleExport({definition:r,kindLabel:`agent config`,moduleMap:t,nodeId:n});return normalizeAgentDefinition(i,`Expected the authored agent config export "${r.exportName??`default`}" from "${r.logicalPath}" to match the public eve shape.`).limits?.sessionUsage}function requireBindingOwner(e,t){let n=e.bindings[t];if(n===void 0)throw Error(`Compiled source "${t}" has no binding.`);return n.owner}function createResolvedInstructionsDefinition(e,t){return{content:t.content,name:t.name,owner:requireCompiledSourceOwner(e,t),logicalPath:t.logicalPath,role:t.role,sourceId:t.sourceId,sourceKind:t.sourceKind}}function requireCompiledSourceOwner(e,t){let n=e.bindings[t.sourceId]?.owner??t.owner;if(n===void 0)throw Error(`Compiled source "${t.sourceId}" has no owner.`);return n}function createResolvedAgentConfig(e,t){let n={name:e.config.name};if(e.config.defaultTools!==void 0&&(n.defaultTools=e.config.defaultTools),e.config.description!==void 0&&(n.description=e.config.description),e.config.compaction!==void 0){let t={};e.config.compaction.model!==void 0&&(t.model=e.config.compaction.model.source===void 0?{contextWindowTokens:e.config.compaction.model.contextWindowTokens,id:e.config.compaction.model.id,maxOutputTokens:e.config.compaction.model.maxOutputTokens,providerOptions:e.config.compaction.model.providerOptions}:{contextWindowTokens:e.config.compaction.model.contextWindowTokens,id:e.config.compaction.model.id,maxOutputTokens:e.config.compaction.model.maxOutputTokens,providerOptions:e.config.compaction.model.providerOptions,source:{exportName:e.config.compaction.model.source.exportName,sourceKind:`module`,logicalPath:e.config.compaction.model.source.logicalPath,sourceId:e.config.compaction.model.source.sourceId},sourceField:e.config.compaction.model.sourceField}),e.config.compaction.thresholdPercent!==void 0&&(t.thresholdPercent=e.config.compaction.thresholdPercent),n.compaction=t}if(e.config.experimental!==void 0&&(n.experimental={workflow:e.config.experimental.workflow===void 0?void 0:{modelCallsPerStep:e.config.experimental.workflow.modelCallsPerStep,retention:e.config.experimental.workflow.retention,world:e.config.experimental.workflow.world}}),e.config.reasoning!==void 0&&(n.reasoning=e.config.reasoning),e.config.source!==void 0&&(n.source=createResolvedModuleSourceRef(e.config.source)),e.config.tool!==void 0&&(n.tool=e.config.tool),e.config.limits!==void 0&&(n.limits={sessionTimeoutMs:e.config.limits.sessionTimeoutMs,sessionUsage:t}),e.config.dynamicModel!==void 0)return{...n,dynamicModel:{...createResolvedModuleSourceRef(e.config.dynamicModel),eventNames:[...e.config.dynamicModel.eventNames]}};let r=e.config.model;return{...n,model:r.source===void 0?{id:r.id,contextWindowTokens:r.contextWindowTokens,maxOutputTokens:r.maxOutputTokens,providerOptions:r.providerOptions}:{contextWindowTokens:r.contextWindowTokens,id:r.id,maxOutputTokens:r.maxOutputTokens,promptCache:r.promptCache,providerOptions:r.providerOptions,source:{exportName:r.source.exportName,sourceKind:`module`,logicalPath:r.source.logicalPath,sourceId:r.source.sourceId}}}}export{resolveAgent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{setChannelInstrumentationKind}from"#channel/compiled-channel.js";import{toErrorMessage}from"#shared/errors.js";import{normalizeChannelDefinition}from"#internal/authored-definition/channel.js";import{ResolveAgentError,createResolvedModuleSourceRef,loadResolvedModuleExport}from"#runtime/resolve-helpers.js";import{
|
|
1
|
+
import{setChannelInstrumentationKind}from"#channel/compiled-channel.js";import{toErrorMessage}from"#shared/errors.js";import{normalizeChannelDefinition}from"#internal/authored-definition/channel.js";import{ResolveAgentError,createResolvedModuleSourceRef,loadResolvedModuleExport}from"#runtime/resolve-helpers.js";import{isHttpRouteDefinition,isWebSocketRouteDefinition}from"#channel/routes.js";import{HTTP_ADAPTER_KIND}from"#channel/http.js";async function resolveChannelDefinition(e,t,n){try{let r=await loadResolvedModuleExport({definition:e,kindLabel:`channel`,moduleMap:t,nodeId:n}),i=normalizeChannelDefinition(r,`Expected the channel export "${e.exportName??`default`}" from "${e.logicalPath}" to match the public eve shape.`),a=createResolvedModuleSourceRef({exportName:e.exportName,logicalPath:e.logicalPath,sourceId:e.sourceId}),o=i.routes.find(t=>t.method.toUpperCase()===e.method.toUpperCase()&&t.path===e.urlPath),s=`channel:${e.name}`;setChannelInstrumentationKind(i,s);let c=i.adapter;c&&c.kind!==HTTP_ADAPTER_KIND&&(c.kind=s);let l=resolveHttpRoute(e,o),u=resolveWebSocketRoute(e,o);return{name:e.name,method:e.method,urlPath:e.urlPath,cors:e.cors,fetch:async(e,t)=>l?l.handler(e,t):Response.json({error:`No matching route handler.`,ok:!1},{status:404}),handler:l?.handler,websocket:u?.handler,receive:i.receive,definition:i,adapter:c,turnPolicy:i.turnPolicy,...a}}catch(t){throw t instanceof ResolveAgentError?t:new ResolveAgentError(`Failed to attach the channel definition from "${e.logicalPath}": ${toErrorMessage(t)}`,{logicalPath:e.logicalPath,sourceId:e.sourceId})}}function resolveHttpRoute(e,t){if(t!==void 0&&e.method!==`WEBSOCKET`&&isHttpRouteDefinition(t))return t}function resolveWebSocketRoute(e,t){if(t!==void 0&&e.method===`WEBSOCKET`&&isWebSocketRouteDefinition(t))return t}export{resolveChannelDefinition};
|
|
@@ -1 +1 @@
|
|
|
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
|
|
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. Export the environment its selector opens, for example \`export const environment = DefaultSandbox.environment();\`.`);return{...s,environment:o,kind:`independent`}}export{resolveSandboxDefinition};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{randomUUID}from"node:crypto";import{readFile,rename,rm,writeFile}from"node:fs/promises";import{resolveRuntimeCompilerArtifactPaths}from"#runtime/loaders/artifact-paths.js";import{createSandboxPreparedArtifactsManifest,sandboxPreparedArtifactsManifestSchema}from"#shared/sandbox-prepared-artifacts.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(`
|
|
1
|
+
import{randomUUID}from"node:crypto";import{readFile,rename,rm,writeFile}from"node:fs/promises";import{resolveRuntimeCompilerArtifactPaths}from"#runtime/loaders/artifact-paths.js";import{createSandboxPreparedArtifactsManifest,sandboxPreparedArtifactsManifestSchema}from"#shared/sandbox-prepared-artifacts.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(`The prepared sandbox artifact for agent node "${e.nodeId}" was created with provider "${t.providerName}", but this process selects provider "${e.providerName}". The sandbox file must select the same provider during the build and at runtime, so a selection that reads the host, such as \`process.env\` or Docker availability, can disagree. Select one provider explicitly, or use DefaultSandbox, which records its choice when the sandbox is prepared. Then rebuild with \`eve build\`, or restart \`eve dev\`.`);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,writeSandboxPreparedArtifactsManifest};
|
|
@@ -23,6 +23,8 @@ export interface RuntimeRegisteredSandbox {
|
|
|
23
23
|
readonly workspaceResourceRoot: CompiledWorkspaceResourceRoot;
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
+
/** The definition that opens `sandbox`: its owner's for a subagent that shares its parent's sandbox. */
|
|
27
|
+
export declare function owningSandboxDefinition(sandbox: RuntimeRegisteredSandbox): ResolvedSandboxDefinition;
|
|
26
28
|
/**
|
|
27
29
|
* Runtime-owned registry that exposes the resolved sandbox to the harness
|
|
28
30
|
* startup path.
|
|
@@ -1 +1 @@
|
|
|
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
|
+
function owningSandboxDefinition(e){return e.inheritance?.definition??e.definition}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,owningSandboxDefinition};
|
|
@@ -3,7 +3,11 @@ import type { WorkflowServeContext, WorkflowServeReceive } from "#public/tools/i
|
|
|
3
3
|
export interface AgentToolInput {
|
|
4
4
|
readonly message: string;
|
|
5
5
|
}
|
|
6
|
+
export interface AgentWithModelToolInput extends AgentToolInput {
|
|
7
|
+
readonly model: string;
|
|
8
|
+
}
|
|
6
9
|
type AgentToolReceive = WorkflowServeReceive<AgentToolInput>;
|
|
10
|
+
type AgentWithModelToolReceive = WorkflowServeReceive<AgentWithModelToolInput>;
|
|
7
11
|
/**
|
|
8
12
|
* The `serve` body of every agent tool: local, remote, dynamic, and the
|
|
9
13
|
* `agent` copy of the root. Each task talks to one session with the agent. A
|
|
@@ -11,4 +15,6 @@ type AgentToolReceive = WorkflowServeReceive<AgentToolInput>;
|
|
|
11
15
|
* response settles every call it answered.
|
|
12
16
|
*/
|
|
13
17
|
export declare function agentToolServeWorkflow(receive: AgentToolReceive, ctx: WorkflowServeContext<string>): Promise<never>;
|
|
18
|
+
/** The opt-in root-copy tool whose model-facing input selects the child model. */
|
|
19
|
+
export declare function agentWithModelServeWorkflow(receive: AgentWithModelToolReceive, ctx: WorkflowServeContext<string>): Promise<never>;
|
|
14
20
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
async function agentToolServeWorkflow(e,t){"use workflow";let n=t.agent(t.toolName),r=sendToAgent(n,await e()),i=e();for(;;){let a=await nextCallOrResult(i,r);if(a.kind===`call`){r=await forwardCall(n,r,a.call),i=e();continue}if(!r.signal.aborted){if(a.result.status===`failed`)throw Error(`The agent's turn failed: ${a.result.error?.message??`no reason given`}\nThis task has ended; to retry, call ${t.toolName} without taskId.`);let o=e();if(o!==i){r=sendToAgent(n,await i),i=o;continue}t.reply(a.result.message??``)}r=sendToAgent(n,await i),i=e()}}function sendToAgent(e,t){return{result:e.send(t.input.message,{signal:t.abortSignal}).then(e=>e.result()),signal:t.abortSignal}}async function nextCallOrResult(e,t){return await Promise.race([t.result.then(e=>({kind:`result`,result:e})),e.then(e=>({call:e,kind:`call`}))])}async function forwardCall(e,t,n){return t.signal.aborted&&await t.result.catch(()=>void 0),sendToAgent(e,n)}agentToolServeWorkflow.workflowId=`workflow//eve//agentToolServeWorkflow`;export{agentToolServeWorkflow};
|
|
1
|
+
async function agentToolServeWorkflow(e,t){"use workflow";let n=t.agent(t.toolName),r=sendToAgent(n,await e()),i=e();for(;;){let a=await nextCallOrResult(i,r);if(a.kind===`call`){r=await forwardCall(n,r,a.call),i=e();continue}if(!r.signal.aborted){if(a.result.status===`failed`)throw Error(`The agent's turn failed: ${a.result.error?.message??`no reason given`}\nThis task has ended; to retry, call ${t.toolName} without taskId.`);let o=e();if(o!==i){r=sendToAgent(n,await i),i=o;continue}t.reply(a.result.message??``)}r=sendToAgent(n,await i),i=e()}}async function agentWithModelServeWorkflow(e,t){"use workflow";let n=await e(),r=n.input.model.trim();if(r===``)throw TypeError(`agent model must not be empty.`);let i=t.agent(`agent`,{model:r}),a=sendToModelAgent(i,n,r),o=e();for(;;){let n=await nextModelCallOrResult(o,a);if(n.kind===`call`){a=await forwardModelCall(i,a,n.call,r),o=e();continue}if(!a.signal.aborted){if(n.result.status===`failed`)throw Error(`The agent's turn failed: ${n.result.error?.message??`no reason given`}\nThis task has ended; to retry, call ${t.toolName} without taskId.`);let s=e();if(s!==o){a=sendToModelAgent(i,await o,r),o=s;continue}t.reply(n.result.message??``)}a=sendToModelAgent(i,await o,r),o=e()}}function sendToAgent(e,t){return{result:e.send(t.input.message,{signal:t.abortSignal}).then(e=>e.result()),signal:t.abortSignal}}function sendToModelAgent(e,t,n){if(t.input.model!==n)throw Error(`An agent task keeps the model it started with. This task has ended; start a new task to use another model.`);return{result:e.send(t.input.message,{signal:t.abortSignal}).then(e=>e.result()),signal:t.abortSignal}}async function nextCallOrResult(e,t){return await Promise.race([t.result.then(e=>({kind:`result`,result:e})),e.then(e=>({call:e,kind:`call`}))])}async function nextModelCallOrResult(e,t){return await Promise.race([t.result.then(e=>({kind:`result`,result:e})),e.then(e=>({call:e,kind:`call`}))])}async function forwardCall(e,t,n){return t.signal.aborted&&await t.result.catch(()=>void 0),sendToAgent(e,n)}async function forwardModelCall(e,t,n,r){return t.signal.aborted&&await t.result.catch(()=>void 0),sendToModelAgent(e,n,r)}agentToolServeWorkflow.workflowId=`workflow//eve//agentToolServeWorkflow`,agentWithModelServeWorkflow.workflowId=`workflow//eve@0.83.1//agentWithModelServeWorkflow`;export{agentToolServeWorkflow,agentWithModelServeWorkflow};
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
readonly content: Buffer;
|
|
7
|
-
readonly path: string;
|
|
1
|
+
import type { SandboxProviderResourceFile } from "#shared/sandbox-provider.js";
|
|
2
|
+
/** The files of one resource directory, split into the trees sandbox providers receive. */
|
|
3
|
+
export interface MaterializedResourceTrees {
|
|
4
|
+
readonly skills: readonly SandboxProviderResourceFile[];
|
|
5
|
+
readonly workspace: readonly SandboxProviderResourceFile[];
|
|
8
6
|
}
|
|
9
7
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
8
|
+
* Reads a compiled resource directory into its `workspace/` and `skills/`
|
|
9
|
+
* trees, each sorted by relative path. A directory with neither subdirectory
|
|
10
|
+
* is read as the workspace tree itself.
|
|
13
11
|
*/
|
|
14
|
-
export declare function materializeWorkspaceDirectory(sourceDirectoryPath: string): Promise<
|
|
15
|
-
export {};
|
|
12
|
+
export declare function materializeWorkspaceDirectory(sourceDirectoryPath: string): Promise<MaterializedResourceTrees>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{readFile,readdir}from"node:fs/promises";import{join,posix}from"node:path";
|
|
1
|
+
import{readFile,readdir}from"node:fs/promises";import{join,posix}from"node:path";const RESOURCE_WORKSPACE_DIRECTORY=`workspace`,RESOURCE_SKILLS_DIRECTORY=`skills`;async function materializeWorkspaceDirectory(e){let t=await readdir(e,{withFileTypes:!0}),hasDirectory=e=>t.some(t=>t.name===e&&t.isDirectory()),n=hasDirectory(RESOURCE_WORKSPACE_DIRECTORY),r=hasDirectory(RESOURCE_SKILLS_DIRECTORY);return!n&&!r?{skills:[],workspace:await readResourceTree(e)}:{skills:r?await readResourceTree(join(e,RESOURCE_SKILLS_DIRECTORY)):[],workspace:n?await readResourceTree(join(e,RESOURCE_WORKSPACE_DIRECTORY)):[]}}async function readResourceTree(e){let t=[];return await addResourceFiles({files:t,relativeDirectoryPath:`.`,sourceDirectoryPath:e}),t.sort((e,t)=>e.relativePath.localeCompare(t.relativePath)),t}async function addResourceFiles(e){let t=await readdir(e.sourceDirectoryPath,{withFileTypes:!0});for(let n of t){if(!n.isDirectory()&&!n.isFile())continue;let t=join(e.sourceDirectoryPath,n.name),r=posix.join(e.relativeDirectoryPath,n.name);if(n.isDirectory()){await addResourceFiles({files:e.files,relativeDirectoryPath:r,sourceDirectoryPath:t});continue}e.files.push({content:await readFile(t),relativePath:r})}}export{materializeWorkspaceDirectory};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { WorkspaceRuntimeSpec } from "#runtime/workspace/types.js";
|
|
2
2
|
/**
|
|
3
3
|
* Creates the authored-workspace prompt section that advertises the authored
|
|
4
4
|
* paths visible at the workspace root.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
function createWorkspacePromptSection(e){return e.rootEntries.length===0?void 0:[`Workspace`,`- You have access to authored files mounted at the workspace root for this run.`,"- The workspace root is the directory where `bash` commands start; `pwd` prints its absolute path.",`- Root entries under the workspace root:`,...e.rootEntries.map(e=>` - ${e}`),"- For questions about workspace paths or file availability, verify with `bash` first using commands like `pwd`, `ls`, and `find`.","- If the required `bash` verification fails, report that failure directly instead of answering from this overview.","- Use the `bash` tool with `ls`, `find`, and `rg` to inspect deeper contents when needed.",`- Do not claim these files are unavailable unless a workspace or tool call actually fails.`].join(`
|
|
2
2
|
`)}export{createWorkspacePromptSection};
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* This is both the model-facing logical path and the live `bash` cwd
|
|
6
|
-
* for every backend. Backends must initialize their filesystems so
|
|
7
|
-
* commands run at this path; there is no per-backend translation.
|
|
2
|
+
* The default sandbox workspace root, used by every built-in provider and by
|
|
3
|
+
* a connection that does not declare its own `workspaceRoot`.
|
|
8
4
|
*/
|
|
9
5
|
export declare const WORKSPACE_ROOT = "/workspace";
|
|
10
6
|
/**
|