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.
Files changed (469) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/dist/src/_virtual/_rolldown/runtime.js +1 -1
  3. package/dist/src/channel/auth/result.d.ts +4 -0
  4. package/dist/src/channel/auth/result.js +1 -0
  5. package/dist/src/channel/schedule.d.ts +20 -6
  6. package/dist/src/channel/schedule.js +1 -1
  7. package/dist/src/channel/types.d.ts +18 -2
  8. package/dist/src/chunks/{use-eve-agent-hZJ7CB8t.js → use-eve-agent-B2Kne9z6.js} +20 -5
  9. package/dist/src/chunks/{use-eve-agent-C1GYGCtb.js → use-eve-agent-DK_T88EP.js} +20 -5
  10. package/dist/src/cli/commands/integration-connect.d.ts +2 -0
  11. package/dist/src/cli/commands/integration-connect.js +1 -1
  12. package/dist/src/cli/commands/integration-setup.js +1 -1
  13. package/dist/src/cli/commands/registry-declared-setups.d.ts +19 -0
  14. package/dist/src/cli/commands/registry-declared-setups.js +1 -1
  15. package/dist/src/cli/commands/registry-recovery.d.ts +3 -1
  16. package/dist/src/cli/commands/registry-recovery.js +1 -1
  17. package/dist/src/cli/commands/registry.d.ts +12 -4
  18. package/dist/src/cli/commands/registry.js +1 -1
  19. package/dist/src/cli/dev/tui/registry-result-message.js +1 -1
  20. package/dist/src/cli/dev/tui/setup-commands.d.ts +2 -0
  21. package/dist/src/cli/dev/tui/setup-commands.js +2 -2
  22. package/dist/src/cli/dev/tui/stream-format.js +2 -2
  23. package/dist/src/client/index.d.ts +1 -0
  24. package/dist/src/client/message-reducer.js +1 -1
  25. package/dist/src/client/session.d.ts +1 -1
  26. package/dist/src/client/session.js +1 -1
  27. package/dist/src/client/sessions.d.ts +1 -1
  28. package/dist/src/client/types.d.ts +6 -0
  29. package/dist/src/compiled/.vendor-stamp.json +2 -1
  30. package/dist/src/compiled/@vercel/schedules/index.d.ts +158 -0
  31. package/dist/src/compiled/@vercel/schedules/index.js +17 -0
  32. package/dist/src/compiler/extension-compatibility.d.ts +24 -18
  33. package/dist/src/compiler/extension-compatibility.js +1 -1
  34. package/dist/src/compiler/load-binding-namespace.d.ts +5 -0
  35. package/dist/src/compiler/load-binding-namespace.js +1 -1
  36. package/dist/src/compiler/manifest.d.ts +39 -0
  37. package/dist/src/compiler/manifest.js +1 -1
  38. package/dist/src/compiler/memory-wrapper-candidates.d.ts +2 -0
  39. package/dist/src/compiler/memory-wrapper-candidates.js +1 -0
  40. package/dist/src/compiler/module-lifecycle.d.ts +1 -1
  41. package/dist/src/compiler/module-lifecycle.js +1 -1
  42. package/dist/src/compiler/module-map.js +1 -1
  43. package/dist/src/compiler/normalize-agent-config.js +1 -1
  44. package/dist/src/compiler/normalize-manifest.js +1 -1
  45. package/dist/src/compiler/normalize-schedule-collection.d.ts +3 -0
  46. package/dist/src/compiler/normalize-schedule-collection.js +1 -0
  47. package/dist/src/compiler/normalize-schedule.d.ts +2 -2
  48. package/dist/src/compiler/normalize-schedule.js +1 -1
  49. package/dist/src/compiler/resolve-workspace-subagent.js +1 -1
  50. package/dist/src/compiler/schedule-collection-wrapper-candidates.d.ts +2 -0
  51. package/dist/src/compiler/schedule-collection-wrapper-candidates.js +1 -0
  52. package/dist/src/compiler/validate-artifact.js +1 -1
  53. package/dist/src/context/build-callback-context.js +1 -1
  54. package/dist/src/context/dynamic-connection-lifecycle.d.ts +6 -0
  55. package/dist/src/context/dynamic-connection-lifecycle.js +1 -1
  56. package/dist/src/context/dynamic-resolve-context.js +1 -1
  57. package/dist/src/context/key-names.d.ts +1 -0
  58. package/dist/src/context/key-names.js +1 -1
  59. package/dist/src/context/keys.d.ts +6 -1
  60. package/dist/src/context/keys.js +1 -1
  61. package/dist/src/context/providers/sandbox.js +1 -1
  62. package/dist/src/context/providers/tool-stubs-key.d.ts +8 -0
  63. package/dist/src/context/providers/tool-stubs-key.js +1 -0
  64. package/dist/src/context/providers/tool-stubs.d.ts +10 -0
  65. package/dist/src/context/providers/tool-stubs.js +1 -0
  66. package/dist/src/context/run-step.js +1 -1
  67. package/dist/src/context/schedule-collection-tools.d.ts +9 -0
  68. package/dist/src/context/schedule-collection-tools.js +1 -0
  69. package/dist/src/context/session-context.d.ts +4 -1
  70. package/dist/src/context/session-schedule.d.ts +9 -0
  71. package/dist/src/context/session-schedule.js +1 -0
  72. package/dist/src/dynamic/definition.d.ts +1 -0
  73. package/dist/src/evals/index.d.ts +1 -0
  74. package/dist/src/evals/runner/execute-task.js +1 -1
  75. package/dist/src/evals/session-manager.d.ts +2 -0
  76. package/dist/src/evals/session-manager.js +1 -1
  77. package/dist/src/eve-channel/create-request.d.ts +2 -0
  78. package/dist/src/eve-channel/index.js +1 -1
  79. package/dist/src/eve-channel/request.js +1 -1
  80. package/dist/src/execution/agent-sessions/context.d.ts +4 -0
  81. package/dist/src/execution/agent-sessions/context.js +1 -1
  82. package/dist/src/execution/agent-sessions/steps.js +1 -1
  83. package/dist/src/execution/cancelled-model-call-batch.js +1 -1
  84. package/dist/src/execution/dynamic-connection-recovery.d.ts +14 -0
  85. package/dist/src/execution/dynamic-connection-recovery.js +1 -0
  86. package/dist/src/execution/dynamic-workflow/tool.js +1 -1
  87. package/dist/src/execution/forward-session-input.js +1 -1
  88. package/dist/src/execution/legacy-session/authorization.js +1 -1
  89. package/dist/src/execution/legacy-session/completion-step.js +1 -1
  90. package/dist/src/execution/legacy-session/inbox.js +1 -1
  91. package/dist/src/execution/legacy-session/interrupt-step.js +1 -1
  92. package/dist/src/execution/proxied-deliver-step.js +1 -1
  93. package/dist/src/execution/runtime-context.js +1 -1
  94. package/dist/src/execution/sandbox/bindings/docker.js +1 -1
  95. package/dist/src/execution/sandbox/bindings/just-bash-runtime.js +1 -1
  96. package/dist/src/execution/sandbox/bindings/just-bash.js +1 -1
  97. package/dist/src/execution/sandbox/bindings/microsandbox-lifecycle.js +1 -1
  98. package/dist/src/execution/sandbox/bindings/vercel.js +1 -1
  99. package/dist/src/execution/sandbox/ensure.d.ts +3 -1
  100. package/dist/src/execution/sandbox/ensure.js +1 -1
  101. package/dist/src/execution/session/active-turn.js +1 -1
  102. package/dist/src/execution/session/admission.js +1 -1
  103. package/dist/src/execution/session/checkpoint-migrations.js +1 -1
  104. package/dist/src/execution/session/end-sandbox-step.d.ts +12 -0
  105. package/dist/src/execution/session/end-sandbox-step.js +1 -0
  106. package/dist/src/execution/session/entry.js +1 -1
  107. package/dist/src/execution/session/finalization.js +1 -1
  108. package/dist/src/execution/session/handoff-steps.js +1 -1
  109. package/dist/src/execution/session/handoff.d.ts +1 -1
  110. package/dist/src/execution/session/handoff.js +1 -1
  111. package/dist/src/execution/session/program.js +1 -1
  112. package/dist/src/execution/session/timeout-steps.js +1 -1
  113. package/dist/src/execution/session/turn-step.js +1 -1
  114. package/dist/src/execution/session/turn.js +1 -1
  115. package/dist/src/execution/session-inbox/inbox.d.ts +6 -1
  116. package/dist/src/execution/session-inbox/inbox.js +1 -1
  117. package/dist/src/execution/session-inbox/protocol.js +1 -1
  118. package/dist/src/execution/session-inbox/release-step.js +1 -1
  119. package/dist/src/execution/session-inbox/resume.d.ts +2 -1
  120. package/dist/src/execution/session-inbox/resume.js +1 -1
  121. package/dist/src/execution/session-workflow-tool-run.js +1 -1
  122. package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
  123. package/dist/src/execution/tasks/model-step.js +1 -1
  124. package/dist/src/execution/tasks/steps.js +1 -1
  125. package/dist/src/execution/tasks/table.d.ts +7 -1
  126. package/dist/src/execution/tasks/table.js +1 -1
  127. package/dist/src/execution/tool-stubs/playback.d.ts +11 -0
  128. package/dist/src/execution/tool-stubs/playback.js +1 -0
  129. package/dist/src/execution/tool-stubs/steps.d.ts +18 -0
  130. package/dist/src/execution/tool-stubs/steps.js +1 -0
  131. package/dist/src/execution/tools/agent-router-workflow.js +1 -1
  132. package/dist/src/execution/tools/connection-tools.d.ts +0 -6
  133. package/dist/src/execution/tools/connection-tools.js +2 -2
  134. package/dist/src/execution/tools/workflow/authorization-completion.js +1 -1
  135. package/dist/src/execution/tools/workflow/body.js +1 -1
  136. package/dist/src/execution/tools/workflow/serve.js +1 -1
  137. package/dist/src/execution/tools/workflow/withdraw-step.js +1 -1
  138. package/dist/src/execution/workflow-runtime.js +1 -1
  139. package/dist/src/execution/workflow-webhook-route.js +1 -1
  140. package/dist/src/framework/sources/modules/schedule-collection-wrapper.d.ts +2 -0
  141. package/dist/src/framework/sources/modules/schedule-collection-wrapper.js +1 -0
  142. package/dist/src/framework/sources/registry.d.ts +1 -0
  143. package/dist/src/framework/sources/registry.js +1 -1
  144. package/dist/src/harness/compaction/step.js +1 -1
  145. package/dist/src/harness/coordination.js +1 -1
  146. package/dist/src/harness/emission.d.ts +1 -0
  147. package/dist/src/harness/emission.js +1 -1
  148. package/dist/src/harness/hitl/approved-calls.d.ts +2 -0
  149. package/dist/src/harness/hitl/approved-calls.js +1 -1
  150. package/dist/src/harness/hitl/index.d.ts +9 -1
  151. package/dist/src/harness/hitl/index.js +1 -1
  152. package/dist/src/harness/hitl/intake.js +1 -1
  153. package/dist/src/harness/model-call/call.d.ts +5 -0
  154. package/dist/src/harness/model-call/call.js +1 -1
  155. package/dist/src/harness/model-call/run.js +1 -1
  156. package/dist/src/harness/proxy-input-requests.d.ts +17 -6
  157. package/dist/src/harness/proxy-input-requests.js +1 -1
  158. package/dist/src/harness/session-machine/current.d.ts +4 -0
  159. package/dist/src/harness/session-machine/current.js +1 -1
  160. package/dist/src/harness/session-machine/transitions.d.ts +13 -0
  161. package/dist/src/harness/session-machine/transitions.js +1 -1
  162. package/dist/src/harness/step/after-model.js +1 -1
  163. package/dist/src/harness/step/context.d.ts +7 -2
  164. package/dist/src/harness/step/context.js +1 -1
  165. package/dist/src/harness/stream-actions.d.ts +6 -1
  166. package/dist/src/harness/stream-actions.js +1 -1
  167. package/dist/src/harness/tool-call-io.js +1 -1
  168. package/dist/src/harness/tool-loop.js +1 -1
  169. package/dist/src/harness/tools.js +1 -1
  170. package/dist/src/instrumentation/ai-sdk-hook-bridge.js +1 -1
  171. package/dist/src/instrumentation/lifecycle.d.ts +1 -0
  172. package/dist/src/internal/application/package.js +1 -1
  173. package/dist/src/internal/authored-definition/schedule-collection.d.ts +2 -0
  174. package/dist/src/internal/authored-definition/schedule-collection.js +1 -0
  175. package/dist/src/internal/authored-definition/schema-backed.js +1 -1
  176. package/dist/src/internal/authored-module-loader.d.ts +7 -0
  177. package/dist/src/internal/authored-module-loader.js +2 -2
  178. package/dist/src/internal/authored-module-map-loader.js +1 -1
  179. package/dist/src/internal/authored-runtime-modules.d.ts +1 -0
  180. package/dist/src/internal/authored-runtime-modules.js +1 -1
  181. package/dist/src/internal/invocation/workflow-execution.js +1 -1
  182. package/dist/src/internal/nitro/development-generation.js +1 -1
  183. package/dist/src/internal/nitro/host/configure-nitro-routes.js +2 -2
  184. package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
  185. package/dist/src/internal/nitro/host/extension-capability-requirements.js +1 -1
  186. package/dist/src/internal/nitro/host/vercel-build-output-config.d.ts +12 -0
  187. package/dist/src/internal/nitro/host/vercel-build-output-config.js +1 -1
  188. package/dist/src/internal/nitro/routes/channel-dispatch.js +1 -1
  189. package/dist/src/internal/nitro/routes/schedule-collection-consumer.d.ts +3 -0
  190. package/dist/src/internal/nitro/routes/schedule-collection-consumer.js +1 -0
  191. package/dist/src/internal/schedules/consumer-route.d.ts +17 -0
  192. package/dist/src/internal/schedules/consumer-route.js +1 -0
  193. package/dist/src/internal/schedules/verify-delivery.d.ts +25 -0
  194. package/dist/src/internal/schedules/verify-delivery.js +1 -0
  195. package/dist/src/internal/workflow/cancel-expired-development-run.js +1 -1
  196. package/dist/src/internal/workflow-bundle/workflow-builders.js +1 -1
  197. package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/cli-config.js +1 -0
  198. package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/cred-storage.js +1 -0
  199. package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/index.js +1 -0
  200. package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/schema.js +1 -0
  201. package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/schema.zod.js +1 -0
  202. package/dist/src/node_modules/.pnpm/@vercel_cli-config@0.2.0/node_modules/@vercel/cli-config/dist/types.js +1 -0
  203. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/envpath.js +1 -0
  204. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/errors.js +2 -0
  205. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/errutils.js +1 -0
  206. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/exec.js +1 -0
  207. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/fsutils.js +1 -0
  208. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/index.js +1 -0
  209. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/lookup.js +1 -0
  210. package/dist/src/node_modules/.pnpm/@vercel_cli-exec@1.0.0/node_modules/@vercel/cli-exec/dist/safety.js +1 -0
  211. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/auth-errors.js +1 -0
  212. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/exchange-vercel-oidc-token.js +1 -0
  213. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/get-context.js +1 -0
  214. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/get-vercel-oidc-token-sync.js +1 -0
  215. 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
  216. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/index.js +1 -0
  217. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/oauth.js +1 -0
  218. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/token-error.js +1 -0
  219. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/token-io.js +1 -0
  220. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/token-util.js +2 -0
  221. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/token.js +1 -0
  222. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/verify-vercel-oidc-token.js +1 -0
  223. package/dist/src/node_modules/.pnpm/@vercel_oidc@3.8.0/node_modules/@vercel/oidc/dist/version.js +1 -0
  224. 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
  225. package/dist/src/node_modules/.pnpm/balanced-match@4.0.4/node_modules/balanced-match/dist/esm/index.js +1 -0
  226. package/dist/src/node_modules/.pnpm/brace-expansion@5.0.12/node_modules/brace-expansion/dist/esm/index.js +1 -0
  227. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js +1 -0
  228. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js +1 -0
  229. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js +1 -0
  230. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js +1 -0
  231. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js +1 -0
  232. package/dist/src/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js +1 -0
  233. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/index.js +1 -0
  234. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/command.js +1 -0
  235. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/error.js +2 -0
  236. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/kill.js +1 -0
  237. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/promise.js +1 -0
  238. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/stdio.js +1 -0
  239. package/dist/src/node_modules/.pnpm/execa@5.1.1/node_modules/execa/lib/stream.js +1 -0
  240. package/dist/src/node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/buffer-stream.js +1 -0
  241. package/dist/src/node_modules/.pnpm/get-stream@6.0.1/node_modules/get-stream/index.js +1 -0
  242. package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/core.js +1 -0
  243. package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/main.js +1 -0
  244. package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/realtime.js +1 -0
  245. package/dist/src/node_modules/.pnpm/human-signals@2.1.0/node_modules/human-signals/build/src/signals.js +1 -0
  246. package/dist/src/node_modules/.pnpm/is-stream@2.0.1/node_modules/is-stream/index.js +1 -0
  247. package/dist/src/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js +1 -0
  248. package/dist/src/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js +1 -0
  249. package/dist/src/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js +1 -0
  250. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/index.js +1 -0
  251. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/compact/decrypt.js +1 -0
  252. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/compact/encrypt.js +1 -0
  253. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/flattened/decrypt.js +1 -0
  254. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/flattened/encrypt.js +1 -0
  255. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/general/decrypt.js +1 -0
  256. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwe/general/encrypt.js +1 -0
  257. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwk/embedded.js +1 -0
  258. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwk/thumbprint.js +1 -0
  259. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwks/local.js +1 -0
  260. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwks/remote.js +1 -0
  261. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/compact/sign.js +1 -0
  262. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/compact/verify.js +1 -0
  263. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/flattened/sign.js +1 -0
  264. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/flattened/verify.js +1 -0
  265. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/general/sign.js +1 -0
  266. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jws/general/verify.js +1 -0
  267. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/decrypt.js +1 -0
  268. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/encrypt.js +1 -0
  269. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/produce.js +1 -0
  270. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/sign.js +1 -0
  271. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/unsecured.js +1 -0
  272. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/jwt/verify.js +1 -0
  273. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/export.js +1 -0
  274. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/generate_key_pair.js +1 -0
  275. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/generate_secret.js +1 -0
  276. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/key/import.js +1 -0
  277. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/aesgcmkw.js +1 -0
  278. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/buffer_utils.js +1 -0
  279. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/cek.js +1 -0
  280. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/check_iv_length.js +1 -0
  281. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/check_key_type.js +1 -0
  282. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/check_p2s.js +1 -0
  283. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/crypto_key.js +1 -0
  284. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/decrypt_key_management.js +1 -0
  285. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/encrypt_key_management.js +1 -0
  286. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/epoch.js +1 -0
  287. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/invalid_key_input.js +1 -0
  288. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/is_disjoint.js +1 -0
  289. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/is_jwk.js +1 -0
  290. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/is_object.js +1 -0
  291. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/iv.js +1 -0
  292. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/jwt_claims_set.js +1 -0
  293. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/private_symbols.js +1 -0
  294. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/secs.js +1 -0
  295. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/validate_algorithms.js +1 -0
  296. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/lib/validate_crit.js +1 -0
  297. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/aeskw.js +1 -0
  298. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/asn1.js +1 -0
  299. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/base64url.js +1 -0
  300. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/cbc_tag.js +1 -0
  301. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/check_cek_length.js +1 -0
  302. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/check_key_length.js +1 -0
  303. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/ciphers.js +1 -0
  304. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/decrypt.js +1 -0
  305. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/digest.js +1 -0
  306. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/dsa_digest.js +1 -0
  307. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/ecdhes.js +1 -0
  308. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/encrypt.js +1 -0
  309. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/fetch_jwks.js +1 -0
  310. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/generate.js +1 -0
  311. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/get_named_curve.js +1 -0
  312. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/get_sign_verify_key.js +1 -0
  313. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/hmac_digest.js +1 -0
  314. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/is_key_like.js +1 -0
  315. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/is_key_object.js +1 -0
  316. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/jwk_to_key.js +1 -0
  317. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/key_to_jwk.js +1 -0
  318. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/node_key.js +1 -0
  319. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/normalize_key.js +1 -0
  320. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/pbes2kw.js +1 -0
  321. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/random.js +1 -0
  322. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/rsaes.js +1 -0
  323. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/runtime.js +1 -0
  324. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/sign.js +1 -0
  325. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/timing_safe_equal.js +1 -0
  326. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/verify.js +1 -0
  327. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/runtime/webcrypto.js +1 -0
  328. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/base64url.js +1 -0
  329. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/decode_jwt.js +1 -0
  330. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/decode_protected_header.js +1 -0
  331. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/errors.js +1 -0
  332. package/dist/src/node_modules/.pnpm/jose@5.10.0/node_modules/jose/dist/node/cjs/util/runtime.js +1 -0
  333. package/dist/src/node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js +1 -0
  334. package/dist/src/node_modules/.pnpm/mimic-fn@2.1.0/node_modules/mimic-fn/index.js +1 -0
  335. package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/assert-valid-pattern.js +1 -0
  336. package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/ast.js +1 -0
  337. package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/brace-expressions.js +1 -0
  338. package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/escape.js +1 -0
  339. package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/index.js +1 -0
  340. package/dist/src/node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/unescape.js +1 -0
  341. package/dist/src/node_modules/.pnpm/mixpart@0.0.6/node_modules/mixpart/dist/index.js +7 -0
  342. package/dist/src/node_modules/.pnpm/npm-run-path@4.0.1/node_modules/npm-run-path/index.js +1 -0
  343. package/dist/src/node_modules/.pnpm/onetime@5.1.2/node_modules/onetime/index.js +1 -0
  344. package/dist/src/node_modules/.pnpm/os-paths@4.4.0/node_modules/os-paths/src/lib/index.js +1 -0
  345. package/dist/src/node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js +1 -0
  346. package/dist/src/node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js +1 -0
  347. package/dist/src/node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js +1 -0
  348. package/dist/src/node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js +1 -0
  349. package/dist/src/node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js +1 -0
  350. package/dist/src/node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/signals.js +1 -0
  351. package/dist/src/node_modules/.pnpm/strip-final-newline@2.0.0/node_modules/strip-final-newline/index.js +2 -0
  352. package/dist/src/node_modules/.pnpm/which@2.0.2/node_modules/which/which.js +1 -0
  353. package/dist/src/node_modules/.pnpm/xdg-app-paths@5.5.1/node_modules/xdg-app-paths/src/lib/index.js +1 -0
  354. package/dist/src/node_modules/.pnpm/xdg-portable@7.3.0/node_modules/xdg-portable/src/lib/index.js +1 -0
  355. package/dist/src/protocol/routes.d.ts +4 -0
  356. package/dist/src/protocol/routes.js +1 -1
  357. package/dist/src/public/channels/auth.d.ts +21 -4
  358. package/dist/src/public/channels/auth.js +1 -1
  359. package/dist/src/public/channels/mcp.js +1 -1
  360. package/dist/src/public/channels/slack/index.d.ts +1 -0
  361. package/dist/src/public/channels/slack/index.js +1 -1
  362. package/dist/src/public/experimental/schedules/client.d.ts +7 -0
  363. package/dist/src/public/experimental/schedules/client.js +1 -0
  364. package/dist/src/public/experimental/schedules/index.d.ts +5 -0
  365. package/dist/src/public/experimental/schedules/index.js +1 -0
  366. package/dist/src/public/experimental/schedules/testing.d.ts +2 -0
  367. package/dist/src/public/experimental/schedules/testing.js +1 -0
  368. package/dist/src/public/experimental/schedules/vercel.d.ts +2 -0
  369. package/dist/src/public/experimental/schedules/vercel.js +1 -0
  370. package/dist/src/public/memory/scope.js +1 -1
  371. package/dist/src/public/schedules/provider-types.d.ts +16 -0
  372. package/dist/src/public/schedules/provider-types.js +1 -0
  373. package/dist/src/public/schedules/providers/in-memory.d.ts +5 -0
  374. package/dist/src/public/schedules/providers/in-memory.js +1 -0
  375. package/dist/src/public/schedules/providers/vercel.d.ts +10 -0
  376. package/dist/src/public/schedules/providers/vercel.js +1 -0
  377. package/dist/src/public/schedules/scope.d.ts +2 -0
  378. package/dist/src/public/schedules/scope.js +1 -0
  379. package/dist/src/public/schedules/subscription.d.ts +258 -0
  380. package/dist/src/public/schedules/subscription.js +1 -0
  381. package/dist/src/public/schedules/testing.d.ts +1 -0
  382. package/dist/src/public/schedules/testing.js +1 -0
  383. package/dist/src/runtime/schedules/collection-client.d.ts +20 -0
  384. package/dist/src/runtime/schedules/collection-client.js +1 -0
  385. package/dist/src/runtime/schedules/dispatch-occurrence.d.ts +12 -0
  386. package/dist/src/runtime/schedules/dispatch-occurrence.js +1 -0
  387. package/dist/src/runtime/schedules/load-collection.d.ts +14 -0
  388. package/dist/src/runtime/schedules/load-collection.js +1 -0
  389. package/dist/src/runtime/schedules/payload.d.ts +24 -0
  390. package/dist/src/runtime/schedules/payload.js +1 -0
  391. package/dist/src/runtime/schedules/provider-types.d.ts +1 -0
  392. package/dist/src/runtime/schedules/provider-types.js +1 -0
  393. package/dist/src/runtime/schedules/queue-namespace.d.ts +2 -0
  394. package/dist/src/runtime/schedules/queue-namespace.js +1 -0
  395. package/dist/src/runtime/schedules/record.d.ts +4 -0
  396. package/dist/src/runtime/schedules/record.js +1 -0
  397. package/dist/src/runtime/schedules/validation.d.ts +6 -0
  398. package/dist/src/runtime/schedules/validation.js +1 -0
  399. package/dist/src/runtime/sessions/runtime-context-keys.js +1 -1
  400. package/dist/src/sandbox/state.d.ts +1 -0
  401. package/dist/src/self-modification/extension/subagents/agent/instructions.js +1 -1
  402. package/dist/src/self-modification/extension/subagents/agent/tools/registry_add.js +1 -1
  403. package/dist/src/setup/flows/registry-session.d.ts +10 -2
  404. package/dist/src/setup/flows/registry-session.js +1 -1
  405. package/dist/src/setup/flows/registry.d.ts +2 -0
  406. package/dist/src/setup/flows/registry.js +1 -1
  407. package/dist/src/setup/integrations/shared/prerequisite.d.ts +8 -0
  408. package/dist/src/setup/integrations/shared/prerequisite.js +1 -1
  409. package/dist/src/setup/registry-setup-client.js +1 -1
  410. package/dist/src/setup/scaffold/create/project.js +1 -1
  411. package/dist/src/setup/scaffold/index.js +1 -1
  412. package/dist/src/setup/vercel-project.d.ts +1 -2
  413. package/dist/src/setup/vercel-project.js +0 -0
  414. package/dist/src/shared/principal-scope.d.ts +2 -0
  415. package/dist/src/shared/principal-scope.js +1 -0
  416. package/dist/src/shared/sandbox-provider.d.ts +9 -2
  417. package/dist/src/shared/schedule-collection-definition.d.ts +11 -0
  418. package/dist/src/shared/schedule-collection-definition.js +1 -0
  419. package/dist/src/shared/schedule-collection-tools.d.ts +1 -0
  420. package/dist/src/shared/schedule-collection-tools.js +1 -0
  421. package/dist/src/subagents/adapter.d.ts +3 -2
  422. package/dist/src/subagents/adapter.js +1 -1
  423. package/dist/src/subagents/callback-route.js +1 -1
  424. package/dist/src/subagents/hitl-proxy.d.ts +4 -3
  425. package/dist/src/subagents/hitl-proxy.js +1 -1
  426. package/dist/src/subagents/parent-notification.js +1 -1
  427. package/dist/src/subagents/tool.d.ts +1 -0
  428. package/dist/src/subagents/tool.js +1 -1
  429. package/dist/src/svelte/index.js +1 -1
  430. package/dist/src/svelte/use-eve-agent.js +1 -1
  431. package/dist/src/tool-stubs/execute.d.ts +13 -0
  432. package/dist/src/tool-stubs/execute.js +1 -0
  433. package/dist/src/tool-stubs/output.d.ts +4 -0
  434. package/dist/src/tool-stubs/output.js +1 -0
  435. package/dist/src/tool-stubs/playback.d.ts +15 -0
  436. package/dist/src/tool-stubs/playback.js +1 -0
  437. package/dist/src/tool-stubs/rules.d.ts +3 -0
  438. package/dist/src/tool-stubs/rules.js +1 -0
  439. package/dist/src/tool-stubs/schema.d.ts +4 -0
  440. package/dist/src/tool-stubs/schema.js +1 -0
  441. package/dist/src/tool-stubs/target.d.ts +8 -0
  442. package/dist/src/tool-stubs/target.js +1 -0
  443. package/dist/src/tool-stubs/types.d.ts +56 -0
  444. package/dist/src/tool-stubs/types.js +1 -0
  445. package/dist/src/tool-stubs/validate-targets.d.ts +6 -0
  446. package/dist/src/tool-stubs/validate-targets.js +1 -0
  447. package/dist/src/tools/framework/agent.js +1 -1
  448. package/dist/src/tools/provided/ask-question-workflow.js +1 -1
  449. package/dist/src/tools/provided/read-file.js +1 -1
  450. package/dist/src/tools/provided/sleep-workflow.js +1 -1
  451. package/dist/src/tracing/agent-otel-content.d.ts +2 -0
  452. package/dist/src/tracing/agent-otel-content.js +2 -2
  453. package/dist/src/tracing/agent-otel-provider.js +1 -1
  454. package/dist/src/vue/index.js +1 -1
  455. package/dist/src/vue/use-eve-agent.js +1 -1
  456. package/docs/concepts/sessions-runs-and-streaming.md +2 -2
  457. package/docs/evals/meta.json +10 -1
  458. package/docs/evals/overview.mdx +2 -0
  459. package/docs/evals/tool-stubs.mdx +257 -0
  460. package/docs/extensions.md +1 -1
  461. package/docs/guides/auth-and-route-protection.md +25 -0
  462. package/docs/guides/dynamic-capabilities.md +10 -3
  463. package/docs/guides/frontend/nextjs.mdx +17 -4
  464. package/docs/sandbox/index.mdx +10 -2
  465. package/docs/subagents/index.mdx +1 -1
  466. package/docs/tools/human-in-the-loop.md +1 -1
  467. package/docs/tools/overview.mdx +8 -4
  468. package/docs/tools/workflows.mdx +21 -11
  469. package/package.json +22 -2
