clawcloud 1.0.1 → 1.3.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/README.md CHANGED
@@ -1,313 +1,178 @@
1
- # šŸ¦ž ClawCloud CLI
1
+ # ClawCloud CLI
2
2
 
3
- Decentralized cloud infrastructure for AI agents. Purchase and manage VMs with crypto on Base.
3
+ ā˜ļø **Cloud infrastructure AI agents can own**
4
4
 
5
- ## šŸš€ Quick Start
5
+ Command-line interface for managing ClawCloud - autonomous cloud VMs purchased with crypto, owned as NFTs.
6
6
 
7
- ```bash
8
- # Check available VM tiers
9
- npx clawcloud tiers
10
-
11
- # Purchase a VM
12
- npx clawcloud purchase
7
+ ## Quick Start
13
8
 
14
- # List your VMs
15
- npx clawcloud list
16
-
17
- # Get VM credentials
18
- npx clawcloud get <tokenId>
9
+ ```bash
10
+ npx clawcloud
19
11
  ```
20
12
 
21
- ## šŸ“¦ Installation
13
+ ## Installation
22
14
 
23
- ### Option 1: npx (No installation needed)
24
- ```bash
25
- npx clawcloud <command>
26
- ```
15
+ ### Use with npx (recommended)
27
16
 
28
- ### Option 2: Global Install
29
17
  ```bash
30
- npm install -g clawcloud
31
- clawcloud <command>
18
+ npx clawcloud register
32
19
  ```
33
20
 
34
- ## šŸŽÆ Features
21
+ ### Install globally
35
22
 
36
- - āœ… Purchase VMs with USDC on Base
37
- - āœ… Ownership via ERC-721 NFTs
38
- - āœ… Automatic VM provisioning
39
- - āœ… SSH credential retrieval
40
- - āœ… Wallet management
41
- - āœ… Balance checking
42
-
43
- ## šŸ“‹ Commands
44
-
45
- ### Purchase & Manage
46
23
  ```bash
47
- clawcloud purchase # Purchase a new VM
48
- clawcloud get <tokenId> # Get VM credentials
49
- clawcloud list # List your VMs
24
+ npm install -g clawcloud
25
+ clawcloud register
50
26
  ```
51
27
 
52
- ### Information
53
- ```bash
54
- clawcloud tiers # Show available VM tiers
55
- clawcloud balance # Check wallet balance
56
- clawcloud info # Show contract/API info
57
- ```
28
+ ## Getting Started
58
29
 
59
- ### Wallet
60
- ```bash
61
- clawcloud wallet # View/setup wallet
62
- ```
30
+ ### 1. Register Your Agent
63
31
 
64
- ### Help
65
32
  ```bash
66
- clawcloud help # Show all commands
33
+ npx clawcloud register
67
34
  ```
68
35
 
69
- ## šŸ› ļø Setup
70
-
71
- ### First Time Setup
72
-
73
- 1. **Run any command** and the CLI will guide you through wallet setup:
74
- ```bash
75
- npx clawcloud tiers
76
- ```
77
-
78
- 2. **Choose wallet option:**
79
- - Import existing private key
80
- - Generate new wallet
81
-
82
- 3. **Fund your wallet:**
83
- - Get ETH on Base (for gas): https://bridge.base.org
84
- - Get USDC (for purchases): https://app.uniswap.org/swap?chain=base
85
-
86
- ### Configuration
87
-
88
- Config is stored in: `~/.clawcloud/config.json`
36
+ You'll get an Agent ID like `agent_1738445234_k9x2m`
89
37
 
90
- **Security Note:** Never share your private key or config file!
38
+ ### 2. Get Your Wallet (Telegram)
91
39
 
92
- ## šŸ’° Pricing
40
+ Open Telegram and message [@clawcloud_devbot](https://t.me/clawcloud_devbot):
93
41
 
94
- | Tier | Name | Per Day | Per Month |
95
- |------|------|---------|-----------|
96
- | 0 | CPU-Basic-1vCPU-1GB | $0.50 | $15.00 |
97
- | 1 | CPU-Standard-2vCPU-4GB | $1.00 | $30.00 |
98
- | 2 | CPU-Performance-4vCPU-8GB | $2.00 | $60.00 |
99
- | 3 | CPU-HighMem-8vCPU-16GB | $4.00 | $120.00 |
100
- | 4 | GPU-T4-4vCPU-16GB | $8.00 | $240.00 |
101
- | 5 | GPU-V100-8vCPU-32GB | $16.00 | $480.00 |
102
- | 6 | GPU-A100-16vCPU-64GB | $32.00 | $960.00 |
103
- | 7 | GPU-H100-32vCPU-128GB | $64.00 | $1,920.00 |
104
-
105
- *Prices in USDC. Minimum 3-day purchase required.*
106
-
107
- ## šŸ” Security
108
-
109
- - **Private keys are stored locally** in `~/.clawcloud/config.json`
110
- - **Never share your private key** with anyone
111
- - **Use a dedicated wallet** for ClawCloud operations
112
- - **Backup your private key** securely
42
+ ```
43
+ /start agent_1738445234_k9x2m
44
+ ```
113
45
 
114
- ## šŸ“– Examples
46
+ The bot will:
47
+ - Verify your agent ID
48
+ - Create a wallet
49
+ - Send you the private key
50
+ - Provide funding instructions
115
51
 
116
- ### Purchase a VM
52
+ ### 3. Configure CLI
117
53
 
118
54
  ```bash
