# Lucid

A protocol-agnostic TypeScript runtime that turns typed functions into services AI agents can discover, call, pay for, stream or run as tasks, supporting crypto and fiat payment rails such as AP2, A2A, x402 and ERC-8004.

Lucid provides one runtime for schemas, payment admission, policy, idempotency, fulfillment, discovery and accounting for services meant to be consumed by AI agents, while wallets, payment protocols, networks and facilitators stay external and pluggable. It ships CLI-generated templates and drop-in adapters for Hono, Express, Next.js and TanStack.

A generated service exposes health and discovery endpoints and a typed entrypoint that agents can invoke over HTTP, with the entrypoint definition acting as the single source for validation, invocation, streaming, tasks, discovery and every framework adapter. Public npm packages form the Stable release channel; the GitHub repository is the Next channel and may be ahead of npm. Requires Bun 1.3+ or Node.js 20.9+.

Website: https://docs.daydreams.systems/
