eve 0.44.4 → 0.45.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 +39 -0
- package/README.md +13 -12
- package/dist/src/acp/adapter.d.ts +1 -1
- package/dist/src/approval/definition.d.ts +84 -0
- package/dist/src/approval/definition.js +1 -0
- package/dist/src/{runtime/governance → channel}/auth/http-basic.d.ts +1 -1
- package/dist/src/{runtime/governance → channel}/auth/jwt-ecdsa.d.ts +1 -1
- package/dist/src/channel/auth/jwt-ecdsa.js +1 -0
- package/dist/src/{runtime/governance → channel}/auth/jwt-hmac.d.ts +1 -1
- package/dist/src/channel/auth/jwt-hmac.js +1 -0
- package/dist/src/{runtime/governance → channel}/auth/oidc.d.ts +1 -1
- package/dist/src/channel/auth/oidc.js +1 -0
- package/dist/src/{runtime/governance → channel}/auth/token-claims.d.ts +1 -1
- package/dist/src/{runtime/governance → channel}/auth/types.d.ts +1 -1
- package/dist/src/{runtime/governance → channel}/auth/vercel-oidc-project.d.ts +1 -1
- package/dist/src/channel/channel-operations.d.ts +1 -1
- package/dist/src/channel/channel-operations.js +1 -1
- package/dist/src/channel/instrumentation.d.ts +1 -0
- package/dist/src/channel/instrumentation.js +1 -1
- package/dist/src/channel/resolve-text.d.ts +1 -1
- package/dist/src/channel/routes.d.ts +1 -1
- package/dist/src/channel/session.d.ts +1 -1
- package/dist/src/channel/session.js +1 -1
- package/dist/src/channel/types.d.ts +2 -2
- package/dist/src/chunks/{use-eve-agent-BtsOXv3s.js → use-eve-agent-BH7Z6SDu.js} +397 -106
- package/dist/src/chunks/{use-eve-agent-BJwaMe5k.js → use-eve-agent-DI2j5XK8.js} +397 -106
- package/dist/src/cli/banner.js +1 -1
- package/dist/src/cli/commands/agent-instructions.js +2 -2
- package/dist/src/cli/commands/channel-add-conflicts.js +1 -1
- package/dist/src/cli/commands/extension-build.js +1 -1
- package/dist/src/cli/commands/extension-init.js +1 -1
- package/dist/src/cli/commands/info.js +1 -1
- package/dist/src/cli/commands/init.js +1 -1
- package/dist/src/cli/commands/integration-connect.d.ts +2 -0
- package/dist/src/cli/commands/integration-connect.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/tui/remote-auth.js +1 -1
- package/dist/src/cli/dev/tui/setup-selection-input.d.ts +3 -1
- package/dist/src/cli/dev/tui/setup-selection-input.js +2 -2
- package/dist/src/cli/dev/tui/terminal-renderer.js +2 -2
- package/dist/src/cli/dev/tui/traces/trace-conversation.d.ts +1 -1
- package/dist/src/cli/dev/tui/traces/trace-conversation.js +1 -1
- package/dist/src/cli/dev/tui/traces/trace-viewer-state.js +1 -1
- package/dist/src/cli/invoke/result.d.ts +1 -1
- package/dist/src/cli/ui/live-row.js +1 -1
- package/dist/src/cli/ui/output.js +1 -1
- package/dist/src/client/agent-info-schema.d.ts +1946 -302
- package/dist/src/client/agent-info-schema.js +1 -1
- package/dist/src/client/client.js +1 -1
- package/dist/src/client/eve-agent-store.d.ts +6 -5
- package/dist/src/client/eve-agent-store.js +1 -1
- package/dist/src/client/health-response-error.d.ts +5 -0
- package/dist/src/client/health-response-error.js +1 -0
- package/dist/src/client/health-schema.d.ts +7 -0
- package/dist/src/client/health-schema.js +1 -0
- package/dist/src/client/index.d.ts +6 -3
- package/dist/src/client/index.js +1 -1
- package/dist/src/client/message-action-parts.d.ts +2 -2
- package/dist/src/client/message-reducer-types.d.ts +1 -1
- package/dist/src/client/reducer.d.ts +1 -1
- package/dist/src/client/session-utils.d.ts +1 -1
- package/dist/src/client/session.d.ts +1 -1
- package/dist/src/client/session.js +1 -1
- package/dist/src/client/types.d.ts +3 -7
- package/dist/src/compiler/artifacts.d.ts +37 -11
- package/dist/src/compiler/artifacts.js +1 -1
- package/dist/src/compiler/channel-route-plan.d.ts +10 -0
- package/dist/src/compiler/channel-route-plan.js +1 -0
- package/dist/src/compiler/compile-agent.d.ts +2 -2
- package/dist/src/compiler/compile-agent.js +2 -2
- package/dist/src/compiler/compile-from-memory.d.ts +13 -52
- package/dist/src/compiler/compile-from-memory.js +1 -1
- package/dist/src/compiler/diagnostics.d.ts +38 -0
- package/dist/src/compiler/diagnostics.js +1 -0
- package/dist/src/compiler/extension-compatibility.d.ts +14 -11
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/compiler/load-binding-namespace.d.ts +9 -0
- package/dist/src/compiler/load-binding-namespace.js +1 -0
- package/dist/src/compiler/manifest.d.ts +182 -51
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/module-map.d.ts +12 -30
- package/dist/src/compiler/module-map.js +3 -3
- package/dist/src/compiler/node-source-state.d.ts +24 -0
- package/dist/src/compiler/node-source-state.js +1 -0
- package/dist/src/compiler/normalize-agent-config.d.ts +5 -1
- package/dist/src/compiler/normalize-agent-config.js +1 -1
- package/dist/src/compiler/normalize-channel.d.ts +8 -2
- package/dist/src/compiler/normalize-channel.js +1 -1
- package/dist/src/compiler/normalize-connection.d.ts +1 -1
- package/dist/src/compiler/normalize-connection.js +1 -1
- package/dist/src/compiler/normalize-helpers.d.ts +14 -4
- package/dist/src/compiler/normalize-helpers.js +1 -1
- package/dist/src/compiler/normalize-hook.d.ts +4 -11
- package/dist/src/compiler/normalize-hook.js +1 -1
- package/dist/src/compiler/normalize-instructions.d.ts +3 -3
- package/dist/src/compiler/normalize-instructions.js +1 -1
- package/dist/src/compiler/normalize-manifest-helpers.d.ts +29 -0
- package/dist/src/compiler/normalize-manifest-helpers.js +1 -0
- package/dist/src/compiler/normalize-manifest.d.ts +8 -4
- package/dist/src/compiler/normalize-manifest.js +1 -1
- package/dist/src/compiler/normalize-memory.d.ts +5 -0
- package/dist/src/compiler/normalize-memory.js +1 -0
- package/dist/src/compiler/normalize-sandbox.d.ts +1 -1
- package/dist/src/compiler/normalize-sandbox.js +1 -1
- package/dist/src/compiler/normalize-schedule.d.ts +2 -2
- package/dist/src/compiler/normalize-schedule.js +1 -1
- package/dist/src/compiler/normalize-skill.d.ts +2 -2
- package/dist/src/compiler/normalize-skill.js +1 -1
- package/dist/src/compiler/normalize-subagent.d.ts +21 -39
- package/dist/src/compiler/normalize-subagent.js +1 -1
- package/dist/src/compiler/normalize-tool.d.ts +2 -1
- package/dist/src/compiler/normalize-tool.js +1 -1
- package/dist/src/compiler/project-sources.d.ts +70 -0
- package/dist/src/compiler/project-sources.js +1 -0
- package/dist/src/compiler/remote-agent-node.d.ts +8 -0
- package/dist/src/compiler/remote-agent-node.js +1 -1
- package/dist/src/compiler/source-graph.d.ts +155 -0
- package/dist/src/compiler/source-graph.js +1 -0
- package/dist/src/compiler/validate-artifact.d.ts +17 -0
- package/dist/src/compiler/validate-artifact.js +1 -0
- package/dist/src/compiler/workspace-resources.js +1 -1
- package/dist/src/connections/errors.d.ts +125 -0
- package/dist/src/connections/errors.js +1 -0
- package/dist/src/context/build-base-tool-context.d.ts +2 -2
- package/dist/src/context/build-callback-context.d.ts +1 -1
- package/dist/src/context/build-dynamic-tools.js +1 -1
- package/dist/src/context/dynamic-instruction-lifecycle.js +1 -1
- package/dist/src/context/dynamic-resolve-context.d.ts +1 -1
- package/dist/src/context/dynamic-skill-lifecycle.js +1 -1
- package/dist/src/context/dynamic-subagent-lifecycle.d.ts +0 -2
- package/dist/src/context/dynamic-subagent-lifecycle.js +1 -1
- package/dist/src/context/dynamic-tool-lifecycle.d.ts +10 -3
- package/dist/src/context/dynamic-tool-lifecycle.js +1 -1
- package/dist/src/context/key-names.d.ts +12 -0
- package/dist/src/context/key-names.js +1 -0
- package/dist/src/context/keys.d.ts +33 -1
- package/dist/src/context/keys.js +1 -1
- package/dist/src/context/memory-event-lifecycle.d.ts +13 -0
- package/dist/src/context/memory-event-lifecycle.js +1 -0
- package/dist/src/context/memory-lifecycle.d.ts +52 -0
- package/dist/src/context/memory-lifecycle.js +1 -0
- package/dist/src/context/memory-tools.d.ts +12 -0
- package/dist/src/context/memory-tools.js +1 -0
- package/dist/src/context/providers/connection-key.d.ts +1 -1
- package/dist/src/context/providers/connection.d.ts +1 -1
- package/dist/src/context/session-context.d.ts +32 -0
- package/dist/src/discover/discover-agent.d.ts +0 -13
- package/dist/src/discover/discover-agent.js +1 -1
- package/dist/src/discover/discover-subagent.js +1 -1
- package/dist/src/discover/extensions.d.ts +6 -6
- package/dist/src/discover/extensions.js +1 -1
- package/dist/src/discover/filesystem.d.ts +2 -2
- package/dist/src/discover/filesystem.js +1 -1
- package/dist/src/discover/manifest.d.ts +9 -1
- package/dist/src/discover/manifest.js +1 -1
- package/dist/src/discover/memory.d.ts +14 -0
- package/dist/src/discover/memory.js +1 -0
- package/dist/src/discover/project.js +1 -1
- package/dist/src/dynamic/definition.d.ts +117 -0
- package/dist/src/dynamic/definition.js +1 -0
- package/dist/src/evals/autoevals-client.js +1 -1
- package/dist/src/evals/cli/eval.js +1 -1
- package/dist/src/evals/index.d.ts +1 -1
- package/dist/src/evals/match.d.ts +1 -1
- package/dist/src/evals/runner/reporters/console.js +1 -1
- package/dist/src/evals/session.d.ts +1 -1
- package/dist/src/evals/target.js +1 -1
- package/dist/src/evals/types.d.ts +1 -1
- package/dist/src/eve-channel/index.d.ts +12 -0
- package/dist/src/eve-channel/index.js +1 -0
- package/dist/src/eve-channel/request.d.ts +49 -0
- package/dist/src/eve-channel/request.js +3 -0
- package/dist/src/eve-channel/support.d.ts +34 -0
- package/dist/src/eve-channel/support.js +1 -0
- package/dist/src/eve-channel/types.d.ts +128 -0
- package/dist/src/eve-channel/types.js +1 -0
- package/dist/src/execution/agent-handle-dispatch.d.ts +1 -1
- package/dist/src/execution/agent-handle-dispatch.js +1 -1
- package/dist/src/execution/authorization-callback-match.d.ts +1 -1
- package/dist/src/execution/cancel-descendant-turns-step.js +1 -1
- package/dist/src/execution/compaction.js +1 -1
- package/dist/src/execution/connection-auth-tool-result.d.ts +1 -1
- package/dist/src/{runtime → execution}/connections/callback-route.d.ts +2 -20
- package/dist/src/execution/connections/callback-route.js +1 -0
- package/dist/src/execution/create-session-step.js +1 -1
- package/dist/src/execution/delegated-parent-notification.d.ts +2 -2
- package/dist/src/execution/delegated-parent-notification.js +1 -1
- package/dist/src/execution/delegated-parent-result.d.ts +1 -1
- package/dist/src/execution/delegated-parent-result.js +1 -1
- package/dist/src/execution/delegation-tool.d.ts +1 -1
- package/dist/src/execution/delegation-tool.js +1 -1
- package/dist/src/execution/dispatch-action-failures.d.ts +1 -1
- package/dist/src/execution/dispatch-runtime-actions-shared.d.ts +1 -2
- package/dist/src/execution/dispatch-runtime-actions-shared.js +1 -1
- package/dist/src/execution/dispatch-runtime-actions-step.js +1 -1
- package/dist/src/execution/dispatch-workflow-runtime-actions-step.d.ts +1 -1
- package/dist/src/execution/durable-session-migrations/turn-workflow.d.ts +1 -1
- package/dist/src/execution/durable-session-store.js +1 -1
- package/dist/src/execution/effective-output-schema.d.ts +2 -1
- package/dist/src/execution/eve-workflow-attributes.d.ts +6 -0
- package/dist/src/execution/eve-workflow-attributes.js +1 -1
- package/dist/src/execution/forward-turn-cancellation-step.js +1 -1
- package/dist/src/execution/history-view.d.ts +2 -2
- package/dist/src/execution/history-view.js +1 -1
- package/dist/src/execution/node-step.js +1 -1
- package/dist/src/execution/remote-agent-dispatch.d.ts +10 -8
- package/dist/src/execution/remote-agent-dispatch.js +1 -1
- package/dist/src/execution/runtime-context.js +1 -1
- package/dist/src/execution/sandbox/{bash-tool.d.ts → bash.d.ts} +2 -2
- package/dist/src/execution/sandbox/bindings/vercel-credentials.js +1 -1
- package/dist/src/execution/sandbox/glob-tool.js +1 -1
- package/dist/src/execution/sandbox/grep-tool.js +1 -1
- package/dist/src/execution/sandbox/{read-file-tool.d.ts → read-file.d.ts} +2 -2
- package/dist/src/execution/sandbox/{read-file-tool.js → read-file.js} +1 -1
- package/dist/src/execution/sandbox/{write-file-tool.d.ts → write-file.d.ts} +2 -2
- package/dist/src/execution/sandbox/write-file.js +1 -0
- package/dist/src/execution/session-callback-route.d.ts +2 -0
- package/dist/src/execution/session-callback-route.js +1 -0
- package/dist/src/execution/session-callback-step.js +1 -1
- package/dist/src/execution/session-timeout-steps.js +1 -1
- package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
- package/dist/src/execution/subagent-adapter.js +1 -1
- package/dist/src/execution/subagent-hitl-proxy.d.ts +1 -1
- package/dist/src/execution/subagent-invocation.d.ts +0 -3
- package/dist/src/execution/subagent-invocation.js +1 -1
- package/dist/src/execution/subagent-start-local.d.ts +1 -2
- package/dist/src/execution/subagent-start-local.js +1 -1
- package/dist/src/execution/subagent-start-remote.d.ts +1 -2
- package/dist/src/execution/subagent-start-remote.js +1 -1
- package/dist/src/execution/subagent-tool.d.ts +4 -8
- package/dist/src/execution/subagent-tool.js +1 -1
- package/dist/src/execution/subagent-usage-span.d.ts +1 -1
- package/dist/src/execution/task-input-response-route.d.ts +2 -0
- package/dist/src/execution/task-input-response-route.js +1 -0
- package/dist/src/execution/tasks/child/instructions.js +1 -1
- package/dist/src/execution/tasks/child/update.d.ts +1 -1
- package/dist/src/execution/tasks/child/update.js +1 -1
- package/dist/src/execution/tasks/parent/continuation-dispatch.d.ts +1 -1
- package/dist/src/execution/tasks/parent/control-shared.d.ts +1 -1
- package/dist/src/execution/tasks/parent/delegate.d.ts +2 -2
- package/dist/src/execution/tasks/parent/delegate.js +1 -1
- package/dist/src/execution/tasks/parent/dispatch-task-step.js +1 -1
- package/dist/src/execution/tasks/parent/dispatch.d.ts +3 -1
- package/dist/src/execution/tasks/parent/dispatch.js +1 -1
- package/dist/src/execution/tasks/parent/hitl-proxy-steps.js +1 -1
- package/dist/src/execution/tasks/parent/tool-execution.js +1 -1
- package/dist/src/execution/terminate-child-sessions-step.d.ts +4 -5
- package/dist/src/execution/terminate-child-sessions-step.js +1 -1
- package/dist/src/execution/tool-auth.d.ts +5 -6
- package/dist/src/execution/tool-auth.js +1 -1
- package/dist/src/execution/tools/connection-search.d.ts +1 -0
- package/dist/src/execution/tools/connection-search.js +2 -0
- package/dist/src/{runtime/framework-tools → execution/tools}/file-state.d.ts +2 -2
- package/dist/src/execution/tools/load-skill.d.ts +6 -0
- package/dist/src/execution/tools/load-skill.js +1 -0
- package/dist/src/{runtime/framework-tools → execution/tools}/subagent/local.d.ts +7 -7
- package/dist/src/execution/tools/subagent/local.js +1 -0
- package/dist/src/{runtime/framework-tools → execution/tools}/subagent/remote.d.ts +5 -5
- package/dist/src/execution/tools/subagent/remote.js +1 -0
- package/dist/src/execution/tools/tasks.d.ts +18 -0
- package/dist/src/execution/tools/tasks.js +1 -0
- package/dist/src/{runtime/framework-tools → execution/tools}/todo.d.ts +0 -2
- package/dist/src/{runtime/framework-tools → execution/tools}/todo.js +1 -2
- package/dist/src/execution/turn-control-protocol.js +1 -1
- package/dist/src/execution/web-fetch/request.js +1 -1
- package/dist/src/execution/wire/session-inbox-resume.js +1 -1
- package/dist/src/execution/wire/session-inbox-wire.v1.js +1 -1
- package/dist/src/execution/workflow-entry.js +1 -1
- package/dist/src/execution/workflow-runtime.js +1 -1
- package/dist/src/execution/workflow-steps.d.ts +1 -3
- package/dist/src/execution/workflow-steps.js +1 -1
- package/dist/src/execution/workflow-trace-context.js +1 -1
- package/dist/src/framework/host-inventory.d.ts +8 -0
- package/dist/src/framework/host-inventory.js +1 -0
- package/dist/src/framework/sources/modules/agent.d.ts +4 -0
- package/dist/src/framework/sources/modules/agent.js +1 -0
- package/dist/src/framework/sources/modules/eve-channel.d.ts +1 -0
- package/dist/src/framework/sources/modules/eve-channel.js +1 -0
- package/dist/src/framework/sources/modules/home-channel.d.ts +2 -0
- package/dist/src/framework/sources/modules/home-channel.js +1 -0
- package/dist/src/framework/sources/modules/memory-wrapper.d.ts +2 -0
- package/dist/src/framework/sources/modules/memory-wrapper.js +1 -0
- package/dist/src/framework/sources/modules/sandbox.d.ts +2 -0
- package/dist/src/framework/sources/modules/sandbox.js +1 -0
- package/dist/src/framework/sources/registry.d.ts +6 -0
- package/dist/src/framework/sources/registry.js +1 -0
- package/dist/src/harness/action-result-helpers.d.ts +1 -1
- package/dist/src/harness/advertised-tools.js +1 -1
- package/dist/src/harness/authorization.d.ts +3 -3
- package/dist/src/harness/background-tools.d.ts +2 -2
- package/dist/src/harness/channel-delivery-instrumentation.js +1 -1
- package/dist/src/harness/compaction.js +1 -1
- package/dist/src/harness/emission.d.ts +1 -1
- package/dist/src/harness/emission.js +1 -1
- package/dist/src/harness/execute-tool.d.ts +3 -3
- package/dist/src/{runtime/framework-tools → harness}/final-output.d.ts +1 -1
- package/dist/src/harness/final-output.js +1 -0
- package/dist/src/harness/handles/query.d.ts +1 -1
- package/dist/src/harness/handles/store.d.ts +8 -0
- package/dist/src/harness/handles/store.js +1 -1
- package/dist/src/harness/hitl/approval-input-requests.d.ts +1 -1
- package/dist/src/harness/hitl/approval-prompt.d.ts +1 -1
- package/dist/src/harness/hitl/pending-input-resolution.d.ts +2 -2
- package/dist/src/harness/hitl/question-input-requests.d.ts +1 -1
- package/dist/src/harness/input-extraction.d.ts +1 -1
- package/dist/src/harness/input-extraction.js +1 -1
- package/dist/src/harness/input-request-class.d.ts +1 -1
- package/dist/src/harness/input-request-resolution.d.ts +1 -1
- package/dist/src/harness/input-requests.d.ts +2 -2
- package/dist/src/harness/instrumentation/lifecycle.d.ts +3 -0
- package/dist/src/harness/instrumentation/providers.js +1 -1
- package/dist/src/harness/instrumentation/runtime.d.ts +2 -1
- package/dist/src/harness/pending-input-batches.d.ts +1 -1
- package/dist/src/harness/prepare-trace-context.d.ts +3 -0
- package/dist/src/harness/prepare-trace-context.js +1 -1
- package/dist/src/harness/provider-safety.d.ts +7 -0
- package/dist/src/harness/provider-safety.js +1 -0
- package/dist/src/{runtime/framework-tools/web-search.d.ts → harness/provider-tool-schemas.d.ts} +1 -9
- package/dist/src/harness/provider-tool-schemas.js +1 -0
- package/dist/src/harness/provider-tools.js +1 -1
- package/dist/src/harness/proxy-input-requests.d.ts +1 -1
- package/dist/src/harness/request-input-tool.d.ts +4 -0
- package/dist/src/harness/request-input-tool.js +1 -0
- package/dist/src/harness/runtime-actions.d.ts +1 -1
- package/dist/src/harness/session-limit-continuation.d.ts +1 -1
- package/dist/src/harness/step-hooks.d.ts +2 -0
- package/dist/src/harness/step-hooks.js +1 -1
- package/dist/src/harness/stream-actions.d.ts +1 -1
- package/dist/src/harness/subagent-depth.d.ts +1 -1
- package/dist/src/harness/tool-call-action.d.ts +1 -1
- package/dist/src/harness/tool-call-input-errors.d.ts +1 -1
- package/dist/src/harness/tool-loop.js +2 -2
- package/dist/src/harness/tool-model-output.d.ts +1 -1
- package/dist/src/harness/tools.d.ts +1 -1
- package/dist/src/harness/tools.js +1 -1
- package/dist/src/harness/types.d.ts +3 -9
- package/dist/src/harness/workflow-runtime-action-state.d.ts +1 -1
- package/dist/src/harness/workflow-subagent-limit.d.ts +1 -1
- package/dist/src/instrumentation/provider.d.ts +117 -0
- package/dist/src/instrumentation/provider.js +1 -0
- package/dist/src/internal/application/compiled-artifacts.js +5 -4
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/authored-definition/approval.d.ts +1 -1
- package/dist/src/internal/authored-definition/connection.js +1 -1
- package/dist/src/internal/authored-definition/core.js +1 -1
- package/dist/src/internal/authored-definition/memory.d.ts +2 -0
- package/dist/src/internal/authored-definition/memory.js +1 -0
- package/dist/src/internal/authored-definition/schema-backed.d.ts +7 -3
- package/dist/src/internal/authored-definition/schema-backed.js +1 -1
- package/dist/src/internal/authored-definition/source-identity.d.ts +17 -0
- package/dist/src/internal/authored-definition/source-identity.js +1 -0
- package/dist/src/internal/authored-module-map-loader.d.ts +1 -5
- package/dist/src/internal/authored-module-map-loader.js +1 -1
- package/dist/src/internal/dynamic-tool-rebind.d.ts +3 -0
- package/dist/src/internal/dynamic-tool-rebind.js +1 -0
- package/dist/src/internal/helpers/markdown.js +1 -1
- package/dist/src/internal/invocation/agent-invocation.d.ts +2 -2
- package/dist/src/internal/invocation/workflow-execution.d.ts +1 -1
- 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.js +1 -1
- package/dist/src/internal/nitro/host/application-route-registry.d.ts +2 -41
- package/dist/src/internal/nitro/host/application-route-registry.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 +3 -4
- package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
- package/dist/src/internal/nitro/host/dev-host-fingerprint.js +1 -1
- package/dist/src/internal/nitro/host/extension-capability-requirements.d.ts +2 -0
- package/dist/src/internal/nitro/host/extension-capability-requirements.js +1 -1
- package/dist/src/internal/nitro/host/start-development-server.js +2 -2
- package/dist/src/internal/nitro/host/start-production-server.js +3 -3
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.d.ts +9 -215
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.js +1 -1
- package/dist/src/internal/nitro/routes/agent-info/load-agent-info-data.d.ts +2 -13
- package/dist/src/internal/nitro/routes/agent-info/load-agent-info-data.js +1 -1
- package/dist/src/internal/nitro/routes/channel-dispatch.js +1 -1
- package/dist/src/internal/nitro/routes/channel-route-context.d.ts +5 -0
- package/dist/src/internal/nitro/routes/channel-route-context.js +1 -1
- package/dist/src/internal/nitro/routes/index.d.ts +0 -9
- package/dist/src/internal/nitro/routes/index.js +2 -1
- package/dist/src/internal/nitro/routes/info.js +1 -1
- package/dist/src/internal/nitro/routes/runtime-stack.d.ts +5 -5
- package/dist/src/internal/nitro/routes/runtime-stack.js +1 -1
- package/dist/src/internal/programmatic-source-loader.d.ts +2 -0
- package/dist/src/internal/programmatic-source-loader.js +1 -0
- package/dist/src/internal/runtime-registry.d.ts +3 -4
- package/dist/src/protocol/message.d.ts +3 -3
- package/dist/src/protocol/routes.d.ts +2 -0
- package/dist/src/protocol/routes.js +1 -1
- package/dist/src/public/agents/auth.d.ts +10 -6
- package/dist/src/public/agents/auth.js +1 -1
- package/dist/src/public/channels/auth.d.ts +1 -1
- package/dist/src/public/channels/auth.js +1 -1
- package/dist/src/public/channels/discord/discordChannel.js +1 -1
- package/dist/src/public/channels/discord/hitl.d.ts +1 -1
- package/dist/src/public/channels/discord/hitl.js +1 -1
- package/dist/src/public/channels/discord/inbound.d.ts +1 -0
- package/dist/src/public/channels/discord/inbound.js +1 -1
- package/dist/src/public/channels/eve.d.ts +1 -139
- package/dist/src/public/channels/eve.js +1 -3
- package/dist/src/public/channels/github/dispatch.d.ts +5 -0
- package/dist/src/public/channels/github/dispatch.js +1 -1
- package/dist/src/public/channels/github/githubChannel.js +1 -1
- package/dist/src/public/channels/github/inbound.d.ts +2 -0
- package/dist/src/public/channels/github/inbound.js +1 -1
- package/dist/src/public/channels/index.d.ts +1 -1
- package/dist/src/public/channels/index.js +1 -1
- package/dist/src/public/channels/linear/hitl.d.ts +1 -1
- package/dist/src/public/channels/linear/inbound.js +1 -1
- package/dist/src/public/channels/mcp.js +1 -1
- package/dist/src/public/channels/slack/action-status.d.ts +1 -1
- package/dist/src/public/channels/slack/hitl.d.ts +1 -1
- package/dist/src/public/channels/slack/hitl.js +1 -1
- package/dist/src/public/channels/slack/inbound.d.ts +9 -0
- package/dist/src/public/channels/slack/inbound.js +1 -1
- package/dist/src/public/channels/slack/interactions.js +1 -1
- package/dist/src/public/channels/slack/model-context.d.ts +3 -1
- package/dist/src/public/channels/slack/model-context.js +2 -2
- package/dist/src/public/channels/slack/session-operations.d.ts +1 -1
- package/dist/src/public/channels/slack/slackChannel.d.ts +1 -1
- package/dist/src/public/channels/slack/slackChannel.js +1 -1
- package/dist/src/public/channels/teams/hitl.d.ts +1 -1
- package/dist/src/public/channels/teams/hitl.js +1 -1
- package/dist/src/public/channels/teams/inbound.d.ts +2 -0
- package/dist/src/public/channels/teams/inbound.js +1 -1
- package/dist/src/public/channels/teams/teamsChannel.js +1 -1
- package/dist/src/public/channels/teams/verify.js +1 -1
- package/dist/src/public/channels/telegram/api.d.ts +15 -0
- package/dist/src/public/channels/telegram/api.js +2 -2
- package/dist/src/public/channels/telegram/authorization-callback.d.ts +10 -0
- package/dist/src/public/channels/telegram/authorization-callback.js +1 -0
- package/dist/src/public/channels/telegram/authorization.d.ts +19 -0
- package/dist/src/public/channels/telegram/authorization.js +3 -0
- package/dist/src/public/channels/telegram/defaults.d.ts +1 -0
- package/dist/src/public/channels/telegram/defaults.js +3 -3
- package/dist/src/public/channels/telegram/hitl.d.ts +1 -1
- package/dist/src/public/channels/telegram/hitl.js +1 -1
- package/dist/src/public/channels/telegram/inbound.d.ts +1 -0
- package/dist/src/public/channels/telegram/inbound.js +1 -1
- package/dist/src/public/channels/telegram/index.d.ts +1 -1
- package/dist/src/public/channels/telegram/index.js +1 -1
- package/dist/src/public/channels/telegram/state.d.ts +6 -0
- package/dist/src/public/channels/telegram/state.js +1 -0
- package/dist/src/public/channels/telegram/telegramChannel.d.ts +11 -0
- package/dist/src/public/channels/telegram/telegramChannel.js +1 -1
- package/dist/src/public/connections/errors.d.ts +1 -125
- package/dist/src/public/connections/errors.js +1 -1
- package/dist/src/public/connections/index.d.ts +2 -2
- package/dist/src/public/connections/index.js +1 -1
- package/dist/src/public/definitions/agent.d.ts +1 -1
- package/dist/src/public/definitions/agent.js +1 -1
- package/dist/src/public/definitions/approval.d.ts +2 -84
- package/dist/src/public/definitions/approval.js +1 -1
- package/dist/src/public/definitions/callback-context.d.ts +1 -32
- package/dist/src/public/definitions/connections/mcp.d.ts +1 -1
- package/dist/src/public/definitions/connections/mcp.js +1 -1
- package/dist/src/public/definitions/connections/openapi.d.ts +1 -1
- package/dist/src/public/definitions/connections/openapi.js +1 -1
- package/dist/src/public/definitions/connections/protocol.d.ts +1 -1
- package/dist/src/public/definitions/instructions.d.ts +2 -2
- package/dist/src/public/definitions/instructions.js +1 -1
- package/dist/src/public/definitions/skill.js +1 -1
- package/dist/src/public/index.d.ts +1 -1
- package/dist/src/public/instructions/index.d.ts +1 -1
- package/dist/src/public/instrumentation/provider.d.ts +1 -117
- package/dist/src/public/instrumentation/provider.js +1 -1
- package/dist/src/public/memory/index.d.ts +117 -0
- package/dist/src/public/memory/index.js +1 -0
- package/dist/src/public/memory/scope.d.ts +2 -0
- package/dist/src/public/memory/scope.js +1 -0
- package/dist/src/public/models/openai/chatgpt/auth.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/sandbox/backends/default.d.ts +1 -49
- package/dist/src/public/sandbox/backends/default.js +1 -1
- package/dist/src/public/sandbox/backends/docker.d.ts +1 -14
- package/dist/src/public/sandbox/backends/docker.js +1 -1
- package/dist/src/public/sandbox/backends/just-bash.d.ts +1 -17
- package/dist/src/public/sandbox/backends/just-bash.js +1 -1
- package/dist/src/public/sandbox/backends/microsandbox.d.ts +1 -17
- package/dist/src/public/sandbox/backends/microsandbox.js +1 -1
- package/dist/src/public/sandbox/backends/vercel.d.ts +1 -30
- package/dist/src/public/sandbox/backends/vercel.js +1 -1
- package/dist/src/public/skills/index.d.ts +3 -3
- package/dist/src/public/skills/index.js +1 -1
- package/dist/src/public/sveltekit/dev-server.js +1 -1
- package/dist/src/public/tools/approval/index.d.ts +2 -2
- package/dist/src/public/tools/approval/index.js +1 -1
- package/dist/src/public/tools/bash.d.ts +3 -0
- package/dist/src/public/tools/bash.js +1 -0
- package/dist/src/public/tools/glob.d.ts +3 -0
- package/dist/src/public/tools/glob.js +1 -0
- package/dist/src/public/tools/grep.d.ts +3 -0
- package/dist/src/public/tools/grep.js +1 -0
- package/dist/src/public/tools/index.d.ts +6 -11
- package/dist/src/public/tools/index.js +1 -1
- package/dist/src/public/tools/load-skill.d.ts +3 -0
- package/dist/src/public/tools/load-skill.js +1 -0
- package/dist/src/public/tools/read-file.d.ts +3 -0
- package/dist/src/public/tools/read-file.js +1 -0
- package/dist/src/public/{tool-result-narrowing.d.ts → tools/result.d.ts} +2 -28
- package/dist/src/public/tools/result.js +1 -0
- package/dist/src/public/tools/sleep.d.ts +1 -0
- package/dist/src/public/tools/sleep.js +1 -0
- package/dist/src/public/tools/todo.d.ts +3 -0
- package/dist/src/public/tools/todo.js +1 -0
- package/dist/src/public/tools/web-fetch.d.ts +3 -0
- package/dist/src/public/tools/web-fetch.js +1 -0
- package/dist/src/public/tools/web-search.d.ts +3 -36
- package/dist/src/public/tools/web-search.js +1 -1
- package/dist/src/public/tools/workflow.d.ts +4 -0
- package/dist/src/public/tools/workflow.js +1 -0
- package/dist/src/public/tools/write-file.d.ts +3 -0
- package/dist/src/public/tools/write-file.js +1 -0
- package/dist/src/public/types/json.d.ts +1 -28
- package/dist/src/react/use-eve-agent.d.ts +1 -0
- package/dist/src/react/use-eve-agent.js +1 -1
- package/dist/src/runtime/actions/keys.d.ts +1 -1
- package/dist/src/runtime/actions/results.d.ts +1 -1
- package/dist/src/runtime/agent/bootstrap.js +1 -1
- package/dist/src/runtime/agent/mock-model-adapter.js +1 -1
- package/dist/src/runtime/connections/authorization-tokens.d.ts +1 -1
- package/dist/src/runtime/connections/mcp-client.d.ts +1 -1
- package/dist/src/runtime/connections/mcp-client.js +1 -1
- package/dist/src/runtime/connections/openapi-client.d.ts +1 -1
- package/dist/src/runtime/connections/openapi-client.js +1 -1
- package/dist/src/runtime/connections/principal.d.ts +1 -1
- package/dist/src/runtime/connections/principal.js +1 -1
- package/dist/src/runtime/connections/registry-types.d.ts +11 -0
- package/dist/src/runtime/connections/registry.d.ts +3 -2
- package/dist/src/runtime/connections/resolve-authorization.d.ts +2 -2
- package/dist/src/runtime/connections/resolve-authorization.js +1 -1
- package/dist/src/runtime/connections/scoped-authorization.d.ts +2 -2
- package/dist/src/runtime/connections/scoped-authorization.js +1 -1
- package/dist/src/runtime/loaders/compile-metadata.js +1 -1
- package/dist/src/runtime/loaders/manifest.js +1 -1
- package/dist/src/runtime/prompt/compose.d.ts +0 -6
- package/dist/src/runtime/prompt/compose.js +1 -1
- package/dist/src/runtime/resolve-agent-graph.js +1 -1
- package/dist/src/runtime/resolve-agent.js +1 -1
- package/dist/src/runtime/resolve-connection.js +1 -1
- package/dist/src/runtime/resolve-dynamic-tool.d.ts +1 -0
- package/dist/src/runtime/resolve-dynamic-tool.js +1 -1
- package/dist/src/runtime/resolve-memory.d.ts +4 -0
- package/dist/src/runtime/resolve-memory.js +1 -0
- package/dist/src/runtime/resolve-tool.d.ts +2 -1
- package/dist/src/runtime/resolve-tool.js +1 -1
- package/dist/src/runtime/sandbox/keys.js +1 -1
- package/dist/src/runtime/sandbox/registry.d.ts +4 -20
- package/dist/src/runtime/sandbox/registry.js +1 -1
- package/dist/src/runtime/sessions/compiled-agent-cache.js +1 -1
- package/dist/src/runtime/sessions/runtime-context-keys.js +1 -1
- package/dist/src/runtime/sessions/turn.d.ts +3 -1
- package/dist/src/runtime/skills/sandbox-access.d.ts +1 -1
- package/dist/src/runtime/subagents/dynamic-agent-config.js +1 -1
- package/dist/src/runtime/subagents/dynamic-remote-agent-config.js +1 -1
- package/dist/src/runtime/subagents/registry.d.ts +0 -27
- package/dist/src/runtime/subagents/registry.js +1 -1
- package/dist/src/runtime/tools/registry.js +1 -1
- package/dist/src/runtime/types.d.ts +18 -27
- package/dist/src/sandbox/backends/default.d.ts +49 -0
- package/dist/src/sandbox/backends/default.js +1 -0
- package/dist/src/sandbox/backends/docker.d.ts +14 -0
- package/dist/src/sandbox/backends/docker.js +1 -0
- package/dist/src/sandbox/backends/just-bash.d.ts +17 -0
- package/dist/src/sandbox/backends/just-bash.js +1 -0
- package/dist/src/sandbox/backends/microsandbox.d.ts +17 -0
- package/dist/src/sandbox/backends/microsandbox.js +1 -0
- package/dist/src/sandbox/backends/vercel.d.ts +30 -0
- package/dist/src/sandbox/backends/vercel.js +1 -0
- package/dist/src/services/dev-client/runtime-artifacts.d.ts +2 -0
- package/dist/src/services/dev-client/runtime-artifacts.js +1 -1
- package/dist/src/services/dev-client.d.ts +1 -1
- package/dist/src/setup/channel-add-conflicts.js +1 -1
- package/dist/src/setup/cli/select-component.js +1 -1
- package/dist/src/setup/connection-connector.d.ts +2 -0
- package/dist/src/setup/connection-connector.js +1 -1
- package/dist/src/setup/flows/link.js +1 -1
- package/dist/src/setup/flows/model-source-change.js +1 -1
- package/dist/src/setup/flows/model.js +1 -1
- package/dist/src/setup/flows/registry.js +1 -1
- package/dist/src/setup/integrations/runner.js +1 -1
- package/dist/src/setup/prompter.js +1 -1
- package/dist/src/setup/scaffold/create/add-to-project.js +1 -1
- package/dist/src/setup/scaffold/create/project.js +2 -2
- package/dist/src/setup/scaffold/create/web-template.d.ts +10 -8
- package/dist/src/setup/scaffold/create/web-template.js +364 -120
- package/dist/src/setup/scaffold/update/channels.js +1 -1
- package/dist/src/setup/scaffold/update/connections.js +1 -1
- package/dist/src/setup/vercel-project.js +0 -0
- package/dist/src/{runtime/actions/types.d.ts → shared/action-types.d.ts} +12 -12
- package/dist/src/{runtime/actions/types.js → shared/action-types.js} +1 -1
- package/dist/src/shared/agent-definition.d.ts +3 -10
- package/dist/src/shared/agent-definition.js +1 -1
- package/dist/src/{runtime/connections/types.d.ts → shared/connection-types.d.ts} +3 -13
- package/dist/src/{runtime/input/types.d.ts → shared/input.d.ts} +1 -1
- package/dist/src/shared/input.js +1 -0
- package/dist/src/shared/instructions-definition.d.ts +2 -0
- package/dist/src/shared/instructions-definition.js +1 -1
- package/dist/src/shared/memory-definition.d.ts +2 -0
- package/dist/src/shared/memory-definition.js +1 -0
- package/dist/src/shared/memory-state.d.ts +55 -0
- package/dist/src/shared/memory-state.js +1 -0
- package/dist/src/shared/objects.d.ts +5 -0
- package/dist/src/shared/objects.js +1 -0
- package/dist/src/shared/sandbox-definition.d.ts +1 -1
- package/dist/src/shared/skill-definition.d.ts +2 -0
- package/dist/src/shared/skill-definition.js +1 -1
- package/dist/src/{execution/skills/types.d.ts → shared/skill-types.d.ts} +1 -1
- package/dist/src/shared/skill-types.js +1 -0
- package/dist/src/{runtime/connections → shared}/validate-authorization.d.ts +1 -1
- package/dist/src/shared/vercel-project.d.ts +1 -0
- package/dist/src/shared/vercel-project.js +1 -1
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.d.ts +8 -4
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/tasks/json.d.ts +4 -89
- package/dist/src/tasks/json.js +1 -1
- package/dist/src/tasks/session-index.d.ts +1 -1
- package/dist/src/tasks/task-id.d.ts +0 -1
- package/dist/src/tasks/task-id.js +1 -1
- package/dist/src/tasks/types.d.ts +1 -1
- package/dist/src/tasks/types.js +1 -1
- package/dist/src/{public/tools/approval/approval-helpers.d.ts → tools/approval/policies.d.ts} +1 -1
- package/dist/src/tools/approval/policies.js +1 -0
- package/dist/src/tools/auth.d.ts +35 -0
- package/dist/src/tools/auth.js +1 -0
- package/dist/src/{public/definitions/tool.d.ts → tools/definition.d.ts} +42 -138
- package/dist/src/tools/definition.js +1 -0
- package/dist/src/{shared/durable-dynamic-tool-callbacks.d.ts → tools/durable-callbacks.d.ts} +1 -1
- package/dist/src/tools/durable-callbacks.js +1 -0
- package/dist/src/tools/dynamic.d.ts +68 -0
- package/dist/src/tools/dynamic.js +1 -0
- package/dist/src/tools/framework/agent-contract.d.ts +8 -0
- package/dist/src/tools/framework/agent-contract.js +1 -0
- package/dist/src/tools/framework/agent.d.ts +17 -0
- package/dist/src/tools/framework/agent.js +1 -0
- package/dist/src/tools/framework/ask-question.d.ts +50 -0
- package/dist/src/tools/framework/ask-question.js +1 -0
- package/dist/src/tools/framework/connection-search.d.ts +3 -0
- package/dist/src/tools/framework/connection-search.js +1 -0
- package/dist/src/tools/framework/task-cancel.d.ts +29 -0
- package/dist/src/tools/framework/task-cancel.js +1 -0
- package/dist/src/tools/framework/task-contract.d.ts +167 -0
- package/dist/src/tools/framework/task-contract.js +1 -0
- package/dist/src/tools/framework/task-update.d.ts +9 -0
- package/dist/src/tools/framework/task-update.js +1 -0
- package/dist/src/{public/tools/output-builders.d.ts → tools/model-output.d.ts} +41 -1
- package/dist/src/tools/provided/bash.d.ts +29 -0
- package/dist/src/tools/provided/bash.js +1 -0
- package/dist/src/tools/provided/glob.d.ts +26 -0
- package/dist/src/tools/provided/glob.js +2 -0
- package/dist/src/{runtime/framework-tools → tools/provided}/grep.d.ts +10 -10
- package/dist/src/tools/provided/grep.js +2 -0
- package/dist/src/tools/provided/load-skill.d.ts +2 -0
- package/dist/src/tools/provided/load-skill.js +1 -0
- package/dist/src/tools/provided/read-file.d.ts +27 -0
- package/dist/src/tools/provided/read-file.js +2 -0
- package/dist/src/{public/tools/sleep/index.d.ts → tools/provided/sleep.d.ts} +3 -3
- package/dist/src/tools/provided/sleep.js +1 -0
- package/dist/src/tools/provided/todo.d.ts +8 -0
- package/dist/src/tools/provided/todo.js +2 -0
- package/dist/src/{runtime/framework-tools → tools/provided}/web-fetch.d.ts +5 -2
- package/dist/src/tools/provided/web-fetch.js +2 -0
- package/dist/src/tools/provided/web-search.d.ts +39 -0
- package/dist/src/tools/provided/web-search.js +1 -0
- package/dist/src/tools/provided/write-file.d.ts +23 -0
- package/dist/src/tools/provided/write-file.js +2 -0
- package/dist/src/tools/workflow.d.ts +37 -0
- package/dist/src/tools/workflow.js +1 -0
- 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-channel-delivery-instrumentation.js +1 -1
- package/dist/src/tracing/agent-otel-provider.js +2 -2
- package/dist/src/tracing/agent-otel-session-context.d.ts +1 -1
- package/dist/src/tracing/agent-otel-session-context.js +1 -1
- package/dist/src/tracing/agent-span-id-generator.d.ts +1 -0
- package/dist/src/tracing/agent-span-id-generator.js +1 -1
- package/dist/src/tracing/agent-trace-context-store.d.ts +1 -1
- package/dist/src/tracing/agent-trace-context-store.js +1 -1
- package/dist/src/tracing/agent-trace-span-processor.js +1 -1
- package/dist/src/tracing/agent-trace-state.d.ts +2 -6
- package/dist/src/tracing/agent-trace-state.js +1 -1
- package/dist/src/tracing/install-instrumentation-runtime.js +1 -1
- package/dist/src/tracing/local-trace-reader.d.ts +1 -3
- package/dist/src/tracing/local-trace-reader.js +1 -1
- package/dist/src/tracing/otel-declaration.d.ts +1 -2
- package/dist/src/tracing/otel-registration.js +1 -1
- package/dist/src/tracing/sampled-trace.d.ts +10 -2
- package/dist/src/tracing/sampled-trace.js +1 -1
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.d.ts +8 -4
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/agent-config.md +16 -4
- package/docs/channels/chat-sdk.mdx +1 -1
- package/docs/channels/discord.mdx +5 -1
- package/docs/channels/eve.mdx +19 -3
- package/docs/channels/github.mdx +2 -0
- package/docs/channels/linear.mdx +1 -1
- package/docs/channels/overview.mdx +1 -1
- package/docs/channels/slack.mdx +2 -0
- package/docs/channels/teams.mdx +1 -1
- package/docs/channels/telegram.mdx +2 -0
- package/docs/concepts/built-in-tools.md +30 -21
- package/docs/concepts/context-control.md +7 -0
- package/docs/concepts/default-harness.md +8 -0
- package/docs/concepts/sessions-runs-and-streaming.md +5 -3
- package/docs/concepts/state.md +8 -1
- package/docs/connections/overview.mdx +1 -1
- package/docs/extensions.md +8 -4
- package/docs/getting-started.mdx +9 -9
- package/docs/guides/auth-and-route-protection.md +3 -3
- package/docs/guides/client/output-schema.mdx +2 -2
- package/docs/guides/client/overview.mdx +4 -2
- package/docs/guides/dynamic-capabilities.md +3 -2
- package/docs/guides/frontend/nuxt.mdx +4 -3
- package/docs/guides/frontend/overview.mdx +21 -18
- package/docs/guides/frontend/sveltekit.mdx +4 -3
- package/docs/guides/frontend/use-eve-agent-svelte.mdx +5 -4
- package/docs/guides/frontend/use-eve-agent-vue.mdx +5 -4
- package/docs/guides/instrumentation.md +1 -0
- package/docs/guides/remote-agents.md +37 -18
- package/docs/memory.md +255 -0
- package/docs/meta.json +1 -0
- package/docs/patterns/multi-tenant-approvals.md +1 -1
- package/docs/patterns/multi-tenant-memory.md +108 -136
- package/docs/reference/cli.md +2 -4
- package/docs/reference/typescript-api.md +35 -31
- package/docs/sandbox.mdx +1 -1
- package/docs/subagents/index.mdx +11 -28
- package/docs/tools/human-in-the-loop.md +43 -2
- package/docs/tools/overview.mdx +1 -1
- package/package.json +68 -8
- package/dist/src/compiler/normalize-extension.d.ts +0 -80
- package/dist/src/compiler/normalize-extension.js +0 -1
- package/dist/src/execution/sandbox/write-file-tool.js +0 -1
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response-from-manifest.d.ts +0 -9
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response-from-manifest.js +0 -1
- package/dist/src/internal/nitro/routes/health.d.ts +0 -14
- package/dist/src/internal/nitro/routes/health.js +0 -1
- package/dist/src/node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js +0 -1
- package/dist/src/public/definitions/tool.js +0 -1
- package/dist/src/public/tool-result-narrowing.js +0 -1
- package/dist/src/public/tools/approval/approval-helpers.js +0 -1
- package/dist/src/public/tools/defaults.d.ts +0 -46
- package/dist/src/public/tools/defaults.js +0 -1
- package/dist/src/public/tools/define-bash-tool.d.ts +0 -21
- package/dist/src/public/tools/define-bash-tool.js +0 -1
- package/dist/src/public/tools/define-glob-tool.d.ts +0 -22
- package/dist/src/public/tools/define-glob-tool.js +0 -1
- package/dist/src/public/tools/define-grep-tool.d.ts +0 -22
- package/dist/src/public/tools/define-grep-tool.js +0 -1
- package/dist/src/public/tools/define-read-file-tool.d.ts +0 -21
- package/dist/src/public/tools/define-read-file-tool.js +0 -1
- package/dist/src/public/tools/define-write-file-tool.d.ts +0 -22
- package/dist/src/public/tools/define-write-file-tool.js +0 -1
- package/dist/src/public/tools/internal.d.ts +0 -13
- package/dist/src/public/tools/internal.js +0 -1
- package/dist/src/public/tools/sleep/index.js +0 -1
- package/dist/src/runtime/connections/callback-route.js +0 -1
- package/dist/src/runtime/framework-channels/index.d.ts +0 -6
- package/dist/src/runtime/framework-channels/index.js +0 -1
- package/dist/src/runtime/framework-tools/agent.d.ts +0 -29
- package/dist/src/runtime/framework-tools/agent.js +0 -1
- package/dist/src/runtime/framework-tools/ask-question.d.ts +0 -35
- package/dist/src/runtime/framework-tools/ask-question.js +0 -1
- package/dist/src/runtime/framework-tools/bash.d.ts +0 -24
- package/dist/src/runtime/framework-tools/bash.js +0 -1
- package/dist/src/runtime/framework-tools/connection-search-dynamic.d.ts +0 -19
- package/dist/src/runtime/framework-tools/connection-search-dynamic.js +0 -2
- package/dist/src/runtime/framework-tools/final-output.js +0 -1
- package/dist/src/runtime/framework-tools/glob.d.ts +0 -26
- package/dist/src/runtime/framework-tools/glob.js +0 -2
- package/dist/src/runtime/framework-tools/grep.js +0 -2
- package/dist/src/runtime/framework-tools/index.d.ts +0 -39
- package/dist/src/runtime/framework-tools/index.js +0 -1
- package/dist/src/runtime/framework-tools/read-file.d.ts +0 -27
- package/dist/src/runtime/framework-tools/read-file.js +0 -2
- package/dist/src/runtime/framework-tools/skill.d.ts +0 -12
- package/dist/src/runtime/framework-tools/skill.js +0 -1
- package/dist/src/runtime/framework-tools/subagent/local.js +0 -1
- package/dist/src/runtime/framework-tools/subagent/remote.js +0 -1
- package/dist/src/runtime/framework-tools/tasks.d.ts +0 -91
- package/dist/src/runtime/framework-tools/tasks.js +0 -1
- package/dist/src/runtime/framework-tools/web-fetch.js +0 -2
- package/dist/src/runtime/framework-tools/web-search.js +0 -1
- package/dist/src/runtime/framework-tools/write-file.d.ts +0 -23
- package/dist/src/runtime/framework-tools/write-file.js +0 -2
- package/dist/src/runtime/governance/auth/jwt-ecdsa.js +0 -1
- package/dist/src/runtime/governance/auth/jwt-hmac.js +0 -1
- package/dist/src/runtime/governance/auth/oidc.js +0 -1
- package/dist/src/runtime/input/types.js +0 -1
- package/dist/src/runtime/session-callback-route.d.ts +0 -6
- package/dist/src/runtime/session-callback-route.js +0 -1
- package/dist/src/runtime/task-input-response-route.d.ts +0 -5
- package/dist/src/runtime/task-input-response-route.js +0 -1
- package/dist/src/shared/durable-dynamic-tool-callbacks.js +0 -1
- package/dist/src/shared/dynamic-tool-definition.d.ts +0 -154
- package/dist/src/shared/dynamic-tool-definition.js +0 -1
- package/dist/src/shared/eve-server-health.d.ts +0 -5
- package/dist/src/shared/eve-server-health.js +0 -1
- package/dist/src/shared/tool-definition.d.ts +0 -89
- /package/dist/src/{runtime/governance → channel}/auth/http-basic.js +0 -0
- /package/dist/src/{runtime/governance → channel}/auth/token-claims.js +0 -0
- /package/dist/src/{runtime/governance → channel}/auth/types.js +0 -0
- /package/dist/src/{runtime/governance → channel}/auth/vercel-oidc-project.js +0 -0
- /package/dist/src/{runtime/governance/network → channel}/ip-allow-list.d.ts +0 -0
- /package/dist/src/{runtime/governance/network → channel}/ip-allow-list.js +0 -0
- /package/dist/src/{execution/skills/types.js → context/session-context.js} +0 -0
- /package/dist/src/execution/sandbox/{bash-tool.js → bash.js} +0 -0
- /package/dist/src/{runtime/framework-tools → execution/tools}/file-state.js +0 -0
- /package/dist/src/{runtime/framework-tools → execution/tools}/sleep.d.ts +0 -0
- /package/dist/src/{runtime/framework-tools → execution/tools}/sleep.js +0 -0
- /package/dist/src/execution/web-fetch/{tool.d.ts → execute.d.ts} +0 -0
- /package/dist/src/execution/web-fetch/{tool.js → execute.js} +0 -0
- /package/dist/src/{shared/tool-definition.js → runtime/connections/registry-types.js} +0 -0
- /package/dist/src/{runtime/connections/types.js → shared/connection-types.js} +0 -0
- /package/dist/src/{runtime/sessions/auth.d.ts → shared/session-auth.d.ts} +0 -0
- /package/dist/src/{runtime/sessions/auth.js → shared/session-auth.js} +0 -0
- /package/dist/src/{runtime/connections → shared}/validate-authorization.js +0 -0
- /package/dist/src/{public/tools/output-builders.js → tools/model-output.js} +0 -0
- /package/dist/src/{shared/tool-schema.d.ts → tools/schema.d.ts} +0 -0
- /package/dist/src/{shared/tool-schema.js → tools/schema.js} +0 -0
- /package/dist/src/{shared/tool-task.d.ts → tools/task.d.ts} +0 -0
- /package/dist/src/{shared/tool-task.js → tools/task.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{serializeOutputSchema}from"#
|
|
1
|
+
import{serializeOutputSchema}from"#tools/schema.js";import{normalizeAgentDefinition}from"#internal/authored-definition/core.js";import{isDynamicModelDefinition}from"#shared/agent-definition.js";import{resolveRuntimeModelSelection}from"#runtime/agent/resolve-model.js";async function normalizeDynamicSubagentAgentConfig(t){let n=`Dynamic subagent "${t.name}" must return defineAgent(...), defineRemoteAgent(...), or null.`,r=normalizeAgentDefinition(t.value,n);if(!r.description)throw Error(`${n} The "description" field is required.`);if(r.build!==void 0)throw Error(`${n} The "build" field cannot be selected at runtime.`);if(r.experimental!==void 0)throw Error(`${n} The "experimental" field cannot be selected at runtime.`);if(isDynamicModelDefinition(r.model))throw Error(`${n} The returned "model" must be static.`);let i={description:r.description,model:await normalizeDurableModelSelection({catalog:t.catalog,selection:{model:r.model,modelContextWindowTokens:r.modelContextWindowTokens,modelOptions:r.modelOptions},state:t.state})};if(r.compaction!==void 0){let e={};r.compaction.model!==void 0&&(e.model=await normalizeDurableModelSelection({catalog:t.catalog,selection:{model:r.compaction.model,modelContextWindowTokens:r.compaction.modelContextWindowTokens,modelOptions:r.modelOptions},state:t.state})),r.compaction.thresholdPercent!==void 0&&(e.thresholdPercent=r.compaction.thresholdPercent),i.compaction=e}return r.limits!==void 0&&(i.limits=r.limits),r.outputSchema!==void 0&&(i.outputSchema=serializeOutputSchema(r.outputSchema)),r.reasoning!==void 0&&(i.reasoning=r.reasoning),i}async function normalizeDurableModelSelection(e){return(await resolveRuntimeModelSelection({catalog:e.catalog,durability:`durable`,selection:e.selection,state:e.state})).reference}export{normalizeDynamicSubagentAgentConfig};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{expectBoolean,expectFunction,expectObjectRecord,expectOnlyKnownKeys,expectString,getOptionalStringRecordProperty}from"#internal/authored-module.js";import{EVE_SESSION_ROUTE_PATH}from"#protocol/routes.js";import{serializeOutputSchema}from"#
|
|
1
|
+
import{expectBoolean,expectFunction,expectObjectRecord,expectOnlyKnownKeys,expectString,getOptionalStringRecordProperty}from"#internal/authored-module.js";import{EVE_SESSION_ROUTE_PATH}from"#protocol/routes.js";import{serializeOutputSchema}from"#tools/schema.js";async function normalizeDynamicRemoteAgentConfig(t){let i=`Dynamic subagent "${t.name}" must return defineAgent(...), defineRemoteAgent(...), or null.`,a=expectObjectRecord(t.value,i);if(expectOnlyKnownKeys(a,[`auth`,`description`,`forwardPrincipal`,`headers`,`kind`,`outputSchema`,`path`,`url`],i),a.kind!==`remote`)throw Error(i);let o=await resolveUrl(a.url,i),s=readCredentialsStepId(a);if(validateCredentials(a,i),(a.auth!==void 0||a.headers!==void 0)&&s===void 0)throw Error(`${i} Dynamic remote auth and headers must be compiled by eve so credentials stay out of durable workflow state.`);let c={description:expectString(a.description,i),path:a.path===void 0?EVE_SESSION_ROUTE_PATH:expectString(a.path,i),url:o};return s!==void 0&&(c.credentialsStepId=s),a.forwardPrincipal!==void 0&&(c.forwardPrincipal=expectBoolean(a.forwardPrincipal,i)),a.outputSchema!==void 0&&(c.outputSchema=serializeOutputSchema(a.outputSchema)),c}async function resolveUrl(e,n){let r=typeof e==`function`?await expectFunction(e,n)():expectString(e,n);if(r.length===0)throw Error(`${n} The "url" field must resolve to a non-empty string.`);return r}function validateCredentials(e,n){e.auth!==void 0&&expectFunction(e.auth,n),e.headers!==void 0&&typeof e.headers!=`function`&&getOptionalStringRecordProperty(e,`headers`,n)}function readCredentialsStepId(e){let t=e.__eveResolveRemoteAgentCredentials;if(typeof t!=`function`)return;let n=t.stepId;return typeof n==`string`?n:void 0}export{normalizeDynamicRemoteAgentConfig};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { z } from "#compiled/zod/index.js";
|
|
2
1
|
import type { PreparedRuntimeDelegationTool } from "#runtime/sessions/turn.js";
|
|
3
2
|
import type { ResolvedDynamicSubagentDefinition, ResolvedRuntimeDelegationNode } from "#runtime/types.js";
|
|
4
3
|
import type { JsonObject } from "#shared/json.js";
|
|
@@ -24,37 +23,11 @@ export interface RuntimeSubagentRegistry {
|
|
|
24
23
|
readonly subagentsByName: ReadonlyMap<string, RuntimeRegisteredSubagent>;
|
|
25
24
|
readonly subagentsByNodeId: ReadonlyMap<string, RuntimeRegisteredSubagent>;
|
|
26
25
|
}
|
|
27
|
-
/**
|
|
28
|
-
* Stable input schema lowered onto every subagent tool. Subagents always
|
|
29
|
-
* accept one free-form `message` string from the parent agent.
|
|
30
|
-
*/
|
|
31
|
-
export declare const SUBAGENT_TOOL_INPUT_SCHEMA: z.ZodObject<{
|
|
32
|
-
message: z.ZodString;
|
|
33
|
-
outputSchema: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
34
|
-
}, z.core.$strict>;
|
|
35
|
-
/**
|
|
36
|
-
* Extended subagent tool input schema for agents that opt into
|
|
37
|
-
* `experimental.subagentPersistentSessions`: adds the `agentId` field the
|
|
38
|
-
* model uses to continue a previous delegation.
|
|
39
|
-
*/
|
|
40
|
-
export declare const PERSISTENT_SUBAGENT_TOOL_INPUT_SCHEMA: z.ZodObject<{
|
|
41
|
-
message: z.ZodString;
|
|
42
|
-
outputSchema: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
|
|
43
|
-
agentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
44
|
-
}, z.core.$strict>;
|
|
45
|
-
/** Selects the serialized subagent tool input schema for one agent's opt-in state. */
|
|
46
|
-
export declare function getSubagentToolInputJsonSchema(persistentSessions: boolean): JsonObject;
|
|
47
26
|
/**
|
|
48
27
|
* Builds the runtime-owned registry for the resolved subagents visible from one
|
|
49
28
|
* runtime agent node.
|
|
50
29
|
*/
|
|
51
30
|
export declare function createRuntimeSubagentRegistry(input: {
|
|
52
|
-
/**
|
|
53
|
-
* Whether the owning agent opted into
|
|
54
|
-
* `experimental.subagentPersistentSessions`. Adds the model-visible
|
|
55
|
-
* `agentId` continuation field to every lowered subagent tool schema.
|
|
56
|
-
*/
|
|
57
|
-
readonly persistentSessions?: boolean;
|
|
58
31
|
readonly reservedToolNames?: readonly string[];
|
|
59
32
|
readonly subagents: readonly ResolvedRuntimeDelegationNode[];
|
|
60
33
|
}): RuntimeSubagentRegistry;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{serializeInputSchema}from"#tools/schema.js";import{SUBAGENT_TOOL_INPUT_SCHEMA}from"#tools/framework/agent-contract.js";import{RuntimeRegistry,RuntimeRegistryError}from"#internal/runtime-registry.js";const SUBAGENT_TOOL_INPUT_JSON_SCHEMA=serializeInputSchema(SUBAGENT_TOOL_INPUT_SCHEMA);function createRuntimeSubagentRegistry(e){let t=[],i=new Set,a=[],o=new RuntimeRegistry(`subagent`,e.reservedToolNames??[]),s=new Map;for(let n of e.subagents){let e={logicalPath:n.logicalPath,sourceId:n.sourceId};if(s.has(n.nodeId))throw new RuntimeRegistryError(`subagent`,`Found multiple runtime subagents mapped to node id "${n.nodeId}".`,{...e,entryName:n.name});let c,l=n.kind===`subagent`?n.dynamic:void 0;if(l===void 0){let r=createPreparedRuntimeSubagentTool(n);c={definition:n,prepared:r},o.register(n.name,c,{location:e,duplicateMessage:`Found multiple subagents named "${n.name}". Subagent names must be unique at runtime.`,reservedMessage:`Subagent "${n.name}" collides with another runtime-visible tool name.`}),t.push(r)}else i.add(n.nodeId),a.push({...l,kind:`subagent`,logicalPath:n.logicalPath,name:n.name,nodeId:n.nodeId,sourceId:n.sourceId,sourceKind:`module`}),c={definition:n};s.set(n.nodeId,c)}return{dynamicNodeIds:i,dynamicResolvers:a,preparedTools:t,subagentsByName:o.asMap(),subagentsByNodeId:s}}function createPreparedRuntimeSubagentTool(e,t=SUBAGENT_TOOL_INPUT_JSON_SCHEMA){if(e.description===void 0)throw Error(`Static subagent "${e.name}" is missing a description.`);return{description:e.description,inputSchema:t,kind:e.kind,logicalPath:e.logicalPath,name:e.name,nodeId:e.nodeId,outputSchema:e.kind===`remote`?e.outputSchema:void 0,sourceId:e.sourceId}}export{createPreparedRuntimeSubagentTool,createRuntimeSubagentRegistry};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{serializeInputSchema,serializeOutputSchema}from"#
|
|
1
|
+
import{serializeInputSchema,serializeOutputSchema}from"#tools/schema.js";import{RuntimeRegistry}from"#internal/runtime-registry.js";async function createRuntimeToolRegistry(e,t={}){let r=[],i=new RuntimeRegistry(`tool`,t.reservedToolNames??[]);for(let t of e.tools){let e=await createPreparedRuntimeTool(t);i.register(t.name,{definition:t,prepared:e},{location:{logicalPath:t.logicalPath,sourceId:t.sourceId},duplicateMessage:`Found multiple authored tools named "${t.name}". Tool names must be unique at runtime.`,reservedMessage:`Tool "${t.name}" collides with another runtime-visible tool name.`}),r.push(e)}return{preparedTools:r,toolsByName:i.asMap()}}function findRegisteredRuntimeTool(e,t){return e.toolsByName.get(t)??null}async function createPreparedRuntimeTool(n){return{description:n.description,inputSchema:serializeInputSchema(n.inputSchema),kind:`authored-tool`,logicalPath:n.logicalPath,name:n.name,owner:n.owner,outputSchema:serializeOutputSchema(n.outputSchema),sourceId:n.sourceId}}export{createRuntimeToolRegistry,findRegisteredRuntimeTool};
|
|
@@ -8,10 +8,10 @@ import type { ChannelRouteMethod, RouteContext } from "#public/definitions/chann
|
|
|
8
8
|
import type { RouteHandler, WebSocketRouteHandler } from "#channel/routes.js";
|
|
9
9
|
import type { OutboundAuthFn } from "#public/agents/auth.js";
|
|
10
10
|
import type { StreamEventHook } from "#public/definitions/hook.js";
|
|
11
|
-
import type { Approval } from "#
|
|
12
|
-
import type { ToolModelOutput } from "#
|
|
11
|
+
import type { Approval } from "#approval/definition.js";
|
|
12
|
+
import type { ToolModelOutput } from "#tools/definition.js";
|
|
13
13
|
import type { ConnectionToolCallDefinition } from "#public/definitions/connections/tool-call.js";
|
|
14
|
-
import type { AuthorizationDefinition, ConnectionAuthResolver, ConnectionProtocol, HeadersDefinition, ToolFilterDefinition } from "#
|
|
14
|
+
import type { AuthorizationDefinition, ConnectionAuthResolver, ConnectionProtocol, HeadersDefinition, ToolFilterDefinition } from "#shared/connection-types.js";
|
|
15
15
|
import type { OpenAPISpecSource } from "#public/definitions/connections/openapi.js";
|
|
16
16
|
import type { CompiledWorkspaceResourceRoot } from "#compiler/manifest.js";
|
|
17
17
|
import type { WorkspaceRuntimeSpec } from "#runtime/workspace/types.js";
|
|
@@ -22,11 +22,13 @@ import type { SourceRef, ModuleSourceRef, SkillPackageSourceRef, MarkdownSourceR
|
|
|
22
22
|
import type { NamedSkillDefinition } from "#shared/skill-definition.js";
|
|
23
23
|
import type { InternalAgentDefinition } from "#shared/agent-definition.js";
|
|
24
24
|
import type { RuntimeDynamicModelReference } from "#runtime/agent/bootstrap.js";
|
|
25
|
-
import type { InternalToolDefinitionWithExecuteFn } from "#
|
|
25
|
+
import type { InternalToolDefinitionWithExecuteFn } from "#tools/definition.js";
|
|
26
26
|
import type { WebSearchProvider } from "#shared/web-search.js";
|
|
27
27
|
import type { SandboxBackend } from "#shared/sandbox-backend.js";
|
|
28
28
|
import type { SandboxBootstrapContext, SandboxSessionContext } from "#shared/sandbox-definition.js";
|
|
29
|
-
import type { ToolSchema } from "#
|
|
29
|
+
import type { ToolSchema } from "#tools/schema.js";
|
|
30
|
+
import type { AgentSourceOwner } from "#compiler/source-graph.js";
|
|
31
|
+
import type { MemoryDefinition } from "#public/memory/index.js";
|
|
30
32
|
/**
|
|
31
33
|
* Runtime-owned source ref describing one additive config module import.
|
|
32
34
|
*/
|
|
@@ -42,6 +44,7 @@ export type ResolvedModuleSourceRef = Readonly<ModuleSourceRef>;
|
|
|
42
44
|
export type ResolvedInstructionsDefinition = Readonly<SourceRef & {
|
|
43
45
|
content: string;
|
|
44
46
|
name: string;
|
|
47
|
+
owner: AgentSourceOwner;
|
|
45
48
|
role: "system" | "user";
|
|
46
49
|
} & (Omit<MarkdownSourceRef<undefined>, "definition"> | ModuleSourceRef)>;
|
|
47
50
|
/**
|
|
@@ -103,7 +106,7 @@ export interface ResolvedConnectionDefinition extends ResolvedModuleSourceRef {
|
|
|
103
106
|
*
|
|
104
107
|
* The resolved `backend` is non-optional: every sandbox in the runtime
|
|
105
108
|
* graph carries a concrete SandboxBackend value, even when the
|
|
106
|
-
* authored definition omits `backend`. The
|
|
109
|
+
* authored definition omits `backend`. The omitted field is filled
|
|
107
110
|
* in by `defaultSandbox()` (which itself selects between
|
|
108
111
|
* `vercel()`, `docker()`, `microsandbox()`, and `justbash()` based on the current
|
|
109
112
|
* environment).
|
|
@@ -125,11 +128,11 @@ export type ResolvedSandboxDefinition = ResolvedModuleSourceRef & {
|
|
|
125
128
|
readonly onSession?: (input: SandboxSessionContext) => Promise<void> | void;
|
|
126
129
|
};
|
|
127
130
|
/**
|
|
128
|
-
* Runtime-owned tool definition resolved from
|
|
129
|
-
* declared by the framework catalog.
|
|
131
|
+
* Runtime-owned tool definition resolved from the selected compiled source graph.
|
|
130
132
|
* A tool without `execute` is surfaced to the client and never executed by eve.
|
|
131
133
|
*/
|
|
132
134
|
export type ResolvedToolDefinition = Readonly<Omit<Optional<InternalToolDefinitionWithExecuteFn<unknown, unknown>, "execute">, "inputSchema" | "outputSchema">> & ResolvedModuleSourceRef & {
|
|
135
|
+
readonly owner: AgentSourceOwner;
|
|
133
136
|
/**
|
|
134
137
|
* Validated runtime input schema. Compiled and durable JSON Schemas are
|
|
135
138
|
* rehydrated before entering this runtime-owned definition.
|
|
@@ -299,12 +302,17 @@ export interface ResolvedDynamicToolResolver extends Readonly<ModuleSourceRef> {
|
|
|
299
302
|
readonly slug: string;
|
|
300
303
|
readonly eventNames: readonly string[];
|
|
301
304
|
readonly events: Readonly<Record<string, (event: unknown, ctx: unknown) => unknown | Promise<unknown>>>;
|
|
305
|
+
readonly rebindMissingCallbacks?: boolean;
|
|
302
306
|
/**
|
|
303
307
|
* Mount namespace when this resolver comes from an extension. Names of tools
|
|
304
308
|
* the resolver produces are prefixed with `${extensionNamespace}__`.
|
|
305
309
|
*/
|
|
306
310
|
readonly extensionNamespace?: string;
|
|
307
311
|
}
|
|
312
|
+
export type ResolvedMemoryDefinition = Readonly<MemoryDefinition & ModuleSourceRef & {
|
|
313
|
+
readonly slot: string;
|
|
314
|
+
readonly visibility: "scope" | "session";
|
|
315
|
+
}>;
|
|
308
316
|
/**
|
|
309
317
|
* Runtime resolver for dynamic skills declared via `defineDynamic({ events })`
|
|
310
318
|
* in `agent/skills/`. Carries the live event handler functions loaded from the
|
|
@@ -337,20 +345,6 @@ export interface ResolvedAgent {
|
|
|
337
345
|
readonly channels: readonly ResolvedChannelDefinition[];
|
|
338
346
|
readonly config?: ResolvedAgentDefinition;
|
|
339
347
|
readonly connections: readonly ResolvedConnectionDefinition[];
|
|
340
|
-
/**
|
|
341
|
-
* Logical names of framework-provided channels the author opted out of by
|
|
342
|
-
* exporting `disableRoute()` from a file in `agent/channels/`. Each
|
|
343
|
-
* entry is the slash-joined slug path of one such file. The graph
|
|
344
|
-
* resolver uses this list to filter the framework default channel set.
|
|
345
|
-
*/
|
|
346
|
-
readonly disabledFrameworkChannels: readonly string[];
|
|
347
|
-
/**
|
|
348
|
-
* Names of framework-provided tools the author opted out of by exporting
|
|
349
|
-
* `disableTool()` from a file in `agent/tools/`. Each entry is the
|
|
350
|
-
* filename slug of one such file. The graph resolver uses this list to
|
|
351
|
-
* filter the framework default tool set.
|
|
352
|
-
*/
|
|
353
|
-
readonly disabledFrameworkTools: readonly string[];
|
|
354
348
|
/**
|
|
355
349
|
* Configuration for the experimental framework `Workflow` orchestration
|
|
356
350
|
* tool. Present when an authored tool module exports
|
|
@@ -371,11 +365,7 @@ export interface ResolvedAgent {
|
|
|
371
365
|
* declare one.
|
|
372
366
|
*/
|
|
373
367
|
readonly instructions: readonly ResolvedInstructionsDefinition[];
|
|
374
|
-
|
|
375
|
-
* Authored sandbox override for this agent, when one exists. `null`
|
|
376
|
-
* means the agent uses the framework default sandbox unchanged.
|
|
377
|
-
*/
|
|
378
|
-
readonly sandbox: ResolvedSandboxDefinition | null;
|
|
368
|
+
readonly sandbox: ResolvedSandboxDefinition;
|
|
379
369
|
/**
|
|
380
370
|
* Byte-free descriptor for the compiled workspace resource tree owned
|
|
381
371
|
* by this agent's graph node. The prewarm orchestrator resolves the
|
|
@@ -384,6 +374,7 @@ export interface ResolvedAgent {
|
|
|
384
374
|
*/
|
|
385
375
|
readonly workspaceResourceRoot: CompiledWorkspaceResourceRoot;
|
|
386
376
|
readonly hooks: readonly ResolvedHookDefinition[];
|
|
377
|
+
readonly memories: readonly ResolvedMemoryDefinition[];
|
|
387
378
|
readonly skills: readonly ResolvedSkillDefinition[];
|
|
388
379
|
readonly tools: readonly ResolvedToolDefinition[];
|
|
389
380
|
readonly workspaceSpec: WorkspaceRuntimeSpec;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { SandboxBackend } from "#public/definitions/sandbox-backend.js";
|
|
2
|
+
import type { DockerSandboxCreateOptions } from "#public/sandbox/docker-sandbox.js";
|
|
3
|
+
import type { JustBashSandboxCreateOptions } from "#public/sandbox/just-bash-sandbox.js";
|
|
4
|
+
import type { MicrosandboxSandboxCreateOptions } from "#public/sandbox/microsandbox-sandbox.js";
|
|
5
|
+
import type { VercelSandboxCreateOptions } from "#public/sandbox/vercel-sandbox.js";
|
|
6
|
+
/**
|
|
7
|
+
* Input to {@link defaultSandbox}: a separate options bag per inner
|
|
8
|
+
* backend. The framework picks one backend at runtime based on
|
|
9
|
+
* availability and passes it the matching bag; the others are ignored.
|
|
10
|
+
*/
|
|
11
|
+
export interface DefaultSandboxOptions {
|
|
12
|
+
readonly docker?: DockerSandboxCreateOptions;
|
|
13
|
+
readonly justBash?: JustBashSandboxCreateOptions;
|
|
14
|
+
readonly microsandbox?: MicrosandboxSandboxCreateOptions;
|
|
15
|
+
readonly vercel?: VercelSandboxCreateOptions;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Availability probes behind {@link defaultSandbox}'s selection chain.
|
|
19
|
+
* Injectable so selection logic is testable without touching the host.
|
|
20
|
+
*/
|
|
21
|
+
export interface DefaultSandboxProbes {
|
|
22
|
+
readonly isDeployedOnVercel: () => boolean;
|
|
23
|
+
readonly isDockerAvailable: () => boolean;
|
|
24
|
+
readonly isMicrosandboxSupported: () => boolean;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Constructs an availability-aware sandbox backend. On first use it
|
|
28
|
+
* picks the best backend the host supports, in priority order:
|
|
29
|
+
*
|
|
30
|
+
* 1. **Vercel Sandbox** when deploying on Vercel (`process.env.VERCEL`
|
|
31
|
+
* is set) — local container/VM runtimes cannot run there.
|
|
32
|
+
* 2. **Docker** when a Linux-container Docker daemon is reachable.
|
|
33
|
+
* 3. **microsandbox** when the host supports it (macOS on Apple
|
|
34
|
+
* Silicon, or glibc Linux with KVM); `eve dev` auto-installs the
|
|
35
|
+
* package into the project.
|
|
36
|
+
* 4. **just-bash** as the dependency-free fallback; `eve dev`
|
|
37
|
+
* auto-installs the package into the project.
|
|
38
|
+
*
|
|
39
|
+
* The selection is cached for the process lifetime. To pin a backend
|
|
40
|
+
* unconditionally, configure its factory directly (`docker()`,
|
|
41
|
+
* `microsandbox()`, `justbash()`,
|
|
42
|
+
* `vercel()`).
|
|
43
|
+
*/
|
|
44
|
+
export declare function defaultSandbox(opts?: DefaultSandboxOptions): SandboxBackend;
|
|
45
|
+
/**
|
|
46
|
+
* The selection chain behind {@link defaultSandbox}. Internal —
|
|
47
|
+
* exported for tests, which inject probes.
|
|
48
|
+
*/
|
|
49
|
+
export declare function selectDefaultSandbox(opts: DefaultSandboxOptions | undefined, probes: DefaultSandboxProbes): SandboxBackend;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isLinuxDockerDaemonAvailableSync,isMicrosandboxPlatformSupported}from"#execution/sandbox/bindings/local.js";import{lazyBackend}from"#execution/sandbox/lazy-backend.js";import{docker}from"#sandbox/backends/docker.js";import{justbash}from"#sandbox/backends/just-bash.js";import{microsandbox}from"#sandbox/backends/microsandbox.js";import{vercel}from"#sandbox/backends/vercel.js";const PRODUCTION_PROBES={isDeployedOnVercel:()=>!!process.env.VERCEL,isDockerAvailable:()=>isLinuxDockerDaemonAvailableSync(),isMicrosandboxSupported:()=>isMicrosandboxPlatformSupported()};function defaultSandbox(e){return lazyBackend(()=>selectDefaultSandbox(e,PRODUCTION_PROBES))}function selectDefaultSandbox(e,t){return t.isDeployedOnVercel()?vercel(e?.vercel):t.isDockerAvailable()?docker(e?.docker):t.isMicrosandboxSupported()?microsandbox(e?.microsandbox):justbash(e?.justBash)}export{defaultSandbox,selectDefaultSandbox};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { SandboxBackend } from "#public/definitions/sandbox-backend.js";
|
|
2
|
+
import type { DockerSandboxCreateOptions } from "#public/sandbox/docker-sandbox.js";
|
|
3
|
+
/**
|
|
4
|
+
* Constructs the Docker sandbox backend: the workspace runs inside a
|
|
5
|
+
* real Linux container driven through the Docker CLI, using the
|
|
6
|
+
* official Ubuntu 26.04 image by default.
|
|
7
|
+
*
|
|
8
|
+
* Requires a running Docker-compatible daemon reachable through a
|
|
9
|
+
* `docker` CLI (Docker Desktop, OrbStack, Colima, Podman via its
|
|
10
|
+
* docker-compatible CLI, …; override the binary with `EVE_DOCKER_PATH`).
|
|
11
|
+
* Configuring this backend pins it unconditionally — when you want
|
|
12
|
+
* fallback behavior, use `defaultBackend()` instead.
|
|
13
|
+
*/
|
|
14
|
+
export declare function docker(opts?: DockerSandboxCreateOptions): SandboxBackend;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createDockerSandboxBackend}from"#execution/sandbox/bindings/local.js";function docker(e){return createDockerSandboxBackend({createOptions:e})}export{docker};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { SandboxBackend } from "#public/definitions/sandbox-backend.js";
|
|
2
|
+
import type { JustBashSandboxCreateOptions } from "#public/sandbox/just-bash-sandbox.js";
|
|
3
|
+
/**
|
|
4
|
+
* Constructs the just-bash sandbox backend: a pure-JS bash interpreter
|
|
5
|
+
* over a virtual filesystem stored under `.eve/sandbox-cache/`. It
|
|
6
|
+
* needs no daemon or VM, but commands run in a simulated shell — no
|
|
7
|
+
* real binaries (`git`, `node`, package managers) and no network
|
|
8
|
+
* isolation.
|
|
9
|
+
*
|
|
10
|
+
* The `just-bash` package is not bundled with eve. When it is missing,
|
|
11
|
+
* `eve dev` installs it into the application automatically (disable
|
|
12
|
+
* with `autoInstall: false`); production processes fail with an
|
|
13
|
+
* actionable install error instead. Configuring this backend pins it
|
|
14
|
+
* unconditionally — when you want fallback behavior, use
|
|
15
|
+
* `defaultBackend()` instead.
|
|
16
|
+
*/
|
|
17
|
+
export declare function justbash(opts?: JustBashSandboxCreateOptions): SandboxBackend;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createJustBashSandboxBackend}from"#execution/sandbox/bindings/local.js";function justbash(e){return createJustBashSandboxBackend({createOptions:e})}export{justbash};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { SandboxBackend } from "#public/definitions/sandbox-backend.js";
|
|
2
|
+
import type { MicrosandboxBootstrapUseOptions, MicrosandboxSandboxCreateOptions, MicrosandboxSessionUseOptions } from "#public/sandbox/microsandbox-sandbox.js";
|
|
3
|
+
/**
|
|
4
|
+
* Constructs the microsandbox sandbox backend: lightweight local VMs
|
|
5
|
+
* via [microsandbox](https://www.npmjs.com/package/microsandbox) with
|
|
6
|
+
* snapshot-backed templates and a firewall capable of domain-level
|
|
7
|
+
* network policies and credential brokering.
|
|
8
|
+
*
|
|
9
|
+
* Supported hosts: macOS on Apple Silicon, or Linux (glibc) with KVM
|
|
10
|
+
* enabled. The `microsandbox` package is not bundled with eve. When it
|
|
11
|
+
* (or its VM runtime) is missing, `eve dev` installs both
|
|
12
|
+
* automatically (disable with `setup: { autoInstall: false }`);
|
|
13
|
+
* production processes fail with actionable errors instead.
|
|
14
|
+
* Configuring this backend pins it unconditionally — when you want
|
|
15
|
+
* fallback behavior, use `defaultBackend()` instead.
|
|
16
|
+
*/
|
|
17
|
+
export declare function microsandbox(opts?: MicrosandboxSandboxCreateOptions): SandboxBackend<MicrosandboxBootstrapUseOptions, MicrosandboxSessionUseOptions>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createMicrosandboxSandboxBackend}from"#execution/sandbox/bindings/local.js";function microsandbox(e){return createMicrosandboxSandboxBackend({createOptions:e})}export{microsandbox};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { SandboxBackend } from "#public/definitions/sandbox-backend.js";
|
|
2
|
+
import type { VercelSandboxBootstrapUseOptions, VercelSandboxOptions, VercelSandboxSessionUseOptions } from "#public/sandbox/vercel-sandbox.js";
|
|
3
|
+
/**
|
|
4
|
+
* Constructs the [Vercel Sandbox](https://vercel.com/docs/sandbox)
|
|
5
|
+
* backend. Configuring this backend pins it unconditionally —
|
|
6
|
+
* including for local development, where it creates real hosted
|
|
7
|
+
* sandboxes (requires Vercel credentials).
|
|
8
|
+
*
|
|
9
|
+
* The optional provider creation fields are forwarded to Vercel Sandbox creation
|
|
10
|
+
* for every fresh sandbox the framework creates (template at prewarm,
|
|
11
|
+
* session at first-time create). On resume (`Sandbox.get`), no create
|
|
12
|
+
* happens, so opts are not re-applied. `networkPolicy` is applied after
|
|
13
|
+
* framework-owned base setup for fresh templates and template-less
|
|
14
|
+
* sessions, before authored bootstrap code runs.
|
|
15
|
+
*
|
|
16
|
+
* `opts.source`, if supplied, is used only on the template create:
|
|
17
|
+
* the author's snapshot, git revision, or tarball becomes the base
|
|
18
|
+
* layer of the template. Bootstrap, seed files, and framework setup
|
|
19
|
+
* still run on top, and every session derives from the resulting
|
|
20
|
+
* eve-owned snapshot. `source` is stripped from session creates so the
|
|
21
|
+
* framework's snapshot always wins.
|
|
22
|
+
*
|
|
23
|
+
* `bootstrap({ use })` applies its options to the template via
|
|
24
|
+
* `sandbox.update(...)`; those settings persist into the snapshot.
|
|
25
|
+
* `onSession({ use })` applies its options to the live session via the
|
|
26
|
+
* SDK's `update` under the hood, overriding any overlapping field
|
|
27
|
+
* from `opts`. `sessionCreateOptions`, when provided, is resolved only
|
|
28
|
+
* when creating a fresh live session and can attach session-specific Drives.
|
|
29
|
+
*/
|
|
30
|
+
export declare function vercel(opts?: VercelSandboxOptions): SandboxBackend<VercelSandboxBootstrapUseOptions, VercelSandboxSessionUseOptions>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createVercelSandbox}from"#execution/sandbox/bindings/vercel.js";function vercel(e){let{sessionCreateOptions:t,...n}=e??{};return createVercelSandbox({createOptions:n,resolveSessionCreateOptions:t})}export{vercel};
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
*/
|
|
11
11
|
export declare function readDevelopmentRuntimeArtifactsRevision(input: {
|
|
12
12
|
readonly serverUrl: string;
|
|
13
|
+
readonly signal?: AbortSignal;
|
|
14
|
+
readonly timeoutMs?: number;
|
|
13
15
|
}): Promise<string | undefined>;
|
|
14
16
|
export declare function suspendDevelopmentRuntimeArtifacts(input: {
|
|
15
17
|
readonly serverUrl: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{EVE_DEV_RUNTIME_ARTIFACTS_REBUILD_ROUTE_PATH,EVE_DEV_RUNTIME_ARTIFACTS_RESUME_ROUTE_PATH,EVE_DEV_RUNTIME_ARTIFACTS_ROUTE_PATH,EVE_DEV_RUNTIME_ARTIFACTS_SUSPEND_ROUTE_PATH}from"#protocol/routes.js";async function readDevelopmentRuntimeArtifactsRevision(e){try{let t=new URL(EVE_DEV_RUNTIME_ARTIFACTS_ROUTE_PATH,e.serverUrl);return await parseDevelopmentRuntimeArtifactsRevision(await fetch(t))}catch{return}}async function suspendDevelopmentRuntimeArtifacts(e){return await changeDevelopmentRuntimeArtifacts(e.serverUrl,EVE_DEV_RUNTIME_ARTIFACTS_SUSPEND_ROUTE_PATH)}async function resumeDevelopmentRuntimeArtifacts(e){try{let n=new URL(EVE_DEV_RUNTIME_ARTIFACTS_RESUME_ROUTE_PATH,e.serverUrl);return e.silent===!0&&n.searchParams.set(`silent`,`1`),await parseDevelopmentRuntimeArtifactsRevision(await fetch(n,{method:`POST`}))}catch{return}}async function changeDevelopmentRuntimeArtifacts(e,t){try{return(await fetch(new URL(t,e),{method:`POST`})).ok}catch{return!1}}async function rebuildDevelopmentRuntimeArtifacts(t){try{let n=new URL(EVE_DEV_RUNTIME_ARTIFACTS_REBUILD_ROUTE_PATH,t.serverUrl);return t.force===!0&&n.searchParams.set(`force`,`1`),await parseDevelopmentRuntimeArtifactsRevision(await fetch(n,{method:`POST`}))}catch{return}}async function parseDevelopmentRuntimeArtifactsRevision(e){if(!e.ok)return;let t=await e.json();return typeof t.revision==`string`&&t.revision.length>0?t.revision:void 0}export{readDevelopmentRuntimeArtifactsRevision,rebuildDevelopmentRuntimeArtifacts,resumeDevelopmentRuntimeArtifacts,suspendDevelopmentRuntimeArtifacts};
|
|
1
|
+
import{EVE_DEV_RUNTIME_ARTIFACTS_REBUILD_ROUTE_PATH,EVE_DEV_RUNTIME_ARTIFACTS_RESUME_ROUTE_PATH,EVE_DEV_RUNTIME_ARTIFACTS_ROUTE_PATH,EVE_DEV_RUNTIME_ARTIFACTS_SUSPEND_ROUTE_PATH}from"#protocol/routes.js";async function readDevelopmentRuntimeArtifactsRevision(e){try{let t=new URL(EVE_DEV_RUNTIME_ARTIFACTS_ROUTE_PATH,e.serverUrl),r=e.timeoutMs===void 0?void 0:AbortSignal.timeout(e.timeoutMs),i=e.signal===void 0?r:r===void 0?e.signal:AbortSignal.any([e.signal,r]),a={redirect:`error`};return i!==void 0&&(a.signal=i),await parseDevelopmentRuntimeArtifactsRevision(await fetch(t,a))}catch{return}}async function suspendDevelopmentRuntimeArtifacts(e){return await changeDevelopmentRuntimeArtifacts(e.serverUrl,EVE_DEV_RUNTIME_ARTIFACTS_SUSPEND_ROUTE_PATH)}async function resumeDevelopmentRuntimeArtifacts(e){try{let n=new URL(EVE_DEV_RUNTIME_ARTIFACTS_RESUME_ROUTE_PATH,e.serverUrl);return e.silent===!0&&n.searchParams.set(`silent`,`1`),await parseDevelopmentRuntimeArtifactsRevision(await fetch(n,{method:`POST`}))}catch{return}}async function changeDevelopmentRuntimeArtifacts(e,t){try{return(await fetch(new URL(t,e),{method:`POST`})).ok}catch{return!1}}async function rebuildDevelopmentRuntimeArtifacts(t){try{let n=new URL(EVE_DEV_RUNTIME_ARTIFACTS_REBUILD_ROUTE_PATH,t.serverUrl);return t.force===!0&&n.searchParams.set(`force`,`1`),await parseDevelopmentRuntimeArtifactsRevision(await fetch(n,{method:`POST`}))}catch{return}}async function parseDevelopmentRuntimeArtifactsRevision(e){if(!e.ok)return;let t=await e.json();return typeof t.revision==`string`&&t.revision.length>0?t.revision:void 0}export{readDevelopmentRuntimeArtifactsRevision,rebuildDevelopmentRuntimeArtifacts,resumeDevelopmentRuntimeArtifacts,suspendDevelopmentRuntimeArtifacts};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { UserContent } from "ai";
|
|
2
|
-
import type { InputResponse } from "#
|
|
2
|
+
import type { InputResponse } from "#shared/input.js";
|
|
3
3
|
/**
|
|
4
4
|
* Tracks local dev runtime-artifact revisions so callers can refresh their
|
|
5
5
|
* presentation before delivering the next turn.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{EVE_SESSION_ROUTE_PATH}from"#protocol/routes.js";import{join}from"node:path";import{compileChannelDefinition}from"#compiler/normalize-channel.js";import{discoverAgent}from"#discover/discover-agent.js";import{isNextJsProject}from"#setup/scaffold/index.js";const SCAFFOLDED_WEB_CHANNEL_LOGICAL_PATH=`channels/eve.ts`;async function inspectExistingChannelRegistrations(
|
|
1
|
+
import{EVE_SESSION_ROUTE_PATH}from"#protocol/routes.js";import{join}from"node:path";import{compileChannelDefinition}from"#compiler/normalize-channel.js";import{createCompiledBindingNamespaceLoader}from"#compiler/load-binding-namespace.js";import{discoverAgent}from"#discover/discover-agent.js";import{isNextJsProject}from"#setup/scaffold/index.js";const SCAFFOLDED_WEB_CHANNEL_LOGICAL_PATH=`channels/eve.ts`;async function inspectExistingChannelRegistrations(o){let s=join(o,`agent`),[{manifest:c},l]=await Promise.all([discoverAgent({agentRoot:s,appRoot:o}),isNextJsProject(o)]),u=new Set,d=new Set;for(let r of c.channels){let i={backing:{externalDependencies:[],kind:`filesystem`,sourcePath:join(s,r.logicalPath)},logicalPath:r.logicalPath,owner:{kind:`application`}},a=await compileChannelDefinition(s,r,{binding:i,loadNamespace:createCompiledBindingNamespaceLoader({bindings:{[r.sourceId]:i},registries:[]})});if(a.kind===`channel`)for(let t of a.definitions)t.kind===`channel`&&(t.method===`POST`&&t.urlPath===EVE_SESSION_ROUTE_PATH&&u.add(r.logicalPath),t.adapterKind===`slack`&&d.add(r.logicalPath))}let f={};return[...u].some(e=>e!==SCAFFOLDED_WEB_CHANNEL_LOGICAL_PATH)&&(f.web=`POST ${EVE_SESSION_ROUTE_PATH} already registered`),d.size>0&&(f.slack=`Slack channel already registered`),{disabledChannelReasons:f,webRouteOwners:[...u],slackOwners:[...d],webAppPresent:l}}function assertCanAddSelectedChannels(t,n){if(t.includes(`web`)){let t=n.webRouteOwners.find(e=>e!==SCAFFOLDED_WEB_CHANNEL_LOGICAL_PATH);if(t!==void 0)throw Error(`Cannot scaffold Web Chat because agent/${t} already defines POST ${EVE_SESSION_ROUTE_PATH}. Web Chat scaffolds the same eve session routes.`)}if(t.includes(`slack`)){let e=n.slackOwners.find(e=>e!==`channels/slack.ts`);if(e!==void 0)throw Error(`Cannot scaffold Slack because agent/${e} already defines a Slack channel. Slack scaffolding would register the channel again.`)}}export{assertCanAddSelectedChannels,inspectExistingChannelRegistrations};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Prompt as m,isCancel as q}from"../../node_modules/.pnpm/@clack_core@1.3.1/node_modules/@clack/core/dist/index.js";import{renderMultiselectPrompt,renderSearchableSelect,renderSelectPrompt}from"./prompt-ui.js";import{createSelectOptionCodec}from"./select-option-codec.js";import{filterOptions,initialSelectState,orderedSelection,reduceSelect,searchActionQuery,selectValueAtCursor,submitRowIndex}from"./select-state.js";import pc from"#compiled/picocolors/index.js";function toPromptState(e){return e}var SelectComponent=class extends m{options;multiple;search;searchAction;required;filter=``;optionCursor=0;selectedSet=new Set;constructor(e){super({render:e.render,validate:()=>this.submitError()},!1),this.options=e.options,this.multiple=e.multiple,this.search=e.search,this.searchAction=e.searchAction,this.required=e.required,this.filter=e.initial.filter,this.optionCursor=e.initial.cursor,this.selectedSet=e.initial.selected,this.refreshValue(),this.on(`key`,(e,t)=>{if(this.multiple&&t?.name===`space`){this.apply({type:`toggle`});return}if(this.search){if(t?.name===`backspace`||e===``||e===`\b`){this.apply({type:`backspace`});return}e!==void 0&&e.length===1&&e>=` `&&e!==``&&this.apply({type:`char`,char:e})}}),this.on(`cursor`,e=>{e===`up`||e===`left`?this.apply({type:`up`}):(e===`down`||e===`right`)&&this.apply({type:`down`})})}visibleOptions(){return filterOptions(this.options,this.filter,this.searchAction)}onSubmitRow(){return this.multiple&&this.optionCursor===submitRowIndex(this.visibleOptions())}submitLabel(){if(this.required)return`Submit`;let e=new Set(this.options.filter(e=>e.locked).map(e=>e.value));return[...this.selectedSet].some(t=>!e.has(t))?`Submit`:`Skip`}_shouldSubmit(){return this.multiple?this.onSubmitRow()?!0:(this.apply({type:`toggle`}),!1):this.visibleOptions()[this.optionCursor]?.completed!==!0}selectedValues(){if(this.multiple)return orderedSelection(this.options,this.selectedSet);let e=selectValueAtCursor(this.visibleOptions(),this.optionCursor);return e===void 0?[]:[e]}submitDisplay(){if(this.multiple){let e=this.options.filter(e=>this.selectedSet.has(e.value)).map(e=>e.label);return e.length>0?e.join(`, `):pc.dim(`(none selected)`)}let e=selectValueAtCursor(this.visibleOptions(),this.optionCursor);return e===void 0?``:this.labelForValue(e)}labelForValue(e){let t=searchActionQuery(e);return t!==void 0&&this.searchAction!==void 0?this.searchAction.label(t):this.options.find(t=>t.value===e)?.label??e}submitError(){return this.multiple?this.required&&this.selectedSet.size===0?`Select at least one option, then press enter.`:void 0:selectValueAtCursor(this.visibleOptions(),this.optionCursor)===void 0?`Type to match an option, then press enter.`:void 0}apply(e){let t=reduceSelect({filter:this.filter,cursor:this.optionCursor,selected:this.selectedSet},e,{options:this.options,searchAction:this.searchAction,submitRow:this.multiple});this.filter=t.filter,this.optionCursor=t.cursor,this.selectedSet=t.selected,this.refreshValue()}refreshValue(){this.value=this.multiple?orderedSelection(this.options,this.selectedSet):selectValueAtCursor(this.visibleOptions(),this.optionCursor)}};function renderSelectComponent(e,t,a,o){let s=toPromptState(e.state);return e.search?renderSearchableSelect({colors:pc,state:s,leadingRail:a,message:t.message,multiple:e.multiple,filter:e.filter,placeholder:t.placeholder,options:e.visibleOptions(),cursor:e.optionCursor,selectedValues:e.selectedValues(),submitDisplay:e.submitDisplay(),footerNote:o,error:e.error,submitLabel:e.submitLabel()}):e.multiple?renderMultiselectPrompt({colors:pc,cursor:e.optionCursor,error:e.error,footerNote:o,leadingRail:a,message:t.message,options:e.options,selectedValues:e.selectedValues(),state:s,submitLabel:e.submitLabel()}):renderSelectPrompt({colors:pc,cursor:e.optionCursor,footerNote:o,leadingRail:a,message:t.message,options:e.options,state:s})}async function runSelectComponent(e){let n=createSelectOptionCodec(e.options),r=initialSelectState({options:n.options,defaultValue:e.defaultValue===void 0?void 0:n.encode(e.defaultValue),initialValues:e.initialValues?.map(e=>n.encode(e)),submitRow:e.multiple}),i,o,c=new SelectComponent({options:n.options,multiple:e.multiple,search:e.search,searchAction:e.searchAction===void 0?void 0:{label:e.searchAction.label},required:e.required,initial:r,render(){return i?renderSelectComponent(i,{message:e.message,placeholder:e.placeholder},e.leadingRail,o?.note()):``}});i=c,o=e.attachGuard?.(c);let l=await c.prompt();if(q(l))return l;if(l===void 0)throw Error(`Select prompt returned no value.`);if(Array.isArray(l))return l.map(e=>n.decode(e));let u=searchActionQuery(l);return u!==void 0&&e.searchAction!==void 0?e.searchAction.value(u):n.decode(l)}export{SelectComponent,runSelectComponent};
|
|
@@ -8,6 +8,8 @@ export interface SetupConnectionConnectorOptions {
|
|
|
8
8
|
projectRoot: string;
|
|
9
9
|
slug: string;
|
|
10
10
|
service: string;
|
|
11
|
+
creationType?: string;
|
|
12
|
+
connectionMethod?: "mcp" | "oauth";
|
|
11
13
|
canonicalConnectorName: string;
|
|
12
14
|
project: VercelProjectReference;
|
|
13
15
|
signal?: AbortSignal;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import{readProjectLink}from"#setup/project-resolution.js";import{captureVercel,runVercel,runVercelCaptureStdout}from"#setup/primitives/run-vercel.js";import{createPromptCommandOutput,withPhase}from"#setup/cli/index.js";const CREATED_CONNECTOR=/\bConnector created:\s*(scl_[A-Za-z0-9_-]+)\b/u;function isRecord(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function parseJson(e){try{return JSON.parse(e)}catch{return}}function connectorCreationFailure(e,t){let n=t?.split(`
|
|
2
|
-
`).map(e=>e.trim()).filter(e=>e.length>0&&!e.startsWith(`Vercel CLI `)).at(-1);return n===void 0?`Could not create the ${e} connector.`:`Could not create the ${e} connector. Vercel returned: ${n}`}function parseConnectorRef(e){if(!isRecord(e)||typeof e.uid!=`string`||typeof e.id!=`string`)return;let t={uid:e.uid,id:e.id};return typeof e.name==`string`&&(t.name=e.name),t}function parseCreatedConnector(e){let t=parseJson(e),n=parseConnectorRef(t);if(!isRecord(t)||n===void 0)return;let r=t.supportedSubjectTypes;return Array.isArray(r)&&r.includes(`user`)?n:void 0}function parseConnectorList(e,t){let n=[];for(let r of e){if(!isRecord(r)||typeof r.service==`string`&&r.service!==t)continue;let e=parseConnectorRef(r);e!==void 0&&n.push(e)}return n}function parseConnectorListPage(e,t){if(!isRecord(e)||!Array.isArray(e.connectors))return;let n=typeof e.cursor==`string`?e.cursor:void 0;return n===void 0?{connectors:parseConnectorList(e.connectors,t)}:{connectors:parseConnectorList(e.connectors,t),cursor:n}}async function listConnectors(e,n,r){let i=[],a=new Set,o;do{let s=[`connect`,`list`,`-F`,`json`,`--all-projects`,`--service`,e.service,`--scope`,n.orgId];o!==void 0&&s.push(`--next`,o);let c=await captureVercel(s,{cwd:e.projectRoot,onOutput:r,signal:e.signal});if(!c.ok)throw Error(c.failure.message);let l=parseConnectorListPage(parseJson(c.stdout),e.service);if(l===void 0)throw Error(`Vercel returned an invalid connector list for ${e.service}.`);i.push(...l.connectors);let u=l.cursor;if(u!==void 0&&a.has(u))throw Error(`The connector list repeated cursor ${u}.`);u!==void 0&&a.add(u),o=u}while(o!==void 0);return i}async function supportsUserAuthorization(e,n,r,i){let a=await captureVercel([`api`,`/v1/connect/connectors/${encodeURIComponent(r.id)}`,`--scope`,n.orgId,`--raw`],{cwd:e.projectRoot,onOutput:i,signal:e.signal});if(!a.ok)throw Error(`Could not verify connector ${r.uid}.`);let o=parseJson(a.stdout);if(!isRecord(o)||o.id!==r.id||o.uid!==r.uid||typeof o.service==`string`&&o.service!==e.service)throw Error(`Vercel returned invalid details for connector ${r.uid}.`);let s=o.supportedSubjectTypes;return Array.isArray(s)&&s.includes(`user`)}function connectorNames(e){let t=new Set;for(let n of e){n.name!==void 0&&t.add(n.name.toLowerCase());let e=n.uid.slice(n.uid.lastIndexOf(`/`)+1).trim();e.length>0&&t.add(e.toLowerCase())}return t}function connectorMatchesCanonicalName(e,t){let n=t.toLowerCase();return e.name?.toLowerCase()===n||e.uid.slice(e.uid.lastIndexOf(`/`)+1).trim().toLowerCase()===n}function nextConnectorName(e,t){if(!t.has(e.toLowerCase()))return e;let n=2;for(;t.has(`${e}-${n}`.toLowerCase());)n+=1;return`${e}-${n}`}async function cleanupCreatedConnectionConnector(t){let r=t.orgId??(await readProjectLink(t.projectRoot))?.orgId,a=[`connect`,`remove`,t.connectorId,`--disconnect-all`,`--yes`];if(r!==void 0&&a.push(`--scope`,r),!await runVercel(a,{cwd:t.projectRoot,onOutput:createPromptCommandOutput(t.log)}))throw Error(`Could not remove connector ${t.connectorId}; run \`vercel connect remove ${t.connectorId} --disconnect-all --yes\`.`)}async function attach(e,t,r,i){return runVercel([`connect`,`attach`,r,`--yes`,`--scope`,t.orgId],{cwd:e.projectRoot,onOutput:i,signal:e.signal})}async function resolveFallbackConnector(e,t,n,i,s){let c=s;for(;;){if(await e.prompter.select({message:`Which connector should ${e.slug} use?`,hintLayout:`inline`,notices:[{tone:`warning`,text:c}],options:[{value:`find`,label:`Find a new one`,hint:`Browse existing connectors`},{value:`create`,label:`Create a new one`,hint:`Register another connector`}]})===`find`){let r=[];for(let a of i)await supportsUserAuthorization(e,t,a,n)&&r.push(a);if(r.length===0){c=`No existing ${e.service} connectors support user authorization.`;continue}let a=new Map(r.map(e=>[e.uid,e])),o=await e.prompter.select({message:`Select a connector for ${e.slug}`,hintLayout:`inline`,search:!0,placeholder:`type to search connectors`,options:r.map(e=>({value:e.uid,label:e.uid,hint:e.name??e.id}))}),s=a.get(o);if(s===void 0)throw Error(`Connector ${o} is no longer available.`);return{kind:`existing`,connector:s}}let s=connectorNames(i),l=(await e.prompter.text({message:`New connector name`,defaultValue:nextConnectorName(e.slug,s),validate:e=>{let t=e.trim().toLowerCase();return t.length===0?`A name is required.`:s.has(t)?`A connector with this name already exists.`:void 0}})).trim(),u=[],createOutput=e=>{u.push(e.text),n(e)},d=await withPhase(e.log,`Waiting for you to complete setup in the browser…`,()=>runVercelCaptureStdout([`connect`,`create`,e.service,`--name`,l,`-F`,`json`,`--scope`,t.orgId],{cwd:e.projectRoot,onOutput:createOutput,signal:e.signal}),{kind:`external-action`,emphasis:`browser`}),f=parseConnectorRef(parseJson(d.stdout))?.id??CREATED_CONNECTOR.exec(u.join(`
|
|
2
|
+
`).map(e=>e.trim()).filter(e=>e.length>0&&!e.startsWith(`Vercel CLI `)).at(-1);return n===void 0?`Could not create the ${e} connector.`:`Could not create the ${e} connector. Vercel returned: ${n}`}function parseConnectorRef(e){if(!isRecord(e)||typeof e.uid!=`string`||typeof e.id!=`string`)return;let t={uid:e.uid,id:e.id};return typeof e.name==`string`&&(t.name=e.name),t}function parseCreatedConnector(e){let t=parseJson(e),n=parseConnectorRef(t);if(!isRecord(t)||n===void 0)return;let r=t.supportedSubjectTypes;return Array.isArray(r)&&r.includes(`user`)?n:void 0}function parseConnectorList(e,t){let n=[];for(let r of e){if(!isRecord(r)||typeof r.service==`string`&&r.service!==t)continue;let e=parseConnectorRef(r);e!==void 0&&n.push(e)}return n}function parseConnectorListPage(e,t){if(!isRecord(e)||!Array.isArray(e.connectors))return;let n=typeof e.cursor==`string`?e.cursor:void 0;return n===void 0?{connectors:parseConnectorList(e.connectors,t)}:{connectors:parseConnectorList(e.connectors,t),cursor:n}}async function listConnectors(e,n,r){let i=[],a=new Set,o;do{let s=[`connect`,`list`,`-F`,`json`,`--all-projects`,`--service`,e.service,`--scope`,n.orgId];o!==void 0&&s.push(`--next`,o);let c=await captureVercel(s,{cwd:e.projectRoot,onOutput:r,signal:e.signal});if(!c.ok)throw Error(c.failure.message);let l=parseConnectorListPage(parseJson(c.stdout),e.service);if(l===void 0)throw Error(`Vercel returned an invalid connector list for ${e.service}.`);i.push(...l.connectors);let u=l.cursor;if(u!==void 0&&a.has(u))throw Error(`The connector list repeated cursor ${u}.`);u!==void 0&&a.add(u),o=u}while(o!==void 0);return i}async function supportsUserAuthorization(e,n,r,i){let a=await captureVercel([`api`,`/v1/connect/connectors/${encodeURIComponent(r.id)}`,`--scope`,n.orgId,`--raw`],{cwd:e.projectRoot,onOutput:i,signal:e.signal});if(!a.ok)throw Error(`Could not verify connector ${r.uid}.`);let o=parseJson(a.stdout);if(!isRecord(o)||o.id!==r.id||o.uid!==r.uid||typeof o.service==`string`&&o.service!==e.service)throw Error(`Vercel returned invalid details for connector ${r.uid}.`);let s=o.supportedSubjectTypes;return Array.isArray(s)&&s.includes(`user`)}function connectorNames(e){let t=new Set;for(let n of e){n.name!==void 0&&t.add(n.name.toLowerCase());let e=n.uid.slice(n.uid.lastIndexOf(`/`)+1).trim();e.length>0&&t.add(e.toLowerCase())}return t}function connectorMatchesCanonicalName(e,t){let n=t.toLowerCase();return e.name?.toLowerCase()===n||e.uid.slice(e.uid.lastIndexOf(`/`)+1).trim().toLowerCase()===n}function nextConnectorName(e,t){if(!t.has(e.toLowerCase()))return e;let n=2;for(;t.has(`${e}-${n}`.toLowerCase());)n+=1;return`${e}-${n}`}async function cleanupCreatedConnectionConnector(t){let r=t.orgId??(await readProjectLink(t.projectRoot))?.orgId,a=[`connect`,`remove`,t.connectorId,`--disconnect-all`,`--yes`];if(r!==void 0&&a.push(`--scope`,r),!await runVercel(a,{cwd:t.projectRoot,onOutput:createPromptCommandOutput(t.log)}))throw Error(`Could not remove connector ${t.connectorId}; run \`vercel connect remove ${t.connectorId} --disconnect-all --yes\`.`)}async function attach(e,t,r,i){return runVercel([`connect`,`attach`,r,`--yes`,`--scope`,t.orgId],{cwd:e.projectRoot,onOutput:i,signal:e.signal})}async function resolveFallbackConnector(e,t,n,i,s){let c=s;for(;;){if(await e.prompter.select({message:`Which connector should ${e.slug} use?`,hintLayout:`inline`,notices:[{tone:`warning`,text:c}],options:[{value:`find`,label:`Find a new one`,hint:`Browse existing connectors`},{value:`create`,label:`Create a new one`,hint:`Register another connector`}]})===`find`){let r=[];for(let a of i)await supportsUserAuthorization(e,t,a,n)&&r.push(a);if(r.length===0){c=`No existing ${e.service} connectors support user authorization.`;continue}let a=new Map(r.map(e=>[e.uid,e])),o=await e.prompter.select({message:`Select a connector for ${e.slug}`,hintLayout:`inline`,search:!0,placeholder:`type to search connectors`,options:r.map(e=>({value:e.uid,label:e.uid,hint:e.name??e.id}))}),s=a.get(o);if(s===void 0)throw Error(`Connector ${o} is no longer available.`);return{kind:`existing`,connector:s}}let s=connectorNames(i),l=(await e.prompter.text({message:`New connector name`,defaultValue:nextConnectorName(e.slug,s),validate:e=>{let t=e.trim().toLowerCase();return t.length===0?`A name is required.`:s.has(t)?`A connector with this name already exists.`:void 0}})).trim(),u=[],createOutput=e=>{u.push(e.text),n(e)},d=await withPhase(e.log,`Waiting for you to complete setup in the browser…`,()=>runVercelCaptureStdout([`connect`,`create`,e.creationType??e.service,`--name`,l,...e.connectionMethod===void 0?[]:[`--connection-method`,e.connectionMethod],`-F`,`json`,`--scope`,t.orgId],{cwd:e.projectRoot,onOutput:createOutput,signal:e.signal}),{kind:`external-action`,emphasis:`browser`}),f=parseConnectorRef(parseJson(d.stdout))?.id??CREATED_CONNECTOR.exec(u.join(`
|
|
3
3
|
`))?.[1],p=d.ok?parseCreatedConnector(d.stdout):void 0;if(p!==void 0)return{kind:`created`,connector:p};let m=d.ok?`The ${e.service} connector does not support user authorization.`:connectorCreationFailure(e.service,d.stderr);if(f!==void 0){try{await cleanupCreatedConnectionConnector({log:e.log,projectRoot:e.projectRoot,connectorId:f,orgId:t.orgId})}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`${m} ${t}`)}e.signal?.throwIfAborted()}throw Error(m)}}async function setupConnectionConnector(e){let t=createPromptCommandOutput(e.log),n=e.project,r=await listConnectors(e,n,t),a=r.find(t=>connectorMatchesCanonicalName(t,e.canonicalConnectorName)),o=`Could not find a connector named ${e.canonicalConnectorName}.`;if(a!==void 0)if(await supportsUserAuthorization(e,n,a,t)){if(await attach(e,n,a.uid,t))return e.log.success(`Attached ${a.uid} connector`),{kind:`existing`,connectorUid:a.uid};e.signal?.throwIfAborted(),o=`Could not attach ${a.uid}.`}else o=`${a.uid} does not support user authorization.`;let s=await resolveFallbackConnector(e,n,t,r,o);if(!await attach(e,n,s.connector.uid,t)){if(s.kind===`created`){let t=`Could not attach ${s.connector.uid} to the linked project.`;try{await cleanupCreatedConnectionConnector({log:e.log,projectRoot:e.projectRoot,connectorId:s.connector.id,orgId:n.orgId})}catch(e){let n=e instanceof Error?e.message:String(e);throw Error(`${t} ${n}`)}throw e.signal?.throwIfAborted(),Error(t)}throw Error(`Could not attach ${s.connector.uid} to the linked project.`)}return e.log.success(`Attached ${s.connector.uid} connector`),s.kind===`created`?{kind:`created`,connectorUid:s.connector.uid,connectorId:s.connector.id}:{kind:`existing`,connectorUid:s.connector.uid}}export{cleanupCreatedConnectionConnector,parseCreatedConnector,setupConnectionConnector};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{AI_GATEWAY_API_KEY_ENV_VAR}from"../ai-gateway-api-key.js";import{interactiveAsker,withAnswers}from"../ask.js";import{detectProjectIdentity}from"../project-resolution.js";import{withSpinner}from"../with-spinner.js";import{snapshotSetupState}from"../state.js";import{detectAiGateway,findEnvFileWithKey}from"../boxes/detect-ai-gateway.js";import{applyAiGatewayCredential}from"../boxes/apply-ai-gateway-credential.js";import{linkVercelProject}from"../boxes/link-project.js";import{resolveProvisioning}from"../boxes/resolve-provisioning.js";import{WizardCancelledError}from"../step.js";import{runInteractive}from"../runner.js";import{inProjectSetupState,prompterSink}from"./in-project.js";import pc from"#compiled/picocolors/index.js";import{hasEnvValue,resolveGatewayCredential}from"#internal/resolve-model-endpoint-status.js";async function runLinkFlow(i){let{appRoot:a,prompter:o,signal:s,projectSelection:c=`existing-only`}=i,l={detectProjectIdentity,findEnvFileWithKey,env:process.env,...i.deps},u=await withSpinner(o,`Checking the current Vercel link...`,async()=>{let e=await l.detectProjectIdentity(a,{signal:s});return s?.throwIfAborted(),e});if(u===void 0){let[t,n]=await Promise.all([l.findEnvFileWithKey(a,AI_GATEWAY_API_KEY_ENV_VAR),l.findEnvFileWithKey(a,`VERCEL_OIDC_TOKEN`)]),r=t??n;r!==void 0&&i.teamSelectMessage===void 0&&o.log.message(`This directory is not linked to a Vercel project yet — the model currently runs on credentials from ${r}.`)}else{let e=u.teamName===void 0?pc.bold(u.projectName):`${pc.bold(u.projectName)} in ${pc.bold(u.teamName)}`;try{if(await o.select({message:`This directory is already linked to\n${e}`,options:[{value:`relink`,label:`Link to another project`},{value:`dismiss`,label:`Dismiss`}]})===`dismiss`)return{kind:`cancelled`}}catch(e){if(e instanceof WizardCancelledError)return{kind:`cancelled`};throw e}}let d=inProjectSetupState(a,{kind:`unresolved`});if((await runInteractive([resolveProvisioning({asker:withAnswers({deploy:`vercel`})(interactiveAsker(o)),prompter:o,targetDirectory:a,mode:{headless:!1},adoptExistingLink:!1,projectSelection:c,teamSelectMessage:i.teamSelectMessage,deps:l.resolveProvisioning}),linkVercelProject({prompter:o,deps:l.linkProject}),detectAiGateway(),applyAiGatewayCredential({prompter:o,deps:l.applyAiGatewayCredential})],d,prompterSink(o),{snapshot:snapshotSetupState,signal:s})).kind===`cancelled`)return{kind:`cancelled`};let[f,p]=await Promise.all([l.findEnvFileWithKey(a,`VERCEL_OIDC_TOKEN`),l.findEnvFileWithKey(a,AI_GATEWAY_API_KEY_ENV_VAR)]);s?.throwIfAborted(),f===void 0&&p===void 0&&o.log.warning("Linked, but no model credential landed in an env file (VERCEL_OIDC_TOKEN or AI_GATEWAY_API_KEY). Run `vercel env pull` once the project has AI Gateway access.");let m={kind:`done`},h={apiKeyInEnv:hasEnvValue(l.env[AI_GATEWAY_API_KEY_ENV_VAR])};p!==void 0&&(h.apiKeyFile=p),f!==void 0&&(h.oidcFile=f);let g=resolveGatewayCredential(h);return g!==void 0&&(m.resolution=g),m}export{runLinkFlow};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{join}from"node:path";import pc from"#compiled/picocolors/index.js";import{discoverAgent}from"#discover/discover-agent.js";import{formatLanguageModelGatewayId}from"#internal/runtime-model.js";import{CHATGPT_MODEL_SELECTION_PREFIX,parseChatGptModelSelection}from"#shared/chatgpt-model.js";import{createCompiledRuntimeModelCatalogLoader}from"#compiler/model-catalog.js";import{createStaticSourceChange}from"#source-change/static-source-change.js";function formatApplyModelSettingsOutcome(e){return e.kind===`rejected`?e.message:e.kind===`unchanged`?`Model settings are already up to date.`:e.changed.length===1&&e.changed[0]===`model`&&e.model!==void 0?`Model changed to ${pc.bold(e.model)}. Live on your next prompt.`:`Model settings updated: ${e.changed.map(t=>t===`model`?`model ${e.model??`updated`}`:t===`reasoning`?`reasoning ${e.reasoning??`provider default`}`:`Fast mode ${e.fastMode?`on`:`off`}`).join(`, `)}. Live on your next prompt.`}function formatApplyModelOutcome(e){switch(e.kind){case`changed`:return`Model changed to ${pc.bold(e.to)}. Live on your next prompt.`;case`unchanged`:return`Model is already \`${e.model}\`.`;case`rejected`:return e.message}}async function changeAgentModelSettings(t){let{appRoot:r,patch:i}=t;if(i.model.kind===`set`){let e=await validateModelSlug(r,i.model.value);if(e!==null)return{kind:`rejected`,message:e}}let{manifest:a}=await discoverAgent({agentRoot:join(r,`agent`),appRoot:r}),o=await createStaticSourceChange(a).updateModelSettings(i);if(o.kind===`bail`)return{kind:`rejected`,message:`Couldn't edit ${o.at.logicalPath}: ${o.reason}. Change the model settings by hand.`};if(o.changed.length===0)return{kind:`unchanged`};let s={kind:`changed`,changed:o.changed};return i.model.kind===`set`&&(s.model=i.model.value),i.reasoning.kind!==`keep`&&(s.reasoning=i.reasoning.kind===`set`?i.reasoning.value:null),i.gatewayServiceTier.kind!==`keep`&&(s.fastMode=i.gatewayServiceTier.kind===`set`),s}async function changeAgentModel(t){let{appRoot:r,slug:i}=t,a=await validateModelSlug(r,i);if(a!==null)return{kind:`rejected`,message:a};let{manifest:o}=await discoverAgent({agentRoot:join(r,`agent`),appRoot:r}),s=await createStaticSourceChange(o).updateModelName(i);return s.kind===`bail`?{kind:`rejected`,message:`Couldn't edit ${s.at.logicalPath}: ${s.reason}. Change \`model\` by hand.`}:s.from===s.to?{kind:`unchanged`,model:s.to}:{kind:`changed`,to:s.to}}async function validateModelSlug(e,t){if(parseChatGptModelSelection(t)!==void 0)return null;if(t.startsWith(CHATGPT_MODEL_SELECTION_PREFIX))return"Choose a bare OpenAI model id after `chatgpt/`.";if(!t.includes(`/`))return`\`${t}\` isn't a provider/model id (e.g. anthropic/claude-sonnet-5).`;let n=createCompiledRuntimeModelCatalogLoader(e);try{if(await n.getModelLimits(formatLanguageModelGatewayId(t))===null)return`I couldn't confirm \`${t}\` in the AI Gateway model catalog, so I didn't change agent.ts.`}catch{return null}return null}export{changeAgentModel,changeAgentModelSettings,formatApplyModelOutcome,formatApplyModelSettingsOutcome,validateModelSlug};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{AI_GATEWAY_API_KEY_ENV_VAR}from"../ai-gateway-api-key.js";import{withSpinner}from"../with-spinner.js";import{gatewayModelCapabilities}from"../boxes/model-capabilities.js";import{fetchGatewayCatalog,modelOptionsFromCatalog}from"../boxes/select-model.js";import{ensureChatGptAuth}from"./chatgpt-auth.js";import{WizardCancelledError}from"../step.js";import{changeAgentModelSettings,formatApplyModelSettingsOutcome}from"./model-source-change.js";import{runProviderFlow}from"./provider.js";import pc from"#compiled/picocolors/index.js";import{DEFAULT_AGENT_MODEL_ID}from"#shared/default-agent-model.js";import{inspectApplication}from"#services/inspect-application.js";import{readProviderSelection,resolveAvailableProviders,writeProviderSelection}from"#setup/provider-settings.js";import{formatModelSummary}from"#shared/model-summary.js";import{readGatewayServiceTier}from"#shared/gateway-service-tier.js";import{DEFAULT_CHATGPT_MODEL_SELECTION,isChatGptModelRouting,parseChatGptModelSelection}from"#shared/chatgpt-model.js";const MODEL_MENU_MESSAGE=``;function providerSelectionHint(t,n){return t===`chatgpt`?n===void 0?`ChatGPT subscription`:`ChatGPT subscription (${n})`:t===`ai-gateway-project`?`AI Gateway via Project`:`AI Gateway via ${AI_GATEWAY_API_KEY_ENV_VAR}`}function modelListRows(e){return modelOptionsFromCatalog(e).map(e=>{let t={value:e.value,label:e.value};return e.featured===!0&&(t.featured=!0),t})}function formatModelDraftHint(e,t,n){let r={model:e};return t!==null&&(r.reasoning=t),n.kind===`priority`&&(r.fastGlyph=`↯`),formatModelSummary(r)}function modelMenuRows(e,t,n,r,i,a,o,s,c){let l;s||c?(l={value:`model`,label:`Change model`,description:s?`The model, its reasoning effort, and the Gateway service tier`:`Reasoning and service tier; the model itself is an SDK model call in agent.ts`},e!==null&&(l.hint=formatModelDraftHint(e,t,n))):l={value:`model`,label:`Change model`,disabled:!0,description:`Set via an SDK model call in agent.ts; edit the source to change it`};let d;return d=o?.kind===`external`&&!isChatGptModelRouting(o)?{disabled:!0,value:`provider`,label:`Change provider`,description:`Disabled in external endpoint mode`}:i?{value:`provider`,label:`Change provider`,hint:providerSelectionHint(r,a),description:`How your agent reaches the model provider`}:{value:`provider`,label:pc.bold(`Configure model access`),hint:pc.yellow(`Not configured`),description:`How your agent reaches the model provider`,accent:`warning`},[l,d,{value:`done`,label:`Done`}]}async function runModelFlow(e){let{appRoot:i,prompter:u,signal:f}=e,p={readCurrentModel:readCurrentAgentModel,applySettings:changeAgentModelSettings,resolveAvailableProviders,readProviderSelection,runProviderFlow,ensureChatGptAuth,writeProviderSelection,...e.deps},m=p.selectModel?.fetchModels??fetchGatewayCatalog,[h,g,_,v]=await withSpinner(u,`Checking the project…`,()=>Promise.all([p.readCurrentModel(i),p.resolveAvailableProviders(i,f===void 0?{env:process.env}:{signal:f,env:process.env}),p.readProviderSelection(i),m(f).catch(()=>void 0)]));f?.throwIfAborted();let{id:y,routing:b,serviceTier:x,editable:S,settingsEditable:C}=h,w=h.reasoning===`provider-default`?null:h.reasoning,T=_??(g.includes(`ai-gateway-key`)?`ai-gateway-key`:`ai-gateway-project`),E=g.includes(T),D,O={model:{kind:`keep`},reasoning:{kind:`keep`},gatewayServiceTier:{kind:`keep`}},k,A,j=!1,M=!1,N=b?.kind===`external`&&!isChatGptModelRouting(b),P=N?{tone:`warning`,text:"`agent.ts` specifies the model provider directly. Model, provider, and service-tier changes stay source-owned; reasoning remains configurable here."}:void 0,F=!E&&b?.kind!==`external`?`provider`:S||C?`model`:`provider`,I=b?.kind!==`external`&&(e.initialStep===`provider`||!E);for(;;){let t;if(I)I=!1,t=`provider`;else try{t=await u.select({message:``,options:modelMenuRows(y,w,isChatGptModelRouting(b)?{kind:`standard`}:x,T,E,e.chatGptAccountLabel,b,S,C),hintLayout:`stacked`,initialValue:F,notices:P===void 0?[]:[P]})}catch(e){if(!(e instanceof WizardCancelledError))throw e;if(hasModelSettingsChanges(O))return{kind:`cancelled`,discardedDraft:!0};break}if(t===`done`){M=!0;break}if(t===`model`){let e=p.pickModelSettings;if(e===void 0)throw Error(`runModelFlow requires a pickModelSettings dep to open the model screen.`);let t=await e({model:S?{kind:`pick`,options:modelListRows(v),current:y}:{kind:`fixed`,current:y,reason:`Set via an SDK model call in agent.ts; edit the source to change it`},reasoning:w,serviceTier:isChatGptModelRouting(b)?{kind:`standard`}:x,settingsEditable:C,externalRouting:N,capabilitiesFor:e=>gatewayModelCapabilities(v,e)});if(f?.throwIfAborted(),t===void 0){F=`model`;continue}t.model!==void 0&&(y=t.model,b=routingForModelSelection(t.model),O.model={kind:`set`,value:t.model}),t.reasoning!==void 0&&(w=t.reasoning==="default"?null:t.reasoning,O.reasoning=w===null?{kind:`remove`}:{kind:`set`,value:w}),t.serviceTier!==void 0&&!isChatGptModelRouting(b)&&(x=t.serviceTier===`priority`?{kind:`priority`}:{kind:`standard`},O.gatewayServiceTier=t.serviceTier===`priority`?{kind:`set`,value:`priority`}:{kind:`remove`}),F=`done`;continue}let r=await p.runProviderFlow({appRoot:i,prompter:u,signal:f,availableProviders:g,selectedProvider:T});if(r.kind===`cancelled`){if(f?.aborted)return{kind:`cancelled`};F=`provider`;continue}if(r.kind===`external-provider`){if(f?.aborted)return{kind:`cancelled`};F=`done`;continue}D=r.kind,D===`chatgpt`?(j=!0,isChatGptModelRouting(b)||(O.model={kind:`set`,value:DEFAULT_CHATGPT_MODEL_SELECTION},O.gatewayServiceTier={kind:`remove`})):isChatGptModelRouting(b)&&(O.model={kind:`set`,value:DEFAULT_AGENT_MODEL_ID}),M=!0;break}let L=O.model.kind===`set`&&parseChatGptModelSelection(O.model.value)!==void 0;if(M&&L&&(O.gatewayServiceTier={kind:`remove`},j=!0),M&&j&&await authenticateChatGpt(p,e.withExclusiveTerminal),M&&hasModelSettingsChanges(O)&&(k=await p.applySettings({appRoot:i,patch:O})),M&&D!==void 0&&k?.kind!==`rejected`&&(await p.writeProviderSelection(i,D),A=D),k!==void 0&&A===void 0&&f?.throwIfAborted(),k===void 0&&A===void 0&&!j)return{kind:`cancelled`};let R={kind:`done`,accessChanged:k?.kind===`changed`||A!==void 0||j};return k===void 0?j&&(R.modelMessage=`ChatGPT login ready.`):R.modelMessage=formatApplyModelSettingsOutcome(k),A!==void 0&&(R.providerSelection=A),R}function routingForModelSelection(e){return parseChatGptModelSelection(e)===void 0?{kind:`gateway`,target:e.split(`/`)[0]??``}:{kind:`external`,provider:`codex`}}async function authenticateChatGpt(e,t){let authenticate=()=>e.ensureChatGptAuth();await(t===void 0?authenticate():t(authenticate))}function hasModelSettingsChanges(e){return e.model.kind!==`keep`||e.reasoning.kind!==`keep`||e.gatewayServiceTier.kind!==`keep`}async function readCurrentAgentModel(e){try{let{compiledState:t}=await inspectApplication(e),n=t?.manifest.config,r=n?.model,i=isChatGptModelRouting(r?.routing);return{id:i&&r!==void 0?`chatgpt/${r.id}`:r?.id??null,routing:r?.routing??null,reasoning:n?.reasoning??null,serviceTier:readGatewayServiceTier(r?.providerOptions),editable:r!==void 0&&(r.source===void 0||i),settingsEditable:n?.source!==void 0}}catch{return{id:null,routing:null,reasoning:null,serviceTier:{kind:`standard`},editable:!1,settingsEditable:!1}}}async function modelChangeRefusalForUneditableModel(e){let{editable:t,routing:n}=await readCurrentAgentModel(e);return t?null:`Model is set via ${n?.kind===`external`?`the external provider \`${n.provider}\``:`an SDK model call`} in agent.ts, not a string literal; /model can't rewrite it. Edit \`model\` in agent.ts.`}export{MODEL_MENU_MESSAGE,modelChangeRefusalForUneditableModel,runModelFlow};
|