eve 0.73.0 → 0.75.0
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 +38 -0
- package/dist/src/_virtual/_rolldown/runtime.js +1 -1
- package/dist/src/channel/auth/result.d.ts +4 -0
- package/dist/src/channel/auth/result.js +1 -0
- package/dist/src/channel/schedule.d.ts +20 -6
- package/dist/src/channel/schedule.js +1 -1
- package/dist/src/channel/types.d.ts +18 -2
- package/dist/src/chunks/{use-eve-agent-hZJ7CB8t.js → use-eve-agent-B2Kne9z6.js} +20 -5
- package/dist/src/chunks/{use-eve-agent-C1GYGCtb.js → use-eve-agent-DK_T88EP.js} +20 -5
- 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/integration-setup.js +1 -1
- package/dist/src/cli/commands/registry-declared-setups.d.ts +19 -0
- package/dist/src/cli/commands/registry-declared-setups.js +1 -1
- package/dist/src/cli/commands/registry-recovery.d.ts +3 -1
- package/dist/src/cli/commands/registry-recovery.js +1 -1
- package/dist/src/cli/commands/registry.d.ts +12 -4
- package/dist/src/cli/commands/registry.js +1 -1
- package/dist/src/cli/dev/tui/registry-result-message.js +1 -1
- package/dist/src/cli/dev/tui/setup-commands.d.ts +2 -0
- package/dist/src/cli/dev/tui/setup-commands.js +2 -2
- package/dist/src/cli/dev/tui/stream-format.js +2 -2
- package/dist/src/client/index.d.ts +1 -0
- package/dist/src/client/message-reducer.js +1 -1
- package/dist/src/client/session.d.ts +1 -1
- package/dist/src/client/session.js +1 -1
- package/dist/src/client/sessions.d.ts +1 -1
- package/dist/src/client/types.d.ts +6 -0
- package/dist/src/compiled/.vendor-stamp.json +2 -1
- package/dist/src/compiled/@vercel/schedules/index.d.ts +158 -0
- package/dist/src/compiled/@vercel/schedules/index.js +17 -0
- package/dist/src/compiler/extension-compatibility.d.ts +24 -18
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/compiler/load-binding-namespace.d.ts +5 -0
- package/dist/src/compiler/load-binding-namespace.js +1 -1
- package/dist/src/compiler/manifest.d.ts +39 -0
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/memory-wrapper-candidates.d.ts +2 -0
- package/dist/src/compiler/memory-wrapper-candidates.js +1 -0
- package/dist/src/compiler/module-lifecycle.d.ts +1 -1
- package/dist/src/compiler/module-lifecycle.js +1 -1
- package/dist/src/compiler/module-map.js +1 -1
- package/dist/src/compiler/normalize-agent-config.js +1 -1
- package/dist/src/compiler/normalize-manifest.js +1 -1
- package/dist/src/compiler/normalize-schedule-collection.d.ts +3 -0
- package/dist/src/compiler/normalize-schedule-collection.js +1 -0
- package/dist/src/compiler/normalize-schedule.d.ts +2 -2
- package/dist/src/compiler/normalize-schedule.js +1 -1
- package/dist/src/compiler/resolve-workspace-subagent.js +1 -1
- package/dist/src/compiler/schedule-collection-wrapper-candidates.d.ts +2 -0
- package/dist/src/compiler/schedule-collection-wrapper-candidates.js +1 -0
- package/dist/src/compiler/validate-artifact.js +1 -1
- package/dist/src/context/build-callback-context.js +1 -1
- package/dist/src/context/dynamic-connection-lifecycle.d.ts +6 -0
- package/dist/src/context/dynamic-connection-lifecycle.js +1 -1
- package/dist/src/context/dynamic-resolve-context.js +1 -1
- package/dist/src/context/key-names.d.ts +1 -0
- package/dist/src/context/key-names.js +1 -1
- package/dist/src/context/keys.d.ts +6 -1
- package/dist/src/context/keys.js +1 -1
- package/dist/src/context/providers/sandbox.js +1 -1
- package/dist/src/context/providers/tool-stubs-key.d.ts +8 -0
- package/dist/src/context/providers/tool-stubs-key.js +1 -0
- package/dist/src/context/providers/tool-stubs.d.ts +10 -0
- package/dist/src/context/providers/tool-stubs.js +1 -0
- package/dist/src/context/run-step.js +1 -1
- package/dist/src/context/schedule-collection-tools.d.ts +9 -0
- package/dist/src/context/schedule-collection-tools.js +1 -0
- package/dist/src/context/session-context.d.ts +4 -1
- package/dist/src/context/session-schedule.d.ts +9 -0
- package/dist/src/context/session-schedule.js +1 -0
- package/dist/src/dynamic/definition.d.ts +1 -0
- package/dist/src/evals/index.d.ts +1 -0
- package/dist/src/evals/runner/execute-task.js +1 -1
- package/dist/src/evals/session-manager.d.ts +2 -0
- package/dist/src/evals/session-manager.js +1 -1
- package/dist/src/eve-channel/create-request.d.ts +2 -0
- package/dist/src/eve-channel/index.js +1 -1
- package/dist/src/eve-channel/request.js +1 -1
- package/dist/src/execution/agent-sessions/context.d.ts +4 -0
- package/dist/src/execution/agent-sessions/context.js +1 -1
- package/dist/src/execution/agent-sessions/steps.js +1 -1
- package/dist/src/execution/cancelled-model-call-batch.js +1 -1
- package/dist/src/execution/dynamic-connection-recovery.d.ts +14 -0
- package/dist/src/execution/dynamic-connection-recovery.js +1 -0
- package/dist/src/execution/dynamic-workflow/tool.js +1 -1
- package/dist/src/execution/forward-session-input.js +1 -1
- package/dist/src/execution/legacy-session/authorization.js +1 -1
- package/dist/src/execution/legacy-session/completion-step.js +1 -1
- package/dist/src/execution/legacy-session/inbox.js +1 -1
- package/dist/src/execution/legacy-session/interrupt-step.js +1 -1
- package/dist/src/execution/proxied-deliver-step.js +1 -1
- package/dist/src/execution/runtime-context.js +1 -1
- package/dist/src/execution/sandbox/bindings/docker.js +1 -1
- package/dist/src/execution/sandbox/bindings/just-bash-runtime.js +1 -1
- package/dist/src/execution/sandbox/bindings/just-bash.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-lifecycle.js +1 -1
- package/dist/src/execution/sandbox/bindings/vercel.js +1 -1
- package/dist/src/execution/sandbox/ensure.d.ts +3 -1
- package/dist/src/execution/sandbox/ensure.js +1 -1
- package/dist/src/execution/session/active-turn.js +1 -1
- package/dist/src/execution/session/admission.js +1 -1
- package/dist/src/execution/session/checkpoint-migrations.js +1 -1
- package/dist/src/execution/session/end-sandbox-step.d.ts +12 -0
- package/dist/src/execution/session/end-sandbox-step.js +1 -0
- package/dist/src/execution/session/entry.js +1 -1
- package/dist/src/execution/session/finalization.js +1 -1
- package/dist/src/execution/session/handoff-steps.js +1 -1
- package/dist/src/execution/session/handoff.d.ts +1 -1
- package/dist/src/execution/session/handoff.js +1 -1
- package/dist/src/execution/session/program.js +1 -1
- package/dist/src/execution/session/timeout-steps.js +1 -1
- package/dist/src/execution/session/turn-step.js +1 -1
- package/dist/src/execution/session/turn.js +1 -1
- package/dist/src/execution/session-inbox/inbox.d.ts +6 -1
- package/dist/src/execution/session-inbox/inbox.js +1 -1
- package/dist/src/execution/session-inbox/protocol.js +1 -1
- package/dist/src/execution/session-inbox/release-step.js +1 -1
- package/dist/src/execution/session-inbox/resume.d.ts +2 -1
- package/dist/src/execution/session-inbox/resume.js +1 -1
- package/dist/src/execution/session-workflow-tool-run.js +1 -1
- package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
- package/dist/src/execution/tasks/model-step.js +1 -1
- package/dist/src/execution/tasks/steps.js +1 -1
- package/dist/src/execution/tasks/table.d.ts +7 -1
- package/dist/src/execution/tasks/table.js +1 -1
- package/dist/src/execution/tool-stubs/playback.d.ts +11 -0
- package/dist/src/execution/tool-stubs/playback.js +1 -0
- package/dist/src/execution/tool-stubs/steps.d.ts +18 -0
- package/dist/src/execution/tool-stubs/steps.js +1 -0
- package/dist/src/execution/tools/agent-router-workflow.js +1 -1
- package/dist/src/execution/tools/connection-tools.d.ts +0 -6
- package/dist/src/execution/tools/connection-tools.js +2 -2
- package/dist/src/execution/tools/workflow/authorization-completion.js +1 -1
- package/dist/src/execution/tools/workflow/body.js +1 -1
- package/dist/src/execution/tools/workflow/serve.js +1 -1
- package/dist/src/execution/tools/workflow/withdraw-step.js +1 -1
- package/dist/src/execution/workflow-runtime.js +1 -1
- package/dist/src/execution/workflow-webhook-route.js +1 -1
- package/dist/src/framework/sources/modules/schedule-collection-wrapper.d.ts +2 -0
- package/dist/src/framework/sources/modules/schedule-collection-wrapper.js +1 -0
- package/dist/src/framework/sources/registry.d.ts +1 -0
- package/dist/src/framework/sources/registry.js +1 -1
- package/dist/src/harness/compaction/step.js +1 -1
- package/dist/src/harness/coordination.js +1 -1
- package/dist/src/harness/emission.d.ts +1 -0
- package/dist/src/harness/emission.js +1 -1
- package/dist/src/harness/hitl/approved-calls.d.ts +2 -0
- package/dist/src/harness/hitl/approved-calls.js +1 -1
- package/dist/src/harness/hitl/index.d.ts +9 -1
- package/dist/src/harness/hitl/index.js +1 -1
- package/dist/src/harness/hitl/intake.js +1 -1
- package/dist/src/harness/model-call/call.d.ts +5 -0
- package/dist/src/harness/model-call/call.js +1 -1
- package/dist/src/harness/model-call/run.js +1 -1
- package/dist/src/harness/proxy-input-requests.d.ts +17 -6
- package/dist/src/harness/proxy-input-requests.js +1 -1
- package/dist/src/harness/session-machine/current.d.ts +4 -0
- package/dist/src/harness/session-machine/current.js +1 -1
- package/dist/src/harness/session-machine/transitions.d.ts +13 -0
- package/dist/src/harness/session-machine/transitions.js +1 -1
- package/dist/src/harness/step/after-model.js +1 -1
- package/dist/src/harness/step/context.d.ts +7 -2
- package/dist/src/harness/step/context.js +1 -1
- package/dist/src/harness/stream-actions.d.ts +6 -1
- package/dist/src/harness/stream-actions.js +1 -1
- package/dist/src/harness/tool-call-io.js +1 -1
- package/dist/src/harness/tool-loop.js +1 -1
- package/dist/src/harness/tools.js +1 -1
- package/dist/src/instrumentation/ai-sdk-hook-bridge.js +1 -1
- package/dist/src/instrumentation/lifecycle.d.ts +1 -0
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/authored-definition/schedule-collection.d.ts +2 -0
- package/dist/src/internal/authored-definition/schedule-collection.js +1 -0
- package/dist/src/internal/authored-definition/schema-backed.js +1 -1
- package/dist/src/internal/authored-module-loader.d.ts +7 -0
- package/dist/src/internal/authored-module-loader.js +2 -2
- package/dist/src/internal/authored-module-map-loader.js +1 -1
- package/dist/src/internal/authored-runtime-modules.d.ts +1 -0
- package/dist/src/internal/authored-runtime-modules.js +1 -1
- package/dist/src/internal/invocation/workflow-execution.js +1 -1
- package/dist/src/internal/nitro/development-generation.js +1 -1
- package/dist/src/internal/nitro/host/configure-nitro-routes.js +2 -2
- package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
- package/dist/src/internal/nitro/host/extension-capability-requirements.js +1 -1
- package/dist/src/internal/nitro/host/vercel-build-output-config.d.ts +12 -0
- package/dist/src/internal/nitro/host/vercel-build-output-config.js +1 -1
- package/dist/src/internal/nitro/routes/channel-dispatch.js +1 -1
- package/dist/src/internal/nitro/routes/schedule-collection-consumer.d.ts +3 -0
- package/dist/src/internal/nitro/routes/schedule-collection-consumer.js +1 -0
- package/dist/src/internal/schedules/consumer-route.d.ts +17 -0
- package/dist/src/internal/schedules/consumer-route.js +1 -0
- package/dist/src/internal/schedules/verify-delivery.d.ts +25 -0
- package/dist/src/internal/schedules/verify-delivery.js +1 -0
- package/dist/src/internal/workflow/cancel-expired-development-run.js +1 -1
- package/dist/src/internal/workflow-bundle/workflow-builders.js +1 -1
- package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/cli-config.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/cred-storage.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/index.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/schema.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/schema.zod.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/types.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/envpath.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/errors.js +2 -0
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/errutils.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/exec.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/fsutils.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/index.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/lookup.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/safety.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/auth-errors.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/exchange-vercel-oidc-token.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/get-context.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/get-vercel-oidc-token-sync.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/get-vercel-oidc-token-with-refresh.js +2 -0
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/index.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/oauth.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/token-error.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/token-io.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/token-util.js +2 -0
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/token.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/verify-vercel-oidc-token.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/version.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_queue@0.5.1_@opentelemetry_api@1.9.1/node_modules/@vercel/queue/dist/index.js +36 -0
- package/dist/src/node_modules/.pnpm/balanced-match@4.0.4/node_modules/balanced-match/dist/esm/index.js +1 -0
- package/dist/src/node_modules/.pnpm/brace-expansion@5.0.12/node_modules/brace-expansion/dist/esm/index.js +1 -0
- package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js +1 -0
- package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js +1 -0
- package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js +1 -0
- package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js +1 -0
- package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js +1 -0
- package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js +1 -0
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/index.js +1 -0
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/command.js +1 -0
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/error.js +2 -0
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/kill.js +1 -0
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/promise.js +1 -0
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/stdio.js +1 -0
- package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/stream.js +1 -0
- package/dist/src/node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/buffer-stream.js +1 -0
- package/dist/src/node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/index.js +1 -0
- package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/core.js +1 -0
- package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/main.js +1 -0
- package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/realtime.js +1 -0
- package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/signals.js +1 -0
- package/dist/src/node_modules/.pnpm/is-stream@2.0.1/node_modules/is-stream/index.js +1 -0
- package/dist/src/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js +1 -0
- package/dist/src/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js +1 -0
- package/dist/src/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/index.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/compact/decrypt.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/compact/encrypt.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/flattened/decrypt.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/flattened/encrypt.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/general/decrypt.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/general/encrypt.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwk/embedded.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwk/thumbprint.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwks/local.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwks/remote.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/compact/sign.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/compact/verify.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/flattened/sign.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/flattened/verify.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/general/sign.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/general/verify.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/decrypt.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/encrypt.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/produce.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/sign.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/unsecured.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/verify.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/export.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/generate_key_pair.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/generate_secret.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/import.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/aesgcmkw.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/buffer_utils.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/cek.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/check_iv_length.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/check_key_type.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/check_p2s.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/crypto_key.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/decrypt_key_management.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/encrypt_key_management.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/epoch.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/invalid_key_input.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/is_disjoint.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/is_jwk.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/is_object.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/iv.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/jwt_claims_set.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/private_symbols.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/secs.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/validate_algorithms.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/validate_crit.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/aeskw.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/asn1.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/base64url.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/cbc_tag.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/check_cek_length.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/check_key_length.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/ciphers.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/decrypt.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/digest.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/dsa_digest.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/ecdhes.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/encrypt.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/fetch_jwks.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/generate.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/get_named_curve.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/get_sign_verify_key.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/hmac_digest.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/is_key_like.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/is_key_object.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/jwk_to_key.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/key_to_jwk.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/node_key.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/normalize_key.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/pbes2kw.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/random.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/rsaes.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/runtime.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/sign.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/timing_safe_equal.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/verify.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/webcrypto.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/base64url.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/decode_jwt.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/decode_protected_header.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/errors.js +1 -0
- package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/runtime.js +1 -0
- package/dist/src/node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js +1 -0
- package/dist/src/node_modules/.pnpm/mimic-fn@2.1.0/node_modules/mimic-fn/index.js +1 -0
- package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/assert-valid-pattern.js +1 -0
- package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/ast.js +1 -0
- package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/brace-expressions.js +1 -0
- package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/escape.js +1 -0
- package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/index.js +1 -0
- package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/unescape.js +1 -0
- package/dist/src/node_modules/.pnpm/mixpart@0.0.6/node_modules/mixpart/dist/index.js +7 -0
- package/dist/src/node_modules/.pnpm/npm-run-path@4.0.1/node_modules/npm-run-path/index.js +1 -0
- package/dist/src/node_modules/.pnpm/onetime@5.1.2/node_modules/onetime/index.js +1 -0
- package/dist/src/node_modules/.pnpm/os-paths@4.4.0/node_modules/os-paths/src/lib/index.js +1 -0
- package/dist/src/node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js +1 -0
- package/dist/src/node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js +1 -0
- package/dist/src/node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js +1 -0
- package/dist/src/node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js +1 -0
- package/dist/src/node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js +1 -0
- package/dist/src/node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/signals.js +1 -0
- package/dist/src/node_modules/.pnpm/strip-final-newline@2.0.0/node_modules/strip-final-newline/index.js +2 -0
- package/dist/src/node_modules/.pnpm/which@2.0.2/node_modules/which/which.js +1 -0
- package/dist/src/node_modules/.pnpm/xdg-app-paths@5.5.1/node_modules/xdg-app-paths/src/lib/index.js +1 -0
- package/dist/src/node_modules/.pnpm/xdg-portable@7.3.0/node_modules/xdg-portable/src/lib/index.js +1 -0
- package/dist/src/protocol/routes.d.ts +4 -0
- package/dist/src/protocol/routes.js +1 -1
- package/dist/src/public/channels/auth.d.ts +21 -4
- package/dist/src/public/channels/auth.js +1 -1
- package/dist/src/public/channels/mcp.js +1 -1
- package/dist/src/public/channels/slack/index.d.ts +1 -0
- package/dist/src/public/channels/slack/index.js +1 -1
- package/dist/src/public/experimental/schedules/client.d.ts +7 -0
- package/dist/src/public/experimental/schedules/client.js +1 -0
- package/dist/src/public/experimental/schedules/index.d.ts +5 -0
- package/dist/src/public/experimental/schedules/index.js +1 -0
- package/dist/src/public/experimental/schedules/testing.d.ts +2 -0
- package/dist/src/public/experimental/schedules/testing.js +1 -0
- package/dist/src/public/experimental/schedules/vercel.d.ts +2 -0
- package/dist/src/public/experimental/schedules/vercel.js +1 -0
- package/dist/src/public/memory/scope.js +1 -1
- package/dist/src/public/schedules/provider-types.d.ts +16 -0
- package/dist/src/public/schedules/provider-types.js +1 -0
- package/dist/src/public/schedules/providers/in-memory.d.ts +5 -0
- package/dist/src/public/schedules/providers/in-memory.js +1 -0
- package/dist/src/public/schedules/providers/vercel.d.ts +10 -0
- package/dist/src/public/schedules/providers/vercel.js +1 -0
- package/dist/src/public/schedules/scope.d.ts +2 -0
- package/dist/src/public/schedules/scope.js +1 -0
- package/dist/src/public/schedules/subscription.d.ts +258 -0
- package/dist/src/public/schedules/subscription.js +1 -0
- package/dist/src/public/schedules/testing.d.ts +1 -0
- package/dist/src/public/schedules/testing.js +1 -0
- package/dist/src/runtime/schedules/collection-client.d.ts +20 -0
- package/dist/src/runtime/schedules/collection-client.js +1 -0
- package/dist/src/runtime/schedules/dispatch-occurrence.d.ts +12 -0
- package/dist/src/runtime/schedules/dispatch-occurrence.js +1 -0
- package/dist/src/runtime/schedules/load-collection.d.ts +14 -0
- package/dist/src/runtime/schedules/load-collection.js +1 -0
- package/dist/src/runtime/schedules/payload.d.ts +24 -0
- package/dist/src/runtime/schedules/payload.js +1 -0
- package/dist/src/runtime/schedules/provider-types.d.ts +1 -0
- package/dist/src/runtime/schedules/provider-types.js +1 -0
- package/dist/src/runtime/schedules/queue-namespace.d.ts +2 -0
- package/dist/src/runtime/schedules/queue-namespace.js +1 -0
- package/dist/src/runtime/schedules/record.d.ts +4 -0
- package/dist/src/runtime/schedules/record.js +1 -0
- package/dist/src/runtime/schedules/validation.d.ts +6 -0
- package/dist/src/runtime/schedules/validation.js +1 -0
- package/dist/src/runtime/sessions/runtime-context-keys.js +1 -1
- package/dist/src/sandbox/state.d.ts +1 -0
- package/dist/src/self-modification/extension/subagents/agent/instructions.js +1 -1
- package/dist/src/self-modification/extension/subagents/agent/tools/registry_add.js +1 -1
- package/dist/src/setup/flows/registry-session.d.ts +10 -2
- package/dist/src/setup/flows/registry-session.js +1 -1
- package/dist/src/setup/flows/registry.d.ts +2 -0
- package/dist/src/setup/flows/registry.js +1 -1
- package/dist/src/setup/integrations/shared/prerequisite.d.ts +8 -0
- package/dist/src/setup/integrations/shared/prerequisite.js +1 -1
- package/dist/src/setup/registry-setup-client.js +1 -1
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/dist/src/setup/scaffold/index.js +1 -1
- package/dist/src/setup/vercel-project.d.ts +1 -2
- package/dist/src/setup/vercel-project.js +0 -0
- package/dist/src/shared/principal-scope.d.ts +2 -0
- package/dist/src/shared/principal-scope.js +1 -0
- package/dist/src/shared/sandbox-provider.d.ts +9 -2
- package/dist/src/shared/schedule-collection-definition.d.ts +11 -0
- package/dist/src/shared/schedule-collection-definition.js +1 -0
- package/dist/src/shared/schedule-collection-tools.d.ts +1 -0
- package/dist/src/shared/schedule-collection-tools.js +1 -0
- package/dist/src/subagents/adapter.d.ts +3 -2
- package/dist/src/subagents/adapter.js +1 -1
- package/dist/src/subagents/callback-route.js +1 -1
- package/dist/src/subagents/hitl-proxy.d.ts +4 -3
- package/dist/src/subagents/hitl-proxy.js +1 -1
- package/dist/src/subagents/parent-notification.js +1 -1
- package/dist/src/subagents/tool.d.ts +1 -0
- package/dist/src/subagents/tool.js +1 -1
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/tool-stubs/execute.d.ts +13 -0
- package/dist/src/tool-stubs/execute.js +1 -0
- package/dist/src/tool-stubs/output.d.ts +4 -0
- package/dist/src/tool-stubs/output.js +1 -0
- package/dist/src/tool-stubs/playback.d.ts +15 -0
- package/dist/src/tool-stubs/playback.js +1 -0
- package/dist/src/tool-stubs/rules.d.ts +3 -0
- package/dist/src/tool-stubs/rules.js +1 -0
- package/dist/src/tool-stubs/schema.d.ts +4 -0
- package/dist/src/tool-stubs/schema.js +1 -0
- package/dist/src/tool-stubs/target.d.ts +8 -0
- package/dist/src/tool-stubs/target.js +1 -0
- package/dist/src/tool-stubs/types.d.ts +56 -0
- package/dist/src/tool-stubs/types.js +1 -0
- package/dist/src/tool-stubs/validate-targets.d.ts +6 -0
- package/dist/src/tool-stubs/validate-targets.js +1 -0
- package/dist/src/tools/framework/agent.js +1 -1
- package/dist/src/tools/provided/ask-question-workflow.js +1 -1
- package/dist/src/tools/provided/read-file.js +1 -1
- package/dist/src/tools/provided/sleep-workflow.js +1 -1
- package/dist/src/tracing/agent-otel-content.d.ts +2 -0
- package/dist/src/tracing/agent-otel-content.js +2 -2
- package/dist/src/tracing/agent-otel-provider.js +1 -1
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/concepts/sessions-runs-and-streaming.md +2 -2
- package/docs/evals/meta.json +10 -1
- package/docs/evals/overview.mdx +2 -0
- package/docs/evals/tool-stubs.mdx +257 -0
- package/docs/extensions.md +1 -1
- package/docs/guides/auth-and-route-protection.md +25 -0
- package/docs/guides/dynamic-capabilities.md +10 -3
- package/docs/guides/frontend/nextjs.mdx +17 -4
- package/docs/sandbox/index.mdx +10 -2
- package/docs/subagents/index.mdx +1 -1
- package/docs/tools/human-in-the-loop.md +1 -1
- package/docs/tools/overview.mdx +8 -4
- package/docs/tools/workflows.mdx +21 -11
- package/package.json +22 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# eve
|
|
2
2
|
|
|
3
|
+
## 0.75.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 32af96d: Rename custom sandbox provider handle hooks from `onSessionStop()` and `onSessionDelete()` to `onSandboxStop()` and `onSandboxDelete()` so handle lifecycle names describe the sandbox resource they operate on.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 84793ed: Schedule creation no longer accepts an initial state: schedules are created active by default (or completed if a one-time schedule is already past). Use the existing enable and disable operations to change a schedule's state after creation.
|
|
12
|
+
- a3c2f40: Add explicitly authorized, session-scoped JSON tool stubs with argument matching and outcome sequences that continue across turns within the same session. Each rule specifies `outcome` or nonempty `outcomes`, with a JSON `response` in each outcome; eve's internal workflow recovery reuses recorded outcomes without consuming another entry.
|
|
13
|
+
|
|
14
|
+
Rules use first-match-wins ordering and explicit slash-separated paths for local child tools. Grant replacement permission on individual `vercelOidc` subject entries or in a custom authenticator's result; existing sessions follow normal channel authentication.
|
|
15
|
+
|
|
16
|
+
Invalid static tool paths and unsupported matcher features fail session creation. Unused rules produce eval warnings. Deployment handoffs use a new checkpoint version for all sessions, so sessions cannot hand off to deployments running an older version.
|
|
17
|
+
- 20c1317: Keep a tool approval answered before a cancelled response resolved, instead of restoring it and resolving it again on the next message. An approved call the cancellation interrupts while it runs gets an interrupted result and is not run again, and a message sent with the answer is kept once.
|
|
18
|
+
- 04d47bc: A typed reply now answers a tool approval or session-limit prompt proxied from a subagent, the same way it answers a subagent's `ctx.ask()` question. On text-only channels such as Linq, Twilio, and Linear, replying `approve` or `continue` resumes the subagent instead of reaching the parent model while the subagent stays parked. When a subagent raises several prompts at once, each reply answers the first open one.
|
|
19
|
+
- bf82cfa: Keep conversation sessions available after a dynamic connection resolver fails, so a later message can retry once the dependency recovers.
|
|
20
|
+
- 89704cb: When a registry item's setup needs a logged-in Vercel CLI, `/add` in `eve dev` now offers to run `vercel login` and then finishes setup without reinstalling the item. Items whose setup fails after their files are installed now show as "setup not finished" with the reason, instead of "Couldn't add". `eve add --non-interactive` reports a `vercel login` prerequisite (exit 2) instead of a raw `vercel connect` failure. eve now detects a logged-out Vercel CLI from `vercel whoami --format json`, so newer CLIs that print only "Logged out." are no longer misreported as a transient error. The self-modification agent no longer describes an item as added before its setup panel has run.
|
|
21
|
+
- 6ab30a5: A subagent's tool approval now stays open on the parent until the subagent settles it. If the subagent's response policy refuses the person who answered, someone else can still answer it, by text or button, instead of the prompt disappearing while the subagent waits. The parent closes the prompt when it relays the subagent's own `input.resolved`, so channels such as Telegram and Discord clear its buttons.
|
|
22
|
+
- 33a95cf: Invoke sandbox provider cleanup when a durable session completes, expires, or fails. Custom providers can implement `onSessionEnd()` to release session-owned resources directly from persisted state.
|
|
23
|
+
- 1cfb212: Tool stubs can now throw an error immediately or mix errors and responses in an outcome sequence. Evals can assert expected tool failures and recovery without treating injected errors as broken stubs.
|
|
24
|
+
|
|
25
|
+
## 0.74.0
|
|
26
|
+
|
|
27
|
+
### Minor Changes
|
|
28
|
+
|
|
29
|
+
- bc101b5: Add experimental `defineDynamicSchedules` with direct operation tools, optional `preparePayload` creation preparation, top-level per-operation approval, and creator-bound execution. Create approval receives prepared data and rejects changed results before writing; `ctx.session.schedule` exposes scheduled-turn provenance without auth attributes.
|
|
30
|
+
|
|
31
|
+
### Patch Changes
|
|
32
|
+
|
|
33
|
+
- 51648e3: Manual compaction now resolves step-scoped dynamic models before summarizing a session.
|
|
34
|
+
- 880dd8b: Record offered tool definitions on GenAI chat spans and expose them to lifecycle handlers when input capture is enabled.
|
|
35
|
+
- f528669: Settle tool calls when a model call is retried and remove unresolved tool parts when a turn ends.
|
|
36
|
+
- 8751775: The experimental Vercel schedule provider includes Schedules SDK alpha.11 in the published package without adding a runtime dependency. Provider requests receive the operation's abort signal, and failed disable calls after inactive creation report that the schedule may remain active.
|
|
37
|
+
- b9470fe: `Shift+Enter` now inserts a newline in the `eve dev` prompt in Warp, which sends a bare line feed for it. `Ctrl+J` inserts a newline too, instead of sending the message.
|
|
38
|
+
- 8751775: Schedule subscriptions default to Vercel Schedules in production and process-local storage under `eve dev`, so an explicit `provider` is no longer required. Pass a provider to override the backend, or use `vercelScheduleProvider` from `eve/experimental/schedules/vercel` to customize the Vercel endpoint.
|
|
39
|
+
- 0b5bb5b: Workflow tools in an `agents/<name>/` workspace member now compile with the workflow ID that the deployment registers, so calls no longer fail with "is not registered as a workflow in this deployment". Members can also import workflow and step modules from the shared root package, such as `lib/`, and `eve dev` rebuilds when shared modules imported from outside the agent directory change.
|
|
40
|
+
|
|
3
41
|
## 0.73.0
|
|
4
42
|
|
|
5
43
|
### Minor Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"node:module";export{};
|
|
1
|
+
import"node:module";var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__commonJSMin=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),__copyProps=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=__getOwnPropNames(t),a=0,o=i.length,s;a<o;a++)s=i[a],!__hasOwnProp.call(e,s)&&s!==n&&__defProp(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=__getOwnPropDesc(t,s))||r.enumerable});return e},__toESM=(e,t,n)=>(n=e==null?{}:__create(__getProtoOf(e)),__copyProps(t||!e||!e.__esModule||!__hasOwnProp.call(e,`default`)?__defProp(n,`default`,{value:e,enumerable:!0}):n,e));export{__commonJSMin,__toESM};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { SessionAuthContext } from "#channel/types.js";
|
|
2
|
+
import type { AuthResult } from "#public/channels/auth.js";
|
|
3
|
+
/** Do not save this request's stub permission or forward it to another agent. */
|
|
4
|
+
export declare function sessionAuthFromResult(result: AuthResult): SessionAuthContext;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function sessionAuthFromResult(e){let{allowToolStubs:t,...n}=e;return n}export{sessionAuthFromResult};
|
|
@@ -2,6 +2,8 @@ import type { ChannelAdapter } from "#channel/adapter.js";
|
|
|
2
2
|
import { type Session } from "#channel/session.js";
|
|
3
3
|
import type { Runtime } from "#channel/types.js";
|
|
4
4
|
import type { ScheduleRunHandler } from "#public/definitions/schedule.js";
|
|
5
|
+
import type { DynamicSchedulesDefinition, ScheduleOccurrenceIdentity } from "#public/schedules/subscription.js";
|
|
6
|
+
import { type ScheduleCollectionPayload } from "#runtime/schedules/payload.js";
|
|
5
7
|
import type { ResolvedChannelDefinition } from "#runtime/types.js";
|
|
6
8
|
export { SCHEDULE_APP_AUTH } from "#channel/schedule-auth.js";
|
|
7
9
|
/**
|
|
@@ -18,11 +20,23 @@ export declare const SCHEDULE_ADAPTER: ChannelAdapter;
|
|
|
18
20
|
* Loaded shape of one schedule for the dispatcher. Either `run` is
|
|
19
21
|
* defined (authored handler) or `markdown` is defined (fire-and-forget).
|
|
20
22
|
*/
|
|
21
|
-
interface ScheduleDispatchInput {
|
|
23
|
+
export interface ScheduleDispatchInput {
|
|
22
24
|
readonly scheduleId: string;
|
|
23
25
|
readonly run?: ScheduleRunHandler;
|
|
24
26
|
readonly markdown?: string;
|
|
25
27
|
}
|
|
28
|
+
/** Sessions started by dispatch and background work registered by the handler. */
|
|
29
|
+
export interface ScheduleDispatchResult {
|
|
30
|
+
readonly sessions: readonly Session[];
|
|
31
|
+
readonly waitUntilTasks: readonly Promise<unknown>[];
|
|
32
|
+
}
|
|
33
|
+
export interface ScheduleCollectionDispatchInput {
|
|
34
|
+
readonly collectionId: string;
|
|
35
|
+
readonly definition: DynamicSchedulesDefinition<any, any, any>;
|
|
36
|
+
readonly payload: ScheduleCollectionPayload<unknown>;
|
|
37
|
+
readonly occurrence: ScheduleOccurrenceIdentity;
|
|
38
|
+
readonly verifyDelivery?: () => Promise<void>;
|
|
39
|
+
}
|
|
26
40
|
/**
|
|
27
41
|
* Dispatches scheduled task execution.
|
|
28
42
|
*
|
|
@@ -38,12 +52,10 @@ interface ScheduleDispatchInput {
|
|
|
38
52
|
*
|
|
39
53
|
* Returns a {@link ScheduleDispatchResult} carrying any sessions the
|
|
40
54
|
* handler started (for telemetry / task-result observability) and the
|
|
41
|
-
* `waitUntil` promises the handler registered.
|
|
55
|
+
* `waitUntil` promises the handler registered. Subscription callbacks resolve
|
|
56
|
+
* creator auth and await their registered work before returning; their channel
|
|
57
|
+
* sends start fresh, unattended sessions rather than resume a conversation.
|
|
42
58
|
*/
|
|
43
|
-
interface ScheduleDispatchResult {
|
|
44
|
-
readonly sessions: readonly Session[];
|
|
45
|
-
readonly waitUntilTasks: readonly Promise<unknown>[];
|
|
46
|
-
}
|
|
47
59
|
export declare class ScheduleDispatcher {
|
|
48
60
|
private readonly runtime;
|
|
49
61
|
private readonly channels;
|
|
@@ -52,7 +64,9 @@ export declare class ScheduleDispatcher {
|
|
|
52
64
|
readonly channels: readonly ResolvedChannelDefinition[];
|
|
53
65
|
});
|
|
54
66
|
trigger(input: ScheduleDispatchInput): Promise<ScheduleDispatchResult>;
|
|
67
|
+
triggerCollection(input: ScheduleCollectionDispatchInput): Promise<ScheduleDispatchResult>;
|
|
55
68
|
private triggerInScope;
|
|
69
|
+
private createHandlerContext;
|
|
56
70
|
private runMarkdown;
|
|
57
71
|
}
|
|
58
72
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createSession}from"#channel/session.js";import{ContextContainer,contextStorage}from"#context/container.js";import{SCHEDULE_APP_AUTH,SCHEDULE_APP_AUTH as SCHEDULE_APP_AUTH$1}from"#channel/schedule-auth.js";import{createCrossChannelToFn,toCrossChannelTargets}from"#channel/cross-channel-receive.js";import{ScheduleIdKey}from"#context/keys.js";import{expectFunction}from"#internal/authored-module.js";const SCHEDULE_ADAPTER_KIND=`schedule`,SCHEDULE_ADAPTER={kind:SCHEDULE_ADAPTER_KIND};var ScheduleDispatcher=class{runtime;channels;constructor(e){this.runtime=e.runtime,this.channels=e.channels}async trigger(e){let t=new ContextContainer;return t.set(ScheduleIdKey,e.scheduleId),await contextStorage.run(t,()=>this.triggerInScope(e))}async
|
|
1
|
+
import{randomUUID}from"node:crypto";import{createSession}from"#channel/session.js";import{ContextContainer,contextStorage}from"#context/container.js";import{scheduleDisplayName}from"#runtime/schedules/record.js";import{SCHEDULE_APP_AUTH,SCHEDULE_APP_AUTH as SCHEDULE_APP_AUTH$1}from"#channel/schedule-auth.js";import{createCrossChannelToFn,toCrossChannelTargets}from"#channel/cross-channel-receive.js";import{AuthKey,OccurrenceIdKey,ScheduleIdKey,ScheduleInstanceKey}from"#context/keys.js";import{expectFunction}from"#internal/authored-module.js";import{parseSchedulePayload,validateSchedulePayload}from"#runtime/schedules/payload.js";const SCHEDULE_ADAPTER_KIND=`schedule`,SCHEDULE_ADAPTER={kind:SCHEDULE_ADAPTER_KIND};var ScheduleDispatcher=class{runtime;channels;constructor(e){this.runtime=e.runtime,this.channels=e.channels}async trigger(e){let t=new ContextContainer;return t.set(ScheduleIdKey,e.scheduleId),await contextStorage.run(t,()=>this.triggerInScope(e))}async triggerCollection(e){let{envelope:t}=parseSchedulePayload(e.payload,{application:e.payload.eve.application,collection:e.collectionId}),{definition:n}=e,r={...e.occurrence,displayName:scheduleDisplayName(e.occurrence.name)},i=n.preparePayload===void 0?await validateSchedulePayload(n.inputSchema,t.payload):t.payload;await e.verifyDelivery?.();let a=await n.auth({principal:t.principal,payload:i,occurrence:r});if(a===null)throw Error(`Scheduled execution is no longer authorized.`);if(a.principalId!==t.principal.principalId||a.principalType!==t.principal.type||a.authenticator!==t.principal.authenticator||a.issuer!==t.principal.issuer||a.subject!==t.principal.subject)throw Error(`Scheduled execution auth must resolve the schedule creator.`);let o=a,s=new ContextContainer;return s.set(ScheduleIdKey,e.collectionId),s.set(AuthKey,o),s.set(OccurrenceIdKey,r.executionId),s.set(ScheduleInstanceKey,r.name),await contextStorage.run(s,async()=>{let e={...this.runtime,resolveContinuation:async()=>void 0,dispatchContinuation:async e=>{if(e.command.kind!==`send`)throw Error(`Scheduled channel receive can only start a fresh session.`);return{status:`session_not_active`}},createSession:async e=>await this.runtime.createSession({...e,auth:o,initiatorAuth:o,capabilities:{requestInput:!1},continuationToken:`eve-scheduled-send:${randomUUID()}`,continuationConflictCommand:void 0})},{args:t,sessions:a,waitUntilTasks:s}=this.createHandlerContext(e);return await n.run({payload:i,occurrence:r,auth:o,to:(e,n)=>({send:r=>t.to(e,n).send(r,{auth:o})}),waitUntil:t.waitUntil}),await Promise.all(s),{sessions:a,waitUntilTasks:s}})}async triggerInScope(e){let{args:t,sessions:n,waitUntilTasks:r}=this.createHandlerContext();if(e.run)await e.run(t);else if(e.markdown!==void 0)n.push(await this.runMarkdown(e.markdown));else throw Error(`Schedule "${e.scheduleId}" has neither "run" nor "markdown" — at least one must be set.`);return{sessions:n,waitUntilTasks:r}}createHandlerContext(e=this.runtime){let t=[],n=[],r=createCrossChannelToFn(e,toCrossChannelTargets(this.channels));return{args:{appAuth:SCHEDULE_APP_AUTH$1,to(e,n){let i=r(e,n);return{async send(e,n){let r=await i.send(e,n);return t.push(r),r}}},waitUntil(e){n.push(e)}},sessions:t,waitUntilTasks:n}}async runMarkdown(e){let t=await this.runtime.createSession({adapter:SCHEDULE_ADAPTER,auth:SCHEDULE_APP_AUTH$1,input:{message:e}});return createSession(t.sessionId,this.runtime)}};function expectScheduleRun(e,t,n){let r=e;if(typeof r!=`object`||!r)throw Error(`Schedule export "${n??`default`}" from "${t}" must be an object.`);return expectFunction(r.run,`Expected the schedule export "${n??`default`}" from "${t}" to export a \`run\` handler function.`)}export{SCHEDULE_ADAPTER,SCHEDULE_ADAPTER_KIND,SCHEDULE_APP_AUTH,ScheduleDispatcher,expectScheduleRun};
|
|
@@ -11,6 +11,7 @@ import type { JsonObject } from "#shared/json.js";
|
|
|
11
11
|
import type { InstrumentationDecision } from "#shared/instrumentation-decision.js";
|
|
12
12
|
import type { ForwardedTraceAssertion } from "#shared/forwarded-trace-policy.js";
|
|
13
13
|
import type { ConversationContext } from "#shared/conversation-context.js";
|
|
14
|
+
import type { StubScope } from "#tool-stubs/types.js";
|
|
14
15
|
export type { ContextAccessor } from "#context/key.js";
|
|
15
16
|
export type { ChannelInstrumentationProjection } from "#channel/instrumentation.js";
|
|
16
17
|
import type { ChannelInstrumentationProjection } from "#channel/instrumentation.js";
|
|
@@ -165,6 +166,7 @@ export type SessionCommand = {
|
|
|
165
166
|
/** Initial workflow title when delivering to a prewarmed session. */
|
|
166
167
|
readonly title?: string;
|
|
167
168
|
readonly kind: "send";
|
|
169
|
+
readonly schedule?: import("#context/session-schedule.js").SessionSchedule;
|
|
168
170
|
readonly payload: DeliverPayload;
|
|
169
171
|
readonly delivery?: ChannelDeliveryMetadata;
|
|
170
172
|
readonly requestId?: string;
|
|
@@ -220,6 +222,7 @@ export interface DispatchSessionInput<TCommand extends SessionCommand = SessionC
|
|
|
220
222
|
* metadata so both cross the durable hook boundary outside adapter-owned data.
|
|
221
223
|
*/
|
|
222
224
|
export interface DeliverHookPayload {
|
|
225
|
+
readonly schedule?: import("#context/session-schedule.js").SessionSchedule;
|
|
223
226
|
/** Initial workflow title; ignored once session initialization has run. */
|
|
224
227
|
readonly title?: string;
|
|
225
228
|
readonly auth?: SessionAuthContext | null;
|
|
@@ -293,9 +296,12 @@ export interface SubagentInputRequestHookPayload {
|
|
|
293
296
|
readonly kind: "subagent-input-request";
|
|
294
297
|
readonly subagentName: string;
|
|
295
298
|
}
|
|
296
|
-
/**
|
|
299
|
+
/**
|
|
300
|
+
* Lifecycle event forwarded from a delegated child: responder and sign-in progress, and the
|
|
301
|
+
* resolution of its requests. The parent relays it unchanged.
|
|
302
|
+
*/
|
|
297
303
|
export type SubagentAuthorizationEvent = Extract<UnstampedMessageStreamEvent, {
|
|
298
|
-
type: "approval.candidate" | "approval.settled" | "authorization.required" | "authorization.completed";
|
|
304
|
+
type: "approval.candidate" | "approval.settled" | "authorization.required" | "authorization.completed" | "input.resolved";
|
|
299
305
|
}>;
|
|
300
306
|
/**
|
|
301
307
|
* Proxy payload sent from a child subagent while it waits for authorization.
|
|
@@ -357,6 +363,16 @@ export interface SessionCapabilities {
|
|
|
357
363
|
* subagent tool wrapper).
|
|
358
364
|
*/
|
|
359
365
|
export interface RunInput {
|
|
366
|
+
/**
|
|
367
|
+
* @internal Set by the server after it authorizes tool stubs.
|
|
368
|
+
* Local subagents match rules qualified by their full path, such as researcher/list_tasks.
|
|
369
|
+
* The root session tracks positions per rule; subagent sessions at the same path
|
|
370
|
+
* share those positions. Unprefixed rules apply only to root tools.
|
|
371
|
+
* Remote agents do not receive these stubs.
|
|
372
|
+
*/
|
|
373
|
+
readonly toolStubs?: StubScope;
|
|
374
|
+
/** Server-supplied provenance inherited by locally delegated scheduled work. */
|
|
375
|
+
readonly schedule?: import("#context/session-schedule.js").SessionSchedule;
|
|
360
376
|
readonly adapter: ChannelAdapter<any>;
|
|
361
377
|
/**
|
|
362
378
|
* Registered channel name for root sessions started from an authored
|
|
@@ -15,6 +15,7 @@ const EVE_SESSION_CANCEL_ROUTE_PATTERN = `${EVE_SESSION_ROUTE_PATH}/:sessionId/c
|
|
|
15
15
|
const EVE_SESSION_COMPACT_ROUTE_PATTERN = `${EVE_SESSION_ROUTE_PATH}/:sessionId/compact`;
|
|
16
16
|
const EVE_SESSION_CLEAR_ROUTE_PATTERN = `${EVE_SESSION_ROUTE_PATH}/:sessionId/clear`;
|
|
17
17
|
const EVE_SESSION_RESET_ROUTE_PATTERN = `${EVE_SESSION_ROUTE_PATH}/:sessionId/reset`;
|
|
18
|
+
const EVE_SESSION_STUBS_ROUTE_PATTERN = `${EVE_SESSION_ROUTE_PATH}/:sessionId/stubs`;
|
|
18
19
|
const EVE_SESSION_STREAM_ROUTE_PATTERN = `${EVE_SESSION_ROUTE_PATH}/:sessionId/stream`;
|
|
19
20
|
const EVE_SUBAGENT_STREAM_ROUTE_PATTERN = `${EVE_SESSION_ROUTE_PATH}/:parentSessionId/subagents/:callId/:childSessionId/stream`;
|
|
20
21
|
const EVE_DEV_DISPATCH_SCHEDULE_ROUTE_PATTERN = `${EVE_ROUTE_PREFIX}/dev/schedules/:scheduleId`;
|
|
@@ -2245,7 +2246,7 @@ var ClientSession = class ClientSession {
|
|
|
2245
2246
|
this.#state = state;
|
|
2246
2247
|
}
|
|
2247
2248
|
static async create(context, input) {
|
|
2248
|
-
const response = await postTurn(context, EVE_SESSION_ROUTE_PATH, input, true);
|
|
2249
|
+
const response = await postTurn(context, EVE_SESSION_ROUTE_PATH, input, true, input.stubs);
|
|
2249
2250
|
const { sessionId } = await readAcceptedMessage(response);
|
|
2250
2251
|
const session = new ClientSession(context, {
|
|
2251
2252
|
sessionId,
|
|
@@ -2447,7 +2448,10 @@ async function postSessionSend(context, path, input) {
|
|
|
2447
2448
|
}
|
|
2448
2449
|
async function postCreateSession(context, options) {
|
|
2449
2450
|
const headers = await context.resolveHeaders(options.headers);
|
|
2451
|
+
const body = options.stubs === void 0 ? void 0 : JSON.stringify({ stubs: options.stubs });
|
|
2452
|
+
if (body !== void 0) headers.set("content-type", "application/json");
|
|
2450
2453
|
const response = await fetch(createClientUrl(context.host, EVE_SESSION_ROUTE_PATH), {
|
|
2454
|
+
body,
|
|
2451
2455
|
headers,
|
|
2452
2456
|
method: "POST",
|
|
2453
2457
|
redirect: context.redirect,
|
|
@@ -2462,9 +2466,10 @@ async function postCreateSession(context, options) {
|
|
|
2462
2466
|
function isSessionNotReady(error) {
|
|
2463
2467
|
return error instanceof ClientError && error.status === 409 && error.code === "session_not_ready";
|
|
2464
2468
|
}
|
|
2465
|
-
async function postTurn(context, path, input, requireMessage) {
|
|
2469
|
+
async function postTurn(context, path, input, requireMessage, stubs) {
|
|
2466
2470
|
const body = createMessageBody(input, requireMessage);
|
|
2467
2471
|
if (body === null) throw new Error(requireMessage ? "Creating a session requires a non-empty message." : "A session turn requires a non-empty message or inputResponses.");
|
|
2472
|
+
if (stubs !== void 0) body.stubs = stubs;
|
|
2468
2473
|
const headers = await context.resolveHeaders(input.headers);
|
|
2469
2474
|
headers.set("content-type", "application/json");
|
|
2470
2475
|
const response = await fetch(createClientUrl(context.host, path), {
|
|
@@ -3470,6 +3475,10 @@ function reduceContent(data, event) {
|
|
|
3470
3475
|
}
|
|
3471
3476
|
case "action.result": {
|
|
3472
3477
|
if (conversationProjection(data).calls[event.data.result.callId]?.taskId !== void 0) return data;
|
|
3478
|
+
if (event.data.error?.code === "MODEL_CALL_ATTEMPT_RETRIED") return updateAssistantMessage(data, event.data.turnId, (message) => ({
|
|
3479
|
+
...message,
|
|
3480
|
+
parts: message.parts.filter((part) => part.type !== "dynamic-tool" || part.toolCallId !== event.data.result.callId)
|
|
3481
|
+
}));
|
|
3473
3482
|
const existing = findToolPart(data, event.data.result.callId);
|
|
3474
3483
|
const descriptor = normalizeActionResult(event.data.result);
|
|
3475
3484
|
const succeeded = event.data.status === void 0 || event.data.status === "completed" ? event.data.result.isError !== true && event.data.error === void 0 : false;
|
|
@@ -3571,7 +3580,7 @@ function reduceContent(data, event) {
|
|
|
3571
3580
|
...message.metadata,
|
|
3572
3581
|
status: "complete"
|
|
3573
3582
|
},
|
|
3574
|
-
parts:
|
|
3583
|
+
parts: removeUnsettledToolParts(closeStreamingRuns(message.parts), conversationProjection(data))
|
|
3575
3584
|
}));
|
|
3576
3585
|
default: return data;
|
|
3577
3586
|
}
|
|
@@ -3606,8 +3615,14 @@ function closeStreamingRuns(parts, stepIndex) {
|
|
|
3606
3615
|
state: "done"
|
|
3607
3616
|
} : part);
|
|
3608
3617
|
}
|
|
3609
|
-
function
|
|
3610
|
-
return parts.filter((part) =>
|
|
3618
|
+
function removeUnsettledToolParts(parts, projection) {
|
|
3619
|
+
return parts.filter((part) => {
|
|
3620
|
+
if (part.type !== "dynamic-tool") return true;
|
|
3621
|
+
if (part.state === "input-streaming") return false;
|
|
3622
|
+
if (part.state !== "input-available") return true;
|
|
3623
|
+
const call = projection.calls[part.toolCallId];
|
|
3624
|
+
return call === void 0 || call.taskId !== void 0 || reportedCallStatus(projection, call) !== "running";
|
|
3625
|
+
});
|
|
3611
3626
|
}
|
|
3612
3627
|
function updateAssistantMessage(data, turnId, update) {
|
|
3613
3628
|
const message = data.messages.find((message) => message.role === "assistant" && message.metadata?.turnId === turnId) ?? createAssistantMessage(turnId);
|
|
@@ -14,6 +14,7 @@ const EVE_SESSION_CANCEL_ROUTE_PATTERN = `${EVE_SESSION_ROUTE_PATH}/:sessionId/c
|
|
|
14
14
|
const EVE_SESSION_COMPACT_ROUTE_PATTERN = `${EVE_SESSION_ROUTE_PATH}/:sessionId/compact`;
|
|
15
15
|
const EVE_SESSION_CLEAR_ROUTE_PATTERN = `${EVE_SESSION_ROUTE_PATH}/:sessionId/clear`;
|
|
16
16
|
const EVE_SESSION_RESET_ROUTE_PATTERN = `${EVE_SESSION_ROUTE_PATH}/:sessionId/reset`;
|
|
17
|
+
const EVE_SESSION_STUBS_ROUTE_PATTERN = `${EVE_SESSION_ROUTE_PATH}/:sessionId/stubs`;
|
|
17
18
|
const EVE_SESSION_STREAM_ROUTE_PATTERN = `${EVE_SESSION_ROUTE_PATH}/:sessionId/stream`;
|
|
18
19
|
const EVE_SUBAGENT_STREAM_ROUTE_PATTERN = `${EVE_SESSION_ROUTE_PATH}/:parentSessionId/subagents/:callId/:childSessionId/stream`;
|
|
19
20
|
const EVE_DEV_DISPATCH_SCHEDULE_ROUTE_PATTERN = `${EVE_ROUTE_PREFIX}/dev/schedules/:scheduleId`;
|
|
@@ -2244,7 +2245,7 @@ var ClientSession = class ClientSession {
|
|
|
2244
2245
|
this.#state = state;
|
|
2245
2246
|
}
|
|
2246
2247
|
static async create(context, input) {
|
|
2247
|
-
const response = await postTurn(context, EVE_SESSION_ROUTE_PATH, input, true);
|
|
2248
|
+
const response = await postTurn(context, EVE_SESSION_ROUTE_PATH, input, true, input.stubs);
|
|
2248
2249
|
const { sessionId } = await readAcceptedMessage(response);
|
|
2249
2250
|
const session = new ClientSession(context, {
|
|
2250
2251
|
sessionId,
|
|
@@ -2446,7 +2447,10 @@ async function postSessionSend(context, path, input) {
|
|
|
2446
2447
|
}
|
|
2447
2448
|
async function postCreateSession(context, options) {
|
|
2448
2449
|
const headers = await context.resolveHeaders(options.headers);
|
|
2450
|
+
const body = options.stubs === void 0 ? void 0 : JSON.stringify({ stubs: options.stubs });
|
|
2451
|
+
if (body !== void 0) headers.set("content-type", "application/json");
|
|
2449
2452
|
const response = await fetch(createClientUrl(context.host, EVE_SESSION_ROUTE_PATH), {
|
|
2453
|
+
body,
|
|
2450
2454
|
headers,
|
|
2451
2455
|
method: "POST",
|
|
2452
2456
|
redirect: context.redirect,
|
|
@@ -2461,9 +2465,10 @@ async function postCreateSession(context, options) {
|
|
|
2461
2465
|
function isSessionNotReady(error) {
|
|
2462
2466
|
return error instanceof ClientError && error.status === 409 && error.code === "session_not_ready";
|
|
2463
2467
|
}
|
|
2464
|
-
async function postTurn(context, path, input, requireMessage) {
|
|
2468
|
+
async function postTurn(context, path, input, requireMessage, stubs) {
|
|
2465
2469
|
const body = createMessageBody(input, requireMessage);
|
|
2466
2470
|
if (body === null) throw new Error(requireMessage ? "Creating a session requires a non-empty message." : "A session turn requires a non-empty message or inputResponses.");
|
|
2471
|
+
if (stubs !== void 0) body.stubs = stubs;
|
|
2467
2472
|
const headers = await context.resolveHeaders(input.headers);
|
|
2468
2473
|
headers.set("content-type", "application/json");
|
|
2469
2474
|
const response = await fetch(createClientUrl(context.host, path), {
|
|
@@ -3469,6 +3474,10 @@ function reduceContent(data, event) {
|
|
|
3469
3474
|
}
|
|
3470
3475
|
case "action.result": {
|
|
3471
3476
|
if (conversationProjection(data).calls[event.data.result.callId]?.taskId !== void 0) return data;
|
|
3477
|
+
if (event.data.error?.code === "MODEL_CALL_ATTEMPT_RETRIED") return updateAssistantMessage(data, event.data.turnId, (message) => ({
|
|
3478
|
+
...message,
|
|
3479
|
+
parts: message.parts.filter((part) => part.type !== "dynamic-tool" || part.toolCallId !== event.data.result.callId)
|
|
3480
|
+
}));
|
|
3472
3481
|
const existing = findToolPart(data, event.data.result.callId);
|
|
3473
3482
|
const descriptor = normalizeActionResult(event.data.result);
|
|
3474
3483
|
const succeeded = event.data.status === void 0 || event.data.status === "completed" ? event.data.result.isError !== true && event.data.error === void 0 : false;
|
|
@@ -3570,7 +3579,7 @@ function reduceContent(data, event) {
|
|
|
3570
3579
|
...message.metadata,
|
|
3571
3580
|
status: "complete"
|
|
3572
3581
|
},
|
|
3573
|
-
parts:
|
|
3582
|
+
parts: removeUnsettledToolParts(closeStreamingRuns(message.parts), conversationProjection(data))
|
|
3574
3583
|
}));
|
|
3575
3584
|
default: return data;
|
|
3576
3585
|
}
|
|
@@ -3605,8 +3614,14 @@ function closeStreamingRuns(parts, stepIndex) {
|
|
|
3605
3614
|
state: "done"
|
|
3606
3615
|
} : part);
|
|
3607
3616
|
}
|
|
3608
|
-
function
|
|
3609
|
-
return parts.filter((part) =>
|
|
3617
|
+
function removeUnsettledToolParts(parts, projection) {
|
|
3618
|
+
return parts.filter((part) => {
|
|
3619
|
+
if (part.type !== "dynamic-tool") return true;
|
|
3620
|
+
if (part.state === "input-streaming") return false;
|
|
3621
|
+
if (part.state !== "input-available") return true;
|
|
3622
|
+
const call = projection.calls[part.toolCallId];
|
|
3623
|
+
return call === void 0 || call.taskId !== void 0 || reportedCallStatus(projection, call) !== "running";
|
|
3624
|
+
});
|
|
3610
3625
|
}
|
|
3611
3626
|
function updateAssistantMessage(data, turnId, update) {
|
|
3612
3627
|
const message = data.messages.find((message) => message.role === "assistant" && message.metadata?.turnId === turnId) ?? createAssistantMessage(turnId);
|
|
@@ -2,6 +2,7 @@ import { cleanupCreatedConnectionConnector, setupConnectionConnector, type Conne
|
|
|
2
2
|
import { ensureVercelProject, type EnsureVercelProjectDeps } from "#setup/flows/ensure-vercel-project.js";
|
|
3
3
|
import { readProjectLink } from "#setup/project-resolution.js";
|
|
4
4
|
import { type Prompter } from "#setup/prompter.js";
|
|
5
|
+
import { requireAuth } from "#setup/vercel-project.js";
|
|
5
6
|
import { updateConnectionConnectorUid } from "#setup/scaffold/update/update-connection-connector.js";
|
|
6
7
|
import type { RegistryCommandLogger } from "./registry.js";
|
|
7
8
|
export interface IntegrationConnectOptions {
|
|
@@ -16,6 +17,7 @@ export interface IntegrationConnectDependencies {
|
|
|
16
17
|
ensureVercelProject: typeof ensureVercelProject;
|
|
17
18
|
ensureVercelProjectDeps?: Partial<EnsureVercelProjectDeps>;
|
|
18
19
|
readProjectLink: typeof readProjectLink;
|
|
20
|
+
requireAuth: typeof requireAuth;
|
|
19
21
|
setupConnectionConnector: typeof setupConnectionConnector;
|
|
20
22
|
cleanupCreatedConnectionConnector: typeof cleanupCreatedConnectionConnector;
|
|
21
23
|
updateConnectionConnectorUid: typeof updateConnectionConnectorUid;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{serializeHeadlessSetupEvent}from"./setup-headless.js";import{join}from"node:path";import{createPrompter}from"#setup/prompter.js";import{readProjectLink}from"#setup/project-resolution.js";import{WizardCancelledError}from"#setup/step.js";import{cleanupCreatedConnectionConnector,setupConnectionConnector}from"#setup/connection-connector.js";import{ensureVercelProject}from"#setup/flows/ensure-vercel-project.js";import{createHeadlessPrompter}from"#setup/headless.js";import{
|
|
1
|
+
import{serializeHeadlessSetupEvent}from"./setup-headless.js";import{join}from"node:path";import{createPrompter}from"#setup/prompter.js";import{readProjectLink}from"#setup/project-resolution.js";import{requireAuth}from"#setup/vercel-project.js";import{WizardCancelledError}from"#setup/step.js";import{cleanupCreatedConnectionConnector,setupConnectionConnector}from"#setup/connection-connector.js";import{ensureVercelProject}from"#setup/flows/ensure-vercel-project.js";import{createHeadlessPrompter}from"#setup/headless.js";import{setupPrerequisiteOf}from"#setup/integrations/shared/prerequisite.js";import{resolveIntegrationVercelProject}from"#setup/integrations/shared/vercel-project.js";import{createRegistrySetupClient}from"#setup/registry-setup-client.js";import{updateConnectionConnectorUid}from"#setup/scaffold/update/update-connection-connector.js";const defaultDependencies={ensureVercelProject,readProjectLink,requireAuth,setupConnectionConnector,cleanupCreatedConnectionConnector,updateConnectionConnectorUid};async function runIntegrationConnect(e){let t={...defaultDependencies,...e.dependencies},n=e.options?.nonInteractive===!0,r=t.createPrompter?.()??(n?createHeadlessPrompter(()=>{}):createPrompter()),i=e.options?.signal;r.intro(`Set up ${e.slug}`);let a=await t.readProjectLink(e.appRoot);if(a!==void 0)await t.requireAuth(e.appRoot,n?void 0:r,{signal:i});else if(n)a=await resolveIntegrationVercelProject({appRoot:e.appRoot,integration:e.slug,signal:i,deps:{readProjectLink:t.readProjectLink}});else try{a=await t.ensureVercelProject({appRoot:e.appRoot,prompter:r,signal:i,teamSelectMessage:()=>`You need to link to a project to use ${e.slug} through Vercel Connect.\n\nSelect your team`,deps:t.ensureVercelProjectDeps})}catch(e){if(e instanceof WizardCancelledError)return;throw e}let o={log:r.log,prompter:r,projectRoot:e.appRoot,slug:e.slug,service:e.service,creationType:e.options?.creationType,connectionMethod:e.options?.connectionMethod,principalType:e.options?.principalType,canonicalConnectorName:e.canonicalConnectorName??e.slug,project:a,signal:i},s=await t.setupConnectionConnector(o),c=join(e.appRoot,`agent`,`connections`,`${e.slug}.ts`);if(!(await t.updateConnectionConnectorUid(c,s.connectorUid)).patched)throw s.kind===`created`&&await t.cleanupCreatedConnectionConnector({log:r.log,projectRoot:e.appRoot,connectorId:s.connectorId,orgId:a.orgId}),Error(`Could not update the connector in agent/connections/${e.slug}.ts.`);r.outro(`Connection ${e.slug} set up.`)}async function runIntegrationConnectCommand(e,t,n,r,i,a={},o=defaultDependencies){let s=createRegistrySetupClient({signal:a.signal});try{await runIntegrationConnect({appRoot:t,slug:n,service:r,canonicalConnectorName:i,options:a,dependencies:{...o,createPrompter:()=>s?.prompter??(a.nonInteractive?createHeadlessPrompter(()=>{}):o.createPrompter?.()??createPrompter())}}),s?.complete()}catch(t){if(s?.fail(t),s!==void 0)return;let n=setupPrerequisiteOf(t);if(a.nonInteractive&&n!==void 0){e.error(serializeHeadlessSetupEvent({version:1,type:`blocked`,status:`prerequisite_required`,prerequisite:n})),process.exitCode=2;return}e.error(t instanceof Error?t.message:String(t)),process.exitCode=1}}export{runIntegrationConnect,runIntegrationConnectCommand};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{serializeHeadlessSetupEvent}from"./setup-headless.js";import{createPrompter}from"#setup/prompter.js";import{resolveEveProjectContext}from"#internal/project-context.js";import{ensureVercelProject}from"#setup/flows/ensure-vercel-project.js";import{createHeadlessPrompter}from"#setup/headless.js";import{
|
|
1
|
+
import{serializeHeadlessSetupEvent}from"./setup-headless.js";import{createPrompter}from"#setup/prompter.js";import{resolveEveProjectContext}from"#internal/project-context.js";import{ensureVercelProject}from"#setup/flows/ensure-vercel-project.js";import{createHeadlessPrompter}from"#setup/headless.js";import{setupPrerequisiteOf}from"#setup/integrations/shared/prerequisite.js";import{createRegistrySetupClient}from"#setup/registry-setup-client.js";import{InteractionRequired,InvalidAnswerError,headlessAsker,interactiveAsker,withAnswers,withPolicy}from"#setup/ask.js";import{WEB_CHAT_TEAM_REQUIREMENT}from"#setup/integrations/web/auth-options.js";import{runIntegrationSetup}from"#setup/integrations/runner.js";import{setupQuestionToWire}from"#setup/setup-question-wire.js";const defaultIntegrationSetupDependencies={};async function runIntegrationSetupCommand(e,t,n,r={},i=defaultIntegrationSetupDependencies){let a=createRegistrySetupClient({process:i.setupProcess,signal:r.signal});try{let o=r.nonInteractive===!0,s=(await resolveEveProjectContext(t)).environmentRoot,c=a?.prompter??i.createPrompter?.()??(o?createHeadlessPrompter(()=>{}):createPrompter()),l=o?headlessAsker():interactiveAsker(c),u=r.yes?withPolicy(`assume`)(l):l,d=withAnswers(r.answers??{})(u),f=await runIntegrationSetup(n,{appRoot:t,projectRoot:s,prompter:c,asker:d,force:r.force,resolveVercelProject:o?void 0:()=>ensureVercelProject({appRoot:s,teamRequirement:n===`web`?WEB_CHAT_TEAM_REQUIREMENT:void 0,prompter:c,signal:a?.signal??r.signal}),signal:a?.signal??r.signal,beginExternalAction:o?t=>{let n=`external-action-${crypto.randomUUID()}`;return e.log(serializeHeadlessSetupEvent({version:1,type:`external_action`,id:n,blocking:!0,...t})),{complete(){e.log(serializeHeadlessSetupEvent({version:1,type:`external_action_resolved`,id:n}))}}}:void 0},i.runnerDeps);if(f.kind===`cancelled`){a?.cancel(),process.env.EVE_SETUP===`1`?process.exitCode=130:o&&e.error(serializeHeadlessSetupEvent({version:1,type:`cancelled`,item:n}));return}c.outro(`Integration set up.`),a?.complete(f.completion),o&&a===void 0&&e.log(serializeHeadlessSetupEvent({version:1,type:`completed`,item:n}))}catch(t){if(a?.fail(t),a!==void 0)return;let n=setupPrerequisiteOf(t);r.nonInteractive&&t instanceof InteractionRequired?(e.error(serializeHeadlessSetupEvent({version:1,type:`blocked`,status:`input_required`,question:setupQuestionToWire(t.question)})),process.exitCode=2):r.nonInteractive&&t instanceof InvalidAnswerError?(e.error(serializeHeadlessSetupEvent({version:1,type:`blocked`,status:`input_required`,question:setupQuestionToWire(t.question),issue:{code:`invalid_answer`,message:t.message}})),process.exitCode=2):r.nonInteractive&&n!==void 0?(e.error(serializeHeadlessSetupEvent({version:1,type:`blocked`,status:`prerequisite_required`,prerequisite:n})),process.exitCode=2):(e.error(t instanceof Error?t.message:String(t)),process.exitCode=1)}}export{runIntegrationSetupCommand};
|
|
@@ -1,7 +1,26 @@
|
|
|
1
1
|
import { type Prompter } from "#setup/prompter.js";
|
|
2
2
|
import type { RegistrySetupCompletion } from "#setup/registry-setup-protocol.js";
|
|
3
|
+
import { type SetupPrerequisite } from "#setup/integrations/shared/prerequisite.js";
|
|
3
4
|
import type { RegistryCommandLogger, RegistrySetupDependencies } from "./registry.js";
|
|
4
5
|
import type { RegistrySetupCommand } from "./registry-setup-command.js";
|
|
6
|
+
/**
|
|
7
|
+
* A declared setup that failed after the item's source was installed. Keeps
|
|
8
|
+
* the original error as `cause` so interactive callers can report the item as
|
|
9
|
+
* installed-but-not-set-up and recover from a structured prerequisite (for
|
|
10
|
+
* example `vercel login`) instead of parsing the message.
|
|
11
|
+
*/
|
|
12
|
+
export declare class RegistrySetupFailedError extends Error {
|
|
13
|
+
readonly item: string;
|
|
14
|
+
readonly resumeCommand: string;
|
|
15
|
+
/** The failure without the resume hint, for callers that render it separately. */
|
|
16
|
+
readonly reason: string;
|
|
17
|
+
constructor(input: {
|
|
18
|
+
item: string;
|
|
19
|
+
resumeCommand: string;
|
|
20
|
+
cause: unknown;
|
|
21
|
+
});
|
|
22
|
+
get prerequisite(): SetupPrerequisite | undefined;
|
|
23
|
+
}
|
|
5
24
|
interface DeclaredSetupOptions {
|
|
6
25
|
yes?: boolean;
|
|
7
26
|
force?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{headlessSetupContinuation,serializeHeadlessSetupEvent}from"./setup-headless.js";import{createPrompter}from"#setup/prompter.js";import{WizardCancelledError}from"#setup/step.js";import{createHeadlessPrompter}from"#setup/headless.js";import{mergeRegistrySetupCompletions}from"#setup/registry-setup-completion.js";async function runDeclaredSetups(e){let t={facts:[]};if(e.setups===void 0)return t;let n=await e.dependencies.loadSetupCommandRunner(),r=e.options.prompter??(e.options.nonInteractive?createHeadlessPrompter(e.logger.log):createPrompter());try{for(let i of e.setups){let a=await n(e.appRoot,{...i,args:[...i.args,...e.options.yes?[`--yes`]:[],...e.options.force&&i.package===`eve`&&i.bin===`eve`&&i.args[0]===`integration`&&i.args[1]===`setup`?[`--force`]:[],...e.options.nonInteractive?[`--non-interactive`]:[],...Object.entries(e.options.answers??{}).flatMap(([e,t])=>[`--answer`,`${e}=${JSON.stringify(t)}`])]},e.item,{prompter:r,signal:e.options.signal});if(a.kind===`cancelled`)return!1;if(a.kind===`blocked`){if(!e.options.nonInteractive)throw Error(`Setup requires more input.`);return e.logger.error(serializeHeadlessSetupEvent({version:1,type:`blocked`,item:e.item,installed:!0,completedItems:[],...a.blocker,next:headlessSetupContinuation({item:e.item,installed:!0,answers:e.options.answers,question:a.blocker.status===`input_required`?a.blocker.question:void 0})})),process.exitCode=2,!1}if(e.options.silent!==!0)for(let t of a.facts)e.logger.log(`${t.label}: ${t.value}`);t=mergeRegistrySetupCompletions(t,a)}return t}catch(t){if(t instanceof WizardCancelledError)return!1;let n=t instanceof Error?t.message:String(t);if(e.options.nonInteractive)return e.logger.error(serializeHeadlessSetupEvent({version:1,type:`failed`,item:e.item,completedItems:[],message:n,next:headlessSetupContinuation({item:e.item,installed:!0,answers:e.options.answers})})),process.exitCode=1,!1;throw
|
|
1
|
+
import{headlessSetupContinuation,serializeHeadlessSetupEvent}from"./setup-headless.js";import{createPrompter}from"#setup/prompter.js";import{WizardCancelledError}from"#setup/step.js";import{createHeadlessPrompter}from"#setup/headless.js";import{SetupPrerequisiteRequired,setupPrerequisiteOf}from"#setup/integrations/shared/prerequisite.js";import{mergeRegistrySetupCompletions}from"#setup/registry-setup-completion.js";var RegistrySetupFailedError=class extends Error{item;resumeCommand;reason;constructor(e){let t=e.cause instanceof Error?e.cause.message:String(e.cause);super(`${t} Try again with \`${e.resumeCommand}\`.`,{cause:e.cause}),this.name=`RegistrySetupFailedError`,this.item=e.item,this.resumeCommand=e.resumeCommand,this.reason=t}get prerequisite(){return setupPrerequisiteOf(this.cause)}};async function runDeclaredSetups(e){let t={facts:[]};if(e.setups===void 0)return t;let n=await e.dependencies.loadSetupCommandRunner(),r=e.options.prompter??(e.options.nonInteractive?createHeadlessPrompter(e.logger.log):createPrompter());try{for(let i of e.setups){let a=await n(e.appRoot,{...i,args:[...i.args,...e.options.yes?[`--yes`]:[],...e.options.force&&i.package===`eve`&&i.bin===`eve`&&i.args[0]===`integration`&&i.args[1]===`setup`?[`--force`]:[],...e.options.nonInteractive?[`--non-interactive`]:[],...Object.entries(e.options.answers??{}).flatMap(([e,t])=>[`--answer`,`${e}=${JSON.stringify(t)}`])]},e.item,{prompter:r,signal:e.options.signal});if(a.kind===`cancelled`)return!1;if(a.kind===`blocked`){if(!e.options.nonInteractive)throw a.blocker.status===`prerequisite_required`?new SetupPrerequisiteRequired(a.blocker.prerequisite):Error(`Setup requires more input.`);return e.logger.error(serializeHeadlessSetupEvent({version:1,type:`blocked`,item:e.item,installed:!0,completedItems:[],...a.blocker,next:headlessSetupContinuation({item:e.item,installed:!0,answers:e.options.answers,question:a.blocker.status===`input_required`?a.blocker.question:void 0})})),process.exitCode=2,!1}if(e.options.silent!==!0)for(let t of a.facts)e.logger.log(`${t.label}: ${t.value}`);t=mergeRegistrySetupCompletions(t,a)}return t}catch(t){if(t instanceof WizardCancelledError)return!1;let n=t instanceof Error?t.message:String(t);if(e.options.nonInteractive)return e.logger.error(serializeHeadlessSetupEvent({version:1,type:`failed`,item:e.item,completedItems:[],message:n,next:headlessSetupContinuation({item:e.item,installed:!0,answers:e.options.answers})})),process.exitCode=1,!1;throw new RegistrySetupFailedError({item:e.item,resumeCommand:e.resumeCommand,cause:t})}}export{RegistrySetupFailedError,runDeclaredSetups};
|
|
@@ -7,7 +7,9 @@ export declare function reportRegistryCompletion(logger: RegistryCommandLogger,
|
|
|
7
7
|
nonInteractive?: boolean;
|
|
8
8
|
}): RegistrySetupCompletion | undefined;
|
|
9
9
|
export declare function errorMessage(error: unknown): string;
|
|
10
|
-
export declare function runRegistryAction<T>(logger: RegistryCommandLogger, _appRoot: string, action: () => Promise<T
|
|
10
|
+
export declare function runRegistryAction<T>(logger: RegistryCommandLogger, _appRoot: string, action: () => Promise<T>, options?: {
|
|
11
|
+
rethrow?: (error: unknown) => boolean;
|
|
12
|
+
}): Promise<T | undefined>;
|
|
11
13
|
export declare function resolveRegistryItemForAdd<T>(logger: RegistryCommandLogger, loadItem: () => Promise<T>, printSuggestions: () => Promise<void>): Promise<{
|
|
12
14
|
found: true;
|
|
13
15
|
item: T;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{reportHeadlessSetupCompletion}from"./setup-headless.js";import{WizardCancelledError}from"#setup/step.js";function reportRegistryCompletion(e,t,n,r){return reportHeadlessSetupCompletion({logger:e,item:t,completion:n,nonInteractive:r.nonInteractive})}function errorMessage(e){return e instanceof Error?e.message:String(e)}function isRegistryNotFoundError(e){return e instanceof Error&&`code`in e&&e.code===`NOT_FOUND`}async function runRegistryAction(e,t,n){try{return await n()}catch(t){if(t instanceof WizardCancelledError)return;e.error(errorMessage(t)),process.exitCode=1;return}}async function resolveRegistryItemForAdd(e,t,n){try{return{found:!0,item:await t()}}catch(t){if(!isRegistryNotFoundError(t))throw t;return e.error(errorMessage(t)),await n(),process.exitCode=1,{found:!1}}}function setupResumeCommand(e){return`eve add ${/^[\w@./:-]+$/.test(e)?e:`'${e.replaceAll(`'`,`'\\''`)}'`} --skip-install`}function setupReminder(e,t){return`${t===`cancelled`?`Setup cancelled.`:`Setup skipped.`} Run \`${setupResumeCommand(e)}\` when you're ready.`}export{errorMessage,reportRegistryCompletion,resolveRegistryItemForAdd,runRegistryAction,setupReminder,setupResumeCommand};
|
|
1
|
+
import{reportHeadlessSetupCompletion}from"./setup-headless.js";import{WizardCancelledError}from"#setup/step.js";function reportRegistryCompletion(e,t,n,r){return reportHeadlessSetupCompletion({logger:e,item:t,completion:n,nonInteractive:r.nonInteractive})}function errorMessage(e){return e instanceof Error?e.message:String(e)}function isRegistryNotFoundError(e){return e instanceof Error&&`code`in e&&e.code===`NOT_FOUND`}async function runRegistryAction(e,t,n,r={}){try{return await n()}catch(t){if(t instanceof WizardCancelledError)return;if(r.rethrow?.(t)===!0)throw t;e.error(errorMessage(t)),process.exitCode=1;return}}async function resolveRegistryItemForAdd(e,t,n){try{return{found:!0,item:await t()}}catch(t){if(!isRegistryNotFoundError(t))throw t;return e.error(errorMessage(t)),await n(),process.exitCode=1,{found:!1}}}function setupResumeCommand(e){return`eve add ${/^[\w@./:-]+$/.test(e)?e:`'${e.replaceAll(`'`,`'\\''`)}'`} --skip-install`}function setupReminder(e,t){return`${t===`cancelled`?`Setup cancelled.`:`Setup skipped.`} Run \`${setupResumeCommand(e)}\` when you're ready.`}export{errorMessage,reportRegistryCompletion,resolveRegistryItemForAdd,runRegistryAction,setupReminder,setupResumeCommand};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { SetupPrerequisite } from "#setup/integrations/shared/prerequisite.js";
|
|
1
2
|
import { type Prompter } from "#setup/prompter.js";
|
|
2
3
|
import type { RegistrySetupCompletion } from "#setup/registry-setup-protocol.js";
|
|
3
4
|
import { type RegistryCommandLogger } from "./registry-recovery.js";
|
|
@@ -5,6 +6,14 @@ import type { runRegistrySetupCommand } from "./registry-setup-command.js";
|
|
|
5
6
|
import { prepareWebRegistryProject } from "./registry-project.js";
|
|
6
7
|
export { runRegistryAddCommand } from "./registry-add-command.js";
|
|
7
8
|
export type { RegistryCommandLogger } from "./registry-recovery.js";
|
|
9
|
+
/** Source was installed, but the item's setup was cancelled, skipped, or failed. */
|
|
10
|
+
export interface RegistrySetupIncomplete {
|
|
11
|
+
resumeCommand: string;
|
|
12
|
+
/** Why setup failed; absent when it was cancelled or skipped. */
|
|
13
|
+
reason?: string;
|
|
14
|
+
/** A structured action that unblocks setup, such as `vercel login`. */
|
|
15
|
+
prerequisite?: SetupPrerequisite;
|
|
16
|
+
}
|
|
8
17
|
export interface AddCommandOptions {
|
|
9
18
|
skipInstall?: boolean;
|
|
10
19
|
overwrite?: boolean;
|
|
@@ -37,6 +46,8 @@ type RunAddCommandOptions = AddCommandOptions & {
|
|
|
37
46
|
prompter?: Prompter;
|
|
38
47
|
signal?: AbortSignal;
|
|
39
48
|
setupAuthorized?: boolean;
|
|
49
|
+
/** Throw {@link RegistrySetupFailedError} to the caller instead of logging it. */
|
|
50
|
+
throwSetupFailures?: boolean;
|
|
40
51
|
};
|
|
41
52
|
/** One discoverable item from an eve-compatible registry catalog. */
|
|
42
53
|
export interface RegistryCatalogItem {
|
|
@@ -75,10 +86,7 @@ export declare function installRegistryItem(appRoot: string, item: string, optio
|
|
|
75
86
|
}, dependencies?: AddCommandDependencies): Promise<{
|
|
76
87
|
output: readonly string[];
|
|
77
88
|
setup?: RegistrySetupCompletion;
|
|
78
|
-
|
|
79
|
-
setupIncomplete?: {
|
|
80
|
-
resumeCommand: string;
|
|
81
|
-
};
|
|
89
|
+
setupIncomplete?: RegistrySetupIncomplete;
|
|
82
90
|
}>;
|
|
83
91
|
/** Installs an official, configured, or URL-addressed registry item. */
|
|
84
92
|
export declare function runAddCommand(logger: RegistryCommandLogger, appRoot: string, item: string, options: RunAddCommandOptions, dependencies?: AddCommandDependencies): Promise<RegistrySetupCompletion | false | "setup-incomplete" | undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{hasInteractiveTerminal}from"./preconditions.js";import{serializeHeadlessSetupEvent}from"./setup-headless.js";import{prepareWebChatProjectRoot,prepareWebRegistryProject,readRegistryConfig}from"./registry-project.js";import{errorMessage,reportRegistryCompletion,resolveRegistryItemForAdd,runRegistryAction,setupReminder,setupResumeCommand}from"./registry-recovery.js";import{runRegistryAddCommand}from"./registry-add-command.js";import{runDeclaredSetups}from"./registry-declared-setups.js";import{installRegistryItemTransaction}from"./registry-install-transaction.js";import{eveMetadataFromRegistryItem,parseOfficialRegistrySearchMetadata}from"./registry-metadata.js";import{prepareDeclaredPnpmBuildPolicy}from"./registry-pnpm-build-policy-flow.js";import{printRegistrySearchResults,registryViewText}from"./registry-presentation.js";import{resolveInstalledPackageInfo}from"#internal/application/package.js";import{createPrompter}from"#setup/prompter.js";import{WizardCancelledError}from"#setup/step.js";import{addRegistryItems,getRegistryItems,searchRegistries}from"#compiled/shadcn-registry/index.js";import semver from"#compiled/semver/index.js";const defaultAddCommandDependencies={createPrompter,hasInteractiveTerminal,loadSetupCommandRunner:async()=>(await import(`./registry-setup-command.js`)).runRegistrySetupCommand,prepareWebRegistryProject};function resolveOfficialRegistryUrl(e=process.env.EVE_DEV_OFFICIAL_REGISTRY_URL){if(e===void 0)return`https://eve.dev/r`;let t;try{t=new URL(e)}catch{throw Error(`EVE_DEV_OFFICIAL_REGISTRY_URL must be an HTTP(S) URL.`)}if(t.protocol!==`http:`&&t.protocol!==`https:`)throw Error(`EVE_DEV_OFFICIAL_REGISTRY_URL must be an HTTP(S) URL.`);if(t.username!==``||t.password!==``)throw Error(`EVE_DEV_OFFICIAL_REGISTRY_URL must not include credentials.`);if(t.search!==``||t.hash!==``)throw Error(`EVE_DEV_OFFICIAL_REGISTRY_URL must not include a query or fragment.`);return t.pathname=t.pathname.replace(/\/+$/,``),t.toString().replace(/\/$/,``)}const OFFICIAL_REGISTRY=resolveOfficialRegistryUrl(),OFFICIAL_CATALOG=`${OFFICIAL_REGISTRY}/registry.json`,SKILLS_REGISTRY=`@skills`;function itemAddress(e){return e.startsWith(`@`)||/^https?:\/\//.test(e)?e:`${OFFICIAL_REGISTRY}/${e}.json`}function assertCompatibleEveVersion(e){if(e===void 0)return;let t=resolveInstalledPackageInfo().version;if(semver.validRange(e)===null)throw Error(`Registry item has an invalid eve version requirement: ${e}.`);if(!semver.subset(t,e))throw Error(`This registry item requires eve ${e}, but this project is using eve ${t}. Upgrade eve and run the command again.`)}function isOfficialItemAddress(e){return e.startsWith(`${OFFICIAL_REGISTRY}/`)}function withBuiltInRegistries(e){return{...e,registries:{[SKILLS_REGISTRY]:`https://www.skills.sh/r/{name}?agent=eve`,...e.registries}}}async function readEveRegistryConfig(e){return withBuiltInRegistries(await readRegistryConfig(e))}function configuredRegistrySources(e){return Object.keys(e.registries??{})}function validateRegistrySource(e){if(e!==void 0&&!e.startsWith(`@`)&&!/^https?:\/\//.test(e))throw Error(`Registry sources must be a namespace or URL: ${e}`)}async function loadOfficialSearchMetadata(){let e=await fetch(OFFICIAL_CATALOG);if(!e.ok)throw Error(`Could not read the eve registry (${e.status}).`);return parseOfficialRegistrySearchMetadata(await e.json())}function searchItemAddress(e){return e.registry===OFFICIAL_CATALOG?e.name:e.addCommandArgument}function enrichSearchItem(e,t){let n=searchItemAddress(e);return{item:e,address:n,...t.get(n)}}function registrySourceLabel(e){return e===OFFICIAL_CATALOG?`eve`:e===SKILLS_REGISTRY?`skills.sh`:e}function searchPresentationSections(e,t,n){return e.flatMap(e=>{let r=t.get(e);return r===void 0?[]:[{label:registrySourceLabel(e),items:r.items.map(e=>enrichSearchItem(e,n)),total:r.pagination.total}]})}async function printAddSuggestions(e,t,n){try{let r=n.split(`/`).at(-1)||n,{resultsBySource:i,sources:a,metadataByAddress:o}=await searchRegistryCatalog(t,{limit:5,query:r}),s=searchPresentationSections(a,i,o);if(s.every(e=>e.items.length===0))return;e.log(`Did you mean?`),printRegistrySearchResults(e,{query:r,sections:s})}catch{}}async function searchRegistryCatalog(e,t){validateRegistrySource(t.source);let n=await readEveRegistryConfig(e),r=t.source?[t.source]:[OFFICIAL_CATALOG,...configuredRegistrySources(n).filter(e=>t.query!==void 0||e!==SKILLS_REGISTRY)],i=await Promise.all(r.map(async e=>{try{return{result:await searchRegistries([e],{config:n,limit:t.limit??100,query:t.query}),source:e}}catch(t){return{error:t,source:e}}})),a=[],o=new Map;for(let e of i)if(`error`in e)a.push({message:errorMessage(e.error),registry:e.source});else{let t=e.result.errors??[];if(a.push(...t),t.length===0){let t=e.result.items.filter(t=>t.registry===e.source);o.set(e.source,{...e.result,items:t,pagination:{...e.result.pagination,total:e.result.items.length===t.length?e.result.pagination.total:0}})}}let s=new Map(a.map(e=>[`${e.registry}\0${e.message}`,e])),c=o.has(OFFICIAL_CATALOG)?await loadOfficialSearchMetadata():new Map,l=o.get(OFFICIAL_CATALOG);if(l!==void 0){let e=l.items.filter(e=>c.get(searchItemAddress(e))?.hidden!==!0);l.items=e,l.pagination={...l.pagination,total:e.length},l.items.sort((e,t)=>{let rank=e=>c.get(searchItemAddress(e))?.implementation===`native`?0:1;return rank(e)-rank(t)})}let u=[...o.values()];return{config:n,result:{items:u.flatMap(e=>e.items),pagination:{hasMore:u.some(e=>e.pagination.hasMore),limit:t.limit??100,offset:0,total:u.reduce((e,t)=>e+t.pagination.total,0)},...s.size>0?{errors:[...s.values()]}:{}},resultsBySource:o,sources:r,metadataByAddress:c}}async function browseRegistryCatalog(e,t={}){let{result:n}=await searchRegistryCatalog(e,t);return{items:n.items.map(e=>{let t={address:e.registry===OFFICIAL_CATALOG?e.name:e.addCommandArgument,name:e.name,source:e.registry===OFFICIAL_CATALOG?`Vercel`:e.registry};return e.title!==void 0&&(t.title=e.title),e.type!==void 0&&(t.type=e.type),e.description!==void 0&&(t.description=e.description),t}),total:n.pagination.total,errors:n.errors??[]}}async function browseRegistryItems(e,t,n,r,i={}){let{result:a,resultsBySource:o,sources:s,metadataByAddress:c}=await searchRegistryCatalog(t,{limit:i.limit,query:n,source:r}),l=a.errors??[];if(i.json||o.size>0){let t=a.items.map(e=>({...e,...c.get(searchItemAddress(e))})),r={query:n,sections:searchPresentationSections(s,o,c)};i.json&&(r.json={...a,items:t}),printRegistrySearchResults(e,r)}for(let t of l)e.error(`${t.registry}: ${t.message}`);l.length>0&&(process.exitCode=1)}async function installRegistryItem(e,t,n={},r=defaultAddCommandDependencies){let i,a=[],o={error:e=>{i=e},log:e=>a.push(e)},s=process.exitCode,c=await runAddCommand(o,e,t,{...n,yes:n.prompter===void 0||n.yes,setupAuthorized:n.prompter!==void 0},r);if(process.exitCode=s,i!==void 0)throw Error(i);if(c===!1)throw new WizardCancelledError;if(c===`setup-incomplete`)return{output:a,setupIncomplete:{resumeCommand:setupResumeCommand(t)}};let l={output:a};return c!==void 0&&(l.setup=c),l}async function runAddCommand(e,t,n,r,i=defaultAddCommandDependencies){let setupIncomplete=t=>(r.silent!==!0&&e.log(setupReminder(n,t)),`setup-incomplete`);return runRegistryAction(e,t,async()=>{let a=itemAddress(n),o=a===itemAddress(`channel/web`)&&r.skipInstall!==!0?await prepareWebChatProjectRoot(t):t,s=await readEveRegistryConfig(t);if(r.skipInstall===!0){if(r.overwrite===!0)throw Error(`--overwrite cannot be used with --skip-install.`);if(r.skipSetup===!0)throw Error(`--skip-install cannot be used with --skip-setup.`);if(!isOfficialItemAddress(a))throw Error(`Setup flows are currently supported only for official eve registry items.`)}let c=await resolveRegistryItemForAdd(e,async()=>(await getRegistryItems([a],{config:s}))[0],()=>printAddSuggestions(e,t,n));if(!c.found)return;let l=c.item,u=isOfficialItemAddress(a)?eveMetadataFromRegistryItem(l):void 0;if(assertCompatibleEveVersion(u?.requires),r.skipInstall===!0){if(u?.setup===void 0)throw Error(`Registry item "${n}" does not declare a setup flow.`);let a=await runDeclaredSetups({logger:e,appRoot:t,item:n,setups:u.setup,options:r,dependencies:i,resumeCommand:setupResumeCommand(n)});return a===!1&&!r.nonInteractive?setupIncomplete(`cancelled`):reportRegistryCompletion(e,n,a,r)}if(!await prepareDeclaredPnpmBuildPolicy({logger:e,appRoot:o,item:n,policies:u?.install?.pnpm?.buildScripts,options:r}))return!1;if(a===itemAddress(`channel/web`)&&await(i.prepareWebRegistryProject??prepareWebRegistryProject)(o),await installRegistryItemTransaction({appRoot:o,item:n,registryItem:l,nonInteractive:r.nonInteractive,logger:e,install:async()=>{await addRegistryItems([a],{config:s,cwd:o,overwrite:r.overwrite,silent:r.silent})}}),u?.setup===void 0)return reportRegistryCompletion(e,n,{facts:[]},r);let d=i.hasInteractiveTerminal?.()??defaultAddCommandDependencies.hasInteractiveTerminal();if(r.nonInteractive&&e.log(serializeHeadlessSetupEvent({version:1,type:`progress`,message:r.skipInstall?`Setup ${n}`:`Installed ${n}`})),r.skipSetup===!0)return r.nonInteractive?reportRegistryCompletion(e,n,{facts:[]},r):setupIncomplete(`skipped`);if(!r.nonInteractive&&!r.yes&&!d&&r.setupAuthorized!==!0)return setupIncomplete(`skipped`);if(!r.nonInteractive&&!r.yes&&r.setupAuthorized!==!0)try{if(await(r.prompter??i.createPrompter?.()??defaultAddCommandDependencies.createPrompter()).select({message:`Set up ${n} now?`,initialValue:`yes`,options:[{value:`yes`,label:`Yes`},{value:`no`,label:`No`}]})===`no`)return setupIncomplete(`skipped`)}catch(e){if(!(e instanceof WizardCancelledError))throw e;return setupIncomplete(`cancelled`)}let f=await runDeclaredSetups({logger:e,appRoot:t,item:n,setups:u.setup,options:{...r,force:r.overwrite},dependencies:i,resumeCommand:setupResumeCommand(n)});return f===!1&&!r.nonInteractive?setupIncomplete(`cancelled`):reportRegistryCompletion(e,n,f,r)})}async function runRegistryListCommand(e,t,n,r={}){await runRegistryAction(e,t,()=>browseRegistryItems(e,t,void 0,n,r))}async function runRegistrySearchCommand(e,t,n,r,i={}){await runRegistryAction(e,t,()=>browseRegistryItems(e,t,n,r,{...i,limit:i.limit??10}))}async function runRegistryViewCommand(e,t,n,r={}){await runRegistryAction(e,t,async()=>{let i=await readEveRegistryConfig(t),a=await getRegistryItems([itemAddress(n)],{config:i}),o=a.length===1?a[0]:a;e.log(r.json?JSON.stringify(o,null,2):registryViewText(n,o))})}export{browseRegistryCatalog,installRegistryItem,resolveOfficialRegistryUrl,runAddCommand,runRegistryAddCommand,runRegistryListCommand,runRegistrySearchCommand,runRegistryViewCommand};
|
|
1
|
+
import{hasInteractiveTerminal}from"./preconditions.js";import{serializeHeadlessSetupEvent}from"./setup-headless.js";import{prepareWebChatProjectRoot,prepareWebRegistryProject,readRegistryConfig}from"./registry-project.js";import{errorMessage,reportRegistryCompletion,resolveRegistryItemForAdd,runRegistryAction,setupReminder,setupResumeCommand}from"./registry-recovery.js";import{runRegistryAddCommand}from"./registry-add-command.js";import{RegistrySetupFailedError,runDeclaredSetups}from"./registry-declared-setups.js";import{installRegistryItemTransaction}from"./registry-install-transaction.js";import{eveMetadataFromRegistryItem,parseOfficialRegistrySearchMetadata}from"./registry-metadata.js";import{prepareDeclaredPnpmBuildPolicy}from"./registry-pnpm-build-policy-flow.js";import{printRegistrySearchResults,registryViewText}from"./registry-presentation.js";import{resolveInstalledPackageInfo}from"#internal/application/package.js";import{createPrompter}from"#setup/prompter.js";import{WizardCancelledError}from"#setup/step.js";import{addRegistryItems,getRegistryItems,searchRegistries}from"#compiled/shadcn-registry/index.js";import semver from"#compiled/semver/index.js";const defaultAddCommandDependencies={createPrompter,hasInteractiveTerminal,loadSetupCommandRunner:async()=>(await import(`./registry-setup-command.js`)).runRegistrySetupCommand,prepareWebRegistryProject};function resolveOfficialRegistryUrl(e=process.env.EVE_DEV_OFFICIAL_REGISTRY_URL){if(e===void 0)return`https://eve.dev/r`;let t;try{t=new URL(e)}catch{throw Error(`EVE_DEV_OFFICIAL_REGISTRY_URL must be an HTTP(S) URL.`)}if(t.protocol!==`http:`&&t.protocol!==`https:`)throw Error(`EVE_DEV_OFFICIAL_REGISTRY_URL must be an HTTP(S) URL.`);if(t.username!==``||t.password!==``)throw Error(`EVE_DEV_OFFICIAL_REGISTRY_URL must not include credentials.`);if(t.search!==``||t.hash!==``)throw Error(`EVE_DEV_OFFICIAL_REGISTRY_URL must not include a query or fragment.`);return t.pathname=t.pathname.replace(/\/+$/,``),t.toString().replace(/\/$/,``)}const OFFICIAL_REGISTRY=resolveOfficialRegistryUrl(),OFFICIAL_CATALOG=`${OFFICIAL_REGISTRY}/registry.json`,SKILLS_REGISTRY=`@skills`;function itemAddress(e){return e.startsWith(`@`)||/^https?:\/\//.test(e)?e:`${OFFICIAL_REGISTRY}/${e}.json`}function assertCompatibleEveVersion(e){if(e===void 0)return;let t=resolveInstalledPackageInfo().version;if(semver.validRange(e)===null)throw Error(`Registry item has an invalid eve version requirement: ${e}.`);if(!semver.subset(t,e))throw Error(`This registry item requires eve ${e}, but this project is using eve ${t}. Upgrade eve and run the command again.`)}function isOfficialItemAddress(e){return e.startsWith(`${OFFICIAL_REGISTRY}/`)}function withBuiltInRegistries(e){return{...e,registries:{[SKILLS_REGISTRY]:`https://www.skills.sh/r/{name}?agent=eve`,...e.registries}}}async function readEveRegistryConfig(e){return withBuiltInRegistries(await readRegistryConfig(e))}function configuredRegistrySources(e){return Object.keys(e.registries??{})}function validateRegistrySource(e){if(e!==void 0&&!e.startsWith(`@`)&&!/^https?:\/\//.test(e))throw Error(`Registry sources must be a namespace or URL: ${e}`)}async function loadOfficialSearchMetadata(){let e=await fetch(OFFICIAL_CATALOG);if(!e.ok)throw Error(`Could not read the eve registry (${e.status}).`);return parseOfficialRegistrySearchMetadata(await e.json())}function searchItemAddress(e){return e.registry===OFFICIAL_CATALOG?e.name:e.addCommandArgument}function enrichSearchItem(e,t){let n=searchItemAddress(e);return{item:e,address:n,...t.get(n)}}function registrySourceLabel(e){return e===OFFICIAL_CATALOG?`eve`:e===SKILLS_REGISTRY?`skills.sh`:e}function searchPresentationSections(e,t,n){return e.flatMap(e=>{let r=t.get(e);return r===void 0?[]:[{label:registrySourceLabel(e),items:r.items.map(e=>enrichSearchItem(e,n)),total:r.pagination.total}]})}async function printAddSuggestions(e,t,n){try{let r=n.split(`/`).at(-1)||n,{resultsBySource:i,sources:a,metadataByAddress:o}=await searchRegistryCatalog(t,{limit:5,query:r}),s=searchPresentationSections(a,i,o);if(s.every(e=>e.items.length===0))return;e.log(`Did you mean?`),printRegistrySearchResults(e,{query:r,sections:s})}catch{}}async function searchRegistryCatalog(e,t){validateRegistrySource(t.source);let n=await readEveRegistryConfig(e),r=t.source?[t.source]:[OFFICIAL_CATALOG,...configuredRegistrySources(n).filter(e=>t.query!==void 0||e!==SKILLS_REGISTRY)],i=await Promise.all(r.map(async e=>{try{return{result:await searchRegistries([e],{config:n,limit:t.limit??100,query:t.query}),source:e}}catch(t){return{error:t,source:e}}})),a=[],o=new Map;for(let e of i)if(`error`in e)a.push({message:errorMessage(e.error),registry:e.source});else{let t=e.result.errors??[];if(a.push(...t),t.length===0){let t=e.result.items.filter(t=>t.registry===e.source);o.set(e.source,{...e.result,items:t,pagination:{...e.result.pagination,total:e.result.items.length===t.length?e.result.pagination.total:0}})}}let s=new Map(a.map(e=>[`${e.registry}\0${e.message}`,e])),c=o.has(OFFICIAL_CATALOG)?await loadOfficialSearchMetadata():new Map,l=o.get(OFFICIAL_CATALOG);if(l!==void 0){let e=l.items.filter(e=>c.get(searchItemAddress(e))?.hidden!==!0);l.items=e,l.pagination={...l.pagination,total:e.length},l.items.sort((e,t)=>{let rank=e=>c.get(searchItemAddress(e))?.implementation===`native`?0:1;return rank(e)-rank(t)})}let u=[...o.values()];return{config:n,result:{items:u.flatMap(e=>e.items),pagination:{hasMore:u.some(e=>e.pagination.hasMore),limit:t.limit??100,offset:0,total:u.reduce((e,t)=>e+t.pagination.total,0)},...s.size>0?{errors:[...s.values()]}:{}},resultsBySource:o,sources:r,metadataByAddress:c}}async function browseRegistryCatalog(e,t={}){let{result:n}=await searchRegistryCatalog(e,t);return{items:n.items.map(e=>{let t={address:e.registry===OFFICIAL_CATALOG?e.name:e.addCommandArgument,name:e.name,source:e.registry===OFFICIAL_CATALOG?`Vercel`:e.registry};return e.title!==void 0&&(t.title=e.title),e.type!==void 0&&(t.type=e.type),e.description!==void 0&&(t.description=e.description),t}),total:n.pagination.total,errors:n.errors??[]}}async function browseRegistryItems(e,t,n,r,i={}){let{result:a,resultsBySource:o,sources:s,metadataByAddress:c}=await searchRegistryCatalog(t,{limit:i.limit,query:n,source:r}),l=a.errors??[];if(i.json||o.size>0){let t=a.items.map(e=>({...e,...c.get(searchItemAddress(e))})),r={query:n,sections:searchPresentationSections(s,o,c)};i.json&&(r.json={...a,items:t}),printRegistrySearchResults(e,r)}for(let t of l)e.error(`${t.registry}: ${t.message}`);l.length>0&&(process.exitCode=1)}async function installRegistryItem(e,t,n={},r=defaultAddCommandDependencies){let i,a=[],o={error:e=>{i=e},log:e=>a.push(e)},s=process.exitCode,c;try{c=await runAddCommand(o,e,t,{...n,yes:n.prompter===void 0||n.yes,setupAuthorized:n.prompter!==void 0,throwSetupFailures:!0},r)}catch(e){if(process.exitCode=s,!(e instanceof RegistrySetupFailedError))throw e;let t={resumeCommand:e.resumeCommand,reason:e.reason};return e.prerequisite!==void 0&&(t.prerequisite=e.prerequisite),{output:a,setupIncomplete:t}}if(process.exitCode=s,i!==void 0)throw Error(i);if(c===!1)throw new WizardCancelledError;if(c===`setup-incomplete`)return{output:a,setupIncomplete:{resumeCommand:setupResumeCommand(t)}};let l={output:a};return c!==void 0&&(l.setup=c),l}async function runAddCommand(e,t,n,r,i=defaultAddCommandDependencies){let setupIncomplete=t=>(r.silent!==!0&&e.log(setupReminder(n,t)),`setup-incomplete`);return runRegistryAction(e,t,async()=>{let a=itemAddress(n),o=a===itemAddress(`channel/web`)&&r.skipInstall!==!0?await prepareWebChatProjectRoot(t):t,s=await readEveRegistryConfig(t);if(r.skipInstall===!0){if(r.overwrite===!0)throw Error(`--overwrite cannot be used with --skip-install.`);if(r.skipSetup===!0)throw Error(`--skip-install cannot be used with --skip-setup.`);if(!isOfficialItemAddress(a))throw Error(`Setup flows are currently supported only for official eve registry items.`)}let c=await resolveRegistryItemForAdd(e,async()=>(await getRegistryItems([a],{config:s}))[0],()=>printAddSuggestions(e,t,n));if(!c.found)return;let l=c.item,u=isOfficialItemAddress(a)?eveMetadataFromRegistryItem(l):void 0;if(assertCompatibleEveVersion(u?.requires),r.skipInstall===!0){if(u?.setup===void 0)throw Error(`Registry item "${n}" does not declare a setup flow.`);let a=await runDeclaredSetups({logger:e,appRoot:t,item:n,setups:u.setup,options:r,dependencies:i,resumeCommand:setupResumeCommand(n)});return a===!1&&!r.nonInteractive?setupIncomplete(`cancelled`):reportRegistryCompletion(e,n,a,r)}if(!await prepareDeclaredPnpmBuildPolicy({logger:e,appRoot:o,item:n,policies:u?.install?.pnpm?.buildScripts,options:r}))return!1;if(a===itemAddress(`channel/web`)&&await(i.prepareWebRegistryProject??prepareWebRegistryProject)(o),await installRegistryItemTransaction({appRoot:o,item:n,registryItem:l,nonInteractive:r.nonInteractive,logger:e,install:async()=>{await addRegistryItems([a],{config:s,cwd:o,overwrite:r.overwrite,silent:r.silent})}}),u?.setup===void 0)return reportRegistryCompletion(e,n,{facts:[]},r);let d=i.hasInteractiveTerminal?.()??defaultAddCommandDependencies.hasInteractiveTerminal();if(r.nonInteractive&&e.log(serializeHeadlessSetupEvent({version:1,type:`progress`,message:r.skipInstall?`Setup ${n}`:`Installed ${n}`})),r.skipSetup===!0)return r.nonInteractive?reportRegistryCompletion(e,n,{facts:[]},r):setupIncomplete(`skipped`);if(!r.nonInteractive&&!r.yes&&!d&&r.setupAuthorized!==!0)return setupIncomplete(`skipped`);if(!r.nonInteractive&&!r.yes&&r.setupAuthorized!==!0)try{if(await(r.prompter??i.createPrompter?.()??defaultAddCommandDependencies.createPrompter()).select({message:`Set up ${n} now?`,initialValue:`yes`,options:[{value:`yes`,label:`Yes`},{value:`no`,label:`No`}]})===`no`)return setupIncomplete(`skipped`)}catch(e){if(!(e instanceof WizardCancelledError))throw e;return setupIncomplete(`cancelled`)}let f=await runDeclaredSetups({logger:e,appRoot:t,item:n,setups:u.setup,options:{...r,force:r.overwrite},dependencies:i,resumeCommand:setupResumeCommand(n)});return f===!1&&!r.nonInteractive?setupIncomplete(`cancelled`):reportRegistryCompletion(e,n,f,r)},{rethrow:e=>r.throwSetupFailures===!0&&e instanceof RegistrySetupFailedError})}async function runRegistryListCommand(e,t,n,r={}){await runRegistryAction(e,t,()=>browseRegistryItems(e,t,void 0,n,r))}async function runRegistrySearchCommand(e,t,n,r,i={}){await runRegistryAction(e,t,()=>browseRegistryItems(e,t,n,r,{...i,limit:i.limit??10}))}async function runRegistryViewCommand(e,t,n,r={}){await runRegistryAction(e,t,async()=>{let i=await readEveRegistryConfig(t),a=await getRegistryItems([itemAddress(n)],{config:i}),o=a.length===1?a[0]:a;e.log(r.json?JSON.stringify(o,null,2):registryViewText(n,o))})}export{browseRegistryCatalog,installRegistryItem,resolveOfficialRegistryUrl,runAddCommand,runRegistryAddCommand,runRegistryListCommand,runRegistrySearchCommand,runRegistryViewCommand};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function registryItemProgress(e){return(t,n,r)=>{e.setNavigation?.(void 0),e.replaceContent?.(),e.setStatus(`Adding ${t.title??t.name} · ${n+1} of ${r}`)}}function outcomeDetails(e){switch(e.kind){case`installed`:{let t=e.facts.filter(e=>e.label.length>0),n=Math.max(0,...t.map(e=>e.label.length));return[...e.facts.map(e=>e.label.length===0?e.value:`${e.label.padEnd(n)} ${e.value}`),...e.output]}case`incomplete`:return[
|
|
1
|
+
function registryItemProgress(e){return(t,n,r)=>{e.setNavigation?.(void 0),e.replaceContent?.(),e.setStatus(`Adding ${t.title??t.name} · ${n+1} of ${r}`)}}function outcomeDetails(e){switch(e.kind){case`installed`:{let t=e.facts.filter(e=>e.label.length>0),n=Math.max(0,...t.map(e=>e.label.length));return[...e.facts.map(e=>e.label.length===0?e.value:`${e.label.padEnd(n)} ${e.value}`),...e.output]}case`incomplete`:return[...e.reason===void 0?[]:[e.reason],`Finish with \`${e.resumeCommand}\``];case`failed`:return e.message.replace(" Try again with `",`
|
|
2
2
|
Try again with \``).split(`
|
|
3
3
|
`);case`cancelled`:return[]}}function registryOutcomeSummary(e){switch(e.kind){case`installed`:return`Added ${e.title}`;case`incomplete`:return`Added ${e.title} · setup not finished`;case`failed`:return`Couldn't add ${e.title}`;case`cancelled`:return`${e.title} not added`}}function hasFailedOutcome(e){return e.some(e=>e.kind===`failed`)}function registryCommandOutcome(e,t=[]){let{outcomes:n}=e,r=n.filter(e=>e.kind===`installed`||e.kind===`incomplete`).length,i=n.length===1?registryOutcomeSummary(n[0]):`Added ${r} of ${n.length} items`,a=n.length===1?outcomeDetails(n[0]):n.flatMap(e=>[`* ${registryOutcomeSummary(e)}`,...outcomeDetails(e).map(e=>` ${e}`)]);return a.push(...t.map(e=>`⚠ ${e}`)),{failed:hasFailedOutcome(n),summary:i,message:a.join(`
|
|
4
4
|
`)}}export{registryCommandOutcome,registryItemProgress};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ModelAccessChange, ModelConnectionSelection } from "#shared/model-connection.js";
|
|
2
2
|
import { runModelLogin } from "#setup/flows/model-login.js";
|
|
3
|
+
import { runLoginFlow } from "#setup/flows/login.js";
|
|
3
4
|
import { runDeployFlow } from "#setup/flows/deploy.js";
|
|
4
5
|
import { runInstallVercelCliFlow } from "#setup/flows/install-vercel-cli.js";
|
|
5
6
|
import { runRegistryFlow } from "#setup/flows/registry.js";
|
|
@@ -44,6 +45,7 @@ export interface TuiSetupFlows {
|
|
|
44
45
|
runInstallVercelCliFlow: typeof runInstallVercelCliFlow;
|
|
45
46
|
runRegistryFlow: typeof runRegistryFlow;
|
|
46
47
|
runDeployFlow: typeof runDeployFlow;
|
|
48
|
+
runLoginFlow?: typeof runLoginFlow;
|
|
47
49
|
}
|
|
48
50
|
/** Setup owns flow-close behavior; the command adapter receives only the transcript outcome. */
|
|
49
51
|
export interface TuiSetupCommandResult extends PromptCommandOutcome {
|