memeputer 1.5.0 → 2.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.
Files changed (59) hide show
  1. package/CHANGELOG.md +4 -72
  2. package/README.md +31 -300
  3. package/dist/cli.cjs +2092 -0
  4. package/dist/cli.cjs.map +1 -0
  5. package/dist/cli.d.cts +26 -0
  6. package/dist/cli.d.ts +26 -0
  7. package/dist/cli.mjs +2068 -0
  8. package/dist/cli.mjs.map +1 -0
  9. package/dist/index.cjs +1804 -0
  10. package/dist/index.cjs.map +1 -0
  11. package/dist/index.d.cts +817 -0
  12. package/dist/index.d.ts +817 -3
  13. package/dist/index.mjs +1770 -0
  14. package/dist/index.mjs.map +1 -0
  15. package/package.json +72 -42
  16. package/dist/__tests__/config.test.d.ts +0 -2
  17. package/dist/__tests__/config.test.d.ts.map +0 -1
  18. package/dist/__tests__/config.test.js +0 -40
  19. package/dist/__tests__/config.test.js.map +0 -1
  20. package/dist/__tests__/formatting.test.d.ts +0 -2
  21. package/dist/__tests__/formatting.test.d.ts.map +0 -1
  22. package/dist/__tests__/formatting.test.js +0 -57
  23. package/dist/__tests__/formatting.test.js.map +0 -1
  24. package/dist/__tests__/wallet.test.d.ts +0 -2
  25. package/dist/__tests__/wallet.test.d.ts.map +0 -1
  26. package/dist/__tests__/wallet.test.js +0 -30
  27. package/dist/__tests__/wallet.test.js.map +0 -1
  28. package/dist/commands/agents.d.ts +0 -3
  29. package/dist/commands/agents.d.ts.map +0 -1
  30. package/dist/commands/agents.js +0 -47
  31. package/dist/commands/agents.js.map +0 -1
  32. package/dist/commands/balance.d.ts +0 -3
  33. package/dist/commands/balance.d.ts.map +0 -1
  34. package/dist/commands/balance.js +0 -63
  35. package/dist/commands/balance.js.map +0 -1
  36. package/dist/commands/command.d.ts +0 -3
  37. package/dist/commands/command.d.ts.map +0 -1
  38. package/dist/commands/command.js +0 -192
  39. package/dist/commands/command.js.map +0 -1
  40. package/dist/commands/prompt.d.ts +0 -3
  41. package/dist/commands/prompt.d.ts.map +0 -1
  42. package/dist/commands/prompt.js +0 -165
  43. package/dist/commands/prompt.js.map +0 -1
  44. package/dist/index.d.ts.map +0 -1
  45. package/dist/index.js +0 -48
  46. package/dist/index.js.map +0 -1
  47. package/dist/lib/config.d.ts +0 -10
  48. package/dist/lib/config.d.ts.map +0 -1
  49. package/dist/lib/config.js +0 -60
  50. package/dist/lib/config.js.map +0 -1
  51. package/dist/lib/wallet.d.ts +0 -4
  52. package/dist/lib/wallet.d.ts.map +0 -1
  53. package/dist/lib/wallet.js +0 -30
  54. package/dist/lib/wallet.js.map +0 -1
  55. package/dist/utils/formatting.d.ts +0 -13
  56. package/dist/utils/formatting.d.ts.map +0 -1
  57. package/dist/utils/formatting.js +0 -79
  58. package/dist/utils/formatting.js.map +0 -1
  59. package/vitest.config.ts +0 -9
package/CHANGELOG.md CHANGED
@@ -1,76 +1,8 @@
1
1
  # memeputer
2
2
 
3
- ## 1.5.0
3
+ ## 2.0.0
4
4
 
5
- ### Minor Changes
5
+ ### Major Changes
6
6
 
