@blockrun/elizaos-plugin 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +102 -0
- package/dist/index.d.ts +53 -0
- package/dist/index.js +282 -0
- package/dist/index.js.map +1 -0
- package/package.json +68 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 BlockRun
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# @elizaos/plugin-blockrun
|
|
2
|
+
|
|
3
|
+
Pay-per-request AI for ElizaOS agents via x402 micropayments on Base.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
This plugin enables ElizaOS agents to make LLM API calls using the [x402 protocol](https://x402.org), paying with USDC micropayments on Base chain. No API keys required - just a wallet with USDC.
|
|
8
|
+
|
|
9
|
+
**Supported Models:**
|
|
10
|
+
- OpenAI: gpt-4o, gpt-4o-mini
|
|
11
|
+
- Anthropic: claude-sonnet-4, claude-3.5-haiku
|
|
12
|
+
- Google: gemini-2.0-flash
|
|
13
|
+
- And more via BlockRun gateway
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install @elizaos/plugin-blockrun
|
|
19
|
+
# or
|
|
20
|
+
pnpm add @elizaos/plugin-blockrun
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Configuration
|
|
24
|
+
|
|
25
|
+
Set your Base chain wallet private key:
|
|
26
|
+
|
|
27
|
+
```env
|
|
28
|
+
BASE_CHAIN_WALLET_KEY=0x...
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Or in agent settings:
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
const agent = new Agent({
|
|
35
|
+
plugins: [blockrunPlugin],
|
|
36
|
+
settings: {
|
|
37
|
+
BASE_CHAIN_WALLET_KEY: '0x...',
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Usage
|
|
43
|
+
|
|
44
|
+
### Plugin Registration
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
import { blockrunPlugin } from '@elizaos/plugin-blockrun';
|
|
48
|
+
|
|
49
|
+
const agent = new Agent({
|
|
50
|
+
plugins: [blockrunPlugin],
|
|
51
|
+
});
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Available Actions
|
|
55
|
+
|
|
56
|
+
#### BLOCKRUN_CHAT
|
|
57
|
+
|
|
58
|
+
Make a pay-per-request AI call:
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
// The action is triggered when the agent needs to query an AI model
|
|
62
|
+
// Payments are handled automatically via x402
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Available Providers
|
|
66
|
+
|
|
67
|
+
#### BLOCKRUN_WALLET
|
|
68
|
+
|
|
69
|
+
Provides wallet context to the agent:
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
// Returns wallet address and USDC balance on Base
|
|
73
|
+
// Useful for agents to understand their payment capacity
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## How It Works
|
|
77
|
+
|
|
78
|
+
1. Agent makes an AI request via BLOCKRUN_CHAT action
|
|
79
|
+
2. BlockRun gateway returns 402 Payment Required with price
|
|
80
|
+
3. Plugin automatically signs USDC payment (EIP-712)
|
|
81
|
+
4. Request is retried with payment signature
|
|
82
|
+
5. AI response is returned to the agent
|
|
83
|
+
|
|
84
|
+
All payments use USDC on Base chain. Typical cost: $0.001-0.01 per request.
|
|
85
|
+
|
|
86
|
+
## Environment Variables
|
|
87
|
+
|
|
88
|
+
| Variable | Description | Required |
|
|
89
|
+
|----------|-------------|----------|
|
|
90
|
+
| `BASE_CHAIN_WALLET_KEY` | Private key for Base chain wallet | Yes |
|
|
91
|
+
| `BLOCKRUN_API_URL` | Custom API URL (default: https://blockrun.ai/api) | No |
|
|
92
|
+
| `BLOCKRUN_DEFAULT_MODEL` | Default model (default: openai/gpt-4o-mini) | No |
|
|
93
|
+
|
|
94
|
+
## Links
|
|
95
|
+
|
|
96
|
+
- [BlockRun](https://blockrun.ai) - Pay-per-request AI gateway
|
|
97
|
+
- [x402 Protocol](https://x402.org) - HTTP 402 micropayment standard
|
|
98
|
+
- [ElizaOS](https://elizaos.ai) - AI agent framework
|
|
99
|
+
|
|
100
|
+
## License
|
|
101
|
+
|
|
102
|
+
MIT
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Action, Provider, Plugin } from '@elizaos/core';
|
|
2
|
+
|
|
3
|
+
declare const blockrunChatAction: Action;
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* BlockRun Wallet Provider - Provides wallet address and USDC balance on Base.
|
|
7
|
+
*
|
|
8
|
+
* This provider gives the agent context about its payment wallet,
|
|
9
|
+
* including address and available USDC balance for x402 micropayments.
|
|
10
|
+
*/
|
|
11
|
+
declare const blockrunWalletProvider: Provider;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @elizaos/plugin-blockrun
|
|
15
|
+
*
|
|
16
|
+
* BlockRun x402 pay-per-request AI plugin for ElizaOS.
|
|
17
|
+
*
|
|
18
|
+
* This plugin enables ElizaOS agents to make LLM API calls using the x402 protocol,
|
|
19
|
+
* paying with USDC micropayments on Base chain. No API keys required - just a wallet.
|
|
20
|
+
*
|
|
21
|
+
* Features:
|
|
22
|
+
* - Pay-per-request AI access (OpenAI, Anthropic, Google, etc.)
|
|
23
|
+
* - Automatic x402 micropayment handling
|
|
24
|
+
* - USDC payments on Base chain
|
|
25
|
+
* - Wallet balance provider for agent context
|
|
26
|
+
*
|
|
27
|
+
* Configuration:
|
|
28
|
+
* Set BASE_CHAIN_WALLET_KEY in your agent settings or environment.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* import { blockrunPlugin } from '@elizaos/plugin-blockrun';
|
|
33
|
+
*
|
|
34
|
+
* const agent = new Agent({
|
|
35
|
+
* plugins: [blockrunPlugin],
|
|
36
|
+
* settings: {
|
|
37
|
+
* BASE_CHAIN_WALLET_KEY: '0x...',
|
|
38
|
+
* },
|
|
39
|
+
* });
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @see https://blockrun.ai
|
|
43
|
+
* @see https://x402.org
|
|
44
|
+
*/
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* BlockRun Plugin for ElizaOS
|
|
48
|
+
*
|
|
49
|
+
* Enables pay-per-request AI via x402 micropayments on Base.
|
|
50
|
+
*/
|
|
51
|
+
declare const blockrunPlugin: Plugin;
|
|
52
|
+
|
|
53
|
+
export { blockrunChatAction, blockrunPlugin, blockrunWalletProvider, blockrunPlugin as default };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
// src/actions/chat.ts
|
|
2
|
+
import {
|
|
3
|
+
logger
|
|
4
|
+
} from "@elizaos/core";
|
|
5
|
+
import { LLMClient } from "@blockrun/llm";
|
|
6
|
+
var clientCache = /* @__PURE__ */ new Map();
|
|
7
|
+
function getClient(runtime) {
|
|
8
|
+
const agentId = runtime.agentId;
|
|
9
|
+
if (clientCache.has(agentId)) {
|
|
10
|
+
return clientCache.get(agentId);
|
|
11
|
+
}
|
|
12
|
+
const privateKey = runtime.getSetting("BASE_CHAIN_WALLET_KEY") || runtime.getSetting("BLOCKRUN_WALLET_KEY") || process.env.BASE_CHAIN_WALLET_KEY;
|
|
13
|
+
if (!privateKey) {
|
|
14
|
+
throw new Error(
|
|
15
|
+
"BlockRun requires a wallet private key. Set BASE_CHAIN_WALLET_KEY in agent settings or environment."
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
const apiUrl = runtime.getSetting("BLOCKRUN_API_URL") || "https://blockrun.ai/api";
|
|
19
|
+
const client = new LLMClient({
|
|
20
|
+
privateKey,
|
|
21
|
+
apiUrl
|
|
22
|
+
});
|
|
23
|
+
clientCache.set(agentId, client);
|
|
24
|
+
return client;
|
|
25
|
+
}
|
|
26
|
+
var blockrunChatAction = {
|
|
27
|
+
name: "BLOCKRUN_CHAT",
|
|
28
|
+
similes: ["BLOCKRUN_AI", "PAY_PER_REQUEST", "X402_CHAT", "MICROPAY_AI"],
|
|
29
|
+
description: "Make a pay-per-request AI call using BlockRun x402 protocol. Automatically handles micropayments in USDC on Base chain. Supports multiple AI providers: OpenAI (gpt-4o, gpt-4o-mini), Anthropic (claude-sonnet-4, claude-3.5-haiku), Google (gemini-2.0-flash), and more.",
|
|
30
|
+
validate: async (runtime) => {
|
|
31
|
+
try {
|
|
32
|
+
const privateKey = runtime.getSetting("BASE_CHAIN_WALLET_KEY") || runtime.getSetting("BLOCKRUN_WALLET_KEY") || process.env.BASE_CHAIN_WALLET_KEY;
|
|
33
|
+
if (!privateKey) {
|
|
34
|
+
logger.warn({
|
|
35
|
+
src: "plugin:blockrun:action:chat",
|
|
36
|
+
agentId: runtime.agentId
|
|
37
|
+
}, "BlockRun wallet key not configured");
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
return true;
|
|
41
|
+
} catch (error) {
|
|
42
|
+
logger.error({
|
|
43
|
+
src: "plugin:blockrun:action:chat",
|
|
44
|
+
error: error instanceof Error ? error.message : String(error)
|
|
45
|
+
}, "Error validating BlockRun action");
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
handler: async (runtime, message, _state, options, callback) => {
|
|
50
|
+
const startTime = Date.now();
|
|
51
|
+
try {
|
|
52
|
+
const client = getClient(runtime);
|
|
53
|
+
const prompt = message.content?.text || "";
|
|
54
|
+
if (!prompt) {
|
|
55
|
+
return {
|
|
56
|
+
text: "No prompt provided for BlockRun chat",
|
|
57
|
+
values: { success: false, error: "No prompt" },
|
|
58
|
+
data: { actionName: "BLOCKRUN_CHAT" },
|
|
59
|
+
success: false
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
const model = options?.model || runtime.getSetting("BLOCKRUN_DEFAULT_MODEL") || "openai/gpt-4o-mini";
|
|
63
|
+
const systemPrompt = options?.system || runtime.character?.system || void 0;
|
|
64
|
+
const chatOptions = {
|
|
65
|
+
system: systemPrompt,
|
|
66
|
+
maxTokens: options?.maxTokens || 1024,
|
|
67
|
+
temperature: options?.temperature
|
|
68
|
+
};
|
|
69
|
+
logger.info({
|
|
70
|
+
src: "plugin:blockrun:action:chat",
|
|
71
|
+
agentId: runtime.agentId,
|
|
72
|
+
model,
|
|
73
|
+
promptLength: prompt.length
|
|
74
|
+
}, "Making BlockRun API call");
|
|
75
|
+
const response = await client.chat(model, prompt, chatOptions);
|
|
76
|
+
const latency = Date.now() - startTime;
|
|
77
|
+
logger.info({
|
|
78
|
+
src: "plugin:blockrun:action:chat",
|
|
79
|
+
agentId: runtime.agentId,
|
|
80
|
+
model,
|
|
81
|
+
responseLength: response.length,
|
|
82
|
+
latencyMs: latency
|
|
83
|
+
}, "BlockRun call completed");
|
|
84
|
+
if (callback) {
|
|
85
|
+
await callback({
|
|
86
|
+
text: response,
|
|
87
|
+
actions: ["BLOCKRUN_CHAT"]
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
return {
|
|
91
|
+
text: response,
|
|
92
|
+
values: {
|
|
93
|
+
success: true,
|
|
94
|
+
model,
|
|
95
|
+
responseLength: response.length,
|
|
96
|
+
latencyMs: latency,
|
|
97
|
+
walletAddress: client.getWalletAddress()
|
|
98
|
+
},
|
|
99
|
+
data: {
|
|
100
|
+
actionName: "BLOCKRUN_CHAT",
|
|
101
|
+
model,
|
|
102
|
+
prompt,
|
|
103
|
+
response,
|
|
104
|
+
latencyMs: latency
|
|
105
|
+
},
|
|
106
|
+
success: true
|
|
107
|
+
};
|
|
108
|
+
} catch (error) {
|
|
109
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
110
|
+
logger.error({
|
|
111
|
+
src: "plugin:blockrun:action:chat",
|
|
112
|
+
agentId: runtime.agentId,
|
|
113
|
+
error: errorMessage
|
|
114
|
+
}, "BlockRun chat failed");
|
|
115
|
+
return {
|
|
116
|
+
text: `BlockRun error: ${errorMessage}`,
|
|
117
|
+
values: {
|
|
118
|
+
success: false,
|
|
119
|
+
error: errorMessage
|
|
120
|
+
},
|
|
121
|
+
data: {
|
|
122
|
+
actionName: "BLOCKRUN_CHAT",
|
|
123
|
+
error: errorMessage
|
|
124
|
+
},
|
|
125
|
+
success: false,
|
|
126
|
+
error: error instanceof Error ? error : new Error(errorMessage)
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
examples: [
|
|
131
|
+
[
|
|
132
|
+
{
|
|
133
|
+
name: "{{name1}}",
|
|
134
|
+
content: {
|
|
135
|
+
text: "Ask BlockRun AI: What is the capital of France?"
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
name: "{{name2}}",
|
|
140
|
+
content: {
|
|
141
|
+
text: "The capital of France is Paris.",
|
|
142
|
+
actions: ["BLOCKRUN_CHAT"]
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
],
|
|
146
|
+
[
|
|
147
|
+
{
|
|
148
|
+
name: "{{name1}}",
|
|
149
|
+
content: {
|
|
150
|
+
text: "Use x402 to query: Explain smart contracts in one sentence."
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
name: "{{name2}}",
|
|
155
|
+
content: {
|
|
156
|
+
text: "Smart contracts are self-executing programs on a blockchain that automatically enforce agreement terms when conditions are met.",
|
|
157
|
+
actions: ["BLOCKRUN_CHAT"]
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
],
|
|
161
|
+
[
|
|
162
|
+
{
|
|
163
|
+
name: "{{name1}}",
|
|
164
|
+
content: {
|
|
165
|
+
text: "Pay-per-request: Generate a haiku about crypto payments."
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
name: "{{name2}}",
|
|
170
|
+
content: {
|
|
171
|
+
text: "Digital coins flow\nMicropayments stream like rain\nValue finds its way",
|
|
172
|
+
actions: ["BLOCKRUN_CHAT"]
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
]
|
|
176
|
+
]
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
// src/providers/wallet.ts
|
|
180
|
+
import { privateKeyToAccount } from "viem/accounts";
|
|
181
|
+
import { createPublicClient, http, formatUnits } from "viem";
|
|
182
|
+
import { base } from "viem/chains";
|
|
183
|
+
var USDC_BASE = "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913";
|
|
184
|
+
var ERC20_ABI = [
|
|
185
|
+
{
|
|
186
|
+
constant: true,
|
|
187
|
+
inputs: [{ name: "_owner", type: "address" }],
|
|
188
|
+
name: "balanceOf",
|
|
189
|
+
outputs: [{ name: "balance", type: "uint256" }],
|
|
190
|
+
type: "function"
|
|
191
|
+
}
|
|
192
|
+
];
|
|
193
|
+
var blockrunWalletProvider = {
|
|
194
|
+
name: "BLOCKRUN_WALLET",
|
|
195
|
+
get: async (runtime, _message) => {
|
|
196
|
+
try {
|
|
197
|
+
const privateKey = runtime.getSetting("BASE_CHAIN_WALLET_KEY") || runtime.getSetting("BLOCKRUN_WALLET_KEY") || process.env.BASE_CHAIN_WALLET_KEY;
|
|
198
|
+
if (!privateKey) {
|
|
199
|
+
return {
|
|
200
|
+
data: {
|
|
201
|
+
configured: false
|
|
202
|
+
},
|
|
203
|
+
values: {
|
|
204
|
+
walletConfigured: "false"
|
|
205
|
+
},
|
|
206
|
+
text: "BlockRun wallet is not configured. Set BASE_CHAIN_WALLET_KEY to enable x402 micropayments."
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
const account = privateKeyToAccount(privateKey);
|
|
210
|
+
const address = account.address;
|
|
211
|
+
const publicClient = createPublicClient({
|
|
212
|
+
chain: base,
|
|
213
|
+
transport: http()
|
|
214
|
+
});
|
|
215
|
+
let usdcBalance = "0";
|
|
216
|
+
let usdcBalanceRaw = BigInt(0);
|
|
217
|
+
try {
|
|
218
|
+
usdcBalanceRaw = await publicClient.readContract({
|
|
219
|
+
address: USDC_BASE,
|
|
220
|
+
abi: ERC20_ABI,
|
|
221
|
+
functionName: "balanceOf",
|
|
222
|
+
args: [address]
|
|
223
|
+
});
|
|
224
|
+
usdcBalance = formatUnits(usdcBalanceRaw, 6);
|
|
225
|
+
} catch {
|
|
226
|
+
}
|
|
227
|
+
let ethBalance = "0";
|
|
228
|
+
try {
|
|
229
|
+
const ethBalanceRaw = await publicClient.getBalance({ address });
|
|
230
|
+
ethBalance = formatUnits(ethBalanceRaw, 18);
|
|
231
|
+
} catch {
|
|
232
|
+
}
|
|
233
|
+
return {
|
|
234
|
+
data: {
|
|
235
|
+
configured: true,
|
|
236
|
+
address,
|
|
237
|
+
usdcBalance: usdcBalanceRaw.toString(),
|
|
238
|
+
ethBalance,
|
|
239
|
+
chain: "base",
|
|
240
|
+
chainId: 8453
|
|
241
|
+
},
|
|
242
|
+
values: {
|
|
243
|
+
walletConfigured: "true",
|
|
244
|
+
walletAddress: address,
|
|
245
|
+
usdcBalance: `${usdcBalance} USDC`,
|
|
246
|
+
ethBalance: `${ethBalance} ETH`
|
|
247
|
+
},
|
|
248
|
+
text: `BlockRun wallet is configured. Address: ${address}. USDC balance: ${usdcBalance} USDC on Base. This wallet is used for x402 micropayments when making AI API calls.`
|
|
249
|
+
};
|
|
250
|
+
} catch (error) {
|
|
251
|
+
return {
|
|
252
|
+
data: {
|
|
253
|
+
configured: false,
|
|
254
|
+
error: error instanceof Error ? error.message : String(error)
|
|
255
|
+
},
|
|
256
|
+
values: {
|
|
257
|
+
walletConfigured: "false",
|
|
258
|
+
error: error instanceof Error ? error.message : "Unknown error"
|
|
259
|
+
},
|
|
260
|
+
text: "Failed to get BlockRun wallet information."
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
// src/index.ts
|
|
267
|
+
var blockrunPlugin = {
|
|
268
|
+
name: "blockrun",
|
|
269
|
+
description: "Pay-per-request AI via x402 micropayments on Base. Access OpenAI, Anthropic, Google, and more without API keys.",
|
|
270
|
+
actions: [blockrunChatAction],
|
|
271
|
+
providers: [blockrunWalletProvider],
|
|
272
|
+
evaluators: [],
|
|
273
|
+
services: []
|
|
274
|
+
};
|
|
275
|
+
var index_default = blockrunPlugin;
|
|
276
|
+
export {
|
|
277
|
+
blockrunChatAction,
|
|
278
|
+
blockrunPlugin,
|
|
279
|
+
blockrunWalletProvider,
|
|
280
|
+
index_default as default
|
|
281
|
+
};
|
|
282
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/actions/chat.ts","../src/providers/wallet.ts","../src/index.ts"],"sourcesContent":["import {\n type Action,\n type ActionExample,\n type ActionResult,\n type HandlerCallback,\n type HandlerOptions,\n type IAgentRuntime,\n type Memory,\n type State,\n logger,\n} from '@elizaos/core';\nimport { LLMClient, type ChatOptions } from '@blockrun/llm';\n\n/**\n * BlockRun Chat Action - Pay-per-request AI via x402 micropayments on Base.\n *\n * This action enables ElizaOS agents to make LLM API calls using the x402 protocol,\n * paying with USDC on Base chain. Supports OpenAI, Anthropic, Google, and other models.\n */\n\n// Cache client instances per agent to avoid recreating\nconst clientCache = new Map<string, LLMClient>();\n\nfunction getClient(runtime: IAgentRuntime): LLMClient {\n const agentId = runtime.agentId;\n\n if (clientCache.has(agentId)) {\n return clientCache.get(agentId)!;\n }\n\n // Get private key from runtime settings or environment\n const privateKey = runtime.getSetting('BASE_CHAIN_WALLET_KEY') ||\n runtime.getSetting('BLOCKRUN_WALLET_KEY') ||\n process.env.BASE_CHAIN_WALLET_KEY;\n\n if (!privateKey) {\n throw new Error(\n 'BlockRun requires a wallet private key. Set BASE_CHAIN_WALLET_KEY in agent settings or environment.'\n );\n }\n\n const apiUrl = runtime.getSetting('BLOCKRUN_API_URL') as string | undefined || 'https://blockrun.ai/api';\n\n const client = new LLMClient({\n privateKey: privateKey as `0x${string}`,\n apiUrl: apiUrl as string,\n });\n\n clientCache.set(agentId, client);\n return client;\n}\n\nexport const blockrunChatAction: Action = {\n name: 'BLOCKRUN_CHAT',\n similes: ['BLOCKRUN_AI', 'PAY_PER_REQUEST', 'X402_CHAT', 'MICROPAY_AI'],\n description:\n 'Make a pay-per-request AI call using BlockRun x402 protocol. ' +\n 'Automatically handles micropayments in USDC on Base chain. ' +\n 'Supports multiple AI providers: OpenAI (gpt-4o, gpt-4o-mini), Anthropic (claude-sonnet-4, claude-3.5-haiku), Google (gemini-2.0-flash), and more.',\n\n validate: async (runtime: IAgentRuntime): Promise<boolean> => {\n try {\n const privateKey = runtime.getSetting('BASE_CHAIN_WALLET_KEY') ||\n runtime.getSetting('BLOCKRUN_WALLET_KEY') ||\n process.env.BASE_CHAIN_WALLET_KEY;\n\n if (!privateKey) {\n logger.warn({\n src: 'plugin:blockrun:action:chat',\n agentId: runtime.agentId,\n }, 'BlockRun wallet key not configured');\n return false;\n }\n\n return true;\n } catch (error) {\n logger.error({\n src: 'plugin:blockrun:action:chat',\n error: error instanceof Error ? error.message : String(error),\n }, 'Error validating BlockRun action');\n return false;\n }\n },\n\n handler: async (\n runtime: IAgentRuntime,\n message: Memory,\n _state?: State,\n options?: HandlerOptions,\n callback?: HandlerCallback\n ): Promise<ActionResult> => {\n const startTime = Date.now();\n\n try {\n const client = getClient(runtime);\n\n // Extract the prompt from the message\n const prompt = message.content?.text || '';\n if (!prompt) {\n return {\n text: 'No prompt provided for BlockRun chat',\n values: { success: false, error: 'No prompt' },\n data: { actionName: 'BLOCKRUN_CHAT' },\n success: false,\n };\n }\n\n // Get model from options or use default\n const model = ((options as Record<string, unknown>)?.model as string) ||\n (runtime.getSetting('BLOCKRUN_DEFAULT_MODEL') as string) ||\n 'openai/gpt-4o-mini';\n\n // Get system prompt from character or options\n const systemPrompt = (options as Record<string, unknown>)?.system as string ||\n runtime.character?.system ||\n undefined;\n\n // Build chat options\n const chatOptions: ChatOptions = {\n system: systemPrompt,\n maxTokens: (options as Record<string, unknown>)?.maxTokens as number || 1024,\n temperature: (options as Record<string, unknown>)?.temperature as number,\n };\n\n logger.info({\n src: 'plugin:blockrun:action:chat',\n agentId: runtime.agentId,\n model,\n promptLength: prompt.length,\n }, 'Making BlockRun API call');\n\n // Make the pay-per-request call\n const response = await client.chat(model, prompt, chatOptions);\n\n const latency = Date.now() - startTime;\n\n logger.info({\n src: 'plugin:blockrun:action:chat',\n agentId: runtime.agentId,\n model,\n responseLength: response.length,\n latencyMs: latency,\n }, 'BlockRun call completed');\n\n // Send response via callback if provided\n if (callback) {\n await callback({\n text: response,\n actions: ['BLOCKRUN_CHAT'],\n });\n }\n\n return {\n text: response,\n values: {\n success: true,\n model,\n responseLength: response.length,\n latencyMs: latency,\n walletAddress: client.getWalletAddress(),\n },\n data: {\n actionName: 'BLOCKRUN_CHAT',\n model,\n prompt,\n response,\n latencyMs: latency,\n },\n success: true,\n };\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : String(error);\n\n logger.error({\n src: 'plugin:blockrun:action:chat',\n agentId: runtime.agentId,\n error: errorMessage,\n }, 'BlockRun chat failed');\n\n return {\n text: `BlockRun error: ${errorMessage}`,\n values: {\n success: false,\n error: errorMessage,\n },\n data: {\n actionName: 'BLOCKRUN_CHAT',\n error: errorMessage,\n },\n success: false,\n error: error instanceof Error ? error : new Error(errorMessage),\n };\n }\n },\n\n examples: [\n [\n {\n name: '{{name1}}',\n content: {\n text: 'Ask BlockRun AI: What is the capital of France?',\n },\n },\n {\n name: '{{name2}}',\n content: {\n text: 'The capital of France is Paris.',\n actions: ['BLOCKRUN_CHAT'],\n },\n },\n ],\n [\n {\n name: '{{name1}}',\n content: {\n text: 'Use x402 to query: Explain smart contracts in one sentence.',\n },\n },\n {\n name: '{{name2}}',\n content: {\n text: 'Smart contracts are self-executing programs on a blockchain that automatically enforce agreement terms when conditions are met.',\n actions: ['BLOCKRUN_CHAT'],\n },\n },\n ],\n [\n {\n name: '{{name1}}',\n content: {\n text: 'Pay-per-request: Generate a haiku about crypto payments.',\n },\n },\n {\n name: '{{name2}}',\n content: {\n text: 'Digital coins flow\\nMicropayments stream like rain\\nValue finds its way',\n actions: ['BLOCKRUN_CHAT'],\n },\n },\n ],\n ] as ActionExample[][],\n};\n\nexport default blockrunChatAction;\n","import type { IAgentRuntime, Memory, Provider } from '@elizaos/core';\nimport { privateKeyToAccount } from 'viem/accounts';\nimport { createPublicClient, http, formatUnits } from 'viem';\nimport { base } from 'viem/chains';\n\n// USDC contract on Base\nconst USDC_BASE = '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913' as const;\n\n// Minimal ERC-20 ABI for balance check\nconst ERC20_ABI = [\n {\n constant: true,\n inputs: [{ name: '_owner', type: 'address' }],\n name: 'balanceOf',\n outputs: [{ name: 'balance', type: 'uint256' }],\n type: 'function',\n },\n] as const;\n\n/**\n * BlockRun Wallet Provider - Provides wallet address and USDC balance on Base.\n *\n * This provider gives the agent context about its payment wallet,\n * including address and available USDC balance for x402 micropayments.\n */\nexport const blockrunWalletProvider: Provider = {\n name: 'BLOCKRUN_WALLET',\n get: async (runtime: IAgentRuntime, _message: Memory) => {\n try {\n // Get private key from settings\n const privateKey = runtime.getSetting('BASE_CHAIN_WALLET_KEY') ||\n runtime.getSetting('BLOCKRUN_WALLET_KEY') ||\n process.env.BASE_CHAIN_WALLET_KEY;\n\n if (!privateKey) {\n return {\n data: {\n configured: false,\n },\n values: {\n walletConfigured: 'false',\n },\n text: 'BlockRun wallet is not configured. Set BASE_CHAIN_WALLET_KEY to enable x402 micropayments.',\n };\n }\n\n // Derive address from private key\n const account = privateKeyToAccount(privateKey as `0x${string}`);\n const address = account.address;\n\n // Create public client for balance query\n const publicClient = createPublicClient({\n chain: base,\n transport: http(),\n });\n\n // Get USDC balance\n let usdcBalance = '0';\n let usdcBalanceRaw = BigInt(0);\n\n try {\n usdcBalanceRaw = await publicClient.readContract({\n address: USDC_BASE,\n abi: ERC20_ABI,\n functionName: 'balanceOf',\n args: [address],\n }) as bigint;\n usdcBalance = formatUnits(usdcBalanceRaw, 6); // USDC has 6 decimals\n } catch {\n // Balance check failed, continue with 0\n }\n\n // Get ETH balance for gas\n let ethBalance = '0';\n try {\n const ethBalanceRaw = await publicClient.getBalance({ address });\n ethBalance = formatUnits(ethBalanceRaw, 18);\n } catch {\n // ETH balance check failed\n }\n\n return {\n data: {\n configured: true,\n address,\n usdcBalance: usdcBalanceRaw.toString(),\n ethBalance,\n chain: 'base',\n chainId: 8453,\n },\n values: {\n walletConfigured: 'true',\n walletAddress: address,\n usdcBalance: `${usdcBalance} USDC`,\n ethBalance: `${ethBalance} ETH`,\n },\n text: `BlockRun wallet is configured. Address: ${address}. USDC balance: ${usdcBalance} USDC on Base. This wallet is used for x402 micropayments when making AI API calls.`,\n };\n } catch (error) {\n return {\n data: {\n configured: false,\n error: error instanceof Error ? error.message : String(error),\n },\n values: {\n walletConfigured: 'false',\n error: error instanceof Error ? error.message : 'Unknown error',\n },\n text: 'Failed to get BlockRun wallet information.',\n };\n }\n },\n};\n\nexport default blockrunWalletProvider;\n","/**\n * @elizaos/plugin-blockrun\n *\n * BlockRun x402 pay-per-request AI plugin for ElizaOS.\n *\n * This plugin enables ElizaOS agents to make LLM API calls using the x402 protocol,\n * paying with USDC micropayments on Base chain. No API keys required - just a wallet.\n *\n * Features:\n * - Pay-per-request AI access (OpenAI, Anthropic, Google, etc.)\n * - Automatic x402 micropayment handling\n * - USDC payments on Base chain\n * - Wallet balance provider for agent context\n *\n * Configuration:\n * Set BASE_CHAIN_WALLET_KEY in your agent settings or environment.\n *\n * @example\n * ```typescript\n * import { blockrunPlugin } from '@elizaos/plugin-blockrun';\n *\n * const agent = new Agent({\n * plugins: [blockrunPlugin],\n * settings: {\n * BASE_CHAIN_WALLET_KEY: '0x...',\n * },\n * });\n * ```\n *\n * @see https://blockrun.ai\n * @see https://x402.org\n */\n\nimport type { Plugin } from '@elizaos/core';\nimport { blockrunChatAction } from './actions/chat';\nimport { blockrunWalletProvider } from './providers/wallet';\n\n// Re-export individual components\nexport * from './actions';\nexport * from './providers';\n\n/**\n * BlockRun Plugin for ElizaOS\n *\n * Enables pay-per-request AI via x402 micropayments on Base.\n */\nexport const blockrunPlugin: Plugin = {\n name: 'blockrun',\n description: 'Pay-per-request AI via x402 micropayments on Base. Access OpenAI, Anthropic, Google, and more without API keys.',\n actions: [blockrunChatAction],\n providers: [blockrunWalletProvider],\n evaluators: [],\n services: [],\n};\n\nexport default blockrunPlugin;\n"],"mappings":";AA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,QACA,QAAQ;AAAA,UACN,kBAAkB;AAAA,UAClB,eAAe;AAAA,UACf,aAAa,GAAG,WAAW;AAAA,UAC3B,YAAY,GAAG,UAAU;AAAA,QAC3B;AAAA,QACA,MAAM,2CAA2C,OAAO,mBAAmB,WAAW;AAAA,MACxF;AAAA,IACF,SAAS,OAAO;AACd,aAAO;AAAA,QACL,MAAM;AAAA,UACJ,YAAY;AAAA,UACZ,OAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAAA,QAC9D;AAAA,QACA,QAAQ;AAAA,UACN,kBAAkB;AAAA,UAClB,OAAO,iBAAiB,QAAQ,MAAM,UAAU;AAAA,QAClD;AAAA,QACA,MAAM;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACF;;;AClEO,IAAM,iBAAyB;AAAA,EACpC,MAAM;AAAA,EACN,aAAa;AAAA,EACb,SAAS,CAAC,kBAAkB;AAAA,EAC5B,WAAW,CAAC,sBAAsB;AAAA,EAClC,YAAY,CAAC;AAAA,EACb,UAAU,CAAC;AACb;AAEA,IAAO,gBAAQ;","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@blockrun/elizaos-plugin",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"description": "BlockRun x402 pay-per-request AI plugin for ElizaOS - enables agents to make micropayments for AI API calls on Base",
|
|
9
|
+
"keywords": [
|
|
10
|
+
"elizaos",
|
|
11
|
+
"plugin",
|
|
12
|
+
"blockrun",
|
|
13
|
+
"x402",
|
|
14
|
+
"micropayments",
|
|
15
|
+
"ai",
|
|
16
|
+
"base",
|
|
17
|
+
"usdc"
|
|
18
|
+
],
|
|
19
|
+
"author": "BlockRun <hello@blockrun.ai>",
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "https://github.com/blockrunai/elizaos-plugin-blockrun"
|
|
24
|
+
},
|
|
25
|
+
"homepage": "https://blockrun.ai",
|
|
26
|
+
"bugs": {
|
|
27
|
+
"url": "https://github.com/blockrunai/elizaos-plugin-blockrun/issues"
|
|
28
|
+
},
|
|
29
|
+
"exports": {
|
|
30
|
+
"./package.json": "./package.json",
|
|
31
|
+
".": {
|
|
32
|
+
"import": {
|
|
33
|
+
"types": "./dist/index.d.ts",
|
|
34
|
+
"default": "./dist/index.js"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"files": [
|
|
39
|
+
"dist",
|
|
40
|
+
"package.json",
|
|
41
|
+
"README.md",
|
|
42
|
+
"LICENSE"
|
|
43
|
+
],
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"@blockrun/llm": "^0.1.1",
|
|
46
|
+
"viem": "^2.21.0"
|
|
47
|
+
},
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"@elizaos/core": ">=1.0.0"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@elizaos/core": "^1.0.0",
|
|
53
|
+
"@types/node": "^22.10.1",
|
|
54
|
+
"tsup": "^8.3.5",
|
|
55
|
+
"typescript": "^5.7.2"
|
|
56
|
+
},
|
|
57
|
+
"scripts": {
|
|
58
|
+
"build": "tsup",
|
|
59
|
+
"dev": "tsup --watch",
|
|
60
|
+
"clean": "rm -rf dist node_modules",
|
|
61
|
+
"prepublishOnly": "npm run build",
|
|
62
|
+
"test": "bun test",
|
|
63
|
+
"test:e2e": "bun run test-e2e.ts"
|
|
64
|
+
},
|
|
65
|
+
"publishConfig": {
|
|
66
|
+
"access": "public"
|
|
67
|
+
}
|
|
68
|
+
}
|