eve 0.73.0 → 0.74.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 +16 -0
- package/dist/src/_virtual/_rolldown/runtime.js +1 -1
- package/dist/src/channel/schedule.d.ts +20 -6
- package/dist/src/channel/schedule.js +1 -1
- package/dist/src/channel/types.d.ts +4 -0
- package/dist/src/chunks/{use-eve-agent-C1GYGCtb.js → use-eve-agent-DOOXadF0.js} +13 -3
- package/dist/src/chunks/{use-eve-agent-hZJ7CB8t.js → use-eve-agent-mP0M7SrL.js} +13 -3
- package/dist/src/cli/dev/tui/stream-format.js +2 -2
- package/dist/src/client/message-reducer.js +1 -1
- 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 +18 -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-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 +2 -0
- package/dist/src/context/keys.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/execution/agent-sessions/context.d.ts +2 -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/dynamic-workflow/tool.js +1 -1
- package/dist/src/execution/runtime-context.js +1 -1
- package/dist/src/execution/session/entry.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/protocol.js +1 -1
- package/dist/src/execution/tools/agent-router-workflow.js +1 -1
- package/dist/src/execution/tools/connection-tools.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/emission.d.ts +1 -0
- package/dist/src/harness/emission.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/session-machine/transitions.d.ts +13 -0
- package/dist/src/harness/session-machine/transitions.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/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/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/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-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/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 +259 -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/setup/scaffold/create/project.js +1 -1
- package/dist/src/shared/principal-scope.d.ts +2 -0
- package/dist/src/shared/principal-scope.js +1 -0
- 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/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/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/tools/workflows.mdx +6 -4
- package/package.json +22 -2
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ScheduleOccurrence } from "#public/schedules/subscription.js";
|
|
2
|
+
export interface ScheduleDelivery<TPayload = unknown> {
|
|
3
|
+
readonly payload: TPayload;
|
|
4
|
+
readonly occurrence: ScheduleOccurrence;
|
|
5
|
+
}
|
|
6
|
+
export interface ScheduleDeliveryTarget {
|
|
7
|
+
readonly key: string;
|
|
8
|
+
readonly deliver?: (delivery: ScheduleDelivery<any>) => Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
export interface ScheduleProviderContext {
|
|
11
|
+
readonly abortSignal: AbortSignal;
|
|
12
|
+
readonly collection: string;
|
|
13
|
+
readonly namespace: string;
|
|
14
|
+
readonly operationId: string;
|
|
15
|
+
readonly target: ScheduleDeliveryTarget;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ScheduleProvider } from "#public/schedules/subscription.js";
|
|
2
|
+
export interface InMemoryScheduleProviderOptions {
|
|
3
|
+
readonly now?: () => Date;
|
|
4
|
+
}
|
|
5
|
+
export declare function inMemoryScheduleProvider(options?: InMemoryScheduleProviderOptions): ScheduleProvider;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createHash,randomUUID}from"node:crypto";function inMemoryScheduleProvider(e={}){let t=new Map,n=new Map,r=new Map,i=new Set,a=new Set,o=e.now??(()=>new Date);return{kind:`in-memory`,async create(e,a){return withOperationResult(n,e.operationId,()=>{let n=scheduleKey(e,a.name);if(t.has(n))throw Error(`Schedule ${JSON.stringify(a.name)} already exists.`);let s=o().getTime(),c={createdAt:s,expression:normalizeExpression(a.expression),payload:a.payload,name:a.name,scheduleId:allocateScheduleId(e,a.name,r,i),state:a.expression.type===`single`&&Date.parse(a.expression.at)<=s?`completed`:a.state??`active`,target:e.target,updatedAt:s};return t.set(n,c),publicRecord(c)})},async list(e,n){let r=[...t.entries()].filter(([t])=>t.startsWith(collectionPrefix(e))).map(([,e])=>publicRecord(e)).sort((e,t)=>e.name.localeCompare(t.name)),i=decodeCursor(n.cursor),a=normalizeLimit(n.limit),o=r.slice(i,i+a),s=i+o.length;return{cursor:s<r.length?String(s):null,data:o}},async get(e,n){let r=t.get(scheduleKey(e,n));return r===void 0?null:publicRecord(r)},async enable(e,r){return setState(t,n,e,r,`active`,o)},async disable(e,r){return setState(t,n,e,r,`inactive`,o)},async invoke(e,r){let i=n.get(e.operationId);if(i!==void 0){e.target.deliver!==void 0&&await e.target.deliver(i);return}let s=requireSchedule(t,scheduleKey(e,r),r);if(s.state===`completed`)throw Error(`Completed schedule ${JSON.stringify(r)} cannot be invoked.`);let c=o().toISOString(),l={payload:s.payload,occurrence:{executionId:allocateOccurrenceId(e.operationId,a),name:s.name,scheduleId:s.scheduleId,scheduledAt:c}};n.set(e.operationId,l),s.target.deliver!==void 0&&await s.target.deliver(l)},async delete(e,i){return withOperationResult(n,e.operationId,()=>{let n=scheduleKey(e,i),a=t.delete(n);return a&&r.delete(n),a})}}}async function setState(e,t,n,r,i,a){return withOperationResult(t,n.operationId,()=>{let t=scheduleKey(n,r),o={...requireSchedule(e,t,r),state:i,updatedAt:a().getTime()};return e.set(t,o),publicRecord(o)})}function requireSchedule(e,t,n){let r=e.get(t);if(r===void 0)throw Error(`Schedule ${JSON.stringify(n)} was not found.`);return r}function withOperationResult(e,t,n){if(e.has(t))return e.get(t);let r=n();return e.set(t,r),r}function allocateOccurrenceId(e,t){let n=`manual_${createHash(`sha256`).update(e).digest(`base64url`)}`,r=n,i=0;for(;t.has(r);)r=`${n}_${++i}`;return t.add(r),r}function normalizeExpression(e){if(e.type===`cron`){let t={type:`cron`,cron:e.cron.trim().replace(/\s+/gu,` `)};return e.timezone!==void 0&&(t.timezone=e.timezone),e.jitter!==void 0&&(t.jitter=e.jitter),t}let t={type:`single`,at:e.at};return e.timezone!==void 0&&(t.timezone=e.timezone),t}function publicRecord(e){return{createdAt:e.createdAt,expression:e.expression,name:e.name,scheduleId:e.scheduleId,state:e.state,updatedAt:e.updatedAt}}function collectionPrefix(e){return`${e.collection}\0${e.namespace}\0`}function scheduleKey(e,t){return`${collectionPrefix(e)}${t}`}function allocateScheduleId(e,t,n,r){let i=scheduleKey(e,t),a=n.get(i);if(a!==void 0)return a;let o;do o=`mem_${createHash(`sha256`).update(`${i}:${randomUUID()}`).digest(`hex`)}`;while(r.has(o));return n.set(i,o),r.add(o),o}function normalizeLimit(e){if(e===void 0)return 20;if(!Number.isSafeInteger(e)||e<1||e>100)throw Error(`Schedule list limit must be an integer from 1 through 100.`);return e}function decodeCursor(e){if(e===void 0)return 0;let t=Number(e);if(!Number.isSafeInteger(t)||t<0)throw Error(`Invalid schedule cursor.`);return t}export{inMemoryScheduleProvider};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ScheduleProvider } from "#public/schedules/subscription.js";
|
|
2
|
+
/** Client options of a Vercel provider, so delivery verification talks to the same endpoint. */
|
|
3
|
+
export declare function readVercelScheduleClientOptions(provider: ScheduleProvider): VercelScheduleProviderOptions | undefined;
|
|
4
|
+
export interface VercelScheduleProviderOptions {
|
|
5
|
+
/** Overrides the public Vercel Schedules endpoint. */
|
|
6
|
+
readonly baseUrl?: string;
|
|
7
|
+
readonly fetch?: typeof fetch;
|
|
8
|
+
}
|
|
9
|
+
/** Uses ambient OIDC on Vercel and process-local storage under `eve dev`. */
|
|
10
|
+
export declare function vercelScheduleProvider(options?: VercelScheduleProviderOptions): ScheduleProvider;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isEveDevEnvironment}from"#internal/application/dev-environment.js";import{deriveEveScheduleQueueTopic}from"#runtime/schedules/queue-namespace.js";import{inMemoryScheduleProvider}from"#public/schedules/providers/in-memory.js";const DEVELOPMENT_PROVIDER=inMemoryScheduleProvider(),CLIENT_OPTIONS=new WeakMap;function readVercelScheduleClientOptions(e){return CLIENT_OPTIONS.get(e)}function vercelScheduleProvider(e={}){if(isEveDevEnvironment())return DEVELOPMENT_PROVIDER;let client=t=>createClient(e,t),t={kind:`vercel`,async create(e,t){let n=await client(e.abortSignal),r=await n.create({expression:toVercelExpression(t.expression),jitter:t.expression.type===`cron`?t.expression.jitter:void 0,name:t.name,namespace:e.namespace,payload:createDispatchPayload(e,t.payload),target:{topic:deriveEveScheduleQueueTopic(e.target.key)},timezone:t.expression.timezone});if(t.state===`inactive`)try{r=await n.disable({name:t.name,namespace:e.namespace})}catch(e){throw Error(`Schedule ${JSON.stringify(t.name)} was created active, but disabling it failed; it may remain active.`,{cause:e})}return fromVercelSchedule(r)},async list(e,t){let n=t.cursor?.trim()||void 0,r={namespace:e.namespace};n!==void 0&&(r.cursor=n),t.limit!==void 0&&(r.limit=t.limit);let i=await(await client(e.abortSignal)).list(r);return{cursor:i.cursor,data:i.data.map(fromVercelSchedule)}},async get(e,t){let n=await getScheduleOrNull(await client(e.abortSignal),t,e.namespace);return n===null?null:fromVercelSchedule(n)},async enable(e,t){return fromVercelSchedule(await(await client(e.abortSignal)).enable({name:t,namespace:e.namespace}))},async disable(e,t){return fromVercelSchedule(await(await client(e.abortSignal)).disable({name:t,namespace:e.namespace}))},async invoke(e,t){await(await client(e.abortSignal)).invoke({name:t,namespace:e.namespace})},async delete(e,t){try{return await(await client(e.abortSignal)).delete({name:t,namespace:e.namespace}),!0}catch(e){if(isNotFoundError(e))return!1;throw e}}};return CLIENT_OPTIONS.set(t,e),t}async function createClient(e,t){assertSupportedVercelEnvironment();let{SchedulesClient:n}=await import(`#compiled/@vercel/schedules/index.js`);t.throwIfAborted();let r=e.fetch??fetch;return new n({...e,fetch:(e,n)=>r(e,{...n,signal:t})})}function createDispatchPayload(e,t){return{eve:{application:e.target.key,collection:e.collection,version:1},payload:t}}function toVercelExpression(e){return e.type===`cron`?{type:`cron`,cron:e.cron}:{type:`single`,at:e.at}}function fromVercelSchedule(e){let t;if(e.expression.type===`cron`){let n={type:`cron`,cron:e.expression.cron,timezone:e.timezone};e.jitter!==void 0&&(n.jitter=e.jitter),t=n}else t={type:`single`,at:e.expression.at,timezone:e.timezone};return{createdAt:e.createdAt,expression:t,name:e.name,scheduleId:e.scheduleId,state:e.state,updatedAt:e.updatedAt}}async function getScheduleOrNull(e,t,n){try{return await e.get({name:t,namespace:n})}catch(e){if(isNotFoundError(e))return null;throw e}}function isNotFoundError(e){return typeof e==`object`&&!!e&&Reflect.get(e,`name`)===`SchedulesApiError`&&Reflect.get(e,`status`)===404}function assertSupportedVercelEnvironment(){if(!process.env.VERCEL?.trim())throw Error(`vercelScheduleProvider() requires a Vercel production deployment or eve dev.`);if(process.env.VERCEL_ENV!==`production`)throw Error("Vercel Schedules currently supports production deployments only. Deploy with `vercel --prod`.")}export{readVercelScheduleClientOptions,vercelScheduleProvider};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{principalScope}from"#shared/principal-scope.js";function byPrincipal(e){return principalScope(e.session.auth)}export{byPrincipal};
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import type { StandardSchemaV1 } from "#compiled/@standard-schema/spec/index.js";
|
|
2
|
+
import type { SessionSchedule } from "#context/session-schedule.js";
|
|
3
|
+
import type { SessionAuth } from "#context/keys.js";
|
|
4
|
+
import type { SessionAuthContext } from "#channel/types.js";
|
|
5
|
+
import type { ScheduleHandlerArgs } from "#public/definitions/schedule.js";
|
|
6
|
+
import type { ExactDefinition } from "#public/definitions/exact.js";
|
|
7
|
+
import type { Approval, ApprovalContext, ApprovalStatus, ApprovalResponseContext, ApprovalResponseDecision } from "#approval/definition.js";
|
|
8
|
+
import type { UserContent } from "ai";
|
|
9
|
+
import type { ChannelReference } from "#channel/compiled-channel.js";
|
|
10
|
+
import type { InferReceiveTarget } from "#channel/receive-target.js";
|
|
11
|
+
import type { Session } from "#channel/session.js";
|
|
12
|
+
import { SCHEDULE_COLLECTION_DEFINITION_BRAND } from "#shared/schedule-collection-definition.js";
|
|
13
|
+
import type { ScheduleProviderContext } from "#runtime/schedules/provider-types.js";
|
|
14
|
+
/** A provider namespace scope, represented by one key or a hierarchical key path. */
|
|
15
|
+
export type ScheduleScopeValue = string | readonly string[];
|
|
16
|
+
/** Return `null` to deny the current schedule operation. */
|
|
17
|
+
export type ScheduleScopeResolverResult = ScheduleScopeValue | null;
|
|
18
|
+
export type ScheduleOperation = "create" | "get" | "list" | "enable" | "disable" | "invoke" | "delete";
|
|
19
|
+
/** Trusted caller context used to authorize each management operation. */
|
|
20
|
+
export interface ScheduleScopeContext {
|
|
21
|
+
readonly abortSignal: AbortSignal;
|
|
22
|
+
readonly operation?: ScheduleOperation;
|
|
23
|
+
readonly name?: string;
|
|
24
|
+
readonly session: {
|
|
25
|
+
readonly id: string;
|
|
26
|
+
readonly auth: SessionAuth;
|
|
27
|
+
readonly schedule?: SessionSchedule;
|
|
28
|
+
};
|
|
29
|
+
readonly channel: {
|
|
30
|
+
readonly kind?: string;
|
|
31
|
+
readonly continuationToken?: string;
|
|
32
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/** Stable creator reference; never a snapshot of credentials or permissions. */
|
|
36
|
+
export interface SchedulePrincipalReference {
|
|
37
|
+
readonly type: string;
|
|
38
|
+
readonly authenticator: string;
|
|
39
|
+
readonly issuer?: string;
|
|
40
|
+
readonly principalId: string;
|
|
41
|
+
readonly subject?: string;
|
|
42
|
+
}
|
|
43
|
+
/** Framework-owned envelope stored alongside timing with the provider. */
|
|
44
|
+
export interface ScheduleEnvelope<TPayload = unknown> {
|
|
45
|
+
readonly version: 3;
|
|
46
|
+
readonly payload: TPayload;
|
|
47
|
+
readonly scope: ScheduleScopeValue;
|
|
48
|
+
readonly principal: SchedulePrincipalReference;
|
|
49
|
+
}
|
|
50
|
+
export interface ScheduleOccurrenceIdentity {
|
|
51
|
+
/** Readable schedule label; name remains the unique management identifier. */
|
|
52
|
+
readonly displayName?: string;
|
|
53
|
+
readonly collection: string;
|
|
54
|
+
readonly scheduleId: string;
|
|
55
|
+
readonly name: string;
|
|
56
|
+
readonly executionId: string;
|
|
57
|
+
readonly scheduledAt: string;
|
|
58
|
+
}
|
|
59
|
+
/** Callback completion is distinct from completion of the agent sessions it starts. */
|
|
60
|
+
export interface ScheduleOccurrenceEvent<TPayload = unknown> {
|
|
61
|
+
readonly type: "occurrence.dispatched" | "occurrence.failed";
|
|
62
|
+
readonly collection: string;
|
|
63
|
+
readonly executionId: string;
|
|
64
|
+
readonly name: string;
|
|
65
|
+
readonly scheduleId: string;
|
|
66
|
+
readonly scheduledAt: string;
|
|
67
|
+
readonly occurrence: ScheduleOccurrenceIdentity;
|
|
68
|
+
readonly sessionIds?: readonly string[];
|
|
69
|
+
readonly reason?: string;
|
|
70
|
+
readonly schedule?: ScheduleEnvelope<TPayload>;
|
|
71
|
+
}
|
|
72
|
+
export type ScheduleOccurrenceEventHandler<TPayload = unknown> = (event: ScheduleOccurrenceEvent<TPayload>) => void | Promise<void>;
|
|
73
|
+
export type ScheduleExpression = {
|
|
74
|
+
readonly type: "cron";
|
|
75
|
+
readonly cron: string;
|
|
76
|
+
readonly timezone?: string;
|
|
77
|
+
readonly jitter?: number;
|
|
78
|
+
} | {
|
|
79
|
+
readonly type: "single";
|
|
80
|
+
readonly at: string;
|
|
81
|
+
readonly timezone?: string;
|
|
82
|
+
};
|
|
83
|
+
/** Relative delays are resolved once at the client call boundary using eve's clock. */
|
|
84
|
+
export type ScheduleTiming = ScheduleExpression | {
|
|
85
|
+
readonly type: "delay";
|
|
86
|
+
readonly minutes: number;
|
|
87
|
+
};
|
|
88
|
+
export type ScheduleState = "active" | "inactive" | "completed";
|
|
89
|
+
/** Provider projection; payload and creator data are not read back. */
|
|
90
|
+
export interface ScheduleRecord {
|
|
91
|
+
/** Human-readable label; multiple schedules may share it. */
|
|
92
|
+
readonly displayName?: string;
|
|
93
|
+
readonly createdAt: number;
|
|
94
|
+
readonly expression: ScheduleExpression;
|
|
95
|
+
readonly name: string;
|
|
96
|
+
readonly scheduleId: string;
|
|
97
|
+
readonly state: ScheduleState;
|
|
98
|
+
readonly updatedAt: number;
|
|
99
|
+
}
|
|
100
|
+
export interface SchedulePage {
|
|
101
|
+
readonly cursor: string | null;
|
|
102
|
+
readonly data: readonly ScheduleRecord[];
|
|
103
|
+
}
|
|
104
|
+
export interface ScheduleCreate<TPayload> {
|
|
105
|
+
readonly expression: ScheduleExpression;
|
|
106
|
+
readonly payload: TPayload;
|
|
107
|
+
readonly name: string;
|
|
108
|
+
readonly state?: ScheduleState;
|
|
109
|
+
}
|
|
110
|
+
export interface ScheduleList {
|
|
111
|
+
readonly cursor?: string;
|
|
112
|
+
readonly limit?: number;
|
|
113
|
+
}
|
|
114
|
+
export interface ScheduleOccurrence {
|
|
115
|
+
readonly executionId: string;
|
|
116
|
+
readonly name: string;
|
|
117
|
+
readonly scheduleId: string;
|
|
118
|
+
readonly scheduledAt: string;
|
|
119
|
+
}
|
|
120
|
+
/** Storage and occurrence transport supplied by a schedule backend. */
|
|
121
|
+
export interface ScheduleProvider {
|
|
122
|
+
readonly kind: string;
|
|
123
|
+
create<TPayload>(context: ScheduleProviderContext, schedule: ScheduleCreate<TPayload>): Promise<ScheduleRecord>;
|
|
124
|
+
list(context: ScheduleProviderContext, query: ScheduleList): Promise<SchedulePage>;
|
|
125
|
+
get(context: ScheduleProviderContext, name: string): Promise<ScheduleRecord | null>;
|
|
126
|
+
enable(context: ScheduleProviderContext, name: string): Promise<ScheduleRecord>;
|
|
127
|
+
disable(context: ScheduleProviderContext, name: string): Promise<ScheduleRecord>;
|
|
128
|
+
invoke(context: ScheduleProviderContext, name: string): Promise<void>;
|
|
129
|
+
delete(context: ScheduleProviderContext, name: string): Promise<boolean>;
|
|
130
|
+
}
|
|
131
|
+
export interface ScheduleClientCreate<TPayload> {
|
|
132
|
+
readonly expression: ScheduleTiming;
|
|
133
|
+
/** Display label. Creation allocates a unique management name returned in the receipt. */
|
|
134
|
+
readonly name: string;
|
|
135
|
+
readonly payload: TPayload;
|
|
136
|
+
}
|
|
137
|
+
export interface SchedulePageResult {
|
|
138
|
+
readonly cursor: string | null;
|
|
139
|
+
readonly data: readonly ScheduleRecord[];
|
|
140
|
+
}
|
|
141
|
+
/** Authenticated client; payload and creator identity are immutable after creation. */
|
|
142
|
+
export interface ScheduleClient<TPayload> {
|
|
143
|
+
create(input: ScheduleClientCreate<TPayload>): Promise<ScheduleRecord>;
|
|
144
|
+
delete(name: string): Promise<boolean>;
|
|
145
|
+
disable(name: string): Promise<ScheduleRecord>;
|
|
146
|
+
enable(name: string): Promise<ScheduleRecord>;
|
|
147
|
+
get(name: string): Promise<ScheduleRecord | null>;
|
|
148
|
+
invoke(name: string): Promise<void>;
|
|
149
|
+
list(input?: ScheduleList): Promise<SchedulePageResult>;
|
|
150
|
+
}
|
|
151
|
+
/** Starts fresh unattended work bound to the resolved creator; callers cannot choose another identity. */
|
|
152
|
+
export type DynamicSchedulesToFn = <TChannel extends ChannelReference<unknown>>(channel: TChannel, target: InferReceiveTarget<TChannel>) => {
|
|
153
|
+
send(message: string | UserContent): Promise<Session>;
|
|
154
|
+
};
|
|
155
|
+
export type ScheduleCreateApproval<TPrepared> = ((context: ApprovalContext & {
|
|
156
|
+
readonly payload: TPrepared;
|
|
157
|
+
}) => ApprovalStatus | Promise<ApprovalStatus>) | {
|
|
158
|
+
readonly request: (context: ApprovalContext & {
|
|
159
|
+
readonly payload: TPrepared;
|
|
160
|
+
}) => ApprovalStatus | Promise<ApprovalStatus>;
|
|
161
|
+
readonly response?: (context: ApprovalResponseContext & {
|
|
162
|
+
readonly payload: TPrepared;
|
|
163
|
+
}) => ApprovalResponseDecision | Promise<ApprovalResponseDecision>;
|
|
164
|
+
};
|
|
165
|
+
export type ScheduleApprovals<TPrepared> = Partial<Record<Exclude<ScheduleOperation, "create">, Approval>> & {
|
|
166
|
+
readonly create?: ScheduleCreateApproval<TPrepared>;
|
|
167
|
+
};
|
|
168
|
+
/** Execution context; `to` starts fresh, unattended sessions as the resolved creator. */
|
|
169
|
+
export interface DynamicSchedulesRunArgs<TPayload> extends Pick<ScheduleHandlerArgs, "waitUntil"> {
|
|
170
|
+
readonly to: DynamicSchedulesToFn;
|
|
171
|
+
readonly payload: TPayload;
|
|
172
|
+
readonly occurrence: ScheduleOccurrenceIdentity;
|
|
173
|
+
readonly auth: SessionAuthContext;
|
|
174
|
+
}
|
|
175
|
+
/** Defines dynamically created schedules whose occurrences invoke authored code. */
|
|
176
|
+
export interface DynamicSchedulesDefinition<TPayload = unknown, TSchema extends StandardSchemaV1<unknown, TPayload> = StandardSchemaV1<unknown, TPayload>, TPrepared = TPayload> {
|
|
177
|
+
readonly description?: string;
|
|
178
|
+
/** Model-facing payload schema. Destination intent may be resolved by `run`. */
|
|
179
|
+
readonly inputSchema: TSchema;
|
|
180
|
+
/** Resolved backend. defineDynamicSchedules defaults omitted providers to Vercel Schedules. */
|
|
181
|
+
readonly provider: ScheduleProvider;
|
|
182
|
+
/**
|
|
183
|
+
* Validates application policy and enriches a creation payload before the provider write.
|
|
184
|
+
* The caller constructs input; eve validates it with `inputSchema`, authorizes creation
|
|
185
|
+
* through `scope`, then calls `preparePayload` with trusted creation context. eve checks that the
|
|
186
|
+
* result is bounded JSON and persists it; `inputSchema` describes caller input, not stored prepared output.
|
|
187
|
+
* Throw an actionable error to reject creation without writing a schedule.
|
|
188
|
+
*
|
|
189
|
+
* A common use is capturing the current channel destination: derive channel/workspace
|
|
190
|
+
* references from verified caller context, replace any model-supplied references, and
|
|
191
|
+
* return them with the task. Keep captured fields out of the input schema.
|
|
192
|
+
* Channel-less or delegated callers may lack that context; reject those cases explicitly.
|
|
193
|
+
*
|
|
194
|
+
* Runs only on creation. Model calls invoke preparePayload before approval and again before
|
|
195
|
+
* writing; execution fails if the prepared result differs from the approved snapshot.
|
|
196
|
+
* Authenticated clients invoke preparePayload once before writing without model approval. Reads, enable/disable operations, and occurrence execution do not call it. Omission
|
|
197
|
+
* stores validated input unchanged. Creation retries may call it again, so avoid
|
|
198
|
+
* irreversible side effects; state changes never recapture a different destination.
|
|
199
|
+
* `auth`, `run`, and occurrence events receive the inferred return type. Declare `preparePayload`
|
|
200
|
+
* before those callbacks for contextual inference, or annotate its return type explicitly.
|
|
201
|
+
* Prepared application data is not revalidated against the input schema at execution;
|
|
202
|
+
* validate the application's persisted contract in authored code when necessary.
|
|
203
|
+
*/
|
|
204
|
+
readonly preparePayload?: (payload: TPayload, context: ScheduleScopeContext & {
|
|
205
|
+
readonly operation: "create";
|
|
206
|
+
readonly name: string;
|
|
207
|
+
}) => TPrepared | Promise<TPrepared>;
|
|
208
|
+
/** Authorizes every management operation. Defaults to `byPrincipal`. */
|
|
209
|
+
readonly scope?: (context: ScheduleScopeContext & {
|
|
210
|
+
readonly operation: ScheduleOperation;
|
|
211
|
+
}) => ScheduleScopeResolverResult | Promise<ScheduleScopeResolverResult>;
|
|
212
|
+
/** Resolves the captured creator to current execution auth; return `null` to deny. */
|
|
213
|
+
readonly auth: (context: {
|
|
214
|
+
readonly principal: SchedulePrincipalReference;
|
|
215
|
+
readonly payload: NoInfer<TPrepared>;
|
|
216
|
+
readonly occurrence: ScheduleOccurrenceIdentity;
|
|
217
|
+
}) => SessionAuthContext | null | Promise<SessionAuthContext | null>;
|
|
218
|
+
/** May repeat on provider retries. Key external effects on the occurrence identity. */
|
|
219
|
+
readonly run: (args: DynamicSchedulesRunArgs<NoInfer<TPrepared>>) => void | Promise<void>;
|
|
220
|
+
readonly events?: {
|
|
221
|
+
/** After `run` and registered `waitUntil` work succeed; may repeat on retries. */
|
|
222
|
+
readonly "occurrence.dispatched"?: ScheduleOccurrenceEventHandler<NoInfer<TPrepared>>;
|
|
223
|
+
/** On a permanent provider failure or after its retry budget is exhausted. */
|
|
224
|
+
readonly "occurrence.failed"?: ScheduleOccurrenceEventHandler<NoInfer<TPrepared>>;
|
|
225
|
+
};
|
|
226
|
+
/** Expose operation tools directly (default true), or false for code-only scheduling. */
|
|
227
|
+
readonly tool?: boolean;
|
|
228
|
+
/** Model-call policies keyed by operation. Create receives the validated prepared payload. */
|
|
229
|
+
readonly approval?: ScheduleApprovals<NoInfer<TPrepared>>;
|
|
230
|
+
}
|
|
231
|
+
export type DefinedDynamicSchedules<TPayload = unknown, TSchema extends StandardSchemaV1<unknown, TPayload> = StandardSchemaV1<unknown, TPayload>, TPrepared = TPayload> = DynamicSchedulesDefinition<TPayload, TSchema, TPrepared> & {
|
|
232
|
+
readonly [SCHEDULE_COLLECTION_DEFINITION_BRAND]: true;
|
|
233
|
+
};
|
|
234
|
+
type DynamicSchedulesOptions<TInput, TSchema extends StandardSchemaV1<unknown, TInput>, TPrepared = TInput> = Omit<DynamicSchedulesDefinition<TInput, TSchema, TPrepared>, "provider" | "tool" | "approval"> & {
|
|
235
|
+
/** Defaults to vercelScheduleProvider(): hosted production scheduling, process-local storage in eve dev. */
|
|
236
|
+
readonly provider?: ScheduleProvider;
|
|
237
|
+
} & ({
|
|
238
|
+
readonly tool: false;
|
|
239
|
+
readonly approval?: never;
|
|
240
|
+
} | {
|
|
241
|
+
readonly tool?: true;
|
|
242
|
+
readonly approval?: ScheduleApprovals<NoInfer<TPrepared>>;
|
|
243
|
+
});
|
|
244
|
+
/**
|
|
245
|
+
* Defines a dynamic schedule subscription. Export it from `agent/schedules/`;
|
|
246
|
+
* identity comes from the module path. inputSchema validates caller input,
|
|
247
|
+
* while eve captures creator identity separately and re-resolves it on every attempt.
|
|
248
|
+
* `run` chooses destinations and starts work; no creation conversation is implicitly captured.
|
|
249
|
+
* Provider defaults to vercelScheduleProvider(); pass provider explicitly to select another backend.
|
|
250
|
+
* The default supports Vercel production and eve dev, not preview or self-hosted scheduling.
|
|
251
|
+
*/
|
|
252
|
+
export declare function defineDynamicSchedules<TInput, TPrepared>(definition: Omit<DynamicSchedulesOptions<TInput, StandardSchemaV1<unknown, TInput>, TPrepared>, "preparePayload"> & {
|
|
253
|
+
readonly preparePayload: (payload: TInput, context: ScheduleScopeContext & {
|
|
254
|
+
readonly operation: "create";
|
|
255
|
+
readonly name: string;
|
|
256
|
+
}) => TPrepared | Promise<TPrepared>;
|
|
257
|
+
}): DefinedDynamicSchedules<TInput, StandardSchemaV1<unknown, TInput>, TPrepared>;
|
|
258
|
+
export declare function defineDynamicSchedules<TSchema extends StandardSchemaV1<unknown, unknown>>(definition: ExactDefinition<DynamicSchedulesOptions<StandardSchemaV1.InferOutput<TSchema>, TSchema>, DynamicSchedulesOptions<StandardSchemaV1.InferOutput<TSchema>, TSchema>>): DefinedDynamicSchedules<StandardSchemaV1.InferOutput<TSchema>, TSchema>;
|
|
259
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{SCHEDULE_COLLECTION_DEFINITION_BRAND}from"#shared/schedule-collection-definition.js";import{vercelScheduleProvider}from"#public/schedules/providers/vercel.js";function defineDynamicSchedules(e){return Object.assign(e,{provider:e.provider??vercelScheduleProvider(),tool:e.tool??!0,[SCHEDULE_COLLECTION_DEFINITION_BRAND]:!0}),e}export{defineDynamicSchedules};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { inMemoryScheduleProvider, type InMemoryScheduleProviderOptions, } from "#public/schedules/providers/in-memory.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{inMemoryScheduleProvider}from"#public/schedules/providers/in-memory.js";export{inMemoryScheduleProvider};
|
|
@@ -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,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.74.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__",
|
|
@@ -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};
|
|
@@ -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};
|
|
@@ -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-mP0M7SrL.js";
|
|
2
2
|
|
|
3
3
|
//#region src/client/tool-call-state.ts
|
|
4
4
|
function toolCallState(conversation, callId, options = {}) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{frameworkTool}from"#tools/provided/framework-tool.js";import{
|
|
1
|
+
import{frameworkTool}from"#tools/provided/framework-tool.js";import{stampToolDefinition}from"#tools/definition.js";import{AGENT_TOOL_DESCRIPTION,SUBAGENT_TOOL_INPUT_SCHEMA}from"#tools/framework/agent-contract.js";import{attachToolBehavior}from"#tools/behavior.js";const agent=attachToolBehavior(frameworkTool(stampToolDefinition({description:AGENT_TOOL_DESCRIPTION,inputSchema:SUBAGENT_TOOL_INPUT_SCHEMA,execute(){throw Error(`The framework "agent" tool was executed directly. It must be resolved through the runtime tool registry, which dispatches it to the shared subagent workflow.`)}},`defineTool`)),{availability:[`root-session`],handling:{action:`self-agent`,kind:`dispatch`}});export{agent,agent as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
async function executeAskQuestionTool(e,t){"use workflow";return toAskQuestionOutput(await t.ask(toAskQuestionRequest(e)))}function toAskQuestionRequest(e){let t=e.options?.map(e=>({description:e.description,id:e.label,label:e.label}));return{allowFreeform:!0,display:t===void 0?`text`:`select`,prompt:e.question,...t!==void 0&&{options:t}}}function toAskQuestionOutput(e){switch(e.status){case`answered`:return{answer:e.optionId??e.text??``,status:`answered`};case`cancelled`:return{interrupted:!0};case`unavailable`:return{status:`unavailable`}}}executeAskQuestionTool.workflowId=`workflow//eve@0.
|
|
1
|
+
async function executeAskQuestionTool(e,t){"use workflow";return toAskQuestionOutput(await t.ask(toAskQuestionRequest(e)))}function toAskQuestionRequest(e){let t=e.options?.map(e=>({description:e.description,id:e.label,label:e.label}));return{allowFreeform:!0,display:t===void 0?`text`:`select`,prompt:e.question,...t!==void 0&&{options:t}}}function toAskQuestionOutput(e){switch(e.status){case`answered`:return{answer:e.optionId??e.text??``,status:`answered`};case`cancelled`:return{interrupted:!0};case`unavailable`:return{status:`unavailable`}}}executeAskQuestionTool.workflowId=`workflow//eve@0.74.0//executeAskQuestionTool`;export{executeAskQuestionTool,toAskQuestionOutput,toAskQuestionRequest};
|