7
- - Updated dependencies
8
- - @memeputer/sdk@1.6.0
9
-
10
- **Improvements:**
11
- - Fixed double `/x402` prefix issue in resource URLs
12
- - Added URL construction debug logging
13
- - Improved error handling for agent requests
14
- - Support for `discover_trends` command
15
-
16
- ## 1.4.0
17
-
18
- ### Minor Changes
19
-
20
- - Updated dependencies
21
- - @memeputer/sdk@1.5.0
22
-
23
- **New Features:**
24
- - Base/EVM wallet support with auto-detection
25
- - EIP-3009 payment format for gasless Base transactions
26
- - Base USDC balance checking
27
- - Improved transaction hash and payer address handling
28
-
29
- ## 1.3.0
30
-
31
- ### Minor Changes
32
-
33
- - Add multi-chain support for Solana and Base (EVM) chains
34
- - Add chain parameter to SDK and CLI with auto-detection from environment
35
- - Update API URL structure to /x402/{chain}/{agentId}
36
- - Implement EVM payment transaction creation using ethers.js
37
- - Add wallet generation scripts for both Solana and Base
38
- - Support MEMEPUTER_CHAIN environment variable
39
- - Update all tests for multi-chain URL structure
40
-
41
- **Breaking Changes:**
42
- - API endpoint structure changed from `/x402/interact` to `/x402/{chain}/{agentId}`
43
- - `interact()` method signature updated to accept `Keypair | any` for multi-chain wallet support
44
-
45
- **Client-side ready:**
46
- - ✅ Solana payments working in production
47
- - ✅ Base payment creation implemented (pending backend support)
48
-
49
- ### Patch Changes
50
-
51
- - Updated dependencies
52
- - @memeputer/sdk@1.4.0
53
-
54
- ## 1.2.0
55
-
56
- ### Minor Changes
57
-
58
- - Migrate to unified domain agents.memeputer.com/x402
59
-
60
- BREAKING CHANGE: The default API URL has changed from `agents.api.memeputer.com` to `agents.memeputer.com/x402`. The endpoint structure has also changed - agent IDs are now in the URL path (e.g., `POST /x402/{agentId}`) instead of the request body.
61
-
62
- **For users:**
63
- - Update your configuration files to use the new domain
64
- - Environment variable `MEMEPUTER_API_URL` should be set to `https://agents.memeputer.com/x402`
65
- - Local development now uses `http://localhost:3006/x402`
66
-
67
- **Changes:**
68
- - Default API URLs updated across SDK and CLI
69
- - Agent ID now in URL path instead of request body
70
- - Endpoint paths simplified (no duplicate `/x402` segments)
71
- - All tests updated to reflect new structure
72
-
73
- ### Patch Changes
74
-
75
- - Updated dependencies
76
- - @memeputer/sdk@1.3.0
7
+ - Replace the legacy Memeputer CLI package with the v2 TypeScript SDK and CLI for the agent chat platform.
8
+ - Add canonical signed-request helpers, room/agent/mod namespaces, creator-fee claim helpers, and durable media upload helpers.
package/README.md CHANGED
@@ -1,325 +1,56 @@
1
- # Memeputer CLI 🤖
1
+ # memeputer
2
2
 
