eve 0.67.0 → 0.67.2
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 +19 -0
- package/dist/src/channel/channel-address.d.ts +2 -2
- package/dist/src/channel/compiled-channel.d.ts +3 -2
- package/dist/src/channel/cross-channel-receive.d.ts +1 -18
- package/dist/src/channel/cross-channel-receive.js +1 -1
- package/dist/src/channel/forwarded-principal.d.ts +3 -2
- package/dist/src/channel/resolve-text.d.ts +2 -1
- package/dist/src/channel/schedule-auth.d.ts +0 -2
- package/dist/src/channel/schedule-auth.js +1 -1
- package/dist/src/channel/schedule.d.ts +2 -2
- package/dist/src/channel/session-callback.d.ts +2 -1
- package/dist/src/channel/types.d.ts +0 -7
- package/dist/src/chunks/{use-eve-agent-OCHP4s0z.js → use-eve-agent-D4HVZBjn.js} +1 -1
- package/dist/src/chunks/{use-eve-agent-DzdyI97Z.js → use-eve-agent-DXcE_8Ja.js} +1 -1
- package/dist/src/cli/acp/command.d.ts +2 -1
- package/dist/src/cli/agent-command.d.ts +2 -1
- package/dist/src/cli/agent-detection.d.ts +0 -1
- package/dist/src/cli/agent-detection.js +1 -1
- package/dist/src/cli/application-command.d.ts +2 -1
- package/dist/src/cli/application-root.d.ts +3 -8
- package/dist/src/cli/application-root.js +1 -1
- package/dist/src/cli/commands/agent-instructions.d.ts +0 -4
- package/dist/src/cli/commands/agent-instructions.js +3 -3
- package/dist/src/cli/commands/extension-init.js +1 -1
- package/dist/src/cli/commands/init-agent-workspace.js +1 -1
- package/dist/src/cli/commands/init-project.d.ts +0 -1
- package/dist/src/cli/commands/init-project.js +1 -1
- package/dist/src/cli/commands/init-target.d.ts +1 -1
- package/dist/src/cli/commands/init-telemetry.d.ts +2 -1
- package/dist/src/cli/commands/init.js +1 -1
- package/dist/src/cli/commands/registry-declared-setups.d.ts +2 -1
- package/dist/src/cli/commands/registry-install-transaction.d.ts +0 -13
- package/dist/src/cli/commands/registry-install-transaction.js +1 -1
- package/dist/src/cli/commands/registry-pnpm-build-policy-flow.d.ts +1 -1
- package/dist/src/cli/commands/registry-presentation.d.ts +0 -1
- package/dist/src/cli/commands/registry-presentation.js +1 -1
- package/dist/src/cli/commands/registry-project.d.ts +2 -1
- package/dist/src/cli/commands/registry.d.ts +0 -4
- package/dist/src/cli/commands/registry.js +1 -1
- package/dist/src/cli/commands/setup-headless.d.ts +2 -1
- package/dist/src/cli/commands/vercel-non-interactive.d.ts +2 -1
- package/dist/src/cli/dev/diagnostic-dump.d.ts +0 -2
- package/dist/src/cli/dev/diagnostic-dump.js +1 -1
- package/dist/src/cli/dev/diagnostic-sink.d.ts +3 -2
- package/dist/src/cli/dev/environment.js +1 -1
- package/dist/src/cli/dev/tui/agent-header.d.ts +2 -1
- package/dist/src/cli/dev/tui/argument-typeahead.d.ts +2 -1
- package/dist/src/cli/dev/tui/dev-rebuild-status.d.ts +2 -1
- package/dist/src/cli/dev/tui/diagnostic-presentation.d.ts +2 -1
- package/dist/src/cli/dev/tui/errors.d.ts +2 -7
- package/dist/src/cli/dev/tui/errors.js +1 -1
- package/dist/src/cli/dev/tui/flow-drawer.d.ts +2 -1
- package/dist/src/cli/dev/tui/line-editor.d.ts +1 -1
- package/dist/src/cli/dev/tui/mcp-connection-status.d.ts +2 -1
- package/dist/src/cli/dev/tui/message-queue.d.ts +4 -3
- package/dist/src/cli/dev/tui/prompt-command-handler.d.ts +2 -1
- package/dist/src/cli/dev/tui/provider-picker.d.ts +3 -2
- package/dist/src/cli/dev/tui/question-panel.d.ts +2 -1
- package/dist/src/cli/dev/tui/registry-result-message.d.ts +3 -4
- package/dist/src/cli/dev/tui/registry-result-message.js +1 -1
- package/dist/src/cli/dev/tui/remote-connection-probe.d.ts +3 -2
- package/dist/src/cli/dev/tui/runner.d.ts +0 -1
- package/dist/src/cli/dev/tui/runner.js +1 -1
- package/dist/src/cli/dev/tui/setup-panel.d.ts +2 -2
- package/dist/src/cli/dev/tui/setup-selection-input.d.ts +2 -2
- package/dist/src/cli/dev/tui/status-line.d.ts +2 -1
- package/dist/src/cli/dev/tui/stream-format.d.ts +3 -2
- package/dist/src/cli/dev/tui/terminal-renderer.d.ts +3 -2
- package/dist/src/cli/dev/tui/theme.d.ts +1 -1
- package/dist/src/cli/dev/tui/tool-block-groups.d.ts +3 -2
- package/dist/src/cli/dev/tui/tool-presentation.d.ts +2 -1
- package/dist/src/cli/dev/tui/traces/trace-content.d.ts +0 -9
- package/dist/src/cli/dev/tui/traces/trace-content.js +1 -1
- package/dist/src/cli/dev/tui/traces/trace-view.d.ts +3 -2
- package/dist/src/cli/dev/tui/traces/trace-viewer-session.d.ts +2 -1
- package/dist/src/cli/dev/tui/traces/trace-viewer-state.d.ts +2 -3
- package/dist/src/cli/dev/tui/traces/trace-viewer-state.js +1 -1
- package/dist/src/cli/dev/ui-options.d.ts +3 -2
- package/dist/src/cli/dev/url-target.d.ts +2 -1
- package/dist/src/cli/invoke/command.d.ts +0 -11
- package/dist/src/cli/invoke/command.js +1 -1
- package/dist/src/cli/invoke/result.d.ts +1 -1
- package/dist/src/cli/telemetry/index.d.ts +0 -6
- package/dist/src/cli/telemetry/preference.d.ts +2 -1
- package/dist/src/cli/ui/alt-screen.d.ts +3 -2
- package/dist/src/cli/ui/live-region.d.ts +3 -2
- package/dist/src/cli/ui/output.d.ts +1 -16
- package/dist/src/cli/ui/output.js +2 -5
- package/dist/src/client/eve-agent-store-helpers.d.ts +0 -1
- package/dist/src/client/eve-agent-store-helpers.js +1 -1
- package/dist/src/client/eve-agent-store.js +1 -1
- package/dist/src/client/message-action-parts.d.ts +2 -1
- package/dist/src/client/session-utils.d.ts +3 -2
- package/dist/src/compiled/.vendor-stamp.json +6 -6
- package/dist/src/compiled/@workflow/core/index.js +2 -2
- package/dist/src/compiled/@workflow/core/private.js +1 -1
- package/dist/src/compiled/@workflow/core/runtime/constants.d.ts +4 -3
- package/dist/src/compiled/@workflow/core/runtime/helpers.d.ts +23 -0
- package/dist/src/compiled/@workflow/core/runtime/helpers.js +1 -1
- package/dist/src/compiled/@workflow/core/runtime/hook-wake.d.ts +69 -36
- package/dist/src/compiled/@workflow/core/runtime/lifecycle-hooks.d.ts +25 -22
- package/dist/src/compiled/@workflow/core/runtime/run-spec-version.d.ts +16 -0
- package/dist/src/compiled/@workflow/core/runtime/start.d.ts +59 -1
- package/dist/src/compiled/@workflow/core/runtime/step-latency.d.ts +3 -2
- package/dist/src/compiled/@workflow/core/runtime/suspension-handler.d.ts +34 -12
- package/dist/src/compiled/@workflow/core/runtime.js +4 -4
- package/dist/src/compiled/@workflow/core/serialization.d.ts +7 -2
- package/dist/src/compiled/@workflow/core/serialization.js +1 -1
- package/dist/src/compiled/@workflow/core/telemetry/semantic-conventions.d.ts +29 -0
- package/dist/src/compiled/@workflow/core/types.d.ts +1 -0
- package/dist/src/compiled/@workflow/core/version.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/workflow.js +1 -1
- package/dist/src/compiled/@workflow/errors/index.d.ts +13 -0
- package/dist/src/compiled/@workflow/errors/index.js +1 -1
- package/dist/src/compiled/@workflow/world/events.d.ts +14 -4
- package/dist/src/compiled/@workflow/world/index.d.ts +2 -2
- package/dist/src/compiled/@workflow/world/interfaces.d.ts +2 -1
- package/dist/src/compiled/@workflow/world/shared.d.ts +24 -0
- package/dist/src/compiled/@workflow/world/spec-version.d.ts +23 -0
- package/dist/src/compiled/@workflow/world-local/index.js +5 -5
- package/dist/src/compiled/@workflow/world-vercel/index.js +16 -16
- package/dist/src/compiled/_chunks/workflow/{attribute-changes-DzJovO_f.js → attribute-changes-D721NpZv.js} +3 -3
- package/dist/src/compiled/_chunks/workflow/{dist-BQSf8Hax.js → dist-BUFGAKRb.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/dist-CaNNONeg.js +3 -0
- package/dist/src/compiled/_chunks/workflow/{frames-qKc30rjg.js → frames-Dr9fHWdo.js} +2 -2
- package/dist/src/compiled/_chunks/workflow/{global-BQnKzRXo.js → global-DKbOgrts.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/helpers-DkKxg_yn.js +1 -0
- package/dist/src/compiled/_chunks/workflow/logger-D4GJNTk4.js +14 -0
- package/dist/src/compiled/_chunks/workflow/resume-hook-uTW-jBYz.js +1 -0
- package/dist/src/compiled/_chunks/workflow/run-5DmiMN9b.js +1 -0
- package/dist/src/compiled/_chunks/workflow/serialization-CNIYl1D3.js +3 -0
- package/dist/src/compiled/_chunks/workflow/sleep-DFKgN7UG.js +1 -0
- package/dist/src/compiled/_chunks/workflow/wait-until-3_1djUuL.js +1 -0
- package/dist/src/compiled/_chunks/workflow/{ws-transport-BrsMYqJg.js → ws-transport--rYOVIaf.js} +1 -1
- package/dist/src/compiler/artifacts.d.ts +4 -27
- package/dist/src/compiler/artifacts.js +1 -1
- package/dist/src/compiler/compile-agent.d.ts +2 -1
- package/dist/src/compiler/compile-agent.js +1 -1
- package/dist/src/compiler/diagnostics.d.ts +0 -11
- package/dist/src/compiler/diagnostics.js +1 -1
- package/dist/src/compiler/manifest.d.ts +0 -4
- package/dist/src/compiler/module-map.d.ts +1 -5
- package/dist/src/compiler/module-map.js +1 -1
- package/dist/src/compiler/normalize-agent-config.js +1 -1
- package/dist/src/compiler/normalize-connection.d.ts +2 -1
- package/dist/src/compiler/normalize-instructions.d.ts +2 -6
- package/dist/src/compiler/normalize-instructions.js +1 -1
- package/dist/src/compiler/normalize-manifest-helpers.d.ts +0 -1
- package/dist/src/compiler/normalize-manifest-helpers.js +1 -1
- package/dist/src/compiler/normalize-manifest.js +1 -1
- package/dist/src/compiler/normalize-skill.d.ts +2 -1
- package/dist/src/compiler/project-sources.d.ts +0 -14
- package/dist/src/compiler/project-sources.js +1 -1
- package/dist/src/compiler/resolve-workspace-subagent.js +1 -1
- package/dist/src/compiler/source-graph.d.ts +1 -2
- package/dist/src/compiler/source-graph.js +1 -1
- package/dist/src/context/build-base-tool-context.d.ts +2 -1
- package/dist/src/context/dynamic-tool-lifecycle.d.ts +0 -4
- package/dist/src/context/dynamic-tool-lifecycle.js +1 -1
- package/dist/src/context/dynamic-tool-metadata.d.ts +0 -1
- package/dist/src/context/dynamic-tool-metadata.js +1 -1
- package/dist/src/context/memory-lifecycle.d.ts +0 -8
- package/dist/src/context/memory-lifecycle.js +1 -1
- package/dist/src/discover/connections.d.ts +0 -15
- package/dist/src/discover/connections.js +1 -1
- package/dist/src/discover/diagnostics.d.ts +0 -12
- package/dist/src/discover/diagnostics.js +1 -1
- package/dist/src/discover/discover-agent.js +1 -1
- package/dist/src/discover/discover-subagent.d.ts +0 -1
- package/dist/src/discover/discover-subagent.js +1 -1
- package/dist/src/discover/extensions.d.ts +3 -10
- package/dist/src/discover/extensions.js +1 -1
- package/dist/src/discover/filesystem.d.ts +5 -9
- package/dist/src/discover/filesystem.js +1 -1
- package/dist/src/discover/grammar.d.ts +0 -46
- package/dist/src/discover/grammar.js +1 -1
- package/dist/src/discover/manifest.d.ts +5 -4
- package/dist/src/discover/memory.d.ts +0 -1
- package/dist/src/discover/memory.js +1 -1
- package/dist/src/discover/named-source-directory.js +1 -1
- package/dist/src/discover/project-source.d.ts +2 -1
- package/dist/src/discover/project.js +1 -1
- package/dist/src/discover/sandbox.js +1 -1
- package/dist/src/discover/skills.d.ts +0 -4
- package/dist/src/discover/skills.js +1 -1
- package/dist/src/evals/cli/eval-client.d.ts +2 -1
- package/dist/src/evals/judge.d.ts +2 -1
- package/dist/src/evals/runner/execute-task.d.ts +1 -1
- package/dist/src/evals/types.d.ts +1 -1
- package/dist/src/eve-channel/support.d.ts +1 -3
- package/dist/src/eve-channel/support.js +1 -1
- package/dist/src/execution/dynamic-workflow/schema.d.ts +2 -1
- package/dist/src/execution/dynamic-workflow/tool.js +1 -1
- package/dist/src/execution/effective-agent-config.d.ts +2 -1
- package/dist/src/execution/eve-workflow-attributes.d.ts +3 -5
- package/dist/src/execution/eve-workflow-attributes.js +1 -1
- package/dist/src/execution/history-view.d.ts +2 -1
- package/dist/src/execution/node-step.d.ts +3 -2
- package/dist/src/execution/runtime-context.js +1 -1
- package/dist/src/execution/sandbox/active-handles.d.ts +2 -4
- package/dist/src/execution/sandbox/active-handles.js +1 -1
- package/dist/src/execution/sandbox/bash.d.ts +2 -1
- package/dist/src/execution/sandbox/bindings/docker-templates.js +1 -1
- package/dist/src/execution/sandbox/bindings/docker.js +1 -1
- package/dist/src/execution/sandbox/bindings/immutable-resources.d.ts +0 -6
- package/dist/src/execution/sandbox/bindings/immutable-resources.js +1 -1
- package/dist/src/execution/sandbox/bindings/just-bash.js +1 -1
- package/dist/src/execution/sandbox/bindings/local-provider-utils.d.ts +3 -2
- package/dist/src/execution/sandbox/bindings/microsandbox-lifecycle.d.ts +0 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-lifecycle.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-network.d.ts +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-options.d.ts +0 -3
- package/dist/src/execution/sandbox/bindings/microsandbox-options.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-templates.d.ts +0 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-templates.js +1 -1
- package/dist/src/execution/sandbox/bindings/vercel.d.ts +1 -1
- package/dist/src/execution/sandbox/dockerfile.d.ts +0 -1
- package/dist/src/execution/sandbox/dockerfile.js +1 -1
- package/dist/src/execution/sandbox/ensure.d.ts +2 -1
- package/dist/src/execution/sandbox/ensure.js +1 -1
- package/dist/src/execution/sandbox/prewarm.d.ts +1 -18
- package/dist/src/execution/sandbox/prewarm.js +1 -1
- package/dist/src/execution/sandbox/require-sandbox.d.ts +0 -11
- package/dist/src/execution/sandbox/require-sandbox.js +1 -1
- package/dist/src/execution/sandbox/truncate-output.d.ts +2 -5
- package/dist/src/execution/sandbox/truncate-output.js +2 -2
- package/dist/src/execution/session/admission.d.ts +3 -2
- package/dist/src/execution/session/event-sink.d.ts +2 -1
- package/dist/src/execution/session/finalization.d.ts +2 -1
- package/dist/src/execution/session/handoff.d.ts +3 -2
- package/dist/src/execution/session/route-selected-delivery.d.ts +2 -1
- package/dist/src/execution/session/timeout-control.d.ts +2 -1
- package/dist/src/execution/session-activity.d.ts +0 -3
- package/dist/src/execution/session-activity.js +1 -1
- package/dist/src/execution/session-inbox/protocol.d.ts +2 -1
- package/dist/src/execution/session.d.ts +3 -2
- package/dist/src/execution/stable-workflow-names.d.ts +0 -6
- package/dist/src/execution/stable-workflow-names.js +1 -1
- package/dist/src/execution/tools/agent-router-workflow.js +1 -1
- package/dist/src/execution/tools/ask-question-workflow.js +1 -1
- package/dist/src/execution/tools/connection-search.js +1 -1
- package/dist/src/execution/tools/sleep-workflow.js +1 -1
- package/dist/src/execution/tools/subagent/invoke-preparation.d.ts +2 -1
- package/dist/src/execution/tools/subagent/start.js +1 -1
- package/dist/src/execution/tools/subagent/task-agent-requests.d.ts +4 -3
- package/dist/src/execution/tools/workflow/background.d.ts +2 -6
- package/dist/src/execution/tools/workflow/background.js +1 -1
- package/dist/src/execution/tools/workflow/owner-channels.d.ts +1 -1
- package/dist/src/execution/tools/workflow/workflow-owner-background.d.ts +2 -1
- package/dist/src/execution/web-fetch/execute.d.ts +2 -2
- package/dist/src/execution/web-fetch/request.d.ts +2 -1
- package/dist/src/extensions/code/extension/lib/computer-use-driver-source.d.ts +0 -2
- package/dist/src/extensions/code/extension/lib/computer-use-driver-source.js +57 -57
- package/dist/src/extensions/code/extension/lib/computer-use.d.ts +1 -1
- package/dist/src/extensions/code/extension/lib/generated-paths.d.ts +2 -1
- package/dist/src/extensions/code/extension/lib/grep-search.d.ts +5 -5
- package/dist/src/extensions/code/extension/lib/grep-search.js +2 -2
- package/dist/src/extensions/code/extension/lib/guidelines.d.ts +2 -1
- package/dist/src/extensions/code/extension/lib/patch.d.ts +3 -2
- package/dist/src/extensions/code/extension/lib/prwatch-github.d.ts +1 -2
- package/dist/src/extensions/code/extension/lib/prwatch-github.js +1 -1
- package/dist/src/extensions/code/extension/lib/prwatch-registry.d.ts +2 -1
- package/dist/src/framework/host-inventory.d.ts +3 -2
- package/dist/src/harness/approval-candidates.d.ts +4 -3
- package/dist/src/harness/approval-delivery-coordinator.d.ts +2 -1
- package/dist/src/harness/authorization.d.ts +0 -9
- package/dist/src/harness/authorization.js +1 -1
- package/dist/src/harness/compaction-prompt.d.ts +2 -1
- package/dist/src/harness/coordination.d.ts +0 -4
- package/dist/src/harness/coordination.js +1 -1
- package/dist/src/harness/input-requests.d.ts +1 -10
- package/dist/src/harness/input-requests.js +1 -1
- package/dist/src/harness/pending-input-batches.d.ts +0 -5
- package/dist/src/harness/pending-input-batches.js +1 -1
- package/dist/src/harness/provider-safety.d.ts +9 -0
- package/dist/src/harness/provider-safety.js +1 -1
- package/dist/src/harness/provider-tools.d.ts +2 -1
- package/dist/src/harness/session-limit-continuation.d.ts +0 -4
- package/dist/src/harness/session-limit-continuation.js +1 -1
- package/dist/src/harness/session-usage-limits.d.ts +2 -1
- package/dist/src/harness/step-hooks.js +1 -1
- package/dist/src/harness/tool-loop.js +2 -2
- package/dist/src/harness/tool-model-output.d.ts +2 -1
- package/dist/src/harness/turn-cancellation.d.ts +2 -7
- package/dist/src/harness/turn-cancellation.js +1 -1
- package/dist/src/harness/turn-client-context.d.ts +2 -1
- package/dist/src/harness/workflow-stream-error.d.ts +0 -7
- package/dist/src/harness/workflow-stream-error.js +1 -1
- package/dist/src/instrumentation/runtime.js +1 -1
- package/dist/src/instrumentation/state.d.ts +2 -2
- package/dist/src/internal/agent-name.d.ts +0 -2
- package/dist/src/internal/agent-name.js +1 -1
- package/dist/src/internal/application/build-profile.d.ts +2 -2
- package/dist/src/internal/application/cache-metadata.js +1 -1
- package/dist/src/internal/application/compiled-artifacts.js +1 -1
- package/dist/src/internal/application/dev-environment.d.ts +2 -8
- package/dist/src/internal/application/dev-environment.js +1 -1
- package/dist/src/internal/application/optional-package-import.js +1 -1
- package/dist/src/internal/application/optional-package-install.js +1 -1
- package/dist/src/internal/application/output-publication-lock.js +1 -1
- package/dist/src/internal/application/output-publication.d.ts +1 -1
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/application/paths.d.ts +0 -5
- package/dist/src/internal/application/paths.js +1 -1
- package/dist/src/internal/application/tsconfig-dependencies.d.ts +0 -16
- package/dist/src/internal/application/tsconfig-dependencies.js +1 -1
- package/dist/src/internal/authored-asset-import-plugin.js +1 -1
- package/dist/src/internal/authored-definition/schema-backed.js +1 -1
- package/dist/src/internal/authored-definition/source-identity.d.ts +1 -1
- package/dist/src/internal/authored-module-evaluation-error.js +1 -1
- package/dist/src/internal/authored-module-loader.js +1 -1
- package/dist/src/internal/authored-module-map-loader.js +1 -1
- package/dist/src/internal/authored-package-boundary.js +1 -1
- package/dist/src/internal/authored-relative-extension-resolver.js +1 -1
- package/dist/src/internal/bundler/extension-scope-plugin.d.ts +2 -1
- package/dist/src/internal/bundler/extension-scope-plugin.js +1 -1
- package/dist/src/internal/bundler/nitro-rolldown.d.ts +3 -12
- package/dist/src/internal/bundler/nitro-rolldown.js +1 -1
- package/dist/src/internal/bundler/vendored-dependency-log.d.ts +7 -0
- package/dist/src/internal/bundler/vendored-dependency-log.js +1 -0
- package/dist/src/internal/eve-project-root.d.ts +0 -3
- package/dist/src/internal/eve-project-root.js +1 -1
- package/dist/src/internal/external-resources-snapshot.d.ts +1 -1
- package/dist/src/internal/external-resources.d.ts +0 -1
- package/dist/src/internal/external-resources.js +1 -1
- package/dist/src/internal/gateway.d.ts +2 -0
- package/dist/src/internal/gateway.js +1 -1
- package/dist/src/internal/helpers/markdown.js +1 -1
- package/dist/src/internal/instrumentation-layout.js +1 -1
- package/dist/src/internal/invocation/metadata.d.ts +1 -1
- package/dist/src/internal/materialized-authored-modules.d.ts +2 -1
- package/dist/src/internal/materialized-authored-modules.js +1 -1
- package/dist/src/internal/mcp/protected-resource.d.ts +2 -1
- package/dist/src/internal/mcp/streamable-http-server.d.ts +4 -5
- package/dist/src/internal/mcp/streamable-http-server.js +1 -1
- package/dist/src/internal/model-catalog.d.ts +2 -1
- package/dist/src/internal/nitro/dev-runtime-artifacts-retention.js +1 -1
- package/dist/src/internal/nitro/dev-runtime-artifacts.d.ts +0 -4
- package/dist/src/internal/nitro/dev-runtime-artifacts.js +1 -1
- package/dist/src/internal/nitro/dev-runtime-source-snapshot-copy.js +1 -1
- package/dist/src/internal/nitro/dev-runtime-source-snapshot-local-roots.js +1 -1
- package/dist/src/internal/nitro/dev-runtime-source-snapshot.d.ts +0 -1
- package/dist/src/internal/nitro/dev-runtime-source-snapshot.js +1 -1
- package/dist/src/internal/nitro/development-generation.d.ts +0 -1
- package/dist/src/internal/nitro/development-generation.js +1 -1
- package/dist/src/internal/nitro/host/build-application.js +1 -1
- package/dist/src/internal/nitro/host/build-extension.js +1 -1
- package/dist/src/internal/nitro/host/build-vercel-agent-summary.js +1 -1
- package/dist/src/internal/nitro/host/channel-routes.d.ts +1 -1
- package/dist/src/internal/nitro/host/configure-nitro-routes.js +1 -1
- package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
- package/dist/src/internal/nitro/host/dev-authored-rebuild-coordinator.d.ts +2 -1
- package/dist/src/internal/nitro/host/dev-authored-source-watcher.js +1 -1
- package/dist/src/internal/nitro/host/dev-host-candidate.d.ts +2 -1
- package/dist/src/internal/nitro/host/drained-nitro-dev-server.d.ts +1 -1
- package/dist/src/internal/nitro/host/extension-capability-requirements.js +1 -1
- package/dist/src/internal/nitro/host/extension-external-dependency-plugin.js +1 -1
- package/dist/src/internal/nitro/host/local-tracing-runtime-plugin.js +1 -1
- package/dist/src/internal/nitro/host/nitro-bundler-config.js +1 -1
- package/dist/src/internal/nitro/host/schedule-task-routes.d.ts +2 -26
- package/dist/src/internal/nitro/host/schedule-task-routes.js +2 -2
- package/dist/src/internal/nitro/host/start-production-server.js +1 -1
- package/dist/src/internal/nitro/host/workspace-extensions.js +1 -1
- package/dist/src/internal/nitro/routes/channel-request-instrumentation.d.ts +2 -1
- package/dist/src/internal/nitro/routes/channel-route-context.d.ts +1 -1
- package/dist/src/internal/nitro/routes/runtime-stack.d.ts +2 -1
- package/dist/src/internal/resolve-model-endpoint-status.d.ts +2 -1
- package/dist/src/internal/vercel/assemble-eve-services.d.ts +3 -2
- package/dist/src/internal/vercel/build-agent-workspace.js +1 -1
- package/dist/src/internal/vercel/eve-service-contribution.d.ts +2 -3
- package/dist/src/internal/vercel/eve-service-contribution.js +1 -1
- package/dist/src/internal/vercel/project-link.d.ts +2 -1
- package/dist/src/internal/vercel/project-link.js +1 -1
- package/dist/src/internal/workflow/development-world-client.js +1 -1
- package/dist/src/internal/workflow/development-world-codec.d.ts +2 -1
- package/dist/src/internal/workflow/development-world-server.js +1 -1
- package/dist/src/internal/workflow/world-compatibility.d.ts +2 -1
- package/dist/src/internal/workflow-bundle/builder-support.d.ts +0 -9
- package/dist/src/internal/workflow-bundle/builder-support.js +2 -3
- package/dist/src/internal/workflow-bundle/builder.js +2 -2
- package/dist/src/internal/workflow-bundle/dynamic-tool-transform.d.ts +0 -1
- package/dist/src/internal/workflow-bundle/dynamic-tool-transform.js +1 -1
- package/dist/src/internal/workflow-bundle/workflow-builders.js +1 -1
- package/dist/src/protocol/activity.d.ts +3 -3
- package/dist/src/protocol/activity.js +1 -1
- package/dist/src/protocol/baggage.d.ts +2 -2
- package/dist/src/protocol/cancel-turn.d.ts +0 -2
- package/dist/src/protocol/event-dedupe.d.ts +2 -1
- package/dist/src/protocol/event-id.d.ts +0 -6
- package/dist/src/protocol/event-id.js +1 -1
- package/dist/src/protocol/traceparent.d.ts +2 -1
- package/dist/src/public/channels/chat-sdk/audience.d.ts +2 -4
- package/dist/src/public/channels/chat-sdk/audience.js +1 -1
- package/dist/src/public/channels/discord/discordChannel.d.ts +1 -1
- package/dist/src/public/channels/github/api.d.ts +2 -22
- package/dist/src/public/channels/github/api.js +1 -1
- package/dist/src/public/channels/github/auth.d.ts +0 -9
- package/dist/src/public/channels/github/auth.js +1 -1
- package/dist/src/public/channels/github/binding.d.ts +3 -2
- package/dist/src/public/channels/github/checkout.d.ts +3 -3
- package/dist/src/public/channels/github/defaults.d.ts +3 -2
- package/dist/src/public/channels/github/githubChannel.d.ts +1 -1
- package/dist/src/public/channels/github/limits.d.ts +0 -2
- package/dist/src/public/channels/github/limits.js +2 -2
- package/dist/src/public/channels/github/pr-context.d.ts +2 -3
- package/dist/src/public/channels/github/pr-context.js +1 -1
- package/dist/src/public/channels/github/state.d.ts +2 -1
- package/dist/src/public/channels/github/verify.d.ts +2 -1
- package/dist/src/public/channels/linear/defaults.d.ts +2 -1
- package/dist/src/public/channels/linear/inbound-images.d.ts +2 -1
- package/dist/src/public/channels/slack/app-manifest.d.ts +3 -4
- package/dist/src/public/channels/slack/app-manifest.js +1 -1
- package/dist/src/public/channels/slack/hitl.d.ts +0 -4
- package/dist/src/public/channels/slack/hitl.js +2 -2
- package/dist/src/public/channels/slack/inbound.d.ts +2 -1
- package/dist/src/public/channels/slack/model-context.d.ts +0 -18
- package/dist/src/public/channels/slack/model-context.js +1 -1
- package/dist/src/public/channels/slack/mrkdwn.d.ts +0 -2
- package/dist/src/public/channels/slack/mrkdwn.js +1 -1
- package/dist/src/public/channels/slack/privacy.d.ts +2 -1
- package/dist/src/public/channels/slack/verify.d.ts +1 -1
- package/dist/src/public/channels/teams/teamsChannel.d.ts +1 -1
- package/dist/src/public/channels/telegram/audience.d.ts +2 -3
- package/dist/src/public/channels/telegram/audience.js +1 -1
- package/dist/src/public/channels/telegram/telegramChannel.d.ts +1 -1
- package/dist/src/public/channels/twilio/defaults.d.ts +0 -7
- package/dist/src/public/channels/twilio/defaults.js +1 -1
- package/dist/src/public/channels/twilio/routing.d.ts +2 -1
- package/dist/src/public/channels/twilio/twilioChannel.d.ts +1 -1
- package/dist/src/public/channels/upload-policy.d.ts +0 -11
- package/dist/src/public/channels/upload-policy.js +1 -1
- package/dist/src/public/definitions/channel.d.ts +1 -1
- package/dist/src/public/index.js +1 -1
- package/dist/src/public/memory/file/provider.js +1 -1
- package/dist/src/public/models/openai/chatgpt/model.d.ts +2 -1
- package/dist/src/public/models/openai/chatgpt/token-broker.d.ts +1 -1
- package/dist/src/public/next/server.js +1 -1
- package/dist/src/public/nuxt/dev-server.d.ts +3 -2
- package/dist/src/public/nuxt/dev-server.js +1 -1
- package/dist/src/public/skills/index.js +1 -1
- package/dist/src/public/sveltekit/dev-server.d.ts +3 -2
- package/dist/src/public/sveltekit/dev-server.js +1 -1
- package/dist/src/public/tools/index.js +1 -1
- package/dist/src/runtime/compiled-artifacts-source.d.ts +0 -4
- package/dist/src/runtime/compiled-artifacts-source.js +1 -1
- package/dist/src/runtime/connections/instance-identity.d.ts +0 -3
- package/dist/src/runtime/connections/instance-identity.js +1 -1
- package/dist/src/runtime/connections/mcp-tracing.d.ts +1 -6
- package/dist/src/runtime/connections/mcp-tracing.js +1 -1
- package/dist/src/runtime/connections/openapi-client.d.ts +1 -1
- package/dist/src/runtime/connections/scoped-authorization.d.ts +0 -9
- package/dist/src/runtime/connections/scoped-authorization.js +1 -1
- package/dist/src/runtime/hooks/registry.d.ts +0 -7
- package/dist/src/runtime/hooks/registry.js +1 -1
- package/dist/src/runtime/loaders/artifact-paths.d.ts +2 -1
- package/dist/src/runtime/loaders/bundled-artifacts.d.ts +0 -1
- package/dist/src/runtime/loaders/bundled-artifacts.js +1 -1
- package/dist/src/runtime/resolve-agent.d.ts +2 -2
- package/dist/src/runtime/resolve-agent.js +1 -1
- package/dist/src/runtime/resolve-dynamic-tool.d.ts +0 -16
- package/dist/src/runtime/resolve-dynamic-tool.js +1 -1
- package/dist/src/runtime/sandbox/prepared-artifacts.d.ts +1 -2
- package/dist/src/runtime/sandbox/prepared-artifacts.js +1 -1
- package/dist/src/runtime/schedules/register.d.ts +0 -4
- package/dist/src/runtime/schedules/register.js +1 -1
- package/dist/src/self-modification/credentials.d.ts +1 -4
- package/dist/src/self-modification/credentials.js +1 -1
- package/dist/src/self-modification/extension/subagents/agent/tools/search_traces.js +1 -1
- package/dist/src/self-modification/filesystem.d.ts +0 -1
- package/dist/src/self-modification/filesystem.js +1 -1
- package/dist/src/self-modification/git-workspace.d.ts +0 -3
- package/dist/src/self-modification/git-workspace.js +1 -1
- package/dist/src/self-modification/github-publisher.d.ts +2 -1
- package/dist/src/self-modification/migration.d.ts +0 -1
- package/dist/src/self-modification/migration.js +1 -1
- package/dist/src/self-modification/mode.d.ts +2 -1
- package/dist/src/self-modification/proposal.d.ts +0 -2
- package/dist/src/self-modification/proposal.js +2 -2
- package/dist/src/self-modification/setup.js +1 -1
- package/dist/src/services/dev-client/agent-info-probe.d.ts +2 -1
- package/dist/src/services/dev-client/request-headers.d.ts +1 -1
- package/dist/src/services/dev-client/vercel-auth-error.d.ts +0 -8
- package/dist/src/services/dev-client/vercel-auth-error.js +2 -3
- package/dist/src/setup/ai-gateway-api-key.d.ts +2 -1
- package/dist/src/setup/append-env.d.ts +3 -2
- package/dist/src/setup/ask.d.ts +3 -3
- package/dist/src/setup/boxes/apply-ai-gateway-credential.d.ts +2 -1
- package/dist/src/setup/boxes/deploy-project.d.ts +4 -3
- package/dist/src/setup/boxes/link-project.d.ts +2 -1
- package/dist/src/setup/boxes/resolve-provisioning.d.ts +2 -1
- package/dist/src/setup/boxes/select-model.d.ts +2 -37
- package/dist/src/setup/boxes/select-model.js +1 -1
- package/dist/src/setup/cli/option-row.d.ts +1 -1
- package/dist/src/setup/cli/prompt-ui.d.ts +0 -10
- package/dist/src/setup/cli/prompt-ui.js +1 -1
- package/dist/src/setup/cli/rail-log.d.ts +0 -2
- package/dist/src/setup/cli/rail-log.js +2 -2
- package/dist/src/setup/connect-provisioning.d.ts +2 -1
- package/dist/src/setup/connection-connector.d.ts +2 -1
- package/dist/src/setup/flows/link.d.ts +2 -1
- package/dist/src/setup/flows/model-login.d.ts +1 -1
- package/dist/src/setup/flows/model-source-change.js +1 -1
- package/dist/src/setup/flows/provider.d.ts +2 -45
- package/dist/src/setup/flows/provider.js +1 -4
- package/dist/src/setup/flows/registry-session.d.ts +3 -2
- package/dist/src/setup/integrations/discord/api.d.ts +2 -1
- package/dist/src/setup/integrations/discord/connect.d.ts +3 -3
- package/dist/src/setup/integrations/discord/connect.js +1 -1
- package/dist/src/setup/integrations/discord/setup.d.ts +2 -1
- package/dist/src/setup/integrations/file-memory/vercel.d.ts +1 -1
- package/dist/src/setup/integrations/github/connect.d.ts +3 -3
- package/dist/src/setup/integrations/github/connect.js +1 -1
- package/dist/src/setup/integrations/github/setup.d.ts +1 -1
- package/dist/src/setup/integrations/linear/connect.d.ts +2 -2
- package/dist/src/setup/integrations/linear/connect.js +1 -1
- package/dist/src/setup/integrations/linear/setup.d.ts +1 -1
- package/dist/src/setup/integrations/linq/connect.d.ts +3 -4
- package/dist/src/setup/integrations/linq/connect.js +1 -1
- package/dist/src/setup/integrations/linq/management.d.ts +2 -1
- package/dist/src/setup/integrations/linq/setup.d.ts +1 -9
- package/dist/src/setup/integrations/linq/setup.js +1 -1
- package/dist/src/setup/integrations/photon/connect.d.ts +5 -7
- package/dist/src/setup/integrations/photon/connect.js +1 -1
- package/dist/src/setup/integrations/photon/management.d.ts +5 -4
- package/dist/src/setup/integrations/photon/setup-flow.d.ts +2 -1
- package/dist/src/setup/integrations/registry.d.ts +0 -2
- package/dist/src/setup/integrations/registry.js +1 -1
- package/dist/src/setup/integrations/runner.d.ts +3 -2
- package/dist/src/setup/integrations/shared/scaffold.d.ts +2 -1
- package/dist/src/setup/integrations/shared/vercel-project.d.ts +2 -1
- package/dist/src/setup/integrations/shopify/setup.d.ts +2 -1
- package/dist/src/setup/integrations/teams/connect.d.ts +3 -3
- package/dist/src/setup/integrations/teams/connect.js +1 -1
- package/dist/src/setup/integrations/teams/setup.d.ts +2 -1
- package/dist/src/setup/integrations/web/setup.d.ts +2 -1
- package/dist/src/setup/primitives/pm/pnpm.js +1 -1
- package/dist/src/setup/primitives/pm/process-result.d.ts +2 -1
- package/dist/src/setup/primitives/pm/shared.d.ts +2 -1
- package/dist/src/setup/primitives/process-output.d.ts +2 -1
- package/dist/src/setup/primitives/run-vercel.js +1 -1
- package/dist/src/setup/project-resolution.d.ts +0 -2
- package/dist/src/setup/project-resolution.js +1 -1
- package/dist/src/setup/provider-settings.js +1 -1
- package/dist/src/setup/quit-guard.d.ts +3 -2
- package/dist/src/setup/scaffold/connections/catalog.d.ts +0 -13
- package/dist/src/setup/scaffold/connections/catalog.js +1 -1
- package/dist/src/setup/scaffold/create/add-to-project.d.ts +2 -1
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/dist/src/setup/scaffold/files.d.ts +2 -1
- package/dist/src/setup/scaffold/update/channels.d.ts +0 -1
- package/dist/src/setup/scaffold/version-tokens.js +1 -1
- package/dist/src/setup/scaffold/workspace-glob.d.ts +0 -1
- package/dist/src/setup/scaffold/workspace-glob.js +1 -1
- package/dist/src/setup/scaffold/workspace-root.d.ts +2 -1
- package/dist/src/setup/scaffold/workspace-root.js +1 -1
- package/dist/src/setup/slack-connect-create.d.ts +1 -1
- package/dist/src/setup/slack-connect-lifecycle.d.ts +5 -5
- package/dist/src/setup/slack-connect.d.ts +0 -4
- package/dist/src/setup/slack-connect.js +1 -1
- package/dist/src/setup/slackbot.d.ts +3 -3
- package/dist/src/setup/slackbot.js +1 -1
- package/dist/src/setup/vercel-api-failure.d.ts +0 -2
- package/dist/src/setup/vercel-api-failure.js +1 -1
- package/dist/src/setup/vercel-project-api.d.ts +1 -1
- package/dist/src/setup/vercel-project.d.ts +4 -38
- package/dist/src/setup/vercel-project.js +0 -0
- package/dist/src/shared/action-types.d.ts +1 -58
- package/dist/src/shared/action-types.js +1 -1
- package/dist/src/shared/agent-definition.d.ts +0 -3
- package/dist/src/shared/agent-turn-outcome.d.ts +1 -3
- package/dist/src/shared/agent-turn-outcome.js +1 -1
- package/dist/src/shared/chatgpt-model.d.ts +0 -1
- package/dist/src/shared/chatgpt-model.js +1 -1
- package/dist/src/shared/conversation-context.d.ts +2 -1
- package/dist/src/shared/conversation-identity.d.ts +2 -0
- package/dist/src/shared/conversation-identity.js +1 -0
- package/dist/src/shared/extension-package-contract.d.ts +2 -1
- package/dist/src/shared/forwarded-trace-policy.d.ts +3 -2
- package/dist/src/shared/gateway-service-tier.d.ts +2 -1
- package/dist/src/shared/memory-state.d.ts +0 -8
- package/dist/src/shared/memory-state.js +1 -1
- package/dist/src/shared/sandbox-environment.d.ts +0 -1
- package/dist/src/shared/sandbox-environment.js +1 -1
- package/dist/src/shared/skill-package.d.ts +0 -5
- package/dist/src/shared/skill-package.js +1 -1
- package/dist/src/shared/skill-paths.d.ts +0 -13
- package/dist/src/shared/skill-paths.js +2 -2
- package/dist/src/shared/token-usage.d.ts +0 -7
- package/dist/src/shared/token-usage.js +1 -1
- package/dist/src/shared/ulid.d.ts +2 -8
- package/dist/src/shared/ulid.js +1 -1
- package/dist/src/shared/vercel-project.d.ts +2 -1
- package/dist/src/shared/vercel-services.d.ts +2 -2
- package/dist/src/shared/workflow-sandbox.d.ts +0 -7
- package/dist/src/source-change/agent-config-ast.d.ts +2 -1
- package/dist/src/source-change/agent-config-string-path.d.ts +2 -2
- package/dist/src/source-change/apply-agent-model-settings.d.ts +2 -1
- package/dist/src/source-change/apply-model-selection.d.ts +2 -1
- package/dist/src/source-change/static-source-change.d.ts +4 -3
- package/dist/src/subagents/invocation.d.ts +1 -1
- package/dist/src/subagents/tool.d.ts +2 -1
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/tools/definition.d.ts +0 -3
- package/dist/src/tools/durable-callbacks.d.ts +1 -2
- package/dist/src/tools/durable-callbacks.js +1 -1
- package/dist/src/tools/framework/agent.js +1 -1
- package/dist/src/tools/framework/task-cancel.d.ts +1 -1
- package/dist/src/tools/native-definition.d.ts +2 -1
- package/dist/src/tracing/agent-action-instrumentation.d.ts +2 -1
- package/dist/src/tracing/agent-invocation-coordinator.js +1 -1
- package/dist/src/tracing/agent-memory-instrumentation.d.ts +2 -1
- package/dist/src/tracing/agent-otel-attributes.js +1 -1
- package/dist/src/tracing/agent-otel-provider.d.ts +2 -1
- package/dist/src/tracing/agent-span-id-generator.d.ts +0 -1
- package/dist/src/tracing/agent-span-id-generator.js +1 -1
- package/dist/src/tracing/agent-tool-instrumentation.d.ts +2 -1
- package/dist/src/tracing/agent-tool-span-context.d.ts +3 -2
- package/dist/src/tracing/agent-trace-context-store.d.ts +0 -2
- package/dist/src/tracing/agent-trace-context-store.js +1 -1
- package/dist/src/tracing/agent-trace-state.d.ts +0 -24
- package/dist/src/tracing/agent-trace-state.js +1 -1
- package/dist/src/tracing/batch-span-processor.d.ts +2 -1
- package/dist/src/tracing/conversation-context.d.ts +0 -2
- package/dist/src/tracing/conversation-context.js +1 -1
- package/dist/src/tracing/install-instrumentation-runtime.js +1 -1
- package/dist/src/tracing/local-trace-analysis.d.ts +4 -3
- package/dist/src/tracing/local-trace-discovery-index.d.ts +0 -2
- package/dist/src/tracing/local-trace-discovery-index.js +1 -1
- package/dist/src/tracing/local-trace-query.d.ts +2 -1
- package/dist/src/tracing/local-trace-retention.d.ts +4 -4
- package/dist/src/tracing/telemetry-budget.d.ts +0 -1
- package/dist/src/tracing/telemetry-budget.js +1 -1
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/agent-config.md +7 -0
- package/package.json +8 -8
- package/dist/src/cli/commands/channel-add-conflicts.d.ts +0 -21
- package/dist/src/cli/commands/channel-add-conflicts.js +0 -1
- package/dist/src/cli/commands/init-confirm.d.ts +0 -12
- package/dist/src/cli/commands/init-confirm.js +0 -1
- package/dist/src/cli/commands/registry-search-presentation.d.ts +0 -16
- package/dist/src/cli/commands/registry-search-presentation.js +0 -6
- package/dist/src/compiled/_chunks/workflow/dist-BfMqXLK3.js +0 -3
- package/dist/src/compiled/_chunks/workflow/helpers-CNMO7zB1.js +0 -1
- package/dist/src/compiled/_chunks/workflow/logger-BCEj9caG.js +0 -14
- package/dist/src/compiled/_chunks/workflow/resume-hook-QS_cMwHn.js +0 -1
- package/dist/src/compiled/_chunks/workflow/run-CA5wWV2S.js +0 -1
- package/dist/src/compiled/_chunks/workflow/serialization-CJ265vSe.js +0 -3
- package/dist/src/compiled/_chunks/workflow/sleep-CBn94Ayv.js +0 -1
- package/dist/src/compiled/_chunks/workflow/wait-until-Bo2U6ON9.js +0 -1
- package/dist/src/compiler/compile-from-memory.d.ts +0 -44
- package/dist/src/compiler/compile-from-memory.js +0 -1
- package/dist/src/execution/connection-auth-tool-result.d.ts +0 -2
- package/dist/src/execution/connection-auth-tool-result.js +0 -1
- package/dist/src/internal/process/pnpm.d.ts +0 -28
- package/dist/src/internal/process/pnpm.js +0 -1
- package/dist/src/public/channels/slack/api-encoding.d.ts +0 -5
- package/dist/src/public/channels/slack/api-encoding.js +0 -1
- package/dist/src/public/definitions/instrumentation.d.ts +0 -1
- package/dist/src/public/definitions/instrumentation.js +0 -1
- package/dist/src/public/models/openai/chatgpt/unsigned-jwt.d.ts +0 -5
- package/dist/src/public/models/openai/chatgpt/unsigned-jwt.js +0 -1
- package/dist/src/sandbox/backends/probes.d.ts +0 -7
- package/dist/src/sandbox/backends/probes.js +0 -1
- package/dist/src/setup/channel-add-conflicts.d.ts +0 -28
- package/dist/src/setup/channel-add-conflicts.js +0 -1
- package/dist/src/setup/gateway-models.d.ts +0 -10
- package/dist/src/setup/gateway-models.js +0 -1
- package/dist/src/setup/primitives/run-pnpm.d.ts +0 -1
- package/dist/src/setup/primitives/run-pnpm.js +0 -1
- package/dist/src/shared/dispatch-action.d.ts +0 -30
- package/dist/src/shared/dispatch-action.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{mkdir,readdir,realpath,rm,stat,utimes}from"node:fs/promises";import{isErrnoCode}from"#shared/guards.js";import{basename,dirname,isAbsolute,join,relative,resolve}from"node:path";import{
|
|
1
|
+
import{mkdir,readdir,realpath,rm,stat,utimes}from"node:fs/promises";import{isErrnoCode}from"#shared/guards.js";import{watch}from"node:fs";import{basename,dirname,isAbsolute,join,relative,resolve}from"node:path";import{pathExists}from"#shared/path-exists.js";import{removeOutputPublicationBackups,rollbackOutputPublication}from"#internal/application/output-publication-artifacts.js";import{readOutputPublicationJournal,readRecoveryLeaseJournal,resolveJournalFilePath,writeOutputPublicationJournal,writeRecoveryLeaseJournal}from"#internal/application/output-publication-journal.js";import{renameWithTransientBusyRetry}from"#shared/rename-with-retry.js";const PUBLICATION_LOCK_TIMEOUT_MS=6e4,INCOMPLETE_LOCK_STALE_MS=5e3;function resolveOutputPublicationLockPath(e){return join(resolve(e),`.eve`,`locks`,`output-publication.lock`)}function startPublicationJournalHeartbeat(e){let t=resolveJournalFilePath(e),n=setInterval(()=>{let e=new Date;utimes(t,e,e).catch(()=>void 0)},1e3);return n.unref(),()=>{clearInterval(n)}}async function acquireOutputPublicationLock(e,t,n){let r=Date.now()+PUBLICATION_LOCK_TIMEOUT_MS,i=`${e}.recovery`;for(await mkdir(dirname(e),{recursive:!0});;){if(await pathExists(i)){if(await n(),await recoverStalePublication(e,i,t))continue;await waitForPublicationLockChange(e,r);continue}try{if(await mkdir(e),await pathExists(i)){await rm(e,{force:!0,recursive:!0}),await waitForPublicationLockChange(e,r);continue}try{await writeOutputPublicationJournal(e,t)}catch(t){throw await rm(e,{force:!0,recursive:!0}),t}return async()=>{if((await readOutputPublicationJournal(e))?.token!==t.token)return;let n=`${e}.released-${t.token}`;try{await renameWithTransientBusyRetry(e,n)}catch(e){if(isErrnoCode(e,`ENOENT`))return;throw e}await rm(n,{force:!0,recursive:!0})}}catch(e){if(!isErrnoCode(e,`EEXIST`))throw e}await n(),!await recoverStalePublication(e,i,t)&&await waitForPublicationLockChange(e,r)}}async function recoverStalePublication(e,t,n){let r=await acquireRecoveryLease(t,n.token);if(r===void 0)return!1;let i=startPublicationJournalHeartbeat(join(t,`lease`)),a=!1;try{let r=await readOutputPublicationJournal(e);if(r!==void 0&&r.liveness===`active`&&isProcessAlive(r.pid)&&!await isJournalStale(e)||r===void 0&&!await isPathStale(e))return!1;if(await pathExists(e)){let r=join(t,`owner-${n.token}`);try{await renameWithTransientBusyRetry(e,r),a=!0}catch(e){if(!isErrnoCode(e,`ENOENT`))throw e}}let i=await readdir(t,{withFileTypes:!0});a=i.some(e=>e.isDirectory()&&e.name.startsWith(`owner-`));for(let e of i)e.isDirectory()&&e.name.startsWith(`owner-`)&&await finishInterruptedPublication(join(t,e.name));return a=!1,!0}finally{i(),a?await r.release():await r.complete()}}async function acquireRecoveryLease(e,t){let n=join(e,`lease`),r={pid:process.pid,token:t};for(await mkdir(e,{recursive:!0});;){try{await mkdir(n);try{await writeRecoveryLeaseJournal(n,r)}catch(e){throw await rm(n,{force:!0,recursive:!0}),e}return{async complete(){if((await readRecoveryLeaseJournal(n))?.token!==t)return;let r=`${e}.released-${t}`;try{await renameWithTransientBusyRetry(e,r)}catch(e){if(isErrnoCode(e,`ENOENT`))return;throw e}await rm(r,{force:!0,recursive:!0})},async release(){if((await readRecoveryLeaseJournal(n))?.token!==t)return;let e=`${n}.released-${t}`;try{await renameWithTransientBusyRetry(n,e)}catch(e){if(isErrnoCode(e,`ENOENT`))return;throw e}await rm(e,{force:!0,recursive:!0})}}}catch(e){if(isErrnoCode(e,`ENOENT`))return;if(!isErrnoCode(e,`EEXIST`))throw e}let i=await readRecoveryLeaseJournal(n);if(i!==void 0&&isProcessAlive(i.pid)&&!await isJournalStale(n)||i===void 0&&!await isPathStale(n))return;let a=`${n}.stale-${t}`;try{await renameWithTransientBusyRetry(n,a)}catch(e){if(isErrnoCode(e,`ENOENT`))continue;throw e}await rm(a,{force:!0,recursive:!0})}}async function finishInterruptedPublication(e){let t=await readOutputPublicationJournal(e);if(t===void 0||!hasTokenDerivedBackupPaths(t)){await rm(e,{force:!0,recursive:!0});return}t.phase===`committed`?await removeOutputPublicationBackups(t):await rollbackOutputPublication(t),await removePublicationScratchDirectory(t),await rm(e,{force:!0,recursive:!0})}function hasTokenDerivedBackupPaths(e){return e.outputBackupPath===`${e.finalOutputDir}.eve-backup-${e.token}`&&e.summaryBackupPath===`${e.finalSummaryPath}.eve-backup-${e.token}`}async function removePublicationScratchDirectory(e){let t=relative(e.scratchDir,e.stagedOutputDir);t===``||t.startsWith(`..`)||isAbsolute(t)||await rm(e.scratchDir,{force:!0,recursive:!0})}async function waitForPublicationLockChange(e,t){let n=t-Date.now();if(n<=0)throw Error(`Timed out waiting ${PUBLICATION_LOCK_TIMEOUT_MS}ms to publish completed build output.`);let r=await realpath(dirname(e)),i=basename(e),a=await readPublicationLockState(e);await new Promise((t,o)=>{let s=!1,c=setTimeout(settleResolve,Math.min(n,INCOMPLETE_LOCK_STALE_MS)),l=watch(r,(e,t)=>{e===`rename`&&(t===null||t.toString().startsWith(i))&&settleResolve()});function cleanup(){clearTimeout(c),l.close()}function settleResolve(){s||(s=!0,cleanup(),t())}function settleReject(e){s||(s=!0,cleanup(),o(e))}l.once(`error`,settleReject),Promise.all([readPublicationLockState(e),pathExists(e),pathExists(`${e}.recovery`)]).then(([e,t,n])=>{(!t&&!n||e!==a)&&settleResolve()},settleReject)})}async function readPublicationLockState(e){let t=`${e}.recovery`,[n,r,i,a]=await Promise.all([readOutputPublicationJournal(e),readRecoveryLeaseJournal(join(t,`lease`)),pathExists(e),pathExists(t)]);return JSON.stringify({lockExists:i,lockToken:n?.token,recoveryExists:a,recoveryToken:r?.token})}async function isPathStale(e){try{return Date.now()-(await stat(e)).mtimeMs>=INCOMPLETE_LOCK_STALE_MS}catch(e){if(isErrnoCode(e,`ENOENT`))return!0;throw e}}async function isJournalStale(e){try{let t=await stat(resolveJournalFilePath(e));return Date.now()-t.mtimeMs>=15e3}catch(e){if(isErrnoCode(e,`ENOENT`))return!0;throw e}}function isProcessAlive(e){try{return process.kill(e,0),!0}catch(e){return!isErrnoCode(e,`ESRCH`)}}export{acquireOutputPublicationLock,acquireRecoveryLease,resolveOutputPublicationLockPath,startPublicationJournalHeartbeat};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { resolveOutputPublicationLockPath } from "#internal/application/output-publication-lock.js";
|
|
2
2
|
export { resolveOutputPublicationLockPath };
|
|
3
|
-
|
|
3
|
+
interface OutputPublicationInput {
|
|
4
4
|
readonly appRoot: string;
|
|
5
5
|
readonly finalOutputDir: string;
|
|
6
6
|
readonly finalSummaryPath: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRequire}from"node:module";import{
|
|
1
|
+
import{createRequire}from"node:module";import{existsSync,readFileSync,realpathSync}from"node:fs";import{basename,dirname,join}from"node:path";import{fileURLToPath}from"node:url";import{EVE_PACKAGE_NAME}from"#internal/package-name.js";let cachedPackageInfo,cachedPackageLocation;const BUNDLED_FALLBACK_PACKAGE_VERSION=`0.67.2`,WORKFLOW_MODULE_ALIASES={"workflow/errors":`src/compiled/@workflow/errors/index.js`,"workflow/internal/private":`src/compiled/@workflow/core/private.js`};function resolveFallbackPackageVersion(){return BUNDLED_FALLBACK_PACKAGE_VERSION.startsWith(`__`)?`0.0.0`:BUNDLED_FALLBACK_PACKAGE_VERSION}const FALLBACK_PACKAGE_INFO={name:EVE_PACKAGE_NAME,version:resolveFallbackPackageVersion()};function resolveCurrentModulePath(){return typeof __filename==`string`?__filename:resolveCurrentModulePathFromStack()}function resolveCurrentModulePathFromStack(){let e=Error.prepareStackTrace;try{Error.prepareStackTrace=(e,t)=>t;let e=Error().stack?.[0]?.getFileName();if(typeof e!=`string`||e.length===0)throw Error(`Failed to resolve the current module path from the stack trace.`);return e.startsWith(`file:`)?fileURLToPath(e):e}finally{Error.prepareStackTrace=e}}const require=createRequire(resolveCurrentModulePath());function tryResolveVerifiedPackageRoot(e){try{let t=realpathSync.native(e);return tryReadInstalledPackageInfo(t,EVE_PACKAGE_NAME)===void 0?void 0:dirname(t)}catch{return}}function findNearestVerifiedPackageRoot(e){let t=e;for(;;){let e=tryResolveVerifiedPackageRoot(join(t,`package.json`));if(e!==void 0)return e;let n=dirname(t);if(n===t)return;t=n}}function tryResolveDirectBuildLocation(e){let t=dirname(e);for(;;){if(basename(t)===`dist`){let e=tryResolveVerifiedPackageRoot(join(dirname(t),`package.json`));if(e!==void 0)return{packageBuildRoot:t,packageRoot:e}}let e=dirname(t);if(e===t)return;t=e}}function isSourceCheckout(e){return existsSync(join(e,`src`,`internal`,`application`,`package.ts`))}function tryCreatePackageLocation(e){if(isSourceCheckout(e))return{packageBuildRoot:null,packageRoot:e};let t=join(e,`dist`);if(existsSync(t))return{packageBuildRoot:t,packageRoot:e}}function resolveSelfPackageJsonPath(e){return createRequire(e).resolve(`${EVE_PACKAGE_NAME}/package.json`)}function resolvePackageLocationFromModulePath(e,t=resolveSelfPackageJsonPath){let n=realpathSync.native(e),r=tryResolveDirectBuildLocation(n);if(r!==void 0)return r;let i=findNearestVerifiedPackageRoot(dirname(n));if(i!==void 0&&isSourceCheckout(i))return{packageBuildRoot:null,packageRoot:i};try{let e=tryResolveVerifiedPackageRoot(t(n)),r=e===void 0?void 0:tryCreatePackageLocation(e);if(r!==void 0)return r}catch{}let a=i===void 0?void 0:tryCreatePackageLocation(i);if(a!==void 0)return a;throw Error(`Failed to resolve the eve package root from "${e}".`)}function resolvePackageLocation(){return cachedPackageLocation??=resolvePackageLocationFromModulePath(resolveCurrentModulePath()),cachedPackageLocation}function resolvePackageBuildRoot(){return resolvePackageLocation().packageBuildRoot}function resolvePackageRoot(){return resolvePackageLocation().packageRoot}function tryResolvePackageRoot(){try{return resolvePackageRoot()}catch{return}}function rewriteSourceFilePathForBuild(e){return e.replace(/\.[cm]?tsx?$/,`.js`)}function resolvePackageSourceFilePath(e){let t=resolvePackageBuildRoot();return t===null?join(resolvePackageRoot(),e):join(t,rewriteSourceFilePathForBuild(e))}function resolvePackageSourceDirectoryPath(e){let t=resolvePackageBuildRoot();return join(t===null?resolvePackageRoot():t,e)}function resolvePackageDependencyPath(e){try{return require.resolve(e)}catch(t){let n=tryResolvePackageRoot(),r=n===void 0||!isSourceCheckout(n)?void 0:resolveSourceCheckoutExport(n,e);if(r!==void 0)return r;throw t}}function resolveSourceCheckoutExport(e,t){if(t!==EVE_PACKAGE_NAME&&!t.startsWith(`${EVE_PACKAGE_NAME}/`))return;let n=t===EVE_PACKAGE_NAME?`.`:`.${t.slice(EVE_PACKAGE_NAME.length)}`;try{let t=JSON.parse(readFileSync(join(e,`package.json`),`utf8`)).exports?.[n],r=typeof t==`string`?t:t?.[`eve-source`]??t?.import??t?.default;if(r===void 0)return;let i=r.replace(/^\.\/dist\/src\//,`src/`).replace(/\.[cm]?js$/u,`.ts`),a=join(e,i);return existsSync(a)?a:void 0}catch{return}}function resolvePackageCompiledFilePath(e){let t=resolvePackageBuildRoot();return t===null?join(resolvePackageRoot(),`.generated`,`compiled`,e.replace(/^src\/compiled\//,``)):join(t,e)}function normalizeInstalledPackageInfo(e){let t=e;if(typeof t.name==`string`&&typeof t.version==`string`)return{name:t.name,version:t.version}}function tryReadInstalledPackageInfo(e,t){let n=normalizeInstalledPackageInfo(JSON.parse(readFileSync(e,`utf8`)));if(n?.name===t)return n}function resolveInstalledPackageInfo(){if(cachedPackageInfo)return cachedPackageInfo;let e=tryResolvePackageRoot(),t=e===void 0?void 0:tryReadInstalledPackageInfo(join(e,`package.json`),EVE_PACKAGE_NAME);if(t)return cachedPackageInfo=t,cachedPackageInfo;try{let e=tryReadInstalledPackageInfo(require.resolve(`${EVE_PACKAGE_NAME}/package.json`),EVE_PACKAGE_NAME);if(e)return cachedPackageInfo=e,cachedPackageInfo}catch{}return cachedPackageInfo={...FALLBACK_PACKAGE_INFO},cachedPackageInfo}function readWorkflowVersionFromManifest(e){let t=e;for(let e of[t.devDependencies,t.dependencies,t.peerDependencies]){let t=e?.[`@workflow/core`];if(typeof t==`string`&&t.trim().length>0)return t}}function resolveExpectedWorkflowVersion(){let e=tryResolvePackageRoot();if(e!==void 0)try{return readWorkflowVersionFromManifest(JSON.parse(readFileSync(join(e,`package.json`),`utf8`)))}catch{}try{return readWorkflowVersionFromManifest(JSON.parse(readFileSync(require.resolve(`${EVE_PACKAGE_NAME}/package.json`),`utf8`)))}catch{return}}function resolveWorkflowModulePath(e){if(e===`workflow`)return resolvePackageSourceFilePath(`src/internal/workflow/index.ts`);if(e===`workflow/api`||e===`workflow/runtime`)return resolvePackageSourceFilePath(`src/internal/workflow/runtime.ts`);if(e===`workflow/internal/builtins`)return resolvePackageSourceFilePath(`src/internal/workflow/builtins.ts`);let t=WORKFLOW_MODULE_ALIASES[e];return t===void 0?require.resolve(e):resolvePackageCompiledFilePath(t)}export{resolveExpectedWorkflowVersion,resolveInstalledPackageInfo,resolvePackageCompiledFilePath,resolvePackageDependencyPath,resolvePackageLocationFromModulePath,resolvePackageRoot,resolvePackageSourceDirectoryPath,resolvePackageSourceFilePath,resolveWorkflowModulePath};
|
|
@@ -16,11 +16,6 @@ export declare function resolveApplicationRoot(cwd?: string): string;
|
|
|
16
16
|
* this is the canonical signal for "managed by Vercel" versus self-hosted.
|
|
17
17
|
*/
|
|
18
18
|
export declare function isVercelBuildEnvironment(): boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Resolves the programmatic Nitro build directory for an app.
|
|
21
|
-
*/
|
|
22
|
-
export declare function resolveNitroBuildDirectory(appRoot: string): string;
|
|
23
|
-
export declare function resolveApplicationHostArtifactsDirectory(appRoot: string): string;
|
|
24
19
|
/**
|
|
25
20
|
* Resolves the package-owned Workflow DevKit bundle directory for a target app.
|
|
26
21
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createHash}from"node:crypto";import{
|
|
1
|
+
import{createHash}from"node:crypto";import{resolveInstalledPackageInfo,resolvePackageRoot,resolvePackageSourceDirectoryPath}from"#internal/application/package.js";import{existsSync,readFileSync,readdirSync,rmSync}from"node:fs";import{join,resolve}from"node:path";import{EVE_INTERNAL_BUILD_OUTPUT_DIRECTORY_ENV,EVE_INTERNAL_HOST_BUILD_OUTPUT_DIRECTORY_ENV}from"#internal/application/build-output-environment.js";import{workflowEntryReference}from"#execution/workflow-runtime.js";function resolveApplicationRoot(e=process.cwd()){return resolve(e)}function getWorkflowBuildCacheKey(e){return createHash(`sha256`).update(e).digest(`hex`).slice(0,12)}function isVercelBuildEnvironment(){return!!process.env.VERCEL}function resolveWorkflowBuildDirectory(e){let t=join(resolvePackageRoot(),`.eve`,`workflow-cache`);return pruneStaleWorkflowCacheSiblings(t),join(t,getWorkflowBuildCacheKey(e))}function pruneStaleWorkflowCacheSiblings(e){if(!existsSync(e))return;let t=resolveInstalledPackageInfo().version,n;try{n=readdirSync(e)}catch{return}for(let r of n){let n=join(e,r),i=join(n,`eve-cache.json`);if(existsSync(i))try{let e=JSON.parse(readFileSync(i,`utf8`));typeof e.eveVersion==`string`&&e.eveVersion!==t&&rmSync(n,{force:!0,recursive:!0})}catch{}}}function resolveSandboxCacheDirectory(e){return join(e,`.eve`,`sandbox-cache`)}function resolveOutputDirectory(e){return isVercelBuildEnvironment()?join(e,`.vercel`,`output`):join(e,`.output`)}function getApplicationInfo(e){return{appRoot:e,outputDir:resolveOutputDirectory(e),workflowId:workflowEntryReference.workflowId,workflowBuildDir:resolveWorkflowBuildDirectory(e),workflowSourceDir:resolvePackageSourceDirectoryPath(`src/execution`)}}export{EVE_INTERNAL_BUILD_OUTPUT_DIRECTORY_ENV,EVE_INTERNAL_HOST_BUILD_OUTPUT_DIRECTORY_ENV,getApplicationInfo,isVercelBuildEnvironment,resolveApplicationRoot,resolveOutputDirectory,resolveSandboxCacheDirectory,resolveWorkflowBuildDirectory};
|
|
@@ -3,21 +3,5 @@
|
|
|
3
3
|
* one package root: root configs plus their extends chain.
|
|
4
4
|
*/
|
|
5
5
|
export declare function resolveTsConfigDependencyPaths(appRoot: string): Promise<string[]>;
|
|
6
|
-
export declare function resolveRootTsConfigPaths(appRoot: string): Promise<string[]>;
|
|
7
|
-
export declare function collectTsConfigDependencyPaths(input: {
|
|
8
|
-
readonly configPath: string;
|
|
9
|
-
readonly resolvedConfigPaths: Set<string>;
|
|
10
|
-
readonly visitingConfigPaths: Set<string>;
|
|
11
|
-
}): Promise<void>;
|
|
12
6
|
export declare function readTextFileIfExists(path: string): Promise<string | undefined>;
|
|
13
7
|
export declare function parseTsConfigObject(source: string): Record<string, unknown> | undefined;
|
|
14
|
-
export declare function extractTsConfigExtendsSpecifiers(source: string): string[];
|
|
15
|
-
export declare function resolveTsConfigExtendsTargetPaths(input: {
|
|
16
|
-
readonly configPath: string;
|
|
17
|
-
readonly extendsSpecifier: string;
|
|
18
|
-
}): string[];
|
|
19
|
-
export declare function resolveFirstExistingTsConfigExtendsTarget(input: {
|
|
20
|
-
readonly configPath: string;
|
|
21
|
-
readonly extendsSpecifier: string;
|
|
22
|
-
}): string | undefined;
|
|
23
|
-
export declare function isTsConfigFilePath(specifier: string): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRequire}from"node:module";import{readFile,readdir}from"node:fs/promises";import{dirname,isAbsolute,join,resolve}from"node:path";import{
|
|
1
|
+
import{createRequire}from"node:module";import{readFile,readdir}from"node:fs/promises";import{dirname,isAbsolute,join,resolve}from"node:path";import{parse}from"#compiled/jsonc-parser/index.js";async function resolveTsConfigDependencyPaths(e){let t=await resolveRootTsConfigPaths(e),n=new Set,r=new Set;for(let e of t)await collectTsConfigDependencyPaths({configPath:e,resolvedConfigPaths:n,visitingConfigPaths:r});return[...n].sort((e,t)=>e.localeCompare(t))}async function resolveRootTsConfigPaths(e){let t=new Set([join(e,`tsconfig.json`),join(e,`jsconfig.json`)]);try{let n=await readdir(e,{withFileTypes:!0});for(let r of n)r.isFile()&&/^tsconfig\..+\.json$/i.test(r.name)&&t.add(join(e,r.name))}catch{}return[...t]}async function collectTsConfigDependencyPaths(e){let t=resolve(e.configPath);if(e.resolvedConfigPaths.has(t)||e.visitingConfigPaths.has(t))return;let n=await readTextFileIfExists(t);if(n!==void 0){e.resolvedConfigPaths.add(t),e.visitingConfigPaths.add(t);try{let r=extractTsConfigExtendsSpecifiers(n);for(let n of r)for(let r of resolveTsConfigExtendsTargetPaths({configPath:t,extendsSpecifier:n}))await collectTsConfigDependencyPaths({configPath:r,resolvedConfigPaths:e.resolvedConfigPaths,visitingConfigPaths:e.visitingConfigPaths})}finally{e.visitingConfigPaths.delete(t)}}}async function readTextFileIfExists(e){try{return await readFile(e,`utf8`)}catch{return}}function parseTsConfigObject(e){let t=[],n=parse(e,t,{allowTrailingComma:!0});if(!(t.length>0||typeof n!=`object`||!n||Array.isArray(n)))return n}function extractTsConfigExtendsSpecifiers(e){let t=parseTsConfigObject(e);if(t===void 0)return[];let n=t.extends;return typeof n==`string`?n.length>0?[n]:[]:Array.isArray(n)?n.filter(e=>typeof e==`string`&&e.length>0):[]}function resolveTsConfigExtendsTargetPaths(e){let t=new Set;if(isTsConfigFilePath(e.extendsSpecifier))for(let n of resolveFileExtendsCandidates({configPath:e.configPath,extendsSpecifier:e.extendsSpecifier}))t.add(n);else for(let n of resolvePackageExtendsCandidates({configPath:e.configPath,extendsSpecifier:e.extendsSpecifier}))t.add(n);return[...t]}function resolveFileExtendsCandidates(e){let t=resolve(dirname(e.configPath),e.extendsSpecifier),n=new Set;return n.add(t),t.endsWith(`.json`)||(n.add(`${t}.json`),n.add(join(t,`tsconfig.json`))),[...n]}function resolvePackageExtendsCandidates(e){let t=new Set([e.extendsSpecifier]);e.extendsSpecifier.endsWith(`.json`)||(t.add(`${e.extendsSpecifier}.json`),t.add(`${e.extendsSpecifier}/tsconfig.json`));let n=new Set,r=createRequire(e.configPath);for(let e of t)try{n.add(r.resolve(e))}catch{}return[...n]}function isTsConfigFilePath(e){return e.startsWith(`.`)||isAbsolute(e)?!0:/^[A-Za-z]:[\\/]/.test(e)}export{parseTsConfigObject,readTextFileIfExists,resolveTsConfigDependencyPaths};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{readFile}from"node:fs/promises";import{dirname,extname,isAbsolute,relative,resolve}from"node:path";
|
|
1
|
+
import{readFile}from"node:fs/promises";import{realpathSync}from"node:fs";import{dirname,extname,isAbsolute,relative,resolve}from"node:path";const AUTHORED_ASSET_CODE_EXTENSIONS=[`.ts`,`.tsx`,`.mts`,`.cts`,`.js`,`.jsx`,`.mjs`,`.cjs`,`.json`];function createAuthoredAssetImportPlugin(e){let t=toCanonicalPath(e.packageRoot);return{name:`eve-authored-asset-import`,resolveId(e,n){if(!isPotentialAuthoredAssetImport(e)||n===void 0)return;let{path:r,suffix:i}=splitImportSuffix(e),a=toCanonicalPath(isAbsolute(r)?r:resolve(dirname(n),r));if(!isPathInsideOrEqual(a,t))throw Error(`Authored asset import "${e}" from "${n}" resolves outside package root "${t}".`);return`${a}${i}`},async load(e){let{path:t,suffix:n}=splitImportSuffix(e);if(!isPotentialAuthoredAssetImport(t))return;if(n===`?raw`){let e=await readAssetText(t);return e===void 0?void 0:{code:`export default ${JSON.stringify(e)};`,moduleType:`js`}}let r=await readAssetDataUrl(t);if(r!==void 0)return{code:`export default ${JSON.stringify(r)};`,moduleType:`js`}}}}function isPathInsideOrEqual(e,t){let n=relative(t,resolve(e));return n===``||!n.startsWith(`..`)&&!isAbsolute(n)}function toCanonicalPath(e){let t=resolve(e);try{return realpathSync.native(t)}catch{return t}}async function readAssetText(e){try{return await readFile(e,`utf8`)}catch(e){if(isPathNotFoundError(e))return;throw e}}function isPotentialAuthoredAssetImport(e){if(e.startsWith(`\0`)||e.startsWith(`node:`)||e.startsWith(`data:`)||e.startsWith(`file:`))return!1;let{path:t}=splitImportSuffix(e);if(!t.startsWith(`.`)&&!t.startsWith(`/`)&&!/^[A-Za-z]:[\\/]/.test(t))return!1;let n=extname(t);return n.length>0&&n!==`.node`&&!AUTHORED_ASSET_CODE_EXTENSIONS.includes(n)}function splitImportSuffix(e){let t=e.indexOf(`?`),n=e.indexOf(`#`),r=t===-1?n:n===-1?t:Math.min(t,n);return r===-1?{path:e,suffix:``}:{path:e.slice(0,r),suffix:e.slice(r)}}async function readAssetDataUrl(e){try{let t=await readFile(e);return`data:${getAssetMimeType(e)};base64,${t.toString(`base64`)}`}catch(e){if(isPathNotFoundError(e))return;throw e}}function isPathNotFoundError(e){return typeof e==`object`&&!!e&&`code`in e&&(e.code===`ENOENT`||e.code===`ENOTDIR`)}function getAssetMimeType(e){switch(extname(e).toLowerCase()){case`.css`:return`text/css`;case`.csv`:return`text/csv`;case`.gif`:return`image/gif`;case`.html`:return`text/html`;case`.jpg`:case`.jpeg`:return`image/jpeg`;case`.png`:return`image/png`;case`.svg`:return`image/svg+xml`;case`.txt`:return`text/plain`;case`.wasm`:return`application/wasm`;case`.webp`:return`image/webp`;default:return`application/octet-stream`}}export{createAuthoredAssetImportPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{expectBoolean,expectFunction,expectObjectRecord,expectOnlyKnownKeys,expectString}from"#internal/authored-module.js";import{serializeInputSchema,serializeOutputSchema}from"#tools/schema.js";import{
|
|
1
|
+
import{expectBoolean,expectFunction,expectObjectRecord,expectOnlyKnownKeys,expectString}from"#internal/authored-module.js";import{serializeInputSchema,serializeOutputSchema}from"#tools/schema.js";import{readWorkflowFunctionId}from"#internal/workflow/reference.js";import{assertResolverOnlyDynamicSentinel,isDynamicSentinel}from"#dynamic/definition.js";import{isWorkflowToolDefinition}from"#tools/workflow-definition.js";import{shouldRebindDynamicCallbacks}from"#internal/dynamic-tool-rebind.js";import{isDisabledToolSentinel}from"#tools/definition.js";import{normalizeApproval}from"#internal/authored-definition/approval.js";import{isWebSearchToolDefinition}from"#tools/provided/web-search.js";import{readToolBehavior}from"#tools/behavior.js";import{readWorkflowProgramOptions}from"#tools/workflow-program-input.js";function normalizeToolDefinition(e,t){if(isDynamicSentinel(e))return assertResolverOnlyDynamicSentinel(e,t),{kind:`dynamic-tool`,eventNames:Object.keys(e.events),rebindMissingCallbacks:shouldRebindDynamicCallbacks(e)};if(isDisabledToolSentinel(e))return{kind:`disabled`};if(isWebSearchToolDefinition(e)){let n=expectObjectRecord(e,t);expectOnlyKnownKeys(n,[`kind`,`provider`],t);let r=expectString(n.provider,t);if(r!==`exa`&&r!==`parallel`)throw Error(`${t} Expected "provider" to be one of: exa, parallel.`);return{kind:`web-search-tool`,provider:r}}let n=expectObjectRecord(e,t),r=readWorkflowFunctionId(n.execute);if(isWorkflowToolDefinition(e)){if(r===void 0)throw Error(`${t} defineWorkflowTool() requires a compiled workflow executor. Start execute with "use workflow" and export defineWorkflowTool() as the default export of a static tool module.`)}else if(r!==void 0)throw Error(`${t} Workflow executors require defineWorkflowTool() from "eve/tools". Replace defineTool() or the bare tool object with defineWorkflowTool().`);expectOnlyKnownKeys(n,[`availableInSubagents`,`label`,`auth`,`description`,`execute`,`execution`,`inputSchema`,`approval`,`approvalKey`,`outputSchema`,`toModelOutput`],t);let i=n.inputSchema===void 0?null:serializeInputSchema(n.inputSchema),a=serializeOutputSchema(n.outputSchema),o=readToolBehavior(e),s=readWorkflowProgramOptions(e),c=n.execute!==void 0;!c&&o?.handling?.kind!==`dispatch`&&expectFunction(n.execute,t);let l={availableInSubagents:n.availableInSubagents===void 0?void 0:expectBoolean(n.availableInSubagents,t),description:expectString(n.description,t),hasApproval:n.approval!==void 0,hasExecute:c,hasModelOutputProjection:n.toModelOutput!==void 0,inputSchema:i};if(o!==void 0&&(l.behavior=o),s!==void 0&&(l.workflowProgram=s),c&&(l.execute=expectFunction(n.execute,t)),n.execution!==void 0){if(!c)throw Error(`${t} Execute-less native tools cannot use background execution.`);let e=expectString(n.execution,t);if(e!==`background`)throw Error(`${t} Expected "execution" to be "background".`);l.execution=e}if(a!==void 0&&(l.outputSchema=a),n.label!==void 0){let e=expectObjectRecord(n.label,t);expectOnlyKnownKeys(e,[`start`,`complete`,`delta`],t),expectFunction(e.start,t),e.complete!==void 0&&expectFunction(e.complete,t),e.delta!==void 0&&expectFunction(e.delta,t)}if(n.approval!==void 0&&normalizeApproval(n.approval,t),n.approvalKey!==void 0&&expectFunction(n.approvalKey,t),n.toModelOutput!==void 0&&expectFunction(n.toModelOutput,t),n.auth!==void 0){let e=expectObjectRecord(n.auth,t);expectFunction(e.getToken,t)}return{kind:`tool`,definition:l}}export{normalizeToolDefinition};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{existsSync,readFileSync,statSync}from"node:fs";import{dirname,extname,join,relative,resolve}from"node:path";import{fileURLToPath}from"node:url";function createAuthoredModuleEvaluationError(e,t){let n=describeInstalledPackageLoadFailure(t);return Error([`Failed to evaluate authored module:`,` ${e}`,...n===void 0?[]:[``,n]].join(`
|
|
2
2
|
`),{cause:t})}function describeInstalledPackageLoadFailure(e){if(!(e instanceof Error))return;let t=e;if(t.code!==`ERR_MODULE_NOT_FOUND`||typeof t.url!=`string`)return;let n=filePathFromUrl(t.url);if(n===void 0||extname(n)!==``)return;let r=findInstalledPackage(n);if(r===void 0)return;let i=toPackageRelativePath(r.root,n);return findExistingModulePath(n)===void 0?[`Failed to load an installed package:`,` Package: ${r.name} (loaded outside the authored bundle)`,` Missing: ${i}`,` Reason: Package output may be incomplete, incorrectly installed, or incompatible with a standalone Node runtime.`,` Hint: Verify the installed package version and output, use a Node-compatible entrypoint, or report the missing module to the package publisher.`].join(`
|
|
3
3
|
`):[`Failed to load an installed package:`,` Package: ${r.name} (loaded outside the authored bundle)`,` Import: ${i}`,` Reason: Node's ESM loader does not infer file extensions for relative imports.`,` Hint: Use a Node-compatible package or entrypoint, or report the extensionless import to the package publisher.`].join(`
|
|
4
4
|
`)}function findExistingModulePath(e){for(let t of[`.js`,`.mjs`,`.cjs`]){let n=`${e}${t}`;try{if(statSync(n).isFile())return n}catch{}}}function toPackageRelativePath(e,t){return relative(e,t).replaceAll(`\\`,`/`)}function filePathFromUrl(e){try{let t=new URL(e);return t.protocol===`file:`?fileURLToPath(t):void 0}catch{return}}function findInstalledPackage(e){let t=dirname(resolve(e));for(;;){let e=join(t,`package.json`);if(existsSync(e)&&isNodeModulesPath(e))try{let n=JSON.parse(readFileSync(e,`utf8`));if(typeof n.name==`string`&&n.name.length>0)return{name:n.name,root:t}}catch{return}let n=dirname(t);if(n===t)return;t=n}}function isNodeModulesPath(e){return e.replaceAll(`\\`,`/`).includes(`/node_modules/`)}export{createAuthoredModuleEvaluationError};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{createHash}from"node:crypto";import{expectObjectRecord}from"#internal/authored-module.js";import{dirname,join,relative,resolve,sep}from"node:path";import{resolvePackageSourceFilePath}from"#internal/application/package.js";import{existsSync,mkdirSync,realpathSync,writeFileSync}from"node:fs";import{createCompiledModuleMapSource}from"#compiler/module-map.js";import{normalizeEsmImportSpecifier}from"#internal/application/import-specifier.js";import{buildSingleRolldownChunk,buildWithNitroRolldown}from"#internal/bundler/nitro-rolldown.js";import{createAuthoredAssetImportPlugin}from"#internal/authored-asset-import-plugin.js";import{authoredModuleConditions}from"#internal/authored-module-conditions.js";import{createAuthoredModuleBundleError}from"#internal/authored-module-bundle.js";import{createAuthoredModuleEvaluationError}from"#internal/authored-module-evaluation-error.js";import{createAuthoredPackageTsConfigPathsPlugin}from"#internal/authored-package-tsconfig-paths.js";import{createAuthoredRelativeExtensionResolverPlugin}from"#internal/authored-relative-extension-resolver.js";import{createExtensionScopePlugin,createFixedNamespaceScopePlugin}from"#internal/bundler/extension-scope-plugin.js";import{RESOLVE_EXTENSIONS,createDistributionPackageBoundaryPlugin,createGenerationPackageBoundaryPlugin,createRuntimeLoaderPackageBoundaryPlugin,isNodeModulesPath,normalizeExternalDependencies}from"#internal/authored-package-boundary.js";import{createNodeEsmCompatBannerPlugin}from"#internal/node-esm-compat-banner.js";import{prepareAuthoredWorkflowDirectives}from"#internal/workflow-bundle/authored-workflow-directives.js";import{createDynamicCapabilityTransformPlugin}from"#internal/workflow-bundle/dynamic-capability-transform-plugin.js";import{applyWorkflowTransform,isAuthoredApplicationModule}from"#internal/workflow-bundle/workflow-builders.js";const AUTHORED_BUNDLED_MODULE_EXTENSION=/\.[cm]?[jt]sx?$/,AUTHORED_MODULE_BUNDLE_DIRECTORY_PATH=join(`node_modules`,`.cache`,`eve`,`authored-modules`),inFlightModuleLoads=new Map;function loadAuthoredModuleNamespace(e,t={}){let n=createInFlightModuleLoadKey(resolve(e),t),r=inFlightModuleLoads.get(n);if(r!==void 0)return r;let i=(async()=>{try{return await doLoadAuthoredModuleNamespace(e,t)}finally{inFlightModuleLoads.delete(n)}})();return inFlightModuleLoads.set(n,i),i}async function doLoadAuthoredModuleNamespace(e,t){let n=AUTHORED_BUNDLED_MODULE_EXTENSION.test(e)?await loadBundledAuthoredModule(e,t):await import(createFileImportSpecifier(e));return expectObjectRecord(n,`Expected "${e}" to export a module namespace object.`)}function createFileImportSpecifier(e){let t=e.replaceAll(`\\`,`/`);return/^[A-Za-z]:\//.test(t)?`file:///${encodeURI(t)}`:t.startsWith(`/`)?`file://${encodeURI(t)}`:t}async function bundleAuthoredModuleCode(e,t={}){let n=resolveAuthoredPackageRoot(e);return await buildAuthoredModuleBundle(e,t,{packageBoundaryPlugin:createRuntimeLoaderPackageBoundaryPlugin({externalDependencies:normalizeExternalDependencies(t.externalDependencies),packageRoot:n}),plugins:[createAuthoredWorkflowDirectivePlugin({appRoot:n})],sourcemap:`inline`})}async function bundleAuthoredModuleForGeneration(e,t={}){return removeRolldownModuleRegionComments(await buildAuthoredModuleBundle(e,t,{packageBoundaryPlugin:createGenerationPackageBoundaryPlugin({externalDependencies:normalizeExternalDependencies(t.externalDependencies),packageRoot:resolveAuthoredPackageRoot(e)}),plugins:[createAuthoredDirectiveGuardPlugin()],sourcemap:!1}))}async function bundleExtensionDistributionGraph(e){let t=[createAuthoredDirectiveGuardPlugin(),createAuthoredRelativeExtensionResolverPlugin({extensions:RESOLVE_EXTENSIONS}),createAuthoredAssetImportPlugin({packageRoot:e.packageRoot}),createAuthoredPackageTsConfigPathsPlugin({appPackageRoot:e.packageRoot,extensions:RESOLVE_EXTENSIONS}),createNodeEsmCompatBannerPlugin({includeRequire:!0}),createDistributionPackageBoundaryPlugin({packageRoot:e.packageRoot,runtimeDependencies:e.runtimeDependencies})];try{let n=await buildWithNitroRolldown({cwd:e.packageRoot,input:Object.fromEntries(e.entries.map(e=>[e.name,e.path])),platform:`node`,plugins:t,resolve:{extensions:[...RESOLVE_EXTENSIONS]},tsconfig:resolveAuthoredTsConfigPath(e.packageRoot),write:!1,output:{chunkFileNames:`_chunks/[name]-[hash].mjs`,codeSplitting:!0,comments:!1,entryFileNames:`[name].mjs`,format:`esm`,sourcemap:!1}}),r=new Map,i=new Set;for(let e of n.output)if(e.type===`chunk`){r.set(e.fileName,removeRolldownModuleRegionComments(e.code));for(let t of[...e.imports,...e.dynamicImports])i.add(t)}return{files:r,imports:[...i]}}catch(t){throw createAuthoredModuleBundleError(e.packageRoot,t)}}async function bundleAuthoredModuleMapForGeneration(e){let t=resolveAuthoredPackageRoot(e.manifest.agentRoot),n=resolvePackageSourceFilePath(usesDevelopmentExtensionModules(e.manifest)?`src/internal/development-programmatic-source-loader.ts`:`src/internal/programmatic-source-loader.ts`),r=normalizeExternalDependencies([...e.manifest.config.build?.externalDependencies??[],...e.manifest.subagents.flatMap(e=>e.configResolver===void 0?e.agent.config.build?.externalDependencies??[]:e.configResolver.build?.externalDependencies??[])]),i=createCompiledModuleMapSource({manifest:e.manifest,moduleMapPath:e.moduleMapPath,programmaticLoaderImportSpecifier:n}),a=createExtensionScopePlugin([e.manifest,...e.manifest.subagents.map(e=>e.agent)].flatMap(e=>e.extensionMounts.map(e=>({packageNamespace:e.packageNamespace,sourceRoot:e.sourceRoot})))),o=new AuthoredWorkflowSourceRecorder(e.appRoot),s=[createVirtualGenerationModuleMapPlugin({id:e.moduleMapPath,source:i}),createExternalRuntimeImportPlugin(n),createAuthoredWorkflowDirectivePlugin({appRoot:e.appRoot,recorder:o}),createDynamicCapabilityTransformPlugin({workflowFunctions:e=>o.workflowFunctions(e)}),o.graphPlugin(),a,createAuthoredRelativeExtensionResolverPlugin({extensions:RESOLVE_EXTENSIONS}),createAuthoredAssetImportPlugin({packageRoot:t}),createAuthoredPackageTsConfigPathsPlugin({appPackageRoot:t,extensions:RESOLVE_EXTENSIONS}),createNodeEsmCompatBannerPlugin({includeRequire:!0}),createGenerationPackageBoundaryPlugin({externalDependencies:r,packageRoot:t})].filter(e=>e!==null);try{let n=await buildSingleRolldownChunk(`authored module map`,{cwd:t,input:e.moduleMapPath,platform:`node`,plugins:s,resolve:{conditionNames:authoredModuleConditions(),extensions:[...RESOLVE_EXTENSIONS]},tsconfig:resolveAuthoredTsConfigPath(t),output:{comments:!1,format:`esm`,sourcemap:!1}});return{authoredWorkflowModules:o.modules(),code:removeRolldownModuleRegionComments(n.code),workflowSourceFingerprint:o.fingerprint()}}catch(t){throw createAuthoredModuleBundleError(e.moduleMapPath,t)}}function usesDevelopmentExtensionModules(e){return[e,...e.subagents.map(e=>e.agent)].some(e=>Object.values(e.bindings).some(e=>e.backing.kind===`programmatic`&&e.backing.registryId.startsWith(`eve:development-extension:`)))}function createExternalRuntimeImportPlugin(e){let t=normalizeEsmImportSpecifier(e);return{name:`eve-external-runtime-import`,resolveId(e){return e===t?{external:!0,id:t}:void 0}}}var AuthoredWorkflowSourceRecorder=class{#e;#t=new Set;#n=new Map;#r=new Map;#i=new Map;constructor(e){this.#e=e}record(e,t,n){this.#r.set(e,t),(n.steps!==void 0||n.workflows!==void 0)&&this.#t.add(e);let r=Object.values(n.workflows??{})[0];r!==void 0&&this.#i.set(e,new Set(Object.keys(r)))}workflowFunctions(e){return this.#i.get(e)}graphPlugin(){let e=this.#n;return{name:`eve-authored-module-graph`,buildEnd(){for(let t of this.getModuleIds()){let n=this.getModuleInfo(t);n!==null&&e.set(t,[...n.importedIds,...n.dynamicallyImportedIds])}}}}modules(){return{directiveModules:[...this.#t].sort(),workflowModules:[...this.#i.keys()].sort()}}fingerprint(){if(this.#t.size===0)return;let e=new Set,t=[...this.#t];for(let n=t.shift();n!==void 0;n=t.shift())!e.has(n)&&this.#r.has(n)&&(e.add(n),t.push(...this.#n.get(n)??[]));let n=createHash(`sha256`);for(let t of[...e].sort())n.update(relative(this.#e,t).split(sep).join(`/`)).update(`\0`).update(this.#r.get(t)??``).update(`\0`);return n.digest(`hex`)}};function createVirtualGenerationModuleMapPlugin(e){return{name:`eve-generation-module-map`,resolveId(t){return t===e.id?t:void 0},load(t){return t===e.id?{code:e.source,moduleType:`js`}:void 0}}}async function buildAuthoredModuleBundle(e,t,n){let r=resolveAuthoredPackageRoot(e),i=resolveAuthoredTsConfigPath(r),a=[...n.plugins,t.extensionScopeNamespace===void 0?null:createFixedNamespaceScopePlugin(t.extensionScopeNamespace),createAuthoredRelativeExtensionResolverPlugin({extensions:RESOLVE_EXTENSIONS}),createAuthoredAssetImportPlugin({packageRoot:r}),createAuthoredPackageTsConfigPathsPlugin({appPackageRoot:r,extensions:RESOLVE_EXTENSIONS}),createNodeEsmCompatBannerPlugin({includeRequire:!0}),n.packageBoundaryPlugin].filter(e=>e!==null);try{return(await buildSingleRolldownChunk(`authored module for "${e}"`,{cwd:r,input:e,platform:`node`,plugins:a,resolve:{conditionNames:authoredModuleConditions(),extensions:[...RESOLVE_EXTENSIONS]},tsconfig:i,output:{comments:!1,format:`esm`,sourcemap:n.sourcemap}})).code}catch(t){throw createAuthoredModuleBundleError(e,t)}}function createAuthoredDirectiveGuardPlugin(){return{name:`eve-authored-directive-guard`,async transform(e,t){if(!AUTHORED_BUNDLED_MODULE_EXTENSION.test(t)||isNodeModulesPath(t))return;let{hasDirectives:n}=await prepareAuthoredWorkflowDirectives({filePath:t,source:e});if(n)throw Error(`Module "${t}" uses Workflow directives ("use step" or "use workflow"). Workflow directives are supported in application modules only, not in extensions or instrumentation.`)}}}function createAuthoredWorkflowDirectivePlugin(e){return{name:`eve-authored-workflow-directives`,async transform(t,n){if(!AUTHORED_BUNDLED_MODULE_EXTENSION.test(n)||isNodeModulesPath(n)||!isAuthoredApplicationModule(n,e.appRoot))return;let r=await applyWorkflowTransform(n,t,`client`,n,e.appRoot);return e.recorder?.record(n,t,r.workflowManifest),r.code===t?void 0:{code:r.code,map:null}}}}function removeRolldownModuleRegionComments(e){return e.split(`
|
|
1
|
+
import{createHash}from"node:crypto";import{expectObjectRecord}from"#internal/authored-module.js";import{resolvePackageSourceFilePath}from"#internal/application/package.js";import{existsSync,mkdirSync,realpathSync,writeFileSync}from"node:fs";import{dirname,join,relative,resolve,sep}from"node:path";import{createCompiledModuleMapSource}from"#compiler/module-map.js";import{normalizeEsmImportSpecifier}from"#internal/application/import-specifier.js";import{buildSingleRolldownChunk,buildWithNitroRolldown}from"#internal/bundler/nitro-rolldown.js";import{createAuthoredAssetImportPlugin}from"#internal/authored-asset-import-plugin.js";import{authoredModuleConditions}from"#internal/authored-module-conditions.js";import{createAuthoredModuleBundleError}from"#internal/authored-module-bundle.js";import{createAuthoredModuleEvaluationError}from"#internal/authored-module-evaluation-error.js";import{createAuthoredPackageTsConfigPathsPlugin}from"#internal/authored-package-tsconfig-paths.js";import{createAuthoredRelativeExtensionResolverPlugin}from"#internal/authored-relative-extension-resolver.js";import{createExtensionScopePlugin,createFixedNamespaceScopePlugin}from"#internal/bundler/extension-scope-plugin.js";import{RESOLVE_EXTENSIONS,createDistributionPackageBoundaryPlugin,createGenerationPackageBoundaryPlugin,createRuntimeLoaderPackageBoundaryPlugin,isNodeModulesPath,normalizeExternalDependencies}from"#internal/authored-package-boundary.js";import{createNodeEsmCompatBannerPlugin}from"#internal/node-esm-compat-banner.js";import{prepareAuthoredWorkflowDirectives}from"#internal/workflow-bundle/authored-workflow-directives.js";import{createDynamicCapabilityTransformPlugin}from"#internal/workflow-bundle/dynamic-capability-transform-plugin.js";import{applyWorkflowTransform,isAuthoredApplicationModule}from"#internal/workflow-bundle/workflow-builders.js";const AUTHORED_BUNDLED_MODULE_EXTENSION=/\.[cm]?[jt]sx?$/,AUTHORED_MODULE_BUNDLE_DIRECTORY_PATH=join(`node_modules`,`.cache`,`eve`,`authored-modules`),inFlightModuleLoads=new Map;function loadAuthoredModuleNamespace(e,t={}){let n=createInFlightModuleLoadKey(resolve(e),t),r=inFlightModuleLoads.get(n);if(r!==void 0)return r;let i=(async()=>{try{return await doLoadAuthoredModuleNamespace(e,t)}finally{inFlightModuleLoads.delete(n)}})();return inFlightModuleLoads.set(n,i),i}async function doLoadAuthoredModuleNamespace(e,t){let n=AUTHORED_BUNDLED_MODULE_EXTENSION.test(e)?await loadBundledAuthoredModule(e,t):await import(createFileImportSpecifier(e));return expectObjectRecord(n,`Expected "${e}" to export a module namespace object.`)}function createFileImportSpecifier(e){let t=e.replaceAll(`\\`,`/`);return/^[A-Za-z]:\//.test(t)?`file:///${encodeURI(t)}`:t.startsWith(`/`)?`file://${encodeURI(t)}`:t}async function bundleAuthoredModuleCode(e,t={}){let n=resolveAuthoredPackageRoot(e);return await buildAuthoredModuleBundle(e,t,{packageBoundaryPlugin:createRuntimeLoaderPackageBoundaryPlugin({externalDependencies:normalizeExternalDependencies(t.externalDependencies),packageRoot:n}),plugins:[createAuthoredWorkflowDirectivePlugin({appRoot:n})],sourcemap:`inline`})}async function bundleAuthoredModuleForGeneration(e,t={}){return removeRolldownModuleRegionComments(await buildAuthoredModuleBundle(e,t,{packageBoundaryPlugin:createGenerationPackageBoundaryPlugin({externalDependencies:normalizeExternalDependencies(t.externalDependencies),packageRoot:resolveAuthoredPackageRoot(e)}),plugins:[createAuthoredDirectiveGuardPlugin()],sourcemap:!1}))}async function bundleExtensionDistributionGraph(e){let t=[createAuthoredDirectiveGuardPlugin(),createAuthoredRelativeExtensionResolverPlugin({extensions:RESOLVE_EXTENSIONS}),createAuthoredAssetImportPlugin({packageRoot:e.packageRoot}),createAuthoredPackageTsConfigPathsPlugin({appPackageRoot:e.packageRoot,extensions:RESOLVE_EXTENSIONS}),createNodeEsmCompatBannerPlugin({includeRequire:!0}),createDistributionPackageBoundaryPlugin({packageRoot:e.packageRoot,runtimeDependencies:e.runtimeDependencies})];try{let n=await buildWithNitroRolldown({cwd:e.packageRoot,input:Object.fromEntries(e.entries.map(e=>[e.name,e.path])),platform:`node`,plugins:t,resolve:{extensions:[...RESOLVE_EXTENSIONS]},tsconfig:resolveAuthoredTsConfigPath(e.packageRoot),write:!1,output:{chunkFileNames:`_chunks/[name]-[hash].mjs`,codeSplitting:!0,comments:!1,entryFileNames:`[name].mjs`,format:`esm`,sourcemap:!1}}),r=new Map,i=new Set;for(let e of n.output)if(e.type===`chunk`){r.set(e.fileName,removeRolldownModuleRegionComments(e.code));for(let t of[...e.imports,...e.dynamicImports])i.add(t)}return{files:r,imports:[...i]}}catch(t){throw createAuthoredModuleBundleError(e.packageRoot,t)}}async function bundleAuthoredModuleMapForGeneration(e){let t=resolveAuthoredPackageRoot(e.manifest.agentRoot),n=resolvePackageSourceFilePath(usesDevelopmentExtensionModules(e.manifest)?`src/internal/development-programmatic-source-loader.ts`:`src/internal/programmatic-source-loader.ts`),r=normalizeExternalDependencies([...e.manifest.config.build?.externalDependencies??[],...e.manifest.subagents.flatMap(e=>e.configResolver===void 0?e.agent.config.build?.externalDependencies??[]:e.configResolver.build?.externalDependencies??[])]),i=createCompiledModuleMapSource({manifest:e.manifest,moduleMapPath:e.moduleMapPath,programmaticLoaderImportSpecifier:n}),a=createExtensionScopePlugin([e.manifest,...e.manifest.subagents.map(e=>e.agent)].flatMap(e=>e.extensionMounts.map(e=>({packageNamespace:e.packageNamespace,sourceRoot:e.sourceRoot})))),o=new AuthoredWorkflowSourceRecorder(e.appRoot),s=[createVirtualGenerationModuleMapPlugin({id:e.moduleMapPath,source:i}),createExternalRuntimeImportPlugin(n),createAuthoredWorkflowDirectivePlugin({appRoot:e.appRoot,recorder:o}),createDynamicCapabilityTransformPlugin({workflowFunctions:e=>o.workflowFunctions(e)}),o.graphPlugin(),a,createAuthoredRelativeExtensionResolverPlugin({extensions:RESOLVE_EXTENSIONS}),createAuthoredAssetImportPlugin({packageRoot:t}),createAuthoredPackageTsConfigPathsPlugin({appPackageRoot:t,extensions:RESOLVE_EXTENSIONS}),createNodeEsmCompatBannerPlugin({includeRequire:!0}),createGenerationPackageBoundaryPlugin({externalDependencies:r,packageRoot:t})].filter(e=>e!==null);try{let n=await buildSingleRolldownChunk(`authored module map`,{cwd:t,input:e.moduleMapPath,platform:`node`,plugins:s,resolve:{conditionNames:authoredModuleConditions(),extensions:[...RESOLVE_EXTENSIONS]},tsconfig:resolveAuthoredTsConfigPath(t),output:{comments:!1,format:`esm`,sourcemap:!1}});return{authoredWorkflowModules:o.modules(),code:removeRolldownModuleRegionComments(n.code),workflowSourceFingerprint:o.fingerprint()}}catch(t){throw createAuthoredModuleBundleError(e.moduleMapPath,t)}}function usesDevelopmentExtensionModules(e){return[e,...e.subagents.map(e=>e.agent)].some(e=>Object.values(e.bindings).some(e=>e.backing.kind===`programmatic`&&e.backing.registryId.startsWith(`eve:development-extension:`)))}function createExternalRuntimeImportPlugin(e){let t=normalizeEsmImportSpecifier(e);return{name:`eve-external-runtime-import`,resolveId(e){return e===t?{external:!0,id:t}:void 0}}}var AuthoredWorkflowSourceRecorder=class{#e;#t=new Set;#n=new Map;#r=new Map;#i=new Map;constructor(e){this.#e=e}record(e,t,n){this.#r.set(e,t),(n.steps!==void 0||n.workflows!==void 0)&&this.#t.add(e);let r=Object.values(n.workflows??{})[0];r!==void 0&&this.#i.set(e,new Set(Object.keys(r)))}workflowFunctions(e){return this.#i.get(e)}graphPlugin(){let e=this.#n;return{name:`eve-authored-module-graph`,buildEnd(){for(let t of this.getModuleIds()){let n=this.getModuleInfo(t);n!==null&&e.set(t,[...n.importedIds,...n.dynamicallyImportedIds])}}}}modules(){return{directiveModules:[...this.#t].sort(),workflowModules:[...this.#i.keys()].sort()}}fingerprint(){if(this.#t.size===0)return;let e=new Set,t=[...this.#t];for(let n=t.shift();n!==void 0;n=t.shift())!e.has(n)&&this.#r.has(n)&&(e.add(n),t.push(...this.#n.get(n)??[]));let n=createHash(`sha256`);for(let t of[...e].sort())n.update(relative(this.#e,t).split(sep).join(`/`)).update(`\0`).update(this.#r.get(t)??``).update(`\0`);return n.digest(`hex`)}};function createVirtualGenerationModuleMapPlugin(e){return{name:`eve-generation-module-map`,resolveId(t){return t===e.id?t:void 0},load(t){return t===e.id?{code:e.source,moduleType:`js`}:void 0}}}async function buildAuthoredModuleBundle(e,t,n){let r=resolveAuthoredPackageRoot(e),i=resolveAuthoredTsConfigPath(r),a=[...n.plugins,t.extensionScopeNamespace===void 0?null:createFixedNamespaceScopePlugin(t.extensionScopeNamespace),createAuthoredRelativeExtensionResolverPlugin({extensions:RESOLVE_EXTENSIONS}),createAuthoredAssetImportPlugin({packageRoot:r}),createAuthoredPackageTsConfigPathsPlugin({appPackageRoot:r,extensions:RESOLVE_EXTENSIONS}),createNodeEsmCompatBannerPlugin({includeRequire:!0}),n.packageBoundaryPlugin].filter(e=>e!==null);try{return(await buildSingleRolldownChunk(`authored module for "${e}"`,{cwd:r,input:e,platform:`node`,plugins:a,resolve:{conditionNames:authoredModuleConditions(),extensions:[...RESOLVE_EXTENSIONS]},tsconfig:i,output:{comments:!1,format:`esm`,sourcemap:n.sourcemap}})).code}catch(t){throw createAuthoredModuleBundleError(e,t)}}function createAuthoredDirectiveGuardPlugin(){return{name:`eve-authored-directive-guard`,async transform(e,t){if(!AUTHORED_BUNDLED_MODULE_EXTENSION.test(t)||isNodeModulesPath(t))return;let{hasDirectives:n}=await prepareAuthoredWorkflowDirectives({filePath:t,source:e});if(n)throw Error(`Module "${t}" uses Workflow directives ("use step" or "use workflow"). Workflow directives are supported in application modules only, not in extensions or instrumentation.`)}}}function createAuthoredWorkflowDirectivePlugin(e){return{name:`eve-authored-workflow-directives`,async transform(t,n){if(!AUTHORED_BUNDLED_MODULE_EXTENSION.test(n)||isNodeModulesPath(n)||!isAuthoredApplicationModule(n,e.appRoot))return;let r=await applyWorkflowTransform(n,t,`client`,n,e.appRoot);return e.recorder?.record(n,t,r.workflowManifest),r.code===t?void 0:{code:r.code,map:null}}}}function removeRolldownModuleRegionComments(e){return e.split(`
|
|
2
2
|
`).filter(e=>!e.startsWith(`//#region `)&&e!==`//#endregion`).join(`
|
|
3
3
|
`)}async function loadBundledAuthoredModule(e,t){let n=await bundleAuthoredModuleCode(e,t),r=normalizeExternalDependencies(t.externalDependencies),i=createHash(`sha1`).update(e).update(`\0`).update(r.join(`\0`)).update(`\0`).update(t.extensionScopeNamespace??``).update(`\0`).update(n).digest(`hex`),a=join(resolveAuthoredPackageRoot(e),AUTHORED_MODULE_BUNDLE_DIRECTORY_PATH),o=join(a,`${i}.mjs`);existsSync(o)||(mkdirSync(a,{recursive:!0}),writeFileSync(o,n));try{return await import(`${createFileImportSpecifier(o)}?v=${i}`)}catch(t){throw createAuthoredModuleEvaluationError(e,t)}}function createInFlightModuleLoadKey(e,t){return`${e}\0${normalizeExternalDependencies(t.externalDependencies).join(`\0`)}\0${t.extensionScopeNamespace??``}`}function resolveAuthoredTsConfigPath(e){for(let t of[`tsconfig.json`,`jsconfig.json`]){let n=join(e,t);if(existsSync(n))return n}return!1}function resolveAuthoredPackageRoot(e){let t=dirname(e);for(;;){if(existsSync(join(t,`package.json`)))return realpathSync(t);let n=dirname(t);if(n===t)throw Error(`Failed to resolve the authored package root for "${e}".`);t=n}}export{bundleAuthoredModuleCode,bundleAuthoredModuleForGeneration,bundleAuthoredModuleMapForGeneration,bundleExtensionDistributionGraph,loadAuthoredModuleNamespace,resolveAuthoredPackageRoot,resolveAuthoredTsConfigPath};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{join,relative,resolve}from"node:path";import{pathToFileURL}from"node:url";import{ROOT_COMPILED_AGENT_NODE_ID}from"#compiler/manifest.js";import{collectRuntimeModuleBindingsForManifest,compiledModuleMapSchema,resolveCompiledModuleExtensionScopeNamespace}from"#compiler/module-map.js";import{memoizeModuleNamespaceFactories}from"#compiler/source-graph.js";import{
|
|
1
|
+
import{join,relative,resolve}from"node:path";import{pathToFileURL}from"node:url";import{ROOT_COMPILED_AGENT_NODE_ID}from"#compiler/manifest.js";import{collectRuntimeModuleBindingsForManifest,compiledModuleMapSchema,resolveCompiledModuleExtensionScopeNamespace}from"#compiler/module-map.js";import{memoizeModuleNamespaceFactories}from"#compiler/source-graph.js";import{formatValidationError}from"#runtime/validation.js";import{loadAuthoredModuleNamespace}from"#internal/authored-module-loader.js";import{loadFrameworkProgrammaticModule}from"#framework/sources/registry.js";import{loadCompiledManifest}from"#runtime/loaders/manifest.js";import{readMaterializedAuthoredModuleIndex}from"#internal/materialized-authored-modules.js";const EXT_CONFIG_SCOPE=Symbol.for(`eve.ext-config-scope`);async function loadCompiledModuleMapFromAuthoredSource(e){return await hydrateCompiledModuleMapFromManifest(await loadCompiledManifest({compiledArtifactsSource:e.compiledArtifactsSource}),e.compiledArtifactsSource.appRoot,e.authoredAppRoot)}async function hydrateCompiledModuleMapFromManifest(e,t,n=e.appRoot){let r=await readMaterializedAuthoredModuleIndex(t);if(r!==void 0)return await loadMaterializedCompiledModuleMap({moduleMapPath:r.moduleMap,runtimeAppRoot:t});let i={},a=[{manifest:e,nodeId:ROOT_COMPILED_AGENT_NODE_ID},...[...e.subagents].sort((e,t)=>e.nodeId.localeCompare(t.nodeId)).map(e=>({manifest:e.agent,nodeId:e.nodeId}))];for(let t of a)i[t.nodeId]={modules:await hydrateCompiledNodeScope(t.manifest,t=>resolve(n,relative(e.appRoot,t)))};return{nodes:i}}async function hydrateCompiledNodeScope(e,t){let n=new Map(e.extensionMounts.map(e=>[e.mountSourceId,e.packageNamespace])),r=globalThis,i={};for(let{binding:a,sourceId:o}of collectRuntimeModuleBindingsForManifest(e)){let e=n.get(o);e!==void 0&&(r[EXT_CONFIG_SCOPE]=e);try{i[o]=a.backing.kind===`programmatic`?await loadFrameworkProgrammaticModule(a.backing,Object.fromEntries(Object.entries(a.backing.dependencies??{}).map(([e,t])=>[e,i[t]]))):memoizeModuleNamespaceFactories(await loadAuthoredModuleNamespace(t(a.backing.sourcePath),{externalDependencies:a.backing.externalDependencies,extensionScopeNamespace:resolveCompiledModuleExtensionScopeNamespace(a)}))}finally{e!==void 0&&(r[EXT_CONFIG_SCOPE]=void 0)}}return i}async function loadMaterializedCompiledModuleMap(e){let t=join(e.runtimeAppRoot,`.eve`,`compile`,e.moduleMapPath),n=await import(`${pathToFileURL(t).href}?generation=${encodeURIComponent(e.moduleMapPath)}`),r=compiledModuleMapSchema.safeParse(n.moduleMap??n.default);if(!r.success)throw Error(`Expected materialized authored module map "${t}" to export a valid compiled eve module map. ${formatValidationError(r.error)}`);return r.data}export{loadCompiledModuleMapFromAuthoredSource};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRequire,isBuiltin}from"node:module";import{
|
|
1
|
+
import{createRequire,isBuiltin}from"node:module";import{resolvePackageDependencyPath,resolveWorkflowModulePath}from"#internal/application/package.js";import{existsSync,readFileSync,realpathSync}from"node:fs";import{dirname,join,resolve,sep}from"node:path";import{normalizeEsmImportSpecifier}from"#internal/application/import-specifier.js";const RESOLVE_EXTENSIONS=[`.ts`,`.tsx`,`.mts`,`.cts`,`.js`,`.jsx`,`.mjs`,`.cjs`,`.json`];function createGenerationPackageBoundaryPlugin(e){return{name:`eve-generation-package-boundary`,async resolveId(t,n,r){if(isPackageImport(t)){if(isFrameworkRuntimeImport(t,n))return{external:!0,id:resolveFrameworkRuntimeImport(t)};if(t.startsWith(`#`)){let r=resolvePackageImport(t,n,e.packageRoot);if(r!==void 0)return{id:r}}if(await resolveConfiguredExternalModule.call(this,{externalDependencies:e.externalDependencies,importer:n,kind:r.kind,packageRoot:e.packageRoot,source:t})!==void 0)return{external:!0,id:t}}}}}function createRuntimeLoaderPackageBoundaryPlugin(e){let t=toCanonicalPath(e.packageRoot);return{name:`eve-runtime-loader-package-boundary`,async resolveId(n,r,i){if(!isPackageImport(n))return;if(isFrameworkRuntimeImport(n,r))return{external:!0,id:resolveRuntimeLoaderFrameworkImport(n)};if(n.startsWith(`#`)){let t=resolvePackageImport(n,r,e.packageRoot);if(t!==void 0)return{id:t}}let a=await resolveConfiguredExternalModule.call(this,{externalDependencies:e.externalDependencies,importer:r,kind:i.kind,packageRoot:e.packageRoot,source:n});if(a!==void 0){let e=resolveExistingExternalFilePath(a.resolvedId)??a.resolvedId;return{external:!0,id:normalizeEsmImportSpecifier(e)}}let o=r===void 0||r.startsWith(`\0`)?void 0:resolve(r);if(o!==void 0&&isPathInsideOrEqual(toCanonicalPath(o),t)){let e=await this.resolve(n,r,{kind:i.kind,skipSelf:!0});if(e===null||typeof e.id!=`string`)throw Error(`Cannot resolve package "${n}" imported from "${o}". Install it with your package manager (e.g. \`pnpm install\`); a running \`eve dev\` retries on the next rebuild.`);if(isNodeModulesPath(e.id))return{external:!0,id:n}}}}}function createDistributionPackageBoundaryPlugin(e){let t=new Set(e.runtimeDependencies);return{name:`eve-extension-distribution-package-boundary`,async resolveId(n,r,i){if(!isPackageImport(n))return;if(n.startsWith(`#`)){let a=await this.resolve(n,r,{kind:i.kind,skipSelf:!0});if(a!==null&&typeof a.id==`string`&&!isPathInsideOrEqual(toCanonicalPath(a.id),toCanonicalPath(e.packageRoot))){let e=nearestPackageName(a.id);if(e!==void 0&&!t.has(e))throw Error(`Package import "${n}" resolves to undeclared package "${e}". Add "${e}" to dependencies, optionalDependencies, or peerDependencies.`)}return}if(isBuiltin(n))return{external:!0,id:n};let a=packageImportName(n);if(!t.has(a))throw Error(`Package "${n}" is not declared by the extension. Add "${a}" to dependencies, optionalDependencies, or peerDependencies.`);let o=await this.resolve(n,r,{kind:i.kind,skipSelf:!0});if(o===null&&(o=await this.resolve(n,join(e.packageRoot,`package.json`),{kind:i.kind,skipSelf:!0})),o===null||typeof o.id!=`string`)throw Error(`Cannot resolve declared package "${n}". Install the extension's dependencies before building.`);return{external:!0,id:n}}}}async function resolveConfiguredExternalModule(e){let t=resolveConfiguredExternalDependency(e.source,e.externalDependencies);if(t===void 0)return;let n=await this.resolve(e.source,e.importer,{kind:e.kind,skipSelf:!0});if(n===null&&(n=await this.resolve(e.source,join(e.packageRoot,`package.json`),{kind:e.kind,skipSelf:!0})),n===null||typeof n.id!=`string`)throw Error(`Cannot resolve external package "${e.source}".`);return{packageName:t,resolvedId:n.id}}function normalizeExternalDependencies(e=[]){return[...new Set(e)].sort()}function resolveConfiguredExternalDependency(e,t){return t.find(t=>e===t||e.startsWith(`${t}/`))}function packageImportName(e){return e.startsWith(`@`)?e.split(`/`,2).join(`/`):e.split(`/`,1)[0]}function nearestPackageName(e){let t=nearestPackageRoot(e);if(t!==void 0)try{let e=JSON.parse(readFileSync(join(t,`package.json`),`utf8`));return typeof e.name==`string`&&e.name.length>0?e.name:void 0}catch{return}}function nearestPackageRoot(e){let t=dirname(toCanonicalPath(e));for(;;){if(existsSync(join(t,`package.json`)))return t;let e=dirname(t);if(e===t)return;t=e}}function resolvePackageImport(e,t,n){let r=t===void 0||t.startsWith(`\0`)?n:nearestPackageRoot(t)??n;try{let t=createRequire(join(r,`package.json`)).resolve(e);return isPathInsideOrEqual(toCanonicalPath(t),toCanonicalPath(r))?t:void 0}catch{return}}function resolveExistingExternalFilePath(e){if(existsSync(e))return e;for(let t of RESOLVE_EXTENSIONS){let n=`${e}${t}`;if(existsSync(n))return n}}function isPackageImport(e){return isPathImport(e)||/^(?:node|data|file):/.test(e)?!1:!e.startsWith(`@/`)}function isPathImport(e){return e.startsWith(`.`)||e.startsWith(`/`)||/^[A-Za-z]:[\\/]/.test(e)}function isFrameworkRuntimeImport(e,t){return e===`eve/self-modification`?!1:e===`eve`||e.startsWith(`eve/`)?!0:e===`workflow`||e.startsWith(`workflow/`)||e.startsWith(`@workflow/`)?t===void 0||!isNodeModulesPath(t):!1}function resolveFrameworkRuntimeImport(e){return e===`eve`||e.startsWith(`eve/`)?e:normalizeEsmImportSpecifier(resolveWorkflowModulePath(e))}function resolveRuntimeLoaderFrameworkImport(e){return e===`eve`||e.startsWith(`eve/`)?normalizeEsmImportSpecifier(resolvePackageDependencyPath(e)):resolveFrameworkRuntimeImport(e)}function isNodeModulesPath(e){return e.replaceAll(`\\`,`/`).includes(`/node_modules/`)}function toCanonicalPath(e){try{return realpathSync(e)}catch{return resolve(e)}}function isPathInsideOrEqual(e,t){let n=resolve(e),r=resolve(t);return n===r||n.startsWith(`${r}${sep}`)}export{RESOLVE_EXTENSIONS,createDistributionPackageBoundaryPlugin,createGenerationPackageBoundaryPlugin,createRuntimeLoaderPackageBoundaryPlugin,isNodeModulesPath,isPathImport,normalizeExternalDependencies};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{realpathSync,statSync}from"node:fs";import{dirname,isAbsolute,join,resolve}from"node:path";import{isNodeModulesPath,isPathImport}from"#internal/authored-package-boundary.js";const PATH_IMPORT_FILTER=/^(?:\.|\/|[A-Za-z]:[\\/])/;function createAuthoredRelativeExtensionResolverPlugin(e){let t=createCachedFileProbe();return{name:`eve-authored-relative-extension-resolver`,resolveId:{filter:{id:PATH_IMPORT_FILTER},handler(n,r){if(r===void 0||r.startsWith(`\0`)||!isPathImport(n))return;let i=resolveExistingImportPath(isAbsolute(n)?n:resolve(dirname(r),n),e.extensions,t);if(i!==void 0)return{id:isNodeModulesPath(i)?toRealModulePath(i):i}}}}}function createCachedFileProbe(){let e=new Map;return t=>{let n=e.get(t);if(n!==void 0)return n;let r=!1;try{r=statSync(t).isFile()}catch{}return e.set(t,r),r}}function resolveExistingImportPath(e,t,n){if(n(e))return e;for(let r of t){let t=`${e}${r}`;if(n(t))return t}for(let r of t){let t=join(e,`index${r}`);if(n(t))return t}}function toRealModulePath(e){try{return realpathSync(e)}catch{return e}}export{createAuthoredRelativeExtensionResolverPlugin};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* One extension's on-disk source root paired with the namespace its durable
|
|
3
3
|
* state keys and config binding must be scoped to.
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
interface ExtensionScope {
|
|
6
6
|
/** Absolute path to the extension's source root. */
|
|
7
7
|
readonly sourceRoot: string;
|
|
8
8
|
/** Package-derived namespace (e.g. `acme-crm`). */
|
|
@@ -35,3 +35,4 @@ export declare function createExtensionScopePlugin(scopes: readonly ExtensionSco
|
|
|
35
35
|
* filesystem path matching (which is unreliable under workspace symlinks).
|
|
36
36
|
*/
|
|
37
37
|
export declare function createFixedNamespaceScopePlugin(namespace: string): ExtensionScopeBundlerPlugin;
|
|
38
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{realpathSync}from"node:fs";import{resolve,sep}from"node:path";const VIRTUAL_PREFIX=`\0eve-ext-scope:`,SCOPED_FRAMEWORK_MODULES={"eve/context":`context`,"eve/extension":`extension`};function canonicalize(e){try{return realpathSync(e)}catch{return resolve(e)}}function importerPath(e){let t=e.indexOf(`?`);return canonicalize(t===-1?e:e.slice(0,t))}function isUnder(e,t){return e===t||e.startsWith(`${t}${sep}`)}function shimSource(e,t){let n=JSON.stringify(t);return e===`context`?[`import { defineState as __eveScopedDefineState } from "eve/context";`,`export function defineState(name, initial) {`,` return __eveScopedDefineState(${n} + "." + name, initial);`,`}`,``].join(`
|
|
2
2
|
`):[`import { defineExtension as __eveScopedDefineExtension } from "eve/extension";`,`export function defineExtension(options, namespace) {`,` return __eveScopedDefineExtension(options, namespace === undefined ? ${n} : namespace);`,`}`,``].join(`
|
|
3
3
|
`)}function scopeHooks(e,t){return{name:e,resolveId(e,n){let r=SCOPED_FRAMEWORK_MODULES[e];if(r===void 0||n===void 0||n.startsWith(`\0`))return;let i=t(n);if(i!==void 0)return`${VIRTUAL_PREFIX}${r}:${i}`},load(e){if(!e.startsWith(VIRTUAL_PREFIX))return;let t=e.slice(15),n=t.indexOf(`:`);return{code:shimSource(t.slice(0,n),t.slice(n+1)),moduleType:`js`}}}}function createExtensionScopePlugin(e){if(e.length===0)return null;let t=e.map(e=>({root:canonicalize(e.sourceRoot),packageNamespace:e.packageNamespace}));return scopeHooks(`eve-extension-scope`,e=>{let n=importerPath(e);for(let e of t)if(isUnder(n,e.root))return e.packageNamespace})}function createFixedNamespaceScopePlugin(e){return scopeHooks(`eve-extension-scope-fixed`,()=>e)}export{createExtensionScopePlugin,createFixedNamespaceScopePlugin};
|
|
@@ -13,22 +13,13 @@ type RolldownOutputAsset = {
|
|
|
13
13
|
type RolldownOutput = {
|
|
14
14
|
readonly output: readonly [RolldownOutputChunk, ...(RolldownOutputChunk | RolldownOutputAsset)[]];
|
|
15
15
|
};
|
|
16
|
-
type RolldownParseAst = (sourceText: string, options?: Record<string, unknown> | null, filename?: string) => unknown;
|
|
17
|
-
export type RolldownParserLanguage = "js" | "jsx" | "ts" | "tsx";
|
|
18
|
-
type RolldownParseAstModule = {
|
|
19
|
-
readonly parseAst: RolldownParseAst;
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Loads Rolldown's parser from Nitro's dependency tree so workflow directive
|
|
23
|
-
* transforms can use the same bundler dependency without exposing it publicly.
|
|
24
|
-
*/
|
|
25
|
-
export declare function loadNitroRolldownParseAst(): Promise<RolldownParseAstModule>;
|
|
26
|
-
export declare function inferRolldownParserLanguage(filename: string): RolldownParserLanguage;
|
|
27
16
|
export declare function parseWithNitroRolldownAst(filename: string, sourceText: string): Promise<unknown>;
|
|
28
17
|
/**
|
|
29
18
|
* Runs a raw Rolldown build. Prefer {@link buildSingleRolldownChunk} for any
|
|
30
19
|
* bundle whose consumer expects one in-memory file; use this directly only
|
|
31
|
-
* for multi-file, written-to-disk output.
|
|
20
|
+
* for multi-file, written-to-disk output. Warnings raised only by dependency
|
|
21
|
+
* code are dropped unless the caller supplies its own `onLog`, except
|
|
22
|
+
* unresolved imports.
|
|
32
23
|
*/
|
|
33
24
|
export declare function buildWithNitroRolldown(options: Record<string, unknown>): Promise<RolldownOutput>;
|
|
34
25
|
export declare const ROLLDOWN_STANDARD_CONDITION_NAMES: ReadonlySet<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRequire}from"node:module";import{pathToFileURL}from"node:url";let rolldownPromise,rolldownParseAstPromise;function loadNitroRolldown(){return rolldownPromise??=(async()=>{let e=createRequire(import.meta.url),t=createRequire(e.resolve(`nitro/package.json`)).resolve(`rolldown`);return await import(pathToFileURL(t).href)})(),rolldownPromise}function loadNitroRolldownParseAst(){return rolldownParseAstPromise??=(async()=>{let e=createRequire(import.meta.url),t=createRequire(e.resolve(`nitro/package.json`)).resolve(`rolldown/parseAst`);return await import(pathToFileURL(t).href)})(),rolldownParseAstPromise}function inferRolldownParserLanguage(e){return e.endsWith(`.tsx`)?`tsx`:e.endsWith(`.jsx`)?`jsx`:/\.[cm]?ts$/.test(e)?`ts`:`js`}async function parseWithNitroRolldownAst(e,t){let{parseAst:n}=await loadNitroRolldownParseAst();return n(t,{astType:`ts`,lang:inferRolldownParserLanguage(e),range:!0,sourceType:`module`},e)}async function buildWithNitroRolldown(e){assertCustomRolldownConditionNames(e);let{build:t}=await loadNitroRolldown();return await t(e)}const ROLLDOWN_STANDARD_CONDITION_NAMES=new Set([`browser`,`default`,`import`,`node`,`require`]);function assertCustomRolldownConditionNames(e){let t=e.resolve;if(typeof t!=`object`||!t)return;let n=Reflect.get(t,`conditionNames`);if(Array.isArray(n)){for(let e of n)if(typeof e==`string`&&ROLLDOWN_STANDARD_CONDITION_NAMES.has(e))throw Error(`Rolldown resolves the standard condition ${JSON.stringify(e)} per import edge; conditionNames may contain only eve-specific additions.`)}}async function buildSingleRolldownChunk(e,t){return getSingleRolldownChunk(await buildWithNitroRolldown({...t,write:!1,output:{...t.output,codeSplitting:!1}}),e)}function getSingleRolldownChunk(e,t){let n=e.output.filter(e=>e.type===`chunk`),r=n[0];if(r===void 0||n.length!==1)throw Error(`Expected one bundled ${t}.`);return r}export{ROLLDOWN_STANDARD_CONDITION_NAMES,buildSingleRolldownChunk,buildWithNitroRolldown,
|
|
1
|
+
import{createRequire}from"node:module";import{pathToFileURL}from"node:url";import{onVendoredDependencyLog}from"#internal/bundler/vendored-dependency-log.js";let rolldownPromise,rolldownParseAstPromise;function loadNitroRolldown(){return rolldownPromise??=(async()=>{let e=createRequire(import.meta.url),t=createRequire(e.resolve(`nitro/package.json`)).resolve(`rolldown`);return await import(pathToFileURL(t).href)})(),rolldownPromise}function loadNitroRolldownParseAst(){return rolldownParseAstPromise??=(async()=>{let e=createRequire(import.meta.url),t=createRequire(e.resolve(`nitro/package.json`)).resolve(`rolldown/parseAst`);return await import(pathToFileURL(t).href)})(),rolldownParseAstPromise}function inferRolldownParserLanguage(e){return e.endsWith(`.tsx`)?`tsx`:e.endsWith(`.jsx`)?`jsx`:/\.[cm]?ts$/.test(e)?`ts`:`js`}async function parseWithNitroRolldownAst(e,t){let{parseAst:n}=await loadNitroRolldownParseAst();return n(t,{astType:`ts`,lang:inferRolldownParserLanguage(e),range:!0,sourceType:`module`},e)}async function buildWithNitroRolldown(e){assertCustomRolldownConditionNames(e);let{build:t}=await loadNitroRolldown();return await t({onLog:onRolldownBuildLog,...e})}function onRolldownBuildLog(e,t,n){if(e===`warn`&&t?.code===`UNRESOLVED_IMPORT`){n(e,t);return}onVendoredDependencyLog(e,t,n)}const ROLLDOWN_STANDARD_CONDITION_NAMES=new Set([`browser`,`default`,`import`,`node`,`require`]);function assertCustomRolldownConditionNames(e){let t=e.resolve;if(typeof t!=`object`||!t)return;let n=Reflect.get(t,`conditionNames`);if(Array.isArray(n)){for(let e of n)if(typeof e==`string`&&ROLLDOWN_STANDARD_CONDITION_NAMES.has(e))throw Error(`Rolldown resolves the standard condition ${JSON.stringify(e)} per import edge; conditionNames may contain only eve-specific additions.`)}}async function buildSingleRolldownChunk(e,t){return getSingleRolldownChunk(await buildWithNitroRolldown({...t,write:!1,output:{...t.output,codeSplitting:!1}}),e)}function getSingleRolldownChunk(e,t){let n=e.output.filter(e=>e.type===`chunk`),r=n[0];if(r===void 0||n.length!==1)throw Error(`Expected one bundled ${t}.`);return r}export{ROLLDOWN_STANDARD_CONDITION_NAMES,buildSingleRolldownChunk,buildWithNitroRolldown,parseWithNitroRolldownAst};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type BundlerDefaultLogHandler = (level: string, log: unknown) => void;
|
|
2
|
+
/**
|
|
3
|
+
* Rollup/Rolldown `onLog` handler that drops warnings raised only by
|
|
4
|
+
* dependency code (`node_modules` or eve's compiled vendor modules), which the
|
|
5
|
+
* user cannot act on, and forwards everything else.
|
|
6
|
+
*/
|
|
7
|
+
export declare function onVendoredDependencyLog(level: string, log: unknown, defaultHandler: BundlerDefaultLogHandler): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function normalizePath(e){return e.replaceAll(`\\`,`/`)}function isNodeModulesPath(e){return normalizePath(e).split(`/`).includes(`node_modules`)}function hasPathSegments(e,t){let n=normalizePath(e).split(`/`).filter(Boolean);return n.some((e,r)=>t.every((e,t)=>n[r+t]===e))}function isCompiledVendorPath(e){return hasPathSegments(e,[`.generated`,`compiled`])||hasPathSegments(e,[`dist`,`src`,`compiled`])}function getLogFilePaths(e){if(typeof e!=`object`||!e)return[];let t=e,n=Array.isArray(t.ids)?t.ids:[];return[t.id,...n,t.loc?.file].filter(e=>typeof e==`string`)}function isVendoredDependencyWarning(e){let t=getLogFilePaths(e);return t.length>0&&t.every(e=>isNodeModulesPath(e)||isCompiledVendorPath(e))}function onVendoredDependencyLog(e,t,n){e===`warn`&&isVendoredDependencyWarning(t)||n(e,t)}export{onVendoredDependencyLog};
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { type ProjectSource } from "#discover/project-source.js";
|
|
2
|
-
export declare function isEveProjectRoot(root: string, options?: {
|
|
3
|
-
readonly source?: ProjectSource;
|
|
4
|
-
}): Promise<boolean>;
|
|
5
2
|
/** Find the nearest package boundary and return it only when it owns an eve project. */
|
|
6
3
|
export declare function findEveProjectRoot(startPath: string, options?: {
|
|
7
4
|
readonly source?: ProjectSource;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{dirname,join,resolve}from"node:path";import{createDiskProjectSource}from"#discover/project-source.js";function isJsonObject(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}async function packageDeclaresEve(e,t){let n;try{n=JSON.parse(await t.readTextFile(e))}catch(t){throw Error(`The package.json at ${e} is not valid JSON.`,{cause:t})}if(!isJsonObject(n))return!1;let r=n.dependencies;return isJsonObject(r)&&typeof r.eve==`string`}async function
|
|
1
|
+
import{dirname,join,resolve}from"node:path";import{createDiskProjectSource}from"#discover/project-source.js";function isJsonObject(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}async function packageDeclaresEve(e,t){let n;try{n=JSON.parse(await t.readTextFile(e))}catch(t){throw Error(`The package.json at ${e} is not valid JSON.`,{cause:t})}if(!isJsonObject(n))return!1;let r=n.dependencies;return isJsonObject(r)&&typeof r.eve==`string`}async function findEveProjectRoot(e,t={}){let n=t.source??createDiskProjectSource(),r=resolve(e),i=await n.stat(r)===`directory`?r:dirname(r);for(;;){let e=join(i,`package.json`);if(await n.stat(e)===`file`)return await packageDeclaresEve(e,n)?i:void 0;let t=dirname(i);if(t===i)return;i=t}}export{findEveProjectRoot};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { JsonObject } from "#shared/json.js";
|
|
2
2
|
export declare const EXTERNAL_RESOURCES_SNAPSHOT_KIND = "eve-external-resources";
|
|
3
3
|
export declare const EXTERNAL_RESOURCES_SNAPSHOT_VERSION = 1;
|
|
4
|
-
|
|
4
|
+
interface ExternalCredentialRequirement {
|
|
5
5
|
readonly method?: string;
|
|
6
6
|
readonly reference: string;
|
|
7
7
|
readonly service: string;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { CompiledAgentManifest } from "#compiler/manifest.js";
|
|
2
2
|
import { type ExternalResourcesSnapshot } from "#internal/external-resources-snapshot.js";
|
|
3
3
|
import { type JsonObject } from "#shared/json.js";
|
|
4
|
-
export declare const CONNECT_MANIFEST_FILENAME = "vercel-connect-manifest.json";
|
|
5
4
|
export declare function buildExternalResourcesSnapshot(input: {
|
|
6
5
|
readonly generatorVersion: string;
|
|
7
6
|
readonly manifest: CompiledAgentManifest;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRequire}from"node:module";import{mkdir,writeFile}from"node:fs/promises";import{join}from"node:path";import{pathToFileURL}from"node:url";import{parseJsonObject}from"#shared/json.js";import{createExternalResourcesSnapshot}from"#internal/external-resources-snapshot.js";
|
|
1
|
+
import{createRequire}from"node:module";import{mkdir,writeFile}from"node:fs/promises";import{join}from"node:path";import{pathToFileURL}from"node:url";import{parseJsonObject}from"#shared/json.js";import{createExternalResourcesSnapshot}from"#internal/external-resources-snapshot.js";function buildExternalResourcesSnapshot(e){let t=[],n=[e.manifest,...e.manifest.subagents.map(e=>e.agent)];for(let r of n)collectExternalResources(r,t,e.publicRoutePrefix);return createExternalResourcesSnapshot({generatorVersion:e.generatorVersion,resources:t})}function collectExternalResources(e,t,n){for(let n of e.connections){let e=n.vercelConnect?.requirement;if(e!==void 0){if(n.protocol===`openapi`&&n.url.length===0)throw Error(`Connect-backed OpenAPI connection "${n.connectionName}" must set baseUrl explicitly.`);t.push({credentials:e,kind:`connection`,logicalPath:n.logicalPath,name:n.connectionName,protocol:{type:n.protocol,url:n.url}})}}for(let r of e.channelRoutes.effective){let e=r.vercelConnect?.requirement;e!==void 0&&r.manifest!==void 0&&t.push({credentials:e,kind:`channel`,logicalPath:r.logicalPath,manifest:r.manifest,name:r.name,route:{path:`${n??``}${r.urlPath}`}})}}async function emitConnectManifest(e){let t=buildExternalResourcesSnapshot(e),n=await createConnectManifest({appRoot:e.appRoot,snapshot:t});n!==void 0&&(await mkdir(e.outputDirectory,{recursive:!0}),await writeFile(join(e.outputDirectory,`vercel-connect-manifest.json`),`${JSON.stringify(n,null,2)}\n`))}async function createConnectManifest(e){if(e.snapshot.resources.length===0)return;let t=createRequire(join(e.appRoot,`package.json`)),n;try{n=t.resolve(`@vercel/connect/manifest`)}catch{throw Error("Connect-backed resources require @vercel/connect with manifest compiler support. Install or update @vercel/connect, then rerun `eve build`.")}try{let t=await import(pathToFileURL(n).href);if(typeof t.experimental_createConnectManifestFromEveResources!=`function`)throw TypeError(`missing experimental_createConnectManifestFromEveResources export`);return parseJsonObject(t.experimental_createConnectManifestFromEveResources(e.snapshot))}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`Failed to create the Connect manifest: ${t}. Update @vercel/connect and rerun \`eve build\`.`)}}export{buildExternalResourcesSnapshot,createConnectManifest,emitConnectManifest};
|
|
@@ -18,3 +18,5 @@ export declare const vercelGatewayFetch: typeof globalThis.fetch;
|
|
|
18
18
|
*/
|
|
19
19
|
export declare function resolveProviderHeaders(model: LanguageModel): Record<string, string> | undefined;
|
|
20
20
|
export declare function isGatewayModel(model: LanguageModel): boolean;
|
|
21
|
+
/** Groups Gateway generations under the same identity used by eve's agent spans. */
|
|
22
|
+
export declare function mergeGatewaySessionId(model: LanguageModel, providerOptions: Readonly<Record<string, unknown>> | undefined, conversationId: string): Record<string, unknown> | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{appendPackageUserAgent,withPackageUserAgent}from"#internal/user-agent.js";const GATEWAY_BASE_URL=`https://ai-gateway.vercel.sh`,AI_GATEWAY_MODELS_URL=`${GATEWAY_BASE_URL}/v1/models`,AI_GATEWAY_MODELS_CATALOG_URL=`${GATEWAY_BASE_URL}/v1/models/catalog`,vercelGatewayFetch=withPackageUserAgent();function resolveProviderHeaders(e){if(isGatewayModel(e))return Object.fromEntries(appendPackageUserAgent(new Headers))}function isGatewayModel(e){return typeof e==`string`||e.provider?.split(`.`)[0]===`gateway`}export{AI_GATEWAY_MODELS_CATALOG_URL,AI_GATEWAY_MODELS_URL,isGatewayModel,resolveProviderHeaders,vercelGatewayFetch};
|
|
1
|
+
import{appendPackageUserAgent,withPackageUserAgent}from"#internal/user-agent.js";const GATEWAY_BASE_URL=`https://ai-gateway.vercel.sh`,AI_GATEWAY_MODELS_URL=`${GATEWAY_BASE_URL}/v1/models`,AI_GATEWAY_MODELS_CATALOG_URL=`${GATEWAY_BASE_URL}/v1/models/catalog`,vercelGatewayFetch=withPackageUserAgent();function resolveProviderHeaders(e){if(isGatewayModel(e))return Object.fromEntries(appendPackageUserAgent(new Headers))}function isGatewayModel(e){return typeof e==`string`||e.provider?.split(`.`)[0]===`gateway`}function mergeGatewaySessionId(e,t,n){if(!isGatewayModel(e))return t;let r=t?.gateway,i=typeof r==`object`&&r&&!Array.isArray(r)?r:void 0;return typeof i?.sessionId==`string`&&i.sessionId.trim()?t:{...t,gateway:{...i,sessionId:n}}}export{AI_GATEWAY_MODELS_CATALOG_URL,AI_GATEWAY_MODELS_URL,isGatewayModel,mergeGatewaySessionId,resolveProviderHeaders,vercelGatewayFetch};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{isObject}from"#shared/guards.js";import{
|
|
1
|
+
import{isObject}from"#shared/guards.js";import{normalizeInstructionsDefinition,normalizeScheduleDefinition,normalizeSkillDefinition}from"#internal/authored-definition/core.js";import{hasFrontmatter,parseFrontmatter}from"#internal/helpers/gray-matter.js";import{defineSchedule}from"#public/definitions/schedule.js";import{defineSkill}from"#public/definitions/skill.js";const CLOSED_FRONTMATTER_PATTERN=/^---\r?\n[\s\S]*?\r?\n---(?:\r?\n|$)/;function parseMarkdownDocument(e){if(!hasFrontmatter(e))return{hasFrontmatter:!1,frontmatter:{},markdown:e};let t;try{t=parseFrontmatter(e)}catch(t){throw startsWithFrontmatterFence(e)&&!hasClosedFrontmatterFence(e)?Error(`Markdown frontmatter is missing a closing delimiter.`):t}if(!isObject(t.data))throw Error(`Markdown frontmatter must parse to an object.`);return{hasFrontmatter:!0,frontmatter:t.data,markdown:normalizeFrontmatterMarkdownBody(t.content)}}function lowerInstructionsMarkdown(e){return normalizeInstructionsDefinition({content:e,role:`system`},`Expected authored instructions markdown to match the public eve shape.`)}function lowerScheduleMarkdown(e){let t=parseMarkdownDocument(e);if(!t.hasFrontmatter)throw Error(`Schedule markdown must start with YAML frontmatter declaring "cron".`);if(`run`in t.frontmatter)throw Error('Markdown-form schedules do not support the "run" frontmatter key. Use a TypeScript schedule (`<name>.ts`) to author a handler.');let n={...t.frontmatter,markdown:t.markdown};return defineSchedule(normalizeScheduleDefinition(n,`Expected authored schedule markdown to match the public eve shape.`))}function lowerSkillMarkdown(e,t={}){let n=parseMarkdownDocument(e),r=t.slug;if(r===void 0&&!n.hasFrontmatter)throw Error(`Skill markdown must start with YAML frontmatter.`);let i=n.frontmatter,a=toOptionalString(i.description,`description`),o={description:r===void 0?requireStringFrontmatter(i.description,`description`):a??t.description??deriveFlatSkillDescription(n.markdown,r),markdown:n.markdown};return applyOptionalSkillFrontmatter(o,i),defineSkill(normalizeSkillDefinition(o,`Expected authored skill markdown to match the public eve shape.`))}function startsWithFrontmatterFence(e){return e.startsWith(`---
|
|
2
2
|
`)||e.startsWith(`---\r
|
|
3
3
|
`)}function hasClosedFrontmatterFence(e){return CLOSED_FRONTMATTER_PATTERN.test(e)}function normalizeFrontmatterMarkdownBody(e){return e.replace(/^\r?\n/u,``)}function applyOptionalSkillFrontmatter(e,t){let n=toOptionalString(t.license,`license`);n!==void 0&&(e.license=n);let r=toOptionalStringRecord(t.metadata,`metadata`);r!==void 0&&(e.metadata=r)}function toOptionalString(e,t){if(e!=null){if(typeof e!=`string`)throw Error(`Expected "${t}" frontmatter to be a string.`);return e}}function requireStringFrontmatter(e,t){let n=toOptionalString(e,t);if(n===void 0)throw Error(`Missing required "${t}" frontmatter.`);return n}function toOptionalStringRecord(e,t){if(e==null)return;if(!isObject(e))throw Error(`Expected "${t}" frontmatter to be an object.`);let n=Object.entries(e).map(([e,n])=>{if(typeof n!=`string`)throw Error(`Expected "${t}.${e}" frontmatter to be a string.`);return[e,n]});return Object.fromEntries(n)}function deriveFlatSkillDescription(e,t){let n=e.split(/\r?\n/u).map(e=>e.trim()).find(e=>e!==``&&!e.startsWith("```"));return n===void 0?`Instructions for the ${t} skill.`:n.replace(/^[#>*\-\s]+/u,``).trim()||`Instructions for the ${t} skill.`}export{lowerInstructionsMarkdown,lowerScheduleMarkdown,lowerSkillMarkdown};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{existsSync,readdirSync,statSync}from"node:fs";import{join}from"node:path";import{isAuthoredTestPath}from"#discover/filesystem.js";const INSTRUMENTATION_EXTENSIONS=[`.ts`,`.mts`,`.js`,`.mjs`],INSTRUMENTATION_DIRECTORY=`instrumentation`;function resolveInstrumentationLayout(e){let t=findRemovedInstrumentationFile(e.agentRoot),n=join(e.agentRoot,INSTRUMENTATION_DIRECTORY),r=existsSync(n)&&statSync(n).isDirectory();if(t!==void 0)throw Error(`Found removed instrumentation file "${t}". Move it into the "${INSTRUMENTATION_DIRECTORY}/" directory as one file per provider. See the instrumentation migration guide.`);return r?{kind:`directory`,modulePathsBySlot:collectInstrumentationProviderModules(n)}:{kind:`directory`,modulePathsBySlot:{}}}function collectInstrumentationProviderModules(e){let t=new Map;for(let n of readdirSync(e,{withFileTypes:!0})){if(!n.isFile()||isAuthoredTestPath(n.name))continue;let r=INSTRUMENTATION_EXTENSIONS.find(e=>n.name.endsWith(e));if(r===void 0)continue;let i=n.name.slice(0,-r.length);if(i!==``){if(t.get(i)!==void 0)throw Error(`Two files declare the "${i}" instrumentation provider in "${e}". Keep one of them.`);t.set(i,join(e,n.name))}}return Object.fromEntries([...t].sort(([e],[t])=>e.localeCompare(t)))}function findRemovedInstrumentationFile(e){for(let t of INSTRUMENTATION_EXTENSIONS){let n=join(e,`${INSTRUMENTATION_DIRECTORY}${t}`);if(existsSync(n))return n}}export{resolveInstrumentationLayout};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { RunInput, SessionAuthContext } from "#channel/types.js";
|
|
2
2
|
import { INVOCATION_OWNER_ATTRIBUTE, INVOCATION_TOKEN_ATTRIBUTE } from "#internal/invocation/attributes.js";
|
|
3
3
|
export { INVOCATION_OWNER_ATTRIBUTE, INVOCATION_TOKEN_ATTRIBUTE };
|
|
4
|
-
|
|
4
|
+
type ExternalInvocationMetadata = NonNullable<RunInput["externalInvocation"]>;
|
|
5
5
|
/** Batch-scoped request id exposed to MCP clients for one durable pending-input event. */
|
|
6
6
|
export declare function invocationInputRequestId(pendingBatchId: string, requestId: string): string;
|
|
7
7
|
/** Fixed-width fingerprint used to bind an invocation to its initiating principal. */
|
|
@@ -7,7 +7,7 @@ export interface MaterializedInstrumentation {
|
|
|
7
7
|
readonly kind: "directory";
|
|
8
8
|
readonly modulePathsBySlot: Readonly<Record<string, string>>;
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
interface MaterializedAuthoredModuleIndex {
|
|
11
11
|
readonly fingerprint: string;
|
|
12
12
|
readonly instrumentation?: MaterializedInstrumentation;
|
|
13
13
|
readonly moduleMap: string;
|
|
@@ -18,3 +18,4 @@ export declare function writeMaterializedAuthoredModules(input: {
|
|
|
18
18
|
readonly runtimeAppRoot: string;
|
|
19
19
|
}): Promise<MaterializedAuthoredModuleIndex>;
|
|
20
20
|
export declare function readMaterializedAuthoredModuleIndex(runtimeAppRoot: string): Promise<MaterializedAuthoredModuleIndex | undefined>;
|
|
21
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createHash}from"node:crypto";import{lstat,mkdir,readFile,readdir,readlink,writeFile}from"node:fs/promises";import{
|
|
1
|
+
import{createHash}from"node:crypto";import{lstat,mkdir,readFile,readdir,readlink,writeFile}from"node:fs/promises";import{existsSync}from"node:fs";import{join,relative,sep}from"node:path";import{COMPILED_AGENT_MANIFEST_KIND,ROOT_COMPILED_AGENT_NODE_ID}from"#compiler/manifest.js";import{serializeCompiledManifestForFingerprint}from"#internal/compiled-manifest-fingerprint.js";const MATERIALIZED_MODULES_DIRECTORY=`authored-modules`,MATERIALIZED_MODULES_INDEX=`authored-modules.json`;async function writeMaterializedAuthoredModules(e){let t=join(e.runtimeAppRoot,`.eve`,`compile`),n=await readCompiledManifest(join(t,`compiled-agent-manifest.json`)),r=join(t,MATERIALIZED_MODULES_DIRECTORY),i=createHash(`sha256`);await mkdir(r,{recursive:!0}),i.update(`manifest\0`).update(serializeCompiledManifestForFingerprint({manifest:n,runtimeAppRoot:e.runtimeAppRoot})).update(`\0`);let a=createMaterializedModuleFileName(ROOT_COMPILED_AGENT_NODE_ID,`module-map`,e.prepared.moduleMapCode),o=join(MATERIALIZED_MODULES_DIRECTORY,a);await writeFile(join(r,a),e.prepared.moduleMapCode),i.update(`module-map\0`).update(e.prepared.moduleMapCode).update(`\0`);let materializeInstrumentationModule=async(e,t)=>{let n=createMaterializedModuleFileName(ROOT_COMPILED_AGENT_NODE_ID,`instrumentation:${e}`,t);return await writeFile(join(r,n),t),i.update(`instrumentation:${e}\0`).update(t).update(`\0`),join(MATERIALIZED_MODULES_DIRECTORY,n)},s={};for(let[t,n]of Object.entries(e.prepared.instrumentation.moduleCodeBySlot))s[t]=await materializeInstrumentationModule(t,n);let c={kind:`directory`,modulePathsBySlot:s};await hashDirectoryIfPresent({fingerprint:i,path:join(t,`workspace-resources`),root:join(t,`workspace-resources`)});let l={fingerprint:i.digest(`hex`),moduleMap:o,version:3};return l.instrumentation=c,await writeFile(join(t,MATERIALIZED_MODULES_INDEX),`${JSON.stringify(l)}\n`),l}async function readMaterializedAuthoredModuleIndex(e){let t=join(e,`.eve`,`compile`,MATERIALIZED_MODULES_INDEX);if(!existsSync(t))return;let n=JSON.parse(await readFile(t,`utf8`));if(n.version!==3||typeof n.fingerprint!=`string`||n.fingerprint.length===0||typeof n.moduleMap!=`string`||n.moduleMap.length===0||!isMaterializedInstrumentation(n.instrumentation))throw Error(`Invalid materialized authored module index at "${t}".`);return n}function isMaterializedInstrumentation(e){if(e===void 0)return!0;if(typeof e!=`object`||!e)return!1;let t=e;if(t.kind===`directory`){let e=t.modulePathsBySlot;return typeof e==`object`&&!!e&&Object.values(e).every(e=>typeof e==`string`)}return!1}async function readCompiledManifest(e){let t=JSON.parse(await readFile(e,`utf8`));if(t.kind!==COMPILED_AGENT_MANIFEST_KIND)throw Error(`Invalid compiled agent manifest at "${e}".`);return t}function createMaterializedModuleFileName(e,t,n){return`${createHash(`sha256`).update(e).update(`\0`).update(t).update(`\0`).update(n).digest(`hex`)}.mjs`}async function hashDirectoryIfPresent(e){if(!existsSync(e.path))return;let t=await lstat(e.path),n=toPortablePath(relative(e.root,e.path));if(t.isSymbolicLink()){e.fingerprint.update(n).update(`\0link\0`).update(await readlink(e.path)).update(`\0`);return}if(t.isDirectory()){for(let t of(await readdir(e.path)).sort())await hashDirectoryIfPresent({...e,path:join(e.path,t)});return}t.isFile()&&e.fingerprint.update(n).update(`\0file\0`).update(await readFile(e.path)).update(`\0`)}function toPortablePath(e){return e.split(sep).join(`/`)}export{readMaterializedAuthoredModuleIndex,writeMaterializedAuthoredModules};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
interface McpProtectedResourceMetadataOptions {
|
|
2
2
|
readonly authorizationServers: readonly string[];
|
|
3
3
|
readonly resource: string;
|
|
4
4
|
readonly scopesSupported?: readonly string[];
|
|
@@ -7,3 +7,4 @@ export interface McpProtectedResourceMetadataOptions {
|
|
|
7
7
|
export declare function createMcpProtectedResourceMetadata(options: McpProtectedResourceMetadataOptions): Readonly<Record<string, unknown>>;
|
|
8
8
|
/** Creates the RFC 9728 bearer discovery challenge for an MCP resource. */
|
|
9
9
|
export declare function createMcpResourceChallenge(resourceMetadataUrl: string, scopes?: readonly string[]): string;
|
|
10
|
+
export {};
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { McpServer, type McpToolAnnotations, type StandardSchemaWithJSON } from "#compiled/@modelcontextprotocol/server/index.js";
|
|
2
2
|
import type { SessionAuthContext } from "#channel/types.js";
|
|
3
3
|
export declare const MCP_PROTOCOL_VERSION = "2026-07-28";
|
|
4
|
-
export declare const MCP_LEGACY_PROTOCOL_VERSION = "2025-11-25";
|
|
5
4
|
/**
|
|
6
5
|
* Upper bound for any MCP POST body. Tool arguments are small JSON; the
|
|
7
6
|
* largest legitimate payload is an `outputSchema`, itself capped at 64 KiB.
|
|
8
7
|
*/
|
|
9
8
|
export declare const MCP_REQUEST_BODY_MAX_BYTES: number;
|
|
10
|
-
|
|
9
|
+
interface McpToolDefinition<TInputSchema extends StandardSchemaWithJSON = StandardSchemaWithJSON> {
|
|
11
10
|
readonly name: string;
|
|
12
11
|
readonly description?: string;
|
|
13
12
|
readonly annotations?: McpToolAnnotations;
|
|
@@ -36,8 +35,8 @@ export type McpContent = {
|
|
|
36
35
|
* change or re-read something; `not_found` means stop; `internal` means the
|
|
37
36
|
* server failed and `errorId` correlates with its logs.
|
|
38
37
|
*/
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
type McpToolOperationErrorCode = "invalid_input" | "not_found" | "conflict" | "internal";
|
|
39
|
+
interface McpToolOperationErrorData {
|
|
41
40
|
readonly code: McpToolOperationErrorCode;
|
|
42
41
|
readonly errorId?: string;
|
|
43
42
|
readonly message: string;
|
|
@@ -61,7 +60,7 @@ export declare function defineMcpTool<const TInputSchema extends StandardSchemaW
|
|
|
61
60
|
readonly signal: AbortSignal;
|
|
62
61
|
}): Promise<McpCallToolResult<TStructured>>;
|
|
63
62
|
}): McpServerTool;
|
|
64
|
-
|
|
63
|
+
interface McpStreamableHttpServerOptions {
|
|
65
64
|
readonly name: string;
|
|
66
65
|
readonly version: string;
|
|
67
66
|
/** Server-level usage guidance returned from `initialize` and `server/discover`. */
|