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/dist/setup.js
ADDED
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interactive setup wizard for NervePay plugin
|
|
3
|
+
* Handles identity registration, gateway pairing, and auto-configuration
|
|
4
|
+
*/
|
|
5
|
+
import * as readline from 'readline';
|
|
6
|
+
import * as fs from 'fs';
|
|
7
|
+
import * as path from 'path';
|
|
8
|
+
import * as os from 'os';
|
|
9
|
+
import { NervePayClient } from './utils/client.js';
|
|
10
|
+
import * as identity from './tools/identity.js';
|
|
11
|
+
import * as gateway from './tools/gateway.js';
|
|
12
|
+
/**
|
|
13
|
+
* Create readline interface for prompts
|
|
14
|
+
*/
|
|
15
|
+
function createInterface() {
|
|
16
|
+
return readline.createInterface({
|
|
17
|
+
input: process.stdin,
|
|
18
|
+
output: process.stdout,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Prompt user for input
|
|
23
|
+
*/
|
|
24
|
+
function prompt(rl, question) {
|
|
25
|
+
return new Promise((resolve) => {
|
|
26
|
+
rl.question(question, (answer) => {
|
|
27
|
+
resolve(answer.trim());
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Prompt yes/no question
|
|
33
|
+
*/
|
|
34
|
+
async function promptYesNo(rl, question, defaultValue = false) {
|
|
35
|
+
const suffix = defaultValue ? ' [Y/n] ' : ' [y/N] ';
|
|
36
|
+
const answer = await prompt(rl, question + suffix);
|
|
37
|
+
if (!answer)
|
|
38
|
+
return defaultValue;
|
|
39
|
+
return answer.toLowerCase().startsWith('y');
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Find OpenClaw config path
|
|
43
|
+
*/
|
|
44
|
+
function findOpenClawConfig() {
|
|
45
|
+
const home = os.homedir();
|
|
46
|
+
const candidates = [
|
|
47
|
+
path.join(home, '.openclaw', 'openclaw.json'),
|
|
48
|
+
path.join(home, '.config', 'openclaw', 'openclaw.json'),
|
|
49
|
+
];
|
|
50
|
+
for (const configPath of candidates) {
|
|
51
|
+
if (fs.existsSync(configPath)) {
|
|
52
|
+
return configPath;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Update OpenClaw config with NervePay credentials
|
|
59
|
+
*/
|
|
60
|
+
function updateOpenClawConfig(did, privateKey, options = {}) {
|
|
61
|
+
try {
|
|
62
|
+
const configPath = findOpenClawConfig();
|
|
63
|
+
if (!configPath) {
|
|
64
|
+
console.log('\n⚠️ Could not find OpenClaw config file.');
|
|
65
|
+
console.log(' Please manually add credentials to your OpenClaw config:');
|
|
66
|
+
console.log(`\n "plugins": {`);
|
|
67
|
+
console.log(` "entries": {`);
|
|
68
|
+
console.log(` "nervepay": {`);
|
|
69
|
+
console.log(` "enabled": true,`);
|
|
70
|
+
console.log(` "config": {`);
|
|
71
|
+
console.log(` "agentDid": "${did}",`);
|
|
72
|
+
console.log(` "privateKey": "${privateKey}",`);
|
|
73
|
+
console.log(` "enableOrchestration": ${options.enableOrchestration || false},`);
|
|
74
|
+
console.log(` "enableAnalytics": ${options.enableAnalytics || false}`);
|
|
75
|
+
console.log(` }`);
|
|
76
|
+
console.log(` }`);
|
|
77
|
+
console.log(` }`);
|
|
78
|
+
console.log(` }\n`);
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
// Read existing config
|
|
82
|
+
const configData = fs.readFileSync(configPath, 'utf-8');
|
|
83
|
+
const config = JSON.parse(configData);
|
|
84
|
+
// Ensure plugins structure exists
|
|
85
|
+
if (!config.plugins) {
|
|
86
|
+
config.plugins = { enabled: true, entries: {} };
|
|
87
|
+
}
|
|
88
|
+
if (!config.plugins.entries) {
|
|
89
|
+
config.plugins.entries = {};
|
|
90
|
+
}
|
|
91
|
+
// Update NervePay plugin config
|
|
92
|
+
config.plugins.entries.nervepay = {
|
|
93
|
+
enabled: true,
|
|
94
|
+
config: {
|
|
95
|
+
apiUrl: 'https://api.nervepay.xyz',
|
|
96
|
+
agentDid: did,
|
|
97
|
+
privateKey: privateKey,
|
|
98
|
+
enableOrchestration: options.enableOrchestration || false,
|
|
99
|
+
enableAnalytics: options.enableAnalytics || false,
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
// Write back to file
|
|
103
|
+
fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
|
|
104
|
+
console.log(`\n✅ Updated OpenClaw config: ${configPath}`);
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
107
|
+
catch (error) {
|
|
108
|
+
console.error(`\n❌ Failed to update config:`, error.message);
|
|
109
|
+
return false;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Save credentials to backup file
|
|
114
|
+
*/
|
|
115
|
+
function saveCredentialsBackup(did, privateKey, mnemonic) {
|
|
116
|
+
const home = os.homedir();
|
|
117
|
+
const backupDir = path.join(home, '.nervepay');
|
|
118
|
+
const backupPath = path.join(backupDir, 'credentials.json');
|
|
119
|
+
try {
|
|
120
|
+
// Create directory if it doesn't exist
|
|
121
|
+
if (!fs.existsSync(backupDir)) {
|
|
122
|
+
fs.mkdirSync(backupDir, { mode: 0o700 });
|
|
123
|
+
}
|
|
124
|
+
// Save credentials
|
|
125
|
+
const credentials = {
|
|
126
|
+
did,
|
|
127
|
+
private_key: privateKey,
|
|
128
|
+
mnemonic,
|
|
129
|
+
created_at: new Date().toISOString(),
|
|
130
|
+
warning: 'KEEP THIS FILE SECURE - Contains private keys!',
|
|
131
|
+
};
|
|
132
|
+
fs.writeFileSync(backupPath, JSON.stringify(credentials, null, 2), {
|
|
133
|
+
mode: 0o600, // Only owner can read/write
|
|
134
|
+
});
|
|
135
|
+
console.log(`\n💾 Credentials backed up to: ${backupPath}`);
|
|
136
|
+
console.log(' (Secure permissions: 600 - only you can read this file)');
|
|
137
|
+
}
|
|
138
|
+
catch (error) {
|
|
139
|
+
console.error(`\n⚠️ Could not save backup:`, error.message);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Poll for claim completion
|
|
144
|
+
*/
|
|
145
|
+
async function waitForClaim(client, sessionId, timeoutMs = 600000 // 10 minutes
|
|
146
|
+
) {
|
|
147
|
+
const startTime = Date.now();
|
|
148
|
+
const pollInterval = 3000; // 3 seconds
|
|
149
|
+
while (Date.now() - startTime < timeoutMs) {
|
|
150
|
+
try {
|
|
151
|
+
const status = await identity.checkClaimStatus(client, sessionId);
|
|
152
|
+
if (status.status === 'claimed') {
|
|
153
|
+
return true;
|
|
154
|
+
}
|
|
155
|
+
else if (status.status === 'expired' || status.status === 'revoked') {
|
|
156
|
+
return false;
|
|
157
|
+
}
|
|
158
|
+
// Show progress
|
|
159
|
+
const elapsed = Math.round((Date.now() - startTime) / 1000);
|
|
160
|
+
process.stdout.write(`\r Waiting for claim... (${elapsed}s) `);
|
|
161
|
+
await new Promise((resolve) => setTimeout(resolve, pollInterval));
|
|
162
|
+
}
|
|
163
|
+
catch {
|
|
164
|
+
// Continue polling on error
|
|
165
|
+
await new Promise((resolve) => setTimeout(resolve, pollInterval));
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return false; // Timeout
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Poll for pairing approval
|
|
172
|
+
*/
|
|
173
|
+
async function waitForPairingApproval(client, requestId, timeoutMs = 1200000 // 20 minutes
|
|
174
|
+
) {
|
|
175
|
+
const startTime = Date.now();
|
|
176
|
+
const pollInterval = 3000;
|
|
177
|
+
while (Date.now() - startTime < timeoutMs) {
|
|
178
|
+
try {
|
|
179
|
+
const status = await gateway.getPairingRequestStatus(client, requestId);
|
|
180
|
+
if (status.status === 'approved') {
|
|
181
|
+
return status.pairing_code || null;
|
|
182
|
+
}
|
|
183
|
+
else if (status.status === 'rejected' || status.status === 'expired') {
|
|
184
|
+
return null;
|
|
185
|
+
}
|
|
186
|
+
const elapsed = Math.round((Date.now() - startTime) / 1000);
|
|
187
|
+
process.stdout.write(`\r Waiting for approval... (${elapsed}s) `);
|
|
188
|
+
await new Promise((resolve) => setTimeout(resolve, pollInterval));
|
|
189
|
+
}
|
|
190
|
+
catch {
|
|
191
|
+
await new Promise((resolve) => setTimeout(resolve, pollInterval));
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
return null;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Main setup wizard
|
|
198
|
+
*/
|
|
199
|
+
export async function runSetup(apiUrl = 'https://api.nervepay.xyz') {
|
|
200
|
+
const rl = createInterface();
|
|
201
|
+
console.log('\n╔═══════════════════════════════════════════════════════╗');
|
|
202
|
+
console.log('║ ║');
|
|
203
|
+
console.log('║ 🔐 NervePay Setup Wizard ║');
|
|
204
|
+
console.log('║ ║');
|
|
205
|
+
console.log('║ Self-sovereign identity for AI agents ║');
|
|
206
|
+
console.log('║ ║');
|
|
207
|
+
console.log('╚═══════════════════════════════════════════════════════╝\n');
|
|
208
|
+
const client = new NervePayClient({ apiUrl });
|
|
209
|
+
// =========================================================================
|
|
210
|
+
// Step 1: Collect Information
|
|
211
|
+
// =========================================================================
|
|
212
|
+
console.log('📋 Step 1: Agent Information\n');
|
|
213
|
+
const agentName = await prompt(rl, ' Agent name: ');
|
|
214
|
+
if (!agentName) {
|
|
215
|
+
console.log('\n❌ Agent name is required');
|
|
216
|
+
rl.close();
|
|
217
|
+
process.exit(1);
|
|
218
|
+
}
|
|
219
|
+
const agentDescription = await prompt(rl, ' Agent description (optional): ');
|
|
220
|
+
// =========================================================================
|
|
221
|
+
// Step 2: Register Identity
|
|
222
|
+
// =========================================================================
|
|
223
|
+
console.log('\n🆔 Step 2: Registering Identity...\n');
|
|
224
|
+
let registrationResult;
|
|
225
|
+
try {
|
|
226
|
+
registrationResult = await identity.registerPendingIdentity(client, {
|
|
227
|
+
name: agentName,
|
|
228
|
+
description: agentDescription || undefined,
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
catch (error) {
|
|
232
|
+
console.error('❌ Registration failed:', error.message);
|
|
233
|
+
rl.close();
|
|
234
|
+
process.exit(1);
|
|
235
|
+
}
|
|
236
|
+
const { did, private_key, mnemonic, session_id, claim_url } = registrationResult;
|
|
237
|
+
console.log(' ✅ Identity created!');
|
|
238
|
+
console.log(` DID: ${did}`);
|
|
239
|
+
// Update client with new credentials
|
|
240
|
+
client.updateConfig({ agentDid: did, privateKey: private_key });
|
|
241
|
+
// =========================================================================
|
|
242
|
+
// Step 3: Human Claim (Optional)
|
|
243
|
+
// =========================================================================
|
|
244
|
+
console.log('\n👤 Step 3: Link to Human Owner (Optional)\n');
|
|
245
|
+
const shouldClaim = await promptYesNo(rl, ' Link this agent to your NervePay account?', true);
|
|
246
|
+
if (shouldClaim) {
|
|
247
|
+
console.log('\n ┌────────────────────────────────────────────────────┐');
|
|
248
|
+
console.log(' │ │');
|
|
249
|
+
console.log(' │ Open this URL in your browser: │');
|
|
250
|
+
console.log(` │ ${claim_url}`);
|
|
251
|
+
console.log(' │ │');
|
|
252
|
+
console.log(' │ Log in to claim this agent and link it to your │');
|
|
253
|
+
console.log(' │ account. This improves trust and enables vault. │');
|
|
254
|
+
console.log(' │ │');
|
|
255
|
+
console.log(' └────────────────────────────────────────────────────┘\n');
|
|
256
|
+
const claimed = await waitForClaim(client, session_id);
|
|
257
|
+
if (claimed) {
|
|
258
|
+
console.log('\n\r ✅ Agent claimed successfully! \n');
|
|
259
|
+
}
|
|
260
|
+
else {
|
|
261
|
+
console.log('\n\r ⚠️ Claim timeout or expired. You can claim later.\n');
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
else {
|
|
265
|
+
console.log('\n ⏭️ Skipped. You can claim later via the dashboard.');
|
|
266
|
+
}
|
|
267
|
+
// =========================================================================
|
|
268
|
+
// Step 4: Gateway Pairing (Optional)
|
|
269
|
+
// =========================================================================
|
|
270
|
+
console.log('\n🔗 Step 4: Gateway Pairing (Optional)\n');
|
|
271
|
+
const shouldPairGateway = await promptYesNo(rl, ' Connect this gateway to NervePay Mission Control?', false);
|
|
272
|
+
if (shouldPairGateway) {
|
|
273
|
+
const gatewayName = await prompt(rl, ' Gateway name: ');
|
|
274
|
+
let gatewayUrl = await prompt(rl, ' Gateway URL (leave blank for auto-detect): ');
|
|
275
|
+
if (!gatewayUrl) {
|
|
276
|
+
// Try to detect from OpenClaw config
|
|
277
|
+
const configPath = findOpenClawConfig();
|
|
278
|
+
if (configPath) {
|
|
279
|
+
try {
|
|
280
|
+
const config = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
|
|
281
|
+
const port = config.gateway?.port || 18789;
|
|
282
|
+
gatewayUrl = `http://127.0.0.1:${port}`;
|
|
283
|
+
console.log(` Auto-detected: ${gatewayUrl}`);
|
|
284
|
+
}
|
|
285
|
+
catch {
|
|
286
|
+
gatewayUrl = 'http://127.0.0.1:18789';
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
else {
|
|
290
|
+
gatewayUrl = 'http://127.0.0.1:18789';
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
console.log('\n Sending pairing request...');
|
|
294
|
+
try {
|
|
295
|
+
const pairingRequest = await gateway.createPairingRequest(client, {
|
|
296
|
+
gateway_name: gatewayName || agentName,
|
|
297
|
+
gateway_url: gatewayUrl,
|
|
298
|
+
max_concurrent_agents: 8,
|
|
299
|
+
default_timeout_seconds: 3600,
|
|
300
|
+
});
|
|
301
|
+
console.log(' ✅ Pairing request sent!');
|
|
302
|
+
console.log(` Request ID: ${pairingRequest.request_id}`);
|
|
303
|
+
console.log('\n Now approve the pairing in your NervePay dashboard:');
|
|
304
|
+
console.log(' 👉 https://nervepay.xyz/dashboard/integrations\n');
|
|
305
|
+
const pairingCode = await waitForPairingApproval(client, pairingRequest.request_id);
|
|
306
|
+
if (pairingCode) {
|
|
307
|
+
console.log('\n\r ✅ Pairing approved! \n');
|
|
308
|
+
// Complete pairing
|
|
309
|
+
const gatewayToken = gateway.findGatewayToken();
|
|
310
|
+
if (gatewayToken) {
|
|
311
|
+
console.log(' Completing pairing...');
|
|
312
|
+
await gateway.completePairing(client, {
|
|
313
|
+
pairing_code: pairingCode,
|
|
314
|
+
gateway_url: gatewayUrl,
|
|
315
|
+
gateway_token: gatewayToken,
|
|
316
|
+
gateway_name: gatewayName || agentName,
|
|
317
|
+
});
|
|
318
|
+
console.log(' ✅ Gateway paired successfully!');
|
|
319
|
+
}
|
|
320
|
+
else {
|
|
321
|
+
console.log(' ⚠️ Could not find gateway token.');
|
|
322
|
+
console.log(' Complete pairing manually with nervepay_complete_pairing tool.');
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
else {
|
|
326
|
+
console.log('\n\r ⚠️ Pairing timeout or rejected. \n');
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
catch (error) {
|
|
330
|
+
console.error(' ❌ Pairing failed:', error.message);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
else {
|
|
334
|
+
console.log('\n ⏭️ Skipped. You can pair later with nervepay_pair_gateway tool.');
|
|
335
|
+
}
|
|
336
|
+
// =========================================================================
|
|
337
|
+
// Step 5: Additional Features
|
|
338
|
+
// =========================================================================
|
|
339
|
+
console.log('\n⚙️ Step 5: Additional Features\n');
|
|
340
|
+
const enableOrchestration = await promptYesNo(rl, ' Enable multi-agent orchestration?', false);
|
|
341
|
+
const enableAnalytics = await promptYesNo(rl, ' Enable analytics tracking?', true);
|
|
342
|
+
// =========================================================================
|
|
343
|
+
// Step 6: Save Configuration
|
|
344
|
+
// =========================================================================
|
|
345
|
+
console.log('\n💾 Step 6: Saving Configuration...\n');
|
|
346
|
+
// Save credentials backup
|
|
347
|
+
saveCredentialsBackup(did, private_key, mnemonic);
|
|
348
|
+
// Update OpenClaw config
|
|
349
|
+
const configUpdated = updateOpenClawConfig(did, private_key, {
|
|
350
|
+
enableOrchestration,
|
|
351
|
+
enableAnalytics,
|
|
352
|
+
});
|
|
353
|
+
// =========================================================================
|
|
354
|
+
// Step 7: Summary
|
|
355
|
+
// =========================================================================
|
|
356
|
+
console.log('\n╔═══════════════════════════════════════════════════════╗');
|
|
357
|
+
console.log('║ ║');
|
|
358
|
+
console.log('║ ✅ Setup Complete! ║');
|
|
359
|
+
console.log('║ ║');
|
|
360
|
+
console.log('╚═══════════════════════════════════════════════════════╝\n');
|
|
361
|
+
console.log('📝 Summary:\n');
|
|
362
|
+
console.log(` Agent Name: ${agentName}`);
|
|
363
|
+
console.log(` DID: ${did}`);
|
|
364
|
+
console.log(` Claimed: ${shouldClaim ? 'Yes' : 'No (you can claim later)'}`);
|
|
365
|
+
console.log(` Gateway Paired: ${shouldPairGateway ? 'Yes' : 'No'}`);
|
|
366
|
+
console.log(` Orchestration: ${enableOrchestration ? 'Enabled' : 'Disabled'}`);
|
|
367
|
+
console.log(` Analytics: ${enableAnalytics ? 'Enabled' : 'Disabled'}`);
|
|
368
|
+
console.log('\n🔐 Security:\n');
|
|
369
|
+
console.log(' ⚠️ CRITICAL: Save your recovery mnemonic securely!');
|
|
370
|
+
console.log(` Mnemonic: ${mnemonic}`);
|
|
371
|
+
console.log('\n This 12-word phrase can restore your identity.');
|
|
372
|
+
console.log(' Store it offline in a safe place.\n');
|
|
373
|
+
if (configUpdated) {
|
|
374
|
+
console.log('🔄 Next Steps:\n');
|
|
375
|
+
console.log(' 1. Restart your OpenClaw gateway:');
|
|
376
|
+
console.log(' openclaw gateway restart\n');
|
|
377
|
+
console.log(' 2. Test authentication:');
|
|
378
|
+
console.log(' openclaw nervepay whoami\n');
|
|
379
|
+
console.log(' 3. Start using NervePay tools in your agents!\n');
|
|
380
|
+
}
|
|
381
|
+
else {
|
|
382
|
+
console.log('⚠️ Next Steps:\n');
|
|
383
|
+
console.log(' 1. Manually add credentials to OpenClaw config');
|
|
384
|
+
console.log(' 2. Restart gateway: openclaw gateway restart');
|
|
385
|
+
console.log(' 3. Test: openclaw nervepay whoami\n');
|
|
386
|
+
}
|
|
387
|
+
console.log('📚 Documentation: https://nervepay.xyz/docs');
|
|
388
|
+
console.log('💬 Support: https://discord.gg/nervepay\n');
|
|
389
|
+
rl.close();
|
|
390
|
+
}
|
|
391
|
+
//# sourceMappingURL=setup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KA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CAAC;IAC3D,OAAO,CAAC,GAAG,CAAC,2CAA2C,CAAC,CAAC;IAEzD,EAAE,CAAC,KAAK,EAAE,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenClaw gateway pairing and management tools
|
|
3
|
+
*/
|
|
4
|
+
import type { NervePayClient } from '../utils/client.js';
|
|
5
|
+
export interface PairingRequestParams {
|
|
6
|
+
gateway_name: string;
|
|
7
|
+
gateway_url: string;
|
|
8
|
+
max_concurrent_agents?: number;
|
|
9
|
+
default_timeout_seconds?: number;
|
|
10
|
+
}
|
|
11
|
+
export interface PairingRequestResult {
|
|
12
|
+
request_id: string;
|
|
13
|
+
agent_did: string;
|
|
14
|
+
gateway_name: string;
|
|
15
|
+
status: 'pending';
|
|
16
|
+
created_at: string;
|
|
17
|
+
}
|
|
18
|
+
export interface PairingRequestStatus {
|
|
19
|
+
id: string;
|
|
20
|
+
status: 'pending' | 'approved' | 'rejected' | 'expired';
|
|
21
|
+
gateway_name: string;
|
|
22
|
+
gateway_url: string;
|
|
23
|
+
pairing_code?: string;
|
|
24
|
+
approved_at?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface CompletePairingParams {
|
|
27
|
+
pairing_code: string;
|
|
28
|
+
gateway_url: string;
|
|
29
|
+
gateway_token: string;
|
|
30
|
+
gateway_name: string;
|
|
31
|
+
}
|
|
32
|
+
export interface Gateway {
|
|
33
|
+
id: string;
|
|
34
|
+
name: string;
|
|
35
|
+
url: string;
|
|
36
|
+
agent_did: string;
|
|
37
|
+
status: 'active' | 'inactive' | 'error';
|
|
38
|
+
max_concurrent_agents: number;
|
|
39
|
+
default_timeout_seconds: number;
|
|
40
|
+
created_at: string;
|
|
41
|
+
last_health_check?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Send pairing request to connect gateway
|
|
45
|
+
* Requires human approval in Mission Control dashboard
|
|
46
|
+
*/
|
|
47
|
+
export declare function createPairingRequest(client: NervePayClient, params: PairingRequestParams): Promise<PairingRequestResult>;
|
|
48
|
+
/**
|
|
49
|
+
* Check pairing request status
|
|
50
|
+
*/
|
|
51
|
+
export declare function getPairingRequestStatus(client: NervePayClient, requestId: string): Promise<PairingRequestStatus>;
|
|
52
|
+
/**
|
|
53
|
+
* Complete pairing after approval (sends gateway token)
|
|
54
|
+
*/
|
|
55
|
+
export declare function completePairing(client: NervePayClient, params: CompletePairingParams): Promise<{
|
|
56
|
+
gateway_id: string;
|
|
57
|
+
status: string;
|
|
58
|
+
}>;
|
|
59
|
+
/**
|
|
60
|
+
* List all gateways
|
|
61
|
+
*/
|
|
62
|
+
export declare function listGateways(client: NervePayClient): Promise<{
|
|
63
|
+
gateways: Gateway[];
|
|
64
|
+
}>;
|
|
65
|
+
/**
|
|
66
|
+
* Get gateway by ID
|
|
67
|
+
*/
|
|
68
|
+
export declare function getGateway(client: NervePayClient, gatewayId: string): Promise<Gateway>;
|
|
69
|
+
/**
|
|
70
|
+
* Update gateway configuration
|
|
71
|
+
*/
|
|
72
|
+
export declare function updateGateway(client: NervePayClient, gatewayId: string, updates: Partial<{
|
|
73
|
+
name: string;
|
|
74
|
+
url: string;
|
|
75
|
+
max_concurrent_agents: number;
|
|
76
|
+
default_timeout_seconds: number;
|
|
77
|
+
}>): Promise<Gateway>;
|
|
78
|
+
/**
|
|
79
|
+
* Delete gateway
|
|
80
|
+
*/
|
|
81
|
+
export declare function deleteGateway(client: NervePayClient, gatewayId: string): Promise<{
|
|
82
|
+
success: boolean;
|
|
83
|
+
}>;
|
|
84
|
+
/**
|
|
85
|
+
* Health check gateway
|
|
86
|
+
*/
|
|
87
|
+
export declare function healthCheckGateway(client: NervePayClient, gatewayId: string): Promise<{
|
|
88
|
+
healthy: boolean;
|
|
89
|
+
latency_ms?: number;
|
|
90
|
+
error?: string;
|
|
91
|
+
}>;
|
|
92
|
+
/**
|
|
93
|
+
* Helper: Read OpenClaw gateway token from local config
|
|
94
|
+
*/
|
|
95
|
+
export declare function findGatewayToken(customPath?: string): string | null;
|
|
96
|
+
//# sourceMappingURL=gateway.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gateway.d.ts","sourceRoot":"","sources":["../../src/tools/gateway.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,MAAM,WAAW,oBAAoB;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAClC;AAED,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,SAAS,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,CAAC;IACxD,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,qBAAqB;IACpC,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,QAAQ,GAAG,UAAU,GAAG,OAAO,CAAC;IACxC,qBAAqB,EAAE,MAAM,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H,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,cAAc,EACtB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC;IACT,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC,CAMD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CA0CnE"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenClaw gateway pairing and management tools
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Send pairing request to connect gateway
|
|
6
|
+
* Requires human approval in Mission Control dashboard
|
|
7
|
+
*/
|
|
8
|
+
export async function createPairingRequest(client, params) {
|
|
9
|
+
return client.post('/v1/integrations/openclaw/pairing/requests', params, true);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Check pairing request status
|
|
13
|
+
*/
|
|
14
|
+
export async function getPairingRequestStatus(client, requestId) {
|
|
15
|
+
return client.get(`/v1/integrations/openclaw/pairing/requests/${requestId}`, false);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Complete pairing after approval (sends gateway token)
|
|
19
|
+
*/
|
|
20
|
+
export async function completePairing(client, params) {
|
|
21
|
+
return client.post('/v1/integrations/openclaw/pairing/complete', params, true);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* List all gateways
|
|
25
|
+
*/
|
|
26
|
+
export async function listGateways(client) {
|
|
27
|
+
return client.get('/v1/orchestration/gateways', true);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Get gateway by ID
|
|
31
|
+
*/
|
|
32
|
+
export async function getGateway(client, gatewayId) {
|
|
33
|
+
return client.get(`/v1/orchestration/gateways/${gatewayId}`, true);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Update gateway configuration
|
|
37
|
+
*/
|
|
38
|
+
export async function updateGateway(client, gatewayId, updates) {
|
|
39
|
+
return client.put(`/v1/orchestration/gateways/${gatewayId}`, updates, true);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Delete gateway
|
|
43
|
+
*/
|
|
44
|
+
export async function deleteGateway(client, gatewayId) {
|
|
45
|
+
return client.delete(`/v1/orchestration/gateways/${gatewayId}`, true);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Health check gateway
|
|
49
|
+
*/
|
|
50
|
+
export async function healthCheckGateway(client, gatewayId) {
|
|
51
|
+
return client.post(`/v1/orchestration/gateways/${gatewayId}/health`, {}, true);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Helper: Read OpenClaw gateway token from local config
|
|
55
|
+
*/
|
|
56
|
+
export function findGatewayToken(customPath) {
|
|
57
|
+
try {
|
|
58
|
+
const fs = require('fs');
|
|
59
|
+
const path = require('path');
|
|
60
|
+
const os = require('os');
|
|
61
|
+
// Check custom path first
|
|
62
|
+
if (customPath && fs.existsSync(customPath)) {
|
|
63
|
+
const data = JSON.parse(fs.readFileSync(customPath, 'utf-8'));
|
|
64
|
+
const token = data?.auth?.token || data?.gateway?.auth?.token || data?.token;
|
|
65
|
+
if (token)
|
|
66
|
+
return token;
|
|
67
|
+
}
|
|
68
|
+
// Check standard locations
|
|
69
|
+
const home = os.homedir();
|
|
70
|
+
const candidates = [
|
|
71
|
+
path.join(home, '.openclaw', 'openclaw.json'),
|
|
72
|
+
path.join(home, '.openclaw', 'gateway.json'),
|
|
73
|
+
path.join(home, '.config', 'openclaw', 'openclaw.json'),
|
|
74
|
+
path.join(home, '.openclaw', 'config.json'),
|
|
75
|
+
];
|
|
76
|
+
for (const configPath of candidates) {
|
|
77
|
+
if (!fs.existsSync(configPath))
|
|
78
|
+
continue;
|
|
79
|
+
try {
|
|
80
|
+
const data = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
|
|
81
|
+
const token = data?.auth?.token || data?.gateway?.auth?.token || data?.token;
|
|
82
|
+
if (token)
|
|
83
|
+
return token;
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
// Check environment variable
|
|
90
|
+
if (process.env.OPENCLAW_GATEWAY_TOKEN) {
|
|
91
|
+
return process.env.OPENCLAW_GATEWAY_TOKEN;
|
|
92
|
+
}
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
catch {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=gateway.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gateway.js","sourceRoot":"","sources":["../../src/tools/gateway.ts"],"names":[],"mappings":"AAAA;;GAEG;AA+CH;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,MAAsB,EACtB,MAA4B;IAE5B,OAAO,MAAM,CAAC,IAAI,CAChB,4CAA4C,EAC5C,MAAM,EACN,IAAI,CACL,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,MAAsB,EACtB,SAAiB;IAEjB,OAAO,MAAM,CAAC,GAAG,CACf,8CAA8C,SAAS,EAAE,EACzD,KAAK,CACN,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,MAAsB,EACtB,MAA6B;IAE7B,OAAO,MAAM,CAAC,IAAI,CAChB,4CAA4C,EAC5C,MAAM,EACN,IAAI,CACL,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,MAAsB;IAEtB,OAAO,MAAM,CAAC,GAAG,CAAC,4BAA4B,EAAE,IAAI,CAAC,CAAC;AACxD,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,MAAsB,EACtB,SAAi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