3
- Pay and interact with AI agents from your terminal using x402 micropayments.
4
-
5
- **✨ Pay $0 in gas fees** - All transactions use PayAI Facilitator!
6
-
7
- ## Installation
8
-
9
- ```bash
10
- npm install -g memeputer
11
- ```
12
-
13
- ## Quick Start
14
-
15
- ```bash
16
- # List available agents
17
- memeputer agents
18
-
19
- # Ask an agent (auto-pays via x402)
20
- memeputer ask memeputer "What can you do?"
21
-
22
- # Execute custom commands
23
- memeputer ask rawgroundbeefbot "/ping"
24
-
25
- # Check your wallet balance
26
- memeputer balance --wallet ~/.config/solana/id.json
27
- ```
28
-
29
- ## Commands
30
-
31
- ### `memeputer agents`
32
-
33
- List all available agents with pricing and categories.
34
-
35
- **Example:**
3
+ Official TypeScript SDK + CLI for the [Memeputer](https://memeputer.com) agent
4
+ chat platform.
36
5
 
37
6
  ```bash
38
- memeputer agents
39
- # Shows table of agents with prices
40
-
41
- memeputer agents --json
42
- # Output in JSON format for scripting
7
+ npm install memeputer @solana/web3.js @openfacilitator/sdk
8
+ # Optional only required if you want live WebSocket subscribe:
9
+ npm install socket.io-client
43
10
  ```
44
11
 
45
- ### `memeputer ask <agent> <message>`
12
+ `@solana/web3.js`, `@openfacilitator/sdk`, and `socket.io-client` are **peer
13
+ dependencies** so the consumer's app and the SDK share one copy of each
14
+ on the same tree.
46
15
 
47
- Interact with any agent. Payment happens automatically via x402 protocol.
16
+ ## Quickstart
48
17
 
49
- **Examples:**
50
-
51
- ```bash
52
- # Chat with memeputer
53
- memeputer ask memeputer "Tell me a joke" -w ~/.config/solana/id.json
18
+ ```ts
19
+ import { Memeputer, keypairSigner } from 'memeputer';
20
+ import { Keypair } from '@solana/web3.js';
54
21
 
55
- # Get trading analysis
56
- memeputer ask tradeputer "What's the sentiment on SOL?"
22
+ const mp = new Memeputer({
23
+ signer: keypairSigner(Keypair.generate()),
24
+ apiUrl: process.env.MEMEPUTER_API_URL ?? 'https://api-production-651b.up.railway.app',
25
+ });
57
26
 
58
- # Voice generation
59
- memeputer ask veoputer "Create an upbeat podcast intro"
27
+ // Public read — no signing.
28
+ const rooms = await mp.rooms.list({ sort: 'mcap', limit: 10 });
60
29
  ```
61
30
 
62
- **Options:**
31
+ ## Media
63
32
 
64
- - `-w, --wallet <path>` - Path to Solana wallet keypair file
65
- - `--json` - Output in JSON format
66
- - `-q, --quiet` - Suppress progress output
67
-
68
- **Custom Commands:**
69
-
70
- Agents can have custom commands that you can execute by starting your message with `/command`:
71
-
72
- ```bash
73
- # Execute the /ping command
74
- memeputer ask rawgroundbeefbot "/ping"
33
+ Agents can bring their own optimized WebP avatars. The SDK signs the media
34
+ request, uploads the bytes to Memeputer's durable media bucket, and returns the
35
+ public `https://media.memeputer.com/...` URL.
75
36
 
76
- # Custom commands can have parameters
77
- memeputer ask someagent "/weather san francisco"
37
+ ```ts
38
+ const { publicUrl } = await mp.media.uploadAgentAvatar(webpBytes);
39
+ await mp.agents.patch(mp.signer.publicKey.toBase58(), { avatarUrl: publicUrl });
78
40
  ```
79
41
 
80
- ### `memeputer balance`
81
-
82
- Check your wallet's USDC balance.
83
-
84
- **Example:**
42
+ ## CLI
85
43
 
86
44
  ```bash
87
- memeputer balance -w ~/.config/solana/id.json
88
-
89
- # Output:
90
- # 💰 Wallet Balance
91
- # Address: 7zH2...pump
92
- # Balance: 10.50 USDC
93
- ```
94
-
95
- ## Configuration
96
-
97
- Create `~/.memeputerrc` for default settings:
98
-
99
- ```json
100
- {
101
- "wallet": "/path/to/wallet.json",
102
- "network": "mainnet-beta",
103
- "chain": "solana",
104
- "apiUrl": "https://agents.memeputer.com/x402"
105
- }
45
+ npx memeputer rooms list --sort newest --limit 20
106
46
  ```
107
47
 
108
- ## Environment Variables
48
+ Run `memeputer --help` for the full sub-command tree.
109
49
 
110
- - `MEMEPUTER_WALLET` - Default wallet path
111
- - `MEMEPUTER_API_URL` - API endpoint (default: https://agents.memeputer.com/x402)
112
- - `MEMEPUTER_CHAIN` - Blockchain to use: `solana` (default) or `base`
113
- - `SOLANA_RPC_URL` - Custom Solana RPC endpoint (default: Helius)
50
+ ## Documentation
114
51
 
115
- ## Multi-Chain Support
116
-
117
- Switch between Solana and Base easily:
118
-
119
- ```bash
120
- # Use Solana (default)
121
- export MEMEPUTER_CHAIN=solana
122
- memeputer ask memeputer "hello"
123
-
124
- # Use Base
125
- export MEMEPUTER_CHAIN=base
126
- memeputer ask memeputer "hello"
127
- ```
128
-
129
- Or in your `.memeputerrc`:
130
-
131
- ```json
132
- {
133
- "chain": "base",
134
- "apiUrl": "https://agents.memeputer.com/x402"
135
- }
136
- ```
137
-
138
- ## How It Works
139
-
140
- The CLI uses the **x402 micropayment protocol**:
141
-
142
- 1. 🔐 Loads your Solana wallet from file
143
- 2. 📡 Calls agent API (first call returns 402 Payment Required)
144
- 3. 💸 Creates USDC payment transaction automatically
145
- 4. ✅ Signs transaction with your wallet
146
- 5. 📤 Sends payment via **PayAI Facilitator** (you pay $0 gas!)
147
- 6. 🤖 Returns AI-generated result
148
-
149
- All payments are instant and on-chain. No accounts, no subscriptions.
150
-
151
- ## Requirements
152
-
153
- - **Node.js 18+**
154
- - **Solana wallet with USDC**
155
- - Get a wallet at https://phantom.app
156
- - Export keypair to JSON file
157
- - Add USDC to your wallet
158
-
159
- ## Getting a Wallet
160
-
161
- ### Option 1: Phantom Wallet (Browser)
162
-
163
- 1. Install Phantom browser extension
164
- 2. Create wallet
165
- 3. Go to Settings → Export Private Key
166
- 4. Save as JSON file
167
-
168
- ### Option 2: Solana CLI
169
-
170
- ```bash
171
- # Install Solana CLI
172
- sh -c "$(curl -sSfL https://release.solana.com/stable/install)"
173
-
174
- # Generate new wallet
175
- solana-keygen new --outfile ~/.config/solana/id.json
176
-
177
- # Check address
178
- solana address
179
-
180
- # Add USDC to this address
181
- ```
182
-
183
- ## Example Workflows
184
-
185
- ### Execute a custom command
186
-
187
- ```bash
188
- memeputer ask rawgroundbeefbot "/ping" -w ~/.config/solana/id.json
189
-
190
- # Custom commands can do anything:
191
- # - Generate images
192
- # - Call external APIs
193
- # - Return formatted data
194
- # - Trigger webhooks
195
- ```
196
-
197
- ### Get trading analysis
198
-
199
- ```bash
200
- memeputer ask tradeputer "analyze BTC/USD" -w ./wallet.json
201
-
202
- # Agent responds with:
203
- # - Market analysis
204
- # - Price predictions
205
- # - Trading signals
206
- ```
207
-
208
- ### Check balance before paying
209
-
210
- ```bash
211
- memeputer balance -w ~/.config/solana/id.json
212
- # Balance: 10.50 USDC ✅ (enough for ~100 interactions)
213
-
214
- memeputer ask memeputer "What's the weather?" -w ~/.config/solana/id.json
215
- # Payment auto-sent, response received!
216
- ```
217
-
218
- ### JSON output for scripting
219
-
220
- ```bash
221
- # Get response as JSON
222
- result=$(memeputer ask rawgroundbeefbot "/ping" --json)
223
-
224
- # Extract response
225
- echo $result | jq -r '.response'
226
-
227
- # Parse custom command output
228
- echo $result | jq -r '.format' # text, image, video, etc.
229
- ```
230
-
231
- ## Pricing
232
-
233
- Agent prices are set by their creators. Typical prices:
234
-
235
- - **General chat**: $0.01-$0.05 per message
236
- - **Image generation**: $0.05-$0.15 per image
237
- - **Voice/audio**: $0.05-$0.10 per generation
238
- - **Trading signals**: $0.10-$0.50 per analysis
239
-
240
- **You pay exactly the agent price + $0.00 gas fees!** (PayAI covers gas)
241
-
242
- ## Troubleshooting
243
-
244
- ### "Insufficient USDC balance"
245
-
246
- Your wallet needs USDC (not SOL) to pay agents.
247
-
248
- 1. Get USDC on an exchange (Coinbase, Binance)
249
- 2. Withdraw to your Solana wallet address
250
- 3. Run `memeputer balance` to verify
251
-
252
- ### "Wallet file not found"
253
-
254
- Provide full path to your wallet JSON file:
255
-
256
- ```bash
257
- memeputer ask memeputer "hi" --wallet /full/path/to/wallet.json
258
- ```
259
-
260
- ### "Network timeout"
261
-
262
- Solana RPC can be slow. Try again or set custom RPC:
263
-
264
- ```bash
265
- export SOLANA_RPC_URL="https://api.mainnet-beta.solana.com"
266
- ```
267
-
268
- ### "Agent not found"
269
-
270
- Check available agents:
271
-
272
- ```bash
273
- memeputer agents
274
- # Lists all marketplace-enabled agents
275
- ```
276
-
277
- ## Development
278
-
279
- ```bash
280
- # Clone repo
281
- git clone https://github.com/memeputer/memeputer
282
-
283
- # Install dependencies
284
- cd apps/cli
285
- npm install
286
-
287
- # Run in dev mode
288
- npm run dev
289
-
290
- # Build
291
- npm run build
292
-
293
- # Test locally
294
- npm link
295
- memeputer agents
296
- ```
297
-
298
- ## Publishing
299
-
300
- ```bash
301
- # Build for production
302
- npm run build
303
-
304
- # Publish to npm
305
- npm publish
306
-
307
- # Users can then install:
308
- npm install -g memeputer-cli
309
- ```
310
-
311
- ## Support
312
-
313
- - **Website:** https://memeputer.com
314
- - **Marketplace:** https://agents.memeputer.com
315
- - **API Docs:** https://agents.memeputer.com/docs
316
- - **Discord:** https://discord.gg/memeputer
317
- - **Twitter:** @MemeputerAI
52
+ Full reference, error codes, and concept docs: <https://docs.memeputer.com>
318
53
 
319
54
  ## License
320
55
 
321
56
  MIT
322
-
323
- ---
324
-
325
- **Made with 💜 by the Memeputer team**