nervepay 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/CHANGELOG.md +117 -0
- package/LICENSE +21 -0
- package/README.md +532 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +449 -0
- package/dist/index.js.map +1 -0
- package/dist/setup.d.ts +9 -0
- package/dist/setup.d.ts.map +1 -0
- package/dist/setup.js +391 -0
- package/dist/setup.js.map +1 -0
- package/dist/tools/gateway.d.ts +96 -0
- package/dist/tools/gateway.d.ts.map +1 -0
- package/dist/tools/gateway.js +99 -0
- package/dist/tools/gateway.js.map +1 -0
- package/dist/tools/identity.d.ts +85 -0
- package/dist/tools/identity.d.ts.map +1 -0
- package/dist/tools/identity.js +42 -0
- package/dist/tools/identity.js.map +1 -0
- package/dist/tools/orchestration.d.ts +111 -0
- package/dist/tools/orchestration.d.ts.map +1 -0
- package/dist/tools/orchestration.js +83 -0
- package/dist/tools/orchestration.js.map +1 -0
- package/dist/tools/vault.d.ts +39 -0
- package/dist/tools/vault.d.ts.map +1 -0
- package/dist/tools/vault.js +57 -0
- package/dist/tools/vault.js.map +1 -0
- package/dist/utils/client.d.ts +42 -0
- package/dist/utils/client.d.ts.map +1 -0
- package/dist/utils/client.js +100 -0
- package/dist/utils/client.js.map +1 -0
- package/dist/utils/crypto.d.ts +28 -0
- package/dist/utils/crypto.d.ts.map +1 -0
- package/dist/utils/crypto.js +108 -0
- package/dist/utils/crypto.js.map +1 -0
- package/openclaw.plugin.json +63 -0
- package/package.json +59 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [1.0.0] - 2026-02-08
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
#### 🎉 Initial Release
|
|
13
|
+
|
|
14
|
+
- **Interactive Setup Wizard** (`openclaw nervepay setup`)
|
|
15
|
+
- Automated identity registration with W3C DIDs
|
|
16
|
+
- Human claim flow with polling
|
|
17
|
+
- Gateway pairing with approval workflow
|
|
18
|
+
- Auto-configuration of OpenClaw config
|
|
19
|
+
- Secure credentials backup to `~/.nervepay/credentials.json`
|
|
20
|
+
- Beautiful CLI interface with progress indicators
|
|
21
|
+
|
|
22
|
+
- **Identity Management Tools**
|
|
23
|
+
- `nervepay_register_identity` - Register W3C DID with Ed25519 keys
|
|
24
|
+
- `nervepay_whoami` - Test authentication and get agent info
|
|
25
|
+
- `nervepay_verify_agent` - Verify other agents' identity
|
|
26
|
+
- `nervepay_resolve_did` - Resolve DID documents
|
|
27
|
+
- Ed25519 signature-based authentication
|
|
28
|
+
- Replay protection with nonces and timestamps
|
|
29
|
+
- BIP39 mnemonic recovery support
|
|
30
|
+
|
|
31
|
+
- **Vault Tools** (Secrets Management)
|
|
32
|
+
- `nervepay_list_secrets` - List available secrets (metadata only)
|
|
33
|
+
- `nervepay_get_secret` - Get decrypted secret value
|
|
34
|
+
- `nervepay_get_secrets` - Batch retrieve multiple secrets
|
|
35
|
+
- AES-256-GCM encryption with envelope encryption
|
|
36
|
+
- Comprehensive audit logging
|
|
37
|
+
- Read-only access for agents (create via dashboard)
|
|
38
|
+
|
|
39
|
+
- **Gateway Pairing Tools**
|
|
40
|
+
- `nervepay_pair_gateway` - Connect OpenClaw gateway to NervePay
|
|
41
|
+
- `nervepay_check_pairing_status` - Poll pairing approval
|
|
42
|
+
- `nervepay_complete_pairing` - Complete pairing with token
|
|
43
|
+
- `nervepay_list_gateways` - List connected gateways
|
|
44
|
+
- `nervepay_gateway_health` - Check gateway health
|
|
45
|
+
- Auto-discovery of gateway tokens from local config
|
|
46
|
+
- Human approval workflow (Telegram-style)
|
|
47
|
+
|
|
48
|
+
- **Orchestration Tools** (Multi-Agent Task Management)
|
|
49
|
+
- `nervepay_create_orchestration` - Create orchestration from PRD
|
|
50
|
+
- `nervepay_start_orchestration` - Start task decomposition
|
|
51
|
+
- `nervepay_get_orchestration` - Get status and progress
|
|
52
|
+
- `nervepay_list_tasks` - List orchestration tasks
|
|
53
|
+
- Task dependency resolution
|
|
54
|
+
- Retry logic for failed tasks
|
|
55
|
+
- Progress monitoring and events audit trail
|
|
56
|
+
|
|
57
|
+
- **CLI Commands**
|
|
58
|
+
- `openclaw nervepay setup` - Interactive setup wizard
|
|
59
|
+
- `openclaw nervepay whoami` - Show agent identity
|
|
60
|
+
- `openclaw nervepay gateways` - List connected gateways
|
|
61
|
+
- `openclaw nervepay secrets` - List secrets
|
|
62
|
+
|
|
63
|
+
- **Gateway RPC Methods**
|
|
64
|
+
- `nervepay.health` - Plugin health check
|
|
65
|
+
- `nervepay.whoami` - Get agent info via RPC
|
|
66
|
+
|
|
67
|
+
- **Auto-Reply Commands**
|
|
68
|
+
- `/nervepay-status` - Show plugin status in chat
|
|
69
|
+
|
|
70
|
+
- **Security Features**
|
|
71
|
+
- Ed25519 cryptographic signatures
|
|
72
|
+
- One-time nonce replay protection
|
|
73
|
+
- 5-minute timestamp validation window
|
|
74
|
+
- AES-256-GCM vault encryption
|
|
75
|
+
- HKDF key derivation
|
|
76
|
+
- Secure file permissions (600) for credentials backup
|
|
77
|
+
- No private keys in logs or error messages
|
|
78
|
+
|
|
79
|
+
- **Documentation**
|
|
80
|
+
- Comprehensive README with API reference
|
|
81
|
+
- EXAMPLES.md with 10 real-world use cases
|
|
82
|
+
- DEPLOYMENT.md with full publishing guide
|
|
83
|
+
- TypeScript type definitions for IDE support
|
|
84
|
+
- Inline code documentation
|
|
85
|
+
|
|
86
|
+
### Security
|
|
87
|
+
|
|
88
|
+
- Private keys are never transmitted to servers (only signatures)
|
|
89
|
+
- Credentials backup uses secure file permissions (600)
|
|
90
|
+
- No secrets in source code or configuration files
|
|
91
|
+
- Comprehensive audit logging for all authenticated operations
|
|
92
|
+
- TLS required for all API communications
|
|
93
|
+
|
|
94
|
+
### Known Issues
|
|
95
|
+
|
|
96
|
+
- Setup wizard requires manual gateway restart after config update
|
|
97
|
+
- Gateway token auto-discovery only checks standard locations
|
|
98
|
+
- Orchestration tools require `enableOrchestration: true` in config
|
|
99
|
+
|
|
100
|
+
## [Unreleased]
|
|
101
|
+
|
|
102
|
+
### Planned Features
|
|
103
|
+
|
|
104
|
+
- [ ] Agent attestation network (vouch for other agents)
|
|
105
|
+
- [ ] Session tokens (reduce signature overhead)
|
|
106
|
+
- [ ] ERC-4337 smart wallet integration
|
|
107
|
+
- [ ] ERC-8004 on-chain reputation bridge
|
|
108
|
+
- [ ] x402 payment protocol support
|
|
109
|
+
- [ ] Sub-agent delegation tools
|
|
110
|
+
- [ ] Real-time analytics dashboard
|
|
111
|
+
- [ ] Multi-gateway load balancing
|
|
112
|
+
- [ ] Task priority scheduling
|
|
113
|
+
- [ ] Webhook notifications for orchestration events
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
[1.0.0]: https://github.com/nervepay/nervepay-plugin/releases/tag/v1.0.0
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 NervePay
|
|
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,532 @@
|
|
|
1
|
+
# NervePay Plugin for OpenClaw
|
|
2
|
+
|
|
3
|
+
**Self-sovereign identity layer for AI agents.** Provides W3C DIDs, Ed25519 cryptographic authentication, secure vault, and multi-agent orchestration.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **🆔 Identity Management**: W3C DID registration with Ed25519 signatures
|
|
8
|
+
- **🔐 Vault**: AES-256-GCM encrypted secrets management
|
|
9
|
+
- **🔗 Gateway Pairing**: Connect OpenClaw gateways to NervePay Mission Control
|
|
10
|
+
- **🤖 Orchestration**: Multi-agent task decomposition and management
|
|
11
|
+
- **✅ Reputation**: Cross-platform agent reputation tracking
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
### Quick Start (Recommended)
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# 1. Install plugin
|
|
19
|
+
openclaw plugins install nervepay
|
|
20
|
+
|
|
21
|
+
# 2. Run interactive setup wizard
|
|
22
|
+
openclaw nervepay setup
|
|
23
|
+
|
|
24
|
+
# That's it! The wizard handles:
|
|
25
|
+
# ✅ Identity registration (W3C DID + Ed25519 keys)
|
|
26
|
+
# ✅ Human claim flow (optional)
|
|
27
|
+
# ✅ Gateway pairing (optional)
|
|
28
|
+
# ✅ Auto-configuration of OpenClaw
|
|
29
|
+
# ✅ Credentials backup
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
The setup wizard is **fully interactive** and takes ~2 minutes. It configures everything automatically!
|
|
33
|
+
|
|
34
|
+
### Manual Installation (from source)
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
git clone https://github.com/nervepay/nervepay-plugin
|
|
38
|
+
cd nervepay-plugin
|
|
39
|
+
npm install
|
|
40
|
+
npm run build
|
|
41
|
+
openclaw plugins install .
|
|
42
|
+
openclaw nervepay setup # Still use the wizard!
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Local Development
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
openclaw plugins install -l ./nervepay-plugin
|
|
49
|
+
openclaw nervepay setup
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Configuration
|
|
53
|
+
|
|
54
|
+
**✨ The setup wizard configures everything automatically!** Just run:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
openclaw nervepay setup
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
It will:
|
|
61
|
+
1. Register your agent identity
|
|
62
|
+
2. Show claim URL (optional, improves trust)
|
|
63
|
+
3. Optionally pair your gateway
|
|
64
|
+
4. Auto-update your OpenClaw config
|
|
65
|
+
5. Save credentials securely to `~/.nervepay/credentials.json`
|
|
66
|
+
|
|
67
|
+
### Manual Configuration (if needed)
|
|
68
|
+
|
|
69
|
+
If you prefer to configure manually or already have credentials:
|
|
70
|
+
|
|
71
|
+
```json5
|
|
72
|
+
{
|
|
73
|
+
"plugins": {
|
|
74
|
+
"enabled": true,
|
|
75
|
+
"entries": {
|
|
76
|
+
"nervepay": {
|
|
77
|
+
"enabled": true,
|
|
78
|
+
"config": {
|
|
79
|
+
"apiUrl": "https://api.nervepay.xyz",
|
|
80
|
+
"agentDid": "did:nervepay:agent:...",
|
|
81
|
+
"privateKey": "ed25519:...",
|
|
82
|
+
"enableOrchestration": false,
|
|
83
|
+
"enableAnalytics": true
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Then restart gateway: `openclaw gateway restart`
|
|
92
|
+
|
|
93
|
+
### Configuration Options
|
|
94
|
+
|
|
95
|
+
| Field | Type | Required | Description |
|
|
96
|
+
|-------|------|----------|-------------|
|
|
97
|
+
| `apiUrl` | string | No | NervePay API URL (default: https://api.nervepay.xyz) |
|
|
98
|
+
| `agentDid` | string | No* | Agent DID (auto-configured by setup wizard) |
|
|
99
|
+
| `privateKey` | string | No* | Ed25519 private key (auto-configured by setup wizard) |
|
|
100
|
+
| `enableOrchestration` | boolean | No | Enable multi-agent orchestration (default: false) |
|
|
101
|
+
| `enableAnalytics` | boolean | No | Enable analytics tracking (default: true) |
|
|
102
|
+
|
|
103
|
+
*Required for authenticated operations (vault, gateway, orchestration)
|
|
104
|
+
|
|
105
|
+
## Quick Start
|
|
106
|
+
|
|
107
|
+
### 🚀 The Easy Way (Interactive Setup)
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
# 1. Install
|
|
111
|
+
openclaw plugins install nervepay
|
|
112
|
+
|
|
113
|
+
# 2. Run setup wizard
|
|
114
|
+
openclaw nervepay setup
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
The wizard will ask you a few questions and configure everything automatically:
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
🔐 NervePay Setup Wizard
|
|
121
|
+
|
|
122
|
+
📋 Step 1: Agent Information
|
|
123
|
+
Agent name: My Research Bot
|
|
124
|
+
Agent description: Helps with literature reviews
|
|
125
|
+
|
|
126
|
+
🆔 Step 2: Registering Identity...
|
|
127
|
+
✅ Identity created!
|
|
128
|
+
DID: did:nervepay:agent:abc123...
|
|
129
|
+
|
|
130
|
+
👤 Step 3: Link to Human Owner
|
|
131
|
+
Link this agent to your NervePay account? [Y/n] y
|
|
132
|
+
Open this URL in your browser:
|
|
133
|
+
https://nervepay.xyz/claim/session-xyz
|
|
134
|
+
|
|
135
|
+
✅ Agent claimed successfully!
|
|
136
|
+
|
|
137
|
+
🔗 Step 4: Gateway Pairing
|
|
138
|
+
Connect this gateway to NervePay Mission Control? [y/N] y
|
|
139
|
+
Gateway name: Home Lab Gateway
|
|
140
|
+
Gateway URL: http://127.0.0.1:18789
|
|
141
|
+
|
|
142
|
+
✅ Gateway paired successfully!
|
|
143
|
+
|
|
144
|
+
⚙️ Step 5: Additional Features
|
|
145
|
+
Enable multi-agent orchestration? [y/N] n
|
|
146
|
+
Enable analytics tracking? [Y/n] y
|
|
147
|
+
|
|
148
|
+
✅ Setup Complete!
|
|
149
|
+
|
|
150
|
+
🔄 Next Steps:
|
|
151
|
+
1. Restart your OpenClaw gateway:
|
|
152
|
+
openclaw gateway restart
|
|
153
|
+
|
|
154
|
+
2. Test authentication:
|
|
155
|
+
openclaw nervepay whoami
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### 🛠️ The Manual Way (Programmatic)
|
|
159
|
+
|
|
160
|
+
If you prefer to use tools directly:
|
|
161
|
+
|
|
162
|
+
```javascript
|
|
163
|
+
// 1. Register identity
|
|
164
|
+
const result = await nervepay_register_identity({
|
|
165
|
+
name: "My AI Agent",
|
|
166
|
+
description: "Purpose of this agent"
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
// 2. Save credentials (shown once only!)
|
|
170
|
+
console.log("DID:", result.did);
|
|
171
|
+
console.log("Private Key:", result.private_key);
|
|
172
|
+
console.log("Mnemonic:", result.mnemonic);
|
|
173
|
+
|
|
174
|
+
// 3. Update OpenClaw config with credentials
|
|
175
|
+
// 4. Restart gateway
|
|
176
|
+
// 5. Test authentication
|
|
177
|
+
const info = await nervepay_whoami();
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
**⚠️ Setup wizard is recommended!** It handles all the tedious configuration automatically.
|
|
181
|
+
|
|
182
|
+
## Available Tools
|
|
183
|
+
|
|
184
|
+
### Identity Tools
|
|
185
|
+
|
|
186
|
+
#### `nervepay_register_identity`
|
|
187
|
+
|
|
188
|
+
Register a new agent identity with W3C DID and Ed25519 keys.
|
|
189
|
+
|
|
190
|
+
**Parameters:**
|
|
191
|
+
- `name` (string, required): Agent display name
|
|
192
|
+
- `description` (string, optional): Agent description/purpose
|
|
193
|
+
|
|
194
|
+
**Returns:**
|
|
195
|
+
```typescript
|
|
196
|
+
{
|
|
197
|
+
did: string; // did:nervepay:agent:...
|
|
198
|
+
private_key: string; // ed25519:...
|
|
199
|
+
public_key: string; // Base58-encoded
|
|
200
|
+
mnemonic: string; // 12-word BIP39 recovery phrase
|
|
201
|
+
session_id: string; // For claim status polling
|
|
202
|
+
claim_url: string; // Give to human owner (optional)
|
|
203
|
+
}
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
#### `nervepay_whoami`
|
|
207
|
+
|
|
208
|
+
Test authentication and get current agent info.
|
|
209
|
+
|
|
210
|
+
**Returns:**
|
|
211
|
+
```typescript
|
|
212
|
+
{
|
|
213
|
+
agent_did: string;
|
|
214
|
+
name: string;
|
|
215
|
+
public_key: string;
|
|
216
|
+
capabilities: {
|
|
217
|
+
max_spending_limit_usd?: number;
|
|
218
|
+
allowed_operations?: string[];
|
|
219
|
+
};
|
|
220
|
+
reputation_score: number; // 0-100
|
|
221
|
+
created_at: string;
|
|
222
|
+
}
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
#### `nervepay_verify_agent`
|
|
226
|
+
|
|
227
|
+
Verify another agent's identity (public endpoint, no auth required).
|
|
228
|
+
|
|
229
|
+
**Parameters:**
|
|
230
|
+
- `did` (string): Agent DID to verify
|
|
231
|
+
|
|
232
|
+
#### `nervepay_resolve_did`
|
|
233
|
+
|
|
234
|
+
Resolve W3C DID document.
|
|
235
|
+
|
|
236
|
+
**Parameters:**
|
|
237
|
+
- `did` (string): DID to resolve
|
|
238
|
+
|
|
239
|
+
### Gateway Tools
|
|
240
|
+
|
|
241
|
+
#### `nervepay_pair_gateway`
|
|
242
|
+
|
|
243
|
+
Connect OpenClaw gateway to NervePay. Sends pairing request that requires human approval.
|
|
244
|
+
|
|
245
|
+
**Parameters:**
|
|
246
|
+
- `gateway_name` (string): Gateway display name
|
|
247
|
+
- `gateway_url` (string): Gateway URL (must be reachable by NervePay)
|
|
248
|
+
- `max_concurrent_agents` (number, optional): Max concurrent sub-agents (default: 8)
|
|
249
|
+
- `default_timeout_seconds` (number, optional): Default task timeout (default: 3600)
|
|
250
|
+
|
|
251
|
+
#### `nervepay_list_gateways`
|
|
252
|
+
|
|
253
|
+
List all connected gateways.
|
|
254
|
+
|
|
255
|
+
#### `nervepay_gateway_health`
|
|
256
|
+
|
|
257
|
+
Check gateway health.
|
|
258
|
+
|
|
259
|
+
**Parameters:**
|
|
260
|
+
- `gateway_id` (string): Gateway ID
|
|
261
|
+
|
|
262
|
+
### Vault Tools
|
|
263
|
+
|
|
264
|
+
#### `nervepay_list_secrets`
|
|
265
|
+
|
|
266
|
+
List all secrets (metadata only, no values).
|
|
267
|
+
|
|
268
|
+
**Returns:**
|
|
269
|
+
```typescript
|
|
270
|
+
{
|
|
271
|
+
secrets: Array<{
|
|
272
|
+
id: string;
|
|
273
|
+
name: string;
|
|
274
|
+
description?: string;
|
|
275
|
+
created_at: string;
|
|
276
|
+
updated_at: string;
|
|
277
|
+
}>;
|
|
278
|
+
}
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
#### `nervepay_get_secret`
|
|
282
|
+
|
|
283
|
+
Get decrypted secret value by name.
|
|
284
|
+
|
|
285
|
+
**Parameters:**
|
|
286
|
+
- `secret_name` (string): Secret name
|
|
287
|
+
|
|
288
|
+
**Returns:**
|
|
289
|
+
```typescript
|
|
290
|
+
{
|
|
291
|
+
secret: {
|
|
292
|
+
id: string;
|
|
293
|
+
name: string;
|
|
294
|
+
value: string; // Decrypted value
|
|
295
|
+
description?: string;
|
|
296
|
+
created_at: string;
|
|
297
|
+
updated_at: string;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
#### `nervepay_get_secrets`
|
|
303
|
+
|
|
304
|
+
Get multiple secrets at once.
|
|
305
|
+
|
|
306
|
+
**Parameters:**
|
|
307
|
+
- `secret_names` (string[]): Array of secret names
|
|
308
|
+
|
|
309
|
+
**Returns:**
|
|
310
|
+
```typescript
|
|
311
|
+
Record<string, string> // { name: value, ... }
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
### Orchestration Tools
|
|
315
|
+
|
|
316
|
+
(Available when `enableOrchestration: true`)
|
|
317
|
+
|
|
318
|
+
#### `nervepay_create_orchestration`
|
|
319
|
+
|
|
320
|
+
Create multi-agent orchestration from PRD (Product Requirements Document).
|
|
321
|
+
|
|
322
|
+
**Parameters:**
|
|
323
|
+
- `gateway_id` (string): Gateway ID to spawn agents on
|
|
324
|
+
- `name` (string): Orchestration name
|
|
325
|
+
- `prd` (string): Product Requirements Document (JSON or text)
|
|
326
|
+
- `context` (object, optional): Additional context data
|
|
327
|
+
|
|
328
|
+
#### `nervepay_start_orchestration`
|
|
329
|
+
|
|
330
|
+
Start orchestration (decomposes PRD and spawns sub-agent tasks).
|
|
331
|
+
|
|
332
|
+
**Parameters:**
|
|
333
|
+
- `orchestration_id` (string): Orchestration ID
|
|
334
|
+
|
|
335
|
+
#### `nervepay_get_orchestration`
|
|
336
|
+
|
|
337
|
+
Get orchestration status and progress.
|
|
338
|
+
|
|
339
|
+
**Parameters:**
|
|
340
|
+
- `orchestration_id` (string): Orchestration ID
|
|
341
|
+
|
|
342
|
+
#### `nervepay_list_tasks`
|
|
343
|
+
|
|
344
|
+
List tasks for an orchestration.
|
|
345
|
+
|
|
346
|
+
**Parameters:**
|
|
347
|
+
- `orchestration_id` (string): Orchestration ID
|
|
348
|
+
- `status` (string, optional): Filter by status (pending/running/completed/failed/blocked)
|
|
349
|
+
|
|
350
|
+
## CLI Commands
|
|
351
|
+
|
|
352
|
+
```bash
|
|
353
|
+
# Interactive setup wizard (⭐ recommended for first-time setup)
|
|
354
|
+
openclaw nervepay setup
|
|
355
|
+
|
|
356
|
+
# Show agent identity
|
|
357
|
+
openclaw nervepay whoami
|
|
358
|
+
|
|
359
|
+
# List connected gateways
|
|
360
|
+
openclaw nervepay gateways
|
|
361
|
+
|
|
362
|
+
# List secrets
|
|
363
|
+
openclaw nervepay secrets
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
The `setup` command is **fully interactive** and handles everything automatically:
|
|
367
|
+
- Identity registration
|
|
368
|
+
- Human claim flow
|
|
369
|
+
- Gateway pairing
|
|
370
|
+
- OpenClaw config updates
|
|
371
|
+
- Credentials backup
|
|
372
|
+
|
|
373
|
+
## Gateway RPC Methods
|
|
374
|
+
|
|
375
|
+
```javascript
|
|
376
|
+
// Health check
|
|
377
|
+
gateway.rpc('nervepay.health');
|
|
378
|
+
// => { status: 'ok', plugin: 'nervepay', version: '1.0.0' }
|
|
379
|
+
|
|
380
|
+
// Get agent identity
|
|
381
|
+
gateway.rpc('nervepay.whoami');
|
|
382
|
+
// => { agent_did: '...', name: '...', ... }
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
## Auto-Reply Commands
|
|
386
|
+
|
|
387
|
+
```
|
|
388
|
+
/nervepay-status
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
Shows plugin status and configuration in chat.
|
|
392
|
+
|
|
393
|
+
## Security
|
|
394
|
+
|
|
395
|
+
### Authentication
|
|
396
|
+
|
|
397
|
+
All authenticated requests use Ed25519 signatures with:
|
|
398
|
+
- **Replay protection**: One-time nonces + 5-minute timestamp window
|
|
399
|
+
- **Integrity**: Signature covers method, path, query, body hash
|
|
400
|
+
- **Non-repudiation**: Only agent with private key can sign
|
|
401
|
+
|
|
402
|
+
### Vault Encryption
|
|
403
|
+
|
|
404
|
+
Secrets use AES-256-GCM envelope encryption:
|
|
405
|
+
- Per-secret Data Encryption Keys (DEK)
|
|
406
|
+
- Master Key Encryption Key (KEK) derived via HKDF-SHA256
|
|
407
|
+
- Random 12-byte nonces per encryption
|
|
408
|
+
- Comprehensive audit logging
|
|
409
|
+
|
|
410
|
+
### Private Key Storage
|
|
411
|
+
|
|
412
|
+
**DO NOT** commit private keys to git or share them. Store them in:
|
|
413
|
+
- Environment variables
|
|
414
|
+
- OpenClaw config (local only)
|
|
415
|
+
- Hardware security modules (HSM)
|
|
416
|
+
- Secure secret managers
|
|
417
|
+
|
|
418
|
+
**BIP39 Mnemonic**: Backup the 12-word recovery phrase offline. It can regenerate the same Ed25519 keypair deterministically.
|
|
419
|
+
|
|
420
|
+
## Use Cases
|
|
421
|
+
|
|
422
|
+
### 1. Secure API Key Management
|
|
423
|
+
|
|
424
|
+
Stop leaking API keys in OpenClaw skills! Store them in NervePay Vault:
|
|
425
|
+
|
|
426
|
+
```javascript
|
|
427
|
+
// Instead of this (insecure):
|
|
428
|
+
const apiKey = "sk-proj-..."; // Leaked in skill code!
|
|
429
|
+
|
|
430
|
+
// Do this:
|
|
431
|
+
const { secret } = await nervepay_get_secret({
|
|
432
|
+
secret_name: "openai_api_key"
|
|
433
|
+
});
|
|
434
|
+
const apiKey = secret.value;
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
**Snyk found 280+ OpenClaw skills leaking API keys.** NervePay Vault fixes this with encrypted storage and audit logs.
|
|
438
|
+
|
|
439
|
+
### 2. Cross-Platform Reputation
|
|
440
|
+
|
|
441
|
+
Your agent's DID carries reputation across all 30+ OpenClaw channels:
|
|
442
|
+
|
|
443
|
+
```javascript
|
|
444
|
+
// Verify agent before trusting
|
|
445
|
+
const { verified, agent } = await nervepay_verify_agent({
|
|
446
|
+
did: "did:nervepay:agent:abc123..."
|
|
447
|
+
});
|
|
448
|
+
|
|
449
|
+
if (verified && agent.reputation_score > 80) {
|
|
450
|
+
// High reputation, proceed with request
|
|
451
|
+
}
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
### 3. Multi-Agent Orchestration
|
|
455
|
+
|
|
456
|
+
Decompose complex PRDs into sub-agent tasks:
|
|
457
|
+
|
|
458
|
+
```javascript
|
|
459
|
+
// Create orchestration
|
|
460
|
+
const orch = await nervepay_create_orchestration({
|
|
461
|
+
gateway_id: "gateway-123",
|
|
462
|
+
name: "Build User Dashboard",
|
|
463
|
+
prd: JSON.stringify({
|
|
464
|
+
title: "User Dashboard",
|
|
465
|
+
requirements: [
|
|
466
|
+
"Design landing page layout",
|
|
467
|
+
"Implement authentication",
|
|
468
|
+
"Create user profile page",
|
|
469
|
+
"Add analytics charts"
|
|
470
|
+
]
|
|
471
|
+
})
|
|
472
|
+
});
|
|
473
|
+
|
|
474
|
+
// Start execution
|
|
475
|
+
await nervepay_start_orchestration({
|
|
476
|
+
orchestration_id: orch.id
|
|
477
|
+
});
|
|
478
|
+
|
|
479
|
+
// Monitor progress
|
|
480
|
+
const status = await nervepay_get_orchestration({
|
|
481
|
+
orchestration_id: orch.id
|
|
482
|
+
});
|
|
483
|
+
console.log(`Progress: ${status.progress_percentage}%`);
|
|
484
|
+
```
|
|
485
|
+
|
|
486
|
+
### 4. Agent-to-Agent Commerce
|
|
487
|
+
|
|
488
|
+
Coming soon: x402 protocol integration for pay-per-request API monetization.
|
|
489
|
+
|
|
490
|
+
## Development
|
|
491
|
+
|
|
492
|
+
### Build
|
|
493
|
+
|
|
494
|
+
```bash
|
|
495
|
+
npm install
|
|
496
|
+
npm run build
|
|
497
|
+
```
|
|
498
|
+
|
|
499
|
+
### Test
|
|
500
|
+
|
|
501
|
+
```bash
|
|
502
|
+
npm test
|
|
503
|
+
```
|
|
504
|
+
|
|
505
|
+
### Watch mode
|
|
506
|
+
|
|
507
|
+
```bash
|
|
508
|
+
npm run dev
|
|
509
|
+
```
|
|
510
|
+
|
|
511
|
+
## Links
|
|
512
|
+
|
|
513
|
+
- **Website**: https://nervepay.xyz
|
|
514
|
+
- **Dashboard**: https://nervepay.xyz/dashboard
|
|
515
|
+
- **Docs**: https://nervepay.xyz/docs
|
|
516
|
+
- **API Reference**: https://nervepay.xyz/docs/api
|
|
517
|
+
- **GitHub**: https://github.com/nervepay/nervepay-plugin
|
|
518
|
+
- **OpenClaw Docs**: https://docs.openclaw.ai/tools/plugin
|
|
519
|
+
|
|
520
|
+
## Support
|
|
521
|
+
|
|
522
|
+
- **Issues**: https://github.com/nervepay/nervepay-plugin/issues
|
|
523
|
+
- **Discord**: https://discord.gg/nervepay
|
|
524
|
+
- **Email**: hello@nervepay.xyz
|
|
525
|
+
|
|
526
|
+
## License
|
|
527
|
+
|
|
528
|
+
MIT © NervePay
|
|
529
|
+
|
|
530
|
+
---
|
|
531
|
+
|
|
532
|
+
**Built with ❤️ for the AI agent ecosystem**
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,GAAG,EAAE,GAAG,QAudxC"}
|