Interactive button-based UI for XMTP agents following XIP-67. Use when creating menus, confirmation dialogs, selection options, or any button-based interaction. Triggers on inline actions, buttons, menus, or ActionBuilder.
中文简介正在准备中。当前显示原文说明。
Core XMTP Agent SDK setup and patterns. Use when creating new agents, handling messages, setting up middleware, or configuring environment variables. Triggers on agent setup, XMTP configuration, message handling, or middleware implementation.
中文简介正在准备中。当前显示原文说明。
查看安装方法安装前可以查看交给 AI 代理的指令内容。
Build event-driven, middleware-powered messaging agents on the XMTP network using the @xmtp/agent-sdk.
Reference these guidelines when:
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Setup | CRITICAL | setup- |
| 2 | Events | HIGH | events- |
| 3 | Middleware | MEDIUM | middleware- |
| 4 | Filters | MEDIUM | filters- |
setup-environment - Configure environment variables for agentsetup-from-env - Create agent using Agent.createFromEnv()setup-manual - Manual agent creation with signerevents-text - Handle text messagesevents-lifecycle - Handle start/stop eventsevents-conversation - Handle new DM and group conversationsevents-message-types - Handle different message types (reaction, reply, attachment)middleware-basics - Create and register middlewaremiddleware-error-handling - Handle errors in middleware chainmiddleware-command-router - Use CommandRouter for slash commandsfilters-message-types - Filter by message typefilters-sender - Filter out self-messagesnpm install @xmtp/agent-sdk
# or
yarn add @xmtp/agent-sdk
SDK 2.0+ uses unified exports: import everything from @xmtp/agent-sdk (no /debug, /middleware, /user, /util subpaths).
import { Agent, getTestUrl } from "@xmtp/agent-sdk";
// Create agent using environment variables
const agent = await Agent.createFromEnv();
// Handle text messages
agent.on("text", async (ctx) => {
await ctx.conversation.sendText("Hello from my XMTP Agent!");
});
// Log when ready
agent.on("start", () => {
console.log(`Agent online: ${getTestUrl(agent.client)}`);
});
await agent.start();
| Variable | Purpose | Example |
|---|---|---|
XMTP_WALLET_KEY | Private key for wallet | 0x1234...abcd |
XMTP_DB_ENCRYPTION_KEY | Database encryption key | 0xabcd...1234 |
XMTP_ENV | Network environment | dev or production |
XMTP_DB_DIRECTORY | Database directory | ./data |
Read individual rule files for detailed explanations:
rules/setup-environment.md
rules/events-text.md
rules/middleware-basics.md
还没有评价。欢迎分享你的使用感受。
无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。
还没有评论。来写第一条吧。
Interactive button-based UI for XMTP agents following XIP-67. Use when creating menus, confirmation dialogs, selection options, or any button-based interaction. Triggers on inline actions, buttons, menus, or ActionBuilder.
中文简介正在准备中。当前显示原文说明。
File attachment handling for XMTP agents. Use when sending or receiving images, files, or any encrypted remote attachments. Triggers on file upload, image sending, or remote attachment handling.
中文简介正在准备中。当前显示原文说明。
Patterns for handling commands, validating input, and filtering messages in XMTP agents. Use when implementing slash commands, validators, or message filters. Triggers on command handling, input validation, or type guards.
中文简介正在准备中。当前显示原文说明。
Token transactions and wallet integration for XMTP agents. Use when sending USDC, creating transaction requests, or handling transaction confirmations. Triggers on USDC transfer, wallet calls, or transaction reference.
中文简介正在准备中。当前显示原文说明。
Group conversation management for XMTP agents. Use when creating groups, managing members, setting permissions, or sending welcome messages. Triggers on group creation, member management, or permissions.
中文简介正在准备中。当前显示原文说明。
ENS and Web3 identity resolution for XMTP agents. Use when resolving domain names, extracting mentions, or fetching Farcaster profiles. Triggers on ENS resolution, Farcaster lookup, or mention extraction.
中文简介正在准备中。当前显示原文说明。