119
- $ npx clawcloud purchase
120
-
121
- šŸ¦ž Wallet: 0x1234...5678
122
- šŸ“Š Available Tiers:
123
-
124
- 0. CPU-Basic-1vCPU-1GB - $0.50/day ($15.00/month)
125
- 1. CPU-Standard-2vCPU-4GB - $1.00/day ($30.00/month)
126
- ...
127
-
128
- Choose tier (0-7): 4
129
- Duration in days (3+ recommended): 7
130
-
131
- šŸ’° Total cost: $56.00 USDC
132
- Proceed with purchase? (y/n): y
133
-
134
- āœ… USDC balance: $100.00 āœ…
135
- ā³ Approving USDC...
136
- āœ… USDC approved!
137
- ā³ Purchasing VM...
138
- āœ… VM purchased successfully! šŸŽ‰
139
-
140
- Token ID: 42
141
- Tier: 4
142
- Duration: 7 days
143
-
144
- ā³ VM is provisioning... This takes 2-3 minutes.
145
- Get credentials: npx clawcloud get 42
55
+ npx clawcloud configure
146
56
  ```
147
57
 
148
- ### Get VM Credentials
149
-
150
- ```bash
151
- $ npx clawcloud get 42
152
-
153
- ā³ Fetching credentials for VM #42...
154
- āœ… VM credentials retrieved!
155
-
156
- ======================================================================
157
- šŸ–„ļø VM #42 - GPU-EXTERNAL
158
- ======================================================================
159
- Tier: 4
160
- Host: rentals-xxxxx.ssh.deployments.targon.com
161
- Username: root
162
- Expires: Feb 9, 2026, 12:00:00 PM
58
+ Enter your Agent ID and private key from Telegram.
163
59
 
164
- šŸ“ SSH Command:
165
- ssh rentals-xxxxx.ssh.deployments.targon.com
166
-
167
- ======================================================================
168
- ```
169
-
170
- ### List Your VMs
60
+ ### 4. Make Your Agent Autonomous
171
61
 
172
62
  ```bash
173
- $ npx clawcloud list
174
-
175
- ā³ Fetching VMs for 0x1234...5678...
176
- āœ… Found 2 VM(s)
177
-
178
- ==========================================================================================
179
- Your VMs:
180
- ==========================================================================================
181
-
182
- āœ… VM #42
183
- Tier: 4
184
- Type: gpu-external
185
- Host: rentals-xxxxx.ssh.deployments.targon.com
186
- Status: running
187
- Created: Feb 2, 2026, 10:30:00 AM
188
- Expires: Feb 9, 2026, 10:30:00 AM
189
- Access: npx clawcloud get 42
190
-
191
- āœ… VM #43
192
- Tier: 1
193
- Type: gcp
194
- Host: 35.123.45.67
195
- Status: running
196
- Created: Feb 2, 2026, 11:00:00 AM
197
- Expires: Feb 5, 2026, 11:00:00 AM
198
- Access: npx clawcloud get 43
199
-
200
- ==========================================================================================
63
+ npx clawcloud export
201
64
  ```
202
65
 
203
- ### Check Balance
66
+ Choose your framework:
67
+ - **OpenClaw / Clawd / Molt** - Installs skill automatically
68
+ - **Node.js SDK** - Exports config for custom agents
69
+ - **Python SDK** - Coming soon
70
+ - **Environment Variables** - For any language
204
71
 
205
- ```bash
206
- $ npx clawcloud balance
72
+ ## Commands
207
73
 
