{"id":32861286,"url":"https://github.com/daydreamsai/lucid-agents","last_synced_at":"2026-02-14T13:04:20.894Z","repository":{"id":322710866,"uuid":"1089851346","full_name":"daydreamsai/lucid-agents","owner":"daydreamsai","description":"Lucid Agents Commerce SDK. Bootstrap AI agents in 60 seconds that can pay, sell, and participate in agentic commerce supply chains. Our protocol agnostic SDK provides CLI-generated templates and drop-in adapters for Hono, Express, Next.js, and TanStack, giving you instant access to crypto/fiat payment rails (AP2, A2A, x402, ERC8004).","archived":false,"fork":false,"pushed_at":"2026-02-11T04:53:24.000Z","size":4408,"stargazers_count":161,"open_issues_count":11,"forks_count":37,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-11T10:31:25.102Z","etag":null,"topics":["8004","a2a","a2a-protocol","agentic-commerce","agents","eip8004","mcp","x402"],"latest_commit_sha":null,"homepage":"https://docs.daydreams.systems/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/daydreamsai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-11-04T22:40:25.000Z","updated_at":"2026-02-11T04:51:00.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/daydreamsai/lucid-agents","commit_stats":null,"previous_names":["daydreamsai/lucid-agents"],"tags_count":362,"template":false,"template_full_name":null,"purl":"pkg:github/daydreamsai/lucid-agents","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daydreamsai%2Flucid-agents","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daydreamsai%2Flucid-agents/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daydreamsai%2Flucid-agents/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daydreamsai%2Flucid-agents/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daydreamsai","download_url":"https://codeload.github.com/daydreamsai/lucid-agents/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daydreamsai%2Flucid-agents/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29444092,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T12:43:28.304Z","status":"ssl_error","status_checked_at":"2026-02-14T12:43:14.160Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["8004","a2a","a2a-protocol","agentic-commerce","agents","eip8004","mcp","x402"],"created_at":"2025-11-08T21:01:04.558Z","updated_at":"2026-02-14T13:04:20.878Z","avatar_url":"https://github.com/daydreamsai.png","language":"TypeScript","funding_links":[],"categories":["💻 Notable Github Projects"],"sub_categories":["A2A (Agent2Agent Protocol)"],"readme":"![info](./info.jpeg)\n\n\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003eLucid Agents\u003c/h1\u003e\n  \u003cp\u003e\u003cstrong\u003eThe Protocol-Agnostic Multi-Runtime Framework for Building and Monetizing AI Agents\u003c/strong\u003e\u003c/p\u003e\n  \u003cp\u003eBuild, deploy, and monetize autonomous AI agents with typed entrypoints, onchain identity, and built-in payment infrastructure.\u003c/p\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/daydreamsai/lucid-agents/blob/master/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/github/license/daydreamsai/lucid-agents?style=for-the-badge\" alt=\"License\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@lucid-agents/cli\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@lucid-agents/cli?style=for-the-badge\" alt=\"NPM Version\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/daydreamsai/lucid-agents/actions\"\u003e\u003cimg src=\"https://img.shields.io/github/actions/workflow/status/daydreamsai/lucid-agents/ci.yml?branch=master\u0026style=for-the-badge\" alt=\"CI Status\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://bun.sh\"\u003e\u003cimg src=\"https://img.shields.io/badge/runtime-bun-black?style=for-the-badge\u0026logo=bun\" alt=\"Bun\"\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n---\n\n## What is Lucid Agents?\n\nLucid Agents is a TypeScript-first framework for building and monetizing AI agents. An agentic commerce and payments SDK. Build AI agents that sell services, facilitate monetary transactions, and participate in agent-to-agent marketplaces.\n\n**Core Capabilities:**\n\n- **Industry-Standard Protocols**: Native support for x402 (payments), A2A (agent-to-agent communication), and ERC-8004 (onchain identity). Build agents that work with the ecosystem\n- **Bi-Directional Payment Tracking**: Track both outgoing payments (agent pays) and incoming payments (agent receives) with persistent storage. Automatic recording with policy enforcement\n- **Payment Policies**: Control spending and receivables with per-payment limits, time-windowed totals, per-target/per-sender limits, and allow/block lists. Multiple policy groups for flexible control\n- **Accept Payments**: Accept payments in USDC on Ethereum L2s (Base) or Solana with automatic paywall middleware. No payment infrastructure code needed\n- **Payment Analytics**: Comprehensive payment reporting with summary statistics, transaction history, and CSV/JSON export for accounting system integration\n- **Agent-to-Agent Communication**: Agents can discover and call other agents, enabling agent marketplaces and multi-agent systems where agents buy and sell services from each other\n- **Onchain Identity**: Register agent identities onchain, build reputation, and prove ownership for trust in agent marketplaces\n- **Framework Flexibility**: Write your agent logic once, deploy on Hono, TanStack Start, Express, or Next.js. Choose the framework that fits your stack\n- **Type-Safe APIs**: Define inputs/outputs with Zod schemas, get automatic validation, JSON schemas, and full TypeScript inference\n- **Real-Time Streaming**: Server-Sent Events (SSE) for streaming agent responses. Perfect for LLM outputs and long-running operations\n- **Task Management**: Long-running tasks with status tracking, cancellation, and real-time updates via SSE subscriptions\n- **Auto-Discovery**: Auto-generated AgentCard manifests with Open Graph tags. Agents are discoverable in directories and show rich previews when shared\n- **Quick Start**: CLI scaffolding with templates for common patterns. Get a working agent in minutes, not hours\n- **Multi-Network Support**: Accept payments on EVM (Base, Ethereum, Sepolia) or Solana (mainnet, devnet) networks\n- **Composable Architecture**: Add only the features you need. Payments, identity, A2A, wallets, analytics. Mix and match as your agent evolves\n\nWhether you're building paid AI services, agent marketplaces, or multi-agent systems where agents transact with each other, Lucid Agents provides the payments and commerce infrastructure you need.\n\n---\n\n## Quick Start (5 Minutes)\n\nGet your first monetized AI agent running in minutes.\n\n### Prerequisites\n\n- [Bun](https://bun.sh/docs/installation) \u003e= 1.0 (recommended) or Node.js \u003e= 20.9\n- An API key from your preferred LLM provider (OpenAI, Anthropic, etc.)\n- Optional: A wallet address for receiving payments\n\n### 1. Create and Configure Your Agent\n\n```bash\n# Interactive mode - CLI guides you through all options\nbunx @lucid-agents/cli my-agent\n\n# Or use inline configuration for faster setup\nbunx @lucid-agents/cli my-agent \\\n  --adapter=hono \\\n  --template=axllm \\\n  --AGENT_NAME=\"My AI Agent\" \\\n  --AGENT_DESCRIPTION=\"AI-powered assistant\" \\\n  --OPENAI_API_KEY=your_api_key_here \\\n  --PAYMENTS_RECEIVABLE_ADDRESS=0xYourAddress \\\n  --NETWORK=ethereum \\\n  --DEFAULT_PRICE=1000\n```\n\nThe CLI will:\n\n- **Adapter selection**: `hono` (HTTP server), `tanstack-ui` (full dashboard), `tanstack-headless` (API only), `express` (Node.js server), or `next` (Next.js App Router)\n- **Template selection**: `blank` (minimal), `axllm` (LLM-powered), `axllm-flow` (workflows), `identity` (onchain identity), `trading-data-agent` (merchant), or `trading-recommendation-agent` (shopper)\n- **Configuration**: Set agent metadata, LLM keys, and optional payment details\n- **Install dependencies**: Automatically run `bun install`\n\n### 2. Start Your Agent\n\n```bash\ncd my-agent\nbun run dev\n```\n\nYour agent is now running at `http://localhost:3000`!\n\n**Try it out:**\n\n```bash\n# View agent manifest\ncurl http://localhost:3000/.well-known/agent.json\n\n# List entrypoints\ncurl http://localhost:3000/entrypoints\n\n# Invoke an entrypoint (example for echo template)\ncurl -X POST http://localhost:3000/entrypoints/echo/invoke \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"input\": {\"text\": \"Hello, Lucid Agents!\"}}'\n```\n\n---\n\n## Architecture Overview\n\nLucid Agents is a TypeScript monorepo built for protocol-agnostic, multi-runtime agent deployment with a compositional extension architecture:\n\n- **Layer 1: Core** - Protocol-agnostic agent runtime with extension system (`@lucid-agents/core`) - no protocol-specific code\n- **Layer 2: Extensions** - Optional capabilities added via composition: `http()` (HTTP protocol), `payments()` (x402), `wallets()` (wallet management), `identity()` (ERC-8004), `a2a()` (agent-to-agent), `ap2()` (Agent Payments Protocol)\n- **Layer 3: Adapters** - Framework integrations (hono, tanstack, express, next) that use the HTTP extension\n\nThe core runtime is completely protocol-agnostic. Protocols like HTTP are provided as extensions that get merged into the runtime. Future protocols (gRPC, WebSocket, etc.) can be added as additional extensions.\n\n\u003e For detailed architecture documentation including dependency graphs, request flows, and extension system design, see [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md).\n\n### Packages\n\n- **`@lucid-agents/types`** - Shared type definitions used across all packages\n- **`@lucid-agents/core`** - Protocol-agnostic agent runtime with extension system\n- **`@lucid-agents/http`** - HTTP extension for request/response handling, streaming, and SSE\n- **`@lucid-agents/wallet`** - Wallet SDK for agent and developer wallet management\n- **`@lucid-agents/payments`** - x402 payment utilities with bi-directional tracking, payment policies, and persistent storage (SQLite, In-Memory, Postgres)\n- **`@lucid-agents/analytics`** - Payment analytics and reporting with CSV/JSON export for accounting system integration\n- **`@lucid-agents/identity`** - ERC-8004 identity toolkit for onchain agent identity\n- **`@lucid-agents/a2a`** - A2A Protocol client for agent-to-agent communication\n- **`@lucid-agents/ap2`** - AP2 (Agent Payments Protocol) extension for Agent Cards\n- **`@lucid-agents/hono`** - Hono HTTP server adapter\n- **`@lucid-agents/express`** - Express HTTP server adapter\n- **`@lucid-agents/tanstack`** - TanStack Start adapter (UI and headless variants)\n- **`@lucid-agents/cli`** - CLI scaffolding tool for creating new agent projects\n\n### Key Concepts\n\n**Entrypoints**: Typed API endpoints that define your agent's capabilities. Each entrypoint has:\n\n- Input/output schemas (Zod)\n- Optional pricing (x402)\n- Handler (synchronous) or stream handler (SSE)\n\n**Adapters**: Runtime frameworks that expose your entrypoints as HTTP routes. Choose based on your deployment needs:\n\n- `hono` - Lightweight, edge-compatible HTTP server\n- `tanstack` - Full-stack React with UI dashboard (or headless API-only)\n- `express` - Traditional Node.js HTTP server\n- `next` - Next.js App Router integration\n\n**A2A Communication**: Agent-to-agent communication protocol enabling agents to call other agents:\n\n- **Direct Invocation**: Synchronous calls via `client.invoke()` or `client.stream()`\n- **Task-Based Operations**: Long-running tasks with `sendMessage()`, status tracking, and cancellation\n- **Multi-Turn Conversations**: Group related tasks with `contextId` for conversational agents\n- **Agent Composition**: Agents can act as both clients and servers, enabling complex supply chains\n\n**Manifests**: Auto-generated AgentCard (`.well-known/agent-card.json`) that describes your agent's capabilities, pricing, and identity for discovery tools and A2A protocols. Built using immutable composition pattern.\n\n**Payment Networks**: Accept payments on:\n\n- **EVM**: Base, Ethereum, Sepolia (ERC-20 USDC)\n- **Solana**: Mainnet, Devnet (SPL USDC)\n\n**Identity**: ERC-8004 onchain identity for reputation and trust. Register once, reference across all networks.\n\n**Payment Policies**: Control both outgoing and incoming payments with limits, time windows, and allow/block lists. Organize policies into groups for flexible control.\n\n**Payment Analytics**: Track spending and earnings with summary statistics, transaction history, and export to CSV/JSON for accounting systems.\n\n---\n\n## Key Packages\n\n### Core Packages\n\n#### [`@lucid-agents/core`](packages/core/README.md)\n\nProtocol-agnostic agent runtime with extension system.\n\n```typescript\nimport { createAgent } from '@lucid-agents/core';\nimport { http } from '@lucid-agents/http';\nimport { z } from 'zod';\n\nconst agent = await createAgent({\n  name: 'my-agent',\n  version: '1.0.0',\n  description: 'My first agent',\n})\n  .use(http())\n  .build();\n\nagent.entrypoints.add({\n  key: 'greet',\n  input: z.object({ name: z.string() }),\n  async handler({ input }) {\n    return { output: { message: `Hello, ${input.name}!` } };\n  },\n});\n```\n\n#### [`@lucid-agents/hono`](packages/hono/README.md)\n\nHono adapter for building traditional HTTP servers.\n\n```typescript\nimport { createAgent } from '@lucid-agents/core';\nimport { http } from '@lucid-agents/http';\nimport { createAgentApp } from '@lucid-agents/hono';\n\nconst agent = await createAgent({\n  name: 'my-agent',\n  version: '1.0.0',\n})\n  .use(http())\n  .build();\n\nconst { app, addEntrypoint } = await createAgentApp(agent);\n\n// Add entrypoints...\n\n// Export for Bun.serve or use Hono serve helper\nexport default {\n  port: Number(process.env.PORT ?? 3000),\n  fetch: app.fetch,\n};\n```\n\n#### [`@lucid-agents/tanstack`](packages/tanstack/README.md)\n\nTanStack Start adapter with UI and headless variants.\n\n```typescript\nimport { createAgent } from '@lucid-agents/core';\nimport { http } from '@lucid-agents/http';\nimport { createTanStackRuntime } from '@lucid-agents/tanstack';\n\nconst agent = await createAgent({\n  name: 'my-agent',\n  version: '1.0.0',\n})\n  .use(http())\n  .build();\n\nexport const { runtime: tanStackRuntime, handlers } =\n  await createTanStackRuntime(agent);\n```\n\n#### [`@lucid-agents/http`](packages/http/README.md)\n\nHTTP extension for request/response handling, streaming, and Server-Sent Events.\n\n```typescript\nimport { createAgent } from '@lucid-agents/core';\nimport { http } from '@lucid-agents/http';\n\nconst agent = await createAgent({\n  name: 'my-agent',\n  version: '1.0.0',\n})\n  .use(http({ landingPage: true }))\n  .build();\n\n// Access HTTP handlers via agent.handlers\n```\n\n#### [`@lucid-agents/identity`](packages/identity/README.md)\n\nERC-8004 toolkit for onchain identity, reputation, and validation.\n\n```typescript\nimport { createAgent } from '@lucid-agents/core';\nimport { wallets } from '@lucid-agents/wallet';\nimport { walletsFromEnv } from '@lucid-agents/wallet';\nimport { createAgentIdentity } from '@lucid-agents/identity';\n\nconst agent = await createAgent({\n  name: 'my-agent',\n  version: '1.0.0',\n})\n  .use(wallets({ config: walletsFromEnv() }))\n  .build();\n\nconst identity = await createAgentIdentity({\n  runtime: agent,\n  domain: 'my-agent.example.com',\n  autoRegister: true, // Register onchain if not exists\n});\n```\n\n#### [`@lucid-agents/payments`](packages/payments/README.md)\n\nx402 payment utilities with bi-directional tracking, payment policies, and persistent storage.\n\n```typescript\nimport { createAgent } from '@lucid-agents/core';\nimport { payments } from '@lucid-agents/payments';\nimport { paymentsFromEnv } from '@lucid-agents/payments';\n\nconst agent = await createAgent({\n  name: 'my-agent',\n  version: '1.0.0',\n})\n  .use(\n    payments({\n      config: {\n        ...paymentsFromEnv(),\n        policyGroups: [\n          {\n            name: 'Daily Limits',\n            outgoingLimits: {\n              global: { maxTotalUsd: 100.0, windowMs: 86400000 },\n            },\n            incomingLimits: {\n              global: { maxTotalUsd: 5000.0, windowMs: 86400000 },\n            },\n            blockedSenders: {\n              domains: ['https://untrusted.example.com'],\n            },\n          },\n        ],\n      },\n      storage: { type: 'sqlite' }, // or 'in-memory' or 'postgres'\n    })\n  )\n  .build();\n\n// Auto-detects EVM vs Solana from PAYMENTS_RECEIVABLE_ADDRESS format\n// Automatically tracks outgoing and incoming payments\n```\n\n#### [`@lucid-agents/a2a`](packages/a2a/README.md)\n\nA2A Protocol client for agent-to-agent communication.\n\n```typescript\nimport { createAgent } from '@lucid-agents/core';\nimport { http } from '@lucid-agents/http';\nimport { a2a } from '@lucid-agents/a2a';\n\nconst agent = await createAgent({\n  name: 'my-agent',\n  version: '1.0.0',\n})\n  .use(http())\n  .use(a2a())\n  .build();\n\n// Access A2A client via agent.a2a\nconst result = await agent.a2a.client.invoke(\n  'https://other-agent.com',\n  'skillId',\n  {\n    input: 'data',\n  }\n);\n```\n\n#### [`@lucid-agents/analytics`](packages/analytics/README.md)\n\nPayment analytics and reporting with CSV/JSON export for accounting systems.\n\n```typescript\nimport { createAgent } from '@lucid-agents/core';\nimport { analytics } from '@lucid-agents/analytics';\nimport { getSummary, exportToCSV } from '@lucid-agents/analytics';\nimport { payments, paymentsFromEnv } from '@lucid-agents/payments';\n\nconst agent = await createAgent({\n  name: 'my-agent',\n  version: '1.0.0',\n})\n  .use(payments({ config: paymentsFromEnv() }))\n  .use(analytics())\n  .build();\n\n// Get payment summary\nconst summary = await getSummary(agent.analytics.paymentTracker, 86400000);\nconsole.log(\n  `Outgoing: ${summary.outgoingTotal}, Incoming: ${summary.incomingTotal}`\n);\n\n// Export to CSV for accounting systems\nconst csv = await exportToCSV(agent.analytics.paymentTracker);\n```\n\n#### [`@lucid-agents/ap2`](packages/ap2/README.md)\n\nAP2 (Agent Payments Protocol) extension for Agent Cards.\n\n```typescript\nimport { createAgent } from '@lucid-agents/core';\nimport { ap2 } from '@lucid-agents/ap2';\n\nconst agent = await createAgent({\n  name: 'my-agent',\n  version: '1.0.0',\n})\n  .use(ap2({ roles: ['merchant'] }))\n  .build();\n```\n\n#### [`@lucid-agents/wallet`](packages/wallet/README.md)\n\nWallet SDK for agent and developer wallet management.\n\n```typescript\nimport { createAgentWallet } from '@lucid-agents/wallet';\n\nconst wallet = await createAgentWallet({\n  type: 'local',\n  privateKey: process.env.AGENT_WALLET_PRIVATE_KEY,\n});\n\n// Or use a thirdweb Engine wallet with the same connector interface\nconst agent = await createAgent({\n  name: 'thirdweb-agent',\n  version: '0.1.0',\n})\n  .use(http())\n  .use(\n    wallets({\n      config: {\n        agent: {\n          type: 'thirdweb',\n          secretKey: process.env.AGENT_WALLET_SECRET_KEY!,\n          clientId: process.env.AGENT_WALLET_CLIENT_ID,\n          walletLabel: 'agent-wallet',\n          chainId: 84532, // Base Sepolia\n        },\n      },\n    })\n  )\n  .build();\n\nconst connector = agent.wallets?.agent?.connector;\nconst capabilities = connector?.getCapabilities?.();\nif (!connector?.getWalletClient || !capabilities?.walletClient) {\n  throw new Error('thirdweb wallet client not available');\n}\n\nconst walletClient = (await connector.getWalletClient())?.client;\nif (!walletClient) {\n  throw new Error('Wallet client not initialized');\n}\n\nawait walletClient.writeContract({\n  account: walletClient.account,\n  chain: walletClient.chain,\n  address: USDC_ADDRESS,\n  abi: erc20Abi,\n  functionName: 'transfer',\n  args: ['0xEA4b0D5ebF46C22e4c7E6b6164706447e67B9B1D', 10_000n], // 0.01 USDC\n});\n```\n\n### CLI Tool\n\n#### [`@lucid-agents/cli`](packages/cli/README.md)\n\nCLI for scaffolding new agent projects with templates and interactive configuration.\n\n```bash\n# Interactive mode\nbunx @lucid-agents/cli\n\n# With options\nbunx @lucid-agents/cli my-agent \\\n  --adapter=tanstack-ui \\\n  --template=axllm \\\n  --non-interactive\n```\n\nEach package contains detailed API documentation, environment variable references, and working examples.\n\n---\n\n## Example: Full-Featured Agent\n\nHere's a complete example showing identity, payments, and LLM integration with streaming:\n\n```typescript\nimport { z } from 'zod';\nimport { createAgent } from '@lucid-agents/core';\nimport { http } from '@lucid-agents/http';\nimport { wallets } from '@lucid-agents/wallet';\nimport { walletsFromEnv } from '@lucid-agents/wallet';\nimport { payments } from '@lucid-agents/payments';\nimport { paymentsFromEnv } from '@lucid-agents/payments';\nimport { identity, identityFromEnv } from '@lucid-agents/identity';\nimport { createAgentApp } from '@lucid-agents/hono';\nimport { AI } from '@ax-llm/ax';\n\n// 1. Initialize LLM\nconst ai = new AI({\n  provider: 'openai',\n  apiKey: process.env.OPENAI_API_KEY,\n});\n\n// 2. Build app with all extensions (identity extension handles ERC-8004 registration automatically)\nconst agent = await createAgent({\n  name: 'ai-assistant',\n  version: '1.0.0',\n  description: 'AI assistant with onchain identity and streaming responses',\n  image: 'https://my-agent.example.com/og-image.png',\n})\n  .use(http())\n  .use(wallets({ config: walletsFromEnv() }))\n  .use(payments({ config: paymentsFromEnv() }))\n  .use(identity({ config: identityFromEnv() }))\n  .build();\n\nconst { app, addEntrypoint } = await createAgentApp(agent);\n\n// 4. Add paid entrypoint with streaming\naddEntrypoint({\n  key: 'chat',\n  description: 'Chat with AI assistant',\n  input: z.object({\n    message: z.string(),\n    history: z\n      .array(\n        z.object({\n          role: z.enum(['user', 'assistant']),\n          content: z.string(),\n        })\n      )\n      .optional(),\n  }),\n  streaming: true,\n  async stream(ctx, emit) {\n    const messages = [\n      ...(ctx.input.history || []),\n      { role: 'user' as const, content: ctx.input.message },\n    ];\n\n    const stream = await ai.chat.stream({ messages });\n\n    for await (const chunk of stream) {\n      await emit({\n        kind: 'delta',\n        delta: chunk.delta,\n        mime: 'text/plain',\n      });\n    }\n\n    return {\n      output: { completed: true },\n      usage: { total_tokens: stream.usage.total_tokens },\n    };\n  },\n});\n\n// Export for Bun.serve or use Hono serve helper\nconst port = Number(process.env.PORT ?? 3000);\nexport default {\n  port,\n  fetch: app.fetch,\n};\n```\n\n**Features demonstrated:**\n\n- Onchain identity registration (ERC-8004). Automatically handled by identity extension\n- Automatic x402 payment verification\n- Bi-directional payment tracking with policy enforcement\n- Streaming LLM responses via SSE\n- Type-safe input/output schemas\n- Trust metadata in manifest for verifiable agent identity\n- Open Graph tags for discovery\n\n---\n\n## Development\n\n### Setup\n\n```bash\n# Clone the repository\ngit clone https://github.com/daydreamsai/lucid-agents.git\ncd lucid-agents\n\n# Install dependencies\nbun install\n\n# Build all packages\nbun run build:packages\n```\n\n### Package Development\n\n```bash\n# Work on a specific package\ncd packages/core\n\n# Build this package\nbun run build\n\n# Run tests\nbun test\n\n# Type check\nbun run type-check\n\n# Lint and format\nbun run lint:fix\nbun run format\n```\n\n---\n\n## Contributing\n\nWe welcome contributions! Whether you're fixing bugs, adding features, or improving documentation.\n\n### Development Setup\n\n1. **Fork and clone** the repository\n\n2. **Install dependencies:**\n\n   ```bash\n   bun install\n   ```\n\n3. **Build all packages** (required - must run in dependency order):\n\n   ```bash\n   bun run build:packages\n   ```\n\n4. **Make your changes:**\n   - Add tests for new features\n   - Update documentation as needed\n\n5. **Run checks before submitting:**\n\n   ```bash\n   bun test              # All tests\n   bun run type-check    # TypeScript validation\n   bun run lint          # Code linting\n   ```\n\n6. **Create a changeset:**\n\n   ```bash\n   bun run changeset\n   ```\n\n7. **Submit a pull request**\n\nFor detailed guidelines, see [CONTRIBUTING.md](CONTRIBUTING.md).\n\n---\n\n## Resources\n\n### Documentation\n\n- **Architecture Guide**: [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) - System design, dependency graphs, and request flows\n- **Package READMEs**: Each package has comprehensive documentation and `AGENTS.md` files\n- **Contributing Guide**: [CONTRIBUTING.md](CONTRIBUTING.md) - Development workflow and guidelines\n\n### Protocols \u0026 Specifications\n\n- **ERC-8004 Specification**: [EIP-8004](https://eips.ethereum.org/EIPS/eip-8004) - Onchain agent identity standard\n- **x402 Protocol**: [x402 GitHub](https://github.com/paywithx402) - HTTP-native payment protocol\n- **A2A Protocol**: [Agent-to-Agent Communication](https://a2a-protocol.org/) - Agent discovery and communication protocol\n\n### Technologies\n\n- **Hono Framework**: [hono.dev](https://hono.dev/) - Lightweight web framework\n- **TanStack Start**: [tanstack.com/start](https://tanstack.com/start) - Full-stack React framework\n- **Bun Runtime**: [bun.sh](https://bun.sh/) - Fast JavaScript runtime\n- **Zod**: [zod.dev](https://zod.dev/) - TypeScript-first schema validation\n\n---\n\n## License\n\nThis project is licensed under the **MIT License**. See the [LICENSE](LICENSE) file for details.\n\n---\n\n## Contributors\n\n\u003ca href=\"https://github.com/daydreamsai/lucid-agents/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=daydreamsai/lucid-agents\" alt=\"Contributors\" /\u003e\n\u003c/a\u003e\n\n---\n\n## Star History\n\n\u003ca href=\"https://star-history.com/#daydreamsai/lucid-agents\u0026Date\"\u003e\n  \u003cimg src=\"https://api.star-history.com/svg?repos=daydreamsai/lucid-agents\u0026type=Date\" alt=\"Star History Chart\" /\u003e\n\u003c/a\u003e\n\n---\n\n\u003cdiv align=\"center\"\u003e\n  \u003cp\u003eBuilt with ❤️ by the Daydreams AI team\u003c/p\u003e\n  \u003cp\u003e\n    \u003ca href=\"https://github.com/daydreamsai/lucid-agents\"\u003eGitHub\u003c/a\u003e •\n    \u003ca href=\"https://www.npmjs.com/org/lucid-agents\"\u003enpm\u003c/a\u003e •\n    \u003ca href=\"https://twitter.com/daydreamsai\"\u003eTwitter\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaydreamsai%2Flucid-agents","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaydreamsai%2Flucid-agents","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaydreamsai%2Flucid-agents/lists"}