Lucid Agents Sdk logo

Lucid Agents Sdk

Organization
daydreamsai
lucid-agents-sdk

Provides Lucid Agents SDK implementation patterns for TypeScript paid agents, including entrypoints, payments, identity, and A2A communication. Use when building or modifying Lucid Agents projects, working in the lucid-agents monorepo, creating templates or CLI features, or answering SDK architecture/API questions.

Overview

Publisherdaydreamsai
Repositoryskills-market
Skill namelucid-agents-sdk
Stars
31
Forks
16
Bundled files
2
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 2 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by daydreamsai on GitHub. Read the source before you install it.

Installation

Install the Lucid Agents Sdk AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/daydreamsai/skills-market/tree/main/plugins/lucid-agents-sdk/skills
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/daydreamsai/skills-market.git /tmp/skills-market
mkdir -p .claude/skills
cp -r /tmp/skills-market/plugins/lucid-agents-sdk/skills .claude/skills/lucid-agents-sdk
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Lucid Agents Sdk in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Lucid Agents Sdk on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Lucid Agents Sdk is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Lucid Agents SDK

TypeScript/Bun framework for building, monetizing, and verifying AI agents.

Packages

  • @lucid-agents/core - Protocol-agnostic agent runtime with extension system
  • @lucid-agents/http - HTTP extension for request/response handling
  • @lucid-agents/identity - ERC-8004 identity and trust layer
  • @lucid-agents/payments - x402 payment utilities with bi-directional tracking
  • @lucid-agents/analytics - Payment analytics and reporting
  • @lucid-agents/wallet - Wallet SDK for agent and developer wallets
  • @lucid-agents/a2a - A2A Protocol client for agent-to-agent communication
  • @lucid-agents/ap2 - AP2 (Agent Payments Protocol) extension
  • @lucid-agents/hono - Hono HTTP server adapter
  • @lucid-agents/express - Express HTTP server adapter
  • @lucid-agents/tanstack - TanStack Start adapter
  • @lucid-agents/cli - CLI for scaffolding new agent projects

Tech Stack: Bun (Node.js 20+ compatible), TypeScript (ESM, strict), tsup, Bun workspaces, Changesets

Architecture

Extension System

Features are added via composable extensions:

typescript
const agent = await createAgent({
  name: 'my-agent',
  version: '1.0.0',
})
  .use(http())
  .use(wallets({ config: walletsFromEnv() }))
  .use(payments({ config: paymentsFromEnv() }))
  .use(identity({ config: identityFromEnv() }))
  .use(a2a())
  .build();

Extensions: http, wallets, payments, analytics, identity, a2a, ap2

Adapters

  • Hono (@lucid-agents/hono) - Lightweight, edge-compatible
  • Express (@lucid-agents/express) - Traditional Node.js/Express
  • TanStack Start (@lucid-agents/tanstack) - Full-stack React (UI or headless)

Payment Networks

NetworkTypeFinalityGas Cost
base / base-sepoliaEVM (L2)~12s~$0.01
ethereum / sepoliaEVM (L1)~12min$0.01-$10
solana / solana-devnetSolana~400ms~$0.0001

EVM: EIP-712 signatures, ERC-20 tokens (USDC), 0x-prefixed addresses Solana: Ed25519 signatures, SPL tokens (USDC), Base58 addresses

x402 Protocol Versions

v1: Simple network names (base, ethereum, solana) v2 (recommended): CAIP-2 chain IDs (eip155:8453 for Base, eip155:1 for Ethereum)

v1 Namev2 CAIP-2 IDDescription
baseeip155:8453Base Mainnet
base-sepoliaeip155:84532Base Sepolia
ethereumeip155:1Ethereum Mainnet
sepoliaeip155:11155111Ethereum Sepolia