208
- ā³ Checking balances...
74
+ ### Setup
75
+ - `npx clawcloud` - Interactive menu
76
+ - `npx clawcloud register` - Register new agent
77
+ - `npx clawcloud configure` - Link wallet after Telegram
78
+ - `npx clawcloud fund` - Show funding instructions
209
79
 
210
- šŸ’° Wallet Balances:
211
- Address: 0x1234567890123456789012345678901234567890
212
- ETH: 0.05 ETH (for gas)
213
- USDC: $100.00 USDC
214
- ```
80
+ ### Autonomous Mode
81
+ - `npx clawcloud export` - Export for autonomous agents
82
+ - `npx clawcloud export --framework openclaw` - Install OpenClaw skill
215
83
 
216
- ## 🌐 Network Details
84
+ ### Wallet & Balance
85
+ - `npx clawcloud balance` - Check USDC balance
217
86
 
218
- **Network:** Base Mainnet
219
- **Chain ID:** 8453
220
- **RPC:** https://mainnet.base.org
87
+ ### VMs & NFTs
88
+ - `npx clawcloud list` - List your VMs and NFTs
89
+ - `npx clawcloud status <nft-id>` - View NFT/VM details
90
+ - `npx clawcloud ssh <nft-id>` - SSH into VM
91
+ - `npx clawcloud transfer <nft-id>` - Transfer NFT/VM ownership
92
+ - `npx clawcloud terminate <nft-id>` - Destroy VM & burn NFT
221
93
 
222
- **Smart Contract:** `0xF708741D37C420518852c6A15aB658066951c852`
223
- **USDC Token:** `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`
224
- **API:** https://api.clawcloud.co
225
-
226
- **Explorer:** https://basescan.org/address/0xF708741D37C420518852c6A15aB658066951c852
94
+ ### Help
95
+ - `npx clawcloud help` - Detailed help
96
+ - `npx clawcloud docs` - Open documentation
227
97
 
228
- ## šŸ› ļø For Developers
98
+ ## Autonomous Agent Example
229
99
 
230
- ### Using in Your Application
100
+ After running `npx clawcloud export`, your agent can:
231
101
 
232
102
  ```javascript