@@ -220,6 +220,13 @@ export declare class ForbiddenError extends Error {
220
220
  readonly response: Response;
221
221
  constructor(opts?: AuthErrorOptions);
222
222
  }
223
+ export interface AuthResult extends SessionAuthContext {
224
+ /**
225
+ * Set to true to let this authenticated caller create sessions with tool stubs.
226
+ * Callers without this permission cannot supply stubs.
227
+ */
228
+ readonly allowToolStubs?: boolean;
229
+ }
223
230
  /**
224
231
  * Route auth callback. Returned value semantics inside {@link routeAuth}:
225
232
  *
@@ -231,7 +238,7 @@ export declare class ForbiddenError extends Error {
231
238
  * {@link UnauthenticatedError} or {@link ForbiddenError}. To accept anonymous
232
239
  * traffic, include {@link none} as the final entry.
233
240
  */
234
- export type AuthFn<TEvent = Request> = (event: TEvent) => SessionAuthContext | null | undefined | Promise<SessionAuthContext | null | undefined>;
241
+ export type AuthFn<TEvent = Request> = (event: TEvent) => AuthResult | null | undefined | Promise<AuthResult | null | undefined>;
235
242
  /**
236
243
  * OAuth protected-resource metadata attached to an inbound auth policy.
237
244
  * `issuer` is shorthand for a single authorization server.
@@ -297,7 +304,7 @@ export declare function withAuthChallenges<TEvent>(fn: AuthFn<TEvent>, challenge
297
304
  * a custom `defineChannel` route handler) should call `routeAuth` rather than
298
305
  * re-implement the walk.
299
306
  */
