eve 0.63.0 → 0.64.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +44 -0
- package/dist/src/ai/evaluate.js +1 -1
- package/dist/src/channel/channel-address.d.ts +4 -1
- package/dist/src/channel/channel-address.js +1 -1
- package/dist/src/channel/channel-operations.d.ts +4 -1
- package/dist/src/channel/cross-channel-receive.d.ts +4 -1
- package/dist/src/channel/cross-channel-receive.js +1 -1
- package/dist/src/channel/session.d.ts +3 -1
- package/dist/src/channel/session.js +1 -1
- package/dist/src/channel/types.d.ts +7 -0
- package/dist/src/chunks/{use-eve-agent-C5-yqRuq.js → use-eve-agent-BdKlQF32.js} +8 -8
- package/dist/src/chunks/{use-eve-agent-CVWk5KKy.js → use-eve-agent-IIuxkn6y.js} +8 -8
- package/dist/src/cli/commands/build.js +1 -1
- package/dist/src/cli/commands/init-agent-workspace.d.ts +2 -0
- package/dist/src/cli/commands/init.js +1 -1
- package/dist/src/cli/commands/registry-pnpm-build-policy-flow.d.ts +1 -1
- package/dist/src/cli/commands/registry-pnpm-build-policy-flow.js +1 -1
- package/dist/src/cli/dev/tui/line-editor.d.ts +11 -1
- package/dist/src/cli/dev/tui/line-editor.js +3 -3
- package/dist/src/cli/dev/tui/model-picker.d.ts +2 -0
- package/dist/src/cli/dev/tui/model-picker.js +1 -1
- package/dist/src/cli/dev/tui/runner.d.ts +0 -1
- package/dist/src/cli/dev/tui/runner.js +2 -2
- package/dist/src/cli/dev/tui/setup-panel.js +1 -1
- package/dist/src/cli/dev/tui/setup-selection-input.js +1 -1
- package/dist/src/cli/dev/tui/stream-format.d.ts +6 -0
- package/dist/src/cli/dev/tui/stream-format.js +2 -2
- package/dist/src/cli/dev/tui/terminal-renderer.d.ts +0 -1
- package/dist/src/cli/dev/tui/terminal-renderer.js +12 -12
- package/dist/src/cli/run.js +1 -1
- package/dist/src/client/agent-info-schema.d.ts +8 -14
- package/dist/src/client/agent-info-schema.js +1 -1
- package/dist/src/client/eve-agent-store.js +1 -1
- package/dist/src/client/session.js +1 -1
- package/dist/src/client/types.d.ts +4 -2
- package/dist/src/compiled/.vendor-stamp.json +11 -11
- package/dist/src/compiled/@chat-adapter/slack/_chat-adapter-shared.d.ts +1 -0
- package/dist/src/compiled/@chat-adapter/slack/api.d.ts +3 -2
- package/dist/src/compiled/@chat-adapter/slack/api.js +1 -1
- package/dist/src/compiled/@chat-adapter/slack/blocks.js +1 -1
- package/dist/src/compiled/@chat-adapter/slack/format.js +1 -1
- package/dist/src/compiled/@chat-adapter/slack/index.d.ts +410 -63
- package/dist/src/compiled/@chat-adapter/slack/index.js +47 -25
- package/dist/src/compiled/@chat-adapter/twilio/api.d.ts +5 -1
- package/dist/src/compiled/@chat-adapter/twilio/api.js +1 -1
- package/dist/src/compiled/@chat-adapter/twilio/index.d.ts +37 -3
- package/dist/src/compiled/@chat-adapter/twilio/index.js +5 -1
- package/dist/src/compiled/@chat-adapter/twilio/webhook.d.ts +2 -2
- package/dist/src/compiled/@chat-adapter/twilio/webhook.js +1 -1
- package/dist/src/compiled/@linqapp/chat-sdk-adapter/index.js +6 -6
- package/dist/src/compiled/@photon-ai/chat-adapter-imessage/index.js +50 -50
- package/dist/src/compiled/@vercel/sandbox/index.js +4 -4
- package/dist/src/compiled/@workflow/core/attribute-changes.d.ts +2 -1
- package/dist/src/compiled/@workflow/core/events-consumer.d.ts +6 -3
- package/dist/src/compiled/@workflow/core/index.js +2 -2
- package/dist/src/compiled/@workflow/core/private.d.ts +37 -5
- package/dist/src/compiled/@workflow/core/private.js +1 -1
- package/dist/src/compiled/@workflow/core/runtime/deployment-guard.d.ts +2 -1
- package/dist/src/compiled/@workflow/core/runtime/helpers.js +1 -1
- package/dist/src/compiled/@workflow/core/runtime/invocations.d.ts +35 -0
- package/dist/src/compiled/@workflow/core/runtime/lifecycle-hooks.d.ts +90 -0
- package/dist/src/compiled/@workflow/core/runtime/quickjs-runtime.d.ts +2 -1
- package/dist/src/compiled/@workflow/core/runtime/resume-hook.d.ts +8 -6
- package/dist/src/compiled/@workflow/core/runtime/step-single-flight.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/runtime.js +4 -4
- package/dist/src/compiled/@workflow/core/serialization.d.ts +5 -1
- package/dist/src/compiled/@workflow/core/serialization.js +1 -1
- package/dist/src/compiled/@workflow/core/version.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/workflow/set-attributes.d.ts +4 -0
- package/dist/src/compiled/@workflow/core/workflow.js +1 -1
- package/dist/src/compiled/@workflow/world/analytics.d.ts +1 -1
- package/dist/src/compiled/@workflow/world/attributes-validation.d.ts +5 -0
- package/dist/src/compiled/@workflow/world/events.d.ts +2 -2
- package/dist/src/compiled/@workflow/world/index.d.ts +2 -1
- package/dist/src/compiled/@workflow/world/interfaces.d.ts +12 -1
- package/dist/src/compiled/@workflow/world/invocation.d.ts +19 -0
- package/dist/src/compiled/@workflow/world/queue.d.ts +24 -3
- package/dist/src/compiled/@workflow/world-local/index.js +3 -3
- package/dist/src/compiled/@workflow/world-vercel/index.js +16 -16
- package/dist/src/compiled/_chunks/node/chunk-6QHBXN7B-gl4n6nmi.js +12 -0
- package/dist/src/compiled/_chunks/node/chunk-7WDLOIRP-B_IWkVtZ.js +1 -0
- package/dist/src/compiled/_chunks/node/chunk-KBOOTKHF-DJqFk2r1.js +1 -0
- package/dist/src/compiled/_chunks/node/chunk-TREVQR3E-CLsTAn-O.js +1 -0
- package/dist/src/compiled/_chunks/node/dist-DYDVZ-FS.js +98 -0
- package/dist/src/compiled/_chunks/node/dist-iEFkK9qw.js +6 -0
- package/dist/src/compiled/_chunks/workflow/attribute-changes-DFx4eluc.js +6 -0
- package/dist/src/compiled/_chunks/workflow/{dist-D38gP7YF.js → dist-DjECvUyK.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{frames-QcJfYHmh.js → frames-D_Q-7A1N.js} +2 -2
- package/dist/src/compiled/_chunks/workflow/{helpers-6kObVbfS.js → helpers-Bw52uyzw.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{logger-NN5YHpYy.js → logger-DFNCa8Nl.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/resume-hook-BhA_nDEV.js +1 -0
- package/dist/src/compiled/_chunks/workflow/{run-DJevv8zz.js → run-BT6SQv5f.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{serialization-C5KgPESk.js → serialization-Cl0SYU0I.js} +3 -3
- package/dist/src/compiled/_chunks/workflow/sleep-DB4AH9-A.js +1 -0
- package/dist/src/compiled/_chunks/workflow/{wait-until-BMY_tOr-.js → wait-until-Dzhr6tzf.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{ws-transport-DSDcKH08.js → ws-transport-BpTMh40s.js} +1 -1
- package/dist/src/compiled/chat/index.d.ts +1 -725
- package/dist/src/compiled/chat/index.js +1 -1
- package/dist/src/compiler/artifacts.d.ts +1 -0
- package/dist/src/compiler/artifacts.js +1 -1
- package/dist/src/compiler/extension-compatibility.d.ts +23 -15
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/compiler/manifest.d.ts +14 -18
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/normalize-helpers.js +1 -1
- package/dist/src/compiler/normalize-sandbox.d.ts +2 -7
- package/dist/src/compiler/normalize-sandbox.js +1 -1
- package/dist/src/compiler/workspace-resources.js +1 -1
- package/dist/src/context/build-callback-context.d.ts +2 -0
- package/dist/src/context/build-callback-context.js +1 -1
- package/dist/src/context/container.d.ts +1 -1
- package/dist/src/context/container.js +1 -1
- package/dist/src/context/key-names.d.ts +1 -0
- package/dist/src/context/key-names.js +1 -1
- package/dist/src/context/keys.d.ts +7 -2
- package/dist/src/context/keys.js +1 -1
- package/dist/src/context/providers/sandbox.js +1 -1
- package/dist/src/context/providers/session.d.ts +19 -2
- package/dist/src/context/session-context.d.ts +1 -1
- package/dist/src/discover/sandbox.js +1 -1
- package/dist/src/evals/cli/eval.js +1 -1
- package/dist/src/evals/context.d.ts +1 -0
- package/dist/src/evals/context.js +1 -1
- package/dist/src/evals/define-eval-config.d.ts +7 -7
- package/dist/src/evals/define-eval-config.js +1 -1
- package/dist/src/evals/define-eval.d.ts +5 -2
- package/dist/src/evals/index.d.ts +1 -1
- package/dist/src/evals/runner/execute-eval.d.ts +2 -0
- package/dist/src/evals/runner/execute-eval.js +1 -1
- package/dist/src/evals/runner/execute-task.d.ts +2 -0
- package/dist/src/evals/runner/execute-task.js +1 -1
- package/dist/src/evals/runner/run-evals.d.ts +2 -0
- package/dist/src/evals/runner/run-evals.js +1 -1
- package/dist/src/evals/target.js +1 -1
- package/dist/src/evals/types.d.ts +22 -6
- package/dist/src/eve-channel/create-request.d.ts +2 -1
- package/dist/src/eve-channel/delivery-policy-request.d.ts +4 -0
- package/dist/src/eve-channel/delivery-policy-request.js +1 -0
- package/dist/src/eve-channel/index.js +1 -1
- package/dist/src/eve-channel/request.d.ts +2 -1
- package/dist/src/eve-channel/request.js +1 -1
- package/dist/src/execution/coordination-dispatch-shared.d.ts +2 -1
- package/dist/src/execution/coordination-dispatch-shared.js +1 -1
- package/dist/src/execution/dynamic-workflow/tool.js +1 -1
- package/dist/src/execution/runtime-context.js +1 -1
- package/dist/src/execution/sandbox/active-handles.d.ts +7 -8
- package/dist/src/execution/sandbox/active-handles.js +1 -1
- package/dist/src/execution/sandbox/bash.js +1 -1
- package/dist/src/execution/sandbox/bindings/docker-cli.d.ts +1 -1
- package/dist/src/execution/sandbox/bindings/docker-cli.js +1 -1
- package/dist/src/execution/sandbox/bindings/docker-container.d.ts +2 -2
- package/dist/src/execution/sandbox/bindings/docker-container.js +1 -1
- package/dist/src/execution/sandbox/bindings/docker-network.d.ts +1 -1
- package/dist/src/execution/sandbox/bindings/docker-network.js +1 -1
- package/dist/src/execution/sandbox/bindings/docker-options.d.ts +4 -5
- package/dist/src/execution/sandbox/bindings/docker-options.js +1 -1
- package/dist/src/execution/sandbox/bindings/docker-session.d.ts +0 -1
- package/dist/src/execution/sandbox/bindings/docker-session.js +2 -2
- package/dist/src/execution/sandbox/bindings/docker.d.ts +16 -18
- package/dist/src/execution/sandbox/bindings/docker.js +1 -1
- package/dist/src/execution/sandbox/bindings/immutable-resources.d.ts +21 -0
- package/dist/src/execution/sandbox/bindings/immutable-resources.js +2 -0
- package/dist/src/execution/sandbox/bindings/just-bash-runtime.d.ts +9 -5
- package/dist/src/execution/sandbox/bindings/just-bash-runtime.js +1 -1
- package/dist/src/execution/sandbox/bindings/just-bash.d.ts +13 -26
- package/dist/src/execution/sandbox/bindings/just-bash.js +1 -1
- package/dist/src/execution/sandbox/bindings/{local-backend-utils.d.ts → local-provider-utils.d.ts} +7 -5
- package/dist/src/execution/sandbox/bindings/local-provider-utils.js +1 -0
- package/dist/src/execution/sandbox/bindings/local.d.ts +3 -3
- package/dist/src/execution/sandbox/bindings/local.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-create.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-lifecycle.d.ts +30 -8
- package/dist/src/execution/sandbox/bindings/microsandbox-lifecycle.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-metadata.d.ts +9 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-metadata.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-network.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-options.d.ts +10 -4
- package/dist/src/execution/sandbox/bindings/microsandbox-options.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-platform.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-runtime.d.ts +7 -5
- package/dist/src/execution/sandbox/bindings/microsandbox-runtime.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-templates.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox.d.ts +11 -21
- package/dist/src/execution/sandbox/bindings/microsandbox.js +1 -1
- package/dist/src/execution/sandbox/bindings/vercel-base-runtime.js +2 -2
- package/dist/src/execution/sandbox/bindings/vercel-credentials.js +1 -1
- package/dist/src/execution/sandbox/bindings/vercel-errors.js +1 -1
- package/dist/src/execution/sandbox/bindings/vercel-lifecycle.d.ts +2 -2
- package/dist/src/execution/sandbox/bindings/vercel-lifecycle.js +1 -1
- package/dist/src/execution/sandbox/bindings/vercel-lookup.js +1 -1
- package/dist/src/execution/sandbox/bindings/vercel-options.d.ts +1 -2
- package/dist/src/execution/sandbox/bindings/vercel-options.js +1 -1
- package/dist/src/execution/sandbox/bindings/vercel.d.ts +20 -12
- package/dist/src/execution/sandbox/bindings/vercel.js +2 -2
- package/dist/src/execution/sandbox/development-cleanup.js +1 -1
- package/dist/src/execution/sandbox/development-lazy-prewarm.d.ts +7 -0
- package/dist/src/execution/sandbox/development-lazy-prewarm.js +1 -0
- package/dist/src/execution/sandbox/development-run.d.ts +2 -3
- package/dist/src/execution/sandbox/dockerfile.d.ts +25 -0
- package/dist/src/execution/sandbox/dockerfile.js +1 -0
- package/dist/src/execution/sandbox/ensure.d.ts +0 -17
- package/dist/src/execution/sandbox/ensure.js +1 -1
- package/dist/src/execution/sandbox/logging-session.js +1 -1
- package/dist/src/execution/sandbox/prewarm.d.ts +23 -27
- package/dist/src/execution/sandbox/prewarm.js +1 -2
- package/dist/src/execution/sandbox/provider-files.d.ts +2 -0
- package/dist/src/execution/sandbox/provider-files.js +1 -0
- package/dist/src/execution/sandbox/provider-host-development.d.ts +2 -0
- package/dist/src/execution/sandbox/provider-host-development.js +1 -0
- package/dist/src/execution/sandbox/provider-host.d.ts +2 -0
- package/dist/src/execution/sandbox/provider-host.js +1 -0
- package/dist/src/execution/sandbox/provider-identity.d.ts +1 -0
- package/dist/src/execution/sandbox/provider-identity.js +1 -0
- package/dist/src/execution/sandbox/ripgrep-probe.d.ts +0 -7
- package/dist/src/execution/sandbox/ripgrep-probe.js +1 -1
- package/dist/src/execution/sandbox/session.d.ts +8 -8
- package/dist/src/execution/sandbox/session.js +1 -1
- package/dist/src/execution/session/handoff-steps.js +1 -1
- package/dist/src/execution/session/handoff.d.ts +1 -1
- package/dist/src/execution/session/handoff.js +1 -1
- package/dist/src/execution/session/input-queue.d.ts +2 -1
- package/dist/src/execution/session/input-queue.js +1 -1
- package/dist/src/execution/session/next-input.js +1 -1
- package/dist/src/execution/session/program.js +1 -1
- package/dist/src/execution/session/turn-step.js +1 -1
- package/dist/src/execution/session-inbox/protocol.js +1 -1
- package/dist/src/execution/tasks/parent/tool-execution.js +1 -1
- package/dist/src/execution/tools/agent-router-workflow.js +1 -1
- package/dist/src/execution/tools/sleep-workflow.js +1 -1
- package/dist/src/execution/tools/subagent/emit-event-step.js +1 -1
- package/dist/src/execution/tools/subagent/invoke-preparation.js +1 -1
- package/dist/src/execution/tools/subagent/start.d.ts +1 -0
- package/dist/src/framework/sources/modules/sandbox.d.ts +2 -1
- package/dist/src/framework/sources/modules/sandbox.js +1 -1
- package/dist/src/harness/approval-delivery-coordinator.js +1 -1
- package/dist/src/harness/hitl/approval-input-requests.d.ts +1 -1
- package/dist/src/harness/hitl/approval-input-requests.js +1 -1
- package/dist/src/harness/input-requests.d.ts +6 -0
- package/dist/src/harness/input-requests.js +1 -1
- package/dist/src/harness/messages.d.ts +2 -1
- package/dist/src/harness/messages.js +1 -1
- package/dist/src/harness/pending-input-batches.d.ts +1 -0
- package/dist/src/harness/pending-input-batches.js +1 -1
- package/dist/src/harness/tool-loop.js +2 -2
- package/dist/src/instrumentation/ai-sdk-warnings.d.ts +6 -0
- package/dist/src/instrumentation/ai-sdk-warnings.js +1 -0
- package/dist/src/instrumentation/runtime.d.ts +1 -0
- package/dist/src/instrumentation/runtime.js +1 -1
- package/dist/src/internal/application/compiled-artifacts.d.ts +2 -0
- package/dist/src/internal/application/compiled-artifacts.js +2 -2
- package/dist/src/internal/application/optional-package-install.d.ts +3 -0
- package/dist/src/internal/application/optional-package-install.js +2 -2
- package/dist/src/internal/application/output-publication-lock.d.ts +6 -0
- package/dist/src/internal/application/output-publication-lock.js +1 -1
- package/dist/src/internal/application/output-publication.js +1 -1
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/authored-module-loader.d.ts +1 -0
- package/dist/src/internal/authored-module-loader.js +1 -1
- package/dist/src/internal/authored-runtime-modules.d.ts +1 -0
- package/dist/src/internal/nitro/development-generation.js +1 -1
- package/dist/src/internal/nitro/host/artifacts-config.d.ts +6 -1
- package/dist/src/internal/nitro/host/artifacts-config.js +1 -1
- package/dist/src/internal/nitro/host/build-application.js +1 -1
- package/dist/src/internal/nitro/host/compiled-sandbox-provider-prune-plugin.d.ts +16 -0
- package/dist/src/internal/nitro/host/compiled-sandbox-provider-prune-plugin.js +5 -0
- package/dist/src/internal/nitro/host/configure-nitro-routes.js +2 -2
- package/dist/src/internal/nitro/host/create-application-nitro.d.ts +3 -3
- package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
- package/dist/src/internal/nitro/host/dev-authored-rebuild-coordinator.js +1 -1
- package/dist/src/internal/nitro/host/dev-host-fingerprint.js +1 -1
- package/dist/src/internal/nitro/host/development-runtime-prune-plugin.d.ts +9 -0
- package/dist/src/internal/nitro/host/development-runtime-prune-plugin.js +2 -0
- package/dist/src/internal/nitro/host/prepare-application-host.d.ts +1 -0
- package/dist/src/internal/nitro/host/prepare-application-host.js +1 -1
- package/dist/src/internal/nitro/host/sandbox-shutdown-plugin.js +1 -1
- package/dist/src/internal/nitro/host/start-development-server.js +2 -2
- package/dist/src/internal/nitro/host/start-production-server.js +2 -2
- package/dist/src/internal/nitro/host/types.d.ts +1 -1
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.js +1 -1
- package/dist/src/internal/nitro/routes/runtime-artifacts.d.ts +1 -0
- package/dist/src/internal/nitro/routes/runtime-artifacts.js +1 -1
- package/dist/src/internal/runtime-registry.d.ts +2 -2
- package/dist/src/internal/vercel/build-agent-workspace.d.ts +3 -1
- package/dist/src/internal/vercel/build-agent-workspace.js +1 -1
- package/dist/src/public/channels/chat-sdk/chatSdkChannel.d.ts +4 -5
- package/dist/src/public/channels/chat-sdk/chatSdkChannel.js +2 -2
- package/dist/src/public/channels/github/checkout.js +1 -1
- package/dist/src/public/channels/index.d.ts +1 -1
- package/dist/src/public/channels/slack/slackChannel.d.ts +3 -1
- package/dist/src/public/channels/slack/slackChannel.js +1 -1
- package/dist/src/public/definitions/channel.d.ts +1 -1
- package/dist/src/public/definitions/sandbox.d.ts +5 -43
- package/dist/src/public/definitions/sandbox.js +1 -1
- package/dist/src/public/local-dev.d.ts +4 -5
- package/dist/src/public/next/vercel-output-config.js +1 -1
- package/dist/src/public/sandbox/docker-sandbox.d.ts +16 -40
- package/dist/src/public/sandbox/docker.d.ts +2 -2
- package/dist/src/public/sandbox/docker.js +1 -1
- package/dist/src/public/sandbox/index.d.ts +4 -9
- package/dist/src/public/sandbox/index.js +1 -1
- package/dist/src/public/sandbox/just-bash-sandbox.d.ts +11 -6
- package/dist/src/public/sandbox/just-bash.d.ts +2 -2
- package/dist/src/public/sandbox/just-bash.js +1 -1
- package/dist/src/public/sandbox/microsandbox-sandbox.d.ts +11 -17
- package/dist/src/public/sandbox/microsandbox.d.ts +2 -2
- package/dist/src/public/sandbox/microsandbox.js +1 -1
- package/dist/src/public/sandbox/provider.d.ts +1 -0
- package/dist/src/public/sandbox/provider.js +1 -0
- package/dist/src/public/sandbox/vercel-sandbox.d.ts +10 -41
- package/dist/src/public/sandbox/vercel.d.ts +2 -2
- package/dist/src/public/sandbox/vercel.js +1 -1
- package/dist/src/runtime/cache-key.js +1 -1
- package/dist/src/runtime/compiled-artifacts-source.d.ts +6 -1
- package/dist/src/runtime/compiled-artifacts-source.js +1 -1
- package/dist/src/runtime/loaders/artifact-paths.d.ts +1 -0
- package/dist/src/runtime/loaders/artifact-paths.js +1 -1
- package/dist/src/runtime/loaders/bundled-artifacts.d.ts +3 -0
- package/dist/src/runtime/loaders/bundled-artifacts.js +1 -1
- package/dist/src/runtime/loaders/compile-metadata.js +1 -1
- package/dist/src/runtime/loaders/manifest.js +1 -1
- package/dist/src/runtime/loaders/module-map.js +1 -1
- package/dist/src/runtime/local-dev-capability.d.ts +14 -12
- package/dist/src/runtime/local-dev-capability.js +1 -1
- package/dist/src/runtime/resolve-agent-graph.js +1 -1
- package/dist/src/runtime/resolve-sandbox.d.ts +1 -10
- package/dist/src/runtime/resolve-sandbox.js +1 -1
- package/dist/src/runtime/sandbox/prepared-artifacts.d.ts +13 -0
- package/dist/src/runtime/sandbox/prepared-artifacts.js +1 -0
- package/dist/src/runtime/sandbox/registry.d.ts +2 -9
- package/dist/src/runtime/sandbox/registry.js +1 -1
- package/dist/src/runtime/sessions/runtime-session.js +1 -1
- package/dist/src/runtime/types.d.ts +13 -26
- package/dist/src/runtime/workspace/types.d.ts +1 -1
- package/dist/src/sandbox/providers/default.d.ts +27 -0
- package/dist/src/sandbox/providers/default.js +1 -0
- package/dist/src/sandbox/providers/docker.d.ts +11 -0
- package/dist/src/sandbox/providers/docker.js +1 -0
- package/dist/src/sandbox/providers/just-bash.d.ts +4 -0
- package/dist/src/sandbox/providers/just-bash.js +1 -0
- package/dist/src/sandbox/providers/microsandbox.d.ts +12 -0
- package/dist/src/sandbox/providers/microsandbox.js +1 -0
- package/dist/src/sandbox/providers/vercel.d.ts +12 -0
- package/dist/src/sandbox/providers/vercel.js +1 -0
- package/dist/src/sandbox/providers.d.ts +5 -0
- package/dist/src/sandbox/providers.js +1 -0
- package/dist/src/sandbox/state.d.ts +6 -25
- package/dist/src/self-modification/extension/subagents/agent/agent.d.ts +1 -1
- package/dist/src/self-modification/extension/subagents/agent/agent.js +1 -1
- package/dist/src/self-modification/extension/subagents/agent/sandbox.d.ts +2 -25
- package/dist/src/self-modification/extension/subagents/agent/sandbox.js +1 -1
- package/dist/src/self-modification/extension/subagents/agent/tools/publish.js +1 -1
- package/dist/src/self-modification/extension/subagents/agent/tools/registry_add.js +1 -1
- package/dist/src/self-modification/filesystem.d.ts +3 -1
- package/dist/src/self-modification/filesystem.js +1 -1
- package/dist/src/self-modification/git-workspace.d.ts +1 -1
- package/dist/src/self-modification/git.d.ts +1 -1
- package/dist/src/self-modification/sandbox.d.ts +14 -9
- package/dist/src/self-modification/sandbox.js +1 -1
- package/dist/src/setup/boxes/select-model.js +1 -1
- package/dist/src/setup/cli/select-state.d.ts +4 -2
- package/dist/src/setup/cli/select-state.js +1 -1
- package/dist/src/setup/flows/model-login.js +1 -1
- package/dist/src/{cli/commands/registry-pnpm-build-policy.d.ts → setup/primitives/pm/pnpm-build-policy.d.ts} +4 -0
- package/dist/src/setup/primitives/pm/pnpm-build-policy.js +8 -0
- package/dist/src/setup/primitives/pm/pnpm.js +3 -2
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/dist/src/shared/default-agent-model.d.ts +1 -1
- package/dist/src/shared/default-agent-model.js +1 -1
- package/dist/src/shared/sandbox-environment.d.ts +45 -0
- package/dist/src/shared/sandbox-environment.js +1 -0
- package/dist/src/shared/sandbox-network-policy.d.ts +8 -3
- package/dist/src/shared/sandbox-network-policy.js +1 -1
- package/dist/src/shared/sandbox-prepared-artifacts.d.ts +16 -0
- package/dist/src/shared/sandbox-prepared-artifacts.js +1 -0
- package/dist/src/shared/sandbox-provider.d.ts +112 -0
- package/dist/src/shared/sandbox-provider.js +1 -0
- package/dist/src/shared/sandbox-session.d.ts +18 -41
- package/dist/src/shared/sandbox-template-error.d.ts +9 -0
- package/dist/src/shared/sandbox-template-error.js +1 -0
- package/dist/src/subagents/tool.d.ts +1 -1
- package/dist/src/subagents/tool.js +1 -1
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/tasks/delivery-context.d.ts +6 -4
- package/dist/src/tasks/delivery-context.js +1 -1
- package/dist/src/tasks/delivery-policy.d.ts +2 -0
- package/dist/src/tasks/delivery-policy.js +1 -1
- package/dist/src/tools/framework/agent-contract.js +1 -1
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/README.md +40 -45
- package/docs/agent-config.md +2 -2
- package/docs/channels/eve.mdx +1 -1
- package/docs/channels/overview.mdx +48 -0
- package/docs/channels/slack.mdx +1 -1
- package/docs/concepts/execution-model-and-durability.mdx +1 -1
- package/docs/concepts/sessions-runs-and-streaming.md +3 -3
- package/docs/dynamic-configuration/meta.json +5 -0
- package/docs/evals/overview.mdx +43 -0
- package/docs/getting-started.mdx +1 -1
- package/docs/guides/client/overview.mdx +1 -1
- package/docs/guides/deployment/overview.md +1 -1
- package/docs/guides/deployment/self-hosting.md +5 -5
- package/docs/guides/deployment/vercel.mdx +10 -18
- package/docs/guides/dev-tui.md +1 -1
- package/docs/guides/hooks.md +4 -0
- package/docs/guides/instrumentation/instrumentation.mdx +1 -1
- package/docs/guides/instrumentation/migration.md +1 -6
- package/docs/guides/instrumentation/otel.mdx +15 -47
- package/docs/memory/meta.json +1 -1
- package/docs/memory/overview.mdx +4 -0
- package/docs/meta.json +13 -16
- package/docs/patterns/meta.json +2 -2
- package/docs/protocols/acp.md +1 -1
- package/docs/protocols/ucp.mdx +1 -1
- package/docs/reference/cli.md +10 -9
- package/docs/reference/meta.json +4 -1
- package/docs/reference/typescript-api.md +2 -25
- package/docs/sandbox/default.mdx +17 -0
- package/docs/sandbox/docker.mdx +29 -0
- package/docs/sandbox/index.mdx +218 -0
- package/docs/sandbox/just-bash.mdx +24 -0
- package/docs/sandbox/meta.json +5 -0
- package/docs/sandbox/microsandbox.mdx +31 -0
- package/docs/sandbox/vercel.mdx +106 -0
- package/docs/schedules.mdx +35 -1
- package/docs/subagents/index.mdx +31 -13
- package/docs/subagents/meta.json +1 -1
- package/docs/tools/overview.mdx +14 -6
- package/docs/tutorial/run-analysis.mdx +6 -5
- package/package.json +20 -11
- package/dist/src/cli/commands/registry-pnpm-build-policy.js +0 -6
- package/dist/src/compiled/_chunks/node/chunk-5OX2R7AJ-CxVV-owP.js +0 -1
- package/dist/src/compiled/_chunks/node/chunk-AYN7QRWH-B__hKQV7.js +0 -1
- package/dist/src/compiled/_chunks/node/chunk-QZV7YRVM-Dzw4WEBv.js +0 -1
- package/dist/src/compiled/_chunks/node/dist-CweJdVFE.js +0 -6
- package/dist/src/compiled/_chunks/node/dist-Da54NuK8.js +0 -96
- package/dist/src/compiled/_chunks/workflow/attribute-changes-A6HfMNG3.js +0 -6
- package/dist/src/compiled/_chunks/workflow/resume-hook-CAqlhwic.js +0 -1
- package/dist/src/compiled/_chunks/workflow/sleep-CbUwdv6O.js +0 -1
- package/dist/src/compiled/chat/_mdast.d.ts +0 -24
- package/dist/src/compiled/chat/_workflow-serde.d.ts +0 -3
- package/dist/src/compiled/chat/jsx-runtime-_JEEAotp.d.ts +0 -907
- package/dist/src/execution/sandbox/bindings/local-backend-utils.js +0 -1
- package/dist/src/execution/sandbox/development-prewarm.d.ts +0 -15
- package/dist/src/execution/sandbox/development-prewarm.js +0 -1
- package/dist/src/execution/sandbox/lazy-backend.d.ts +0 -15
- package/dist/src/execution/sandbox/lazy-backend.js +0 -1
- package/dist/src/execution/sandbox/template-prewarm-lock.d.ts +0 -8
- package/dist/src/execution/sandbox/template-prewarm-lock.js +0 -1
- package/dist/src/internal/authored-definition/sandbox.d.ts +0 -17
- package/dist/src/internal/authored-definition/sandbox.js +0 -1
- package/dist/src/internal/nitro/host/compiled-sandbox-backend-prune-plugin.d.ts +0 -16
- package/dist/src/internal/nitro/host/compiled-sandbox-backend-prune-plugin.js +0 -2
- package/dist/src/public/definitions/sandbox-backend.d.ts +0 -17
- package/dist/src/public/definitions/sandbox-backend.js +0 -1
- package/dist/src/public/sandbox/backends/default.d.ts +0 -1
- package/dist/src/public/sandbox/backends/default.js +0 -1
- package/dist/src/public/sandbox/backends/docker.d.ts +0 -1
- package/dist/src/public/sandbox/backends/docker.js +0 -1
- package/dist/src/public/sandbox/backends/just-bash.d.ts +0 -1
- package/dist/src/public/sandbox/backends/just-bash.js +0 -1
- package/dist/src/public/sandbox/backends/microsandbox.d.ts +0 -1
- package/dist/src/public/sandbox/backends/microsandbox.js +0 -1
- package/dist/src/public/sandbox/backends/vercel.d.ts +0 -1
- package/dist/src/public/sandbox/backends/vercel.js +0 -1
- package/dist/src/runtime/sandbox/keys.d.ts +0 -42
- package/dist/src/runtime/sandbox/keys.js +0 -1
- package/dist/src/runtime/sandbox/template-plan.d.ts +0 -24
- package/dist/src/runtime/sandbox/template-plan.js +0 -1
- package/dist/src/sandbox/backends/default.d.ts +0 -42
- package/dist/src/sandbox/backends/default.js +0 -1
- package/dist/src/sandbox/backends/docker.d.ts +0 -14
- package/dist/src/sandbox/backends/docker.js +0 -1
- package/dist/src/sandbox/backends/just-bash.d.ts +0 -17
- package/dist/src/sandbox/backends/just-bash.js +0 -1
- package/dist/src/sandbox/backends/microsandbox.d.ts +0 -17
- package/dist/src/sandbox/backends/microsandbox.js +0 -1
- package/dist/src/sandbox/backends/vercel.d.ts +0 -30
- package/dist/src/sandbox/backends/vercel.js +0 -1
- package/dist/src/shared/sandbox-backend.d.ts +0 -176
- package/dist/src/shared/sandbox-backend.js +0 -1
- package/dist/src/shared/sandbox-definition.d.ts +0 -112
- package/dist/src/shared/sandbox-definition.js +0 -1
- package/docs/sandbox.mdx +0 -342
|
@@ -24,8 +24,7 @@ import type { InternalAgentDefinition } from "#shared/agent-definition.js";
|
|
|
24
24
|
import type { RuntimeDynamicModelReference } from "#runtime/agent/bootstrap.js";
|
|
25
25
|
import type { InternalToolDefinitionWithExecuteFn } from "#tools/definition.js";
|
|
26
26
|
import type { CompiledToolBehavior } from "#tools/behavior.js";
|
|
27
|
-
import type {
|
|
28
|
-
import type { SandboxBootstrapContext, SandboxSessionContext } from "#shared/sandbox-definition.js";
|
|
27
|
+
import type { SandboxEnvironmentIdentity, SandboxSelector } from "#shared/sandbox-environment.js";
|
|
29
28
|
import type { ToolSchema } from "#tools/schema.js";
|
|
30
29
|
import type { AgentSourceOwner } from "#compiler/source-graph.js";
|
|
31
30
|
import type { MemoryDefinition } from "#public/memory/index.js";
|
|
@@ -104,32 +103,20 @@ export interface ResolvedConnectionDefinition extends ResolvedModuleSourceRef {
|
|
|
104
103
|
readonly url: string;
|
|
105
104
|
}
|
|
106
105
|
/**
|
|
107
|
-
* Runtime-owned
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
* The resolved `backend` is non-optional: every sandbox in the runtime
|
|
111
|
-
* graph carries a concrete SandboxBackend value, even when the
|
|
112
|
-
* authored definition omits `backend`. The omitted field is filled
|
|
113
|
-
* in by `defaultSandbox()` (which itself selects between
|
|
114
|
-
* `vercel()`, `docker()`, `microsandbox()`, and `justbash()` based on the current
|
|
115
|
-
* environment).
|
|
106
|
+
* Runtime-owned sandbox definition resolved from a compiled module map.
|
|
107
|
+
* Independent definitions carry their exported environment; parent definitions
|
|
108
|
+
* explicitly inherit the dispatching agent's sandbox.
|
|
116
109
|
*/
|
|
117
|
-
|
|
118
|
-
readonly
|
|
119
|
-
readonly
|
|
120
|
-
readonly sourceHash?: string;
|
|
121
|
-
/**
|
|
122
|
-
* Resolved backend value. The authored `SandboxDefinition.backend`
|
|
123
|
-
* accepts either a `SandboxBackend` or a `() => SandboxBackend`; by
|
|
124
|
-
* the time it reaches the runtime the function form has been
|
|
125
|
-
* unwrapped via `lazyBackend(...)` so consumers always see a plain
|
|
126
|
-
* value.
|
|
127
|
-
*/
|
|
128
|
-
readonly backend: SandboxBackend;
|
|
129
|
-
readonly description?: string;
|
|
130
|
-
readonly inheritsParent?: boolean;
|
|
131
|
-
readonly onSession?: (input: SandboxSessionContext) => Promise<void> | void;
|
|
110
|
+
type ResolvedSandboxDefinitionBase = ResolvedModuleSourceRef & {
|
|
111
|
+
readonly revisionHash: string;
|
|
112
|
+
readonly selector: SandboxSelector;
|
|
132
113
|
};
|
|
114
|
+
export type ResolvedSandboxDefinition = ResolvedSandboxDefinitionBase & ({
|
|
115
|
+
readonly environment: SandboxEnvironmentIdentity;
|
|
116
|
+
readonly kind: "independent";
|
|
117
|
+
} | {
|
|
118
|
+
readonly kind: "parent";
|
|
119
|
+
});
|
|
133
120
|
/**
|
|
134
121
|
* Runtime-owned tool definition resolved from the selected compiled source graph.
|
|
135
122
|
* A tool without `execute` is surfaced to the client and never executed by eve.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { DockerSandboxEnvironmentOptions } from "#public/sandbox/docker-sandbox.js";
|
|
2
|
+
import type { JustBashSandboxCreateOptions } from "#public/sandbox/just-bash-sandbox.js";
|
|
3
|
+
import type { MicrosandboxSandboxCreateOptions } from "#public/sandbox/microsandbox-sandbox.js";
|
|
4
|
+
import type { VercelSandboxCreateOptions } from "#public/sandbox/vercel-sandbox.js";
|
|
5
|
+
import type { SandboxEnvironment } from "#shared/sandbox-environment.js";
|
|
6
|
+
import type { SandboxSession } from "#shared/sandbox-session.js";
|
|
7
|
+
export interface DefaultSandboxEnvironmentOptions {
|
|
8
|
+
readonly docker?: DockerSandboxEnvironmentOptions;
|
|
9
|
+
readonly justBash?: JustBashSandboxCreateOptions;
|
|
10
|
+
readonly microsandbox?: MicrosandboxSandboxCreateOptions;
|
|
11
|
+
readonly prepare?: (sandbox: SandboxSession) => Promise<void> | void;
|
|
12
|
+
readonly vercel?: VercelSandboxCreateOptions;
|
|
13
|
+
}
|
|
14
|
+
export interface DefaultSandboxProbes {
|
|
15
|
+
readonly isDeployedOnVercel: () => boolean;
|
|
16
|
+
readonly isDockerAvailable: () => boolean;
|
|
17
|
+
readonly isMicrosandboxSupported: () => boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare const SANDBOX_PROVIDER_PROBES: DefaultSandboxProbes;
|
|
20
|
+
export declare const DefaultSandbox: {
|
|
21
|
+
name: string;
|
|
22
|
+
environment(options?: DefaultSandboxEnvironmentOptions): SandboxEnvironment<undefined>;
|
|
23
|
+
};
|
|
24
|
+
export declare function defineDefaultSandboxProvider(probes: DefaultSandboxProbes): {
|
|
25
|
+
name: string;
|
|
26
|
+
environment(options?: DefaultSandboxEnvironmentOptions): SandboxEnvironment<undefined>;
|
|
27
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isLinuxDockerDaemonAvailableSync,isMicrosandboxPlatformSupported}from"#execution/sandbox/bindings/local.js";import{DockerSandbox}from"#sandbox/providers/docker.js";import{JustBashSandbox}from"#sandbox/providers/just-bash.js";import{MicrosandboxSandbox}from"#sandbox/providers/microsandbox.js";import{createDefaultVercelEnvironment}from"#sandbox/providers/vercel.js";const SANDBOX_PROVIDER_PROBES={isDeployedOnVercel:()=>!!process.env.VERCEL,isDockerAvailable:()=>isLinuxDockerDaemonAvailableSync(),isMicrosandboxSupported:()=>isMicrosandboxPlatformSupported()},DefaultSandbox=defineDefaultSandboxProvider(SANDBOX_PROVIDER_PROBES);function defineDefaultSandboxProvider(e){return{name:`default`,environment(t={}){return e.isDeployedOnVercel()?withoutOpenOptions(createDefaultVercelEnvironment(withPreparation(t.vercel,t.prepare))):e.isDockerAvailable()?withoutOpenOptions(DockerSandbox.environment(withPreparation(t.docker,t.prepare))):e.isMicrosandboxSupported()?withoutOpenOptions(MicrosandboxSandbox.environment(withPreparation(t.microsandbox,t.prepare))):JustBashSandbox.environment(withPreparation(t.justBash,t.prepare))}}}function withPreparation(e,t){return Object.assign({},e,t===void 0?{}:{prepare:t})}function withoutOpenOptions(e){return e}export{DefaultSandbox,SANDBOX_PROVIDER_PROBES,defineDefaultSandboxProvider};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { DockerSandboxEnvironmentOptions, DockerSandboxRuntimeOptions } from "#public/sandbox/docker-sandbox.js";
|
|
2
|
+
import type { SandboxEnvironment } from "#shared/sandbox-environment.js";
|
|
3
|
+
import type { MutableNetworkSandboxSession } from "#shared/sandbox-session.js";
|
|
4
|
+
export type { DockerSandboxEnvironmentOptions, DockerSandboxRuntimeOptions, } from "#public/sandbox/docker-sandbox.js";
|
|
5
|
+
type DockerfileEnvironmentInput = Omit<DockerSandboxEnvironmentOptions, "image">;
|
|
6
|
+
export declare const DockerSandbox: {
|
|
7
|
+
name: string;
|
|
8
|
+
environment(options?: Readonly<DockerSandboxEnvironmentOptions> | undefined): SandboxEnvironment<DockerSandboxRuntimeOptions, MutableNetworkSandboxSession>;
|
|
9
|
+
dockerfile(options?: DockerfileEnvironmentInput): SandboxEnvironment<DockerSandboxRuntimeOptions, MutableNetworkSandboxSession>;
|
|
10
|
+
image(reference: string, options?: DockerfileEnvironmentInput): SandboxEnvironment<DockerSandboxRuntimeOptions, MutableNetworkSandboxSession>;
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createDockerSandboxProvider}from"#execution/sandbox/bindings/local.js";import{defineSandboxProvider}from"#shared/sandbox-provider.js";const provider=defineSandboxProvider({name:`docker`,environment(e){return createDockerSandboxProvider(e)}}),DockerSandbox={...provider,dockerfile(e={}){return provider.environment(e)},image(e,t={}){return provider.environment({...t,image:e})}};export{DockerSandbox};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { JustBashSandboxCreateOptions } from "#public/sandbox/just-bash-sandbox.js";
|
|
2
|
+
import type { FixedNetworkSandboxSession } from "#shared/sandbox-session.js";
|
|
3
|
+
export type JustBashEnvironmentOptions = JustBashSandboxCreateOptions;
|
|
4
|
+
export declare const JustBashSandbox: import("#shared/sandbox-provider.js").SandboxProvider<JustBashSandboxCreateOptions, undefined, FixedNetworkSandboxSession>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createJustBashSandboxProvider}from"#execution/sandbox/bindings/local.js";import{defineSandboxProvider}from"#shared/sandbox-provider.js";const JustBashSandbox=defineSandboxProvider({name:`just-bash`,environment:e=>createJustBashSandboxProvider(e)});export{JustBashSandbox};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { MicrosandboxSandboxCreateOptions, MicrosandboxSandboxRuntimeOptions } from "#public/sandbox/microsandbox-sandbox.js";
|
|
2
|
+
import type { SandboxEnvironment } from "#shared/sandbox-environment.js";
|
|
3
|
+
import type { MutableNetworkSandboxSession } from "#shared/sandbox-session.js";
|
|
4
|
+
export type MicrosandboxEnvironmentOptions = MicrosandboxSandboxCreateOptions;
|
|
5
|
+
type DockerfileEnvironmentInput = Omit<MicrosandboxEnvironmentOptions, "image">;
|
|
6
|
+
export declare const MicrosandboxSandbox: {
|
|
7
|
+
name: string;
|
|
8
|
+
environment(options?: Readonly<MicrosandboxSandboxCreateOptions> | undefined): SandboxEnvironment<MicrosandboxSandboxRuntimeOptions, MutableNetworkSandboxSession>;
|
|
9
|
+
dockerfile(options?: DockerfileEnvironmentInput): SandboxEnvironment<MicrosandboxSandboxRuntimeOptions, MutableNetworkSandboxSession>;
|
|
10
|
+
image(reference: string, options?: DockerfileEnvironmentInput): SandboxEnvironment<MicrosandboxSandboxRuntimeOptions, MutableNetworkSandboxSession>;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineSandboxProvider}from"#shared/sandbox-provider.js";import{createMicrosandboxSandboxProvider}from"#execution/sandbox/bindings/microsandbox.js";const provider=defineSandboxProvider({name:`microsandbox`,stateProtocolVersion:3,environment:e=>createMicrosandboxSandboxProvider(e)}),MicrosandboxSandbox={...provider,dockerfile(e={}){return provider.environment(e)},image(e,t={}){return provider.environment({...t,image:e})}};export{MicrosandboxSandbox};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { VercelSandboxCreateOptions, VercelSandboxRuntimeOptions } from "#public/sandbox/vercel-sandbox.js";
|
|
2
|
+
import type { SandboxEnvironment } from "#shared/sandbox-environment.js";
|
|
3
|
+
import type { MutableNetworkSandboxSession, SandboxSession } from "#shared/sandbox-session.js";
|
|
4
|
+
export type VercelSandboxEnvironmentOptions = VercelSandboxCreateOptions & {
|
|
5
|
+
readonly prepare?: (sandbox: SandboxSession) => Promise<void> | void;
|
|
6
|
+
};
|
|
7
|
+
export type { VercelSandboxRuntimeOptions } from "#public/sandbox/vercel-sandbox.js";
|
|
8
|
+
export declare function createDefaultVercelEnvironment(options?: VercelSandboxEnvironmentOptions): SandboxEnvironment<VercelSandboxRuntimeOptions, MutableNetworkSandboxSession>;
|
|
9
|
+
export declare const VercelSandbox: {
|
|
10
|
+
name: string;
|
|
11
|
+
environment(options?: VercelSandboxEnvironmentOptions): SandboxEnvironment<VercelSandboxRuntimeOptions, MutableNetworkSandboxSession>;
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineSandboxProvider}from"#shared/sandbox-provider.js";import{createVercelSandbox,createVercelSandboxProvider}from"#execution/sandbox/bindings/vercel.js";const defaultProvider=defineSandboxProvider({name:`vercel`,environment:e=>{let{prepare:t,...n}=e??{};return createVercelSandbox({createOptions:n,prepare:t,skipEmptyPreparation:!0})}}),provider=defineSandboxProvider({name:`vercel`,environment:e=>createVercelSandboxProvider(e)});function createDefaultVercelEnvironment(e){return defaultProvider.environment(e)}const VercelSandbox={name:`vercel`,environment(e){return provider.environment(e)}};export{VercelSandbox,createDefaultVercelEnvironment};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { DefaultSandbox } from "#sandbox/providers/default.js";
|
|
2
|
+
export { DockerSandbox } from "#sandbox/providers/docker.js";
|
|
3
|
+
export { JustBashSandbox } from "#sandbox/providers/just-bash.js";
|
|
4
|
+
export { MicrosandboxSandbox } from "#sandbox/providers/microsandbox.js";
|
|
5
|
+
export { VercelSandbox } from "#sandbox/providers/vercel.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{DockerSandbox}from"#sandbox/providers/docker.js";import{DefaultSandbox}from"#sandbox/providers/default.js";import{JustBashSandbox}from"#sandbox/providers/just-bash.js";import{MicrosandboxSandbox}from"#sandbox/providers/microsandbox.js";import{VercelSandbox}from"#sandbox/providers/vercel.js";export{DefaultSandbox,DockerSandbox,JustBashSandbox,MicrosandboxSandbox,VercelSandbox};
|
|
@@ -1,32 +1,13 @@
|
|
|
1
1
|
import type { SandboxSession } from "#public/definitions/sandbox.js";
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
* backend's public-API spelling into harness code.
|
|
9
|
-
*/
|
|
10
|
-
export type SandboxSessionState = SandboxBackendSessionState;
|
|
11
|
-
/**
|
|
12
|
-
* Serializable sandbox state carried on the harness session across
|
|
13
|
-
* step boundaries.
|
|
14
|
-
*
|
|
15
|
-
* Contains only stable identifiers — live handles stay in a
|
|
16
|
-
* process-level cache and are rehydrated per step via the backend.
|
|
17
|
-
* Every agent owns exactly one sandbox, so the state is just a single
|
|
18
|
-
* `initialized` flag and an optional persisted session record.
|
|
19
|
-
*/
|
|
2
|
+
import type { SandboxDeleteOptions, SandboxPreparedArtifact } from "#shared/sandbox-provider.js";
|
|
3
|
+
export interface SandboxSessionState {
|
|
4
|
+
readonly providerName: string;
|
|
5
|
+
readonly state: SandboxPreparedArtifact;
|
|
6
|
+
readonly stateProtocolVersion: number;
|
|
7
|
+
}
|
|
20
8
|
export interface SandboxState {
|
|
21
|
-
readonly initialized: boolean;
|
|
22
9
|
readonly session: SandboxSessionState | null;
|
|
23
10
|
}
|
|
24
|
-
/**
|
|
25
|
-
* Lazy sandbox accessor bound to one step execution.
|
|
26
|
-
*
|
|
27
|
-
* Returned by `ensureSandboxAccess` and placed on the `AlsContext` (via
|
|
28
|
-
* `SandboxKey`) so tools can call `ctx.getSandbox()`.
|
|
29
|
-
*/
|
|
30
11
|
export interface SandboxAccess {
|
|
31
12
|
captureState(): Promise<SandboxState>;
|
|
32
13
|
delete?(options?: SandboxDeleteOptions): Promise<void>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type AgentReasoningDefinition, type AgentStaticModelDefinition, type DynamicSentinel, type DynamicSubagentDefinition } from "eve";
|
|
2
2
|
import { type SelfModificationConfig } from "../../../config.js";
|
|
3
3
|
/** Fallback model when neither the self-modification agent nor its parent configures one. */
|
|
4
|
-
export declare const FALLBACK_SELF_MODIFICATION_MODEL = "
|
|
4
|
+
export declare const FALLBACK_SELF_MODIFICATION_MODEL = "spacexai/grok-4.7";
|
|
5
5
|
/** Configuration for the self-modification subagent. */
|
|
6
6
|
export interface SelfModificationAgentOptions {
|
|
7
7
|
/** Policy shared with the sandbox and extension mount. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{resolveSelfModificationConfig}from"../../../config.js";import{hasGitHubCredential}from"../../../credentials.js";import extension_default from"../../extension.js";import{resolveSelfModificationMode}from"../../../mode.js";import{DEFAULT_AGENT_MODEL_ID}from"#shared/default-agent-model.js";import{defineAgent,defineDynamic}from"eve";const FALLBACK_SELF_MODIFICATION_MODEL=DEFAULT_AGENT_MODEL_ID;function renderDescription(e){return e.filter(e=>e.length>0).join(` `)}function defineSelfModificationAgent(e={}){let resolve=async(t,n)=>{let r=extension_default.config,i=e.reasoning??r.reasoning,a=resolveSelfModificationConfig(e.config??r),o=resolveSelfModificationMode(a),s=e.model??r.model??n.model?.id??FALLBACK_SELF_MODIFICATION_MODEL,c=renderDescription([`Delegate here when the user asks to change this eve agent or its authored source.`,`If the requested change references a tool or skill, include the exact identifier. Do not infer source paths; let the child resolve the appropriate file under /source. Delegate the requested change and existing constraints without adding unrequested features, implementation steps, or reporting requirements.`,`Treat requests for persistent changes to future behavior or capabilities as source-modification requests, even when the requester does not mention files or source code. Infer persistence from the request and conversation rather than waiting for phrases such as “modify your source.” For example, asking the agent to stop always doing something, add a capability, or change future responses calls for inspecting and editing the authored source instead of providing a one-turn workaround.`,`Treat questions phrased as whether you can install, add, enable, or connect to a named product or service as requests to extend this eve agent and delegate immediately. Do not assume they refer to device software, ask what kind of installation they mean, or deny them because you lack access to the user's device. The subagent determines whether the request maps to an integration, channel, connection, or other capability, then checks registry availability and any required setup.`,o===`local`?`Delegate questions about which integrations, channels, connections, or capabilities are available to add: the subagent searches the eve registry and reports exact item addresses instead of guessing them.`:`Delegate requests to add integrations, channels, connections, or capabilities: the subagent searches the official eve registry and can install source changes into the draft proposal. Setup may require non-secret answers or an external action, and secret binding remains separate.`,o===`local`?`Delegate requests to investigate, diagnose, or optimize the agent's behavior from local traces to this subagent: it can inspect the invoking session's trace and make persistent source changes when warranted.`:``,`Resolve short follow-ups such as “yes” or “do it” against the preceding conversation. If whether the requested change should persist is genuinely ambiguous, ask one concise clarifying question.`,`If a tool or capability created or changed by this subagent later fails or behaves incorrectly, explain the observed problem and offer to delegate a repair. Do not start the repair until the user confirms. Treat that confirmation as a source-modification request and delegate it immediately, including the exact identifier, failing behavior, expected behavior, and existing constraints.`,o===`local`?`Source edits do not affect the caller’s current turn. After this subagent reports changes, do not invoke edited tools or attempt runtime verification until a new user turn.`:`Source edits do not affect the caller’s current turn. The subagent can publish only a draft pull request, and changes become effective only after review, merge, and redeployment.`]);if(o===`local`)return defineAgent({description:c,model:s,reasoning:i});if(o!==`deployed`||a.deployed===void 0||a.deployed.credentials.kind===`pat`&&!hasGitHubCredential())return null;try{if(!await a.deployed.authorize({channel:n.channel,principal:n.session.auth.current}))return null}catch{return null}return defineAgent({description:c,model:s,reasoning:i})};return defineDynamic({events:{"session.started":resolve,"turn.started":resolve}})}var agent_default=defineSelfModificationAgent();export{FALLBACK_SELF_MODIFICATION_MODEL,agent_default as default,defineSelfModificationAgent};
|
|
1
|
+
import{resolveSelfModificationConfig}from"../../../config.js";import{hasGitHubCredential}from"../../../credentials.js";import extension_default from"../../extension.js";import{resolveSelfModificationMode}from"../../../mode.js";import{DEFAULT_AGENT_MODEL_ID}from"#shared/default-agent-model.js";import{defineAgent,defineDynamic}from"eve";import{getLocalDevCapability}from"eve/local-dev";const FALLBACK_SELF_MODIFICATION_MODEL=DEFAULT_AGENT_MODEL_ID;function renderDescription(e){return e.filter(e=>e.length>0).join(` `)}function defineSelfModificationAgent(e={}){let resolve=async(t,n)=>{let r=extension_default.config,i=e.reasoning??r.reasoning,a=resolveSelfModificationConfig(e.config??r),o=resolveSelfModificationMode(a),s=e.model??r.model??n.model?.id??FALLBACK_SELF_MODIFICATION_MODEL,c=renderDescription([`Delegate here when the user asks to change this eve agent or its authored source.`,`If the requested change references a tool or skill, include the exact identifier. Do not infer source paths; let the child resolve the appropriate file under /source. Delegate the requested change and existing constraints without adding unrequested features, implementation steps, or reporting requirements.`,`Treat requests for persistent changes to future behavior or capabilities as source-modification requests, even when the requester does not mention files or source code. Infer persistence from the request and conversation rather than waiting for phrases such as “modify your source.” For example, asking the agent to stop always doing something, add a capability, or change future responses calls for inspecting and editing the authored source instead of providing a one-turn workaround.`,`Treat questions phrased as whether you can install, add, enable, or connect to a named product or service as requests to extend this eve agent and delegate immediately. Do not assume they refer to device software, ask what kind of installation they mean, or deny them because you lack access to the user's device. The subagent determines whether the request maps to an integration, channel, connection, or other capability, then checks registry availability and any required setup.`,o===`local`?`Delegate questions about which integrations, channels, connections, or capabilities are available to add: the subagent searches the eve registry and reports exact item addresses instead of guessing them.`:`Delegate requests to add integrations, channels, connections, or capabilities: the subagent searches the official eve registry and can install source changes into the draft proposal. Setup may require non-secret answers or an external action, and secret binding remains separate.`,o===`local`?`Delegate requests to investigate, diagnose, or optimize the agent's behavior from local traces to this subagent: it can inspect the invoking session's trace and make persistent source changes when warranted.`:``,`Resolve short follow-ups such as “yes” or “do it” against the preceding conversation. If whether the requested change should persist is genuinely ambiguous, ask one concise clarifying question.`,`If a tool or capability created or changed by this subagent later fails or behaves incorrectly, explain the observed problem and offer to delegate a repair. Do not start the repair until the user confirms. Treat that confirmation as a source-modification request and delegate it immediately, including the exact identifier, failing behavior, expected behavior, and existing constraints.`,o===`local`?`Source edits do not affect the caller’s current turn. After this subagent reports changes, do not invoke edited tools or attempt runtime verification until a new user turn.`:`Source edits do not affect the caller’s current turn. The subagent can publish only a draft pull request, and changes become effective only after review, merge, and redeployment.`]);if(o===`local`)return getLocalDevCapability()===void 0?null:defineAgent({description:c,model:s,reasoning:i});if(o!==`deployed`||a.deployed===void 0||a.deployed.credentials.kind===`pat`&&!hasGitHubCredential())return null;try{if(!await a.deployed.authorize({channel:n.channel,principal:n.session.auth.current}))return null}catch{return null}return defineAgent({description:c,model:s,reasoning:i})};return defineDynamic({events:{"session.started":resolve,"turn.started":resolve}})}var agent_default=defineSelfModificationAgent();export{FALLBACK_SELF_MODIFICATION_MODEL,agent_default as default,defineSelfModificationAgent};
|
|
@@ -1,26 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { type SelfModificationConfig } from "../../../config.js";
|
|
4
|
-
export interface SelfModificationSandboxOptions {
|
|
5
|
-
/**
|
|
6
|
-
* Production backend. Deployed self-modification owns an allow-all network
|
|
7
|
-
* policy and temporarily adds a credential transform while checking out its
|
|
8
|
-
* source. When omitted, eve selects Vercel Sandbox on Vercel or microsandbox
|
|
9
|
-
* on a supported self-hosted system.
|
|
10
|
-
*/
|
|
11
|
-
readonly backend?: SandboxBackend;
|
|
12
|
-
/** Policy shared with the agent and extension mount. */
|
|
13
|
-
readonly config?: SelfModificationConfig;
|
|
14
|
-
}
|
|
15
|
-
type SelfModificationSandboxProbes = Pick<DefaultSandboxProbes, "isDeployedOnVercel" | "isMicrosandboxSupported">;
|
|
16
|
-
/** Defines the local source mount or isolated production proposal workspace. */
|
|
17
|
-
export declare function defineSelfModificationSandbox(options?: SelfModificationSandboxOptions): SandboxDefinition;
|
|
18
|
-
/**
|
|
19
|
-
* Deployed self-modification deliberately selects a backend that can inject
|
|
20
|
-
* GitHub auth at the network boundary, keeping the credential outside the
|
|
21
|
-
* sandbox and agent. Docker and just-bash do not provide that separation.
|
|
22
|
-
* Internal—exported for tests, which inject availability probes.
|
|
23
|
-
*/
|
|
24
|
-
export declare function selectDeployedSelfModificationBackend(configured: SandboxBackend | undefined, probes: SelfModificationSandboxProbes): SandboxBackend;
|
|
25
|
-
declare const _default: SandboxDefinition;
|
|
1
|
+
export { defineSelfModificationSandbox } from "eve/self-modification/sandbox";
|
|
2
|
+
declare const _default: import("eve/self-modification/sandbox").SelfModificationSandbox;
|
|
26
3
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import extension_default from"../../extension.js";import{defineSelfModificationSandbox,defineSelfModificationSandbox as defineSelfModificationSandbox$1}from"eve/self-modification/sandbox";var sandbox_default=defineSelfModificationSandbox$1({config:extension_default.config});export{sandbox_default as default,defineSelfModificationSandbox};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{resolveSelfModificationConfig}from"../../../../config.js";import{createGitHubCredentialProvider}from"../../../../credentials.js";import extension_default from"../../../extension.js";import{resolveSelfModificationMode}from"../../../../mode.js";import{readPreparedSelfModificationWorkspace}from"../../../../git-workspace.js";import{publishGitHubDraftPullRequest}from"../../../../github-publisher.js";import{withSelfModificationWorkspaceLock}from"../../../../workspace-lock.js";import{defineDynamic,defineTool}from"eve/tools";const inputSchema={type:`object`,additionalProperties:!1,properties:{summary:{type:`string`,minLength:1,maxLength:1e4,description:`Concise description of the proposed agent source change.`},title:{type:`string`,minLength:1,maxLength:256,description:`Concise draft pull request title.`}},required:[`summary`,`title`]},outputSchema={type:`object`,additionalProperties:!1,properties:{branch:{type:`string`},changedPaths:{type:`array`,items:{type:`string`}},commitSha:{type:`string`},deployed:{type:`boolean`,const:!1},draft:{type:`boolean`,const:!0},merged:{type:`boolean`,const:!1},pullRequestUrl:{type:`string`},repository:{type:`string`},targetBranch:{type:`string`}},required:[`branch`,`changedPaths`,`commitSha`,`deployed`,`draft`,`merged`,`pullRequestUrl`,`repository`,`targetBranch`]};function resolveTool(){let e=resolveSelfModificationConfig(extension_default.config);return resolveSelfModificationMode(e)!==`deployed`||e.deployed===void 0?null:defineTool({description:`Publish the complete validated agent source change as one draft pull request. Merge and deployment do not occur.`,inputSchema,outputSchema,execute:publish})}async function publish(e,t){if(typeof e!=`object`||!e||!(`summary`in e)||typeof e.summary!=`string`||e.summary.trim().length===0||!(`title`in e)||typeof e.title!=`string`||e.title.trim().length===0)throw Error(`Production publication requires a valid title and summary.`);let n=resolveSelfModificationConfig(extension_default.config);if(resolveSelfModificationMode(n)!==`deployed`||n.deployed===void 0)throw Error(`Production publication requires deployed self-modification configuration.`);let r=n.deployed,i=e.summary,a=e.title,o=publicationOperationId(t),s=await t.getSandbox();return await withSelfModificationWorkspaceLock(`sandbox:${
|
|
1
|
+
import{resolveSelfModificationConfig}from"../../../../config.js";import{createGitHubCredentialProvider}from"../../../../credentials.js";import extension_default from"../../../extension.js";import{resolveSelfModificationMode}from"../../../../mode.js";import{readPreparedSelfModificationWorkspace}from"../../../../git-workspace.js";import{publishGitHubDraftPullRequest}from"../../../../github-publisher.js";import{withSelfModificationWorkspaceLock}from"../../../../workspace-lock.js";import{defineDynamic,defineTool}from"eve/tools";const inputSchema={type:`object`,additionalProperties:!1,properties:{summary:{type:`string`,minLength:1,maxLength:1e4,description:`Concise description of the proposed agent source change.`},title:{type:`string`,minLength:1,maxLength:256,description:`Concise draft pull request title.`}},required:[`summary`,`title`]},outputSchema={type:`object`,additionalProperties:!1,properties:{branch:{type:`string`},changedPaths:{type:`array`,items:{type:`string`}},commitSha:{type:`string`},deployed:{type:`boolean`,const:!1},draft:{type:`boolean`,const:!0},merged:{type:`boolean`,const:!1},pullRequestUrl:{type:`string`},repository:{type:`string`},targetBranch:{type:`string`}},required:[`branch`,`changedPaths`,`commitSha`,`deployed`,`draft`,`merged`,`pullRequestUrl`,`repository`,`targetBranch`]};function resolveTool(){let e=resolveSelfModificationConfig(extension_default.config);return resolveSelfModificationMode(e)!==`deployed`||e.deployed===void 0?null:defineTool({description:`Publish the complete validated agent source change as one draft pull request. Merge and deployment do not occur.`,inputSchema,outputSchema,execute:publish})}async function publish(e,t){if(typeof e!=`object`||!e||!(`summary`in e)||typeof e.summary!=`string`||e.summary.trim().length===0||!(`title`in e)||typeof e.title!=`string`||e.title.trim().length===0)throw Error(`Production publication requires a valid title and summary.`);let n=resolveSelfModificationConfig(extension_default.config);if(resolveSelfModificationMode(n)!==`deployed`||n.deployed===void 0)throw Error(`Production publication requires deployed self-modification configuration.`);let r=n.deployed,i=e.summary,a=e.title,o=publicationOperationId(t),s=await t.getSandbox();return await withSelfModificationWorkspaceLock(`sandbox:${t.session.id}`,async()=>{let e=await readPreparedSelfModificationWorkspace({...r,sandbox:s});return await publishGitHubDraftPullRequest({credentialProvider:createGitHubCredentialProvider(r.credentials),description:i,operationId:o,sandbox:s,title:a,workspace:e})})}function publicationOperationId(e){let t=e.session.parent;if(t===void 0)throw Error(`Production publication requires a delegated child session.`);return`${t.rootSessionId}:${t.sessionId}:${t.turn.id}:${t.callId}:${e.session.id}`}var publish_default=defineDynamic({events:{"session.started":resolveTool}});export{publish_default as default,publicationOperationId};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{resolveSelfModificationConfig}from"../../../../config.js";import{classifyCatalogEntry}from"../../../classify-registry-item.js";import{runEveAdd}from"../../../eve-add.js";import extension_default from"../../../extension.js";import{assertOfficialRegistryAddress,installProductionRegistryItem}from"../../../production-registry-add.js";import{resolveSelfModificationMode}from"../../../../mode.js";import{readPreparedSelfModificationWorkspace}from"../../../../git-workspace.js";import{withSelfModificationWorkspaceLock}from"../../../../workspace-lock.js";import{loadRegistryIndex,officialRegistryIndexUrl,resolveRegistryIndexUrl}from"./search_registry.js";import{
|
|
1
|
+
import{resolveSelfModificationConfig}from"../../../../config.js";import{classifyCatalogEntry}from"../../../classify-registry-item.js";import{runEveAdd}from"../../../eve-add.js";import extension_default from"../../../extension.js";import{assertOfficialRegistryAddress,installProductionRegistryItem}from"../../../production-registry-add.js";import{resolveSelfModificationMode}from"../../../../mode.js";import{readPreparedSelfModificationWorkspace}from"../../../../git-workspace.js";import{withSelfModificationWorkspaceLock}from"../../../../workspace-lock.js";import{loadRegistryIndex,officialRegistryIndexUrl,resolveRegistryIndexUrl}from"./search_registry.js";import{getLocalDevCapability}from"eve/local-dev";import{defineDynamic,defineTool}from"eve/tools";import{once}from"eve/tools/approval";const localInputSchema={type:`object`,additionalProperties:!1,properties:{address:{type:`string`,minLength:1,maxLength:200,description:"Exact address of an item in the configured eve registry, for example `channel/slack` or `extension/browserbase`."}},required:[`address`]},localOutputSchema={type:`object`,additionalProperties:!1,properties:{status:{type:`string`,enum:[`installed`,`needs-terminal`,`failed`]},address:{type:`string`},title:{type:`string`},envVars:{type:`array`,items:{type:`string`},description:`Environment variables the item needs that are not set. The item is installed but will not work until the developer sets them. Never ask for or repeat their values.`},reason:{type:`string`,description:`Why the item was not installed here.`},changed:{type:`array`,items:{type:`string`},description:`Project-relative paths a failed install could not restore.`},nextCommand:{type:`string`,description:"The command that completes a `needs-terminal` item."},message:{type:`string`,description:`One-line summary to relay to the developer.`}},required:[`status`,`address`,`message`]},productionInputSchema={type:`object`,additionalProperties:!1,properties:{address:{type:`string`,minLength:1,maxLength:200,description:"Exact official eve registry address, for example `channel/slack` or `extension/browserbase`."},answers:{type:`object`,additionalProperties:!0,description:`Non-secret answers to the setup question returned by the previous call.`},installed:{type:`boolean`,description:`Set to true with answers when the previous input-required result installed the source.`}},required:[`address`]},productionOutputSchema={type:`object`,additionalProperties:!1,properties:{status:{type:`string`,enum:[`completed`,`input-required`,`external-action-required`,`failed`,`cancelled`]},address:{type:`string`},changedPaths:{type:`array`,items:{type:`string`},description:`Repository-relative paths installed into the proposal.`},completedItems:{type:`array`,items:{type:`string`}},deploymentRequired:{type:`boolean`},installed:{type:`boolean`,description:`Whether source installation completed before setup paused.`},question:{type:`object`,additionalProperties:!0,description:`The current setup question. Supply only its non-secret answer on the next call.`},message:{type:`string`},url:{type:`string`,description:`External authorization URL the developer must open.`},userCode:{type:`string`}},required:[`status`,`address`]};function unsetEnvVars(e,t=process.env){return(e.envVars??[]).filter(e=>{let n=t[e];return n===void 0||n===``})}function handoffMessage(e){if(e.interactiveClient)return{message:`${e.title} was not installed by this tool. ${e.reason} Continue in the setup panel that opens here; do not ask the developer to run another command.`};let t=`eve add ${e.address}`;return{message:`${e.title} was not installed. ${e.reason} Run \`${t}\` in a terminal to finish it.`,nextCommand:t}}async function addLocalRegistryItem(e,t={}){let n=(t.getCapability??getLocalDevCapability)();if(n===void 0)throw Error("Registry items can only be installed while `eve dev` is running. Report the item address to the developer instead of installing it.");let r=(await loadRegistryIndex({nowMs:Date.now(),signal:t.signal,url:resolveRegistryIndexUrl()})).find(t=>t.address===e);if(r===void 0)throw Error(`No item in the configured eve registry is published at "${e}". Check the address before trying again.`);let i=classifyCatalogEntry(r);if(i.kind===`needs-terminal`){let t=handoffMessage({address:e,interactiveClient:n.interactiveClient,reason:i.reason,title:r.title});return{address:e,reason:i.reason,status:`needs-terminal`,title:r.title,...t}}let a=await withSelfModificationWorkspaceLock(`local:${n.appRoot}`,async()=>n.withSuspendedSource(()=>runEveAdd({address:e,appRoot:n.appRoot,signal:t.signal,spawn:t.spawn})));if(a.kind===`blocked`){let t=handoffMessage({address:e,interactiveClient:n.interactiveClient,reason:a.message,title:r.title});return{address:e,reason:a.message,status:`needs-terminal`,title:r.title,...t}}if(a.kind===`failed`)return a.changed===void 0?{address:e,status:`failed`,title:r.title,reason:a.message,message:a.message}:{address:e,status:`failed`,title:r.title,reason:a.message,message:a.message,changed:a.changed};let o=unsetEnvVars(r);return{address:e,envVars:[...o],message:o.length===0?`Installed ${r.title}.`:`Installed ${r.title}. It will not work until ${o.join(`, `)} ${o.length===1?`is`:`are`} set.`,status:`installed`,title:r.title}}async function addProductionRegistryItem(e,t,n,r){if(assertOfficialRegistryAddress(e),(await loadRegistryIndex({nowMs:Date.now(),signal:t.abortSignal,url:officialRegistryIndexUrl()})).find(t=>t.address===e)===void 0)throw Error(`No official eve registry item is published at "${e}".`);let i=await t.getSandbox(),a=await withSelfModificationWorkspaceLock(`sandbox:${t.session.id}`,async()=>{let a=await readPreparedSelfModificationWorkspace({...n,sandbox:i});return await installProductionRegistryItem({address:e,answers:r.answers,installed:r.installed,sandbox:i,signal:t.abortSignal,workspace:a})});return a.kind===`completed`?{address:e,...a,status:`completed`}:a.kind===`input-required`?{address:e,...a,status:`input-required`}:a.kind===`external-action-required`?{address:e,...a,status:`external-action-required`}:{address:e,...a,status:a.kind}}function localRegistryAddTool(){return defineTool({approval:once(),description:`Install an item from the configured eve registry into this project. Items that need setup are handed to the local setup flow instead. Search first, then call this with the exact item address.`,inputSchema:localInputSchema,outputSchema:localOutputSchema,async execute(e,t){let{address:n}=e;if(typeof n!=`string`||n.length===0)throw Error(`address must be an exact item address from the configured eve registry.`);return await addLocalRegistryItem(n,{signal:t.abortSignal})}})}function productionRegistryAddTool(e){return defineTool({approval:once(),description:`Install an exact item from the official eve registry into the current production change proposal. If setup pauses, call this tool again with the non-secret answers and the installed state from its result. External authorization and secret binding must be completed by the developer.`,inputSchema:productionInputSchema,outputSchema:productionOutputSchema,async execute(t,n){let{address:r}=t;if(typeof r!=`string`||r.length===0)throw Error(`address must be an exact item address from the official eve registry.`);return await addProductionRegistryItem(r,n,e,{answers:`answers`in t&&typeof t.answers==`object`&&t.answers!==null&&!Array.isArray(t.answers)?t.answers:void 0,installed:`installed`in t&&t.installed===!0})}})}function resolveRegistryAddTool(e){let t=resolveSelfModificationMode(e);return t===`local`?localRegistryAddTool():t===`deployed`&&e.deployed!==void 0?productionRegistryAddTool(e.deployed):null}var registry_add_default=defineDynamic({events:{"session.started":()=>resolveRegistryAddTool(resolveSelfModificationConfig(extension_default.config))}});export{addLocalRegistryItem,registry_add_default as default,handoffMessage,resolveRegistryAddTool,unsetEnvVars};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { IFileSystem } from "just-bash";
|
|
2
2
|
export declare function createSelfModificationFilesystem(input: {
|
|
3
|
-
readonly appRoot
|
|
3
|
+
readonly appRoot?: string;
|
|
4
4
|
readonly defaultFilesystem: IFileSystem;
|
|
5
|
+
resolveProjectPath?(path: string): string;
|
|
5
6
|
readonly justBash: typeof import("just-bash");
|
|
6
7
|
}): Promise<IFileSystem>;
|
|
8
|
+
export declare const createLocalSelfModificationFilesystem: typeof createSelfModificationFilesystem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{mkdir}from"node:fs/promises";import{resolve}from"node:path";async function createSelfModificationFilesystem(e){let{MountableFs:
|
|
1
|
+
import{mkdir}from"node:fs/promises";import{resolve}from"node:path";import{getLocalDevCapability}from"eve/local-dev";async function createSelfModificationFilesystem(e){let t=getLocalDevCapability();if(t===void 0)throw Error(`Self-modification requires eve dev facilities for the authored source tree and watcher.`);let{MountableFs:n,OverlayFs:r,ReadWriteFs:i}=e.justBash,a=t.appRoot,o=resolve(a,`.eve/traces/v1`),s=resolve(a,`.eve/logs`);return await Promise.all([e.defaultFilesystem.mkdir(`/source`,{recursive:!0}),mkdir(o,{recursive:!0}),mkdir(s,{recursive:!0})]),new n({base:e.defaultFilesystem,mounts:[{filesystem:new i({allowSymlinks:!1,maxFileReadSize:2**53-1,root:resolve(a,`agent`)}),mountPoint:`/source`},{filesystem:new r({mountPoint:`/`,readOnly:!0,root:o}),mountPoint:`/traces`},{filesystem:new r({mountPoint:`/`,readOnly:!0,root:s}),mountPoint:`/logs`},{filesystem:new r({mountPoint:`/`,readOnly:!0,root:resolve(a,`node_modules/eve/docs`)}),mountPoint:`/eve-docs`}]})}const createLocalSelfModificationFilesystem=createSelfModificationFilesystem;export{createLocalSelfModificationFilesystem,createSelfModificationFilesystem};
|
|
@@ -11,7 +11,7 @@ export interface PreparedSelfModificationWorkspace {
|
|
|
11
11
|
readonly repositoryPath: string;
|
|
12
12
|
readonly targetBranch: string;
|
|
13
13
|
}
|
|
14
|
-
type CheckoutSandbox = Pick<SandboxSession, "run"
|
|
14
|
+
type CheckoutSandbox = Pick<SandboxSession, "run"> & Required<Pick<SandboxSession, "setNetworkPolicy">>;
|
|
15
15
|
/** Prepares a token-free remote and immutable target-branch checkout for one child session. */
|
|
16
16
|
export declare function prepareSelfModificationWorkspace(input: {
|
|
17
17
|
readonly directory: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SandboxSession } from "eve/sandbox";
|
|
2
2
|
type CommandSandbox = Pick<SandboxSession, "run">;
|
|
3
|
-
export declare function withBrokeredGitHubCredential<T>(sandbox: Pick<SandboxSession, "setNetworkPolicy"
|
|
3
|
+
export declare function withBrokeredGitHubCredential<T>(sandbox: Required<Pick<SandboxSession, "setNetworkPolicy">>, token: string, operation: () => Promise<T>): Promise<T>;
|
|
4
4
|
export declare function gitOutput(sandbox: CommandSandbox, command: string, trim?: boolean): Promise<string>;
|
|
5
5
|
export declare function runGitCommand(sandbox: CommandSandbox, command: string): Promise<void>;
|
|
6
6
|
export {};
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
|
|
1
|
+
import { type RuntimeSandboxSession, type SandboxSelectorContext } from "#public/definitions/sandbox.js";
|
|
2
|
+
import { MicrosandboxSandbox } from "#sandbox/providers/microsandbox.js";
|
|
3
|
+
import { type DefaultSandboxProbes } from "#sandbox/providers/default.js";
|
|
4
|
+
import { VercelSandbox } from "#sandbox/providers/vercel.js";
|
|
5
|
+
import { type SelfModificationConfig } from "./config.js";
|
|
3
6
|
export interface SelfModificationSandboxOptions {
|
|
4
|
-
readonly
|
|
5
|
-
readonly config?: unknown;
|
|
7
|
+
readonly config?: SelfModificationConfig;
|
|
6
8
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
export interface SelfModificationSandbox {
|
|
10
|
+
(context: SandboxSelectorContext): Promise<RuntimeSandboxSession> | RuntimeSandboxSession;
|
|
11
|
+
}
|
|
12
|
+
type Probes = Pick<DefaultSandboxProbes, "isDeployedOnVercel" | "isMicrosandboxSupported">;
|
|
13
|
+
type DeployedSelfModificationEnvironment = ReturnType<typeof MicrosandboxSandbox.environment> | ReturnType<typeof VercelSandbox.environment>;
|
|
14
|
+
export declare function defineSelfModificationSandbox(options?: SelfModificationSandboxOptions): SelfModificationSandbox;
|
|
15
|
+
export declare function selectDeployedSelfModificationEnvironment(probes: Probes): DeployedSelfModificationEnvironment;
|
|
16
|
+
declare const _default: SelfModificationSandbox;
|
|
12
17
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineSandbox}from"#public/sandbox/
|
|
1
|
+
import{resolveSelfModificationConfig}from"./config.js";import{createGitHubCredentialProvider}from"./credentials.js";import{SELF_MODIFICATION_BASELINE_NETWORK_POLICY}from"./network-policy.js";import{resolveSelfModificationMode}from"./mode.js";import{REPOSITORY_PATH,prepareSelfModificationWorkspace}from"./git-workspace.js";import{createSelfModificationFilesystem}from"./filesystem.js";import{bindSandboxEnvironment}from"#shared/sandbox-environment.js";import{shellQuote}from"#shared/shell-quote.js";import{defineSandbox}from"#public/definitions/sandbox.js";import{SANDBOX_PROVIDER_PROBES}from"#sandbox/providers/default.js";import{JustBashSandbox}from"#sandbox/providers/just-bash.js";import{MicrosandboxSandbox}from"#sandbox/providers/microsandbox.js";import{VercelSandbox}from"#sandbox/providers/vercel.js";function defineSelfModificationSandbox(e={}){let t=resolveSelfModificationConfig(e.config),n=resolveSelfModificationMode(t);if(n!==`deployed`){let e=n===`local`?JustBashSandbox.environment({filesystem:createSelfModificationFilesystem}):JustBashSandbox.environment();return bindSandboxEnvironment(defineSandbox(()=>e.open()),e)}let r=selectDeployedSelfModificationEnvironment(SANDBOX_PROVIDER_PROBES);return bindSandboxEnvironment(defineSandbox(async({session:e})=>{let n=await r.open({networkPolicy:SELF_MODIFICATION_BASELINE_NETWORK_POLICY});if(t.deployed===void 0)return n;if(e.parent===void 0)throw Error(`Production self-modification requires a child session.`);if(n.setNetworkPolicy===void 0)throw Error(`Production self-modification requires mutable sandbox network policy.`);let i={...n,setNetworkPolicy:n.setNetworkPolicy},a=t.deployed,o=await createGitHubCredentialProvider(a.credentials).resolve({capability:`checkout`,repository:a.repository});await prepareSelfModificationWorkspace({directory:a.directory,repository:a.repository,sandbox:i,targetBranch:a.targetBranch,token:o});let s=a.directory===`.`?REPOSITORY_PATH:`${REPOSITORY_PATH}/${a.directory}`;if((await n.run({command:`rm -rf /source && ln -s ${shellQuote(`${s}/agent`)} /source`})).exitCode!==0)throw Error(`Self-modification could not mount the agent source.`);return n}),r)}function selectDeployedSelfModificationEnvironment(e){if(e.isDeployedOnVercel())return VercelSandbox.environment();if(e.isMicrosandboxSupported())return MicrosandboxSandbox.environment();throw Error(`Deployed self-modification requires runtime credential transforms. No supported provider is available. Use Vercel Sandbox or microsandbox on a supported self-hosted system.`)}var sandbox_default=defineSelfModificationSandbox();export{sandbox_default as default,defineSelfModificationSandbox,selectDeployedSelfModificationEnvironment};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{select}from"../ask.js";import{DEFAULT_AGENT_MODEL_ID}from"#shared/default-agent-model.js";import{AI_GATEWAY_MODELS_URL,vercelGatewayFetch}from"#internal/gateway.js";import{parseGatewayModelCatalog,parseGatewayModelCatalog as parseGatewayCatalog}from"#shared/gateway-model-catalog.js";function modelOption(e,t,n,r=!0){return{id:e,label:t,value:e,hint:n,featured:r||void 0}}const FEATURED_MODEL_IDS=[DEFAULT_AGENT_MODEL_ID,`anthropic/claude-opus-4.8`,`openai/gpt-5.5`],FALLBACK_MODELS=[modelOption(DEFAULT_AGENT_MODEL_ID,`
|
|
1
|
+
import{select}from"../ask.js";import{DEFAULT_AGENT_MODEL_ID}from"#shared/default-agent-model.js";import{AI_GATEWAY_MODELS_URL,vercelGatewayFetch}from"#internal/gateway.js";import{parseGatewayModelCatalog,parseGatewayModelCatalog as parseGatewayCatalog}from"#shared/gateway-model-catalog.js";function modelOption(e,t,n,r=!0){return{id:e,label:t,value:e,hint:n,featured:r||void 0}}const FEATURED_MODEL_IDS=[DEFAULT_AGENT_MODEL_ID,`anthropic/claude-opus-4.8`,`openai/gpt-5.5`],FALLBACK_MODELS=[modelOption(DEFAULT_AGENT_MODEL_ID,`Grok 4.7`,`SpaceXAI`),modelOption(`anthropic/claude-opus-4.8`,`Claude Opus 4.8`,`Anthropic`),modelOption(`openai/gpt-5.5`,`GPT-5.5`,`OpenAI`),modelOption(`google/gemini-3.5`,`Gemini 3.5`,`Google`,!1)],PROVIDER_BRANDS={openai:`OpenAI`,zai:`Z.AI`,xai:`xAI`,spacexai:`SpaceXAI`,deepseek:`DeepSeek`,moonshotai:`Moonshot AI`};function providerLabel(e){return e.length===0?``:PROVIDER_BRANDS[e]??e.charAt(0).toUpperCase()+e.slice(1)}async function fetchGatewayCatalog(e){let t=new AbortController,n=setTimeout(()=>t.abort(),5e3);try{let n=e===void 0?t.signal:AbortSignal.any([e,t.signal]),r=await vercelGatewayFetch(AI_GATEWAY_MODELS_URL,{signal:n});if(!r.ok)throw Error(`AI Gateway model catalog request failed (${r.status}).`);return parseGatewayModelCatalog(await r.json())}finally{clearTimeout(n)}}function featuredPriority(e){let t=FEATURED_MODEL_IDS.indexOf(e);return t===-1?FEATURED_MODEL_IDS.length:t}function modelOptionsFromCatalog(e){if(e===void 0)return FALLBACK_MODELS;let t=e.filter(e=>e.type===`language`&&(e.id===DEFAULT_AGENT_MODEL_ID||(e.tags??[]).includes(`web-search`))).map(e=>{let t=e.id.split(`/`)[0]??``;return{value:e.id,label:e.name,hint:providerLabel(t),provider:t,released:e.released}}).sort((e,t)=>{let n=featuredPriority(e.value)-featuredPriority(t.value);if(n!==0)return n;let r=(t.released??-1/0)-(e.released??-1/0);if(r!==0)return r;let i=e.label.localeCompare(t.label);return i===0?e.value.localeCompare(t.value):i});return t.length===0?FALLBACK_MODELS:t.map(({value:e,label:t,hint:n})=>({id:e,label:t,value:e,hint:n,featured:FEATURED_MODEL_IDS.includes(e)||void 0}))}async function buildModelOptions(e,t){try{return modelOptionsFromCatalog(await e(t))}catch{return t?.throwIfAborted(),FALLBACK_MODELS}}function selectModel(e){let t=e.deps??{fetchModels:fetchGatewayCatalog};return{id:`select-model`,async gather({signal:n}){let r=e.presetModel;if(r!==void 0&&r.length>0)return r;let i=await buildModelOptions(t.fetchModels,n),a=e.defaultModel!==void 0&&i.some(t=>t.value===e.defaultModel)?e.defaultModel:i.some(e=>e.value===DEFAULT_AGENT_MODEL_ID)?DEFAULT_AGENT_MODEL_ID:i[0]?.value;return e.asker.ask(select({key:`model`,message:`Which model should your agent use?`,options:i,recommended:a,required:!0,search:!0,placeholder:`type to search`}))},async perform({input:e}){return e},apply(e,t){return{...e,modelId:t}}}}export{fetchGatewayCatalog,modelOptionsFromCatalog,parseGatewayCatalog,selectModel};
|
|
@@ -23,6 +23,8 @@ export type SelectEvent = {
|
|
|
23
23
|
char: string;
|
|
24
24
|
} | {
|
|
25
25
|
type: "backspace";
|
|
26
|
+
} | {
|
|
27
|
+
type: "delete-word-backward";
|
|
26
28
|
} | {
|
|
27
29
|
type: "clear";
|
|
28
30
|
} | {
|
|
@@ -58,8 +60,8 @@ export declare function filterOptions(options: readonly PromptOption<string>[],
|
|
|
58
60
|
/**
|
|
59
61
|
* Advances the interaction state for a single keypress.
|
|
60
62
|
*
|
|
61
|
-
* Editing the query
|
|
62
|
-
*
|
|
63
|
+
* Editing the query re-homes the cursor onto the first selectable match but
|
|
64
|
+
* leaves marked values intact, so a multi-select keeps its
|
|
63
65
|
* picks while the list is filtered. `toggle` (space) marks or unmarks the
|
|
64
66
|
* highlighted entry; navigation skips disabled rows.
|
|
65
67
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{previousGraphemeBoundary}from"#shared/text-boundaries.js";const SEARCH_ACTION_PREFIX=`\0search-action:`;function searchActionValue(e){return`${SEARCH_ACTION_PREFIX}${e}`}function searchActionQuery(e){return e.startsWith(SEARCH_ACTION_PREFIX)?e.slice(15):void 0}function submitRowIndex(e){return e.length}function filterOptions(e,t,n){let r=t.trim();if(r===``)return[...e];let i=r.toLowerCase(),a=e.filter(e=>e.trailingAction!==!0&&(e.label.toLowerCase().includes(i)||e.value.toLowerCase().includes(i)||(e.hint?.toLowerCase().includes(i)??!1)||(e.focusHint?.toLowerCase().includes(i)??!1)||(e.keywords?.some(e=>e.toLowerCase().includes(i))??!1)));return n!==void 0&&a.push({value:searchActionValue(r),label:n.label(r)}),[...a,...e.filter(e=>e.trailingAction===!0)]}function isFocusable(e){return!e.disabled&&!e.locked}function isActionable(e){return isFocusable(e)&&!e.completed}function firstFocusableIndex(e,t){let n=e.findIndex(isFocusable);return n>=0?n:t?submitRowIndex(e):0}function stepCursor(e,t,n,r){let i=e.length+ +!!r;if(i===0)return t;let a=t;for(let t=0;t<i;t+=1){if(a=(a+n+i)%i,r&&a===submitRowIndex(e))return a;let t=e[a];if(t&&isFocusable(t))return a}return t}function reduceSelect(e,t,n){let r=n.submitRow===!0;switch(t.type){case`char`:{let i=e.filter+t.char;return{...e,filter:i,cursor:firstFocusableIndex(filterOptions(n.options,i,n.searchAction),r)}}case`backspace`:{if(e.filter.length===0)return e;let t=e.filter.slice(0,previousGraphemeBoundary(e.filter,e.filter.length));return{...e,filter:t,cursor:firstFocusableIndex(filterOptions(n.options,t,n.searchAction),r)}}case`clear`:return e.filter.length===0?e:{...e,filter:``,cursor:firstFocusableIndex(filterOptions(n.options,``,n.searchAction),r)};case`up`:case`down`:{let i=filterOptions(n.options,e.filter,n.searchAction),a=t.type===`up`?-1:1,o=stepCursor(i,e.cursor,a,r);return o===e.cursor?e:{...e,cursor:o}}case`toggle`:{let t=filterOptions(n.options,e.filter,n.searchAction)[e.cursor];if(t===void 0||!isActionable(t))return e;let r=new Set(e.selected);return r.has(t.value)?r.delete(t.value):r.add(t.value),{...e,selected:r}}}}function initialSelectState(e){let t=e.filter??``,n=filterOptions(e.options,t,e.searchAction),r=firstFocusableIndex(n,e.submitRow===!0);if(e.defaultValue!==void 0){let t=n.findIndex(t=>isFocusable(t)&&t.value===e.defaultValue);t>=0&&(r=t)}let i=e.options.filter(e=>e.locked).map(e=>e.value);return{filter:t,cursor:r,selected:new Set([...e.initialValues??[],...i])}}function selectValueAtCursor(e,t){let n=e[t];return n&&isActionable(n)?n.value:void 0}function orderedSelection(e,t){return e.filter(e=>t.has(e.value)).map(e=>e.value)}export{filterOptions,initialSelectState,orderedSelection,reduceSelect,searchActionQuery,searchActionValue,selectValueAtCursor,submitRowIndex};
|
|
1
|
+
import{previousGraphemeBoundary}from"#shared/text-boundaries.js";const SEARCH_ACTION_PREFIX=`\0search-action:`;function searchActionValue(e){return`${SEARCH_ACTION_PREFIX}${e}`}function searchActionQuery(e){return e.startsWith(SEARCH_ACTION_PREFIX)?e.slice(15):void 0}function submitRowIndex(e){return e.length}function filterOptions(e,t,n){let r=t.trim();if(r===``)return[...e];let i=r.toLowerCase(),a=e.filter(e=>e.trailingAction!==!0&&(e.label.toLowerCase().includes(i)||e.value.toLowerCase().includes(i)||(e.hint?.toLowerCase().includes(i)??!1)||(e.focusHint?.toLowerCase().includes(i)??!1)||(e.keywords?.some(e=>e.toLowerCase().includes(i))??!1)));return n!==void 0&&a.push({value:searchActionValue(r),label:n.label(r)}),[...a,...e.filter(e=>e.trailingAction===!0)]}function isFocusable(e){return!e.disabled&&!e.locked}function isActionable(e){return isFocusable(e)&&!e.completed}function previousWordBoundary(e){let t=e.length;for(;t>0;){let n=previousGraphemeBoundary(e,t);if(isWordCharacter(e.slice(n,t)))break;t=n}for(;t>0;){let n=previousGraphemeBoundary(e,t);if(!isWordCharacter(e.slice(n,t)))break;t=n}return t}function isWordCharacter(e){return/^[\p{L}\p{M}\p{N}_]/u.test(e)}function firstFocusableIndex(e,t){let n=e.findIndex(isFocusable);return n>=0?n:t?submitRowIndex(e):0}function stepCursor(e,t,n,r){let i=e.length+ +!!r;if(i===0)return t;let a=t;for(let t=0;t<i;t+=1){if(a=(a+n+i)%i,r&&a===submitRowIndex(e))return a;let t=e[a];if(t&&isFocusable(t))return a}return t}function reduceSelect(e,t,n){let r=n.submitRow===!0;switch(t.type){case`char`:{let i=e.filter+t.char;return{...e,filter:i,cursor:firstFocusableIndex(filterOptions(n.options,i,n.searchAction),r)}}case`backspace`:{if(e.filter.length===0)return e;let t=e.filter.slice(0,previousGraphemeBoundary(e.filter,e.filter.length));return{...e,filter:t,cursor:firstFocusableIndex(filterOptions(n.options,t,n.searchAction),r)}}case`delete-word-backward`:{if(e.filter.length===0)return e;let t=e.filter.slice(0,previousWordBoundary(e.filter));return{...e,filter:t,cursor:firstFocusableIndex(filterOptions(n.options,t,n.searchAction),r)}}case`clear`:return e.filter.length===0?e:{...e,filter:``,cursor:firstFocusableIndex(filterOptions(n.options,``,n.searchAction),r)};case`up`:case`down`:{let i=filterOptions(n.options,e.filter,n.searchAction),a=t.type===`up`?-1:1,o=stepCursor(i,e.cursor,a,r);return o===e.cursor?e:{...e,cursor:o}}case`toggle`:{let t=filterOptions(n.options,e.filter,n.searchAction)[e.cursor];if(t===void 0||!isActionable(t))return e;let r=new Set(e.selected);return r.has(t.value)?r.delete(t.value):r.add(t.value),{...e,selected:r}}}}function initialSelectState(e){let t=e.filter??``,n=filterOptions(e.options,t,e.searchAction),r=firstFocusableIndex(n,e.submitRow===!0);if(e.defaultValue!==void 0){let t=n.findIndex(t=>isFocusable(t)&&t.value===e.defaultValue);t>=0&&(r=t)}let i=e.options.filter(e=>e.locked).map(e=>e.value);return{filter:t,cursor:r,selected:new Set([...e.initialValues??[],...i])}}function selectValueAtCursor(e,t){let n=e[t];return n&&isActionable(n)?n.value:void 0}function orderedSelection(e,t){return e.filter(e=>t.has(e.value)).map(e=>e.value)}export{filterOptions,initialSelectState,orderedSelection,reduceSelect,searchActionQuery,searchActionValue,selectValueAtCursor,submitRowIndex};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fetchGatewayCatalog}from"../boxes/select-model.js";import{measureLoginStage,withLoginProgress}from"./model-login-progress.js";import{CONNECTION_OPTIONS,authenticateModelConnection,reuseModelConnection}from"./model-login-connection.js";import{changeValidatedAgentModel,readAuthoredModelSelection}from"./model-source-change.js";import{MODEL_CONNECTION_ENV}from"#internal/model-auth/transport.js";import{inspectApplication}from"#services/inspect-application.js";import{WizardCancelledError}from"#setup/step.js";import{MODEL_HELPERS,parseModelHelper}from"#shared/model-helper.js";import{providerSettingsMatch,readProviderKeySourceSync,readProviderSelection,readProviderTeamSync,resolveAvailableProviders,writeProviderSelection}from"#setup/provider-settings.js";import{resolveModelEndpointStatus}from"#internal/resolve-model-endpoint-status.js";import{classifyModelRouting}from"#internal/classify-model-routing.js";import{availableHelperModels}from"#internal/model-auth/available-models.js";import{isModelConnection,readDefaultConnection,writeDefaultConnection}from"#internal/model-auth/store.js";function environmentConnection(e){if(e.AI_GATEWAY_API_KEY?.trim())return`ai-gateway-key`;if(e.VERCEL_OIDC_TOKEN?.trim())return`ai-gateway-project`;if(e.OPENAI_API_KEY?.trim())return`openai`;if(e.ANTHROPIC_API_KEY?.trim())return`anthropic`}async function readLoginModel(e){let t=await readAuthoredModelSelection(e);if(t!==void 0)return{selection:t,external:parseModelHelper(t)!==void 0};let n=(await inspectApplication(e)).compiledState?.manifest.config.model;return{selection:n?.routing.kind===`gateway`&&n.source===void 0?n.id:void 0,external:n?.routing.kind===`external`}}function modelSelection(e,t){let n=e===`chatgpt`||e===`openai`||e===`anthropic`?e:void 0,r=t.selection===void 0?void 0:parseModelHelper(t.selection),i=n?r?.helper===n:t.selection!==void 0&&!t.external,a=n?MODEL_HELPERS[n].defaultModel
|
|
1
|
+
import{fetchGatewayCatalog}from"../boxes/select-model.js";import{measureLoginStage,withLoginProgress}from"./model-login-progress.js";import{CONNECTION_OPTIONS,authenticateModelConnection,reuseModelConnection}from"./model-login-connection.js";import{changeValidatedAgentModel,readAuthoredModelSelection}from"./model-source-change.js";import{MODEL_CONNECTION_ENV}from"#internal/model-auth/transport.js";import{DEFAULT_AGENT_MODEL_ID}from"#shared/default-agent-model.js";import{inspectApplication}from"#services/inspect-application.js";import{WizardCancelledError}from"#setup/step.js";import{MODEL_HELPERS,parseModelHelper}from"#shared/model-helper.js";import{providerSettingsMatch,readProviderKeySourceSync,readProviderSelection,readProviderTeamSync,resolveAvailableProviders,writeProviderSelection}from"#setup/provider-settings.js";import{resolveModelEndpointStatus}from"#internal/resolve-model-endpoint-status.js";import{classifyModelRouting}from"#internal/classify-model-routing.js";import{availableHelperModels}from"#internal/model-auth/available-models.js";import{isModelConnection,readDefaultConnection,writeDefaultConnection}from"#internal/model-auth/store.js";function environmentConnection(e){if(e.AI_GATEWAY_API_KEY?.trim())return`ai-gateway-key`;if(e.VERCEL_OIDC_TOKEN?.trim())return`ai-gateway-project`;if(e.OPENAI_API_KEY?.trim())return`openai`;if(e.ANTHROPIC_API_KEY?.trim())return`anthropic`}async function readLoginModel(e){let t=await readAuthoredModelSelection(e);if(t!==void 0)return{selection:t,external:parseModelHelper(t)!==void 0};let n=(await inspectApplication(e)).compiledState?.manifest.config.model;return{selection:n?.routing.kind===`gateway`&&n.source===void 0?n.id:void 0,external:n?.routing.kind===`external`}}function modelSelection(e,t){let n=e===`chatgpt`||e===`openai`||e===`anthropic`?e:void 0,r=t.selection===void 0?void 0:parseModelHelper(t.selection),i=n?r?.helper===n:t.selection!==void 0&&!t.external,a=n?MODEL_HELPERS[n].defaultModel:DEFAULT_AGENT_MODEL_ID,o=r?.id??t.selection;return{helper:n,compatible:i,defaultId:a,needsModels:!i||o===a}}async function applyConnection(e,t,n,r){let{appRoot:i,prompter:a,signal:o}=e,{selected:s,team:c}=t,{helper:l,compatible:u,defaultId:d,needsModels:f}=modelSelection(s,n),p;if(f){let e=t.availableModels??r??(l?await withLoginProgress(a,`Loading available models…`,()=>availableHelperModels(l,o)):[]),i=d;if(!e.includes(i)){if(e.length===0)throw Error(`No models are available for this connection. Choose another connection with /login.`);i=await a.select({message:`Choose an available model`,search:!0,options:e.map(e=>({value:e,label:e}))})}let s=l?MODEL_HELPERS[l].prefix+i:i;(!u||s!==n.selection)&&(p=s)}let m=s===`openai`||s===`anthropic`||s===`ai-gateway-key`?e.automatic?readProviderKeySourceSync(i)??(environmentConnection(process.env)===s?`environment`:`secret`):`secret`:void 0,h={selected:s,...c,keySource:m},g=!await providerSettingsMatch(i,h),save=async()=>{if(o?.throwIfAborted(),p!==void 0){let t=await changeValidatedAgentModel({appRoot:e.agentRoot??i,slug:p});if(t.kind===`rejected`)throw Error(t.message)}g&&await writeProviderSelection(i,s,c,m),process.env[MODEL_CONNECTION_ENV]=s,m?process.env.EVE_MODEL_KEY_SOURCE=m:delete process.env.EVE_MODEL_KEY_SOURCE,c?(process.env.EVE_MODEL_TEAM=c.teamId,process.env.EVE_MODEL_TEAM_NAME=c.teamName):(delete process.env.EVE_MODEL_TEAM,delete process.env.EVE_MODEL_TEAM_NAME)};p===void 0?await save():await withLoginProgress(a,`Loading selected model…`,()=>measureLoginStage(`activation`,()=>e.withConnectionUpdate?e.withConnectionUpdate(save):save())),e.automatic||await writeDefaultConnection(s);let _=p??n.selection,v=l&&_?parseModelHelper(_)?.id:_,y;if(v){let e=l?{kind:`external`,provider:MODEL_HELPERS[l].provider}:classifyModelRouting(v);y={id:v,routing:e,endpoint:resolveModelEndpointStatus(e,{apiKey:s===`ai-gateway-key`,oidc:s===`ai-gateway-project`,account:s===`vercel`||s===`vercel-cli`,team:c?.teamName},{state:`ready`})}}return{kind:`ready`,reload:p!==void 0&&e.withConnectionUpdate===void 0,...y&&{model:y}}}async function runModelLogin(e){let{appRoot:t,prompter:n,signal:r}=e,i,getModel=()=>i??=measureLoginStage(`source_inspection`,()=>readLoginModel(e.agentRoot??t)),connect=async(i,a)=>{let o=new AbortController,s=r?AbortSignal.any([r,o.signal]):o.signal,c=getModel().then(async e=>{let t=modelSelection(i,e);return{model:e,models:!t.helper&&t.needsModels?(await measureLoginStage(`gateway_catalog`,()=>fetchGatewayCatalog(s))).filter(e=>e.type===`language`).map(e=>e.id):void 0}}).then(e=>({value:e}),e=>({error:e}));try{let r=readProviderTeamSync(t),o=await measureLoginStage(`authentication`,async()=>a?await withLoginProgress(n,`Checking model access…`,()=>reuseModelConnection(i,r,s)):await authenticateModelConnection({selected:i,team:r,prompter:n,signal:s}));if(!o)return;let l=await withLoginProgress(n,`Loading available models…`,()=>c);if(`error`in l)throw l.error;return await applyConnection({...e,automatic:a,signal:s},o,l.value.model,l.value.models)}finally{o.abort()}};try{if(e.automatic){let{model:e,selected:a}=await withLoginProgress(n,`Reading saved connection…`,async()=>{let[e,n,r,i]=await Promise.all([getModel(),readProviderSelection(t),resolveAvailableProviders(t),readDefaultConnection()]),a=e.selection===void 0?void 0:parseModelHelper(e.selection)?.helper;return{model:e,selected:n??a??environmentConnection(process.env)??(r.includes(`ai-gateway-project`)?`ai-gateway-project`:void 0)??i??`vercel-cli`}});if(e.external&&e.selection===void 0)return{kind:`ready`,reload:!1};try{let e=await connect(a,!0);if(e)return e}catch(e){i=void 0,r?.throwIfAborted(),n.log.warning(e instanceof Error?e.message:`Could not connect automatically. Retry /login.`)}}for(;;){let e=await n.select({message:`Choose a connection`,search:!0,options:[...CONNECTION_OPTIONS]});if(!isModelConnection(e))throw Error(`Choose a model connection.`);try{let t=await connect(e,!1);if(t)return t}catch(e){if(i=void 0,e instanceof WizardCancelledError)return{kind:`cancelled`};r?.throwIfAborted(),n.log.warning(e instanceof Error?e.message:`Connection failed. Retry /login.`)}}}catch(e){if(e instanceof WizardCancelledError)return{kind:`cancelled`};throw e}}export{environmentConnection,runModelLogin};
|
|
@@ -6,6 +6,10 @@ export interface PnpmBuildPolicyContext {
|
|
|
6
6
|
}
|
|
7
7
|
/** Applies one explicit pnpm build policy while preserving unrelated workspace settings. */
|
|
8
8
|
export declare function withPnpmBuildPolicy(source: string, packages: readonly string[], action: PnpmBuildPolicyAction): string;
|
|
9
|
+
/** Adds optional-package defaults without replacing the application's explicit decisions. */
|
|
10
|
+
export declare function withPnpmOptionalDependencyDefaults(source: string, packages: readonly string[]): string;
|
|
11
|
+
/** Prepares defaults in the owning workspace before installing an optional engine. */
|
|
12
|
+
export declare function ensurePnpmOptionalDependencyDefaults(appRoot: string, packages: readonly string[]): Promise<void>;
|
|
9
13
|
/** Resolves whether every package already has an explicit non-blocking pnpm policy. */
|
|
10
14
|
export declare function inspectPnpmBuildPolicy(appRoot: string, packages: readonly string[]): Promise<PnpmBuildPolicyContext>;
|
|
11
15
|
/** Persists the policy selected before the registry installation transaction begins. */
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{PNPM_WORKSPACE_PATH,findClaimingAncestorPnpmWorkspaceRoot}from"./pnpm.js";import{access,readFile,writeFile}from"node:fs/promises";import{join}from"node:path";function blockRange(e,t){let n=e.findIndex(e=>RegExp(`^${t}:`).test(e));if(n<0)return;if(!RegExp(`^${t}:\\s*(?:#.*)?$`).test(e[n]??``))throw Error(`Cannot safely update ${t} because it does not use block-style YAML in ${PNPM_WORKSPACE_PATH}.`);let r=n+1;for(;r<e.length&&!/^\S/u.test(e[r]??``);)r+=1;return{start:n,end:r}}function unquoteYamlScalar(e){let t=e.trim();if(t.startsWith(`"`)&&t.endsWith(`"`))try{let e=JSON.parse(t);if(typeof e==`string`)return e}catch{return t}return t.startsWith(`'`)&&t.endsWith(`'`)?t.slice(1,-1).replaceAll(`''`,`'`):t}function mappingEntry(e){let t=/^\s+("(?:[^"\\]|\\.)*"|'(?:[^']|'')*'|[^:#][^:]*?):\s*(true|false)\s*(?:#.*)?$/u.exec(e);if(t!==null)return{key:unquoteYamlScalar(t[1]),value:t[2]===`true`}}function sequenceEntry(e){let t=/^\s+-\s+(.*?)(?:\s+#.*)?$/u.exec(e);return t===null?void 0:unquoteYamlScalar(t[1])}function policyEntries(e,t,n){let r=blockRange(e,t),i=new Map;if(r===void 0)return i;for(let t of e.slice(r.start+1,r.end))if(n===`mapping`){let e=mappingEntry(t);e!==void 0&&i.set(e.key,e.value)}else{let e=sequenceEntry(t);e!==void 0&&i.set(e,!0)}return i}function removePolicyEntries(e,t,n,r){let i=blockRange(e,t);if(i===void 0)return;for(let t=i.end-1;t>i.start;--t){let i=n===`mapping`?mappingEntry(e[t]??``)?.key:sequenceEntry(e[t]??``);i!==void 0&&r.has(i)&&e.splice(t,1)}let a=blockRange(e,t);if(a!==void 0&&!e.slice(a.start+1,a.end).some(e=>(n===`mapping`?mappingEntry(e):sequenceEntry(e))!==void 0)){let t=e.slice(a.start+1,a.end).filter(e=>e.trimStart().startsWith(`#`));e.splice(a.start,a.end-a.start,...t)}}function appendPolicyEntries(e,t,n,r){let i=blockRange(e,t);if(i===void 0){for(;e.at(-1)===``;)e.pop();e.length>0&&e.push(``),e.push(`${t}:`),i={start:e.length-1,end:e.length}}let a=policyEntries(e,t,n),o=r.filter(e=>!a.has(e));if(o.length===0)return;let s=o.map(e=>n===`mapping`?` ${JSON.stringify(e)}: true`:` - ${JSON.stringify(e)}`);e.splice(i.end,0,...s)}function withPnpmBuildPolicy(e,t,n){let r=[...new Set(t)].sort(),i=new Set(r),a=e.replace(/\r\n/gu,`
|
|
2
|
+
`).split(`
|
|
3
|
+
`);for(removePolicyEntries(a,`allowBuilds`,`mapping`,i),removePolicyEntries(a,`ignoredOptionalDependencies`,`sequence`,i),n===`allow-builds`?appendPolicyEntries(a,`allowBuilds`,`mapping`,r):appendPolicyEntries(a,`ignoredOptionalDependencies`,`sequence`,r);a.at(-1)===``;)a.pop();return`${a.join(`
|
|
4
|
+
`)}\n`}function withPnpmOptionalDependencyDefaults(e,t){let n=e.replace(/\r\n/gu,`
|
|
5
|
+
`).split(`
|
|
6
|
+
`),r=[policyEntries(n,`allowBuilds`,`mapping`),policyEntries(n,`ignoredOptionalDependencies`,`sequence`),policyEntries(n,`onlyBuiltDependencies`,`sequence`),policyEntries(n,`ignoredBuiltDependencies`,`sequence`)],i=t.filter(e=>!r.some(t=>t.has(e)));return i.length===0?e:withPnpmBuildPolicy(e,i,`ignore-optional`)}async function ensurePnpmOptionalDependencyDefaults(e,t){let n=join(await owningPnpmWorkspaceRoot(e),PNPM_WORKSPACE_PATH),r=await readWorkspacePolicy(n),i=withPnpmOptionalDependencyDefaults(r,t);i!==r&&(await writeFile(n,i,`utf8`),console.info(`[eve:dev] updated optional dependency defaults in "${n}".`))}async function readWorkspacePolicy(e){try{return await readFile(e,`utf8`)}catch(e){if(e.code===`ENOENT`)return``;throw e}}async function owningPnpmWorkspaceRoot(e){try{return await access(join(e,PNPM_WORKSPACE_PATH)),e}catch(e){if(e.code!==`ENOENT`)throw e}return findClaimingAncestorPnpmWorkspaceRoot(e)??e}async function inspectPnpmBuildPolicy(e,t){let n=await owningPnpmWorkspaceRoot(e),r=join(n,PNPM_WORKSPACE_PATH),i=(await readWorkspacePolicy(r)).replace(/\r\n/gu,`
|
|
7
|
+
`).split(`
|
|
8
|
+
`),a=policyEntries(i,`allowBuilds`,`mapping`),o=policyEntries(i,`ignoredOptionalDependencies`,`sequence`);return{filePath:r,packages:t,satisfied:t.every(e=>a.get(e)===!0||o.has(e))}}async function applyPnpmBuildPolicy(e,t){let n=await readWorkspacePolicy(e.filePath);await writeFile(e.filePath,withPnpmBuildPolicy(n,e.packages,t),`utf8`)}export{applyPnpmBuildPolicy,ensurePnpmOptionalDependencyDefaults,inspectPnpmBuildPolicy,withPnpmBuildPolicy,withPnpmOptionalDependencyDefaults};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import{pathExists}from"../../path-exists.js";import{workspacePatternForProject,workspacePatternsClaimProject}from"../../scaffold/workspace-glob.js";import{readFile,writeFile}from"node:fs/promises";import{dirname,extname,join,resolve}from"node:path";import{existsSync,readFileSync,realpathSync}from"node:fs";const PNPM_WORKSPACE_PATH=`pnpm-workspace.yaml`,PNPM_WORKSPACE_MEMBERSHIP_ARGUMENTS=[`list`,`--depth`,`-1`,`--json`],
|
|
1
|
+
import{pathExists}from"../../path-exists.js";import{workspacePatternForProject,workspacePatternsClaimProject}from"../../scaffold/workspace-glob.js";import{readFile,writeFile}from"node:fs/promises";import{dirname,extname,join,resolve}from"node:path";import{existsSync,readFileSync,realpathSync}from"node:fs";const PNPM_WORKSPACE_PATH=`pnpm-workspace.yaml`,PNPM_WORKSPACE_MEMBERSHIP_ARGUMENTS=[`list`,`--depth`,`-1`,`--json`],DEFAULT_BUILD_POLICIES=[{name:`esbuild`,line:` esbuild: true`},{name:`sharp`,line:` sharp: false`}],PNPM_WORKSPACE_CONTENT=[`minimumReleaseAge: 0`,`minimumReleaseAgeStrict: true`,`allowBuilds:`,...DEFAULT_BUILD_POLICIES.map(({line:e})=>e),``].join(`
|
|
2
2
|
`);function findYamlBlockEnd(e,t){let n=t+1;for(;n<e.length;){let t=e[n]??``;if(t.length>0&&!t.startsWith(` `)&&!t.startsWith(` `))break;n+=1}return n}function withPnpmWorkspacePolicy(e){let t=e.endsWith(`
|
|
3
3
|
`)?e:`${e}\n`,n=t.split(`
|
|
4
|
-
`),r=n.findIndex(e=>e===`allowBuilds:`);if(r<0)return`${t.trim().length===0?``:`${t}\n`}allowBuilds:\n${
|
|
4
|
+
`),r=n.findIndex(e=>e===`allowBuilds:`);if(r<0)return`${t.trim().length===0?``:`${t}\n`}allowBuilds:\n${DEFAULT_BUILD_POLICIES.map(({line:e})=>e).join(`
|
|
5
|
+
`)}\n`;let i=findYamlBlockEnd(n,r),a=n.slice(r+1,i),o=DEFAULT_BUILD_POLICIES.filter(({name:e})=>!a.some(t=>t.match(/^\s+([^:]+):/)?.[1]===e));if(o.length===0)return t;let s=i;for(;s>r+1&&n[s-1]===``;)--s;return n.splice(s,0,...o.map(({line:e})=>e)),n.join(`
|
|
5
6
|
`)}async function ensurePnpmWorkspacePolicy(e){if(!await pathExists(e))return await writeFile(e,PNPM_WORKSPACE_CONTENT,`utf8`),`written`;let t=await readFile(e,`utf8`),n=withPnpmWorkspacePolicy(t);return n===t?`skipped`:(await writeFile(e,n,`utf8`),`written`)}function findAncestorPnpmWorkspaceRoot(e){let t=dirname(resolve(e));for(;;){if(existsSync(join(t,`pnpm-workspace.yaml`)))return t;let e=dirname(t);if(e===t)return;t=e}}function hasAncestorPnpmWorkspace(e){return findAncestorPnpmWorkspaceRoot(e)!==void 0}function parsePnpmWorkspacePackagePatterns(e){let t=e.split(/\r?\n/u),n=t.findIndex(e=>/^\s*packages:/u.test(e));if(n<0)return;let r=/^\s*packages:\s*\[(.*)\]\s*(?:#.*)?$/u.exec(t[n]??``);if(r!==null){let e=r[1].trim();return e.length===0?[]:e.split(`,`).map(e=>e.trim().replace(/^['"]|['"]$/gu,``)).filter(e=>e.length>0)}if(t[n]?.trim()!==`packages:`)return;let i=[];for(let e of t.slice(n+1)){if(/^\S/u.test(e))break;let t=/^\s*-\s*(.+?)\s*$/u.exec(e);t!==null&&i.push(t[1].replace(/^['"]|['"]$/gu,``))}return i}function findClaimingAncestorPnpmWorkspaceRoot(e){let t=findAncestorPnpmWorkspaceRoot(e);if(t===void 0)return;let n;try{n=parsePnpmWorkspacePackagePatterns(readFileSync(join(t,PNPM_WORKSPACE_PATH),`utf8`))}catch{return t}return n===void 0||workspacePatternsClaimProject(n,t,e)?t:void 0}function withPnpmWorkspacePackagePattern(e,t){let n=e.endsWith(`
|
|
6
7
|
`)?e:`${e}\n`,r=n.split(`
|
|
7
8
|
`),i=r.findIndex(e=>e.trim()===`packages:`);if(i<0)return`${n.trim().length===0?``:`${n}\n`}packages:\n - ${t}\n`;let a=findYamlBlockEnd(r,i);for(;a>i+1&&r[a-1]===``;)--a;return r.splice(a,0,` - ${t}`),r.join(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{pinnedNodeEngineMajor}from"../../node-engine.js";import{parseChatGptModelSelection}from"../../../shared/chatgpt-model.js";import{SUPPORTED_AUTHORED_MODULE_FILE_EXTENSIONS}from"../update/module-files.js";import{pathExists,writeTextFile}from"../files.js";import{blockingCreateInPlaceEntries}from"../create-in-place.js";import{DEFAULT_CONNECT_PACKAGE_VERSION,resolveVersionToken}from"../version-tokens.js";import{applyPackageManagerWorkspaceConfiguration,isPackageManagerWorkspaceMember,patchWorkspaceRootPackageJson}from"../workspace-root.js";import{WEB_APP_TEMPLATE_FILES}from"./web-template.js";import{mkdir,readdir,stat}from"node:fs/promises";import{basename,join,resolve}from"node:path";const CURRENT_DIRECTORY_PROJECT_NAME=`.`,DEFAULT_AI_PACKAGE_VERSION=`^7.0.105`,DEFAULT_ZOD_PACKAGE_VERSION=`4.5.4`,DEFAULT_EVE_PACKAGE_CONTRACT={version:`0.
|
|
1
|
+
import{pinnedNodeEngineMajor}from"../../node-engine.js";import{parseChatGptModelSelection}from"../../../shared/chatgpt-model.js";import{SUPPORTED_AUTHORED_MODULE_FILE_EXTENSIONS}from"../update/module-files.js";import{pathExists,writeTextFile}from"../files.js";import{blockingCreateInPlaceEntries}from"../create-in-place.js";import{DEFAULT_CONNECT_PACKAGE_VERSION,resolveVersionToken}from"../version-tokens.js";import{applyPackageManagerWorkspaceConfiguration,isPackageManagerWorkspaceMember,patchWorkspaceRootPackageJson}from"../workspace-root.js";import{WEB_APP_TEMPLATE_FILES}from"./web-template.js";import{mkdir,readdir,stat}from"node:fs/promises";import{basename,join,resolve}from"node:path";const CURRENT_DIRECTORY_PROJECT_NAME=`.`,DEFAULT_AI_PACKAGE_VERSION=`^7.0.105`,DEFAULT_ZOD_PACKAGE_VERSION=`4.5.4`,DEFAULT_EVE_PACKAGE_CONTRACT={version:`0.64.1`,nodeEngine:`>=24`};function resolveEvePackageContract(e=DEFAULT_EVE_PACKAGE_CONTRACT){return{version:resolveVersionToken(`evePackage.version`,e.version),nodeEngine:resolveVersionToken(`evePackage.nodeEngine`,e.nodeEngine)}}function modelProviderSlug(e){let t=(e.split(`/`)[0]??``).replaceAll(/[^A-Za-z0-9._-]/gu,``);return t.length>0?t:`anthropic`}function byokProviderEnvVar(e){let t=modelProviderSlug(e).toUpperCase().replaceAll(/[^A-Z0-9]/gu,`_`);return`${/^[0-9]/.test(t)?`_`:``}${t}_API_KEY`}function agentTemplateFiles(e,t){return{"agent/agent.ts":renderAgentTemplate(e,t),"agent/channels/eve.ts":WEB_APP_TEMPLATE_FILES[`agent/channels/eve.ts`],"agent/instructions.md":AGENT_INSTRUCTIONS_TEMPLATE}}function renderAgentTemplate(e,t){let n=parseChatGptModelSelection(e);return n===void 0?BASE_AGENT_TEMPLATE.replaceAll(`__EVE_INIT_MODEL__`,e).replaceAll(`__EVE_INIT_REASONING__`,reasoningTemplateLine(t)):`import { defineAgent } from "eve";\nimport { chatgpt } from "eve/models/openai";\n\nexport default defineAgent({\n model: chatgpt(${JSON.stringify(n)}),\n${reasoningTemplateLine(t)}});\n`}function reasoningTemplateLine(e){return e===void 0||e===`provider-default`?``:` reasoning: "${e}",\n`}function renderTemplate(e,t){return e===BASE_AGENT_TEMPLATE&&parseChatGptModelSelection(t.model)!==void 0?renderAgentTemplate(t.model,t.reasoning):e.replaceAll(`__EVE_INIT_APP_NAME__`,t.appName).replaceAll(`__EVE_INIT_MODEL__`,t.model).replaceAll(`__EVE_INIT_REASONING__`,reasoningTemplateLine(t.reasoning)).replaceAll(`__EVE_INIT_BYOK_PROVIDER__`,modelProviderSlug(t.model)).replaceAll(`__EVE_INIT_BYOK_ENV_VAR__`,byokProviderEnvVar(t.model)).replaceAll(`__EVE_INIT_PACKAGE_VERSION__`,formatEveDependencySpecifier(t.eveVersion)).replaceAll(`__EVE_INIT_AI_SDK_VERSION__`,t.aiPackageVersion).replaceAll(`__EVE_INIT_CONNECT_VERSION__`,t.connectPackageVersion).replaceAll(`__EVE_INIT_ZOD_VERSION__`,t.zodPackageVersion).replaceAll(`__EVE_INIT_TYPESCRIPT_VERSION__`,t.typescriptPackageVersion).replaceAll(`__EVE_INIT_TYPES_NODE_VERSION__`,t.nodeTypesVersion).replaceAll(`__EVE_INIT_NODE_ENGINE__`,t.nodeEngine)}function formatEveDependencySpecifier(e){return/^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z-.]+)?$/.test(e)?`^${e}`:e}const BASE_AGENT_TEMPLATE=`import { defineAgent } from "eve";
|
|
2
2
|
|
|
3
3
|
export default defineAgent({
|
|
4
4
|
model: "__EVE_INIT_MODEL__",
|