233
- const { exec } = require('child_process');
234
- const util = require('util');
235
- const execPromise = util.promisify(exec);
236
-
237
- // Purchase VM
238
- const { stdout } = await execPromise('npx clawcloud purchase');
239
- console.log(stdout);
240
-
241
- // Get credentials
242
- const { stdout: creds } = await execPromise('npx clawcloud get 42');
243
- console.log(creds);
103
+ import ClawCloud from '@clawcloud/sdk';
104
+
105
+ const cloud = new ClawCloud({
106
+ configPath: '~/.clawcloud/autonomous-config.json'
107
+ });
108
+
109
+ // Agent decides: "I need to run a backtest"
110
+ const balance = await cloud.wallet.balance();
111
+
112
+ if (balance > 10) {
113
+ // Purchase VM autonomously
114
+ const vm = await cloud.vms.purchase({
115
+ tier: 'SMALL',
116
+ months: 1
117
+ });
118
+
119
+ // Wait for provisioning
120
+ await vm.waitReady();
121
+
122
+ // Deploy code
123
+ await vm.deployCode('./my-strategy');
124
+
125
+ // Run task
126
+ await vm.execute('npm run backtest');
127
+ }
244
128
  ```
245
129
 
246
- ### API Integration
130
+ ## NFTs
247
131
 
248
- For programmatic access, use the REST API directly:
132
+ When you purchase a VM:
133
+ - An ERC-721 NFT is minted to your wallet
134
+ - NFT token ID = VM identifier
135
+ - Own the NFT = Own the VM
136
+ - Transfer NFT = Transfer VM ownership
249
137
 
250
- ```bash
251
- # API Documentation
252
- https://api.clawcloud.co/docs
253
-
254
- # Get tiers
255
- curl https://api.clawcloud.co/tiers
138
+ View your NFTs on [OpenSea](https://opensea.io) or [BaseScan](https://basescan.org).
256
139
 
257
- # Get credentials (requires signature)
258
- curl -H "Authorization: Bearer $SIGNATURE" \
259
- https://api.clawcloud.co/credentials/42
260
- ```
140
+ ## Features
261
141
 
262
- ## šŸ› Troubleshooting
142
+ - šŸ¤– **Autonomous**: Agents purchase VMs on their own
143
+ - šŸŽØ **NFT-Based**: VMs are owned as ERC-721 tokens
144
+ - ā›“ļø **Base Blockchain**: Fast, cheap transactions
145
+ - ā˜ļø **Multi-Cloud**: GCP, AWS, private servers
146
+ - šŸ’° **Pay-as-you-go**: Starting at $0.08/hour
147
+ - šŸ” **Non-Custodial**: You control your keys
263
148
 
264
- ### "Insufficient USDC" Error
265
- - Buy USDC on Base: https://app.uniswap.org/swap?chain=base
266
- - Bridge USDC to Base: https://bridge.base.org
267
-
268
- ### "Insufficient funds for gas" Error
269
- - Bridge ETH to Base: https://bridge.base.org
270
- - You need ~0.001 ETH for gas
271
-
272
- ### "VM still provisioning" Message
273
- - Wait 2-3 minutes after purchase
274
- - Try getting credentials again: `npx clawcloud get <tokenId>`
275
-
276
- ### "Invalid signature" Error
277
- - Make sure you own the NFT for the token ID
278
- - Check that you're using the correct wallet
279
-
280
- ### CLI Config Issues
281
- ```bash
282
- # Remove config and start fresh
283
- rm -rf ~/.clawcloud
284
- npx clawcloud wallet
285
- ```
149
+ ## Requirements
286
150
 
287
- ## šŸ†˜ Support
151
+ - Node.js >= 18.0.0
152
+ - USDC on Base blockchain
153
+ - Telegram account (for wallet setup)
288
154
 
289
- - **Documentation:** https://docs.clawcloud.co
290
- - **Discord:** discord.gg/clawcloud
291
- - **Twitter:** @ClawCloud
292
- - **GitHub Issues:** https://github.com/clawcloud/clawcloud-cli/issues
155
+ ## Configuration
293
156
 
294
- ## šŸ“œ License
157
+ Config stored in `~/.clawcloud/`:
158
+ - `agents.json` - Registered agents
159
+ - `wallet.json` - Wallet configuration (secure!)
160
+ - `config.json` - API endpoints and settings
295
161
 
296
- MIT License - see LICENSE file for details
162
+ ## Links
297
163
 
298
- ## šŸš€ Roadmap
164
+ - **Website**: https://clawcloud.co
165
+ - **Docs**: https://docs.clawcloud.co
166
+ - **Telegram**: https://t.me/clawcloud_devbot
167
+ - **GitHub**: https://github.com/clawcloud/clawcloud
168
+ - **Twitter**: https://twitter.com/clawcloudx
299
169
 
300
- - [ ] Web dashboard
301
- - [ ] VM management (restart, resize)
302
- - [ ] Custom images/templates
303
- - [ ] Team/organization accounts
304
- - [ ] Volume attachments
305
- - [ ] Networking configuration
306
- - [ ] Monitoring & alerts
170
+ ## Support
307
171
 
308
- ---
172
+ - šŸ’¬ Telegram: https://t.me/clawcloud
173
+ - šŸ› Issues: https://github.com/clawcloud/clawcloud/issues
174
+ - šŸ“§ Email: support@clawcloud.co
309
175
 
310
- **Built with ā¤ļø for autonomous AI agents**
311
- Powered by Base, Railway, and Targon
176
+ ## License
312
177
 
313
- šŸ¦ž LFG!
178
+ MIT Ā© ClawCloud
@@ -0,0 +1,158 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { program } from 'commander';
4
+ import chalk from 'chalk';
5
+ import { register } from '../src/commands/register.js';
6
+ import { configure } from '../src/commands/configure.js';
7
+ import { exportConfig } from '../src/commands/export.js';
8
+ import { balance } from '../src/commands/balance.js';
9
+ import { buy } from '../src/commands/buy.js';
10
+ import { list } from '../src/commands/list.js';
11
+ import { status } from '../src/commands/status.js';
12
+ import { ssh } from '../src/commands/ssh.js';
13
+ import { transfer } from '../src/commands/transfer.js';
14
+ import { terminate } from '../src/commands/terminate.js';
15
+ import { fund } from '../src/commands/fund.js';
16
+ import { nfts } from '../src/commands/nfts.js';
17
+ import { interactive } from '../src/commands/interactive.js';
18
+ import { displayHelp } from '../src/utils/help.js';
19
+ import { getVersion } from '../src/utils/version.js';
20
+
21
+ const version = getVersion();
22
+
23
+ program
24
+ .name('clawcloud')
25
+ .description('ā˜ļø Cloud infrastructure AI agents can own')
26
+ .version(version, '-v, --version', 'Output the current version');
27
+
28
+ // Interactive mode (default when no command)
29
+ program
30
+ .action(() => {
31
+ interactive();
32
+ });
33
+
34
+ // Registration & Setup
35
+ program
36
+ .command('register')
37
+ .description('Register a new AI agent')
38
+ .action(register);
39
+
40
+ program
41
+ .command('configure')
42
+ .description('Configure agent wallet after Telegram setup')
43
+ .action(configure);
44
+
45
+ program
46
+ .command('fund')
47
+ .description('Show funding instructions')
48
+ .action(fund);
49
+
50
+ // Autonomous Mode (Primary)
51
+ program
52
+ .command('export')
53
+ .description('Export configuration for autonomous agents')
54
+ .option('-f, --framework <type>', 'Agent framework (openclaw, nodejs, python, env)', 'openclaw')
55
+ .option('-o, --output <path>', 'Output path')
56
+ .action(exportConfig);
57
+
58
+ // Wallet & Balance
59
+ program
60
+ .command('balance')
61
+ .alias('bal')
62
+ .description('Check USDC balance')
63
+ .option('--json', 'Output as JSON')
64
+ .action(balance);
65
+
66
+ // NFT/VM Management
67
+ program
68
+ .command('list')
69
+ .alias('ls')
70
+ .description('List your VMs and NFTs')
71
+ .option('--json', 'Output as JSON')
72
+ .action(list);
73
+
74
+ program
75
+ .command('nfts')
76
+ .description('View your NFT collection')
77
+ .action(nfts);
78
+
79
+ program
80
+ .command('status <nft-id>')
81
+ .description('View NFT and VM details')
82
+ .option('--json', 'Output as JSON')
83
+ .action(status);
84
+
85
+ program
86
+ .command('buy')
87
+ .description('Purchase a VM (manual mode)')
88
+ .option('-t, --tier <tier>', 'VM tier (MICRO, SMALL, MEDIUM, LARGE, XLARGE)')
89
+ .option('-m, --months <months>', 'Duration in months (1-12)')
90
+ .option('-y, --yes', 'Skip confirmation')
91
+ .action(buy);
92
+
93
+ program
94
+ .command('renew <nft-id>')
95
+ .description('Renew/extend a VM')
96
+ .option('-m, --months <months>', 'Additional months')
97
+ .option('-y, --yes', 'Skip confirmation')
98
+ .action((nftId, options) => {
99
+ console.log(chalk.yellow('Renew feature coming soon!'));
100
+ });
101
+
102
+ program
103
+ .command('ssh <nft-id>')
104
+ .description('SSH into a VM')
105
+ .action(ssh);
106
+
107
+ program
108
+ .command('transfer <nft-id>')
109
+ .description('Transfer NFT/VM to another address')
110
+ .option('-t, --to <address>', 'Recipient address')
111
+ .option('-y, --yes', 'Skip confirmation')
112
+ .action(transfer);
113
+
114
+ program
115
+ .command('terminate <nft-id>')
116
+ .alias('destroy')
117
+ .description('Destroy VM and burn NFT')
118
+ .option('-y, --yes', 'Skip confirmation')
119
+ .action(terminate);
120
+
121
+ // Documentation & Help
122
+ program
123
+ .command('docs')
124
+ .description('Open documentation in browser')
125
+ .action(() => {
126
+ const { exec } = require('child_process');
127
+ exec('open https://docs.clawcloud.co');
128
+ console.log(chalk.blue('šŸ“– Opening documentation...'));
129
+ });
130
+
131
+ program
132
+ .command('help')
133
+ .description('Display detailed help')
134
+ .action(displayHelp);
135
+
136
+ // Hidden dev commands
137
+ program
138
+ .command('contract')
139
+ .description('Show contract addresses')
140
+ .option('--testnet', 'Show testnet contracts')
141
+ .action((options) => {
142
+ const { getConfig } = require('../src/utils/config.js');
143
+ const config = getConfig();
144
+ console.log(chalk.cyan('\nšŸ“ Contract Addresses:\n'));
145
+ if (options.testnet) {
146
+ console.log(chalk.gray('Base Sepolia:'), '0x...');
147
+ } else {
148
+ console.log(chalk.gray('Base Mainnet:'), config.CONTRACT_ADDRESS || 'Not configured');
149
+ }
150
+ });
151
+
152
+ // Parse arguments
153
+ program.parse(process.argv);
154
+
155
+ // Show help if no command provided
156
+ if (!process.argv.slice(2).length) {
157
+ interactive();
158
+ }
package/package.json CHANGED
@@ -1,40 +1,57 @@
1
1
  {
2
2
  "name": "clawcloud",
3
- "version": "1.0.1",
4
- "description": "ClawCloud CLI - Decentralized cloud infrastructure for AI agents on Base",
5
- "main": "index.js",
3
+ "version": "1.3.0",
4
+ "description": "ā˜ļø Cloud infrastructure AI agents can own - CLI tool",
5
+ "main": "bin/clawcloud.js",
6
+ "type": "module",
6
7
  "bin": {
7
- "clawcloud": "./index.js"
8
+ "clawcloud": "./bin/clawcloud.js"
8
9
  },
9
10
  "scripts": {
10
- "test": "echo \"Error: no test specified\" && exit 1"
11
+ "test": "echo \"Tests coming soon\"",
12
+ "prepublishOnly": "chmod +x bin/clawcloud.js"
11
13
  },
12
14
  "keywords": [
13
- "blockchain",
14
- "base",
15
- "cloud",
16
- "vm",
17
15
  "ai",
18
16
  "agents",
19
- "cryptocurrency",
17
+ "cloud",
18
+ "vm",
19
+ "infrastructure",
20
+ "autonomous",
21
+ "blockchain",
22
+ "base",
20
23
  "nft",
21
- "web3",
22
- "cli"
24
+ "openclaw",
25
+ "depin"
23
26
  ],
24
27
  "author": "ClawCloud",
25
28
  "license": "MIT",
26
29
  "repository": {
27
30
  "type": "git",
28
- "url": "https://github.com/clawcloud/clawcloud-cli.git"
31
+ "url": "https://github.com/clawcloud/clawcloud.git",
32
+ "directory": "cli"
29
33
  },
30
34
  "homepage": "https://clawcloud.co",
31
35
  "bugs": {
32
- "url": "https://github.com/clawcloud/clawcloud-cli/issues"
33
- },
34
- "dependencies": {
35
- "ethers": "^6.9.0"
36
+ "url": "https://github.com/clawcloud/clawcloud/issues"
36
37
  },
37
38
  "engines": {
38
39
  "node": ">=18.0.0"
39
- }
40
+ },
41
+ "dependencies": {
42
+ "boxen": "^7.1.1",
43
+ "chalk": "^5.3.0",
44
+ "cli-table3": "^0.6.3",
45
+ "commander": "^11.1.0",
46
+ "ethers": "^6.10.0",
47
+ "inquirer": "^9.2.12",
48
+ "ora": "^7.0.1"
49
+ },
50
+ "files": [
51
+ "bin/",
52
+ "src/",
53
+ "templates/",
54
+ "README.md",
55
+ "LICENSE"
56
+ ]
40
57
  }
@@ -0,0 +1,22 @@
1
+ import { getConfig } from '../utils/config.js';
2
+
3
+ export async function registerAgent(name, description) {
4
+ const config = getConfig();
5
+
6
+ // TODO: Replace with real API call
7
+ // const response = await fetch(`${config.API_URL}/agents/register`, {
8
+ // method: 'POST',
9
+ // headers: { 'Content-Type': 'application/json' },
10
+ // body: JSON.stringify({ name, description })
11
+ // });
12
+
13
+ // Mock response for now
14
+ await new Promise(resolve => setTimeout(resolve, 1000));
15
+
16
+ return {
17
+ agent_id: `agent_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`,
18
+ name,
19
+ description,
20
+ created_at: new Date().toISOString()
21
+ };
22
+ }