300
- export declare function routeAuth(request: Request, auth: AuthFn<Request> | readonly AuthFn<Request>[]): Promise<SessionAuthContext | Response>;
307
+ export declare function routeAuth(request: Request, auth: AuthFn<Request> | readonly AuthFn<Request>[]): Promise<AuthResult | Response>;
301
308
  /**
302
309
  * Returns an {@link AuthFn} for scaffolded apps that makes unfinished
303
310
  * production auth fail as an intentional 401 rather than an internal route
@@ -343,7 +350,7 @@ export declare function none<TEvent = unknown>(): AuthFn<TEvent>;
343
350
  */
344
351
  export declare function localDev(): AuthFn<Request>;
345
352
  /**
346
- * Options for {@link verifyVercelOidc} and {@link vercelOidc}.
353
+ * Options for verifying a Vercel OIDC token with {@link verifyVercelOidc}.
347
354
  */
348
355
  export interface VerifyVercelOidcOptions {
349
356
  /**
@@ -452,13 +459,23 @@ export interface VercelSubjectInput {
452
459
  * not exposed in `sub`. See Vercel's OIDC reference for the token anatomy.
453
460
  */
454
461
  export declare function vercelSubject(input: VercelSubjectInput): string;
462
+ export interface VercelOidcOptions extends Omit<VerifyVercelOidcOptions, "subjects"> {
463
+ /**
464
+ * Additional token subjects allowed to authenticate.
465
+ * To allow stubs, use { subject, allowToolStubs: true } for that subject.
466
+ */
467
+ readonly subjects?: readonly (string | {
468
+ readonly subject: string;
469
+ readonly allowToolStubs?: boolean;
470
+ })[];
471
+ }
455
472
  /**
456
473
  * Returns an HTTP route auth callback backed by Vercel OIDC. See
457
474
  * {@link verifyVercelOidc} for the always-on current-project bypass and how
458
475
  * `subjects` extends acceptance to other Vercel projects. Declares a
459
476
  * `Bearer` {@link withAuthChallenges} challenge for {@link routeAuth}'s 401.
460
477
  */
461
- export declare function vercelOidc(opts?: VerifyVercelOidcOptions): AuthFn<Request>;
478
+ export declare function vercelOidc(opts?: VercelOidcOptions): AuthFn<Request>;
462
479
  /**
463
480
  * Options accepted by {@link httpBasic}.
464
481
  */
@@ -1 +1 @@
1
- import{createLogger}from"#internal/logging.js";import{decodeJwt}from"#compiled/jose/index.js";import{isVercelOidcIssuer}from"#shared/vercel-project.js";import{isLoopbackHostname}from"#shared/network-address.js";import{isEveDevEnvironment}from"#internal/application/dev-environment.js";import{resolveVercelOidcCurrentProject}from"#channel/auth/vercel-oidc-project.js";import{authenticateHttpBasicStrategy}from"#channel/auth/http-basic.js";import{authenticateJwtEcdsaStrategy}from"#channel/auth/jwt-ecdsa.js";import{authenticateJwtHmacStrategy}from"#channel/auth/jwt-hmac.js";import{authenticateOidcStrategy}from"#channel/auth/oidc.js";import{createRuntimeSessionAuthContext}from"#channel/auth/types.js";import{createRuntimeIpAllowList,isRuntimeIpAllowed}from"#channel/ip-allow-list.js";const vercelOidcLog=createLogger(`auth.vercel-oidc`);function verifyHttpBasic(e,t){if(e===null)return{ok:!1};let n=authenticateHttpBasicStrategy({authorization:e,strategy:{kind:`http-basic`,password:t.password,username:t.username}});return n.kind===`authenticated`?{ok:!0,sessionAuth:createRuntimeSessionAuthContext(n.principal)}:{ok:!1}}async function verifyJwtHmac(e,t){if(e===null||e.length===0)return{ok:!1};let n={algorithm:t.algorithm,audiences:[...t.audiences],clockSkewSeconds:t.clockSkewSeconds??30,issuer:t.issuer,kind:`jwt-hmac`,secret:t.secret,...t.claims===void 0?{}:{claims:t.claims},...t.subjects===void 0?{}:{subjects:t.subjects}},r=await authenticateJwtHmacStrategy({strategy:n,token:e});return r.kind===`authenticated`?{ok:!0,sessionAuth:createRuntimeSessionAuthContext(r.principal)}:{ok:!1}}async function verifyJwtEcdsa(e,t){if(e===null||e.length===0)return{ok:!1};let n={algorithm:t.algorithm,audiences:[...t.audiences],clockSkewSeconds:t.clockSkewSeconds??30,issuer:t.issuer,kind:`jwt-ecdsa`,publicKey:t.publicKey,...t.claims===void 0?{}:{claims:t.claims},...t.subjects===void 0?{}:{subjects:t.subjects}},r=await authenticateJwtEcdsaStrategy({strategy:n,token:e});return r.kind===`authenticated`?{ok:!0,sessionAuth:createRuntimeSessionAuthContext(r.principal)}:{ok:!1}}async function verifyOidc(e,t){let n=await runOidcVerification(e,{...t,acceptCurrentVercelProject:!1,currentVercelProject:void 0});return n.kind===`authenticated`?{ok:!0,sessionAuth:createRuntimeSessionAuthContext(n.principal)}:{ok:!1}}async function runOidcVerification(e,t){if(e===null||e.length===0)return{kind:`not-authenticated`};let n={acceptCurrentVercelProject:t.acceptCurrentVercelProject,audiences:[...t.audiences],clockSkewSeconds:t.clockSkewSeconds??30,discoveryUrl:t.discoveryUrl??`${t.issuer.replace(/\/$/,``)}/.well-known/openid-configuration`,issuer:t.issuer,kind:`oidc`,...t.claims===void 0?{}:{claims:t.claims},...t.subjects===void 0?{}:{subjects:t.subjects}},r=t.currentVercelProject===void 0?n:{...n,currentVercelProject:t.currentVercelProject};return await authenticateOidcStrategy({strategy:r,token:e})}function extractBearerToken(e){if(e===null)return null;let t=/^Bearer\s+(.+)$/i.exec(e)?.[1]?.trim();return t===void 0||t.length===0?null:t}function createIpAllowList(e){return createRuntimeIpAllowList(e)}function isIpAllowed(e,t){return e!==null&&isRuntimeIpAllowed(e,t)}function createUnauthorizedResponse(e={}){let t=e.status??401,n=e.code??(t===403?`forbidden`:`unauthorized`),r=e.message??(t===403?`Forbidden.`:`Authorization is required for this route.`),i=e.challenges??[],a=new Headers({"cache-control":`no-store`});for(let e of i)a.append(`www-authenticate`,formatChallenge(e));return Response.json({code:n,error:r,ok:!1},{headers:a,status:t})}function formatChallenge(e){if(e.parameters===void 0||Object.keys(e.parameters).length===0)return e.scheme;let t=Object.entries(e.parameters).map(([e,t])=>`${e}="${escapeAuthChallengeParameter(t)}"`).join(`, `);return`${e.scheme} ${t}`}function escapeAuthChallengeParameter(e){return e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)}function isValidOAuthIdentifierUrl(e){try{let t=new URL(e);return(t.protocol===`https:`||t.protocol===`http:`&&isLoopbackHostname(t.hostname))&&t.username.length===0&&t.password.length===0&&t.search.length===0&&t.hash.length===0}catch{return!1}}function isValidMetadataPath(e){if(!e.startsWith(`/`)||e.startsWith(`//`))return!1;let t=new URL(e,`https://eve.invalid`);return t.origin===`https://eve.invalid`&&t.search.length===0&&t.hash.length===0}var UnauthenticatedError=class extends Error{response;constructor(e={}){super(e.message??`Authorization is required for this route.`),this.name=`UnauthenticatedError`,this.response=createUnauthorizedResponse({...e,status:401})}},ForbiddenError=class extends Error{response;constructor(e={}){super(e.message??`Forbidden.`),this.name=`ForbiddenError`,this.response=createUnauthorizedResponse({...e,status:403})}};const OAUTH_RESOURCE_SYMBOL=Symbol.for(`eve.channels.auth.oauthResource`);function oauthResource(e,t){let n=t.issuer===void 0?t.authorizationServers:[t.issuer];if(n.length===0||n.some(e=>!isValidOAuthIdentifierUrl(e)))throw Error(`oauthResource requires at least one HTTPS authorization server URL (HTTP is allowed only on loopback).`);if(t.resource!==void 0&&!isValidOAuthIdentifierUrl(t.resource))throw Error(`oauthResource resource must be an HTTPS URL without credentials, query, or fragment (HTTP is allowed only on loopback).`);if(t.metadataPath!==void 0&&!isValidMetadataPath(t.metadataPath))throw Error(`oauthResource metadataPath must be an absolute path without a host, query, or fragment.`);let r=Array.isArray(e)?e:[e],composed=async e=>{for(let t of r){let n=await t(e);if(n)return n}return null},i=collectDeclaredChallenges(r),a=withAuthChallenges(composed,i.length>0?i:[{scheme:`Bearer`}]);return Object.defineProperty(a,OAUTH_RESOURCE_SYMBOL,{enumerable:!1,value:t}),a}function readOAuthResourceOptions(e){if(!Array.isArray(e))return e[OAUTH_RESOURCE_SYMBOL]}const AUTH_CHALLENGES_SYMBOL=Symbol.for(`eve.channels.auth.challenges`);function withAuthChallenges(e,t){let wrapped=t=>e(t);return Object.defineProperty(wrapped,AUTH_CHALLENGES_SYMBOL,{value:t}),wrapped}function getDeclaredChallenges(e){return e[AUTH_CHALLENGES_SYMBOL]}function collectDeclaredChallenges(e){let t=new Set,n=[];for(let r of e)for(let e of getDeclaredChallenges(r)??[]){let r=formatChallenge(e);t.has(r)||(t.add(r),n.push(e))}return n}async function routeAuth(e,t){let n=Array.isArray(t)?t:[t];try{for(let t of n){let n=await t(e);if(n)return n}}catch(e){if(typeof e==`object`&&e&&`response`in e&&e.response instanceof Response)return e.response;throw e}let r=collectDeclaredChallenges(n);return createUnauthorizedResponse({challenges:r.length>0?addInvalidBearerTokenError(e,r):[{scheme:`Bearer`}]})}function addInvalidBearerTokenError(e,t){let n=e.headers.get(`authorization`);return n===null||!/^Bearer(?:\s|$)/i.test(n.trim())||!t.some(e=>e.scheme===`Bearer`)?t:t.map(e=>e.scheme!==`Bearer`||e.parameters?.error!==void 0?e:{...e,parameters:{...e.parameters,error:`invalid_token`}})}function placeholderAuth(){return()=>{if(process.env.VERCEL_ENV!==`production`)return null;throw new UnauthenticatedError({code:`eve_production_auth_not_configured`,message:`Production auth is not configured. Replace placeholderAuth() in agent/channels/eve.ts with your app's auth provider.`})}}function none(){return()=>ANONYMOUS_SESSION_AUTH_CONTEXT}function localDev(){return()=>isLocalDevelopmentServer()?LOCAL_DEV_SESSION_AUTH_CONTEXT:null}function isLocalDevelopmentServer(){return process.env.VERCEL&&process.env.VERCEL_ENV===`development`?!0:isEveDevEnvironment()}const ANONYMOUS_SESSION_AUTH_CONTEXT={attributes:{},authenticator:`none`,principalId:`anonymous`,principalType:`anonymous`},LOCAL_DEV_SESSION_AUTH_CONTEXT={attributes:{},authenticator:`local-dev`,principalId:`local-dev`,principalType:`local-dev`};async function verifyVercelOidc(e,t={}){if(e===null||e.length===0)return{ok:!1};let n=decodeUnverifiedJwtClaims(e);if(n===null)return vercelOidcLog.debug(`Rejected token that failed to decode as a JWT.`),{ok:!1};if(!isVercelOidcIssuer(n.issuer))return vercelOidcLog.debug(`Rejected token whose issuer is not a Vercel OIDC issuer.`,{issuer:n.issuer}),{ok:!1};if(n.audiences.length===0)return vercelOidcLog.debug(`Rejected token with no audience claim.`,{issuer:n.issuer}),{ok:!1};if(!n.audiences.some(e=>e.startsWith(`https://vercel.com/`)))return vercelOidcLog.debug(`Rejected token whose audience is not a Vercel audience.`,{audiences:n.audiences,issuer:n.issuer}),{ok:!1};let r=resolveCurrentVercelProject(t),i=await runOidcVerification(e,{acceptCurrentVercelProject:!0,audiences:n.audiences,currentVercelProject:r,issuer:n.issuer,subjects:t.subjects??[]});return i.kind===`authenticated`?(vercelOidcLog.debug(`Accepted Vercel OIDC token.`,{issuer:n.issuer,principalType:i.principal.principalType,subject:i.principal.subject}),{ok:!0,sessionAuth:createRuntimeSessionAuthContext(i.principal)}):(vercelOidcLog.debug(`Rejected Vercel OIDC token after verification.`,{audiences:n.audiences,issuer:n.issuer,reason:i.kind,subjectsConfigured:(t.subjects??[]).length>0,...i.kind===`misconfigured`?{detail:i.message}:{}}),{ok:!1})}function resolveCurrentVercelProject(e){if(e.currentVercelProject!==void 0)return e.currentVercelProject;let t=process.env.VERCEL_PROJECT_ID?.trim();if(t===void 0||t.length===0)return;let n=process.env.VERCEL_TARGET_ENV?.trim()||process.env.VERCEL_ENV?.trim();return n===void 0||n.length===0?{projectId:t}:{environment:n,projectId:t}}function vercelSubject(e){assertVercelSubjectSegment(`teamSlug`,e.teamSlug),assertVercelSubjectSegment(`projectName`,e.projectName);let t=e.environment??`production`;if(t!==`production`&&t!==`preview`&&t!==`development`&&t!==`*`)throw Error(`vercelSubject: invalid environment ${JSON.stringify(t)}; expected "production", "preview", "development", or "*".`);return`owner:${e.teamSlug}:project:${e.projectName}:environment:${t}`}function assertVercelSubjectSegment(e,t){if(t.length===0)throw Error(`vercelSubject: ${e} must be a non-empty string.`);if(t.includes(`*`)||t.includes(`:`))throw Error(`vercelSubject: ${e} ${JSON.stringify(t)} may not contain ${t.includes(`:`)?`':'`:`'*'`}. Hand-write the subject string when wildcards are intentional.`)}function vercelOidc(e={}){return withAuthChallenges(async t=>{let n=extractBearerToken(t.headers.get(`authorization`)),r=e.currentVercelProject??(n!==null&&isLocalDevelopmentVercelOidc()?await resolveVercelOidcCurrentProject(t):void 0),i=await verifyVercelOidc(n,r===void 0?e:{...e,currentVercelProject:r});return i.ok?i.sessionAuth:null},[{scheme:`Bearer`}])}function isLocalDevelopmentVercelOidc(){return process.env.VERCEL_ENV===`development`?!0:process.env.VERCEL_ENV===`preview`||process.env.VERCEL_ENV===`production`?!1:isEveDevEnvironment()}function httpBasic(e,t){return withAuthChallenges(t=>{let n=verifyHttpBasic(t.headers.get(`authorization`),e);return n.ok?n.sessionAuth:null},[{parameters:{realm:t?.realm??`eve`,charset:`UTF-8`},scheme:`Basic`}])}function jwtHmac(e){return withAuthChallenges(async t=>{let n=await verifyJwtHmac(extractBearerToken(t.headers.get(`authorization`)),e);return n.ok?n.sessionAuth:null},[{scheme:`Bearer`}])}function jwtEcdsa(e){return withAuthChallenges(async t=>{let n=await verifyJwtEcdsa(extractBearerToken(t.headers.get(`authorization`)),e);return n.ok?n.sessionAuth:null},[{scheme:`Bearer`}])}function oidc(e){return withAuthChallenges(async t=>{let n=await verifyOidc(extractBearerToken(t.headers.get(`authorization`)),e);return n.ok?n.sessionAuth:null},[{scheme:`Bearer`}])}function decodeUnverifiedJwtClaims(e){let t;try{t=decodeJwt(e)}catch{return null}return typeof t.iss!=`string`||t.iss.length===0?null:{audiences:typeof t.aud==`string`?[t.aud]:Array.isArray(t.aud)?t.aud.filter(e=>typeof e==`string`):[],issuer:t.iss}}export{ForbiddenError,UnauthenticatedError,createIpAllowList,createUnauthorizedResponse,escapeAuthChallengeParameter,extractBearerToken,httpBasic,isIpAllowed,jwtEcdsa,jwtHmac,localDev,none,oauthResource,oidc,placeholderAuth,readOAuthResourceOptions,routeAuth,vercelOidc,vercelSubject,verifyHttpBasic,verifyJwtEcdsa,verifyJwtHmac,verifyOidc,verifyVercelOidc,withAuthChallenges};
1
+ import{createLogger}from"#internal/logging.js";import{decodeJwt}from"#compiled/jose/index.js";import{areTokenClaimMatchersSatisfied}from"#channel/auth/token-claims.js";import{isVercelOidcIssuer}from"#shared/vercel-project.js";import{isLoopbackHostname}from"#shared/network-address.js";import{isEveDevEnvironment}from"#internal/application/dev-environment.js";import{resolveVercelOidcCurrentProject}from"#channel/auth/vercel-oidc-project.js";import{authenticateHttpBasicStrategy}from"#channel/auth/http-basic.js";import{authenticateJwtEcdsaStrategy}from"#channel/auth/jwt-ecdsa.js";import{authenticateJwtHmacStrategy}from"#channel/auth/jwt-hmac.js";import{authenticateOidcStrategy}from"#channel/auth/oidc.js";import{createRuntimeSessionAuthContext}from"#channel/auth/types.js";import{createRuntimeIpAllowList,isRuntimeIpAllowed}from"#channel/ip-allow-list.js";const vercelOidcLog=createLogger(`auth.vercel-oidc`);function verifyHttpBasic(e,t){if(e===null)return{ok:!1};let n=authenticateHttpBasicStrategy({authorization:e,strategy:{kind:`http-basic`,password:t.password,username:t.username}});return n.kind===`authenticated`?{ok:!0,sessionAuth:createRuntimeSessionAuthContext(n.principal)}:{ok:!1}}async function verifyJwtHmac(e,t){if(e===null||e.length===0)return{ok:!1};let n={algorithm:t.algorithm,audiences:[...t.audiences],clockSkewSeconds:t.clockSkewSeconds??30,issuer:t.issuer,kind:`jwt-hmac`,secret:t.secret,...t.claims===void 0?{}:{claims:t.claims},...t.subjects===void 0?{}:{subjects:t.subjects}},r=await authenticateJwtHmacStrategy({strategy:n,token:e});return r.kind===`authenticated`?{ok:!0,sessionAuth:createRuntimeSessionAuthContext(r.principal)}:{ok:!1}}async function verifyJwtEcdsa(e,t){if(e===null||e.length===0)return{ok:!1};let n={algorithm:t.algorithm,audiences:[...t.audiences],clockSkewSeconds:t.clockSkewSeconds??30,issuer:t.issuer,kind:`jwt-ecdsa`,publicKey:t.publicKey,...t.claims===void 0?{}:{claims:t.claims},...t.subjects===void 0?{}:{subjects:t.subjects}},r=await authenticateJwtEcdsaStrategy({strategy:n,token:e});return r.kind===`authenticated`?{ok:!0,sessionAuth:createRuntimeSessionAuthContext(r.principal)}:{ok:!1}}async function verifyOidc(e,t){let n=await runOidcVerification(e,{...t,acceptCurrentVercelProject:!1,currentVercelProject:void 0});return n.kind===`authenticated`?{ok:!0,sessionAuth:createRuntimeSessionAuthContext(n.principal)}:{ok:!1}}async function runOidcVerification(e,t){if(e===null||e.length===0)return{kind:`not-authenticated`};let n={acceptCurrentVercelProject:t.acceptCurrentVercelProject,audiences:[...t.audiences],clockSkewSeconds:t.clockSkewSeconds??30,discoveryUrl:t.discoveryUrl??`${t.issuer.replace(/\/$/,``)}/.well-known/openid-configuration`,issuer:t.issuer,kind:`oidc`,...t.claims===void 0?{}:{claims:t.claims},...t.subjects===void 0?{}:{subjects:t.subjects}},r=t.currentVercelProject===void 0?n:{...n,currentVercelProject:t.currentVercelProject};return await authenticateOidcStrategy({strategy:r,token:e})}function extractBearerToken(e){if(e===null)return null;let t=/^Bearer\s+(.+)$/i.exec(e)?.[1]?.trim();return t===void 0||t.length===0?null:t}function createIpAllowList(e){return createRuntimeIpAllowList(e)}function isIpAllowed(e,t){return e!==null&&isRuntimeIpAllowed(e,t)}function createUnauthorizedResponse(e={}){let t=e.status??401,n=e.code??(t===403?`forbidden`:`unauthorized`),r=e.message??(t===403?`Forbidden.`:`Authorization is required for this route.`),i=e.challenges??[],a=new Headers({"cache-control":`no-store`});for(let e of i)a.append(`www-authenticate`,formatChallenge(e));return Response.json({code:n,error:r,ok:!1},{headers:a,status:t})}function formatChallenge(e){if(e.parameters===void 0||Object.keys(e.parameters).length===0)return e.scheme;let t=Object.entries(e.parameters).map(([e,t])=>`${e}="${escapeAuthChallengeParameter(t)}"`).join(`, `);return`${e.scheme} ${t}`}function escapeAuthChallengeParameter(e){return e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)}function isValidOAuthIdentifierUrl(e){try{let t=new URL(e);return(t.protocol===`https:`||t.protocol===`http:`&&isLoopbackHostname(t.hostname))&&t.username.length===0&&t.password.length===0&&t.search.length===0&&t.hash.length===0}catch{return!1}}function isValidMetadataPath(e){if(!e.startsWith(`/`)||e.startsWith(`//`))return!1;let t=new URL(e,`https://eve.invalid`);return t.origin===`https://eve.invalid`&&t.search.length===0&&t.hash.length===0}var UnauthenticatedError=class extends Error{response;constructor(e={}){super(e.message??`Authorization is required for this route.`),this.name=`UnauthenticatedError`,this.response=createUnauthorizedResponse({...e,status:401})}},ForbiddenError=class extends Error{response;constructor(e={}){super(e.message??`Forbidden.`),this.name=`ForbiddenError`,this.response=createUnauthorizedResponse({...e,status:403})}};const OAUTH_RESOURCE_SYMBOL=Symbol.for(`eve.channels.auth.oauthResource`);function oauthResource(e,t){let n=t.issuer===void 0?t.authorizationServers:[t.issuer];if(n.length===0||n.some(e=>!isValidOAuthIdentifierUrl(e)))throw Error(`oauthResource requires at least one HTTPS authorization server URL (HTTP is allowed only on loopback).`);if(t.resource!==void 0&&!isValidOAuthIdentifierUrl(t.resource))throw Error(`oauthResource resource must be an HTTPS URL without credentials, query, or fragment (HTTP is allowed only on loopback).`);if(t.metadataPath!==void 0&&!isValidMetadataPath(t.metadataPath))throw Error(`oauthResource metadataPath must be an absolute path without a host, query, or fragment.`);let r=Array.isArray(e)?e:[e],composed=async e=>{for(let t of r){let n=await t(e);if(n)return n}return null},i=collectDeclaredChallenges(r),a=withAuthChallenges(composed,i.length>0?i:[{scheme:`Bearer`}]);return Object.defineProperty(a,OAUTH_RESOURCE_SYMBOL,{enumerable:!1,value:t}),a}function readOAuthResourceOptions(e){if(!Array.isArray(e))return e[OAUTH_RESOURCE_SYMBOL]}const AUTH_CHALLENGES_SYMBOL=Symbol.for(`eve.channels.auth.challenges`);function withAuthChallenges(e,t){let wrapped=t=>e(t);return Object.defineProperty(wrapped,AUTH_CHALLENGES_SYMBOL,{value:t}),wrapped}function getDeclaredChallenges(e){return e[AUTH_CHALLENGES_SYMBOL]}function collectDeclaredChallenges(e){let t=new Set,n=[];for(let r of e)for(let e of getDeclaredChallenges(r)??[]){let r=formatChallenge(e);t.has(r)||(t.add(r),n.push(e))}return n}async function routeAuth(e,t){let n=Array.isArray(t)?t:[t];try{for(let t of n){let n=await t(e);if(n)return n}}catch(e){if(typeof e==`object`&&e&&`response`in e&&e.response instanceof Response)return e.response;throw e}let r=collectDeclaredChallenges(n);return createUnauthorizedResponse({challenges:r.length>0?addInvalidBearerTokenError(e,r):[{scheme:`Bearer`}]})}function addInvalidBearerTokenError(e,t){let n=e.headers.get(`authorization`);return n===null||!/^Bearer(?:\s|$)/i.test(n.trim())||!t.some(e=>e.scheme===`Bearer`)?t:t.map(e=>e.scheme!==`Bearer`||e.parameters?.error!==void 0?e:{...e,parameters:{...e.parameters,error:`invalid_token`}})}function placeholderAuth(){return()=>{if(process.env.VERCEL_ENV!==`production`)return null;throw new UnauthenticatedError({code:`eve_production_auth_not_configured`,message:`Production auth is not configured. Replace placeholderAuth() in agent/channels/eve.ts with your app's auth provider.`})}}function none(){return()=>ANONYMOUS_SESSION_AUTH_CONTEXT}function localDev(){return()=>isLocalDevelopmentServer()?LOCAL_DEV_SESSION_AUTH_CONTEXT:null}function isLocalDevelopmentServer(){return process.env.VERCEL&&process.env.VERCEL_ENV===`development`?!0:isEveDevEnvironment()}const ANONYMOUS_SESSION_AUTH_CONTEXT={attributes:{},authenticator:`none`,principalId:`anonymous`,principalType:`anonymous`},LOCAL_DEV_SESSION_AUTH_CONTEXT={attributes:{},authenticator:`local-dev`,principalId:`local-dev`,principalType:`local-dev`};async function verifyVercelOidc(e,t={}){if(e===null||e.length===0)return{ok:!1};let n=decodeUnverifiedJwtClaims(e);if(n===null)return vercelOidcLog.debug(`Rejected token that failed to decode as a JWT.`),{ok:!1};if(!isVercelOidcIssuer(n.issuer))return vercelOidcLog.debug(`Rejected token whose issuer is not a Vercel OIDC issuer.`,{issuer:n.issuer}),{ok:!1};if(n.audiences.length===0)return vercelOidcLog.debug(`Rejected token with no audience claim.`,{issuer:n.issuer}),{ok:!1};if(!n.audiences.some(e=>e.startsWith(`https://vercel.com/`)))return vercelOidcLog.debug(`Rejected token whose audience is not a Vercel audience.`,{audiences:n.audiences,issuer:n.issuer}),{ok:!1};let r=resolveCurrentVercelProject(t),i=await runOidcVerification(e,{acceptCurrentVercelProject:!0,audiences:n.audiences,currentVercelProject:r,issuer:n.issuer,subjects:t.subjects??[]});return i.kind===`authenticated`?(vercelOidcLog.debug(`Accepted Vercel OIDC token.`,{issuer:n.issuer,principalType:i.principal.principalType,subject:i.principal.subject}),{ok:!0,sessionAuth:createRuntimeSessionAuthContext(i.principal)}):(vercelOidcLog.debug(`Rejected Vercel OIDC token after verification.`,{audiences:n.audiences,issuer:n.issuer,reason:i.kind,subjectsConfigured:(t.subjects??[]).length>0,...i.kind===`misconfigured`?{detail:i.message}:{}}),{ok:!1})}function resolveCurrentVercelProject(e){if(e.currentVercelProject!==void 0)return e.currentVercelProject;let t=process.env.VERCEL_PROJECT_ID?.trim();if(t===void 0||t.length===0)return;let n=process.env.VERCEL_TARGET_ENV?.trim()||process.env.VERCEL_ENV?.trim();return n===void 0||n.length===0?{projectId:t}:{environment:n,projectId:t}}function vercelSubject(e){assertVercelSubjectSegment(`teamSlug`,e.teamSlug),assertVercelSubjectSegment(`projectName`,e.projectName);let t=e.environment??`production`;if(t!==`production`&&t!==`preview`&&t!==`development`&&t!==`*`)throw Error(`vercelSubject: invalid environment ${JSON.stringify(t)}; expected "production", "preview", "development", or "*".`);return`owner:${e.teamSlug}:project:${e.projectName}:environment:${t}`}function assertVercelSubjectSegment(e,t){if(t.length===0)throw Error(`vercelSubject: ${e} must be a non-empty string.`);if(t.includes(`*`)||t.includes(`:`))throw Error(`vercelSubject: ${e} ${JSON.stringify(t)} may not contain ${t.includes(`:`)?`':'`:`'*'`}. Hand-write the subject string when wildcards are intentional.`)}function vercelOidc(e={}){let{subjects:t,...n}=e,r={...n,subjects:t?.map(e=>typeof e==`string`?e:e.subject)};return withAuthChallenges(async n=>{let i=extractBearerToken(n.headers.get(`authorization`)),a=e.currentVercelProject??(i!==null&&isLocalDevelopmentVercelOidc()?await resolveVercelOidcCurrentProject(n):void 0),o=await verifyVercelOidc(i,a===void 0?r:{...r,currentVercelProject:a});if(!o.ok)return null;let s=o.sessionAuth;return(s.principalType===`service`||s.principalType===`runtime`)&&t?.some(e=>typeof e!=`string`&&e.allowToolStubs===!0&&areTokenClaimMatchersSatisfied({sub:s.subject},{subjects:[e.subject]}))?{...s,allowToolStubs:!0}:s},[{scheme:`Bearer`}])}function isLocalDevelopmentVercelOidc(){return process.env.VERCEL_ENV===`development`?!0:process.env.VERCEL_ENV===`preview`||process.env.VERCEL_ENV===`production`?!1:isEveDevEnvironment()}function httpBasic(e,t){return withAuthChallenges(t=>{let n=verifyHttpBasic(t.headers.get(`authorization`),e);return n.ok?n.sessionAuth:null},[{parameters:{realm:t?.realm??`eve`,charset:`UTF-8`},scheme:`Basic`}])}function jwtHmac(e){return withAuthChallenges(async t=>{let n=await verifyJwtHmac(extractBearerToken(t.headers.get(`authorization`)),e);return n.ok?n.sessionAuth:null},[{scheme:`Bearer`}])}function jwtEcdsa(e){return withAuthChallenges(async t=>{let n=await verifyJwtEcdsa(extractBearerToken(t.headers.get(`authorization`)),e);return n.ok?n.sessionAuth:null},[{scheme:`Bearer`}])}function oidc(e){return withAuthChallenges(async t=>{let n=await verifyOidc(extractBearerToken(t.headers.get(`authorization`)),e);return n.ok?n.sessionAuth:null},[{scheme:`Bearer`}])}function decodeUnverifiedJwtClaims(e){let t;try{t=decodeJwt(e)}catch{return null}return typeof t.iss!=`string`||t.iss.length===0?null:{audiences:typeof t.aud==`string`?[t.aud]:Array.isArray(t.aud)?t.aud.filter(e=>typeof e==`string`):[],issuer:t.iss}}export{ForbiddenError,UnauthenticatedError,createIpAllowList,createUnauthorizedResponse,escapeAuthChallengeParameter,extractBearerToken,httpBasic,isIpAllowed,jwtEcdsa,jwtHmac,localDev,none,oauthResource,oidc,placeholderAuth,readOAuthResourceOptions,routeAuth,vercelOidc,vercelSubject,verifyHttpBasic,verifyJwtEcdsa,verifyJwtHmac,verifyOidc,verifyVercelOidc,withAuthChallenges};
@@ -1 +1 @@
1
- import{z}from"#compiled/zod/index.js";import{inputRequestSchema,inputResponseSchema}from"#shared/input.js";import{resolveInstalledPackageInfo}from"#internal/application/package.js";import{parseJsonObject}from"#shared/json.js";import{DELETE,GET,HEAD,OPTIONS,POST,defineChannel}from"#public/definitions/channel.js";import{readAgentInfoRouteResponse,readRouteChannelName,readRouteSessionCreator,readSkillFileSource}from"#internal/nitro/routes/channel-route-context.js";import{escapeAuthChallengeParameter,readOAuthResourceOptions,routeAuth}from"#public/channels/auth.js";import{McpToolOperationError,createMcpStreamableHttpServer,defineMcpTool}from"#internal/mcp/streamable-http-server.js";import{WorkflowAgentInvocationExecution}from"#internal/invocation/workflow-execution.js";import{MCP_TOOL_SESSIONS_EXTENSION,createPublishedTools}from"#internal/mcp/published-tools.js";import{resolveMcpRequestPrincipals}from"#internal/mcp/forwarded-principal-header.js";import{createMcpSkillsFeature}from"#internal/mcp/skills.js";import{validateMcpHttpRequest,validateMcpMetadataRequest}from"#internal/mcp/http-security.js";import{createMcpProtectedResourceMetadata,createMcpResourceChallenge}from"#internal/mcp/protected-resource.js";function mcpChannel(e){if(e?.auth===void 0)throw Error(`mcpChannel requires auth. Use none() for explicit public access.`);let t={agent:e.agent??!0,skills:e.skills??!1,tools:e.tools??!1};if(!t.agent&&!t.tools&&!t.skills)throw Error(`mcpChannel publishes nothing with agent, tools, and skills all false. Enable one.`);let n=e.route??`/eve/v1/mcp`,r=readOAuthResourceOptions(e.auth),handle=async(n,i)=>await authenticateMcpRequest(n,i,e,r,t),i=[GET(n,handle),POST(n,handle),DELETE(n,handle)];return r!==void 0&&i.unshift(...protectedResourceMetadataRoutes(r,n)),defineChannel({routes:i})}function protectedResourceMetadataRoutes(e,t){let n=protectedResourceMetadataPath(e,t);return[GET(n,async n=>protectedResourceMetadataResponse(n,e,t,!1)),HEAD(n,async n=>protectedResourceMetadataResponse(n,e,t,!0)),OPTIONS(n,async e=>protectedResourceMetadataOptionsResponse(e))]}function protectedResourceMetadataPath(e,t){if(e.metadataPath!==void 0)return e.metadataPath;let n=e.resource===void 0?t:new URL(e.resource).pathname;return n===`/`?`/.well-known/oauth-protected-resource`:`/.well-known/oauth-protected-resource${n}`}function protectedResourceMetadataResponse(e,t,n,r){let i=validateMcpMetadataRequest(e);if(i!==void 0)return i;let a=t.resource??new URL(n,new URL(e.url).origin).toString(),o=t.issuer===void 0?t.authorizationServers:[t.issuer],s=Response.json(createMcpProtectedResourceMetadata({authorizationServers:o,resource:a,scopesSupported:t.scopes}),{headers:{"access-control-allow-origin":`*`,"cache-control":`no-store`}});return r?new Response(null,{headers:s.headers,status:s.status}):s}function protectedResourceMetadataOptionsResponse(e){let t=validateMcpMetadataRequest(e);if(t!==void 0)return t;let n=new Headers({"access-control-allow-methods":`GET, HEAD, OPTIONS`,"access-control-allow-origin":`*`,"cache-control":`no-store`}),r=e.headers.get(`access-control-request-headers`);return r!==null&&(n.set(`access-control-allow-headers`,r),n.set(`vary`,`Access-Control-Request-Headers`)),new Response(null,{headers:n,status:204})}function addResourceChallenge(e,t,n){if(e.status!==401&&e.status!==403)return e;let r=protectedResourceMetadataPath(n,new URL(t.url).pathname),i=n.resource??new URL(t.url).origin,a=new URL(r,i).toString(),o=new Headers(e.headers),s=o.get(`www-authenticate`);if(e.status===401)o.set(`www-authenticate`,mergeMcpBearerChallenge(s,a,n.scopes));else{let t=augmentInsufficientScopeChallenge(s,a);if(t===void 0)return e;o.set(`www-authenticate`,t)}return new Response(e.body,{headers:o,status:e.status,statusText:e.statusText})}function mergeMcpBearerChallenge(e,t,n){let r=parseAuthChallenges(e),i=r.find(e=>e.scheme.toLowerCase()===`bearer`&&hasAuthParameter(e.value,`error`))??r.find(e=>e.scheme.toLowerCase()===`bearer`);return replaceBearerChallenges(r,i,i===void 0?createMcpResourceChallenge(t,n):augmentBearerChallenge(i.value,t,n))}function augmentInsufficientScopeChallenge(e,t){let n=parseAuthChallenges(e),r=n.find(e=>e.scheme.toLowerCase()===`bearer`&&hasAuthParameter(e.value,`error`,`insufficient_scope`));if(r!==void 0)return replaceBearerChallenges(n,r,augmentBearerChallenge(r.value,t))}function replaceBearerChallenges(e,t,n){let r=[],i=!1;for(let a of e){if(a.scheme.toLowerCase()!==`bearer`){r.push(a.value);continue}!i&&a===t&&(r.push(n),i=!0)}return i||r.push(n),r.join(`, `)}function augmentBearerChallenge(e,t,n){let r=e;return hasAuthParameter(r,`resource_metadata`)||(r=appendAuthParameter(r,`resource_metadata`,t)),n?.length&&!hasAuthParameter(r,`scope`)&&(r=appendAuthParameter(r,`scope`,n.join(` `))),r}function appendAuthParameter(e,t,n){return`${e}${e.trim().toLowerCase()===`bearer`?` `:`, `}${t}="${escapeAuthChallengeParameter(n)}"`}function hasAuthParameter(e,t,n){let r=t.replaceAll(/[.*+?^${}()|[\]\\]/g,`\\$&`);if(n===void 0)return RegExp(`(?:^|[\\s,])${r}\\s*=`,`i`).test(e);let i=n.replaceAll(/[.*+?^${}()|[\]\\]/g,`\\$&`);return RegExp(`(?:^|[\\s,])${r}\\s*=\\s*(?:"${i}"|${i})(?=$|[\\s,])`,`i`).test(e)}function parseAuthChallenges(e){if(e===null)return[];let t=[];for(let n of splitQuotedHeaderList(e)){let e=readChallengeScheme(n);if(e!==void 0){t.push({scheme:e,value:n});continue}let r=t.at(-1);r!==void 0&&(r.value+=`, ${n}`)}return t}function splitQuotedHeaderList(e){let t=[],n=!1,r=!1,i=0;for(let a=0;a<e.length;a++){let o=e[a];if(n)n=!1;else if(o===`\\`)n=!0;else if(o===`"`)r=!r;else if(o===`,`&&!r){let n=e.slice(i,a).trim();n.length>0&&t.push(n),i=a+1}}let a=e.slice(i).trim();return a.length>0&&t.push(a),t}function readChallengeScheme(e){let t=/^([!#$%&'*+\-.^_`|~0-9A-Za-z]+)(?:\s+|$)/.exec(e);if(t===null)return;let n=t[1];if(n!==void 0)return e.slice(n.length).trimStart().startsWith(`=`)?void 0:n}async function authenticateMcpRequest(e,t,n,r,i){let a=validateMcpHttpRequest(e);if(a!==void 0)return a;let o=await routeAuth(e,n.auth);if(o instanceof Response)return r===void 0?o:addResourceChallenge(o,e,r);let s=await resolveMcpRequestPrincipals(e,o,n.trustedForwarders);return s instanceof Response?s:await handleMcpRequest(e,t,o,s,i)}async function handleMcpRequest(e,t,n,r,i){let a=readRouteSessionCreator(t),o=readRouteChannelName(t),s=readAgentInfoRouteResponse(t);if(o===void 0||a===void 0||s===void 0)return Response.json({error:`MCP requires agent route context.`},{status:500});let c=await s();if(!c.ok)return c;let l=await c.json();if(typeof l.agent?.name!=`string`)return Response.json({error:`MCP requires compiled agent metadata.`},{status:500});let u=typeof l.agent.description==`string`?l.agent.description:void 0,d=new WorkflowAgentInvocationExecution({createSession:a,from:t.from}),f=i.agent?createInvocationTools(d,u,n.authenticator===`none`&&n.principalType===`anonymous`):[],p=i.tools||i.skills?await t.describe():void 0,m=i.tools&&p!==void 0?createPublishedTools({invokeTool:t.invokeTool,principals:r,reserved:new Set(f.map(e=>e.name)),tools:p.tools}):[],h=[];if(i.tools&&h.push({capabilities:{extensions:{[MCP_TOOL_SESSIONS_EXTENSION]:{}}},register(){}}),i.skills&&p!==void 0){let e=readSkillFileSource(t);if(e===void 0)return Response.json({error:`MCP requires agent route context.`},{status:500});h.push(createMcpSkillsFeature({files:e,skills:p.skills}))}return await createMcpStreamableHttpServer({authenticate:async()=>n,features:h,instructions:i.agent?MCP_SERVER_INSTRUCTIONS:void 0,name:l.agent.name,tools:i.agent||i.tools?[...f,...m]:void 0,version:resolveInstalledPackageInfo().version})(e)}const MCP_SERVER_INSTRUCTIONS=[`Each invocation is one durable agent task.`,`Call agent_start once per task and keep the returned invocationId.`,`Poll agent_get, waiting at least pollAfterMs between calls, until status is completed, failed, or cancelled.`,`If status is input_required, answer every entry in inputRequests in one agent_update call; repeating accepted answers is safe.`,`If status is authorization_required, show the user the authorization url or instructions and keep polling.`,`isError on a tool result means your call was rejected; a failed status means the task failed.`,`agent_start is not idempotent and a lost response leaves no invocationId, so ask the user before starting again.`,`Work continues after your connection drops; agent_cancel stops it, then poll until any terminal status.`].join(` `);function createInvocationTools(e,t,n){let r=n?` On this public channel, the invocation ID is a bearer capability until workflow retention expires.`:``,i=`Starts durable work and returns an invocation handle immediately. Call once per task; keep invocationId and poll agent_get. Not idempotent: if the response is lost, ask the user before starting again rather than retrying.${r}`;return[defineMcpTool({definition:{annotations:{destructiveHint:!0,idempotentHint:!1,openWorldHint:!0,readOnlyHint:!1},description:t===void 0?i:`${t} ${i}`,inputSchema:z.strictObject({message:utf8Bounded(MAX_MESSAGE_BYTES).min(1)}),name:`agent_start`,outputSchema:AGENT_INVOCATION_OUTPUT_SCHEMA},async call(t,n){return invocationResult(await e.create({auth:n.auth,message:t.message}))}}),defineMcpTool({definition:{annotations:{destructiveHint:!1,idempotentHint:!0,openWorldHint:!1,readOnlyHint:!0},description:`Reads complete durable invocation state. Wait at least pollAfterMs between calls. Terminal statuses are completed, failed, and cancelled. input_required needs agent_update; authorization_required needs the user to follow the returned authorization.${r}`,inputSchema:z.strictObject({invocationId:z.string().min(1).max(MAX_ID_CHARS)}),name:`agent_get`,outputSchema:AGENT_INVOCATION_OUTPUT_SCHEMA},async call(t,n){return invocationResult(requiredInvocation(await e.read({auth:n.auth,invocationId:t.invocationId})))}}),defineMcpTool({definition:{annotations:{destructiveHint:!0,idempotentHint:!1,openWorldHint:!0,readOnlyHint:!1},description:`Answers the pending input batch on an input_required invocation. Include one response per entry in inputRequests, each keyed by its requestId, in a single call; partial batches are rejected. Returns the current invocation state; repeating the same accepted answers is safe.`,inputSchema:z.strictObject({invocationId:z.string().min(1).max(MAX_ID_CHARS),responses:z.array(MCP_INPUT_RESPONSE_SCHEMA).min(1).max(MAX_RESPONSES_PER_UPDATE)}),name:`agent_update`,outputSchema:AGENT_INVOCATION_OUTPUT_SCHEMA},async call(t,n){return invocationResult(requiredMutation(await e.update({auth:n.auth,invocationId:t.invocationId,responses:t.responses})))}}),defineMcpTool({definition:{annotations:{destructiveHint:!0,idempotentHint:!0,openWorldHint:!1,readOnlyHint:!1},description:`Requests cooperative cancellation of a non-terminal invocation. Cancellation is asynchronous and can race with completion: poll agent_get until status is terminal (cancelled, completed, or failed). Safe to call repeatedly.`,inputSchema:z.strictObject({invocationId:z.string().min(1).max(MAX_ID_CHARS)}),name:`agent_cancel`,outputSchema:AGENT_INVOCATION_OUTPUT_SCHEMA},async call(t,n){return invocationResult(requiredInvocation(await e.cancel({auth:n.auth,invocationId:t.invocationId})))}})]}const INVOCATION_NOT_FOUND=`Invocation not found. It may have expired or belong to another caller.`;function requiredInvocation(e){if(e===void 0)throw new McpToolOperationError(`not_found`,INVOCATION_NOT_FOUND);return e}function requiredMutation(e){switch(e.type){case`success`:return e.invocation;case`conflict`:throw new McpToolOperationError(`conflict`,`${e.message} Call agent_get to read the current state before answering again.`);case`not_found`:throw new McpToolOperationError(`not_found`,INVOCATION_NOT_FOUND)}}function invocationResult(e){let t=parseJsonObject(e);return{content:[{text:JSON.stringify(t),type:`text`}],structuredContent:t}}const AUTHORIZATION_CHALLENGE_SCHEMA=z.strictObject({displayName:z.string().optional(),expiresAt:z.iso.datetime().optional(),instructions:z.string().optional(),url:z.url().optional(),userCode:z.string().optional()}),AUTHORIZATION_REQUEST_SCHEMA=z.strictObject({authorization:AUTHORIZATION_CHALLENGE_SCHEMA.optional(),description:z.string(),name:z.string(),webhookUrl:z.url().optional()}),MAX_MESSAGE_BYTES=65536,MAX_ID_CHARS=256,MAX_RESPONSES_PER_UPDATE=64;function utf8Bounded(e){let t=new TextEncoder;return z.string().refine(n=>t.encode(n).byteLength<=e,{message:`must be at most ${String(e)} bytes when UTF-8 encoded`})}const MCP_INPUT_RESPONSE_SCHEMA=inputResponseSchema.safeExtend({optionId:z.string().max(256).optional(),requestId:z.string().min(1).max(256),text:utf8Bounded(16384).optional()}),MCP_INPUT_REQUEST_SCHEMA=inputRequestSchema.safeExtend({action:z.strictObject({callId:z.string(),input:z.record(z.string(),z.json()),kind:z.literal(`tool-call`),toolName:z.string()})}),AGENT_INVOCATION_BASE_SCHEMA=z.strictObject({createdAt:z.iso.datetime(),expiresAt:z.iso.datetime().optional(),invocationId:z.string()}),AGENT_INVOCATION_OUTPUT_SCHEMA=z.discriminatedUnion(`status`,[AGENT_INVOCATION_BASE_SCHEMA.extend({pollAfterMs:z.number().int().nonnegative(),result:z.json().optional(),status:z.literal(`working`)}),AGENT_INVOCATION_BASE_SCHEMA.extend({inputRequests:z.record(z.string(),MCP_INPUT_REQUEST_SCHEMA),result:z.json().optional(),status:z.literal(`input_required`)}),AGENT_INVOCATION_BASE_SCHEMA.extend({authorizations:z.array(AUTHORIZATION_REQUEST_SCHEMA).min(1),pollAfterMs:z.number().int().nonnegative(),result:z.json().optional(),status:z.literal(`authorization_required`)}),AGENT_INVOCATION_BASE_SCHEMA.extend({result:z.json().optional(),status:z.literal(`completed`)}),AGENT_INVOCATION_BASE_SCHEMA.extend({error:z.strictObject({code:z.number().int(),data:z.json().optional(),message:z.string()}),status:z.literal(`failed`)}),AGENT_INVOCATION_BASE_SCHEMA.extend({status:z.literal(`cancelled`)})]);export{mcpChannel};
1
+ import{z}from"#compiled/zod/index.js";import{inputRequestSchema,inputResponseSchema}from"#shared/input.js";import{resolveInstalledPackageInfo}from"#internal/application/package.js";import{parseJsonObject}from"#shared/json.js";import{DELETE,GET,HEAD,OPTIONS,POST,defineChannel}from"#public/definitions/channel.js";import{readAgentInfoRouteResponse,readRouteChannelName,readRouteSessionCreator,readSkillFileSource}from"#internal/nitro/routes/channel-route-context.js";import{sessionAuthFromResult}from"#channel/auth/result.js";import{escapeAuthChallengeParameter,readOAuthResourceOptions,routeAuth}from"#public/channels/auth.js";import{McpToolOperationError,createMcpStreamableHttpServer,defineMcpTool}from"#internal/mcp/streamable-http-server.js";import{WorkflowAgentInvocationExecution}from"#internal/invocation/workflow-execution.js";import{MCP_TOOL_SESSIONS_EXTENSION,createPublishedTools}from"#internal/mcp/published-tools.js";import{resolveMcpRequestPrincipals}from"#internal/mcp/forwarded-principal-header.js";import{createMcpSkillsFeature}from"#internal/mcp/skills.js";import{validateMcpHttpRequest,validateMcpMetadataRequest}from"#internal/mcp/http-security.js";import{createMcpProtectedResourceMetadata,createMcpResourceChallenge}from"#internal/mcp/protected-resource.js";function mcpChannel(e){if(e?.auth===void 0)throw Error(`mcpChannel requires auth. Use none() for explicit public access.`);let t={agent:e.agent??!0,skills:e.skills??!1,tools:e.tools??!1};if(!t.agent&&!t.tools&&!t.skills)throw Error(`mcpChannel publishes nothing with agent, tools, and skills all false. Enable one.`);let n=e.route??`/eve/v1/mcp`,r=readOAuthResourceOptions(e.auth),handle=async(n,i)=>await authenticateMcpRequest(n,i,e,r,t),i=[GET(n,handle),POST(n,handle),DELETE(n,handle)];return r!==void 0&&i.unshift(...protectedResourceMetadataRoutes(r,n)),defineChannel({routes:i})}function protectedResourceMetadataRoutes(e,t){let n=protectedResourceMetadataPath(e,t);return[GET(n,async n=>protectedResourceMetadataResponse(n,e,t,!1)),HEAD(n,async n=>protectedResourceMetadataResponse(n,e,t,!0)),OPTIONS(n,async e=>protectedResourceMetadataOptionsResponse(e))]}function protectedResourceMetadataPath(e,t){if(e.metadataPath!==void 0)return e.metadataPath;let n=e.resource===void 0?t:new URL(e.resource).pathname;return n===`/`?`/.well-known/oauth-protected-resource`:`/.well-known/oauth-protected-resource${n}`}function protectedResourceMetadataResponse(e,t,n,r){let i=validateMcpMetadataRequest(e);if(i!==void 0)return i;let a=t.resource??new URL(n,new URL(e.url).origin).toString(),o=t.issuer===void 0?t.authorizationServers:[t.issuer],s=Response.json(createMcpProtectedResourceMetadata({authorizationServers:o,resource:a,scopesSupported:t.scopes}),{headers:{"access-control-allow-origin":`*`,"cache-control":`no-store`}});return r?new Response(null,{headers:s.headers,status:s.status}):s}function protectedResourceMetadataOptionsResponse(e){let t=validateMcpMetadataRequest(e);if(t!==void 0)return t;let n=new Headers({"access-control-allow-methods":`GET, HEAD, OPTIONS`,"access-control-allow-origin":`*`,"cache-control":`no-store`}),r=e.headers.get(`access-control-request-headers`);return r!==null&&(n.set(`access-control-allow-headers`,r),n.set(`vary`,`Access-Control-Request-Headers`)),new Response(null,{headers:n,status:204})}function addResourceChallenge(e,t,n){if(e.status!==401&&e.status!==403)return e;let r=protectedResourceMetadataPath(n,new URL(t.url).pathname),i=n.resource??new URL(t.url).origin,a=new URL(r,i).toString(),o=new Headers(e.headers),s=o.get(`www-authenticate`);if(e.status===401)o.set(`www-authenticate`,mergeMcpBearerChallenge(s,a,n.scopes));else{let t=augmentInsufficientScopeChallenge(s,a);if(t===void 0)return e;o.set(`www-authenticate`,t)}return new Response(e.body,{headers:o,status:e.status,statusText:e.statusText})}function mergeMcpBearerChallenge(e,t,n){let r=parseAuthChallenges(e),i=r.find(e=>e.scheme.toLowerCase()===`bearer`&&hasAuthParameter(e.value,`error`))??r.find(e=>e.scheme.toLowerCase()===`bearer`);return replaceBearerChallenges(r,i,i===void 0?createMcpResourceChallenge(t,n):augmentBearerChallenge(i.value,t,n))}function augmentInsufficientScopeChallenge(e,t){let n=parseAuthChallenges(e),r=n.find(e=>e.scheme.toLowerCase()===`bearer`&&hasAuthParameter(e.value,`error`,`insufficient_scope`));if(r!==void 0)return replaceBearerChallenges(n,r,augmentBearerChallenge(r.value,t))}function replaceBearerChallenges(e,t,n){let r=[],i=!1;for(let a of e){if(a.scheme.toLowerCase()!==`bearer`){r.push(a.value);continue}!i&&a===t&&(r.push(n),i=!0)}return i||r.push(n),r.join(`, `)}function augmentBearerChallenge(e,t,n){let r=e;return hasAuthParameter(r,`resource_metadata`)||(r=appendAuthParameter(r,`resource_metadata`,t)),n?.length&&!hasAuthParameter(r,`scope`)&&(r=appendAuthParameter(r,`scope`,n.join(` `))),r}function appendAuthParameter(e,t,n){return`${e}${e.trim().toLowerCase()===`bearer`?` `:`, `}${t}="${escapeAuthChallengeParameter(n)}"`}function hasAuthParameter(e,t,n){let r=t.replaceAll(/[.*+?^${}()|[\]\\]/g,`\\$&`);if(n===void 0)return RegExp(`(?:^|[\\s,])${r}\\s*=`,`i`).test(e);let i=n.replaceAll(/[.*+?^${}()|[\]\\]/g,`\\$&`);return RegExp(`(?:^|[\\s,])${r}\\s*=\\s*(?:"${i}"|${i})(?=$|[\\s,])`,`i`).test(e)}function parseAuthChallenges(e){if(e===null)return[];let t=[];for(let n of splitQuotedHeaderList(e)){let e=readChallengeScheme(n);if(e!==void 0){t.push({scheme:e,value:n});continue}let r=t.at(-1);r!==void 0&&(r.value+=`, ${n}`)}return t}function splitQuotedHeaderList(e){let t=[],n=!1,r=!1,i=0;for(let a=0;a<e.length;a++){let o=e[a];if(n)n=!1;else if(o===`\\`)n=!0;else if(o===`"`)r=!r;else if(o===`,`&&!r){let n=e.slice(i,a).trim();n.length>0&&t.push(n),i=a+1}}let a=e.slice(i).trim();return a.length>0&&t.push(a),t}function readChallengeScheme(e){let t=/^([!#$%&'*+\-.^_`|~0-9A-Za-z]+)(?:\s+|$)/.exec(e);if(t===null)return;let n=t[1];if(n!==void 0)return e.slice(n.length).trimStart().startsWith(`=`)?void 0:n}async function authenticateMcpRequest(e,t,n,r,i){let a=validateMcpHttpRequest(e);if(a!==void 0)return a;let o=await routeAuth(e,n.auth);if(o instanceof Response)return r===void 0?o:addResourceChallenge(o,e,r);let s=sessionAuthFromResult(o),c=await resolveMcpRequestPrincipals(e,s,n.trustedForwarders);return c instanceof Response?c:await handleMcpRequest(e,t,s,c,i)}async function handleMcpRequest(e,t,n,r,i){let a=readRouteSessionCreator(t),o=readRouteChannelName(t),s=readAgentInfoRouteResponse(t);if(o===void 0||a===void 0||s===void 0)return Response.json({error:`MCP requires agent route context.`},{status:500});let c=await s();if(!c.ok)return c;let l=await c.json();if(typeof l.agent?.name!=`string`)return Response.json({error:`MCP requires compiled agent metadata.`},{status:500});let u=typeof l.agent.description==`string`?l.agent.description:void 0,d=new WorkflowAgentInvocationExecution({createSession:a,from:t.from}),f=i.agent?createInvocationTools(d,u,n.authenticator===`none`&&n.principalType===`anonymous`):[],p=i.tools||i.skills?await t.describe():void 0,m=i.tools&&p!==void 0?createPublishedTools({invokeTool:t.invokeTool,principals:r,reserved:new Set(f.map(e=>e.name)),tools:p.tools}):[],h=[];if(i.tools&&h.push({capabilities:{extensions:{[MCP_TOOL_SESSIONS_EXTENSION]:{}}},register(){}}),i.skills&&p!==void 0){let e=readSkillFileSource(t);if(e===void 0)return Response.json({error:`MCP requires agent route context.`},{status:500});h.push(createMcpSkillsFeature({files:e,skills:p.skills}))}return await createMcpStreamableHttpServer({authenticate:async()=>n,features:h,instructions:i.agent?MCP_SERVER_INSTRUCTIONS:void 0,name:l.agent.name,tools:i.agent||i.tools?[...f,...m]:void 0,version:resolveInstalledPackageInfo().version})(e)}const MCP_SERVER_INSTRUCTIONS=[`Each invocation is one durable agent task.`,`Call agent_start once per task and keep the returned invocationId.`,`Poll agent_get, waiting at least pollAfterMs between calls, until status is completed, failed, or cancelled.`,`If status is input_required, answer every entry in inputRequests in one agent_update call; repeating accepted answers is safe.`,`If status is authorization_required, show the user the authorization url or instructions and keep polling.`,`isError on a tool result means your call was rejected; a failed status means the task failed.`,`agent_start is not idempotent and a lost response leaves no invocationId, so ask the user before starting again.`,`Work continues after your connection drops; agent_cancel stops it, then poll until any terminal status.`].join(` `);function createInvocationTools(e,t,n){let r=n?` On this public channel, the invocation ID is a bearer capability until workflow retention expires.`:``,i=`Starts durable work and returns an invocation handle immediately. Call once per task; keep invocationId and poll agent_get. Not idempotent: if the response is lost, ask the user before starting again rather than retrying.${r}`;return[defineMcpTool({definition:{annotations:{destructiveHint:!0,idempotentHint:!1,openWorldHint:!0,readOnlyHint:!1},description:t===void 0?i:`${t} ${i}`,inputSchema:z.strictObject({message:utf8Bounded(MAX_MESSAGE_BYTES).min(1)}),name:`agent_start`,outputSchema:AGENT_INVOCATION_OUTPUT_SCHEMA},async call(t,n){return invocationResult(await e.create({auth:n.auth,message:t.message}))}}),defineMcpTool({definition:{annotations:{destructiveHint:!1,idempotentHint:!0,openWorldHint:!1,readOnlyHint:!0},description:`Reads complete durable invocation state. Wait at least pollAfterMs between calls. Terminal statuses are completed, failed, and cancelled. input_required needs agent_update; authorization_required needs the user to follow the returned authorization.${r}`,inputSchema:z.strictObject({invocationId:z.string().min(1).max(MAX_ID_CHARS)}),name:`agent_get`,outputSchema:AGENT_INVOCATION_OUTPUT_SCHEMA},async call(t,n){return invocationResult(requiredInvocation(await e.read({auth:n.auth,invocationId:t.invocationId})))}}),defineMcpTool({definition:{annotations:{destructiveHint:!0,idempotentHint:!1,openWorldHint:!0,readOnlyHint:!1},description:`Answers the pending input batch on an input_required invocation. Include one response per entry in inputRequests, each keyed by its requestId, in a single call; partial batches are rejected. Returns the current invocation state; repeating the same accepted answers is safe.`,inputSchema:z.strictObject({invocationId:z.string().min(1).max(MAX_ID_CHARS),responses:z.array(MCP_INPUT_RESPONSE_SCHEMA).min(1).max(MAX_RESPONSES_PER_UPDATE)}),name:`agent_update`,outputSchema:AGENT_INVOCATION_OUTPUT_SCHEMA},async call(t,n){return invocationResult(requiredMutation(await e.update({auth:n.auth,invocationId:t.invocationId,responses:t.responses})))}}),defineMcpTool({definition:{annotations:{destructiveHint:!0,idempotentHint:!0,openWorldHint:!1,readOnlyHint:!1},description:`Requests cooperative cancellation of a non-terminal invocation. Cancellation is asynchronous and can race with completion: poll agent_get until status is terminal (cancelled, completed, or failed). Safe to call repeatedly.`,inputSchema:z.strictObject({invocationId:z.string().min(1).max(MAX_ID_CHARS)}),name:`agent_cancel`,outputSchema:AGENT_INVOCATION_OUTPUT_SCHEMA},async call(t,n){return invocationResult(requiredInvocation(await e.cancel({auth:n.auth,invocationId:t.invocationId})))}})]}const INVOCATION_NOT_FOUND=`Invocation not found. It may have expired or belong to another caller.`;function requiredInvocation(e){if(e===void 0)throw new McpToolOperationError(`not_found`,INVOCATION_NOT_FOUND);return e}function requiredMutation(e){switch(e.type){case`success`:return e.invocation;case`conflict`:throw new McpToolOperationError(`conflict`,`${e.message} Call agent_get to read the current state before answering again.`);case`not_found`:throw new McpToolOperationError(`not_found`,INVOCATION_NOT_FOUND)}}function invocationResult(e){let t=parseJsonObject(e);return{content:[{text:JSON.stringify(t),type:`text`}],structuredContent:t}}const AUTHORIZATION_CHALLENGE_SCHEMA=z.strictObject({displayName:z.string().optional(),expiresAt:z.iso.datetime().optional(),instructions:z.string().optional(),url:z.url().optional(),userCode:z.string().optional()}),AUTHORIZATION_REQUEST_SCHEMA=z.strictObject({authorization:AUTHORIZATION_CHALLENGE_SCHEMA.optional(),description:z.string(),name:z.string(),webhookUrl:z.url().optional()}),MAX_MESSAGE_BYTES=65536,MAX_ID_CHARS=256,MAX_RESPONSES_PER_UPDATE=64;function utf8Bounded(e){let t=new TextEncoder;return z.string().refine(n=>t.encode(n).byteLength<=e,{message:`must be at most ${String(e)} bytes when UTF-8 encoded`})}const MCP_INPUT_RESPONSE_SCHEMA=inputResponseSchema.safeExtend({optionId:z.string().max(256).optional(),requestId:z.string().min(1).max(256),text:utf8Bounded(16384).optional()}),MCP_INPUT_REQUEST_SCHEMA=inputRequestSchema.safeExtend({action:z.strictObject({callId:z.string(),input:z.record(z.string(),z.json()),kind:z.literal(`tool-call`),toolName:z.string()})}),AGENT_INVOCATION_BASE_SCHEMA=z.strictObject({createdAt:z.iso.datetime(),expiresAt:z.iso.datetime().optional(),invocationId:z.string()}),AGENT_INVOCATION_OUTPUT_SCHEMA=z.discriminatedUnion(`status`,[AGENT_INVOCATION_BASE_SCHEMA.extend({pollAfterMs:z.number().int().nonnegative(),result:z.json().optional(),status:z.literal(`working`)}),AGENT_INVOCATION_BASE_SCHEMA.extend({inputRequests:z.record(z.string(),MCP_INPUT_REQUEST_SCHEMA),result:z.json().optional(),status:z.literal(`input_required`)}),AGENT_INVOCATION_BASE_SCHEMA.extend({authorizations:z.array(AUTHORIZATION_REQUEST_SCHEMA).min(1),pollAfterMs:z.number().int().nonnegative(),result:z.json().optional(),status:z.literal(`authorization_required`)}),AGENT_INVOCATION_BASE_SCHEMA.extend({result:z.json().optional(),status:z.literal(`completed`)}),AGENT_INVOCATION_BASE_SCHEMA.extend({error:z.strictObject({code:z.number().int(),data:z.json().optional(),message:z.string()}),status:z.literal(`failed`)}),AGENT_INVOCATION_BASE_SCHEMA.extend({status:z.literal(`cancelled`)})]);export{mcpChannel};
@@ -10,6 +10,7 @@ export type { SlackAttachment, SlackAuthor, SlackEvent, SlackEventEnvelope, Slac
10
10
  export { callSlackApi, resolveSlackBotToken, slackContinuationToken, type SlackPostInput, type SlackPostedMessage, type SlackBotTokenContext, type SlackThreadMessage, type SlackUploadFilesOptions, type SlackUploadFilesResult, } from "#public/channels/slack/api.js";
11
11
  export { type SlackFetch, type SlackTransportOptions } from "#public/channels/slack/transport.js";
12
12
  export { defaultSlackAuth } from "#public/channels/slack/defaults.js";
13
+ export { buildSlackAuthContext } from "#public/channels/slack/auth.js";
13
14
  export { postCompletedSlackReply, type SlackCompletedReply, } from "#public/channels/slack/reply-delivery.js";
14
15
  export { SLACK_MARKDOWN_TEXT_MAX_LENGTH } from "#public/channels/slack/limits.js";
15
16
  export { defineSlackRenderer, type SlackRenderer, type SlackRendererEvents, type SlackRenderHandler, type SlackRenderNext, type SlackTaskCard, } from "#public/channels/slack/renderers.js";
@@ -1 +1 @@
1
- import{Actions,Button,Card,CardLink,CardText,Divider,ExternalSelect,Field,Fields,Image,LinkButton,Modal,RadioSelect,Section,Select,SelectOption,Table,TextInput,cardChildToFallbackText,isCardElement}from"#compiled/chat/index.js";import{cardToBlocks,cardToFallbackText}from"#public/channels/slack/blocks.js";import{SLACK_MARKDOWN_TEXT_MAX_LENGTH}from"#public/channels/slack/limits.js";import{HITL_ACTION_PREFIX,deriveHitlResponse,renderInputRequestBlocks}from"#public/channels/slack/hitl.js";import{callSlackApi,resolveSlackBotToken,slackContinuationToken}from"#public/channels/slack/api.js";import{postCompletedSlackReply}from"#public/channels/slack/reply-delivery.js";import{slackChannel}from"#public/channels/slack/slackChannel.js";import{defaultSlackAuth}from"#public/channels/slack/defaults.js";import{defineSlackRenderer}from"#public/channels/slack/renderers.js";import{loadThreadContextMessages}from"#public/channels/slack/thread.js";export{Actions,Button,Card,CardLink,CardText,Divider,ExternalSelect,Field,Fields,HITL_ACTION_PREFIX,Image,LinkButton,Modal,RadioSelect,SLACK_MARKDOWN_TEXT_MAX_LENGTH,Section,Select,SelectOption,Table,TextInput,callSlackApi,cardChildToFallbackText,cardToBlocks,cardToFallbackText,defaultSlackAuth,defineSlackRenderer,deriveHitlResponse,isCardElement,loadThreadContextMessages,postCompletedSlackReply,renderInputRequestBlocks,resolveSlackBotToken,slackChannel,slackContinuationToken};
1
+ import{Actions,Button,Card,CardLink,CardText,Divider,ExternalSelect,Field,Fields,Image,LinkButton,Modal,RadioSelect,Section,Select,SelectOption,Table,TextInput,cardChildToFallbackText,isCardElement}from"#compiled/chat/index.js";import{cardToBlocks,cardToFallbackText}from"#public/channels/slack/blocks.js";import{SLACK_MARKDOWN_TEXT_MAX_LENGTH}from"#public/channels/slack/limits.js";import{buildSlackAuthContext}from"#public/channels/slack/auth.js";import{HITL_ACTION_PREFIX,deriveHitlResponse,renderInputRequestBlocks}from"#public/channels/slack/hitl.js";import{callSlackApi,resolveSlackBotToken,slackContinuationToken}from"#public/channels/slack/api.js";import{postCompletedSlackReply}from"#public/channels/slack/reply-delivery.js";import{slackChannel}from"#public/channels/slack/slackChannel.js";import{defaultSlackAuth}from"#public/channels/slack/defaults.js";import{defineSlackRenderer}from"#public/channels/slack/renderers.js";import{loadThreadContextMessages}from"#public/channels/slack/thread.js";export{Actions,Button,Card,CardLink,CardText,Divider,ExternalSelect,Field,Fields,HITL_ACTION_PREFIX,Image,LinkButton,Modal,RadioSelect,SLACK_MARKDOWN_TEXT_MAX_LENGTH,Section,Select,SelectOption,Table,TextInput,buildSlackAuthContext,callSlackApi,cardChildToFallbackText,cardToBlocks,cardToFallbackText,defaultSlackAuth,defineSlackRenderer,deriveHitlResponse,isCardElement,loadThreadContextMessages,postCompletedSlackReply,renderInputRequestBlocks,resolveSlackBotToken,slackChannel,slackContinuationToken};
@@ -0,0 +1,7 @@
1
+ import type { StandardSchemaV1 } from "#compiled/@standard-schema/spec/index.js";
2
+ import type { DefinedDynamicSchedules, ScheduleClient } from "#public/schedules/subscription.js";
3
+ import { type ScheduleCollectionClient } from "#runtime/schedules/collection-client.js";
4
+ /** Binds a registered subscription to a scope authorized on every operation. */
5
+ export declare function schedules<TPayload, TPrepared = TPayload>(collection: DefinedDynamicSchedules<TPayload, StandardSchemaV1<unknown, TPayload>, TPrepared>): Promise<ScheduleClient<TPayload>>;
6
+ /** Shared binding for model approval preview and code-only client access. */
7
+ export declare function bindScheduleCollection<TPayload, TPrepared = TPayload>(collection: DefinedDynamicSchedules<TPayload, StandardSchemaV1<unknown, TPayload>, TPrepared>): Promise<ScheduleCollectionClient<TPayload, TPrepared>>;
@@ -0,0 +1 @@
1
+ import{getAdapterKind}from"#channel/adapter.js";import{loadContext}from"#context/container.js";import{AuthKey,ChannelInstrumentationKey,ContinuationTokenKey,InitiatorAuthKey,SessionIdKey}from"#context/keys.js";import{readScheduleCollectionSource}from"#shared/schedule-collection-definition.js";import{normalizeScheduleCollectionDefinition}from"#internal/authored-definition/schedule-collection.js";import{readSessionSchedule}from"#context/session-schedule.js";import{ChannelKey}from"#runtime/sessions/runtime-context-keys.js";import{createScheduleCollectionClient}from"#runtime/schedules/collection-client.js";async function schedules(e){return await bindScheduleCollection(e)}async function bindScheduleCollection(e){let t=readScheduleCollectionSource(e);if(t===void 0)throw Error(`schedules(): subscription must be a stamped agent/schedules module export.`);let n=normalizeScheduleCollectionDefinition(e,`Invalid schedule subscription ${t.logicalPath}.`),r=loadContext(),i=r.get(ChannelKey);return createScheduleCollectionClient(n,{abortSignal:new AbortController().signal,session:{id:r.get(SessionIdKey)??``,schedule:readSessionSchedule(r),auth:{current:r.get(AuthKey)??null,initiator:r.get(InitiatorAuthKey)??null}},channel:{kind:i===void 0?void 0:getAdapterKind(i),continuationToken:r.get(ContinuationTokenKey),metadata:r.get(ChannelInstrumentationKey)?.metadata},application:t.application,collection:t.collection})}export{bindScheduleCollection,schedules};
@@ -0,0 +1,5 @@
1
+ /** Experimental dynamic schedule subscriptions. APIs may change without notice. */
2
+ export { schedules } from "#public/experimental/schedules/client.js";
3
+ export { defineDynamicSchedules, type DefinedDynamicSchedules, type DynamicSchedulesDefinition, type DynamicSchedulesRunArgs, type DynamicSchedulesToFn, type ScheduleCreateApproval, type ScheduleApprovals, type ScheduleClient, type ScheduleClientCreate, type ScheduleCreate, type ScheduleExpression, type ScheduleTiming, type ScheduleList, type ScheduleOccurrence, type ScheduleOccurrenceIdentity, type SchedulePrincipalReference, type ScheduleOccurrenceEvent, type SchedulePage, type ScheduleProvider, type ScheduleRecord, type ScheduleScopeContext, type ScheduleScopeResolverResult, type ScheduleOperation, type ScheduleState, } from "#public/schedules/subscription.js";
4
+ export type { ScheduleDelivery, ScheduleDeliveryTarget, ScheduleProviderContext, } from "#runtime/schedules/provider-types.js";
5
+ export { byPrincipal } from "#public/schedules/scope.js";
@@ -0,0 +1 @@
1
+ import{schedules}from"#public/experimental/schedules/client.js";import{defineDynamicSchedules}from"#public/schedules/subscription.js";import{byPrincipal}from"#public/schedules/scope.js";export{byPrincipal,defineDynamicSchedules,schedules};
@@ -0,0 +1,2 @@
1
+ /** Experimental in-memory dynamic schedule collections for tests. */
2
+ 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,2 @@
1
+ /** Experimental Vercel-backed dynamic schedule collections. */
2
+ export { vercelScheduleProvider, type VercelScheduleProviderOptions, } from "#public/schedules/providers/vercel.js";
@@ -0,0 +1 @@
1
+ import{vercelScheduleProvider}from"#public/schedules/providers/vercel.js";export{vercelScheduleProvider};
@@ -1 +1 @@
1
- const DISABLED_PRINCIPAL_TYPES=new Set([`anonymous`,`runtime`]);function byPrincipal(e){let t=e.session.auth.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{byPrincipal};
1
+ import{principalScope}from"#shared/principal-scope.js";function byPrincipal(e){return principalScope(e.session.auth)}export{byPrincipal};
@@ -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`:`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){return fromVercelSchedule(await(await client(e.abortSignal)).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}))},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,2 @@
1
+ import type { ScheduleScopeContext } from "#public/schedules/subscription.js";
2
+ export declare function byPrincipal(context: ScheduleScopeContext): string | null;
@@ -0,0 +1 @@
1
+ import{principalScope}from"#shared/principal-scope.js";function byPrincipal(e){return principalScope(e.session.auth)}export{byPrincipal};
@@ -0,0 +1,258 @@
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
+ }
109
+ export interface ScheduleList {
110
+ readonly cursor?: string;
111
+ readonly limit?: number;
112
+ }
113
+ export interface ScheduleOccurrence {
114
+ readonly executionId: string;
115
+ readonly name: string;
116
+ readonly scheduleId: string;
117
+ readonly scheduledAt: string;
118
+ }
119
+ /** Storage and occurrence transport supplied by a schedule backend. */
120
+ export interface ScheduleProvider {
121
+ readonly kind: string;
122
+ create<TPayload>(context: ScheduleProviderContext, schedule: ScheduleCreate<TPayload>): Promise<ScheduleRecord>;
123
+ list(context: ScheduleProviderContext, query: ScheduleList): Promise<SchedulePage>;
124
+ get(context: ScheduleProviderContext, name: string): Promise<ScheduleRecord | null>;
125
+ enable(context: ScheduleProviderContext, name: string): Promise<ScheduleRecord>;
126
+ disable(context: ScheduleProviderContext, name: string): Promise<ScheduleRecord>;
127
+ invoke(context: ScheduleProviderContext, name: string): Promise<void>;
128
+ delete(context: ScheduleProviderContext, name: string): Promise<boolean>;
129
+ }
130
+ export interface ScheduleClientCreate<TPayload> {
131
+ readonly expression: ScheduleTiming;
132
+ /** Display label. Creation allocates a unique management name returned in the receipt. */
133
+ readonly name: string;
134
+ readonly payload: TPayload;
135
+ }
136
+ export interface SchedulePageResult {
137
+ readonly cursor: string | null;
138
+ readonly data: readonly ScheduleRecord[];
139
+ }
140
+ /** Authenticated client; payload and creator identity are immutable after creation. */
141
+ export interface ScheduleClient<TPayload> {
142
+ create(input: ScheduleClientCreate<TPayload>): Promise<ScheduleRecord>;
143
+ delete(name: string): Promise<boolean>;
144
+ disable(name: string): Promise<ScheduleRecord>;
145
+ enable(name: string): Promise<ScheduleRecord>;
146
+ get(name: string): Promise<ScheduleRecord | null>;
147
+ invoke(name: string): Promise<void>;
148
+ list(input?: ScheduleList): Promise<SchedulePageResult>;
149
+ }
150
+ /** Starts fresh unattended work bound to the resolved creator; callers cannot choose another identity. */
151
+ export type DynamicSchedulesToFn = <TChannel extends ChannelReference<unknown>>(channel: TChannel, target: InferReceiveTarget<TChannel>) => {
152
+ send(message: string | UserContent): Promise<Session>;
153
+ };
154
+ export type ScheduleCreateApproval<TPrepared> = ((context: ApprovalContext & {
155
+ readonly payload: TPrepared;
156
+ }) => ApprovalStatus | Promise<ApprovalStatus>) | {
157
+ readonly request: (context: ApprovalContext & {
158
+ readonly payload: TPrepared;
159
+ }) => ApprovalStatus | Promise<ApprovalStatus>;
160
+ readonly response?: (context: ApprovalResponseContext & {
161
+ readonly payload: TPrepared;
162
+ }) => ApprovalResponseDecision | Promise<ApprovalResponseDecision>;
163
+ };
164
+ export type ScheduleApprovals<TPrepared> = Partial<Record<Exclude<ScheduleOperation, "create">, Approval>> & {
165
+ readonly create?: ScheduleCreateApproval<TPrepared>;
166
+ };
167
+ /** Execution context; `to` starts fresh, unattended sessions as the resolved creator. */
168
+ export interface DynamicSchedulesRunArgs<TPayload> extends Pick<ScheduleHandlerArgs, "waitUntil"> {
169
+ readonly to: DynamicSchedulesToFn;
170
+ readonly payload: TPayload;
171
+ readonly occurrence: ScheduleOccurrenceIdentity;
172
+ readonly auth: SessionAuthContext;
173
+ }
174
+ /** Defines dynamically created schedules whose occurrences invoke authored code. */
175
+ export interface DynamicSchedulesDefinition<TPayload = unknown, TSchema extends StandardSchemaV1<unknown, TPayload> = StandardSchemaV1<unknown, TPayload>, TPrepared = TPayload> {
176
+ readonly description?: string;
177
+ /** Model-facing payload schema. Destination intent may be resolved by `run`. */
178
+ readonly inputSchema: TSchema;
179
+ /** Resolved backend. defineDynamicSchedules defaults omitted providers to Vercel Schedules. */
180
+ readonly provider: ScheduleProvider;
181
+ /**
182
+ * Validates application policy and enriches a creation payload before the provider write.
183
+ * The caller constructs input; eve validates it with `inputSchema`, authorizes creation
184
+ * through `scope`, then calls `preparePayload` with trusted creation context. eve checks that the
185
+ * result is bounded JSON and persists it; `inputSchema` describes caller input, not stored prepared output.
186
+ * Throw an actionable error to reject creation without writing a schedule.
187
+ *
188
+ * A common use is capturing the current channel destination: derive channel/workspace
189
+ * references from verified caller context, replace any model-supplied references, and
190
+ * return them with the task. Keep captured fields out of the input schema.
191
+ * Channel-less or delegated callers may lack that context; reject those cases explicitly.
192
+ *
193
+ * Runs only on creation. Model calls invoke preparePayload before approval and again before
194
+ * writing; execution fails if the prepared result differs from the approved snapshot.
195
+ * Authenticated clients invoke preparePayload once before writing without model approval. Reads, enable/disable operations, and occurrence execution do not call it. Omission
196
+ * stores validated input unchanged. Creation retries may call it again, so avoid
197
+ * irreversible side effects; state changes never recapture a different destination.
198
+ * `auth`, `run`, and occurrence events receive the inferred return type. Declare `preparePayload`
199
+ * before those callbacks for contextual inference, or annotate its return type explicitly.
200
+ * Prepared application data is not revalidated against the input schema at execution;
201
+ * validate the application's persisted contract in authored code when necessary.
202
+ */
203
+ readonly preparePayload?: (payload: TPayload, context: ScheduleScopeContext & {
204
+ readonly operation: "create";
205
+ readonly name: string;
206
+ }) => TPrepared | Promise<TPrepared>;
207
+ /** Authorizes every management operation. Defaults to `byPrincipal`. */
208
+ readonly scope?: (context: ScheduleScopeContext & {
209
+ readonly operation: ScheduleOperation;
210
+ }) => ScheduleScopeResolverResult | Promise<ScheduleScopeResolverResult>;
211
+ /** Resolves the captured creator to current execution auth; return `null` to deny. */
212
+ readonly auth: (context: {
213
+ readonly principal: SchedulePrincipalReference;
214
+ readonly payload: NoInfer<TPrepared>;
215
+ readonly occurrence: ScheduleOccurrenceIdentity;
216
+ }) => SessionAuthContext | null | Promise<SessionAuthContext | null>;
217
+ /** May repeat on provider retries. Key external effects on the occurrence identity. */
218
+ readonly run: (args: DynamicSchedulesRunArgs<NoInfer<TPrepared>>) => void | Promise<void>;
219
+ readonly events?: {
220
+ /** After `run` and registered `waitUntil` work succeed; may repeat on retries. */
221
+ readonly "occurrence.dispatched"?: ScheduleOccurrenceEventHandler<NoInfer<TPrepared>>;
222
+ /** On a permanent provider failure or after its retry budget is exhausted. */
223
+ readonly "occurrence.failed"?: ScheduleOccurrenceEventHandler<NoInfer<TPrepared>>;
224
+ };
225
+ /** Expose operation tools directly (default true), or false for code-only scheduling. */
226
+ readonly tool?: boolean;
227
+ /** Model-call policies keyed by operation. Create receives the validated prepared payload. */
228
+ readonly approval?: ScheduleApprovals<NoInfer<TPrepared>>;
229
+ }
230
+ export type DefinedDynamicSchedules<TPayload = unknown, TSchema extends StandardSchemaV1<unknown, TPayload> = StandardSchemaV1<unknown, TPayload>, TPrepared = TPayload> = DynamicSchedulesDefinition<TPayload, TSchema, TPrepared> & {
231
+ readonly [SCHEDULE_COLLECTION_DEFINITION_BRAND]: true;
232
+ };
233
+ type DynamicSchedulesOptions<TInput, TSchema extends StandardSchemaV1<unknown, TInput>, TPrepared = TInput> = Omit<DynamicSchedulesDefinition<TInput, TSchema, TPrepared>, "provider" | "tool" | "approval"> & {
234
+ /** Defaults to vercelScheduleProvider(): hosted production scheduling, process-local storage in eve dev. */
235
+ readonly provider?: ScheduleProvider;
236
+ } & ({
237
+ readonly tool: false;
238
+ readonly approval?: never;
239
+ } | {
240
+ readonly tool?: true;
241
+ readonly approval?: ScheduleApprovals<NoInfer<TPrepared>>;
242
+ });
243
+ /**
244
+ * Defines a dynamic schedule subscription. Export it from `agent/schedules/`;
245
+ * identity comes from the module path. inputSchema validates caller input,
246
+ * while eve captures creator identity separately and re-resolves it on every attempt.
247
+ * `run` chooses destinations and starts work; no creation conversation is implicitly captured.
248
+ * Provider defaults to vercelScheduleProvider(); pass provider explicitly to select another backend.
249
+ * The default supports Vercel production and eve dev, not preview or self-hosted scheduling.
250
+ */
251
+ export declare function defineDynamicSchedules<TInput, TPrepared>(definition: Omit<DynamicSchedulesOptions<TInput, StandardSchemaV1<unknown, TInput>, TPrepared>, "preparePayload"> & {
252
+ readonly preparePayload: (payload: TInput, context: ScheduleScopeContext & {
253
+ readonly operation: "create";
254
+ readonly name: string;
255
+ }) => TPrepared | Promise<TPrepared>;
256
+ }): DefinedDynamicSchedules<TInput, StandardSchemaV1<unknown, TInput>, TPrepared>;
257
+ 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>;
258
+ 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};