Loading...
Loading...
Skill for working with the Lucid Agents SDK - a TypeScript framework for building and monetizing AI agents. Use this skill when building or modifying Lucid Agents projects, working with agent entrypoints, payments, identity, or A2A communication. Activate when: Building or modifying Lucid Agents projects, working with agent entrypoints, payments, identity, or A2A communication, developing in the lucid-agents monorepo, creating new templates or CLI features, or questions about the Lucid Agents architecture or API.
npx skill4agent add daydreamsai/skills-market lucid-agents-sdkconst 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();@lucid-agents/hono@lucid-agents/express@lucid-agents/tanstack| Network | Type | Finality | Gas Cost |
|---|---|---|---|
| EVM (L2) | ~12s | ~$0.01 |
| EVM (L1) | ~12min | $0.01-$10 |
| Solana | ~400ms | ~$0.0001 |
baseethereumsolanaeip155:8453eip155:1| v1 Name | v2 CAIP-2 ID | Description |
|---|---|---|
| | Base Mainnet |
| | Base Sepolia |
| | Ethereum Mainnet |
| | Ethereum Sepolia |
https://facilitator.daydreams.systems@lucid-agents/hono@0.7.20import { 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}` } };
},
});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,
};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();CRITICAL: Per ERC-8004 spec,MUST be a URL to hosted metadata, NOT inline JSON.agentURI
/.well-known/erc8004.json// 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';| Network | Registry Address |
|---|---|
| Ethereum Mainnet | |
| Base | |
{ "dependencies": { "zod": "^4.0.0" } }TypeError: z.toJSONSchema is not a functionbun add zod@4{ "dependencies": { "@lucid-agents/hono": "^0.7.20" } }No facilitator registered for scheme: exact and network: basebun add @lucid-agents/hono@latestPAYMENTS_RECEIVABLE_ADDRESS=0xYourWalletAddress # required
FACILITATOR_URL=https://facilitator.daydreams.systems # required
NETWORK=base # required (or base-sepolia, ethereum, solana, etc.)// Correct - Bun auto-serves this
export default {
port: Number(process.env.PORT ?? 3000),
fetch: app.fetch,
};Bun.serve()EADDRINUSEimport { 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 };{
"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"
}
}POST /entrypoints/{key}/invokePOST /entrypoints/{key}/streamGET /healthGET /