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
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { StandardSchemaV1 } from "#compiled/@standard-schema/spec/index.js";
|
|
2
|
+
import type { SessionSchedule } from "#context/session-schedule.js";
|
|
3
|
+
import type { ScheduleClient, ScheduleClientCreate, DynamicSchedulesDefinition, ScheduleEnvelope, ScheduleScopeContext } from "#public/schedules/subscription.js";
|
|
4
|
+
export interface ScheduleBoundCallContext extends ScheduleScopeContext {
|
|
5
|
+
readonly application: string;
|
|
6
|
+
readonly collection: string;
|
|
7
|
+
readonly operationId?: () => string;
|
|
8
|
+
}
|
|
9
|
+
export interface PreparedScheduleCreate<TPrepared = unknown> {
|
|
10
|
+
readonly displayName: string;
|
|
11
|
+
readonly expression: import("#public/schedules/subscription.js").ScheduleTiming;
|
|
12
|
+
readonly envelope: ScheduleEnvelope<TPrepared>;
|
|
13
|
+
}
|
|
14
|
+
/** Internal capabilities used by generated create approval; authored clients expose only create. */
|
|
15
|
+
export interface ScheduleCollectionClient<TInput, TPrepared> extends ScheduleClient<TInput> {
|
|
16
|
+
prepareCreate(input: ScheduleClientCreate<TInput>): Promise<PreparedScheduleCreate<TInput | TPrepared>>;
|
|
17
|
+
create(input: ScheduleClientCreate<TInput>, approved?: PreparedScheduleCreate): Promise<import("#public/schedules/subscription.js").ScheduleRecord>;
|
|
18
|
+
}
|
|
19
|
+
export declare function createScheduleCollectionClient<TPayload, TPrepared = TPayload>(definition: DynamicSchedulesDefinition<TPayload, StandardSchemaV1<unknown, TPayload>, TPrepared>, callContext: ScheduleBoundCallContext): ScheduleCollectionClient<TPayload, TPrepared>;
|
|
20
|
+
export declare function assertScheduleManagementAllowed(schedule?: SessionSchedule): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createHash,randomUUID}from"node:crypto";import{contextStorage,loadContext}from"#context/container.js";import{projectScheduleRecord}from"#runtime/schedules/record.js";import{createScheduleCollectionPayload,validateSchedulePayload}from"#runtime/schedules/payload.js";import{isDeepStrictEqual}from"node:util";import{readSessionSchedule}from"#context/session-schedule.js";import{BundleKey}from"#runtime/sessions/runtime-context-keys.js";import{resolveScheduleTiming,validateScheduleListLimit,validateScheduleName}from"#runtime/schedules/validation.js";import{dispatchScheduledOccurrence}from"#runtime/schedules/dispatch-occurrence.js";import{byPrincipal}from"#public/schedules/scope.js";function createScheduleCollectionClient(e,t){let n=t.operationId??randomUUID,contextFor=(e,n)=>{let r={...t,operation:e};return n!==void 0&&(r.name=n),r},resolveNamespace=async(r,i)=>{assertScheduleManagementAllowed(t.session.schedule);let a=contextFor(r,i),o=e.scope===void 0?byPrincipal(a):await e.scope({...a,operation:r});if(o===null)throw Error(`Schedule ${r} is not available in this context.`);return validateScope(o),{scope:o,provider:{abortSignal:t.abortSignal,collection:t.collection,namespace:deriveScheduleNamespace(t.application,t.collection,o),operationId:n(),target:{key:t.application,deliver:async({payload:n,occurrence:r})=>{await dispatchScheduledOccurrence({bundle:loadContext().require(BundleKey),collection:t.collection,definition:e,occurrence:{...r,collection:t.collection},payload:n})}}}}},prepareCreation=async n=>{let r=validateScheduleName(n.name);resolveScheduleTiming(n.expression);let{scope:i,provider:a}=await resolveNamespace(`create`,r),o=principalReference(t.session.auth.current);if(o===null)throw Error(`Creating a schedule requires an authenticated principal.`);let s=await validateSchedulePayload(e.inputSchema,n.payload),c={version:3,payload:e.preparePayload===void 0?s:await e.preparePayload(s,{...contextFor(`create`,r),operation:`create`,name:r}),scope:i,principal:o},l=createScheduleCollectionPayload({application:t.application,collection:t.collection,envelope:c}),u={displayName:r,expression:JSON.parse(JSON.stringify(n.expression)),envelope:l.envelope};if(Buffer.byteLength(JSON.stringify(u))>65536)throw Error(`Prepared schedule creation exceeds the 64 KB limit, including timing and payload.`);return{prepared:u,provider:a}};return{async prepareCreate(e){return(await prepareCreation(e)).prepared},async create(n,r){let{prepared:i,provider:a}=await prepareCreation(n);if(r!==void 0&&!isDeepStrictEqual(i,r))throw Error(`Schedule creation changed after approval. Request a new creation approval; no schedule was written.`);let o=`${i.displayName.slice(0,218)}--${randomUUID()}`,s=resolveScheduleTiming(n.expression),c=createScheduleCollectionPayload({application:t.application,collection:t.collection,envelope:i.envelope});return projectScheduleRecord(await e.provider.create(a,{expression:s,name:o,payload:c}))},async delete(t){let n=validateScheduleName(t),{provider:r}=await resolveNamespace(`delete`,n);return await e.provider.delete(r,n)},async disable(t){let n=validateScheduleName(t),{provider:r}=await resolveNamespace(`disable`,n);return projectScheduleRecord(await e.provider.disable(r,n))},async enable(t){let n=validateScheduleName(t),{provider:r}=await resolveNamespace(`enable`,n);return projectScheduleRecord(await e.provider.enable(r,n))},async get(t){let n=validateScheduleName(t),{provider:r}=await resolveNamespace(`get`,n),i=await e.provider.get(r,n);return i===null?null:projectScheduleRecord(i)},async invoke(t){let n=validateScheduleName(t),{provider:r}=await resolveNamespace(`invoke`,n);await e.provider.invoke(r,n)},async list(t={}){let n=validateScheduleListLimit(t.limit),{provider:r}=await resolveNamespace(`list`),i={};t.cursor?.trim()&&(i.cursor=t.cursor.trim()),n!==void 0&&(i.limit=n);let a=await e.provider.list(r,i);return{...a,data:a.data.map(projectScheduleRecord)}}}}function assertScheduleManagementAllowed(e){let t=contextStorage.getStore();if(e!==void 0||t!==void 0&&readSessionSchedule(t)!==void 0)throw Error(`Schedule management is unavailable during scheduled execution.`)}function principalReference(e){if(e===null||e.principalType===`anonymous`||e.principalType===`runtime`)return null;let t={type:e.principalType,authenticator:e.authenticator,principalId:e.principalId};return e.issuer!==void 0&&(t.issuer=e.issuer),e.subject!==void 0&&(t.subject=e.subject),t}function validateScope(e){let t=typeof e==`string`?[e]:e;if(t.length===0||t.some(e=>typeof e!=`string`||e.trim().length===0))throw Error(`Schedule scope must be a non-empty string or tuple of non-empty strings.`)}function deriveScheduleNamespace(e,t,n){if(e.trim().length===0)throw Error(`Schedule application must not be empty.`);return`eve-${createHash(`sha256`).update(JSON.stringify([`eve-schedule-namespace-v2`,e,t,n])).digest(`base64url`)}`}export{assertScheduleManagementAllowed,createScheduleCollectionClient};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { DynamicSchedulesDefinition, ScheduleOccurrenceIdentity } from "#public/schedules/subscription.js";
|
|
2
|
+
import type { ScheduleCollectionPayload } from "#runtime/schedules/payload.js";
|
|
3
|
+
import type { CompiledRuntimeAgentBundle } from "#runtime/sessions/compiled-agent-cache.js";
|
|
4
|
+
/** Dispatches an at-least-once callback and reports the sessions it started, if any. */
|
|
5
|
+
export declare function dispatchScheduledOccurrence(input: {
|
|
6
|
+
readonly bundle: Pick<CompiledRuntimeAgentBundle, "compiledArtifactsSource" | "graph">;
|
|
7
|
+
readonly collection: string;
|
|
8
|
+
readonly definition: DynamicSchedulesDefinition<any, any, any>;
|
|
9
|
+
readonly occurrence: ScheduleOccurrenceIdentity;
|
|
10
|
+
readonly payload: ScheduleCollectionPayload<unknown>;
|
|
11
|
+
readonly verifyDelivery?: () => Promise<void>;
|
|
12
|
+
}): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{scheduleDisplayName}from"#runtime/schedules/record.js";import{createWorkflowRuntime}from"#execution/workflow-runtime.js";import{ScheduleDispatcher}from"#channel/schedule.js";async function dispatchScheduledOccurrence(e){let t={...e.occurrence,displayName:scheduleDisplayName(e.occurrence.name)},n=await new ScheduleDispatcher({runtime:createWorkflowRuntime({compiledArtifactsSource:e.bundle.compiledArtifactsSource}),channels:e.bundle.graph.root.channels}).triggerCollection({collectionId:e.collection,definition:e.definition,occurrence:t,payload:e.payload,verifyDelivery:e.verifyDelivery});await e.definition.events?.[`occurrence.dispatched`]?.({collection:e.collection,executionId:e.occurrence.executionId,name:t.name,occurrence:t,scheduledAt:e.occurrence.scheduledAt,scheduleId:e.occurrence.scheduleId,sessionIds:n.sessions.map(e=>e.id),schedule:e.payload.envelope,type:`occurrence.dispatched`})}export{dispatchScheduledOccurrence};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CompiledAgentManifest } from "#compiler/manifest.js";
|
|
2
|
+
import type { DynamicSchedulesDefinition } from "#public/schedules/subscription.js";
|
|
3
|
+
import type { CompiledRuntimeAgentBundle } from "#runtime/sessions/compiled-agent-cache.js";
|
|
4
|
+
/** The agent does not deploy the named collection, or not with the expected provider. */
|
|
5
|
+
export declare class ScheduleCollectionNotDeployedError extends Error {
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Reloads a collection's authored definition inside a durable step or queue
|
|
9
|
+
* callback, where the closure that created the occurrence no longer exists.
|
|
10
|
+
*/
|
|
11
|
+
export declare function loadScheduleCollectionDefinition(bundle: Pick<CompiledRuntimeAgentBundle, "compiledArtifactsSource" | "moduleMap" | "nodeId">, collection: string, options?: {
|
|
12
|
+
readonly manifest?: CompiledAgentManifest;
|
|
13
|
+
readonly providerKind?: string;
|
|
14
|
+
}): Promise<DynamicSchedulesDefinition<unknown>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{loadCompiledManifest}from"#runtime/loaders/manifest.js";import{normalizeScheduleCollectionDefinition}from"#internal/authored-definition/schedule-collection.js";import{loadResolvedModuleExport}from"#runtime/resolve-helpers.js";var ScheduleCollectionNotDeployedError=class extends Error{};async function loadScheduleCollectionDefinition(e,t,n={}){let r=(n.manifest??await loadCompiledManifest({compiledArtifactsSource:e.compiledArtifactsSource})).scheduleCollections.find(e=>e.name===t&&(n.providerKind===void 0||e.providerKind===n.providerKind));if(r===void 0)throw new ScheduleCollectionNotDeployedError(`Schedule collection "${t}" is not deployed by this agent.`);let i=await loadResolvedModuleExport({definition:r,kindLabel:`schedule collection`,moduleMap:e.moduleMap,nodeId:e.nodeId});return normalizeScheduleCollectionDefinition(i,`Invalid schedule collection ${t}.`)}export{ScheduleCollectionNotDeployedError,loadScheduleCollectionDefinition};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ScheduleEnvelope } from "#public/schedules/subscription.js";
|
|
2
|
+
export interface ScheduleCollectionPayload<TPayload = unknown> {
|
|
3
|
+
readonly eve: {
|
|
4
|
+
readonly application: string;
|
|
5
|
+
readonly collection: string;
|
|
6
|
+
readonly version: 3;
|
|
7
|
+
};
|
|
8
|
+
readonly envelope: ScheduleEnvelope<TPayload>;
|
|
9
|
+
}
|
|
10
|
+
export declare function createScheduleCollectionPayload<TPayload>(input: {
|
|
11
|
+
readonly application: string;
|
|
12
|
+
readonly collection: string;
|
|
13
|
+
readonly envelope: ScheduleEnvelope<TPayload>;
|
|
14
|
+
}): ScheduleCollectionPayload<TPayload>;
|
|
15
|
+
export declare function parseSchedulePayload<TPayload = unknown>(value: unknown, expected?: {
|
|
16
|
+
readonly application: string;
|
|
17
|
+
readonly collection: string;
|
|
18
|
+
}): ScheduleCollectionPayload<TPayload>;
|
|
19
|
+
/** Shared validation for client writes and delivered occurrences. */
|
|
20
|
+
export declare function validateSchedulePayload<T>(schema: {
|
|
21
|
+
readonly "~standard": {
|
|
22
|
+
validate(value: unknown): unknown;
|
|
23
|
+
};
|
|
24
|
+
}, value: unknown): Promise<T>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{z}from"#compiled/zod/index.js";const referenceSchema=z.string().min(1).max(2048),principalReferenceSchema=z.object({type:referenceSchema,authenticator:referenceSchema,issuer:referenceSchema.optional(),principalId:referenceSchema,subject:referenceSchema.optional()}).strict(),payloadSchema=z.object({eve:z.object({application:referenceSchema,collection:referenceSchema,version:z.literal(3)}).strict(),envelope:z.object({version:z.literal(3),payload:z.json(),scope:z.union([z.string().min(1),z.array(z.string().min(1)).min(1)]),principal:principalReferenceSchema}).strict()}).strict();function createScheduleCollectionPayload(e){return parseSchedulePayload({eve:{application:e.application,collection:e.collection,version:3},envelope:e.envelope})}function parseSchedulePayload(e,t){let n;try{let t=JSON.stringify(e);if(t===void 0||Buffer.byteLength(t)>65536)throw Error();n=JSON.parse(t)}catch{throw Error(`Invalid scheduled collection payload; recreate the schedule.`)}let r=payloadSchema.safeParse(n);if(!r.success)throw Error(`Invalid scheduled collection payload; recreate the schedule.`);if(t!==void 0&&(r.data.eve.application!==t.application||r.data.eve.collection!==t.collection))throw Error(`Schedule identity changed; recreate the schedule.`);return r.data}async function validateSchedulePayload(e,t){let n=await e[`~standard`].validate(t);if(n.issues!==void 0||!(`value`in n))throw Error(`Invalid schedule payload: ${n.issues?.map(e=>e.message).join(`; `)??`schema validation failed`}.`);return n.value}export{createScheduleCollectionPayload,parseSchedulePayload,validateSchedulePayload};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { ScheduleDelivery, ScheduleDeliveryTarget, ScheduleProviderContext, } from "#public/schedules/provider-types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createHash}from"node:crypto";function deriveEveScheduleQueueTopic(e){let t=e.trim();if(t.length===0)throw Error(`Schedule application must not be empty.`);return`__eve_schedule_${createHash(`sha256`).update(t).digest(`hex`).slice(0,32)}`}export{deriveEveScheduleQueueTopic};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ScheduleRecord } from "#public/schedules/subscription.js";
|
|
2
|
+
/** Provider names retain the readable label so get/list need no payload read-back. */
|
|
3
|
+
export declare function scheduleDisplayName(name: string): string;
|
|
4
|
+
export declare function projectScheduleRecord(record: ScheduleRecord): ScheduleRecord;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function scheduleDisplayName(e){return e.replace(/--[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/u,``)}function projectScheduleRecord(e){return{...e,displayName:scheduleDisplayName(e.name)}}export{projectScheduleRecord,scheduleDisplayName};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ScheduleExpression, ScheduleTiming } from "#public/schedules/subscription.js";
|
|
2
|
+
export declare function validateScheduleName(name: string): string;
|
|
3
|
+
export declare const MAX_SCHEDULE_DELAY_MINUTES = 525600;
|
|
4
|
+
export declare function resolveScheduleTiming(timing: ScheduleTiming, now?: number): ScheduleExpression;
|
|
5
|
+
export declare function validateScheduleExpression(expression: ScheduleExpression): ScheduleExpression;
|
|
6
|
+
export declare function validateScheduleListLimit(limit: number | undefined): number | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const SCHEDULE_IDENTIFIER=/^[0-9A-Za-z][0-9A-Za-z._-]{0,255}$/u,LOCAL_DATE_TIME=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(?::00)?$/u;function validateScheduleName(e){let t=e.trim();if(!SCHEDULE_IDENTIFIER.test(t))throw Error(`Schedule name must be 1–256 characters, start with an ASCII letter or digit, and contain only letters, digits, '.', '_', and '-'.`);return t}const MAX_SCHEDULE_DELAY_MINUTES=525600;function resolveScheduleTiming(e,t=Date.now()){if(e.type!==`delay`)return validateScheduleExpression(e);if(!Number.isSafeInteger(e.minutes)||e.minutes<1||e.minutes>525600)throw Error(`Schedule delay must be a whole number from 1 through ${MAX_SCHEDULE_DELAY_MINUTES} minutes.`);if(Object.keys(e).some(e=>e!==`type`&&e!==`minutes`))throw Error(`Relative schedule delays accept only type and minutes; no timezone is needed.`);return{type:`single`,at:new Date(Math.ceil((t+e.minutes*6e4)/6e4)*6e4).toISOString().slice(0,16),timezone:`UTC`}}function validateScheduleExpression(e){if(e.type===`cron`){let t=e.cron.trim().replace(/\s+/gu,` `);if(t.split(` `).length!==5)throw Error(`Schedule cron expressions must contain exactly five fields.`);let n={type:`cron`,cron:t};if(e.timezone!==void 0&&(n.timezone=validateTimezone(e.timezone)),e.jitter!==void 0){if(!Number.isSafeInteger(e.jitter)||e.jitter<1||e.jitter>15)throw Error(`Schedule jitter must be an integer from 1 through 15 minutes.`);n.jitter=e.jitter}return n}if(!LOCAL_DATE_TIME.test(e.at))throw Error(`One-time schedules require a minute-precision local datetime in "YYYY-MM-DDTHH:mm" or "YYYY-MM-DDTHH:mm:00" format without an offset or fractional seconds.`);let t={type:`single`,at:e.at};return e.timezone!==void 0&&(t.timezone=validateTimezone(e.timezone)),t}function validateScheduleListLimit(e){if(e!==void 0){if(!Number.isSafeInteger(e)||e<1||e>100)throw Error(`Schedule list limit must be an integer from 1 through 100.`);return e}}function validateTimezone(e){let t=e.trim();if(t.length===0||t.length>50)throw Error(`Schedule timezone must be a valid IANA timezone.`);try{new Intl.DateTimeFormat(`en-US`,{timeZone:t}).format(0)}catch{throw Error(`Invalid IANA timezone: ${t}`)}return t}export{MAX_SCHEDULE_DELAY_MINUTES,resolveScheduleTiming,validateScheduleExpression,validateScheduleListLimit,validateScheduleName};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getAdapterKind}from"#channel/adapter.js";import{ContextKey}from"#context/key.js";import{CHANNEL_CONTEXT_KEY_NAME}from"#context/key-names.js";import{resolveDurableCompiledArtifactsSource,serializeDurableCompiledArtifactsSource}from"#runtime/durable-compiled-artifacts-source.js";import{getCompiledRuntimeAgentBundle}from"#runtime/sessions/compiled-agent-cache.js";import{deserializeRuntimeAdapter}from"#runtime/channels/registry.js";const ChannelKey=new ContextKey(CHANNEL_CONTEXT_KEY_NAME,{codec:{serialize(e){return{kind:getAdapterKind(e),state:e.state?{...e.state}:{}}},deserialize(e,t){let n=t.get(BundleKey);if(n===void 0)throw Error(`Cannot deserialize "eve.channel" before "eve.bundle". The runtime bundle must be present in context.`);return deserializeRuntimeAdapter(n.adapterRegistry,e)}}}),BundleKey=new ContextKey(
|
|
1
|
+
import{getAdapterKind}from"#channel/adapter.js";import{ContextKey}from"#context/key.js";import{BUNDLE_CONTEXT_KEY_NAME,CHANNEL_CONTEXT_KEY_NAME}from"#context/key-names.js";import{resolveDurableCompiledArtifactsSource,serializeDurableCompiledArtifactsSource}from"#runtime/durable-compiled-artifacts-source.js";import{getCompiledRuntimeAgentBundle}from"#runtime/sessions/compiled-agent-cache.js";import{deserializeRuntimeAdapter}from"#runtime/channels/registry.js";const ChannelKey=new ContextKey(CHANNEL_CONTEXT_KEY_NAME,{codec:{serialize(e){return{kind:getAdapterKind(e),state:e.state?{...e.state}:{}}},deserialize(e,t){let n=t.get(BundleKey);if(n===void 0)throw Error(`Cannot deserialize "eve.channel" before "eve.bundle". The runtime bundle must be present in context.`);return deserializeRuntimeAdapter(n.adapterRegistry,e)}}}),BundleKey=new ContextKey(BUNDLE_CONTEXT_KEY_NAME,{codec:{serialize:e=>({nodeId:e.nodeId,source:serializeDurableCompiledArtifactsSource(e.compiledArtifactsSource)}),deserialize:e=>{let{source:t,nodeId:n}=e;return getCompiledRuntimeAgentBundle({compiledArtifactsSource:resolveDurableCompiledArtifactsSource(t),nodeId:n})}}});export{BundleKey,ChannelKey};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { SandboxSession } from "#public/definitions/sandbox.js";
|
|
2
2
|
import type { SandboxEnvironmentIdentity } from "#shared/sandbox-environment.js";
|
|
3
3
|
import type { SandboxDeleteOptions, SandboxPreparedArtifact } from "#shared/sandbox-provider.js";
|
|
4
|
+
export type SandboxSessionEndReason = "completed" | "expired" | "failed";
|
|
4
5
|
export interface SandboxSessionState {
|
|
5
6
|
readonly providerName: string;
|
|
6
7
|
readonly state: SandboxPreparedArtifact;
|
|
@@ -2,7 +2,7 @@ import{resolveSelfModificationConfig}from"../../../config.js";import{isLocalSelf
|
|
|
2
2
|
|
|
3
3
|
Only when the requester explicitly names the self-modification subagent, edit whichever of /source/extensions/self-modification.ts or /source/extensions/self-modification/extension.ts exists. If neither exists, create /source/extensions/self-modification/extension.ts with write_file using this content, then make the requested model or reasoning change:
|
|
4
4
|
\`\`\`ts
|
|
5
|
-
${renderLocalSelfModificationExtension()}\`\`\``;var instructions_default=defineDynamic({events:{"session.started":()=>isLocalSelfModificationEnabled(resolveSelfModificationConfig(extension_default.config))?defineInstructions({markdown:renderInstructions([roleInstructions,sourceWorkspaceInstructions,sourceEditingInstructions,toolAuthoringInstructions,registryWorkflowInstructions,documentationInstructions,"## Local environment\n\nThe registry_add tool will complete installation for items that need no setup. In the local dev TUI, a `needs-terminal` result
|
|
5
|
+
${renderLocalSelfModificationExtension()}\`\`\``;var instructions_default=defineDynamic({events:{"session.started":()=>isLocalSelfModificationEnabled(resolveSelfModificationConfig(extension_default.config))?defineInstructions({markdown:renderInstructions([roleInstructions,sourceWorkspaceInstructions,sourceEditingInstructions,toolAuthoringInstructions,registryWorkflowInstructions,documentationInstructions,"## Local environment\n\nThe registry_add tool will complete installation for items that need no setup. In the local dev TUI, a `needs-terminal` result queues the existing setup panel, which opens after your reply and reports the setup outcome itself. Until then nothing is installed: say that setup continues in the panel and never describe the item as added, connected, or set up. In headless development, if a `needs-terminal` result includes `nextCommand`, present that exact value as the only shell command in your response. Never infer, construct, or rewrite a command: installing an item uses `eve add <item>`; `eve registry add` configures registry namespace mappings and does not install items.\n\nLocal eve dev logs are mounted read-only at /logs. Local trace segments are mounted read-only at /traces when available. For latency, failure, token, or behavior analysis, load and follow the `trace_analysis` skill. Trace searches are scoped to the invoking conversation and exclude the current investigation by default.\n\nThe application package.json is not mounted. Do not search outside /source for application files. You cannot run host binaries such as git, node, pnpm, or tsc. Use existing imports and registry_add for supported registry installations.",workingInstructions,selfModificationSubagentGuidance,`## Report results
|
|
6
6
|
|
|
7
7
|
For source-modification tasks, return a concise handoff to the caller. Use at most four short bullets covering changed paths and behavior, and any required setup or unresolved issues.
|
|
8
8
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{classifyCatalogEntry}from"../../../classify-registry-item.js";import{runEveAdd}from"../../../eve-add.js";import{defineLocalOnlyDynamic,resolveLocalOnly}from"../../../local-only.js";import{withSelfModificationWorkspaceLock}from"../../../../workspace-lock.js";import{loadRegistryIndex,resolveRegistryIndexUrl}from"./search_registry.js";import{defineTool}from"eve/tools";import{getLocalDevCapability}from"eve/local-dev";const localInputSchema={type:`object`,additionalProperties:!1,properties:{address:{type:`string`,minLength:1,maxLength:200,description:"Exact address of an item in the configured eve registry, for example `channel/slack` or `extension/browserbase`."}},required:[`address`]},localOutputSchema={type:`object`,additionalProperties:!1,properties:{status:{type:`string`,enum:[`installed`,`needs-terminal`,`failed`]},address:{type:`string`},title:{type:`string`},envVars:{type:`array`,items:{type:`string`},description:`Environment variables the item needs that are not set. The item is installed but will not work until the developer sets them. Never ask for or repeat their values.`},reason:{type:`string`,description:`Why the item was not installed here.`},changed:{type:`array`,items:{type:`string`},description:`Project-relative paths a failed install could not restore.`},nextCommand:{type:`string`,description:"The command that completes a `needs-terminal` item."},message:{type:`string`,description:`One-line summary to relay to the developer.`}},required:[`status`,`address`,`message`]};function unsetEnvVars(e,t=process.env){return(e.envVars??[]).filter(e=>{let n=t[e];return n===void 0||n===``})}function handoffMessage(e){if(e.interactiveClient)return{message:`${e.title}
|
|
1
|
+
import{classifyCatalogEntry}from"../../../classify-registry-item.js";import{runEveAdd}from"../../../eve-add.js";import{defineLocalOnlyDynamic,resolveLocalOnly}from"../../../local-only.js";import{withSelfModificationWorkspaceLock}from"../../../../workspace-lock.js";import{loadRegistryIndex,resolveRegistryIndexUrl}from"./search_registry.js";import{defineTool}from"eve/tools";import{getLocalDevCapability}from"eve/local-dev";const localInputSchema={type:`object`,additionalProperties:!1,properties:{address:{type:`string`,minLength:1,maxLength:200,description:"Exact address of an item in the configured eve registry, for example `channel/slack` or `extension/browserbase`."}},required:[`address`]},localOutputSchema={type:`object`,additionalProperties:!1,properties:{status:{type:`string`,enum:[`installed`,`needs-terminal`,`failed`]},address:{type:`string`},title:{type:`string`},envVars:{type:`array`,items:{type:`string`},description:`Environment variables the item needs that are not set. The item is installed but will not work until the developer sets them. Never ask for or repeat their values.`},reason:{type:`string`,description:`Why the item was not installed here.`},changed:{type:`array`,items:{type:`string`},description:`Project-relative paths a failed install could not restore.`},nextCommand:{type:`string`,description:"The command that completes a `needs-terminal` item."},message:{type:`string`,description:`One-line summary to relay to the developer.`}},required:[`status`,`address`,`message`]};function unsetEnvVars(e,t=process.env){return(e.envVars??[]).filter(e=>{let n=t[e];return n===void 0||n===``})}function handoffMessage(e){if(e.interactiveClient)return{message:`${e.title} has not been installed yet. ${e.reason} Its setup panel opens after this reply, asks for anything setup needs, and reports whether setup succeeded; tell the developer to complete it there, and do not describe ${e.title} as added, connected, or set up. Do not ask the developer to run another command.`};let t=`eve add ${e.address}`;return{message:`${e.title} was not installed. ${e.reason} Run \`${t}\` in a terminal to finish it.`,nextCommand:t}}async function addLocalRegistryItem(e,t={}){let n=(t.getCapability??getLocalDevCapability)();if(n===void 0)throw Error("Registry items can only be installed while `eve dev` is running. Report the item address to the developer instead of installing it.");let r=(await loadRegistryIndex({nowMs:Date.now(),signal:t.signal,url:resolveRegistryIndexUrl()})).find(t=>t.address===e);if(r===void 0)throw Error(`No item in the configured eve registry is published at "${e}". Check the address before trying again.`);let i=classifyCatalogEntry(r);if(i.kind===`self-modification-mount`)throw Error(i.reason);if(i.kind===`needs-terminal`){let t=handoffMessage({address:e,interactiveClient:n.interactiveClient,reason:i.reason,title:r.title});return{address:e,reason:i.reason,status:`needs-terminal`,title:r.title,...t}}let a=await withSelfModificationWorkspaceLock(`local:${n.appRoot}`,async()=>n.withSuspendedSource(()=>runEveAdd({address:e,appRoot:n.appRoot,signal:t.signal,spawn:t.spawn})));if(a.kind===`blocked`){let t=handoffMessage({address:e,interactiveClient:n.interactiveClient,reason:a.message,title:r.title});return{address:e,reason:a.message,status:`needs-terminal`,title:r.title,...t}}if(a.kind===`failed`)return a.changed===void 0?{address:e,status:`failed`,title:r.title,reason:a.message,message:a.message}:{address:e,status:`failed`,title:r.title,reason:a.message,message:a.message,changed:a.changed};let o=unsetEnvVars(r);return{address:e,envVars:[...o],message:o.length===0?`Installed ${r.title}.`:`Installed ${r.title}. It will not work until ${o.join(`, `)} ${o.length===1?`is`:`are`} set.`,status:`installed`,title:r.title}}function localRegistryAddTool(){return defineTool({description:`Install an item from the configured eve registry into this project. Items that need setup are handed to the local setup flow instead. Search first, then call this with the exact item address.`,inputSchema:localInputSchema,outputSchema:localOutputSchema,async execute(e,t){let{address:n}=e;if(typeof n!=`string`||n.length===0)throw Error(`address must be an exact item address from the configured eve registry.`);return await addLocalRegistryItem(n,{signal:t.abortSignal})}})}function resolveRegistryAddTool(e){return resolveLocalOnly(e,localRegistryAddTool())}var registry_add_default=defineLocalOnlyDynamic(localRegistryAddTool());export{addLocalRegistryItem,registry_add_default as default,handoffMessage,resolveRegistryAddTool,unsetEnvVars};
|
|
@@ -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 { detectDeployment } from "#setup/project-resolution.js";
|
|
3
4
|
import type { RegistrySetupCompletion, RegistrySetupFact } from "#setup/registry-setup-protocol.js";
|
|
@@ -12,11 +13,16 @@ export type RegistrySessionOutcome = {
|
|
|
12
13
|
facts: readonly RegistrySetupFact[];
|
|
13
14
|
output: readonly string[];
|
|
14
15
|
}
|
|
15
|
-
/** Files were added, but the item's setup was cancelled or
|
|
16
|
+
/** Files were added, but the item's setup was cancelled, skipped, or failed. */
|
|
16
17
|
| {
|
|
17
18
|
kind: "incomplete";
|
|
18
19
|
title: string;
|
|
20
|
+
/** Registry address, used to resume setup without reinstalling. */
|
|
21
|
+
address: string;
|
|
19
22
|
resumeCommand: string;
|
|
23
|
+
/** Why setup failed; absent when it was cancelled or skipped. */
|
|
24
|
+
reason?: string;
|
|
25
|
+
prerequisite?: SetupPrerequisite;
|
|
20
26
|
}
|
|
21
27
|
/** User-facing installation error, including any actionable follow-up lines. */
|
|
22
28
|
| {
|
|
@@ -38,7 +44,9 @@ export interface RegistrySessionResult {
|
|
|
38
44
|
}
|
|
39
45
|
interface RegistrySession {
|
|
40
46
|
add(title: string, output: readonly string[], setup?: RegistrySetupCompletion): void;
|
|
41
|
-
addIncomplete(title: string,
|
|
47
|
+
addIncomplete(title: string, incomplete: Omit<Extract<RegistrySessionOutcome, {
|
|
48
|
+
kind: "incomplete";
|
|
49
|
+
}>, "kind" | "title">): void;
|
|
42
50
|
addFailure(title: string, message: string): void;
|
|
43
51
|
addCancellation(title: string): void;
|
|
44
52
|
result(deployed?: "production"): RegistrySessionResult;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./deploy.js";import"#setup/project-resolution.js";function createRegistrySession(e){let t=[],n=!1;function result(e){let n={outcomes:[...t]};return e!==void 0&&(n.deployed=e),n}return{add(e,r,i={facts:[]}){t.push({kind:`installed`,title:e,facts:i.facts,output:r}),n||=i.deploymentRequired===!0},addIncomplete(e,n){t.push({kind:`incomplete`,title:e
|
|
1
|
+
import"./deploy.js";import"#setup/project-resolution.js";function createRegistrySession(e){let t=[],n=!1;function result(e){let n={outcomes:[...t]};return e!==void 0&&(n.deployed=e),n}return{add(e,r,i={facts:[]}){t.push({kind:`installed`,title:e,facts:i.facts,output:r}),n||=i.deploymentRequired===!0},addIncomplete(e,n){t.push({kind:`incomplete`,title:e,...n})},addFailure(e,n){t.push({kind:`failed`,title:e,message:n})},addCancellation(e){t.push({kind:`cancelled`,title:e})},result,async continueAfterInstall(t){if(!n)return result();let r=await e.detectDeployment(t.appRoot,{signal:t.signal}),i=r.state===`linked`||r.state===`deployed`;for(t.prompter.replaceContent?.();;){if(await t.prompter.select({message:`What would you like to do next?`,initialValue:`finish`,hintLayout:`inline`,options:[...i?[{value:`deploy`,label:`Deploy`}]:[],{value:`finish`,label:`Start chatting`}]})===`finish`)return result();if(await t.prompter.select({message:`Deploy to prod?`,initialValue:`yes`,options:[{value:`yes`,label:`Yes`},{value:`back`,label:`Back`}]})!==`back`)return result((await e.runDeployFlow({appRoot:t.appRoot,prompter:t.prompter,signal:t.signal,interactive:!0})).kind===`deployed`?`production`:void 0)}}}}export{createRegistrySession};
|
|
@@ -22,6 +22,8 @@ export declare function runRegistryFlow(input: {
|
|
|
22
22
|
signal?: AbortSignal;
|
|
23
23
|
/** Registry item supplied by `/add <item>`, installed directly. */
|
|
24
24
|
initialAddress?: string;
|
|
25
|
+
/** Rerun the item's setup only; its source is already installed. */
|
|
26
|
+
skipInstall?: boolean;
|
|
25
27
|
onScreen?: (input: {
|
|
26
28
|
screen: "registry_install";
|
|
27
29
|
registrySelectedCount?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRegistrySession}from"./registry-session.js";import{WizardCancelledError}from"#setup/step.js";import{HumanActionRequiredError}from"#setup/human-action.js";import{withSpinner}from"#setup/with-spinner.js";function label(e){return e.name}var RegistryFlowFailedError=class extends Error{completed;constructor(e,t){super(e instanceof Error?e.message:String(e),{cause:e}),this.name=`RegistryFlowFailedError`,this.completed=t}};function hasSettledOutcomes(e){return e!==void 0&&e.outcomes.length>0}async function runRegistryFlow(e){let t;try{let n=e.initialAddress?.trim(),r;if(n!==void 0&&n!==``)r=[{address:n,name:n,source:`Registry`}];else{let t=e.deps?.browseRegistryCatalog??(await import(`#cli/commands/registry.js`)).browseRegistryCatalog,n=await withSpinner(e.prompter,`Loading registry…`,()=>t(e.appRoot)),i=[...n.items],a=await e.prompter.select({message:`Add to your agent`,search:!0,options:i.map(e=>({value:e.address,label:e.name,hint:e.address,keywords:[e.title??``,e.description??``]})),notices:n.errors.map(e=>({tone:`warning`,text:`${e.registry}: ${e.message}`}))}),o=i.find(e=>e.address===a);if(o===void 0)throw Error(`That registry item is no longer available. Run /add to try again.`);r=[o]}let i=e.deps?.installRegistryItem??(await import(`#cli/commands/registry.js`)).installRegistryItem,a=e.installRoot??e.appRoot,o=e.deps?.detectDeployment??(await import(`#setup/project-resolution.js`)).detectDeployment,s=e.deps?.runDeployFlow??(await import(`./deploy.js`)).runDeployFlow;t=createRegistrySession({detectDeployment:o,runDeployFlow:s}),e.onScreen?.({screen:`registry_install`});let c=t;for(let[t,n]of r.entries()){e.signal?.throwIfAborted(),e.onItemStart?.(n,t,r.length);try{let install=(t=e.signal)=>i(a,n.address,{silent:!0,prompter:e.prompter,signal:t}),run=()=>e.runItem===void 0?install():e.runItem(install),t=await(e.prompter.withExclusiveTerminal?.(run)??run());t.setupIncomplete===void 0?c.add(label(n),t.output,t.setup):c.addIncomplete(label(n),t.setupIncomplete
|
|
1
|
+
import{createRegistrySession}from"./registry-session.js";import{WizardCancelledError}from"#setup/step.js";import{HumanActionRequiredError}from"#setup/human-action.js";import{withSpinner}from"#setup/with-spinner.js";function label(e){return e.name}var RegistryFlowFailedError=class extends Error{completed;constructor(e,t){super(e instanceof Error?e.message:String(e),{cause:e}),this.name=`RegistryFlowFailedError`,this.completed=t}};function hasSettledOutcomes(e){return e!==void 0&&e.outcomes.length>0}async function runRegistryFlow(e){let t;try{let n=e.initialAddress?.trim(),r;if(n!==void 0&&n!==``)r=[{address:n,name:n,source:`Registry`}];else{let t=e.deps?.browseRegistryCatalog??(await import(`#cli/commands/registry.js`)).browseRegistryCatalog,n=await withSpinner(e.prompter,`Loading registry…`,()=>t(e.appRoot)),i=[...n.items],a=await e.prompter.select({message:`Add to your agent`,search:!0,options:i.map(e=>({value:e.address,label:e.name,hint:e.address,keywords:[e.title??``,e.description??``]})),notices:n.errors.map(e=>({tone:`warning`,text:`${e.registry}: ${e.message}`}))}),o=i.find(e=>e.address===a);if(o===void 0)throw Error(`That registry item is no longer available. Run /add to try again.`);r=[o]}let i=e.deps?.installRegistryItem??(await import(`#cli/commands/registry.js`)).installRegistryItem,a=e.installRoot??e.appRoot,o=e.deps?.detectDeployment??(await import(`#setup/project-resolution.js`)).detectDeployment,s=e.deps?.runDeployFlow??(await import(`./deploy.js`)).runDeployFlow;t=createRegistrySession({detectDeployment:o,runDeployFlow:s}),e.onScreen?.({screen:`registry_install`});let c=t;for(let[t,n]of r.entries()){e.signal?.throwIfAborted(),e.onItemStart?.(n,t,r.length);try{let install=(t=e.signal)=>i(a,n.address,{silent:!0,...e.skipInstall===!0&&{skipInstall:!0},prompter:e.prompter,signal:t}),run=()=>e.runItem===void 0?install():e.runItem(install),t=await(e.prompter.withExclusiveTerminal?.(run)??run());t.setupIncomplete===void 0?c.add(label(n),t.output,t.setup):c.addIncomplete(label(n),{address:n.address,...t.setupIncomplete})}catch(t){if(e.signal?.throwIfAborted(),t instanceof WizardCancelledError){c.addCancellation(label(n));continue}if(t instanceof HumanActionRequiredError)throw t;let r=(t instanceof Error?t.message:String(t)).trim()||`Installation failed.`;c.addFailure(label(n),r)}}return{kind:`done`,result:await c.continueAfterInstall({appRoot:e.appRoot,prompter:e.prompter,signal:e.signal})}}catch(e){if(e instanceof WizardCancelledError){let e=t?.result();return hasSettledOutcomes(e)?{kind:`done`,result:{...e,cancelled:!0}}:{kind:`cancelled`}}let n=t?.result();throw hasSettledOutcomes(n)?new RegistryFlowFailedError(e,n):e}}export{RegistryFlowFailedError,runRegistryFlow};
|
|
@@ -15,3 +15,11 @@ export declare class SetupPrerequisiteRequired extends Error {
|
|
|
15
15
|
readonly prerequisite: SetupPrerequisite;
|
|
16
16
|
constructor(prerequisite: SetupPrerequisite);
|
|
17
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* The structured prerequisite behind a setup error, if any. Shared Vercel
|
|
20
|
+
* provisioning steps throw {@link HumanActionRequiredError} (for example
|
|
21
|
+
* `vercel login`); setup callers report it as a command prerequisite so the
|
|
22
|
+
* action survives process and protocol boundaries instead of being flattened
|
|
23
|
+
* into an unactionable message.
|
|
24
|
+
*/
|
|
25
|
+
export declare function setupPrerequisiteOf(error: unknown): SetupPrerequisite | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var SetupPrerequisiteRequired=class extends Error{prerequisite;constructor(e){super(e.message),this.name=`SetupPrerequisiteRequired`,this.prerequisite=e}};export{SetupPrerequisiteRequired};
|
|
1
|
+
import{HumanActionRequiredError}from"../../human-action.js";var SetupPrerequisiteRequired=class extends Error{prerequisite;constructor(e){super(e.message),this.name=`SetupPrerequisiteRequired`,this.prerequisite=e}};function setupPrerequisiteOf(e){if(e instanceof SetupPrerequisiteRequired)return e.prerequisite;if(e instanceof HumanActionRequiredError)return{kind:`command`,code:e.action.kind,message:e.action.reason,command:e.action.command}}export{SetupPrerequisiteRequired,setupPrerequisiteOf};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{InteractionRequired,InvalidAnswerError}from"./ask-signals.js";import{
|
|
1
|
+
import{InteractionRequired,InvalidAnswerError}from"./ask-signals.js";import{setupPrerequisiteOf}from"./integrations/shared/prerequisite.js";import"./ask.js";import{WizardCancelledError}from"./step.js";import{setupQuestionToWire}from"./setup-question-wire.js";import"./registry-setup-protocol.js";function send(e,t){if(e.send===void 0||!e.connected)throw Error(`The registry setup host disconnected.`);e.send(t)}function registrySetupBlocker(e){if(e instanceof InteractionRequired)return{status:`input_required`,question:setupQuestionToWire(e.question)};if(e instanceof InvalidAnswerError)return{status:`input_required`,question:setupQuestionToWire(e.question),issue:{code:`invalid_answer`,message:e.message}};let t=setupPrerequisiteOf(e);return t===void 0?void 0:{status:`prerequisite_required`,prerequisite:t}}function registrySetupError(e){if(!(e instanceof Error))return{message:String(e)};let t=e.stack?.split(`
|
|
2
2
|
`).slice(1).map(e=>e.trim()).filter(Boolean);return t===void 0||t.length===0?{message:e.message}:{message:e.message,details:t}}function createRegistrySetupClient(e={}){let t=e.process??process;if(t.send===void 0||process.env.EVE_SETUP_PROTOCOL===void 0)return;let n=new AbortController;e.signal!==void 0&&e.signal.addEventListener(`abort`,()=>n.abort(e.signal?.reason),{once:!0});let r=1,i=new Map,onMessage=e=>{if(e.type===`cancel`){n.abort(new WizardCancelledError);for(let e of i.values())e({type:`cancel`});i.clear();return}i.get(e.id)?.(e)};t.on(`message`,onMessage),send(t,{type:`ready`,version:2});async function prompt(e){n.signal.throwIfAborted();let a=r++,o=await new Promise(n=>{i.set(a,n),send(t,{type:`prompt`,id:a,prompt:e})});if(i.delete(a),o.type===`cancel`||o.cancelled===!0)throw new WizardCancelledError;return o.value}async function validatedText(e,t){let n=t.notices;for(;;){let r=await prompt({kind:e,message:t.message,placeholder:t.placeholder,defaultValue:t.defaultValue,notices:n}),i=t.validate?.(r);if(i===void 0)return r;n=[{tone:`error`,text:i}]}}function select(e){return prompt({kind:`select`,options:e})}let a={text:e=>validatedText(`text`,e),password:e=>validatedText(`password`,e),select,async selectEditable(e){let t=await prompt({kind:`editable-select`,options:{...e,editable:{value:e.editable.value,defaultValue:e.editable.defaultValue}}});if(t.kind===`selected`)return{kind:`selected`,value:t.value};let n=e.editable.validate?.(t.text);if(n!==void 0)throw Error(n);return{kind:`edited`,value:t.value,text:t.text}},acknowledge:e=>prompt({kind:`acknowledge`,options:e}),awaitChoice(e){let n=r++;return{choice:new Promise((r,a)=>{i.set(n,e=>{i.delete(n),e.type===`cancel`||e.cancelled===!0?a(new WizardCancelledError):r(e.value)}),send(t,{type:`prompt`,id:n,prompt:{kind:`choice`,options:e}})}),close:()=>{i.delete(n),send(t,{type:`close-prompt`,id:n})}}},note(e,n,r){send(t,{type:`note`,message:e,title:n,tone:r?.tone})},intro(e,n){send(t,{type:`intro`,text:e,subtitle:n})},outro(e){send(t,{type:`outro`,text:e})},log:{message:e=>send(t,{type:`log`,level:`message`,text:e}),info:e=>send(t,{type:`log`,level:`info`,text:e}),success:e=>send(t,{type:`log`,level:`success`,text:e}),warning:e=>send(t,{type:`log`,level:`warning`,text:e}),error:e=>send(t,{type:`log`,level:`error`,text:e}),commandOutput:e=>send(t,{type:`log`,level:`commandOutput`,text:e}),spinner(e){let n=r++;return send(t,{type:`status`,id:n,status:e}),{stop:()=>send(t,{type:`status`,id:n})}}}},o=!1,finish=e=>{o||(o=!0,send(t,{type:`result`,outcome:e}),t.off(`message`,onMessage),t.disconnect?.())};return{prompter:a,signal:n.signal,complete:(e={facts:[]})=>finish({kind:`completed`,...e}),cancel:()=>finish({kind:`cancelled`}),fail(e){let t=registrySetupBlocker(e);finish(t===void 0?{kind:`failed`,error:registrySetupError(e)}:{kind:`blocked`,blocker:t})}}}export{createRegistrySetupClient};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{pinnedNodeEngineMajor}from"../../node-engine.js";import{parseChatGptModelSelection}from"../../../shared/chatgpt-model.js";import{SUPPORTED_AUTHORED_MODULE_FILE_EXTENSIONS}from"../update/module-files.js";import{pathExists,writeTextFile}from"../files.js";import{blockingCreateInPlaceEntries}from"../create-in-place.js";import{DEFAULT_CONNECT_PACKAGE_VERSION,resolveVersionToken}from"../version-tokens.js";import{applyPackageManagerWorkspaceConfiguration,isPackageManagerWorkspaceMember,patchWorkspaceRootPackageJson}from"../workspace-root.js";import{WEB_CHANNEL_TEMPLATES}from"./web-template.js";import{AGENT_INSTRUCTIONS_TEMPLATE}from"./instructions-template.js";import{SCAFFOLDED_AGENT_PATHS}from"./agent-paths.js";import{mkdir,readdir,stat}from"node:fs/promises";import{basename,join,resolve}from"node:path";const CURRENT_DIRECTORY_PROJECT_NAME=`.`,DEFAULT_AI_PACKAGE_VERSION=`^7.0.128`,DEFAULT_ZOD_PACKAGE_VERSION=`4.5.4`,DEFAULT_EVE_PACKAGE_CONTRACT={version:`0.
|
|
1
|
+
import{pinnedNodeEngineMajor}from"../../node-engine.js";import{parseChatGptModelSelection}from"../../../shared/chatgpt-model.js";import{SUPPORTED_AUTHORED_MODULE_FILE_EXTENSIONS}from"../update/module-files.js";import{pathExists,writeTextFile}from"../files.js";import{blockingCreateInPlaceEntries}from"../create-in-place.js";import{DEFAULT_CONNECT_PACKAGE_VERSION,resolveVersionToken}from"../version-tokens.js";import{applyPackageManagerWorkspaceConfiguration,isPackageManagerWorkspaceMember,patchWorkspaceRootPackageJson}from"../workspace-root.js";import{WEB_CHANNEL_TEMPLATES}from"./web-template.js";import{AGENT_INSTRUCTIONS_TEMPLATE}from"./instructions-template.js";import{SCAFFOLDED_AGENT_PATHS}from"./agent-paths.js";import{mkdir,readdir,stat}from"node:fs/promises";import{basename,join,resolve}from"node:path";const CURRENT_DIRECTORY_PROJECT_NAME=`.`,DEFAULT_AI_PACKAGE_VERSION=`^7.0.128`,DEFAULT_ZOD_PACKAGE_VERSION=`4.5.4`,DEFAULT_EVE_PACKAGE_CONTRACT={version:`0.75.0`,nodeEngine:`>=24`};function resolveEvePackageContract(e=DEFAULT_EVE_PACKAGE_CONTRACT){return{version:resolveVersionToken(`evePackage.version`,e.version),nodeEngine:resolveVersionToken(`evePackage.nodeEngine`,e.nodeEngine)}}function modelProviderSlug(e){let t=(e.split(`/`)[0]??``).replaceAll(/[^A-Za-z0-9._-]/gu,``);return t.length>0?t:`anthropic`}function byokProviderEnvVar(e){let t=modelProviderSlug(e).toUpperCase().replaceAll(/[^A-Z0-9]/gu,`_`);return`${/^[0-9]/.test(t)?`_`:``}${t}_API_KEY`}function agentTemplateFiles(e,t){return{[SCAFFOLDED_AGENT_PATHS.config]:renderAgentTemplate(e,t),[SCAFFOLDED_AGENT_PATHS.channel]:WEB_CHANNEL_TEMPLATES.default,[SCAFFOLDED_AGENT_PATHS.instructions]:AGENT_INSTRUCTIONS_TEMPLATE}}function renderAgentTemplate(e,t){let n=parseChatGptModelSelection(e);return n===void 0?BASE_AGENT_TEMPLATE.replaceAll(`__EVE_INIT_MODEL__`,e).replaceAll(`__EVE_INIT_REASONING__`,reasoningTemplateLine(t)):`import { defineAgent } from "eve";\nimport { chatgpt } from "eve/models/openai";\n\nexport default defineAgent({\n model: chatgpt(${JSON.stringify(n)}),\n${reasoningTemplateLine(t)}});\n`}function reasoningTemplateLine(e){return e===void 0||e===`provider-default`?``:` reasoning: "${e}",\n`}function renderTemplate(e,t){return e===BASE_AGENT_TEMPLATE&&parseChatGptModelSelection(t.model)!==void 0?renderAgentTemplate(t.model,t.reasoning):e.replaceAll(`__EVE_INIT_APP_NAME__`,t.appName).replaceAll(`__EVE_INIT_MODEL__`,t.model).replaceAll(`__EVE_INIT_REASONING__`,reasoningTemplateLine(t.reasoning)).replaceAll(`__EVE_INIT_BYOK_PROVIDER__`,modelProviderSlug(t.model)).replaceAll(`__EVE_INIT_BYOK_ENV_VAR__`,byokProviderEnvVar(t.model)).replaceAll(`__EVE_INIT_PACKAGE_VERSION__`,formatEveDependencySpecifier(t.eveVersion)).replaceAll(`__EVE_INIT_AI_SDK_VERSION__`,t.aiPackageVersion).replaceAll(`__EVE_INIT_CONNECT_VERSION__`,t.connectPackageVersion).replaceAll(`__EVE_INIT_ZOD_VERSION__`,t.zodPackageVersion).replaceAll(`__EVE_INIT_TYPESCRIPT_VERSION__`,t.typescriptPackageVersion).replaceAll(`__EVE_INIT_TYPES_NODE_VERSION__`,t.nodeTypesVersion).replaceAll(`__EVE_INIT_NODE_ENGINE__`,t.nodeEngine)}function formatEveDependencySpecifier(e){return/^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z-.]+)?$/.test(e)?`^${e}`:e}const BASE_AGENT_TEMPLATE=`import { defineAgent } from "eve";
|
|
2
2
|
|
|
3
3
|
export default defineAgent({
|
|
4
4
|
model: "__EVE_INIT_MODEL__",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{WriteFileExistsError}from"./files.js";import{CURRENT_DIRECTORY_PROJECT_NAME,byokProviderEnvVar,isEveProject,scaffoldBaseProject}from"./create/project.js";import{scaffoldExtensionProject}from"./create/extension.js";import{DEFAULT_SLACK_CONNECTOR_SLUG,SLACK_CHANNEL_DEFAULT_ROUTE,deriveSlackConnectorSlug,ensureChannel,hasVercelHostFramework,isNextJsProject,listAuthoredChannels,normalizeSlackConnectorSlug,resolveVercelHostFrameworkPreset}from"./update/channels.js";import{SCAFFOLDABLE_CHANNELS}from"./channels-catalog.js";import{CONNECTION_CATALOG,CUSTOM_CONNECTION_SLUG,SUPPORTED_PROTOCOLS,catalogSlugs,effectiveProtocols,endpointForProtocol,getCatalogEntry,isValidConnectionSlug}from"./connections/catalog.js";import{ensureConnection,ensureConnectionDependencies,listAuthoredConnections}from"./update/connections.js";import{ensurePackageDependencies}from"./update/dependencies.js";
|
|
1
|
+
import{HumanActionRequiredError}from"../human-action.js";import{WriteFileExistsError}from"./files.js";import{CURRENT_DIRECTORY_PROJECT_NAME,byokProviderEnvVar,isEveProject,scaffoldBaseProject}from"./create/project.js";import{scaffoldExtensionProject}from"./create/extension.js";import{DEFAULT_SLACK_CONNECTOR_SLUG,SLACK_CHANNEL_DEFAULT_ROUTE,deriveSlackConnectorSlug,ensureChannel,hasVercelHostFramework,isNextJsProject,listAuthoredChannels,normalizeSlackConnectorSlug,resolveVercelHostFrameworkPreset}from"./update/channels.js";import{SCAFFOLDABLE_CHANNELS}from"./channels-catalog.js";import{CONNECTION_CATALOG,CUSTOM_CONNECTION_SLUG,SUPPORTED_PROTOCOLS,catalogSlugs,effectiveProtocols,endpointForProtocol,getCatalogEntry,isValidConnectionSlug}from"./connections/catalog.js";import{ensureConnection,ensureConnectionDependencies,listAuthoredConnections}from"./update/connections.js";import{ensurePackageDependencies}from"./update/dependencies.js";export{CONNECTION_CATALOG,CURRENT_DIRECTORY_PROJECT_NAME,CUSTOM_CONNECTION_SLUG,DEFAULT_SLACK_CONNECTOR_SLUG,HumanActionRequiredError,SCAFFOLDABLE_CHANNELS,SLACK_CHANNEL_DEFAULT_ROUTE,SUPPORTED_PROTOCOLS,WriteFileExistsError,byokProviderEnvVar,catalogSlugs,deriveSlackConnectorSlug,effectiveProtocols,endpointForProtocol,ensureChannel,ensureConnection,ensureConnectionDependencies,ensurePackageDependencies,getCatalogEntry,hasVercelHostFramework,isEveProject,isNextJsProject,isValidConnectionSlug,listAuthoredChannels,listAuthoredConnections,normalizeSlackConnectorSlug,resolveVercelHostFrameworkPreset,scaffoldBaseProject,scaffoldExtensionProject};
|
|
@@ -31,8 +31,7 @@ export declare function assertNewProjectNameAvailable(projectRoot: string, team:
|
|
|
31
31
|
* The Vercel auth state, read-only. `cli-missing` (ENOENT) and `unavailable` (a
|
|
32
32
|
* transient network/API fault) are each kept distinct from `logged-out` so a
|
|
33
33
|
* caller never tells the user to log in when the real cause is a missing CLI or
|
|
34
|
-
* an unreachable network.
|
|
35
|
-
* not-authenticated diagnostic.
|
|
34
|
+
* an unreachable network.
|
|
36
35
|
*/
|
|
37
36
|
export type VercelAuthStatus = "authenticated" | "logged-out" | "cli-missing" | "unavailable";
|
|
38
37
|
export declare function getVercelAuthStatus(projectRoot: string, options?: VercelProjectOperationOptions): Promise<VercelAuthStatus>;
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const DISABLED_PRINCIPAL_TYPES=new Set([`anonymous`,`runtime`]);function principalScope(e){let t=e.current;return t===null||DISABLED_PRINCIPAL_TYPES.has(t.principalType)?null:t.principalType===`local-dev`?`local-dev`:JSON.stringify([t.principalType,t.authenticator,t.issuer??null,t.principalId])}export{principalScope};
|
|
@@ -73,10 +73,17 @@ export interface SandboxProviderSessionContext {
|
|
|
73
73
|
export interface SandboxProviderHandle<Session extends SandboxSession = SandboxSession> {
|
|
74
74
|
readonly sandbox: Session;
|
|
75
75
|
onRuntimeShutdown(): Promise<void>;
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
onSandboxDelete(options?: SandboxDeleteOptions): Promise<void>;
|
|
77
|
+
onSandboxStop(): Promise<void>;
|
|
78
78
|
}
|
|
79
79
|
export interface SandboxProviderImplementation<OpenOptions extends object | undefined, PreparedArtifact extends SandboxPreparedArtifact, SessionState, Session extends SandboxSession = SandboxSession> {
|
|
80
|
+
/**
|
|
81
|
+
* Permanently releases resources owned by a durable session after its terminal outcome.
|
|
82
|
+
* Implementations must be idempotent because the cleanup step may retry.
|
|
83
|
+
*/
|
|
84
|
+
onSessionEnd?(context: SandboxProviderSessionContext, artifact: Readonly<PreparedArtifact>, state: Readonly<SessionState>, options: {
|
|
85
|
+
readonly reason: "completed" | "expired" | "failed";
|
|
86
|
+
}): Promise<void>;
|
|
80
87
|
prepare(context: SandboxProviderPrepareContext): Promise<PreparedArtifact>;
|
|
81
88
|
resume(context: SandboxProviderSessionContext, artifact: Readonly<PreparedArtifact>, state: Readonly<SessionState>): Promise<SandboxProviderHandle<Session>>;
|
|
82
89
|
start(context: SandboxProviderSessionContext, options: Readonly<OpenOptions> | undefined, artifact: Readonly<PreparedArtifact>): Promise<{
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const SCHEDULE_COLLECTION_DEFINITION_BRAND: unique symbol;
|
|
2
|
+
export declare const SCHEDULE_COLLECTION_SOURCE: unique symbol;
|
|
3
|
+
export interface ScheduleCollectionSourceIdentity {
|
|
4
|
+
readonly application: string;
|
|
5
|
+
readonly collection: string;
|
|
6
|
+
readonly logicalPath: string;
|
|
7
|
+
readonly sourceId: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function stampScheduleCollectionSource(value: object, identity: ScheduleCollectionSourceIdentity): void;
|
|
10
|
+
export declare function readScheduleCollectionSource(value: object): ScheduleCollectionSourceIdentity | undefined;
|
|
11
|
+
export declare function isScheduleCollectionDefinition(value: unknown): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const SCHEDULE_COLLECTION_DEFINITION_BRAND=Symbol.for(`eve:schedule-collection-definition`),SCHEDULE_COLLECTION_SOURCE=Symbol.for(`eve:schedule-collection-source`);function stampScheduleCollectionSource(e,t){let n=readScheduleCollectionSource(e);if(n!==void 0){if(n.application!==t.application||n.collection!==t.collection||n.logicalPath!==t.logicalPath||n.sourceId!==t.sourceId)throw Error(`Schedule collection source identity does not match its compiled module.`);return}Object.defineProperty(e,SCHEDULE_COLLECTION_SOURCE,{configurable:!1,enumerable:!1,value:Object.freeze({...t})})}function readScheduleCollectionSource(e){return Reflect.get(e,SCHEDULE_COLLECTION_SOURCE)}function isScheduleCollectionDefinition(e){return typeof e==`object`&&!!e&&Reflect.get(e,SCHEDULE_COLLECTION_DEFINITION_BRAND)===!0}export{SCHEDULE_COLLECTION_DEFINITION_BRAND,SCHEDULE_COLLECTION_SOURCE,isScheduleCollectionDefinition,readScheduleCollectionSource,stampScheduleCollectionSource};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function scheduleCollectionToolPrefix(collection: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function scheduleCollectionToolPrefix(e){return`schedule__${e.replaceAll(`/`,`-`)}`}export{scheduleCollectionToolPrefix};
|
|
@@ -3,7 +3,8 @@ import type { ChannelAdapter } from "#channel/adapter.js";
|
|
|
3
3
|
* Framework adapter that bridges a child subagent session to its
|
|
4
4
|
* parent.
|
|
5
5
|
*
|
|
6
|
-
* It proxies child `input.requested` events upward so the parent channel
|
|
7
|
-
*
|
|
6
|
+
* It proxies child `input.requested` events upward so the parent channel can
|
|
7
|
+
* render HITL prompts and route responses back down to the child, and the
|
|
8
|
+
* `input.resolved` of requests only the child can close.
|
|
8
9
|
*/
|
|
9
10
|
export declare const SUBAGENT_ADAPTER: ChannelAdapter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createErrorId,createLogger}from"#internal/logging.js";import{ContinuationTokenKey,SessionIdKey,SessionInboxKey}from"#context/keys.js";import{SUBAGENT_ADAPTER_KIND,isSubagentAdapterState}from"#subagents/adapter-state.js";const log=createLogger(`execution.subagent-adapter`),SUBAGENT_ADAPTER={kind:SUBAGENT_ADAPTER_KIND,async"approval.candidate"(e,t){await forwardSubagentAuthorizationEvent({data:e,type:`approval.candidate`},t)},async"approval.settled"(e,t){await forwardSubagentAuthorizationEvent({data:e,type:`approval.settled`},t)},async"authorization.required"(e,t){await forwardSubagentAuthorizationEvent({data:e,type:`authorization.required`},t)},async"authorization.completed"(e,t){await forwardSubagentAuthorizationEvent({data:e,type:`authorization.completed`},t)},async"input.requested"(e,t){let n=t.state;isSubagentAdapterState(n)&&await forwardSubagentInputRequestStep({hookPayload:{callId:n.callId,childContinuationToken:t.ctx.require(ContinuationTokenKey),childSessionId:t.ctx.require(SessionIdKey),childSessionInbox:t.ctx.get(SessionInboxKey),inputSource:t.inputSource,event:{requests:e.requests,sequence:e.sequence,stepIndex:e.stepIndex,turnId:e.turnId},kind:`subagent-input-request`,subagentName:n.subagentName},parentContinuationToken:n.parentContinuationToken})}};async function forwardSubagentAuthorizationEvent(e,t){let n=t.state;isSubagentAdapterState(n)&&await forwardSubagentAuthorizationEventStep({hookPayload:{callId:n.callId,childSessionId:t.ctx.require(SessionIdKey),event:e,kind:`subagent-authorization-event`,subagentName:n.subagentName},parentContinuationToken:n.parentContinuationToken})}async function forwardSubagentAuthorizationEventStep(e){"use step";try{await resumeParentHook(e.parentContinuationToken,e.hookPayload)}catch(t){let n=createErrorId();throw log.warn(`failed to forward subagent authorization event to parent`,{callId:e.hookPayload.callId,childSessionId:e.hookPayload.childSessionId,errorId:n,eventType:e.hookPayload.event.type,parentContinuationToken:e.parentContinuationToken,subagentName:e.hookPayload.subagentName,error:t}),t}}async function forwardSubagentInputRequestStep(e){"use step";try{await resumeParentHook(e.parentContinuationToken,e.hookPayload)}catch(t){let n=createErrorId();throw log.warn(`failed to forward proxied HITL batch to parent`,{callId:e.hookPayload.callId,childContinuationToken:e.hookPayload.childContinuationToken,childSessionId:e.hookPayload.childSessionId,errorId:n,parentContinuationToken:e.parentContinuationToken,subagentName:e.hookPayload.subagentName,error:t}),t}}async function resumeParentHook(e,t){let{resumeHook:n}=await import(`#internal/workflow/runtime.js`);await n(e,t)}export{SUBAGENT_ADAPTER};
|
|
1
|
+
import{createErrorId,createLogger}from"#internal/logging.js";import{ContinuationTokenKey,SessionIdKey,SessionInboxKey}from"#context/keys.js";import{resolvedForParent}from"#harness/proxy-input-requests.js";import{SUBAGENT_ADAPTER_KIND,isSubagentAdapterState}from"#subagents/adapter-state.js";const log=createLogger(`execution.subagent-adapter`),SUBAGENT_ADAPTER={kind:SUBAGENT_ADAPTER_KIND,async"approval.candidate"(e,t){await forwardSubagentAuthorizationEvent({data:e,type:`approval.candidate`},t)},async"approval.settled"(e,t){await forwardSubagentAuthorizationEvent({data:e,type:`approval.settled`},t)},async"authorization.required"(e,t){await forwardSubagentAuthorizationEvent({data:e,type:`authorization.required`},t)},async"authorization.completed"(e,t){await forwardSubagentAuthorizationEvent({data:e,type:`authorization.completed`},t)},async"input.resolved"(e,t){let n=resolvedForParent(e);n!==void 0&&await forwardSubagentAuthorizationEvent({data:n,type:`input.resolved`},t)},async"input.requested"(e,t){let n=t.state;isSubagentAdapterState(n)&&await forwardSubagentInputRequestStep({hookPayload:{callId:n.callId,childContinuationToken:t.ctx.require(ContinuationTokenKey),childSessionId:t.ctx.require(SessionIdKey),childSessionInbox:t.ctx.get(SessionInboxKey),inputSource:t.inputSource,event:{requests:e.requests,sequence:e.sequence,stepIndex:e.stepIndex,turnId:e.turnId},kind:`subagent-input-request`,subagentName:n.subagentName},parentContinuationToken:n.parentContinuationToken})}};async function forwardSubagentAuthorizationEvent(e,t){let n=t.state;isSubagentAdapterState(n)&&await forwardSubagentAuthorizationEventStep({hookPayload:{callId:n.callId,childSessionId:t.ctx.require(SessionIdKey),event:e,kind:`subagent-authorization-event`,subagentName:n.subagentName},parentContinuationToken:n.parentContinuationToken})}async function forwardSubagentAuthorizationEventStep(e){"use step";try{await resumeParentHook(e.parentContinuationToken,e.hookPayload)}catch(t){let n=createErrorId();throw log.warn(`failed to forward subagent authorization event to parent`,{callId:e.hookPayload.callId,childSessionId:e.hookPayload.childSessionId,errorId:n,eventType:e.hookPayload.event.type,parentContinuationToken:e.parentContinuationToken,subagentName:e.hookPayload.subagentName,error:t}),t}}async function forwardSubagentInputRequestStep(e){"use step";try{await resumeParentHook(e.parentContinuationToken,e.hookPayload)}catch(t){let n=createErrorId();throw log.warn(`failed to forward proxied HITL batch to parent`,{callId:e.hookPayload.callId,childContinuationToken:e.hookPayload.childContinuationToken,childSessionId:e.hookPayload.childSessionId,errorId:n,parentContinuationToken:e.parentContinuationToken,subagentName:e.hookPayload.subagentName,error:t}),t}}async function resumeParentHook(e,t){let{resumeHook:n}=await import(`#internal/workflow/runtime.js`);await n(e,t)}export{SUBAGENT_ADAPTER};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z}from"#compiled/zod/index.js";import{inputRequestSchema}from"#shared/input.js";import{jsonValueSchema}from"#shared/json-schemas.js";import{
|
|
1
|
+
import{z}from"#compiled/zod/index.js";import{inputRequestSchema,inputResponseSchema}from"#shared/input.js";import{jsonValueSchema}from"#shared/json-schemas.js";import{resumeHook}from"#internal/workflow/runtime.js";import{renameLegacyTaskCallback}from"#execution/legacy-remote-agent/protocol.js";import{agentTurnOutcomeWithCostSchema}from"#shared/agent-turn-outcome.js";const sessionInputCallbackSchema=z.object({callId:z.string().min(1),childContinuationToken:z.string().min(1),childSessionId:z.string().min(1),childSessionInbox:z.object({sessionId:z.string().min(1)}).strict().optional(),inputSource:z.string().min(1).optional(),remote:z.object({name:z.string().min(1),url:z.string().url(),forwardPrincipal:z.boolean().optional(),sessionId:z.string().min(1),resolverId:z.string().min(1).optional()}).strict().optional(),kind:z.literal(`subagent-input-request`),subagentName:z.string().min(1),event:z.object({requests:z.array(inputRequestSchema).min(1),sequence:z.number(),stepIndex:z.number(),taskId:z.string().optional(),turnId:z.string()})}),sessionAuthorizationCallbackSchema=z.object({callId:z.string().min(1),childSessionId:z.string().min(1),kind:z.literal(`subagent-authorization-event`),subagentName:z.string().min(1),event:z.discriminatedUnion(`type`,[z.object({type:z.literal(`approval.candidate`),data:z.object({candidateId:z.string(),outcome:z.enum([`pending`,`rejected`,`failed`,`timed-out`,`stale`]),requestId:z.string(),responderPrincipalId:z.string(),reason:z.string().optional(),sequence:z.number(),stepIndex:z.number(),turnId:z.string()}).passthrough()}),z.object({type:z.literal(`approval.settled`),data:z.object({outcome:z.enum([`approved`,`cancelled`]),requestId:z.string(),responderPrincipalId:z.string(),sequence:z.number(),stepIndex:z.number(),turnId:z.string()}).passthrough()}),z.object({type:z.literal(`input.resolved`),data:z.object({resolutions:z.array(z.object({kind:z.enum([`question`,`session-limit`,`tool-approval`]),outcome:z.enum([`answered`,`approved`,`cancelled`,`denied`,`ignored`,`invalid`]),requestId:z.string(),response:inputResponseSchema.optional()}).passthrough()),sequence:z.number(),stepIndex:z.number(),turnId:z.string()}).passthrough()}),z.object({type:z.literal(`authorization.required`),data:z.object({description:z.string(),name:z.string(),sequence:z.number(),stepIndex:z.number(),turnId:z.string(),webhookUrl:z.string().optional(),attemptId:z.string().optional(),taskId:z.string().optional(),principalId:z.string().optional()}).passthrough()}),z.object({type:z.literal(`authorization.completed`),data:z.object({name:z.string(),outcome:z.enum([`authorized`,`declined`,`failed`,`timed-out`]),sequence:z.number(),stepIndex:z.number(),turnId:z.string(),attemptId:z.string().optional(),taskId:z.string().optional(),principalId:z.string().optional()}).passthrough()})])}),sessionResultCallbackSchema=z.discriminatedUnion(`kind`,[z.object({callId:z.string().min(1),kind:z.literal(`turn.completed`),outcome:agentTurnOutcomeWithCostSchema,output:jsonValueSchema.optional(),subagentName:z.string().min(1)}),z.object({callId:z.string().min(1),error:jsonValueSchema,kind:z.literal(`turn.failed`),outcome:agentTurnOutcomeWithCostSchema,subagentName:z.string().min(1)})]);async function handleSessionCallbackRequest(e,t){let n=t.params.token;if(typeof n!=`string`||n.length===0)return Response.json({error:`Missing callback token.`,ok:!1},{status:400});let r;try{r=renameLegacyTaskCallback(await e.json())}catch{return Response.json({error:`Invalid JSON body.`,ok:!1},{status:400})}let i=callbackKind(r),a=i===`subagent-input-request`?sessionInputCallbackSchema.safeParse(r):i===`subagent-authorization-event`?sessionAuthorizationCallbackSchema.safeParse(r):void 0;if(a!==void 0&&!a.success)return Response.json({error:`Invalid session input callback.`,ok:!1},{status:400});let o=a===void 0?projectSessionCallbackResult(r):void 0;if(o instanceof Response)return o;try{await resumeHook(n,a?.success?a.data:{kind:`runtime-action-result`,results:[o]})}catch{return Response.json({error:`Session callback not pending.`,ok:!1},{status:404})}return Response.json({ok:!0},{status:202})}function callbackKind(e){if(typeof e==`object`&&e)return Reflect.get(e,`kind`)}function projectSessionCallbackResult(e){if(typeof e!=`object`||!e)return Response.json({error:`Expected a JSON object.`,ok:!1},{status:400});let t=callbackKind(e);if(t!==`turn.completed`&&t!==`turn.failed`)return Response.json({error:`Unsupported callback kind.`,ok:!1},{status:400});let n=sessionResultCallbackSchema.safeParse(e);if(!n.success)return Response.json({error:`Invalid session result callback.`,ok:!1},{status:400});let r=n.data;return r.kind===`turn.completed`?{callId:r.callId,kind:`subagent-result`,origin:`child`,outcome:r.outcome,output:r.output??``,subagentName:r.subagentName,usage:r.outcome.usageDelta}:{callId:r.callId,isError:!0,kind:`subagent-result`,origin:`child`,outcome:r.outcome,output:r.error,subagentName:r.subagentName}}export{handleSessionCallbackRequest};
|
|
@@ -45,9 +45,10 @@ export interface RoutedDeliverPayload {
|
|
|
45
45
|
/**
|
|
46
46
|
* Splits a deliver payload into parent-local and proxied-child buckets.
|
|
47
47
|
*
|
|
48
|
-
* With `resolveMessage`, a plain-text message is also resolved against
|
|
49
|
-
*
|
|
50
|
-
*
|
|
48
|
+
* With `resolveMessage`, a plain-text message is also resolved against the
|
|
49
|
+
* first open request when a child asked it, whether a `ctx.ask()` question, a
|
|
50
|
+
* tool approval, or a session-limit prompt: a matching option or permitted free
|
|
51
|
+
* text answers that one request, and the message is consumed along with its
|
|
51
52
|
* `context`. Otherwise the message stays with the parent.
|
|
52
53
|
*/
|
|
53
54
|
export declare function routeDeliverPayload(input: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{inputTextKey,readAnswerText}from"#internal/input-text.js";import{firstOpenInput}from"#harness/open-input-request.js";import{resolveTextToResponse}from"#channel/resolve-text.js";import{storedProjection}from"#harness/session-machine/view.js";import{getProxyInputRequests}from"#harness/proxy-input-requests.js";import{resolveInputOutcome}from"#harness/input-request-resolution.js";import{SESSION_LIMIT_STOP_OPTION_ID}from"#harness/hitl/budget-request.js";const CONSUMED_MESSAGE_KEYS=new Set([`context`,`message`,inputTextKey]);function routeDeliverPayload(e){let t=getProxyInputRequests(e.state),routable=(t,n)=>n!==void 0&&e.allowRoute?.(t,n)!==!1,n=
|
|
1
|
+
import{inputTextKey,readAnswerText}from"#internal/input-text.js";import{firstOpenInput}from"#harness/open-input-request.js";import{resolveTextToResponse}from"#channel/resolve-text.js";import{storedProjection}from"#harness/session-machine/view.js";import{getProxyInputRequests,resolvedByChild}from"#harness/proxy-input-requests.js";import{resolveInputOutcome}from"#harness/input-request-resolution.js";import{SESSION_LIMIT_STOP_OPTION_ID}from"#harness/hitl/budget-request.js";const CONSUMED_MESSAGE_KEYS=new Set([`context`,`message`,inputTextKey]);function routeDeliverPayload(e){let t=getProxyInputRequests(e.state),routable=(t,n)=>n!==void 0&&e.allowRoute?.(t,n)!==!1,n=resolveMessageAgainstFirstRequest({enabled:e.resolveMessage===!0,entries:t,payload:e.payload,routable,state:e.state}),[r]=n.responses,i=[...e.payload.inputResponses??[],...n.responses],a=new Map,o=[],s,bucketFor=e=>{let t=JSON.stringify([e.childContinuationToken,e.childSessionInbox?.sessionId??``,e.remote?.sessionId??``,e.event.sequence,e.event.stepIndex,e.event.turnId,e.inputSource??null]),n=a.get(t);if(n!==void 0)return n;let r={childContinuationToken:e.childContinuationToken,remote:e.remote,event:e.event,parentRequestIds:[],responses:[],routes:[],...e.childSessionInbox!==void 0&&{childSessionInbox:e.childSessionInbox},...e.workflowAsk!==void 0&&{workflowAsk:e.workflowAsk}};return a.set(t,r),r},c=new Set;for(let e of i){let n=t.get(e.requestId);if(n===void 0||!routable(e.requestId,n)){o.push(e);continue}if(c.has(e.requestId))continue;c.add(e.requestId),n.kind===`session-limit`&&e.optionId===SESSION_LIMIT_STOP_OPTION_ID&&(s={kind:`cancel-turn`});let r=bucketFor(n);r.parentRequestIds.push(e.requestId),r.responses.push(e),r.routes.push(n)}let l=[...a.values()].map(({workflowAsk:n,remote:i,childContinuationToken:a,childSessionInbox:o,event:s,parentRequestIds:c,responses:l,routes:u})=>{let d=new Set(c),decided=e=>{let n=t.get(e)?.kind;return n===void 0||!resolvedByChild(n)},f=new Set([...d].filter(decided));for(let e of u)if(e.batch!==void 0&&batchResolves({batch:e.batch,childContinuationToken:a,entries:t,responseIds:d}))for(let t of e.batch.requestIds)decided(t)&&f.add(t);return{childContinuationToken:a,payload:{inputResponses:l},resolved:{event:s,resolutions:resolveRetiredRequests({entries:t,responses:l,retireRequestIds:f})},...o!==void 0&&{childSessionInbox:o},...r!==void 0&&l.includes(r)&&{message:e.payload.message},...n!==void 0&&{workflowAsk:n},...i!==void 0&&{remote:i},...u[0]?.inputSource!==void 0&&{inputSource:u[0].inputSource}}}),u={};for(let[t,r]of Object.entries(e.payload))t!==`inputResponses`&&r!==void 0&&(n.consumed&&CONSUMED_MESSAGE_KEYS.has(t)||(u[t]=r));return o.length>0&&(u.inputResponses=o),{forChildren:l,forSelf:Object.keys(u).length>0?u:void 0,parentAction:s}}function resolveRetiredRequests(e){let t=new Map(e.responses.map(e=>[e.requestId,e])),n=[];for(let r of e.retireRequestIds){let i=e.entries.get(r);i!==void 0&&n.push(toInputResolution(r,i,t.get(r)))}return n}function toInputResolution(e,t,n){let r=resolveInputOutcome(t.kind,n),i={kind:t.kind,outcome:r,requestId:e};return n===void 0?i:{...i,response:n}}function resolveMessageAgainstFirstRequest(e){let t={consumed:!1,responses:[]};if(!e.enabled||(e.payload.inputResponses?.length??0)>0)return t;let n=readAnswerText(e.payload);if(n===void 0)return t;let answered=t=>{let n=e.entries.get(t);return n!==void 0&&!e.routable(t,n)},r=firstOpenInput(storedProjection(e.state),answered)?.request.requestId??[...e.entries.keys()].find(e=>!answered(e)),i=r===void 0?void 0:e.entries.get(r)?.reply;if(r===void 0||i===void 0)return t;let a=resolveTextToResponse(n,{requestId:r,...i});return a===void 0?t:{consumed:!0,responses:[a]}}function batchResolves(e){return e.batch.approvalRequestIds.length===0||e.batch.approvalRequestIds.every(t=>{let n=e.entries.get(t);return n===void 0||!sameBatch(n,e)||e.responseIds.has(t)})}function sameBatch(e,t){return e.childContinuationToken===t.childContinuationToken&&e.batch?.requestIds.length===t.batch.requestIds.length&&e.batch.requestIds.every((e,n)=>e===t.batch.requestIds[n])}export{routeDeliverPayload};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createLogger}from"#internal/logging.js";import{SessionCallbackKey}from"#context/keys.js";import{toErrorMessage}from"#shared/errors.js";import{parseJsonValue}from"#shared/json.js";import{ChannelKey}from"#runtime/sessions/runtime-context-keys.js";import{parseSessionCallback}from"#channel/session-callback.js";import{deserializeContext}from"#context/serialize.js";import{postSessionCallbackRequest}from"#execution/session-callback-request.js";import{HookNotFoundError}from"#compiled/@workflow/errors/index.js";import{
|
|
1
|
+
import{createLogger}from"#internal/logging.js";import{SessionCallbackKey}from"#context/keys.js";import{toErrorMessage}from"#shared/errors.js";import{parseJsonValue}from"#shared/json.js";import{ChannelKey}from"#runtime/sessions/runtime-context-keys.js";import{resumeHook}from"#internal/workflow/runtime.js";import{parseSessionCallback}from"#channel/session-callback.js";import{deserializeContext}from"#context/serialize.js";import{postSessionCallbackRequest}from"#execution/session-callback-request.js";import{HookNotFoundError}from"#compiled/@workflow/errors/index.js";import{SUBAGENT_ADAPTER_KIND,isSubagentAdapterState}from"#subagents/adapter-state.js";const log=createLogger(`execution.delegated-parent-notification`),SUBAGENT_EXECUTION_FAILED=`SUBAGENT_EXECUTION_FAILED`,ZERO_TOKEN_USAGE={cacheReadTokens:0,cacheWriteTokens:0,inputTokens:0,outputTokens:0};async function notifyTurnCallerStep(e){"use step";if(e.caller===void 0)return;let t=createSettledTurnResult({caller:e.caller,lifecycle:e.lifecycle,sessionId:e.sessionId,settled:e.settled});if(e.caller.replyTo.kind===`callback`){await postSettledTurnCallback({result:t,sessionId:e.sessionId,url:e.caller.replyTo.url});return}await resumeSettledTurnHook(e.caller.replyTo.token,t)}async function notifyCancelledTaskCallerStep(e){"use step";let t=e.usage??ZERO_TOKEN_USAGE,n={code:SUBAGENT_EXECUTION_FAILED,message:`The agent invocation was cancelled.`},r={callId:e.caller.callId,isError:!0,kind:`subagent-result`,origin:`child`,outcome:{kind:`parked`,result:{kind:`cancelled`},usageDelta:t},output:n,subagentName:e.caller.subagentName},i=e.usage===void 0?r:{...r,usage:e.usage};if(e.caller.replyTo.kind===`callback`){await postSettledTurnCallback({result:i,sessionId:e.sessionId,url:e.caller.replyTo.url});return}await resumeSettledTurnHook(e.caller.replyTo.token,i)}function createSettledTurnResult(e){let t=e.settled.usage??ZERO_TOKEN_USAGE;if(e.settled.isError===!0){let n={code:SUBAGENT_EXECUTION_FAILED,message:toErrorMessage(e.settled.output)};return{callId:e.caller.callId,isError:!0,kind:`subagent-result`,origin:`child`,outcome:{kind:e.lifecycle,result:{error:n,kind:`failed`},usageDelta:t},output:n,subagentName:e.caller.subagentName}}let n=parseJsonValue(e.settled.output),r={callId:e.caller.callId,kind:`subagent-result`,origin:`child`,outcome:{kind:e.lifecycle,result:{kind:`succeeded`,output:n},usageDelta:t},output:n,subagentName:e.caller.subagentName};return e.settled.usage===void 0?r:{...r,usage:e.settled.usage}}async function resolveInitialTurnCallerStep(e){"use step";let t=e.serializedContext[SessionCallbackKey.name];if(t!==void 0){let e=parseSessionCallback(t);if(!e.ok)throw Error(`Serialized session callback is invalid.`,{cause:e.cause});return{callId:e.callback.callId,replyTo:{kind:`callback`,token:e.callback.token,url:e.callback.url},subagentName:e.callback.subagentName}}let n=(await deserializeContext(e.serializedContext)).get(ChannelKey);if(n?.kind===SUBAGENT_ADAPTER_KIND&&isSubagentAdapterState(n.state))return{callId:n.state.callId,replyTo:{kind:`hook`,token:n.state.parentContinuationToken},subagentName:n.state.subagentName}}function bindTurnCallerContext(e,t){if(e===void 0)return t;if(e.replyTo.kind===`callback`){let n={callId:e.callId,subagentName:e.subagentName,token:e.replyTo.token,url:e.replyTo.url};return{...t,[SessionCallbackKey.name]:n}}let n=t[ChannelKey.name];if(typeof n!=`object`||!n||Reflect.get(n,`kind`)!==SUBAGENT_ADAPTER_KIND||!isSubagentAdapterState(Reflect.get(n,`state`)))throw Error(`Delegated local turn is missing its subagent adapter binding.`);let r={...Reflect.get(n,`state`),callId:e.callId,parentContinuationToken:e.replyTo.token,subagentName:e.subagentName};return{...t,[ChannelKey.name]:{...n,state:r}}}async function postSettledTurnCallback(e){let{sessionId:t}=e;if(e.result.isError===!0){await postCallbackPayload({payload:{callId:e.result.callId,error:e.result.output,kind:`turn.failed`,outcome:e.result.outcome,sessionId:t,subagentName:e.result.subagentName},url:e.url});return}await postCallbackPayload({payload:{callId:e.result.callId,kind:`turn.completed`,outcome:e.result.outcome,output:e.result.output,sessionId:t,subagentName:e.result.subagentName},url:e.url})}async function postCallbackPayload(e){let t=await postSessionCallbackRequest({body:e.payload,url:e.url});if(!t.ok)throw Error(`Turn callback failed with HTTP ${t.status}.`)}async function resumeSettledTurnHook(e,t){try{await resumeHook(e,{kind:`runtime-action-result`,results:[t]})}catch(n){if(!HookNotFoundError.is(n))throw n;log.warn(`turn caller hook no longer exists`,{callId:t.callId,callerToken:e})}}export{bindTurnCallerContext,notifyCancelledTaskCallerStep,notifyTurnCallerStep,resolveInitialTurnCallerStep};
|
|
@@ -47,6 +47,7 @@ export declare function buildSubagentRunInput(input: {
|
|
|
47
47
|
* parent capabilities produce an undefined child capability set.
|
|
48
48
|
*/
|
|
49
49
|
readonly capabilities?: SessionCapabilities;
|
|
50
|
+
readonly schedule?: import("#context/session-schedule.js").SessionSchedule;
|
|
50
51
|
readonly channelMetadata?: ChannelInstrumentationProjection;
|
|
51
52
|
/** Replay-stable key the child's continuation token derives from. */
|
|
52
53
|
readonly continuationKey: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{formatSubagentInput}from"#subagents/invocation.js";import{mintSubagentContinuationToken}from"#execution/session.js";import{SUBAGENT_ADAPTER_KIND}from"#subagents/adapter-state.js";function buildSubagentRunInput(e){let{action:t,auth:n,capabilities:r,channelMetadata:i,inheritedConversation:a,initiatorAuth:o,session:s,source:c}=e,l=mintSubagentContinuationToken(e.continuationKey),u={callId:t.callId,parentContinuationToken:e.parent.continuationToken??s.continuationToken,parentSessionId:s.sessionId,subagentName:t.subagentName};return(e.graph?.nodesByNodeId.get(t.nodeId)?.sandboxRegistry.sandbox?.definition.kind===`parent`||e.selfAgent)&&(s.sandboxState!==void 0&&(u.parentSandboxState=s.sandboxState),u.sandboxSessionId=e.sandboxSessionId??s.sessionId),{childContinuationToken:l,runInput:{adapter:{kind:SUBAGENT_ADAPTER_KIND,state:u},auth:n,capabilities:r,channelMetadata:i,inheritedConversation:a,continuationToken:l,initiatorAuth:o,input:{message:formatSubagentCallInputMessage({action:t,source:c}),outputSchema:t.input.outputSchema},limits:e.limits,conversationId:e.parent.conversationId,parent:e.parent.lineage,parentTraceContext:e.parent.traceContext,traceRoot:e.parent.traceRoot}}}function formatSubagentCallInputMessage(e){let{message:t}=e.action.input;switch(e.source.type){case`local`:return formatSubagentInput({description:e.source.description,message:t,name:e.action.subagentName,type:`local`}).message;case`runtime`:return formatSubagentInput({message:t,name:e.action.subagentName,type:`runtime`}).message;default:return e.source}}export{buildSubagentRunInput};
|
|
1
|
+
import{formatSubagentInput}from"#subagents/invocation.js";import{mintSubagentContinuationToken}from"#execution/session.js";import{SUBAGENT_ADAPTER_KIND}from"#subagents/adapter-state.js";function buildSubagentRunInput(e){let{action:t,auth:n,capabilities:r,channelMetadata:i,inheritedConversation:a,initiatorAuth:o,session:s,source:c}=e,l=mintSubagentContinuationToken(e.continuationKey),u={callId:t.callId,parentContinuationToken:e.parent.continuationToken??s.continuationToken,parentSessionId:s.sessionId,subagentName:t.subagentName};return(e.graph?.nodesByNodeId.get(t.nodeId)?.sandboxRegistry.sandbox?.definition.kind===`parent`||e.selfAgent)&&(s.sandboxState!==void 0&&(u.parentSandboxState=s.sandboxState),u.sandboxSessionId=e.sandboxSessionId??s.sessionId),{childContinuationToken:l,runInput:{adapter:{kind:SUBAGENT_ADAPTER_KIND,state:u},auth:n,capabilities:r,schedule:e.schedule,channelMetadata:i,inheritedConversation:a,continuationToken:l,initiatorAuth:o,input:{message:formatSubagentCallInputMessage({action:t,source:c}),outputSchema:t.input.outputSchema},limits:e.limits,conversationId:e.parent.conversationId,parent:e.parent.lineage,parentTraceContext:e.parent.traceContext,traceRoot:e.parent.traceRoot}}}function formatSubagentCallInputMessage(e){let{message:t}=e.action.input;switch(e.source.type){case`local`:return formatSubagentInput({description:e.source.description,message:t,name:e.action.subagentName,type:`local`}).message;case`runtime`:return formatSubagentInput({message:t,name:e.action.subagentName,type:`runtime`}).message;default:return e.source}}export{buildSubagentRunInput};
|
package/dist/src/svelte/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as conversationProjection, i as openConversationInputs, n as conversationReducer, o as callStatus, r as defaultMessageReducer, t as useEveAgent } from "../chunks/use-eve-agent-
|
|
1
|
+
import { a as conversationProjection, i as openConversationInputs, n as conversationReducer, o as callStatus, r as defaultMessageReducer, t as useEveAgent } from "../chunks/use-eve-agent-B2Kne9z6.js";
|
|
2
2
|
|
|
3
3
|
//#region src/client/tool-call-state.ts
|
|
4
4
|
function toolCallState(conversation, callId, options = {}) {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { StubResult } from "#tool-stubs/types.js";
|
|
2
|
+
import type { ToolExecuteOptions } from "#tools/definition.js";
|
|
3
|
+
/** Tool inputs and approvals have already been checked before a stub can replace execution. */
|
|
4
|
+
export declare function executeWithToolStub(tool: string, input: unknown, options: ToolExecuteOptions, execute: () => unknown): unknown;
|
|
5
|
+
/** The connection wrapper checks operation inputs and approvals before requesting a stub. */
|
|
6
|
+
export declare function connectionToolStub(tool: string, input: unknown, callId: string): Promise<StubResult>;
|
|
7
|
+
/** Record errors converting stub responses so eval verification can detect them. */
|
|
8
|
+
export declare function recordToolStubFailure(tool: string, callId: string | undefined, turnId?: string): Promise<void>;
|
|
9
|
+
/** Record stub failures even when the caller recovers with fallback output. */
|
|
10
|
+
export declare function observeToolOutput<T>(tool: string, calls: readonly {
|
|
11
|
+
readonly callId: string;
|
|
12
|
+
readonly turnId?: string;
|
|
13
|
+
}[], project: () => T | Promise<T>, recover?: (error: unknown) => T): Promise<T>;
|