eve 0.66.3 → 0.67.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +37 -0
- package/dist/src/channel/channel-address.d.ts +0 -2
- package/dist/src/channel/channel-address.js +1 -1
- package/dist/src/channel/channel-operations.d.ts +0 -5
- package/dist/src/channel/channel-operations.js +1 -1
- package/dist/src/channel/compiled-channel.d.ts +8 -0
- package/dist/src/channel/compiled-channel.js +2 -2
- package/dist/src/channel/conversation-context.js +1 -1
- package/dist/src/channel/routes.d.ts +1 -2
- 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/schedule.js +1 -1
- package/dist/src/channel/types.d.ts +8 -13
- package/dist/src/chunks/{use-eve-agent-Di1u2zKu.js → use-eve-agent-D4HVZBjn.js} +1 -6
- package/dist/src/chunks/{use-eve-agent-PbSMyJ6e.js → use-eve-agent-DXcE_8Ja.js} +1 -6
- package/dist/src/cli/acp/command.js +3 -3
- package/dist/src/cli/application-root.d.ts +0 -2
- 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.js +1 -1
- package/dist/src/cli/commands/logs.d.ts +3 -3
- package/dist/src/cli/commands/logs.js +1 -1
- package/dist/src/cli/commands/register-integration-commands.js +1 -1
- package/dist/src/cli/commands/trace.js +1 -1
- package/dist/src/cli/dev/command.d.ts +9 -5
- package/dist/src/cli/dev/command.js +1 -3
- package/dist/src/cli/dev/diagnostic-dump.js +1 -1
- package/dist/src/cli/dev/environment.js +1 -1
- package/dist/src/cli/dev/run-interactive-ui.d.ts +0 -1
- package/dist/src/cli/dev/run-interactive-ui.js +1 -1
- package/dist/src/cli/dev/tui/blocks.js +1 -1
- package/dist/src/cli/dev/tui/prompt-command-handler.js +1 -1
- package/dist/src/cli/dev/tui/question-panel.d.ts +4 -4
- package/dist/src/cli/dev/tui/question-panel.js +1 -1
- package/dist/src/cli/dev/tui/runner.d.ts +0 -1
- package/dist/src/cli/dev/tui/runner.js +2 -2
- package/dist/src/cli/dev/tui/terminal-renderer.js +8 -9
- package/dist/src/cli/dev/tui/theme.d.ts +1 -1
- package/dist/src/cli/dev/url-target.js +1 -1
- package/dist/src/cli/invoke/command.d.ts +2 -5
- package/dist/src/cli/invoke/command.js +1 -1
- package/dist/src/cli/invoke/invoke.d.ts +2 -2
- package/dist/src/cli/invoke/invoke.js +1 -1
- package/dist/src/cli/invoke/result.d.ts +14 -194
- package/dist/src/cli/invoke/result.js +1 -1
- package/dist/src/cli/run.d.ts +0 -4
- package/dist/src/cli/run.js +2 -2
- package/dist/src/cli/telemetry/index.js +1 -1
- package/dist/src/cli/ui/output.d.ts +0 -15
- package/dist/src/cli/ui/output.js +2 -5
- package/dist/src/client/eve-agent-store.js +1 -1
- package/dist/src/client/message-reducer.js +1 -1
- package/dist/src/compiled/.vendor-stamp.json +1 -1
- package/dist/src/compiler/artifacts.js +1 -1
- package/dist/src/compiler/compile-agent.js +1 -1
- package/dist/src/compiler/compile-from-memory.d.ts +0 -1
- package/dist/src/compiler/compile-from-memory.js +1 -1
- package/dist/src/compiler/extension-compatibility.d.ts +25 -18
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/compiler/manifest.d.ts +48 -14
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/normalize-agent-config.js +1 -1
- package/dist/src/compiler/normalize-channel.js +1 -1
- package/dist/src/compiler/normalize-connection.js +1 -1
- package/dist/src/compiler/normalize-manifest-helpers.js +1 -1
- package/dist/src/compiler/normalize-subagent.d.ts +0 -2
- package/dist/src/compiler/normalize-subagent.js +1 -1
- package/dist/src/compiler/remote-agent-node.d.ts +0 -2
- package/dist/src/compiler/remote-agent-node.js +1 -1
- package/dist/src/compiler/workspace-resources.js +1 -1
- package/dist/src/context/dynamic-subagent-lifecycle.js +1 -1
- package/dist/src/context/keys.d.ts +0 -3
- package/dist/src/context/keys.js +1 -1
- package/dist/src/context/memory-lifecycle.d.ts +1 -0
- package/dist/src/context/memory-lifecycle.js +1 -1
- package/dist/src/discover/diagnostics.d.ts +0 -4
- package/dist/src/discover/diagnostics.js +1 -1
- package/dist/src/discover/project.js +1 -1
- package/dist/src/eve-channel/create-request.d.ts +0 -3
- package/dist/src/eve-channel/create-request.js +1 -1
- package/dist/src/eve-channel/index.js +1 -1
- package/dist/src/eve-channel/request.js +1 -1
- package/dist/src/eve-channel/types.d.ts +1 -1
- package/dist/src/execution/delegated-session-context.d.ts +2 -0
- package/dist/src/execution/delegated-session-context.js +1 -0
- package/dist/src/execution/dynamic-connections.d.ts +4 -1
- package/dist/src/execution/dynamic-connections.js +1 -1
- package/dist/src/execution/dynamic-workflow/tool.js +1 -1
- package/dist/src/execution/effective-agent-config.js +1 -1
- package/dist/src/execution/legacy-session/input.d.ts +0 -2
- package/dist/src/execution/legacy-session/input.js +1 -1
- package/dist/src/execution/legacy-session/prepare-step.d.ts +0 -1
- package/dist/src/execution/legacy-session/turn-workflow.js +1 -1
- package/dist/src/execution/node-step.d.ts +4 -2
- package/dist/src/execution/node-step.js +1 -1
- package/dist/src/execution/proxied-deliver-step.js +1 -1
- package/dist/src/execution/publish-channel-event.d.ts +23 -0
- package/dist/src/execution/publish-channel-event.js +1 -0
- package/dist/src/execution/runtime-context.js +1 -1
- package/dist/src/execution/sandbox/bindings/docker-templates.js +1 -1
- package/dist/src/execution/sandbox/bindings/just-bash.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-templates.js +1 -1
- package/dist/src/execution/session/entry.js +1 -1
- package/dist/src/execution/session/event-sink.d.ts +1 -1
- package/dist/src/execution/session/event-sink.js +1 -1
- package/dist/src/execution/session/finalization.d.ts +1 -4
- package/dist/src/execution/session/finalization.js +1 -1
- package/dist/src/execution/session/handoff.d.ts +1 -3
- package/dist/src/execution/session/handoff.js +1 -1
- package/dist/src/execution/session/input-queue.d.ts +0 -1
- package/dist/src/execution/session/input-queue.js +1 -1
- package/dist/src/execution/session/next-input.d.ts +0 -1
- package/dist/src/execution/session/next-input.js +1 -1
- package/dist/src/execution/session/program.d.ts +0 -3
- package/dist/src/execution/session/program.js +1 -1
- package/dist/src/execution/session/turn-step-result.d.ts +1 -2
- package/dist/src/execution/session/turn-step-result.js +1 -1
- package/dist/src/execution/session/turn-step.js +1 -1
- package/dist/src/execution/session/turn.d.ts +2 -2
- package/dist/src/execution/session/turn.js +1 -1
- package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
- package/dist/src/execution/tasks/parent/hitl-proxy-steps.js +1 -1
- package/dist/src/execution/tools/agent-router-workflow.js +1 -1
- package/dist/src/execution/tools/agent-router.d.ts +0 -2
- package/dist/src/execution/tools/agent-router.js +1 -1
- package/dist/src/execution/tools/ask-question-workflow.js +1 -1
- package/dist/src/execution/tools/connection-search.d.ts +1 -0
- 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.js +1 -1
- package/dist/src/execution/tools/subagent/start.js +1 -1
- package/dist/src/extensions/code/extension/lib/connect-authentication.js +1 -1
- package/dist/src/extensions/code/extension/lib/github-shell.js +1 -1
- package/dist/src/extensions/code/extension/lib/prwatch-github.js +1 -1
- package/dist/src/framework/sources/registry.js +1 -1
- package/dist/src/harness/approval-delivery-coordinator.d.ts +3 -13
- package/dist/src/harness/approval-delivery-coordinator.js +1 -1
- package/dist/src/harness/authorization.d.ts +0 -9
- package/dist/src/harness/authorization.js +1 -1
- package/dist/src/harness/emission.d.ts +2 -3
- package/dist/src/harness/emission.js +1 -1
- package/dist/src/harness/input-request-resolution.d.ts +2 -0
- package/dist/src/harness/input-request-resolution.js +1 -1
- package/dist/src/harness/input-requests.d.ts +3 -3
- package/dist/src/harness/input-requests.js +1 -1
- package/dist/src/harness/pending-input-batches.d.ts +3 -3
- 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/proxy-input-requests.d.ts +2 -0
- package/dist/src/harness/proxy-input-requests.js +1 -1
- package/dist/src/harness/session-limit-enforcement.d.ts +2 -3
- package/dist/src/harness/session-limit-enforcement.js +1 -1
- package/dist/src/harness/step-hooks.js +1 -1
- package/dist/src/harness/tool-loop.js +2 -2
- package/dist/src/harness/tools.js +1 -1
- package/dist/src/harness/turn-cancellation.d.ts +2 -7
- package/dist/src/harness/turn-cancellation.js +1 -1
- package/dist/src/harness/types.d.ts +11 -13
- 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/session-context.js +1 -1
- package/dist/src/instrumentation/session-init.js +1 -1
- 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/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/package.js +1 -1
- package/dist/src/internal/application/paths.js +1 -1
- 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/core.js +1 -1
- package/dist/src/internal/authored-module-evaluation-error.js +1 -1
- package/dist/src/internal/authored-module-loader.js +1 -2
- package/dist/src/internal/authored-package-boundary.d.ts +0 -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.js +1 -1
- package/dist/src/internal/bundler/nitro-rolldown.d.ts +3 -1
- package/dist/src/internal/bundler/nitro-rolldown.js +1 -1
- package/dist/src/internal/bundler/vendored-dependency-log.d.ts +7 -0
- package/dist/src/internal/bundler/vendored-dependency-log.js +1 -0
- package/dist/src/internal/external-resources-snapshot.d.ts +46 -0
- package/dist/src/internal/external-resources-snapshot.js +1 -0
- package/dist/src/internal/external-resources.d.ts +20 -0
- package/dist/src/internal/external-resources.js +1 -0
- package/dist/src/internal/gateway.d.ts +2 -0
- package/dist/src/internal/gateway.js +1 -1
- package/dist/src/internal/instrumentation-layout.js +1 -1
- package/dist/src/internal/invocation/workflow-execution.d.ts +0 -2
- package/dist/src/internal/invocation/workflow-execution.js +1 -1
- package/dist/src/internal/materialized-authored-modules.js +1 -1
- package/dist/src/internal/nitro/dev-runtime-artifacts-retention.js +1 -1
- 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.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/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-source-watcher.js +1 -1
- package/dist/src/internal/nitro/host/extension-external-dependency-plugin.js +1 -1
- package/dist/src/internal/nitro/host/instrumentation-entry.d.ts +3 -0
- package/dist/src/internal/nitro/host/instrumentation-entry.js +2 -0
- 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 +1 -25
- package/dist/src/internal/nitro/host/schedule-task-routes.js +2 -2
- package/dist/src/internal/nitro/host/start-development-server.d.ts +0 -8
- package/dist/src/internal/nitro/host/start-development-server.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/host.d.ts +1 -1
- package/dist/src/internal/nitro/host.js +1 -1
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.js +1 -1
- package/dist/src/internal/nitro/routes/index.js +72 -3
- package/dist/src/internal/process/pnpm.js +1 -1
- package/dist/src/internal/vercel/build-agent-workspace.js +1 -1
- package/dist/src/internal/workflow/development-world-client.js +1 -1
- package/dist/src/internal/workflow/development-world-server.js +1 -1
- package/dist/src/internal/workflow-bundle/builder-support.js +1 -1
- package/dist/src/internal/workflow-bundle/builder.js +2 -2
- package/dist/src/internal/workflow-bundle/workflow-builders.js +1 -1
- package/dist/src/node_modules/.pnpm/{@vercel_cli-config@0.2.7 → @vercel_cli-config@0.3.0}/node_modules/@vercel/cli-config/dist/index.js +1 -1
- package/dist/src/node_modules/.pnpm/{@vercel_connect@2.2.0_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_3fe44d656b2dcd93a04011e80966afff → @vercel_connect@2.3.3_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_a37674779346d612fa7d2ca9bd316494}/node_modules/@vercel/connect/dist/authorization.js +1 -1
- package/dist/src/node_modules/.pnpm/@vercel_connect@2.3.3_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_a37674779346d612fa7d2ca9bd316494/node_modules/@vercel/connect/dist/connector.js +1 -0
- package/dist/src/node_modules/.pnpm/{@vercel_connect@2.2.0_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_3fe44d656b2dcd93a04011e80966afff → @vercel_connect@2.3.3_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_a37674779346d612fa7d2ca9bd316494}/node_modules/@vercel/connect/dist/installation.js +1 -1
- package/dist/src/node_modules/.pnpm/{@vercel_connect@2.2.0_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_3fe44d656b2dcd93a04011e80966afff → @vercel_connect@2.3.3_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_a37674779346d612fa7d2ca9bd316494}/node_modules/@vercel/connect/dist/token.js +1 -1
- package/dist/src/node_modules/.pnpm/{@vercel_oidc@3.8.8 → @vercel_oidc@3.8.9}/node_modules/@vercel/oidc/dist/token-util.js +1 -1
- package/dist/src/node_modules/.pnpm/{@vercel_oidc@3.8.8 → @vercel_oidc@3.8.9}/node_modules/@vercel/oidc/dist/token.js +1 -1
- package/dist/src/node_modules/.pnpm/{@vercel_oidc@3.8.8 → @vercel_oidc@3.8.9}/node_modules/@vercel/oidc/dist/version.js +1 -1
- package/dist/src/protocol/message.d.ts +4 -0
- package/dist/src/protocol/message.js +1 -1
- package/dist/src/public/channels/chat-sdk/chatSdkChannel.d.ts +0 -1
- package/dist/src/public/channels/chat-sdk/chatSdkChannel.js +1 -1
- package/dist/src/public/channels/github/api.d.ts +0 -10
- package/dist/src/public/channels/github/api.js +1 -1
- package/dist/src/public/channels/mcp.js +1 -1
- package/dist/src/public/channels/slack/app-manifest.d.ts +9 -0
- package/dist/src/public/channels/slack/app-manifest.js +1 -0
- 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-content.js +6 -3
- 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/slackChannel.d.ts +4 -1
- package/dist/src/public/channels/slack/slackChannel.js +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/remote-agent.d.ts +0 -9
- package/dist/src/public/definitions/workspace-agent.d.ts +0 -3
- package/dist/src/public/definitions/workspace-agent.js +1 -1
- package/dist/src/public/next/server.js +1 -1
- package/dist/src/public/nuxt/dev-server.js +1 -1
- package/dist/src/public/sveltekit/dev-server.js +1 -1
- package/dist/src/runtime/agent/bootstrap.d.ts +0 -1
- package/dist/src/runtime/agent/bootstrap.js +1 -1
- package/dist/src/runtime/connections/mcp-client.js +1 -1
- package/dist/src/runtime/connections/mcp-tracing.d.ts +27 -0
- package/dist/src/runtime/connections/mcp-tracing.js +1 -0
- package/dist/src/runtime/resolve-agent-graph.js +1 -1
- package/dist/src/runtime/resolve-agent.js +1 -1
- package/dist/src/runtime/subagents/dynamic-agent-config.d.ts +0 -2
- package/dist/src/runtime/subagents/dynamic-agent-config.js +1 -1
- package/dist/src/runtime/subagents/dynamic-remote-agent-config.d.ts +0 -2
- package/dist/src/runtime/subagents/dynamic-remote-agent-config.js +1 -1
- package/dist/src/runtime/types.d.ts +1 -2
- package/dist/src/self-modification/extension/subagents/agent/tools/search_traces.js +1 -1
- package/dist/src/services/dev-client/vercel-auth-error.d.ts +1 -9
- package/dist/src/services/dev-client/vercel-auth-error.js +2 -3
- package/dist/src/setup/boxes/select-model.d.ts +2 -36
- package/dist/src/setup/boxes/select-model.js +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/primitives/pm/pnpm.js +1 -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/scaffold/connections/catalog.d.ts +0 -13
- package/dist/src/setup/scaffold/connections/catalog.js +1 -1
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/dist/src/setup/scaffold/version-tokens.js +1 -1
- package/dist/src/setup/scaffold/workspace-root.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.d.ts +2 -21
- package/dist/src/setup/vercel-project.js +0 -0
- package/dist/src/setup/verified-remote-agent.d.ts +1 -0
- package/dist/src/setup/verified-remote-agent.js +1 -1
- package/dist/src/shared/action-types.d.ts +2 -2
- package/dist/src/shared/agent-definition.d.ts +0 -9
- package/dist/src/shared/agent-turn-outcome.d.ts +1 -1
- package/dist/src/shared/channel-definition.d.ts +2 -2
- package/dist/src/shared/conversation-context.d.ts +0 -4
- package/dist/src/shared/conversation-context.js +1 -1
- package/dist/src/shared/conversation-identity.d.ts +2 -0
- package/dist/src/shared/conversation-identity.js +1 -0
- package/dist/src/shared/skill-paths.d.ts +0 -13
- package/dist/src/shared/skill-paths.js +2 -2
- package/dist/src/shared/validate-authorization.js +1 -1
- package/dist/src/shared/vercel-connect-metadata.d.ts +12 -0
- package/dist/src/shared/vercel-connect-metadata.js +1 -0
- package/dist/src/subagents/agent-handle-errors.d.ts +0 -4
- package/dist/src/subagents/agent-handle-errors.js +1 -1
- package/dist/src/subagents/callback-route.js +1 -1
- package/dist/src/subagents/callback-step.d.ts +0 -22
- package/dist/src/subagents/callback-step.js +1 -1
- package/dist/src/subagents/event-proxy-step.js +1 -1
- package/dist/src/subagents/hitl-proxy.d.ts +3 -5
- package/dist/src/subagents/hitl-proxy.js +1 -1
- package/dist/src/subagents/invocation.d.ts +5 -6
- package/dist/src/subagents/parent-notification.d.ts +1 -18
- package/dist/src/subagents/parent-notification.js +1 -1
- package/dist/src/subagents/remote-dispatch.js +1 -1
- package/dist/src/subagents/tool.d.ts +0 -3
- package/dist/src/subagents/tool.js +1 -1
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/tools/framework/agent-contract.d.ts +0 -2
- package/dist/src/tools/framework/agent-contract.js +1 -1
- package/dist/src/tracing/agent-action-instrumentation.js +1 -1
- package/dist/src/tracing/agent-approval-instrumentation.js +1 -1
- package/dist/src/tracing/agent-invocation-coordinator.js +1 -1
- package/dist/src/tracing/agent-memory-instrumentation.js +1 -1
- package/dist/src/tracing/agent-otel-attributes.js +1 -1
- package/dist/src/tracing/agent-otel-provider.js +2 -2
- package/dist/src/tracing/agent-otel-session-context.js +1 -1
- package/dist/src/tracing/agent-tool-instrumentation.js +1 -1
- package/dist/src/tracing/agent-tool-span-context.d.ts +15 -0
- package/dist/src/tracing/agent-tool-span-context.js +1 -0
- 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/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/otel-declaration.d.ts +4 -9
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/agent-config.md +19 -13
- package/docs/channels/chat-sdk.mdx +1 -1
- package/docs/channels/custom.mdx +1 -1
- package/docs/channels/eve.mdx +4 -4
- package/docs/channels/mcp.mdx +10 -10
- package/docs/channels/slack.mdx +1 -1
- package/docs/concepts/sessions-runs-and-streaming.md +5 -6
- package/docs/connections/overview.mdx +22 -0
- package/docs/guides/deployment/overview.md +1 -1
- package/docs/guides/deployment/self-hosting.md +1 -1
- package/docs/guides/deployment/vercel.mdx +2 -2
- package/docs/guides/dev-tui.md +6 -6
- package/docs/guides/dynamic-capabilities.md +2 -2
- package/docs/guides/frontend/overview.mdx +5 -3
- package/docs/guides/hooks.md +4 -2
- package/docs/guides/instrumentation/agent-runs.mdx +7 -7
- package/docs/guides/instrumentation/instrumentation.mdx +22 -5
- package/docs/guides/instrumentation/otel.mdx +30 -0
- package/docs/guides/remote-agents.md +3 -4
- package/docs/guides/self-modification.md +1 -1
- package/docs/memory/custom-provider.md +1 -1
- package/docs/protocols/acp.md +1 -1
- package/docs/reference/cli.md +91 -97
- package/docs/schedules.mdx +4 -5
- package/docs/subagents/index.mdx +5 -7
- package/docs/tools/human-in-the-loop.md +4 -0
- package/docs/tools/overview.mdx +2 -0
- package/docs/tools/workflows.mdx +1 -1
- package/docs/tutorial/remember-definitions.mdx +1 -1
- package/docs/tutorial/ship-it.mdx +1 -1
- package/package.json +3 -2
- package/dist/src/cli/commands/channels.d.ts +0 -9
- package/dist/src/cli/commands/channels.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/execution/effective-output-schema.d.ts +0 -22
- package/dist/src/execution/effective-output-schema.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_connect@2.2.0_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_3fe44d656b2dcd93a04011e80966afff/node_modules/@vercel/connect/dist/connector.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/shared/run-mode.d.ts +0 -7
- package/dist/src/shared/run-mode.js +0 -1
- package/dist/src/subagents/parent-result.d.ts +0 -14
- package/dist/src/subagents/parent-result.js +0 -1
- /package/dist/src/node_modules/.pnpm/{@vercel_connect@2.2.0_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_3fe44d656b2dcd93a04011e80966afff → @vercel_connect@2.3.3_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_a37674779346d612fa7d2ca9bd316494}/node_modules/@vercel/connect/dist/index.js +0 -0
- /package/dist/src/node_modules/.pnpm/{@vercel_connect@2.2.0_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_3fe44d656b2dcd93a04011e80966afff → @vercel_connect@2.3.3_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_a37674779346d612fa7d2ca9bd316494}/node_modules/@vercel/connect/dist/internal/base-url.js +0 -0
- /package/dist/src/node_modules/.pnpm/{@vercel_connect@2.2.0_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_3fe44d656b2dcd93a04011e80966afff → @vercel_connect@2.3.3_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_a37674779346d612fa7d2ca9bd316494}/node_modules/@vercel/connect/dist/internal/default-scopes.js +0 -0
- /package/dist/src/node_modules/.pnpm/{@vercel_connect@2.2.0_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_3fe44d656b2dcd93a04011e80966afff → @vercel_connect@2.3.3_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_a37674779346d612fa7d2ca9bd316494}/node_modules/@vercel/connect/dist/internal/env.js +0 -0
- /package/dist/src/node_modules/.pnpm/{@vercel_connect@2.2.0_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_3fe44d656b2dcd93a04011e80966afff → @vercel_connect@2.3.3_@ai-sdk_mcp@2.0.52_zod@4.5.4__@auth_core@0.41.2_@chat-adapter_sla_a37674779346d612fa7d2ca9bd316494}/node_modules/@vercel/connect/dist/internal/url-validation.js +0 -0
- /package/dist/src/node_modules/.pnpm/{@vercel_oidc@3.8.8 → @vercel_oidc@3.8.9}/node_modules/@vercel/oidc/dist/auth-errors.js +0 -0
- /package/dist/src/node_modules/.pnpm/{@vercel_oidc@3.8.8 → @vercel_oidc@3.8.9}/node_modules/@vercel/oidc/dist/exchange-vercel-oidc-token.js +0 -0
- /package/dist/src/node_modules/.pnpm/{@vercel_oidc@3.8.8 → @vercel_oidc@3.8.9}/node_modules/@vercel/oidc/dist/get-context.js +0 -0
- /package/dist/src/node_modules/.pnpm/{@vercel_oidc@3.8.8 → @vercel_oidc@3.8.9}/node_modules/@vercel/oidc/dist/get-vercel-oidc-token-sync.js +0 -0
- /package/dist/src/node_modules/.pnpm/{@vercel_oidc@3.8.8 → @vercel_oidc@3.8.9}/node_modules/@vercel/oidc/dist/get-vercel-oidc-token-with-refresh.js +0 -0
- /package/dist/src/node_modules/.pnpm/{@vercel_oidc@3.8.8 → @vercel_oidc@3.8.9}/node_modules/@vercel/oidc/dist/index.js +0 -0
- /package/dist/src/node_modules/.pnpm/{@vercel_oidc@3.8.8 → @vercel_oidc@3.8.9}/node_modules/@vercel/oidc/dist/oauth.js +0 -0
- /package/dist/src/node_modules/.pnpm/{@vercel_oidc@3.8.8 → @vercel_oidc@3.8.9}/node_modules/@vercel/oidc/dist/token-error.js +0 -0
- /package/dist/src/node_modules/.pnpm/{@vercel_oidc@3.8.8 → @vercel_oidc@3.8.9}/node_modules/@vercel/oidc/dist/token-io.js +0 -0
- /package/dist/src/node_modules/.pnpm/{@vercel_oidc@3.8.8 → @vercel_oidc@3.8.9}/node_modules/@vercel/oidc/dist/verify-vercel-oidc-token.js +0 -0
|
@@ -106,18 +106,5 @@ export declare function catalogSlugs(): string[];
|
|
|
106
106
|
export declare function effectiveProtocols(declared: readonly ConnectionProtocol[] | undefined): ConnectionProtocol[];
|
|
107
107
|
/** True when a slug is a valid filesystem-derived connection name. */
|
|
108
108
|
export declare function isValidConnectionSlug(slug: string): boolean;
|
|
109
|
-
/**
|
|
110
|
-
* The `vercel connect create <service>` identifier for a Connect-backed
|
|
111
|
-
* connection: the explicit `auth.service` when set, otherwise the MCP host.
|
|
112
|
-
* Returns `undefined` when neither is available, in which case the connector
|
|
113
|
-
* must be provisioned out of band.
|
|
114
|
-
*/
|
|
115
|
-
export declare function connectorServiceForEntry(entry: Pick<ConnectionCatalogEntry, "mcp" | "auth">): string | undefined;
|
|
116
|
-
/** Canonical connector name attempted before offering discovery or creation. */
|
|
117
|
-
export declare function canonicalConnectorNameForEntry(entry: {
|
|
118
|
-
auth?: ConnectionAuthSpec;
|
|
119
|
-
}): string | undefined;
|
|
120
|
-
/** Extracts the bare host from an MCP URL, or `undefined` when unparseable. */
|
|
121
|
-
export declare function mcpServiceHost(url: string | undefined): string | undefined;
|
|
122
109
|
/** Returns the endpoint block required for a protocol, or `null` when missing. */
|
|
123
110
|
export declare function endpointForProtocol(entry: Pick<ConnectionCatalogEntry, "mcp" | "openapi">, protocol: ConnectionProtocol): McpEndpoint | OpenApiEndpoint | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{connectionEntries,connectionProtocols}from"#compiled/@eve/catalog/index.js";const SUPPORTED_PROTOCOLS=[`mcp`],CUSTOM_CONNECTION_SLUG=`custom`,CONNECTION_AUTH={"browser-use":{kind:`header`,headers:[{header:`x-browser-use-api-key`,envVar:`BROWSER_USE_API_KEY`}]},linear:{kind:`connect`,connector:`linear`,service:`mcp.linear.app`},notion:{kind:`connect`,connector:`notion`,service:`mcp.notion.com`},datadog:{kind:`connect`,connector:`datadog`,service:`mcp.datadoghq.com`},honeycomb:{kind:`connect`,connector:`honeycomb`,service:`mcp.honeycomb.io`}};function buildCatalogEntry(e,t,n){let r=CONNECTION_AUTH[e];if(r===void 0)throw Error(`Connection "${e}" is in the catalog but has no scaffolder auth overlay.`);let i={slug:e,label:t,protocols:connectionProtocols(n),description:n.description,auth:r};return n.mcp&&(i.mcp={url:n.mcp.url}),n.openapi&&(i.openapi={spec:n.openapi.spec,baseUrl:n.openapi.baseUrl}),i}const CONNECTION_CATALOG=connectionEntries().filter(e=>e.surfaces.scaffoldable).map(e=>{if(e.connection===void 0)throw Error(`Catalog connection "${e.slug}" is missing its connection identity.`);return buildCatalogEntry(e.slug,e.name,e.connection)}),CATALOG_BY_SLUG=new Map(CONNECTION_CATALOG.map(e=>[e.slug,e]));function getCatalogEntry(e){return CATALOG_BY_SLUG.get(e)}function catalogSlugs(){return CONNECTION_CATALOG.map(e=>e.slug)}function effectiveProtocols(e){let t=e===void 0||e.length===0?SUPPORTED_PROTOCOLS:e;return SUPPORTED_PROTOCOLS.filter(e=>t.includes(e))}const CONNECTION_SLUG_PATTERN=/^[a-z][a-z0-9-]{0,63}$/;function isValidConnectionSlug(e){return CONNECTION_SLUG_PATTERN.test(e)}function
|
|
1
|
+
import{connectionEntries,connectionProtocols}from"#compiled/@eve/catalog/index.js";const SUPPORTED_PROTOCOLS=[`mcp`],CUSTOM_CONNECTION_SLUG=`custom`,CONNECTION_AUTH={"browser-use":{kind:`header`,headers:[{header:`x-browser-use-api-key`,envVar:`BROWSER_USE_API_KEY`}]},linear:{kind:`connect`,connector:`linear`,service:`mcp.linear.app`},notion:{kind:`connect`,connector:`notion`,service:`mcp.notion.com`},datadog:{kind:`connect`,connector:`datadog`,service:`mcp.datadoghq.com`},honeycomb:{kind:`connect`,connector:`honeycomb`,service:`mcp.honeycomb.io`}};function buildCatalogEntry(e,t,n){let r=CONNECTION_AUTH[e];if(r===void 0)throw Error(`Connection "${e}" is in the catalog but has no scaffolder auth overlay.`);let i={slug:e,label:t,protocols:connectionProtocols(n),description:n.description,auth:r};return n.mcp&&(i.mcp={url:n.mcp.url}),n.openapi&&(i.openapi={spec:n.openapi.spec,baseUrl:n.openapi.baseUrl}),i}const CONNECTION_CATALOG=connectionEntries().filter(e=>e.surfaces.scaffoldable).map(e=>{if(e.connection===void 0)throw Error(`Catalog connection "${e.slug}" is missing its connection identity.`);return buildCatalogEntry(e.slug,e.name,e.connection)}),CATALOG_BY_SLUG=new Map(CONNECTION_CATALOG.map(e=>[e.slug,e]));function getCatalogEntry(e){return CATALOG_BY_SLUG.get(e)}function catalogSlugs(){return CONNECTION_CATALOG.map(e=>e.slug)}function effectiveProtocols(e){let t=e===void 0||e.length===0?SUPPORTED_PROTOCOLS:e;return SUPPORTED_PROTOCOLS.filter(e=>t.includes(e))}const CONNECTION_SLUG_PATTERN=/^[a-z][a-z0-9-]{0,63}$/;function isValidConnectionSlug(e){return CONNECTION_SLUG_PATTERN.test(e)}function endpointForProtocol(e,t){return t===`mcp`?e.mcp??null:e.openapi??null}export{CONNECTION_CATALOG,CUSTOM_CONNECTION_SLUG,SUPPORTED_PROTOCOLS,catalogSlugs,effectiveProtocols,endpointForProtocol,getCatalogEntry,isValidConnectionSlug};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{pinnedNodeEngineMajor}from"../../node-engine.js";import{parseChatGptModelSelection}from"../../../shared/chatgpt-model.js";import{SUPPORTED_AUTHORED_MODULE_FILE_EXTENSIONS}from"../update/module-files.js";import{pathExists,writeTextFile}from"../files.js";import{blockingCreateInPlaceEntries}from"../create-in-place.js";import{DEFAULT_CONNECT_PACKAGE_VERSION,resolveVersionToken}from"../version-tokens.js";import{applyPackageManagerWorkspaceConfiguration,isPackageManagerWorkspaceMember,patchWorkspaceRootPackageJson}from"../workspace-root.js";import{WEB_CHANNEL_TEMPLATES}from"./web-template.js";import{mkdir,readdir,stat}from"node:fs/promises";import{basename,join,resolve}from"node:path";const CURRENT_DIRECTORY_PROJECT_NAME=`.`,DEFAULT_AI_PACKAGE_VERSION=`^7.0.105`,DEFAULT_ZOD_PACKAGE_VERSION=`4.5.4`,DEFAULT_EVE_PACKAGE_CONTRACT={version:`0.
|
|
1
|
+
import{pinnedNodeEngineMajor}from"../../node-engine.js";import{parseChatGptModelSelection}from"../../../shared/chatgpt-model.js";import{SUPPORTED_AUTHORED_MODULE_FILE_EXTENSIONS}from"../update/module-files.js";import{pathExists,writeTextFile}from"../files.js";import{blockingCreateInPlaceEntries}from"../create-in-place.js";import{DEFAULT_CONNECT_PACKAGE_VERSION,resolveVersionToken}from"../version-tokens.js";import{applyPackageManagerWorkspaceConfiguration,isPackageManagerWorkspaceMember,patchWorkspaceRootPackageJson}from"../workspace-root.js";import{WEB_CHANNEL_TEMPLATES}from"./web-template.js";import{mkdir,readdir,stat}from"node:fs/promises";import{basename,join,resolve}from"node:path";const CURRENT_DIRECTORY_PROJECT_NAME=`.`,DEFAULT_AI_PACKAGE_VERSION=`^7.0.105`,DEFAULT_ZOD_PACKAGE_VERSION=`4.5.4`,DEFAULT_EVE_PACKAGE_CONTRACT={version:`0.67.1`,nodeEngine:`>=24`};function resolveEvePackageContract(e=DEFAULT_EVE_PACKAGE_CONTRACT){return{version:resolveVersionToken(`evePackage.version`,e.version),nodeEngine:resolveVersionToken(`evePackage.nodeEngine`,e.nodeEngine)}}function modelProviderSlug(e){let t=(e.split(`/`)[0]??``).replaceAll(/[^A-Za-z0-9._-]/gu,``);return t.length>0?t:`anthropic`}function byokProviderEnvVar(e){let t=modelProviderSlug(e).toUpperCase().replaceAll(/[^A-Z0-9]/gu,`_`);return`${/^[0-9]/.test(t)?`_`:``}${t}_API_KEY`}function agentTemplateFiles(e,t){return{"agent/agent.ts":renderAgentTemplate(e,t),"agent/channels/eve.ts":WEB_CHANNEL_TEMPLATES.default,"agent/instructions.md":AGENT_INSTRUCTIONS_TEMPLATE}}function renderAgentTemplate(e,t){let n=parseChatGptModelSelection(e);return n===void 0?BASE_AGENT_TEMPLATE.replaceAll(`__EVE_INIT_MODEL__`,e).replaceAll(`__EVE_INIT_REASONING__`,reasoningTemplateLine(t)):`import { defineAgent } from "eve";\nimport { chatgpt } from "eve/models/openai";\n\nexport default defineAgent({\n model: chatgpt(${JSON.stringify(n)}),\n${reasoningTemplateLine(t)}});\n`}function reasoningTemplateLine(e){return e===void 0||e===`provider-default`?``:` reasoning: "${e}",\n`}function renderTemplate(e,t){return e===BASE_AGENT_TEMPLATE&&parseChatGptModelSelection(t.model)!==void 0?renderAgentTemplate(t.model,t.reasoning):e.replaceAll(`__EVE_INIT_APP_NAME__`,t.appName).replaceAll(`__EVE_INIT_MODEL__`,t.model).replaceAll(`__EVE_INIT_REASONING__`,reasoningTemplateLine(t.reasoning)).replaceAll(`__EVE_INIT_BYOK_PROVIDER__`,modelProviderSlug(t.model)).replaceAll(`__EVE_INIT_BYOK_ENV_VAR__`,byokProviderEnvVar(t.model)).replaceAll(`__EVE_INIT_PACKAGE_VERSION__`,formatEveDependencySpecifier(t.eveVersion)).replaceAll(`__EVE_INIT_AI_SDK_VERSION__`,t.aiPackageVersion).replaceAll(`__EVE_INIT_CONNECT_VERSION__`,t.connectPackageVersion).replaceAll(`__EVE_INIT_ZOD_VERSION__`,t.zodPackageVersion).replaceAll(`__EVE_INIT_TYPESCRIPT_VERSION__`,t.typescriptPackageVersion).replaceAll(`__EVE_INIT_TYPES_NODE_VERSION__`,t.nodeTypesVersion).replaceAll(`__EVE_INIT_NODE_ENGINE__`,t.nodeEngine)}function formatEveDependencySpecifier(e){return/^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z-.]+)?$/.test(e)?`^${e}`:e}const BASE_AGENT_TEMPLATE=`import { defineAgent } from "eve";
|
|
2
2
|
|
|
3
3
|
export default defineAgent({
|
|
4
4
|
model: "__EVE_INIT_MODEL__",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{existsSync,readFileSync,realpathSync}from"node:fs";import{dirname,join}from"node:path";import{fileURLToPath}from"node:url";function versionToken(e){return`__${e}_VERSION__`}function bareToken(e){return`__${e}__`}const NODE_ENGINE_TOKEN=bareToken(`NODE_ENGINE`),DEFAULT_CONNECT_PACKAGE_VERSION=`2.2.0`,DEFAULT_MICROSANDBOX_PACKAGE_VERSION=`0.5.5`,TOKEN_SOURCES={[versionToken(`EVE_PACKAGE`)]:{kind:`eve-version`},[versionToken(`EVE_PACKAGE_DEPENDENCY`)]:{kind:`eve-version`},[NODE_ENGINE_TOKEN]:{kind:`eve-node-engine`},[versionToken(`AI_SDK`)]:{kind:`catalog`,packageName:`ai`},[versionToken(`NEXT`)]:{kind:`catalog`,packageName:`next`},[versionToken(`REACT`)]:{kind:`catalog`,packageName:`react`},[versionToken(`REACT_DOM`)]:{kind:`catalog`,packageName:`react-dom`},[versionToken(`STREAMDOWN`)]:{kind:`catalog`,packageName:`streamdown`},[versionToken(`ZOD`)]:{kind:`catalog`,packageName:`zod`},[versionToken(`TYPESCRIPT`)]:{kind:`catalog`,packageName:`typescript`},[versionToken(`TYPES_REACT`)]:{kind:`catalog`,packageName:`@types/react`},[versionToken(`TYPES_REACT_DOM`)]:{kind:`catalog`,packageName:`@types/react-dom`}},resolvedTokens=new Map;function findEvePackageRoot(){let e=dirname(realpathSync(fileURLToPath(import.meta.url)));for(;;){let t=join(e,`package.json`);if(existsSync(t)&&JSON.parse(readFileSync(t,`utf8`)).name===`eve`)return e;let n=dirname(e);if(n===e)return;e=n}}function findWorkspaceManifest(e){let t=e;for(;;){let e=join(t,`pnpm-workspace.yaml`);if(existsSync(e))return e;let n=dirname(t);if(n===t)return;t=n}}function readCatalogVersion(e,t){let n=readFileSync(e,`utf8`).split(/\r?\n/),r=!1;for(let e of n){if(/^catalog:\s*$/.test(e)){r=!0;continue}if(!r)continue;if(/^\S/.test(e))break;let n=e.match(/^\s+(?:"([^"]+)"|([\w@/.-]+)):\s*"([^"]+)"/);if(n&&(n[1]??n[2])===t)return n[3]}}function resolveTokenFromDevTree(e){let t=TOKEN_SOURCES[e];if(t!==void 0)try{let e=findEvePackageRoot();if(e===void 0||!existsSync(join(e,`scripts/stamp-version-tokens.mjs`)))return;if(t.kind===`eve-version`){let t=JSON.parse(readFileSync(join(e,`package.json`),`utf8`));return typeof t.version==`string`?t.version:void 0}if(t.kind===`eve-node-engine`){let t=JSON.parse(readFileSync(join(e,`package.json`),`utf8`)).engines?.node;return typeof t==`string`?t:void 0}let n=findWorkspaceManifest(e);return n===void 0?void 0:readCatalogVersion(n,t.packageName)}catch{return}}function resolveVersionToken(e,t){if(!t.startsWith(`__`))return t;let n=resolvedTokens.get(t);if(n!==void 0)return n;let r=resolveTokenFromDevTree(t);if(r===void 0)throw Error(`Scaffold received unstamped version token (${e}=${t}). Build eve before using its dist entrypoint.`);return resolvedTokens.set(t,r),r}export{DEFAULT_CONNECT_PACKAGE_VERSION,DEFAULT_MICROSANDBOX_PACKAGE_VERSION,resolveVersionToken};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isPathInside,workspacePatternForProject,workspacePatternsClaimProject}from"./workspace-glob.js";import{ensurePnpmWorkspaceIncludesProject,findAncestorPnpmWorkspaceRoot}from"../primitives/pm/pnpm.js";import{getPackageManagerStrategy}from"../primitives/pm/index.js";import{patchPackageJson}from"./update/package-json.js";import{readFile,writeFile}from"node:fs/promises";import{
|
|
1
|
+
import{isPathInside,workspacePatternForProject,workspacePatternsClaimProject}from"./workspace-glob.js";import{ensurePnpmWorkspaceIncludesProject,findAncestorPnpmWorkspaceRoot}from"../primitives/pm/pnpm.js";import{getPackageManagerStrategy}from"../primitives/pm/index.js";import{patchPackageJson}from"./update/package-json.js";import{readFile,writeFile}from"node:fs/promises";import{existsSync,readFileSync}from"node:fs";import{dirname,join,resolve}from"node:path";function isJsonObject(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function packageJsonWorkspacePatterns(e){let t=e.workspaces;return Array.isArray(t)?t.filter(e=>typeof e==`string`):!isJsonObject(t)||!Array.isArray(t.packages)?[]:t.packages.filter(e=>typeof e==`string`)}function readPackageJsonWorkspacePatterns(e){let t=JSON.parse(readFileSync(e,`utf8`));if(!isJsonObject(t))return;let n=packageJsonWorkspacePatterns(t);return n.length===0?void 0:n}function findAncestorPackageJsonWorkspaceRoot(e){let t=dirname(resolve(e));for(;;){let e=join(t,`package.json`);if(existsSync(e))try{if(readPackageJsonWorkspacePatterns(e)!==void 0)return t}catch{}let n=dirname(t);if(n===t)return;t=n}}function findClaimingPackageJsonWorkspaceRoot(e){let t=findAncestorPackageJsonWorkspaceRoot(e);if(t===void 0)return;let n;try{n=readPackageJsonWorkspacePatterns(join(t,`package.json`))}catch{return}return n!==void 0&&workspacePatternsClaimProject(n,t,e)?t:void 0}function findPackageManagerWorkspaceRoot(e,t){switch(e){case`pnpm`:return findAncestorPnpmWorkspaceRoot(t);case`bun`:case`npm`:case`yarn`:return findAncestorPackageJsonWorkspaceRoot(t)}}function isPackageManagerWorkspaceMember(e,t){let n=findPackageManagerWorkspaceRoot(e,t);return n!==void 0&&resolve(n)!==resolve(t)}function workspaceRootPackageJsonPath(e,t){let n=findPackageManagerWorkspaceRoot(e,t);return n===void 0?void 0:join(n,`package.json`)}async function ensurePackageJsonWorkspaceIncludesProject(e){let t=findAncestorPackageJsonWorkspaceRoot(e);if(t===void 0||resolve(t)===resolve(e)||findClaimingPackageJsonWorkspaceRoot(e)===t)return;let n=join(t,`package.json`),r=JSON.parse(await readFile(n,`utf8`)),i=workspacePatternForProject(t,e);if(Array.isArray(r.workspaces))r.workspaces=[...r.workspaces,i];else if(isJsonObject(r.workspaces)&&Array.isArray(r.workspaces.packages))r.workspaces={...r.workspaces,packages:[...r.workspaces.packages,i]};else return;return await writeFile(n,`${JSON.stringify(r,null,2)}\n`,`utf8`),n}async function ensurePackageManagerWorkspaceIncludesProject(e,t){switch(e){case`pnpm`:{let e=findAncestorPnpmWorkspaceRoot(t);return e===void 0?void 0:await ensurePnpmWorkspaceIncludesProject(t)===`written`?join(e,`pnpm-workspace.yaml`):void 0}case`bun`:case`npm`:case`yarn`:return ensurePackageJsonWorkspaceIncludesProject(t)}}async function patchWorkspaceRootPackageJson(e,t,n){if(!isPackageManagerWorkspaceMember(e,t))return{changed:!1};let r=workspaceRootPackageJsonPath(e,t);if(r===void 0||!existsSync(r))return{changed:!1};let i=await patchPackageJson(r,{nodeEngineRequirement:n.nodeEngineRequirement});return i.changed&&await n.onWorkspaceRootMutation?.({kind:`package-json`,nodeEngineOverride:i.nodeEngineOverride,path:r}),{...i,path:r}}async function applyPackageManagerWorkspaceConfiguration(e){let t=resolve(e.workspaceProbeRoot??e.projectRoot),n=e.packageManager===`pnpm`?void 0:await ensurePackageManagerWorkspaceIncludesProject(e.packageManager,t),r=await getPackageManagerStrategy(e.packageManager).applyProjectConfiguration(e.projectRoot,{workspaceProbeRoot:t}),i=[...n===void 0?[]:[n],...r.filesWritten],a=[...r.filesSkipped];for(let t of i)isPathInside(e.projectRoot,t)||await e.onWorkspaceRootMutation?.({kind:`workspace-config`,path:t});return{filesSkipped:a,filesWritten:i}}export{applyPackageManagerWorkspaceConfiguration,isPackageManagerWorkspaceMember,patchWorkspaceRootPackageJson};
|
|
@@ -3,7 +3,5 @@ import type { VercelCaptureFailure, VercelCaptureResult } from "#setup/primitive
|
|
|
3
3
|
export declare function normalizeVercelApiResult(result: VercelCaptureResult): VercelCaptureResult;
|
|
4
4
|
/** Whether a Vercel API failure proves that the requested resource does not exist. */
|
|
5
5
|
export declare function isNotFoundApiFailure(failure: VercelCaptureFailure): boolean;
|
|
6
|
-
/** Whether a Vercel API failure proves that the requested resource already exists. */
|
|
7
|
-
export declare function isConflictApiFailure(failure: VercelCaptureFailure): boolean;
|
|
8
6
|
/** Whether a scoped Vercel API request was denied. */
|
|
9
7
|
export declare function isForbiddenApiFailure(failure: VercelCaptureFailure): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z}from"#compiled/zod/index.js";const VercelApiErrorSchema=z.object({error:z.object({code:z.union([z.string(),z.number()]).optional(),message:z.string().optional()}).optional()});function apiErrorFromStdout(e){try{let t=VercelApiErrorSchema.safeParse(JSON.parse(e));return t.success?t.data.error:void 0}catch{return}}function apiFailureText(e){let t=apiErrorFromStdout(e.stdout);return`${String(t?.code??``)} ${t?.message??``} ${e.stderr}`.toLowerCase()}function normalizeVercelApiResult(e){if(!e.ok)return e;let t=apiErrorFromStdout(e.stdout);if(t===void 0)return e;let n=t.message??(t.code===void 0?void 0:String(t.code));return{ok:!1,failure:{stdout:e.stdout,stderr:``,message:`Vercel API request failed${n===void 0?``:`: ${n}`}.`}}}function isNotFoundApiFailure(e){return/(^|\W)(404|not_found)(\W|$)|not found/.test(apiFailureText(e))}function
|
|
1
|
+
import{z}from"#compiled/zod/index.js";const VercelApiErrorSchema=z.object({error:z.object({code:z.union([z.string(),z.number()]).optional(),message:z.string().optional()}).optional()});function apiErrorFromStdout(e){try{let t=VercelApiErrorSchema.safeParse(JSON.parse(e));return t.success?t.data.error:void 0}catch{return}}function apiFailureText(e){let t=apiErrorFromStdout(e.stdout);return`${String(t?.code??``)} ${t?.message??``} ${e.stderr}`.toLowerCase()}function normalizeVercelApiResult(e){if(!e.ok)return e;let t=apiErrorFromStdout(e.stdout);if(t===void 0)return e;let n=t.message??(t.code===void 0?void 0:String(t.code));return{ok:!1,failure:{stdout:e.stdout,stderr:``,message:`Vercel API request failed${n===void 0?``:`: ${n}`}.`}}}function isNotFoundApiFailure(e){return/(^|\W)(404|not_found)(\W|$)|not found/.test(apiFailureText(e))}function isForbiddenApiFailure(e){return/(^|\W)(403|forbidden|not_authorized|team_unauthorized|sso|saml)(\W|$)|not authorized/.test(apiFailureText(e))}export{isForbiddenApiFailure,isNotFoundApiFailure,normalizeVercelApiResult};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createPromptCommandOutput } from "#setup/cli/index.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { type VercelCaptureFailure } from "#setup/primitives/index.js";
|
|
3
|
+
import { type ProjectResolution } from "./project-resolution.js";
|
|
4
4
|
import type { Prompter } from "./prompter.js";
|
|
5
5
|
import type { ResolvedVercelProjectSpec, VercelProjectIdentity } from "./state.js";
|
|
6
6
|
import { type VercelProjectOperationOptions } from "./vercel-project-api.js";
|
|
@@ -23,24 +23,7 @@ export interface LinkProjectOperationOptions extends CreatedProjectFrameworkOpti
|
|
|
23
23
|
/** Configure 100% trace sampling when creating a Vercel project. */
|
|
24
24
|
traceSampling?: boolean;
|
|
25
25
|
}
|
|
26
|
-
/** Effects used to ensure an interactive Vercel project link. */
|
|
27
|
-
export interface EnsureLinkedVercelProjectDeps {
|
|
28
|
-
readProjectLink: typeof readProjectLink;
|
|
29
|
-
runVercel: typeof runVercel;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Returns the existing Vercel project link or creates one through the Vercel
|
|
33
|
-
* CLI's interactive flow. The CLI owns team and project selection.
|
|
34
|
-
*/
|
|
35
|
-
export declare function ensureLinkedVercelProject(input: {
|
|
36
|
-
projectRoot: string;
|
|
37
|
-
prompter: Prompter;
|
|
38
|
-
signal?: AbortSignal;
|
|
39
|
-
deps?: EnsureLinkedVercelProjectDeps;
|
|
40
|
-
}): Promise<NonNullable<Awaited<ReturnType<typeof readProjectLink>>>>;
|
|
41
26
|
export declare function unresolvedProject(): ProjectResolution;
|
|
42
|
-
/** Resolves the linked project id from a resolution, if any. */
|
|
43
|
-
export declare function projectIdFromResolution(project: ProjectResolution): string | undefined;
|
|
44
27
|
/** Resolves one project by exact name or id through the Vercel API. */
|
|
45
28
|
export declare function resolveProjectByNameOrId(projectRoot: string, team: string, projectNameOrId: string, options?: VercelProjectOperationOptions): Promise<VercelProjectIdentity | null>;
|
|
46
29
|
export declare function assertNewProjectNameAvailable(projectRoot: string, team: string, projectName: string, options?: VercelProjectOperationOptions): Promise<void>;
|
|
@@ -67,8 +50,6 @@ export declare function requireVercelAuth(failure: VercelCaptureFailure): never;
|
|
|
67
50
|
* not-authenticated diagnostic.
|
|
68
51
|
*/
|
|
69
52
|
export type VercelAuthStatus = "authenticated" | "logged-out" | "cli-missing" | "unavailable";
|
|
70
|
-
/** Returns the user-facing reason Vercel-backed setup is unavailable. */
|
|
71
|
-
export declare function vercelAuthBlockerReason(authStatus: VercelAuthStatus): string | undefined;
|
|
72
53
|
export declare function getVercelAuthStatus(projectRoot: string, options?: VercelProjectOperationOptions): Promise<VercelAuthStatus>;
|
|
73
54
|
/**
|
|
74
55
|
* Ensures Vercel authentication before any provisioning. `vercel whoami` exits
|
|
Binary file
|
|
@@ -21,6 +21,7 @@ export interface InspectVerifiedRemoteAgentDeps {
|
|
|
21
21
|
* before inspection is retried.
|
|
22
22
|
*/
|
|
23
23
|
export declare function inspectVerifiedRemoteAgent(input: {
|
|
24
|
+
readonly headers?: Readonly<Record<string, string>>;
|
|
24
25
|
readonly serverUrl: string;
|
|
25
26
|
readonly workspaceRoot: string;
|
|
26
27
|
readonly prompter?: Prompter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Client,ClientError}from"#client/index.js";import{WizardCancelledError}from"#setup/step.js";import{resolveVerifiedRemoteDevelopmentClient}from"#setup/verified-remote-client.js";import{runRemoteAuthFlow}from"#cli/dev/tui/remote-auth.js";const defaultDeps={createClient:e=>new Client(e),resolveVerifiedRemoteDevelopmentClient,runRemoteAuthFlow};async function inspectVerifiedRemoteAgent(e){let t={...defaultDeps,...e.deps},n=await t.resolveVerifiedRemoteDevelopmentClient({serverUrl:e.serverUrl,signal:e.signal,workspaceRoot:e.workspaceRoot});try{return inspection(await t.createClient(n.options).info(),verifiedScope(n))}catch(t){if(e.prompter===void 0||!isAuthenticationFailure(t)||!canAuthenticateInteractively(t,n))throw t}let r=await t.runRemoteAuthFlow({configureTrustedSources:!0,prompter:e.prompter,serverUrl:e.serverUrl,signal:e.signal,workspaceRoot:e.workspaceRoot});if(r.kind===`cancelled`)throw new WizardCancelledError;if(r.kind===`failed`)throw Error(r.message);let i={...n.options,auth:{vercelOidc:{token:r.resolveToken}},host:e.serverUrl,redirect:`manual`};return inspection(await t.createClient(i).info(),r.target.deployment.ownerId)}function inspection(e,t){return t===void 0?{info:e}:{info:e,vercelScope:t}}function verifiedScope(e){let t=e.deploymentResolution;return t?.kind===`resolved`?t.target.deployment.ownerId:void 0}function isAuthenticationFailure(e){return e instanceof ClientError&&(e.status>=300&&e.status<400||e.status===401||e.status===403)}function canAuthenticateInteractively(e,t){return e.status>=300&&e.status<400&&(e.headers.location??``).includes(`vercel.com/sso-api`)?!0:t.deploymentResolution?.kind===`resolved`||t.deploymentResolution?.kind===`forbidden`}export{inspectVerifiedRemoteAgent};
|
|
1
|
+
import{Client,ClientError}from"#client/index.js";import{WizardCancelledError}from"#setup/step.js";import{resolveVerifiedRemoteDevelopmentClient}from"#setup/verified-remote-client.js";import{runRemoteAuthFlow}from"#cli/dev/tui/remote-auth.js";const defaultDeps={createClient:e=>new Client(e),resolveVerifiedRemoteDevelopmentClient,runRemoteAuthFlow};async function inspectVerifiedRemoteAgent(e){let t={...defaultDeps,...e.deps},n=await t.resolveVerifiedRemoteDevelopmentClient({headers:e.headers,serverUrl:e.serverUrl,signal:e.signal,workspaceRoot:e.workspaceRoot});try{return inspection(await t.createClient(n.options).info(),verifiedScope(n))}catch(t){if(e.prompter===void 0||!isAuthenticationFailure(t)||!canAuthenticateInteractively(t,n))throw t}let r=await t.runRemoteAuthFlow({configureTrustedSources:!0,prompter:e.prompter,serverUrl:e.serverUrl,signal:e.signal,workspaceRoot:e.workspaceRoot});if(r.kind===`cancelled`)throw new WizardCancelledError;if(r.kind===`failed`)throw Error(r.message);let i={...n.options,auth:{vercelOidc:{token:r.resolveToken}},headers:e.headers,host:e.serverUrl,redirect:`manual`};return inspection(await t.createClient(i).info(),r.target.deployment.ownerId)}function inspection(e,t){return t===void 0?{info:e}:{info:e,vercelScope:t}}function verifiedScope(e){let t=e.deploymentResolution;return t?.kind===`resolved`?t.target.deployment.ownerId:void 0}function isAuthenticationFailure(e){return e instanceof ClientError&&(e.status>=300&&e.status<400||e.status===401||e.status===403)}function canAuthenticateInteractively(e,t){return e.status>=300&&e.status<400&&(e.headers.location??``).includes(`vercel.com/sso-api`)?!0:t.deploymentResolution?.kind===`resolved`||t.deploymentResolution?.kind===`forbidden`}export{inspectVerifiedRemoteAgent};
|
|
@@ -187,8 +187,8 @@ declare const runtimeToolResultActionResultSchema: z.ZodObject<{
|
|
|
187
187
|
* turn. The parent settles the agent handle from `outcome.kind` and folds
|
|
188
188
|
* `outcome.usageDelta` into its session totals; `output`/`isError` remain
|
|
189
189
|
* the tool-result projection shown to the model. Every producer states the
|
|
190
|
-
* envelope explicitly
|
|
191
|
-
*
|
|
190
|
+
* envelope explicitly, so the parent never infers lifecycle from an absent
|
|
191
|
+
* field. `usage`
|
|
192
192
|
* carries the turn's token spend so the caller can attribute the
|
|
193
193
|
* subagent's tokens.
|
|
194
194
|
*
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { CallSettings, LanguageModel } from "ai";
|
|
2
|
-
import type { StandardJSONSchemaV1 } from "#compiled/@standard-schema/spec/index.js";
|
|
3
2
|
import type { JsonObject } from "#shared/json.js";
|
|
4
3
|
import type { ModuleSourceRef } from "#shared/source-ref.js";
|
|
5
4
|
import { type DynamicResolveContext, type DynamicSentinel } from "#dynamic/definition.js";
|
|
@@ -286,7 +285,6 @@ export type InternalAgentDefinition = {
|
|
|
286
285
|
defaultTools?: boolean;
|
|
287
286
|
experimental?: AgentExperimentalDefinition;
|
|
288
287
|
model: InternalAgentModelDefinition;
|
|
289
|
-
outputSchema?: JsonObject;
|
|
290
288
|
reasoning?: AgentReasoningDefinition;
|
|
291
289
|
source?: ModuleSourceRef;
|
|
292
290
|
tool?: boolean;
|
|
@@ -336,13 +334,6 @@ type PublicAgentDefinitionBase = {
|
|
|
336
334
|
* in workflow tools.
|
|
337
335
|
*/
|
|
338
336
|
readonly tool?: boolean;
|
|
339
|
-
/**
|
|
340
|
-
* Optional structured return type used when this agent runs in task mode
|
|
341
|
-
* (for example as a subagent, schedule, or remote job). Interactive
|
|
342
|
-
* conversation turns ignore this field unless the client supplies a
|
|
343
|
-
* per-message output schema.
|
|
344
|
-
*/
|
|
345
|
-
readonly outputSchema?: StandardJSONSchemaV1<unknown, unknown> | JsonObject;
|
|
346
337
|
};
|
|
347
338
|
/**
|
|
348
339
|
* Shared public definition for an agent. Static models may carry definition-level
|
|
@@ -20,7 +20,7 @@ export type AgentTurnResult = {
|
|
|
20
20
|
* `parked` means the child session survived the turn and can accept another
|
|
21
21
|
* delivery; `terminal` means the child session ended with this turn. The
|
|
22
22
|
* lifecycle is carried explicitly: a failed turn can leave the child parked,
|
|
23
|
-
* and a succeeded turn can be terminal
|
|
23
|
+
* and a succeeded turn can be terminal. Consumers must never
|
|
24
24
|
* infer lifecycle from success or error codes.
|
|
25
25
|
*
|
|
26
26
|
* `usageDelta` is the provider-reported usage this turn added to the child's
|
|
@@ -91,8 +91,8 @@ export interface GenericChannelDefinition<TEvents, TState = undefined, TCtx = vo
|
|
|
91
91
|
readonly metadata?: (state: NonNullable<TState>) => TMetadata;
|
|
92
92
|
/**
|
|
93
93
|
* Classifies who can observe the originating conversation. The hook runs
|
|
94
|
-
* after route auth with channel state, the authenticated principal,
|
|
95
|
-
*
|
|
94
|
+
* after route auth with channel state, the authenticated principal, and
|
|
95
|
+
* deployment environment. Return `"unknown"` when classification is not
|
|
96
96
|
* confident; consumers treat it as non-public.
|
|
97
97
|
*/
|
|
98
98
|
readonly audience?: (input: AudienceContext<TState>) => ChannelAudience;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { InstrumentationChannelKind } from "#public/channels/index.js";
|
|
2
2
|
import { ContextKey } from "#context/key.js";
|
|
3
3
|
import { type ChannelAudience } from "#shared/channel-audience.js";
|
|
4
|
-
import type { RunMode } from "#shared/run-mode.js";
|
|
5
4
|
import type { ForwardedTraceAssertion } from "#shared/forwarded-trace-policy.js";
|
|
6
5
|
export type ConversationEnvironment = "development" | "preview" | "production";
|
|
7
6
|
export interface ConversationContext {
|
|
@@ -10,7 +9,6 @@ export interface ConversationContext {
|
|
|
10
9
|
readonly name?: string;
|
|
11
10
|
};
|
|
12
11
|
readonly audience: ChannelAudience;
|
|
13
|
-
readonly mode: RunMode;
|
|
14
12
|
readonly environment: ConversationEnvironment;
|
|
15
13
|
readonly principalType: string;
|
|
16
14
|
}
|
|
@@ -34,7 +32,6 @@ export interface AudienceInput<TState> {
|
|
|
34
32
|
/** @deprecated Use `caller`; it excludes `principalId`, `issuer`, and `subject`. */
|
|
35
33
|
readonly auth: AudiencePrincipal | null;
|
|
36
34
|
readonly channel: ConversationContext["channel"];
|
|
37
|
-
readonly mode: RunMode;
|
|
38
35
|
readonly environment: ConversationEnvironment;
|
|
39
36
|
}
|
|
40
37
|
/** Preferred input type for new audience callback annotations. */
|
|
@@ -47,7 +44,6 @@ export interface ConversationContextFallback {
|
|
|
47
44
|
readonly channelKind?: string;
|
|
48
45
|
readonly environment: ConversationEnvironment;
|
|
49
46
|
readonly forwardedTracePolicy?: ForwardedTraceAssertion;
|
|
50
|
-
readonly mode?: RunMode;
|
|
51
47
|
readonly principalType?: string;
|
|
52
48
|
}
|
|
53
49
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{normalizeChannelAudience}from"#shared/channel-audience.js";import{isNonEmptyString}from"#shared/guards.js";import{normalizeInstrumentationChannelKind}from"#shared/instrumentation-channel-kind.js";import{ContextKey}from"#context/key.js";const UNKNOWN_CONVERSATION_CONTEXT={audience:`unknown`,channel:{kind:`unknown`},environment:`production`,
|
|
1
|
+
import{normalizeChannelAudience}from"#shared/channel-audience.js";import{isNonEmptyString}from"#shared/guards.js";import{normalizeInstrumentationChannelKind}from"#shared/instrumentation-channel-kind.js";import{ContextKey}from"#context/key.js";const UNKNOWN_CONVERSATION_CONTEXT={audience:`unknown`,channel:{kind:`unknown`},environment:`production`,principalType:`anonymous`};function resolveConversationContext(e,t,n={}){return e===void 0?{...UNKNOWN_CONVERSATION_CONTEXT,audience:t.forwardedTracePolicy?.originAudience??`unknown`,channel:{kind:normalizeInstrumentationChannelKind(t.channelKind)},environment:t.environment,principalType:t.principalType??`anonymous`}:!n.forwardedOverridesStored||t.forwardedTracePolicy===void 0?e:{...e,audience:t.forwardedTracePolicy.originAudience}}const ConversationContextKey=new ContextKey(`eve.conversation`,{codec:{serialize:e=>e,deserialize:e=>{if(typeof e!=`object`||!e||Array.isArray(e))return UNKNOWN_CONVERSATION_CONTEXT;let t=normalizeConversationContext(e);return t===void 0?UNKNOWN_CONVERSATION_CONTEXT:t}}});function normalizeConversationContext(e){if(typeof e!=`object`||!e||Array.isArray(e))return;let t=e,n=normalizeConversationChannel(t.channel),r=t.environment,i=t.principalType;if(!(n===void 0||r!==`development`&&r!==`preview`&&r!==`production`||!isNonEmptyString(i)))return{audience:normalizeChannelAudience(t.audience),channel:n,environment:r,principalType:i}}function normalizeConversationChannel(e){if(typeof e!=`object`||!e||Array.isArray(e))return;let t=e;return{kind:normalizeInstrumentationChannelKind(typeof t.kind==`string`?t.kind:void 0),name:isNonEmptyString(t.name)?t.name:void 0}}export{ConversationContextKey,UNKNOWN_CONVERSATION_CONTEXT,normalizeConversationContext,resolveConversationContext};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{contextStorage}from"#context/container.js";import{ConversationIdKey}from"#context/keys.js";const MAX_ID_BYTES=1024,encoder=new TextEncoder;function readConversationId(e){if(!(typeof e!=`string`||e.length===0||e.length>MAX_ID_BYTES||/[\u0000-\u001f\u007f-\u009f\u2028\u2029]/u.test(e)||encoder.encode(e).byteLength>MAX_ID_BYTES))try{return e}catch{return}}function resolveConversationId(e){return readConversationId(contextStorage.getStore()?.get(ConversationIdKey))??e}export{readConversationId,resolveConversationId};
|
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
import type { SandboxSession } from "#shared/sandbox-session.js";
|
|
2
2
|
export declare const MODEL_SKILL_ROOT = "$HOME/.agents/skills";
|
|
3
3
|
export declare const FALLBACK_SKILL_ROOT = "/workspace/skills";
|
|
4
|
-
export declare function formatSkillModelPath(input: {
|
|
5
|
-
readonly name: string;
|
|
6
|
-
readonly relativePath: string;
|
|
7
|
-
}): string;
|
|
8
|
-
export declare function formatFallbackSkillPath(input: {
|
|
9
|
-
readonly name: string;
|
|
10
|
-
readonly relativePath: string;
|
|
11
|
-
}): string;
|
|
12
4
|
/**
|
|
13
5
|
* Resolves where skills live in the sandbox: under the probed home when it has
|
|
14
6
|
* one, and under {@link FALLBACK_SKILL_ROOT} when it does not.
|
|
@@ -26,11 +18,6 @@ export declare function resolveSandboxModelPath(input: {
|
|
|
26
18
|
readonly path: string;
|
|
27
19
|
readonly sandbox: SandboxSession;
|
|
28
20
|
}): Promise<string>;
|
|
29
|
-
export declare function resolveSandboxSkillReadPaths(input: {
|
|
30
|
-
readonly name: string;
|
|
31
|
-
readonly relativePath: string;
|
|
32
|
-
readonly sandbox: SandboxSession;
|
|
33
|
-
}): Promise<readonly string[]>;
|
|
34
21
|
export declare function resolveSandboxSkillWritePath(input: {
|
|
35
22
|
readonly name: string;
|
|
36
23
|
readonly relativePath: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const MODEL_HOME_ROOT=`$HOME`,MODEL_SKILL_ROOT=`${MODEL_HOME_ROOT}/.agents/skills`,FALLBACK_SKILL_ROOT=`/workspace/skills`,sandboxHomeCache=new WeakMap;
|
|
2
|
-
`)&&!e.includes(`\r`)}function normalizeSandboxHome(e){return e===`/`?e:e.replace(/\/+$/,``)}export{FALLBACK_SKILL_ROOT,MODEL_SKILL_ROOT,
|
|
1
|
+
const MODEL_HOME_ROOT=`$HOME`,MODEL_SKILL_ROOT=`${MODEL_HOME_ROOT}/.agents/skills`,FALLBACK_SKILL_ROOT=`/workspace/skills`,sandboxHomeCache=new WeakMap;async function resolveSandboxSkillRoot(e){return await resolveSandboxModelPath({path:MODEL_SKILL_ROOT,sandbox:e.sandbox})}async function resolveSandboxModelPath(e){if(!isModelHomePath(e.path))return e.path;let t=await resolveSandboxHome(e.sandbox);if(t!==null){let n=e.path.slice(5);return n.length===0?t:`${t===`/`?``:t}${n}`}return isModelSkillPath(e.path)?`${FALLBACK_SKILL_ROOT}${e.path.slice(MODEL_SKILL_ROOT.length)}`:e.path}async function resolveSandboxSkillWritePath(e){return formatSkillPath({name:e.name,relativePath:e.relativePath,root:await resolveSandboxSkillRoot({sandbox:e.sandbox})})}function formatSkillPath(e){return`${e.root}/${e.name}/${e.relativePath}`}async function resolveSandboxHome(e){let t=sandboxHomeCache.get(e);if(t!==void 0)return await t;let n=probeSandboxHome(e);return sandboxHomeCache.set(e,n),await n}async function probeSandboxHome(e){try{let t=await e.run({command:`printf '%s\\n' "$HOME"`});if(t.exitCode!==0)return null;let n=t.stdout.trim();return isUsableSandboxHome(n)?normalizeSandboxHome(n):null}catch{return null}}function isModelHomePath(e){return e===MODEL_HOME_ROOT||e.startsWith(`${MODEL_HOME_ROOT}/`)}function isModelSkillPath(e){return e===MODEL_SKILL_ROOT||e.startsWith(`${MODEL_SKILL_ROOT}/`)}function isUsableSandboxHome(e){return e.length>0&&e.startsWith(`/`)&&!e.includes(`\0`)&&!e.includes(`
|
|
2
|
+
`)&&!e.includes(`\r`)}function normalizeSandboxHome(e){return e===`/`?e:e.replace(/\/+$/,``)}export{FALLBACK_SKILL_ROOT,MODEL_SKILL_ROOT,resolveSandboxModelPath,resolveSandboxSkillRoot,resolveSandboxSkillWritePath};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function validateAuthorizationSpec(e,t=`auth`){if(typeof e!=`object`||!e)return`The "${t}" field must be an object with a "getToken" method.`;let n=e;if(typeof n.getToken!=`function`)return`The "${t}.getToken" field must be a function returning Promise<{ token }>.`;let r=n.startAuthorization!==void 0,i=n.completeAuthorization!==void 0,a=n.credentialOwner!==void 0,o=n.principalType!==void 0;if(a&&o)return`The "${t}" field must not provide both "credentialOwner" and "principalType".`;let s=a?`credentialOwner`:`principalType`,c=a?n.credentialOwner:n.principalType;if(c!==void 0&&c!==`app`&&c!==`user`)return`The "${t}.${s}" field must be "app" or "user".`;if(r!==i)return`The "${t}" field must provide either both "startAuthorization" and "completeAuthorization" (interactive OAuth) or neither (getToken-only). Got only "${r?`startAuthorization`:`completeAuthorization`}".`;if(r&&typeof n.startAuthorization!=`function`)return`The "${t}.startAuthorization" field must be a function when provided.`;if(i&&typeof n.completeAuthorization!=`function`)return`The "${t}.completeAuthorization" field must be a function when provided.`;if(r&&a)return`The "${t}.credentialOwner" field is only supported by getToken-only authorization. Interactive authorization is restricted to "principalType": "user" in v1.`;if(r&&n.principalType!==`user`)return`Interactive authorization (startAuthorization + completeAuthorization) is restricted to "principalType": "user" in v1. App-level credentials must use a getToken-only definition.`;if(n.displayName!==void 0&&(typeof n.displayName!=`string`||n.displayName.length===0))return`The "${t}.displayName" field must be a non-empty string when provided.`}function normalizeAuthorizationSpec(e,t,n=`auth`){let r=validateAuthorizationSpec(e,n);if(r!==void 0)throw Error(`${t} ${r}`);let i=e,a=
|
|
1
|
+
import{extractVercelConnectMetadata}from"#shared/vercel-connect-metadata.js";function validateAuthorizationSpec(e,t=`auth`){if(typeof e!=`object`||!e)return`The "${t}" field must be an object with a "getToken" method.`;let n=e;if(typeof n.getToken!=`function`)return`The "${t}.getToken" field must be a function returning Promise<{ token }>.`;let r=n.startAuthorization!==void 0,i=n.completeAuthorization!==void 0,a=n.credentialOwner!==void 0,o=n.principalType!==void 0;if(a&&o)return`The "${t}" field must not provide both "credentialOwner" and "principalType".`;let s=a?`credentialOwner`:`principalType`,c=a?n.credentialOwner:n.principalType;if(c!==void 0&&c!==`app`&&c!==`user`)return`The "${t}.${s}" field must be "app" or "user".`;if(r!==i)return`The "${t}" field must provide either both "startAuthorization" and "completeAuthorization" (interactive OAuth) or neither (getToken-only). Got only "${r?`startAuthorization`:`completeAuthorization`}".`;if(r&&typeof n.startAuthorization!=`function`)return`The "${t}.startAuthorization" field must be a function when provided.`;if(i&&typeof n.completeAuthorization!=`function`)return`The "${t}.completeAuthorization" field must be a function when provided.`;if(r&&a)return`The "${t}.credentialOwner" field is only supported by getToken-only authorization. Interactive authorization is restricted to "principalType": "user" in v1.`;if(r&&n.principalType!==`user`)return`Interactive authorization (startAuthorization + completeAuthorization) is restricted to "principalType": "user" in v1. App-level credentials must use a getToken-only definition.`;if(n.displayName!==void 0&&(typeof n.displayName!=`string`||n.displayName.length===0))return`The "${t}.displayName" field must be a non-empty string when provided.`}function normalizeAuthorizationSpec(e,t,n=`auth`){let r=validateAuthorizationSpec(e,n);if(r!==void 0)throw Error(`${t} ${r}`);let i=e,a=extractVercelConnectMetadata(i.vercelConnect),o=i.displayName,s=typeof i.evict==`function`?i.evict:void 0;if(i.startAuthorization!==void 0&&i.completeAuthorization!==void 0){let e={completeAuthorization:i.completeAuthorization,getToken:i.getToken,principalType:`user`,startAuthorization:i.startAuthorization};return a!==void 0&&(e={...e,vercelConnect:a}),o!==void 0&&(e={...e,displayName:o}),s!==void 0&&(e={...e,evict:s}),e}let c={getToken:i.getToken,principalType:i.credentialOwner??i.principalType??`app`};return a!==void 0&&(c={...c,vercelConnect:a}),o!==void 0&&(c={...c,displayName:o}),s!==void 0&&(c={...c,evict:s}),c}export{normalizeAuthorizationSpec,validateAuthorizationSpec};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface ExternalCredentialRequirement {
|
|
2
|
+
readonly method?: string;
|
|
3
|
+
readonly reference: string;
|
|
4
|
+
readonly service: string;
|
|
5
|
+
readonly subjectTypes: readonly ("app" | "user")[];
|
|
6
|
+
}
|
|
7
|
+
export interface VercelConnectMetadata {
|
|
8
|
+
readonly connector: string;
|
|
9
|
+
readonly requirement?: ExternalCredentialRequirement;
|
|
10
|
+
}
|
|
11
|
+
export declare function extractVercelConnectMetadata(value: unknown): VercelConnectMetadata | undefined;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function extractVercelConnectMetadata(e){if(typeof e!=`object`||!e)return;let{connector:t,requirement:n}=e;if(typeof t!=`string`||t.length===0)return;let r=extractCredentialRequirement(n);return r===void 0?{connector:t}:{connector:t,requirement:r}}function extractCredentialRequirement(e){if(typeof e!=`object`||!e)return;let{method:t,reference:n,service:r,subjectTypes:i}=e;if(typeof n!=`string`||n.length===0||typeof r!=`string`||r.length===0||!Array.isArray(i)||i.length===0||!i.every(e=>e===`app`||e===`user`)||t!==void 0&&(typeof t!=`string`||t.length===0))return;let a={reference:n,service:r,subjectTypes:i};return typeof t==`string`&&(a.method=t),a}export{extractVercelConnectMetadata};
|
|
@@ -23,7 +23,3 @@ export declare const SUBAGENT_START_FAILED = "SUBAGENT_START_FAILED";
|
|
|
23
23
|
export declare const SUBAGENT_EXECUTION_FAILED = "SUBAGENT_EXECUTION_FAILED";
|
|
24
24
|
/** Error code for a remote agent session that failed to start. */
|
|
25
25
|
export declare const REMOTE_AGENT_START_FAILED = "REMOTE_AGENT_START_FAILED";
|
|
26
|
-
/** Fallback error code for a remote `session.failed` callback without error detail. */
|
|
27
|
-
export declare const REMOTE_AGENT_FAILED = "REMOTE_AGENT_FAILED";
|
|
28
|
-
/** Error code a child session reports back when the whole session failed. */
|
|
29
|
-
export declare const SESSION_FAILED = "SESSION_FAILED";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const AGENT_MISMATCH=`AGENT_MISMATCH`,AGENT_UNREACHABLE=`AGENT_UNREACHABLE`,AGENT_BUSY=`AGENT_BUSY`;function formatAgentBusyMessage(e){let t=`Agent "${e.agentName}" with id "${e.agentId}" is still working on`;return e.ownerId?.startsWith(`task_`)?`${t} task "${e.ownerId}".`:`${t} ${e.ownerId===void 0?`another task`:`another invocation`}.`}const SUBAGENT_START_FAILED=`SUBAGENT_START_FAILED`,SUBAGENT_EXECUTION_FAILED=`SUBAGENT_EXECUTION_FAILED`,REMOTE_AGENT_START_FAILED=`REMOTE_AGENT_START_FAILED
|
|
1
|
+
const AGENT_MISMATCH=`AGENT_MISMATCH`,AGENT_UNREACHABLE=`AGENT_UNREACHABLE`,AGENT_BUSY=`AGENT_BUSY`;function formatAgentBusyMessage(e){let t=`Agent "${e.agentName}" with id "${e.agentId}" is still working on`;return e.ownerId?.startsWith(`task_`)?`${t} task "${e.ownerId}".`:`${t} ${e.ownerId===void 0?`another task`:`another invocation`}.`}const SUBAGENT_START_FAILED=`SUBAGENT_START_FAILED`,SUBAGENT_EXECUTION_FAILED=`SUBAGENT_EXECUTION_FAILED`,REMOTE_AGENT_START_FAILED=`REMOTE_AGENT_START_FAILED`;export{AGENT_BUSY,AGENT_MISMATCH,AGENT_UNREACHABLE,REMOTE_AGENT_START_FAILED,SUBAGENT_EXECUTION_FAILED,SUBAGENT_START_FAILED,formatAgentBusyMessage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z}from"#compiled/zod/index.js";import{isInputRequest}from"#shared/input.js";import{jsonValueSchema}from"#shared/json-schemas.js";import{resumeHook}from"#internal/workflow/runtime.js";import{
|
|
1
|
+
import{z}from"#compiled/zod/index.js";import{isInputRequest}from"#shared/input.js";import{jsonValueSchema}from"#shared/json-schemas.js";import{resumeHook}from"#internal/workflow/runtime.js";import{agentTurnOutcomeWithCostSchema}from"#shared/agent-turn-outcome.js";import{readTaskIdFromInboxToken}from"#tasks/task-inbox-token.js";const eventCoordinateSchema=z.number().int().nonnegative(),authorizationChallengeSchema=z.looseObject({displayName:z.string().optional(),expiresAt:z.string().optional(),instructions:z.string().optional(),url:z.string().optional(),userCode:z.string().optional()}),taskInputEventSchema=z.looseObject({requests:z.array(jsonValueSchema.refine(isInputRequest)).min(1),sequence:eventCoordinateSchema,stepIndex:eventCoordinateSchema,turnId:z.string()}),taskAuthorizationEventSchema=z.discriminatedUnion(`type`,[z.looseObject({data:z.looseObject({attemptId:z.string().optional(),authorization:authorizationChallengeSchema.optional(),description:z.string(),name:z.string(),sequence:eventCoordinateSchema,stepIndex:eventCoordinateSchema,turnId:z.string(),webhookUrl:z.string().optional()}),type:z.literal(`authorization.required`)}),z.looseObject({data:z.looseObject({attemptId:z.string().optional(),authorization:authorizationChallengeSchema.optional(),name:z.string(),outcome:z.enum([`authorized`,`declined`,`failed`,`timed-out`]),reason:z.string().optional(),sequence:eventCoordinateSchema,stepIndex:eventCoordinateSchema,turnId:z.string()}),type:z.literal(`authorization.completed`)})]),taskEventCallbackSchema=z.discriminatedUnion(`kind`,[z.object({callId:z.string(),childContinuationToken:z.string(),childSessionId:z.string(),event:taskInputEventSchema,kind:z.literal(`task.input-requested`),subagentName:z.string(),taskId:z.string()}),z.object({callId:z.string(),childContinuationToken:z.string(),childSessionId:z.string(),event:taskAuthorizationEventSchema,kind:z.literal(`task.authorization`),subagentName:z.string(),taskId:z.string()})]),taskTurnStartedCallbackSchema=z.object({kind:z.literal(`turn.started`),sessionId:z.string().min(1),taskId:z.string().min(1),turnId:z.string().min(1)}),sessionResultCallbackSchema=z.discriminatedUnion(`kind`,[z.object({callId:z.string().min(1),kind:z.literal(`turn.completed`),outcome:agentTurnOutcomeWithCostSchema,output:jsonValueSchema.optional(),subagentName:z.string().min(1)}),z.object({callId:z.string().min(1),error:jsonValueSchema,kind:z.literal(`turn.failed`),outcome:agentTurnOutcomeWithCostSchema,subagentName:z.string().min(1)})]);async function handleSessionCallbackRequest(e,t){let n=t.params.token;if(typeof n!=`string`||n.length===0)return Response.json({error:`Missing callback token.`,ok:!1},{status:400});let r;try{r=await e.json()}catch{return Response.json({error:`Invalid JSON body.`,ok:!1},{status:400})}let i=projectTaskEvent(r,n);if(i instanceof Response)return i;if(i!==void 0){try{await resumeHook(n,i)}catch{return Response.json({error:`Session callback not pending.`,ok:!1},{status:404})}return Response.json({ok:!0},{status:202})}let a=rejectDirectTaskTurnStarted(r,n);if(a instanceof Response)return a;if(a!==void 0){try{await resumeHook(n,a)}catch{return Response.json({error:`Session callback not pending.`,ok:!1},{status:404})}return Response.json({ok:!0},{status:202})}let o=projectSessionCallbackResult(r);if(o instanceof Response)return o;try{await resumeHook(n,{kind:`runtime-action-result`,results:[o]})}catch{return Response.json({error:`Session callback not pending.`,ok:!1},{status:404})}return Response.json({ok:!0},{status:202})}function callbackKind(e){if(typeof e==`object`&&e)return Reflect.get(e,`kind`)}function projectTaskEvent(e,t){let n=callbackKind(e);if(n!==`task.input-requested`&&n!==`task.authorization`)return;let r=taskEventCallbackSchema.safeParse(e);if(!r.success)return Response.json({error:`Invalid task event callback.`,ok:!1},{status:400});let i=r.data;if(readTaskIdFromInboxToken(t)!==void 0){let e=rejectMismatchedTaskToken(t,i.taskId);return e===void 0?Response.json({error:`Direct subagent task events are no longer accepted.`,ok:!1},{status:410}):e}return i.kind===`task.input-requested`?{callId:i.callId,childContinuationToken:i.childContinuationToken,childSessionId:i.childSessionId,event:i.event,kind:`subagent-input-request`,subagentName:i.subagentName}:{callId:i.callId,childSessionId:i.childSessionId,event:i.event,kind:`subagent-authorization-event`,subagentName:i.subagentName}}function rejectDirectTaskTurnStarted(e,t){if(callbackKind(e)!==`turn.started`)return;let n=taskTurnStartedCallbackSchema.safeParse(e);if(!n.success)return Response.json({error:`Invalid task turn-start callback.`,ok:!1},{status:400});let r=rejectMismatchedTaskToken(t,n.data.taskId);return r===void 0?Response.json({error:`Direct subagent task turn callbacks are no longer accepted.`,ok:!1},{status:410}):r}function rejectMismatchedTaskToken(e,t){return readTaskIdFromInboxToken(e)===t?void 0:Response.json({error:`Task callback token mismatch.`,ok:!1},{status:403})}function projectSessionCallbackResult(e){if(typeof e!=`object`||!e)return Response.json({error:`Expected a JSON object.`,ok:!1},{status:400});let t=callbackKind(e);if(t!==`turn.completed`&&t!==`turn.failed`)return Response.json({error:`Unsupported callback kind.`,ok:!1},{status:400});let n=sessionResultCallbackSchema.safeParse(e);if(!n.success)return Response.json({error:`Invalid session result callback.`,ok:!1},{status:400});let r=n.data;return r.kind===`turn.completed`?{callId:r.callId,kind:`subagent-result`,origin:`child`,outcome:r.outcome,output:r.output??``,subagentName:r.subagentName,usage:r.outcome.usageDelta}:{callId:r.callId,isError:!0,kind:`subagent-result`,origin:`child`,outcome:r.outcome,output:r.error,subagentName:r.subagentName}}export{handleSessionCallbackRequest};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { SubagentAuthorizationEvent } from "#channel/types.js";
|
|
2
|
-
import type { TokenUsage } from "#shared/token-usage.js";
|
|
3
2
|
import type { UnstampedMessageStreamEvent } from "#protocol/message.js";
|
|
4
3
|
/** Sends task-owned remote HITL and authorization events to the parent callback capability. */
|
|
5
4
|
export declare function fireTaskEventCallbackStep(input: {
|
|
@@ -10,24 +9,3 @@ export declare function fireTaskEventCallbackStep(input: {
|
|
|
10
9
|
type: "input.requested";
|
|
11
10
|
}>;
|
|
12
11
|
}): Promise<void>;
|
|
13
|
-
/**
|
|
14
|
-
* Sends the configured session terminal callback.
|
|
15
|
-
*
|
|
16
|
-
* Absence is a no-op. Once callback metadata is present, delivery is part of
|
|
17
|
-
* the remote delegation result path, so failures are logged and rethrown
|
|
18
|
-
* instead of being reported as a successful terminal step. Throwing is
|
|
19
|
-
* intentional: this function runs as a durable Workflow step, so rejection
|
|
20
|
-
* hands retry/failure policy back to the Workflow orchestrator rather than
|
|
21
|
-
* letting eve falsely mark the callback delivery as complete.
|
|
22
|
-
*
|
|
23
|
-
* `usage` — the session's token totals — rides along on completed
|
|
24
|
-
* callbacks so the caller can attribute this agent's spend. Failed
|
|
25
|
-
* callbacks never carry usage.
|
|
26
|
-
*/
|
|
27
|
-
export declare function fireSessionCallbackStep(input: {
|
|
28
|
-
readonly error?: unknown;
|
|
29
|
-
readonly output?: unknown;
|
|
30
|
-
readonly serializedContext: Record<string, unknown>;
|
|
31
|
-
readonly status: "completed" | "failed";
|
|
32
|
-
readonly usage?: TokenUsage;
|
|
33
|
-
}): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{parseSessionCallback}from"#channel/session-callback.js";import{postSessionCallbackRequest}from"#execution/session-callback-request.js";async function fireTaskEventCallbackStep(e){"use step";let t=parseSerializedSessionCallback(e.callback);if(t.taskId===void 0)return;let n=e.event.type===`input.requested`,r=n?`task.input-requested`:`task.authorization`,i=await postSessionCallbackRequest({body:{callId:t.callId,childContinuationToken:e.childContinuationToken,childSessionId:e.childSessionId,event:n?e.event.data:e.event,kind:r,subagentName:t.subagentName,taskId:t.taskId},url:t.url});if(!i.ok)throw Error(`Task event callback failed with HTTP ${i.status}.`)}function parseSerializedSessionCallback(e){let t=parseSessionCallback(e);if(!t.ok)throw Error(`Serialized session callback is invalid.`,{cause:t.cause});return t.callback}export{fireTaskEventCallbackStep};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{BundleKey,ChannelKey}from"#runtime/sessions/runtime-context-keys.js";import{emitTurnEpilogue,getHarnessEmissionState,setHarnessEmissionState}from"#harness/emission.js";import{deserializeContext,serializeContext}from"#context/serialize.js";import{createDurableSessionState,readDurableSession}from"#execution/durable-session-store.js";import{resolveEffectiveAgentRuntime}from"#execution/effective-agent-config.js";import{hydrateDurableSession}from"#execution/session.js";import{buildAdapterContext}from"#channel/adapter-context.js";import{withContextScope}from"#context/run-step.js";import{upsertProxyInputRequests}from"#harness/proxy-input-requests.js";import{emitProxiedInputRequest}from"#subagents/hitl-proxy.js";import{publishChannelEvent}from"#execution/publish-channel-event.js";import{reconcileSessionContinuationToken}from"#execution/reconcile-session-continuation-token.js";async function runProxySubagentEventStep(e){"use step";let t=readDurableSession(e.sessionState),n=await deserializeContext(e.serializedContext);return emitProxiedSubagentEvent({answerHook:e.answerHook,ctx:n,durableSession:t,hookPayload:e.hookPayload,sessionWritable:e.sessionWritable})}async function emitRecordedTaskInputRequestStep(e){"use step";let t=readDurableSession(e.sessionState);return await emitProxiedSubagentEvent({ctx:await deserializeContext(e.serializedContext),durableSession:t,hookPayload:{callId:e.request.taskId,childContinuationToken:e.request.replyTo,childSessionId:e.request.taskId,event:{requests:e.request.requests??[e.request.request],sequence:e.request.sequence,stepIndex:e.request.stepIndex,turnId:e.request.turnId},kind:`subagent-input-request`,subagentName:e.request.taskId},sessionWritable:e.sessionWritable,recordProxyInputRequests:!1})}async function emitProxiedSubagentEvent(e){let{ctx:t}=e,n=t.require(ChannelKey),r=t.require(BundleKey),i=resolveEffectiveAgentRuntime(r,t),a=hydrateDurableSession({compactionOverrides:{thresholdPercent:i.thresholdPercent},durable:e.durableSession,turnAgent:i.turnAgent}),o=buildAdapterContext(n,t),s=e.sessionWritable.getWriter(),c,l;try{let emit=async e=>{await publishChannelEvent({adapter:n,adapterCtx:o,ctx:t,event:e,writer:s})},r=await withContextScope(t,a,async t=>{if(e.hookPayload.kind===`subagent-authorization-event`)return await emit(e.hookPayload.event),{result:void 0,session:await closeStandaloneAuthorizationEvent({emit,eventType:e.hookPayload.event.type,session:t})};let n=await emitProxiedInputRequest({emit,hookPayload:e.hookPayload,session:t});return{result:n.entries,session:n.session}});c=r.result,l=r.session}finally{s.releaseLock()}if(e.recordProxyInputRequests!==!1&&c!==void 0&&e.hookPayload.kind===`subagent-input-request`){let t=e.answerHook;l=upsertProxyInputRequests({entries:t===void 0?c:c.map(([e,n])=>[e,{...n,answerHook:t}]),forChildContinuationToken:e.hookPayload.childContinuationToken,session:l})}let u=reconcileSessionContinuationToken(t,l);return{serializedContext:serializeContext(t),sessionState:createDurableSessionState({session:u})}}async function closeStandaloneAuthorizationEvent(e){if(e.eventType!==`authorization.required`&&e.eventType!==`authorization.completed`)return e.session;let t=getHarnessEmissionState(e.session.state),n=await emitTurnEpilogue(e.emit,t);return setHarnessEmissionState(e.session,n)}export{emitProxiedSubagentEvent,emitRecordedTaskInputRequestStep,runProxySubagentEventStep};
|
|
@@ -2,17 +2,15 @@ import type { SessionInboxAddress } from "#execution/session-inbox/address.js";
|
|
|
2
2
|
import type { DeliverPayload, SubagentInputRequestHookPayload } from "#channel/types.js";
|
|
3
3
|
import type { AnswerHookRoute, ProxyInputRequest } from "#harness/proxy-input-requests.js";
|
|
4
4
|
import type { HarnessEmitFn, HarnessSession, SessionStateMap } from "#harness/types.js";
|
|
5
|
-
import type { RunMode } from "#shared/run-mode.js";
|
|
6
5
|
import type { InputResponse } from "#shared/input.js";
|
|
7
6
|
/**
|
|
8
|
-
* Runs the parent-side work for a `subagent-input-request
|
|
9
|
-
*
|
|
10
|
-
*
|
|
7
|
+
* Runs the parent-side work for a `subagent-input-request`: emits the request
|
|
8
|
+
* and a waiting boundary on the parent stream. The returned proxy entries
|
|
9
|
+
* route the eventual response back down to the child.
|
|
11
10
|
*/
|
|
12
11
|
export declare function emitProxiedInputRequest(input: {
|
|
13
12
|
readonly emit: HarnessEmitFn;
|
|
14
13
|
readonly hookPayload: SubagentInputRequestHookPayload;
|
|
15
|
-
readonly mode: RunMode;
|
|
16
14
|
readonly session: HarnessSession;
|
|
17
15
|
}): Promise<{
|
|
18
16
|
readonly entries: readonly (readonly [requestId: string, route: ProxyInputRequest])[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createInputRequestedEvent}from"#protocol/message.js";import{resolveTextToResponse}from"#channel/resolve-text.js";import{emitTurnEpilogue,getHarnessEmissionState,setHarnessEmissionState}from"#harness/emission.js";import{getProxyInputRequests,toProxyInputRequestEntries}from"#harness/proxy-input-requests.js";import{SESSION_LIMIT_STOP_OPTION_ID}from"#harness/session-limit-continuation.js";async function emitProxiedInputRequest(e){await e.emit(createInputRequestedEvent({requests:e.hookPayload.event.requests,sequence:e.hookPayload.event.sequence,stepIndex:e.hookPayload.event.stepIndex,turnId:e.hookPayload.event.turnId}));let t=
|
|
1
|
+
import{createInputRequestedEvent}from"#protocol/message.js";import{resolveTextToResponse}from"#channel/resolve-text.js";import{emitTurnEpilogue,getHarnessEmissionState,setHarnessEmissionState}from"#harness/emission.js";import{getProxyInputRequests,toProxyInputRequestEntries}from"#harness/proxy-input-requests.js";import{SESSION_LIMIT_STOP_OPTION_ID}from"#harness/session-limit-continuation.js";async function emitProxiedInputRequest(e){await e.emit(createInputRequestedEvent({requests:e.hookPayload.event.requests,sequence:e.hookPayload.event.sequence,stepIndex:e.hookPayload.event.stepIndex,turnId:e.hookPayload.event.turnId}));let t=getHarnessEmissionState(e.session.state),n=await emitTurnEpilogue(e.emit,t);return{entries:toProxyInputRequestEntries(e.hookPayload),session:setHarnessEmissionState(e.session,n)}}function routeDeliverPayload(e){let t=getProxyInputRequests(e.state),routable=(t,n)=>n!==void 0&&e.allowRoute?.(t,n)!==!1,n=resolveMessageAgainstQuestions({enabled:e.resolveMessage===!0,entries:t,payload:e.payload,routable}),r=[...e.payload.inputResponses??[],...n.responses],i=new Map,a=[],o,bucketFor=e=>{let t=[e.childContinuationToken,e.childSessionInbox?.sessionId??``,e.childResponseUrl??`local`,e.taskId??``].join(`\0`),n=i.get(t);if(n!==void 0)return n;let r={childContinuationToken:e.childContinuationToken,dismissedRequestIds:[],parentRequestIds:[],responses:[],routes:[],...e.childSessionInbox!==void 0&&{childSessionInbox:e.childSessionInbox},...e.answerHook!==void 0&&{answerHook:e.answerHook},...e.childResponseUrl!==void 0&&{childResponseUrl:e.childResponseUrl},...e.taskId!==void 0&&{taskId:e.taskId}};return i.set(t,r),r},s=new Set;for(let e of r){let n=t.get(e.requestId);if(n===void 0||!routable(e.requestId,n)){a.push(e);continue}if(s.has(e.requestId))continue;s.add(e.requestId),n.kind===`session-limit`&&e.optionId===SESSION_LIMIT_STOP_OPTION_ID&&(o={kind:`cancel-turn`});let r=bucketFor(n);r.parentRequestIds.push(e.requestId),r.responses.push(toChildInputResponse(e,n)),r.routes.push(n)}for(let e of n.dismissedRequestIds){let n=t.get(e);n!==void 0&&bucketFor(n).dismissedRequestIds.push(e)}let c=[...i.values()].map(({answerHook:e,childContinuationToken:n,childSessionInbox:r,childResponseUrl:i,dismissedRequestIds:a,parentRequestIds:o,responses:s,routes:c,taskId:l})=>{let u=new Set(o),d=new Set([...u,...a]);for(let e of c)if(e.batch!==void 0&&batchResolves({batch:e.batch,childContinuationToken:n,entries:t,responseIds:u}))for(let t of e.batch.requestIds)d.add(t);return{childContinuationToken:n,payload:{inputResponses:s},retireRequestIds:[...d],...a.length>0&&{dismissedRequestIds:a},...r!==void 0&&{childSessionInbox:r},...e!==void 0&&{answerHook:e},...i!==void 0&&{childResponseUrl:i},...l!==void 0&&{taskId:l}}}),l={};for(let[t,r]of Object.entries(e.payload))t!==`inputResponses`&&r!==void 0&&(t===`message`&&n.consumed||(l[t]=r));return a.length>0&&(l.inputResponses=a),{forChildren:c,forSelf:Object.keys(l).length>0?l:void 0,parentAction:o}}function resolveMessageAgainstQuestions(e){let t={consumed:!1,dismissedRequestIds:[],responses:[]};if(!e.enabled||(e.payload.inputResponses?.length??0)>0||e.payload.message===void 0)return t;let n=[...e.entries].filter(([t,n])=>n.kind===`question`&&e.routable(t,n)),r=n.flatMap(([e,t])=>{let n=t.answerHook?.question??t.question;return n===void 0?[]:[{requestId:e,...n}]});if(r.length===0)return t;let[i]=r,a=n.length===1&&i!==void 0&&typeof e.payload.message==`string`?resolveTextToResponse(e.payload.message,i):void 0;return a===void 0?{consumed:!1,dismissedRequestIds:r.filter(e=>e.dismissible===!0).map(e=>e.requestId),responses:[]}:{consumed:!0,dismissedRequestIds:[],responses:[a]}}function batchResolves(e){return e.batch.approvalRequestIds.length===0||e.batch.approvalRequestIds.every(t=>{let n=e.entries.get(t);return n===void 0||!sameBatch(n,e)||e.responseIds.has(t)})}function sameBatch(e,t){return e.childContinuationToken===t.childContinuationToken&&e.batch?.requestIds.length===t.batch.requestIds.length&&e.batch.requestIds.every((e,n)=>e===t.batch.requestIds[n])}function toChildInputResponse(e,t){return t.childRequestId===void 0?e:{...e,requestId:t.childRequestId}}export{emitProxiedInputRequest,routeDeliverPayload};
|
|
@@ -17,12 +17,11 @@ export interface FormattedSubagentInvocation extends StepInput {
|
|
|
17
17
|
readonly message: string;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* share this rule.
|
|
20
|
+
* Reads the `outputSchema` a `ctx.agent()` call requested. An empty `{}`
|
|
21
|
+
* constrains nothing, but honoring it would flip the child into
|
|
22
|
+
* structured-output mode and discard its text reply, so only a non-empty
|
|
23
|
+
* object counts as a requested schema. Local and remote dispatch share this
|
|
24
|
+
* rule.
|
|
26
25
|
*/
|
|
27
26
|
export declare function normalizeRequestedOutputSchema(outputSchema: JsonValue | undefined): JsonObject | undefined;
|
|
28
27
|
type RuntimeSubagentInputFormatRequest = {
|
|
@@ -1,24 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Sends delegated task results to their parent and conversation results to
|
|
3
|
-
* the caller of each turn.
|
|
4
|
-
*/
|
|
1
|
+
/** Sends settled turn results to the caller of each turn. */
|
|
5
2
|
import type { TurnCaller } from "#channel/types.js";
|
|
6
|
-
import type { RuntimeSubagentChildResult } from "#shared/action-types.js";
|
|
7
3
|
import type { AgentTurnOutcome } from "#shared/agent-turn-outcome.js";
|
|
8
4
|
import type { TokenUsage } from "#shared/token-usage.js";
|
|
9
|
-
/**
|
|
10
|
-
* Resumes the parent owner's hook with a delegated subagent result.
|
|
11
|
-
* No-op for root sessions.
|
|
12
|
-
*
|
|
13
|
-
* `usage` — the completed child's session-total token spend — is
|
|
14
|
-
* attached to success results so the caller can attribute the
|
|
15
|
-
* subagent's tokens. Error results never carry usage.
|
|
16
|
-
*/
|
|
17
|
-
export declare function notifyDelegatedParentStep(input: {
|
|
18
|
-
readonly result: RuntimeSubagentChildResult | undefined;
|
|
19
|
-
readonly serializedContext: Record<string, unknown>;
|
|
20
|
-
readonly usage?: TokenUsage;
|
|
21
|
-
}): Promise<void>;
|
|
22
5
|
/** Settled turn payload forwarded from the owner to the caller. */
|
|
23
6
|
export interface SettledTurnNotification {
|
|
24
7
|
readonly output: unknown;
|