The Daydreams facilitator (https://facilitator.daydreams.systems) supports both v1 and v2. Use @lucid-agents/hono@0.7.20+ for proper x402 v2 support on Base.

API Quick Reference

Core Agent Creation

typescript
import { createAgent } from '@lucid-agents/core';
import { http } from '@lucid-agents/http';
import { z } from 'zod';

const agent = await createAgent({
  name: 'my-agent',
  version: '1.0.0',
  description: 'My first agent',
})
  .use(http())
  .build();

agent.entrypoints.add({
  key: 'greet',
  input: z.object({ name: z.string() }),
  async handler({ input }) {
    return { output: { message: `Hello, ${input.name}` } };
  },
});

Hono Adapter

typescript
import { createAgent } from '@lucid-agents/core';
import { http } from '@lucid-agents/http';
import { createAgentApp } from '@lucid-agents/hono';

const agent = await createAgent({
  name: 'my-agent',
  version: '1.0.0',
})
  .use(http())
  .build();

const { app, addEntrypoint } = await createAgentApp(agent);

addEntrypoint({
  key: 'echo',
  description: 'Echo back input',
  input: z.object({ text: z.string() }),
  handler: async ctx => {
    return { output: { text: ctx.input.text } };
  },
});

export default {
  port: Number(process.env.PORT ?? 3000),
  fetch: app.fetch,
};

Payments Extension

typescript
import { createAgent } from '@lucid-agents/core';
import { payments, paymentsFromEnv } from '@lucid-agents/payments';

const agent = await createAgent({
  name: 'my-agent',
  version: '1.0.0',
})
  .use(
    payments({
      config: {
        ...paymentsFromEnv(),
        policyGroups: [
          {
            name: 'Daily Limits',
            outgoingLimits: {
              global: { maxTotalUsd: 100.0, windowMs: 86400000 },
            },
            incomingLimits: {
              global: { maxTotalUsd: 5000.0, windowMs: 86400000 },
            },
          },
        ],
      },
      storage: { type: 'sqlite' }, // or 'in-memory' or 'postgres'
    })
  )
  .build();

ERC-8004 Identity Registration

CRITICAL: Per ERC-8004 spec, agentURI MUST be a URL to hosted metadata, NOT inline JSON.

  1. Host registration file at /.well-known/erc8004.json
  2. Generate agent icon (512x512 PNG)
  3. Register on-chain with the hosted URL
typescript
// WRONG - DO NOT pass inline JSON
const agentURI = JSON.stringify({ name: "Agent", ... });

// CORRECT - Pass URL to hosted registration file
const agentURI = 'https://my-agent.example.com/.well-known/erc8004.json';
NetworkRegistry Address
Ethereum Mainnet0x8004A169FB4a3325136EB29fA0ceB6D2e539a432
Base0x8004A169FB4a3325136EB29fA0ceB6D2e539a432

Full reference: ERC8004_REFERENCE.md

Critical Requirements

Zod v4 Required (NOT v3!)

json
{ "dependencies": { "zod": "^4.0.0" } }

Error with v3: TypeError: z.toJSONSchema is not a function Fix: bun add zod@4

@lucid-agents/hono v0.7.20+ for Base x402

json
{ "dependencies": { "@lucid-agents/hono": "^0.7.20" } }

Error with older versions: No facilitator registered for scheme: exact and network: base Fix: bun add @lucid-agents/hono@latest

Required Environment Variables

bash
PAYMENTS_RECEIVABLE_ADDRESS=0xYourWalletAddress  # required
FACILITATOR_URL=https://facilitator.daydreams.systems  # required
NETWORK=base  # required (or base-sepolia, ethereum, solana, etc.)

Bun Server Export Format

typescript
// Correct - Bun auto-serves this
export default {
  port: Number(process.env.PORT ?? 3000),
  fetch: app.fetch,
};

Do NOT call Bun.serve() explicitly -- causes EADDRINUSE.

Minimal Working Example

typescript
import { createAgent } from '@lucid-agents/core';
import { http } from '@lucid-agents/http';
import { createAgentApp } from '@lucid-agents/hono';
import { payments, paymentsFromEnv } from '@lucid-agents/payments';
import { z } from 'zod';  // Must be zod v4!

const agent = await createAgent({
  name: 'my-agent',
  version: '1.0.0',
  description: 'My agent',
})
  .use(http())
  .use(payments({ config: paymentsFromEnv() }))
  .build();

const { app, addEntrypoint } = await createAgentApp(agent);

addEntrypoint({
  key: 'hello',
  description: 'Say hello',
  input: z.object({ name: z.string() }),
  price: { amount: 0 },  // Free endpoint
  handler: async (ctx) => {
    return { output: { message: `Hello, ${ctx.input.name}!` } };
  },
});

const port = Number(process.env.PORT ?? 3000);
console.log(`Agent running on port ${port}`);

export default { port, fetch: app.fetch };

Minimal package.json

json
{
  "name": "my-agent",
  "type": "module",
  "scripts": {
    "dev": "bun run --hot src/index.ts",
    "start": "bun run src/index.ts"
  },
  "dependencies": {
    "@lucid-agents/core": "latest",
    "@lucid-agents/http": "latest",
    "@lucid-agents/hono": "latest",
    "@lucid-agents/payments": "latest",
    "hono": "^4.0.0",
    "zod": "^4.0.0"
  }
}

Entrypoint Path Convention

  • Invoke: POST /entrypoints/{key}/invoke
  • Stream: POST /entrypoints/{key}/stream
  • Health: GET /health
  • Landing: GET / (HTML page)

Resources

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Lucid Agents Sdk AI skill do?

Provides Lucid Agents SDK implementation patterns for TypeScript paid agents, including entrypoints, payments, identity, and A2A communication. Use when building or modifying Lucid Agents projects, working in the lucid-agents monorepo, creating templates or CLI features, or answering SDK architecture/API questions.

Why use Lucid Agents Sdk on TypingMind?

Because you install it once and use it with any model. Lucid Agents Sdk is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Lucid Agents Sdk in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/daydreamsai/skills-market/tree/main/plugins/lucid-agents-sdk/skills. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Lucid Agents Sdk?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Lucid Agents Sdk?

As many as you like. As long as a model supports skills, you can use Lucid Agents Sdk with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Lucid Agents Sdk AI skill free?

It is published on GitHub by daydreamsai. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