rapay 1.0.3 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +26 -26
- package/README.md +69 -69
- package/bin/ra +32 -32
- package/install.js +214 -198
- package/package.json +51 -51
package/LICENSE
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
Ra Pay AI Proprietary Software License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Ra Pay AI, LLC. All Rights Reserved.
|
|
4
|
-
|
|
5
|
-
This software ("Software") is proprietary and confidential.
|
|
6
|
-
|
|
7
|
-
PERMITTED USES:
|
|
8
|
-
- Install and use Software per Terms of Service at https://rapay.ai/terms
|
|
9
|
-
- Use Software for personal or commercial purposes in accordance with Terms of Service
|
|
10
|
-
|
|
11
|
-
PROHIBITED USES:
|
|
12
|
-
- Reverse engineer, decompile, or disassemble the Software
|
|
13
|
-
- Copy, modify, distribute, or create derivative works
|
|
14
|
-
- Remove proprietary notices or labels
|
|
15
|
-
- Use the Software to compete with Ra Pay AI, LLC
|
|
16
|
-
|
|
17
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
-
SOFTWARE.
|
|
24
|
-
|
|
25
|
-
Full Terms of Service: https://rapay.ai/terms
|
|
26
|
-
Privacy Policy: https://rapay.ai/privacy
|
|
1
|
+
Ra Pay AI Proprietary Software License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Ra Pay AI, LLC. All Rights Reserved.
|
|
4
|
+
|
|
5
|
+
This software ("Software") is proprietary and confidential.
|
|
6
|
+
|
|
7
|
+
PERMITTED USES:
|
|
8
|
+
- Install and use Software per Terms of Service at https://rapay.ai/terms
|
|
9
|
+
- Use Software for personal or commercial purposes in accordance with Terms of Service
|
|
10
|
+
|
|
11
|
+
PROHIBITED USES:
|
|
12
|
+
- Reverse engineer, decompile, or disassemble the Software
|
|
13
|
+
- Copy, modify, distribute, or create derivative works
|
|
14
|
+
- Remove proprietary notices or labels
|
|
15
|
+
- Use the Software to compete with Ra Pay AI, LLC
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
+
SOFTWARE.
|
|
24
|
+
|
|
25
|
+
Full Terms of Service: https://rapay.ai/terms
|
|
26
|
+
Privacy Policy: https://rapay.ai/privacy
|
package/README.md
CHANGED
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
# Ra Pay CLI
|
|
2
|
-
|
|
3
|
-
**Payment infrastructure for AI agents.** Send fiat USD payments via Stripe without browser automation.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install -g rapay
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Quick Start
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
# Link your bank account (one-time setup)
|
|
15
|
-
ra link-bank
|
|
16
|
-
|
|
17
|
-
# Send a payment
|
|
18
|
-
ra send 100 USD to acct_1234567890
|
|
19
|
-
|
|
20
|
-
# Check your balance
|
|
21
|
-
ra balance
|
|
22
|
-
|
|
23
|
-
# View transaction history
|
|
24
|
-
ra history
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## Features
|
|
28
|
-
|
|
29
|
-
- **40x more token-efficient** than browser automation (JSON vs HTML)
|
|
30
|
-
- **99% reliability** vs 50% with browser automation
|
|
31
|
-
- **2 seconds** vs 60 seconds per payment
|
|
32
|
-
- **Zero browser tracking** - terminal-native privacy
|
|
33
|
-
- **Prompt injection protection** - JSON-only responses
|
|
34
|
-
|
|
35
|
-
## For AI Agents
|
|
36
|
-
|
|
37
|
-
Ra Pay is designed for autonomous AI agents:
|
|
38
|
-
|
|
39
|
-
```bash
|
|
40
|
-
# JSON output mode for programmatic parsing
|
|
41
|
-
ra send 100 USD to acct_1234567890 --json
|
|
42
|
-
ra balance --json
|
|
43
|
-
ra history --json
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
## Commands
|
|
47
|
-
|
|
48
|
-
| Command | Description |
|
|
49
|
-
|---------|-------------|
|
|
50
|
-
| `ra link-bank` | Link your Stripe account (one-time) |
|
|
51
|
-
| `ra send <amount> USD to <account>` | Send a payment |
|
|
52
|
-
| `ra balance` | Check your balance |
|
|
53
|
-
| `ra history` | View transaction history |
|
|
54
|
-
| `ra whoami` | Show your account info |
|
|
55
|
-
| `ra schema` | Print AEO schema for AI discovery |
|
|
56
|
-
|
|
57
|
-
## Documentation
|
|
58
|
-
|
|
59
|
-
- Website: https://rapay.ai
|
|
60
|
-
- API Docs: https://api.rapay.ai/docs
|
|
61
|
-
|
|
62
|
-
## Support
|
|
63
|
-
|
|
64
|
-
- Email: e@rapay.ai
|
|
65
|
-
- Issues: https://github.com/Ra-Pay-AI/rapay/issues
|
|
66
|
-
|
|
67
|
-
## License
|
|
68
|
-
|
|
69
|
-
Proprietary - Ra Pay AI, LLC
|
|
1
|
+
# Ra Pay CLI
|
|
2
|
+
|
|
3
|
+
**Payment infrastructure for AI agents.** Send fiat USD payments via Stripe without browser automation.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g rapay
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# Link your bank account (one-time setup)
|
|
15
|
+
ra link-bank
|
|
16
|
+
|
|
17
|
+
# Send a payment
|
|
18
|
+
ra send 100 USD to acct_1234567890
|
|
19
|
+
|
|
20
|
+
# Check your balance
|
|
21
|
+
ra balance
|
|
22
|
+
|
|
23
|
+
# View transaction history
|
|
24
|
+
ra history
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Features
|
|
28
|
+
|
|
29
|
+
- **40x more token-efficient** than browser automation (JSON vs HTML)
|
|
30
|
+
- **99% reliability** vs 50% with browser automation
|
|
31
|
+
- **2 seconds** vs 60 seconds per payment
|
|
32
|
+
- **Zero browser tracking** - terminal-native privacy
|
|
33
|
+
- **Prompt injection protection** - JSON-only responses
|
|
34
|
+
|
|
35
|
+
## For AI Agents
|
|
36
|
+
|
|
37
|
+
Ra Pay is designed for autonomous AI agents:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# JSON output mode for programmatic parsing
|
|
41
|
+
ra send 100 USD to acct_1234567890 --json
|
|
42
|
+
ra balance --json
|
|
43
|
+
ra history --json
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Commands
|
|
47
|
+
|
|
48
|
+
| Command | Description |
|
|
49
|
+
|---------|-------------|
|
|
50
|
+
| `ra link-bank` | Link your Stripe account (one-time) |
|
|
51
|
+
| `ra send <amount> USD to <account>` | Send a payment |
|
|
52
|
+
| `ra balance` | Check your balance |
|
|
53
|
+
| `ra history` | View transaction history |
|
|
54
|
+
| `ra whoami` | Show your account info |
|
|
55
|
+
| `ra schema` | Print AEO schema for AI discovery |
|
|
56
|
+
|
|
57
|
+
## Documentation
|
|
58
|
+
|
|
59
|
+
- Website: https://rapay.ai
|
|
60
|
+
- API Docs: https://api.rapay.ai/docs
|
|
61
|
+
|
|
62
|
+
## Support
|
|
63
|
+
|
|
64
|
+
- Email: e@rapay.ai
|
|
65
|
+
- Issues: https://github.com/Ra-Pay-AI/rapay/issues
|
|
66
|
+
|
|
67
|
+
## License
|
|
68
|
+
|
|
69
|
+
Proprietary - Ra Pay AI, LLC
|
package/bin/ra
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const { spawn } = require('child_process');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
const os = require('os');
|
|
6
|
-
|
|
7
|
-
const binDir = __dirname;
|
|
8
|
-
const platform = os.platform();
|
|
9
|
-
const binaryName = platform === 'win32' ? 'ra.exe' : 'ra-binary';
|
|
10
|
-
const binaryPath = path.join(binDir, binaryName);
|
|
11
|
-
|
|
12
|
-
// Check if binary exists
|
|
13
|
-
const fs = require('fs');
|
|
14
|
-
if (!fs.existsSync(binaryPath)) {
|
|
15
|
-
console.error('Ra Pay CLI not installed properly. Please reinstall with: npm install -g rapay');
|
|
16
|
-
process.exit(1);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// Spawn the binary with all arguments
|
|
20
|
-
const child = spawn(binaryPath, process.argv.slice(2), {
|
|
21
|
-
stdio: 'inherit',
|
|
22
|
-
windowsHide: true
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
child.on('error', (err) => {
|
|
26
|
-
console.error('Failed to start Ra Pay CLI:', err.message);
|
|
27
|
-
process.exit(1);
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
child.on('close', (code) => {
|
|
31
|
-
process.exit(code || 0);
|
|
32
|
-
});
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { spawn } = require('child_process');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const os = require('os');
|
|
6
|
+
|
|
7
|
+
const binDir = __dirname;
|
|
8
|
+
const platform = os.platform();
|
|
9
|
+
const binaryName = platform === 'win32' ? 'ra.exe' : 'ra-binary';
|
|
10
|
+
const binaryPath = path.join(binDir, binaryName);
|
|
11
|
+
|
|
12
|
+
// Check if binary exists
|
|
13
|
+
const fs = require('fs');
|
|
14
|
+
if (!fs.existsSync(binaryPath)) {
|
|
15
|
+
console.error('Ra Pay CLI not installed properly. Please reinstall with: npm install -g rapay');
|
|
16
|
+
process.exit(1);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Spawn the binary with all arguments
|
|
20
|
+
const child = spawn(binaryPath, process.argv.slice(2), {
|
|
21
|
+
stdio: 'inherit',
|
|
22
|
+
windowsHide: true
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
child.on('error', (err) => {
|
|
26
|
+
console.error('Failed to start Ra Pay CLI:', err.message);
|
|
27
|
+
process.exit(1);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
child.on('close', (code) => {
|
|
31
|
+
process.exit(code || 0);
|
|
32
|
+
});
|
package/install.js
CHANGED
|
@@ -1,198 +1,214 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Ra Pay CLI installer
|
|
5
|
-
* Downloads the correct binary for the user's platform from GitHub Releases
|
|
6
|
-
* Verifies SHA256 checksum before installation for security
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
const { createHash } = require('crypto');
|
|
10
|
-
const fs = require('fs');
|
|
11
|
-
const path = require('path');
|
|
12
|
-
const https = require('https');
|
|
13
|
-
const os = require('os');
|
|
14
|
-
|
|
15
|
-
const VERSION = '1.0.
|
|
16
|
-
const CDN_BASE = 'https://cdn.rapay.ai';
|
|
17
|
-
|
|
18
|
-
// Platform/arch to binary name mapping
|
|
19
|
-
// NOTE: linux-arm64 not supported yet (keyring native libs don't cross-compile)
|
|
20
|
-
const BINARY_MAP = {
|
|
21
|
-
'darwin-x64': 'ra-darwin-x64',
|
|
22
|
-
'darwin-arm64': 'ra-darwin-arm64',
|
|
23
|
-
'linux-x64': 'ra-linux-x64',
|
|
24
|
-
'win32-x64': 'ra-win32-x64.exe',
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
function getPlatformKey() {
|
|
28
|
-
const platform = os.platform();
|
|
29
|
-
const arch = os.arch();
|
|
30
|
-
return `${platform}-${arch}`;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function getBinaryName() {
|
|
34
|
-
const key = getPlatformKey();
|
|
35
|
-
const binary = BINARY_MAP[key];
|
|
36
|
-
|
|
37
|
-
if (!binary) {
|
|
38
|
-
console.error(`Unsupported platform: ${key}`);
|
|
39
|
-
console.error(`Supported platforms: ${Object.keys(BINARY_MAP).join(', ')}`);
|
|
40
|
-
console.error('');
|
|
41
|
-
console.error('For linux-arm64, please build from source:');
|
|
42
|
-
console.error(' git clone https://github.com/Ra-Pay-AI/rapay');
|
|
43
|
-
console.error(' cd rapay/cli && cargo build --release');
|
|
44
|
-
process.exit(1);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
return binary;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function getDownloadUrl(filename) {
|
|
51
|
-
return `${CDN_BASE}/v${VERSION}/${filename}`;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function download(url) {
|
|
55
|
-
return new Promise((resolve, reject) => {
|
|
56
|
-
const chunks = [];
|
|
57
|
-
|
|
58
|
-
const request = (url) => {
|
|
59
|
-
const urlObj = new URL(url);
|
|
60
|
-
const options = {
|
|
61
|
-
hostname: urlObj.hostname,
|
|
62
|
-
path: urlObj.pathname,
|
|
63
|
-
headers: {
|
|
64
|
-
'User-Agent': 'rapay-installer/1.0',
|
|
65
|
-
'Accept': '*/*'
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
https.get(options, (response) => {
|
|
70
|
-
// Handle redirects
|
|
71
|
-
if (response.statusCode === 301 || response.statusCode === 302) {
|
|
72
|
-
request(response.headers.location);
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
if (response.statusCode !== 200) {
|
|
77
|
-
reject(new Error(`Failed to download: HTTP ${response.statusCode}`));
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
response.on('data', (chunk) => chunks.push(chunk));
|
|
82
|
-
response.on('end', () => resolve(Buffer.concat(chunks)));
|
|
83
|
-
response.on('error', reject);
|
|
84
|
-
}).on('error', reject);
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
request(url);
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
function calculateSha256(buffer) {
|
|
92
|
-
return createHash('sha256').update(buffer).digest('hex');
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
function parseChecksums(content) {
|
|
96
|
-
const checksums = {};
|
|
97
|
-
const lines = content.toString().split('\n');
|
|
98
|
-
|
|
99
|
-
for (const line of lines) {
|
|
100
|
-
// Skip comments and empty lines
|
|
101
|
-
if (line.startsWith('#') || !line.trim()) continue;
|
|
102
|
-
|
|
103
|
-
// Format: "hash filename" or "hash filename"
|
|
104
|
-
const match = line.match(/^([a-f0-9]{64})\s+(.+)$/i);
|
|
105
|
-
if (match) {
|
|
106
|
-
const [, hash, filename] = match;
|
|
107
|
-
checksums[filename.trim()] = hash.toLowerCase();
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
return checksums;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
async function install() {
|
|
115
|
-
const binDir = path.join(__dirname, 'bin');
|
|
116
|
-
const platform = os.platform();
|
|
117
|
-
const binaryName = getBinaryName();
|
|
118
|
-
// Windows: ra.exe, Unix: ra-binary (launcher script handles dispatch)
|
|
119
|
-
const destName = platform === 'win32' ? 'ra.exe' : 'ra-binary';
|
|
120
|
-
const destPath = path.join(binDir, destName);
|
|
121
|
-
const binaryUrl = getDownloadUrl(binaryName);
|
|
122
|
-
const checksumsUrl = getDownloadUrl('checksums.txt');
|
|
123
|
-
|
|
124
|
-
console.log(`Installing Ra Pay CLI v${VERSION} for ${getPlatformKey()}...`);
|
|
125
|
-
|
|
126
|
-
// Create bin directory
|
|
127
|
-
if (!fs.existsSync(binDir)) {
|
|
128
|
-
fs.mkdirSync(binDir, { recursive: true });
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
try {
|
|
132
|
-
// Step 1: Download checksums.txt
|
|
133
|
-
console.log('Downloading checksums...');
|
|
134
|
-
let checksums = {};
|
|
135
|
-
try {
|
|
136
|
-
const checksumsContent = await download(checksumsUrl);
|
|
137
|
-
checksums = parseChecksums(checksumsContent);
|
|
138
|
-
console.log(` Found ${Object.keys(checksums).length} checksums`);
|
|
139
|
-
} catch (error) {
|
|
140
|
-
console.
|
|
141
|
-
console.
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
// Step
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
console.error('
|
|
162
|
-
console.error('
|
|
163
|
-
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Ra Pay CLI installer
|
|
5
|
+
* Downloads the correct binary for the user's platform from GitHub Releases
|
|
6
|
+
* Verifies SHA256 checksum before installation for security
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const { createHash } = require('crypto');
|
|
10
|
+
const fs = require('fs');
|
|
11
|
+
const path = require('path');
|
|
12
|
+
const https = require('https');
|
|
13
|
+
const os = require('os');
|
|
14
|
+
|
|
15
|
+
const VERSION = '1.0.3'; // CDN binary version (npm package version may differ)
|
|
16
|
+
const CDN_BASE = 'https://cdn.rapay.ai';
|
|
17
|
+
|
|
18
|
+
// Platform/arch to binary name mapping
|
|
19
|
+
// NOTE: linux-arm64 not supported yet (keyring native libs don't cross-compile)
|
|
20
|
+
const BINARY_MAP = {
|
|
21
|
+
'darwin-x64': 'ra-darwin-x64',
|
|
22
|
+
'darwin-arm64': 'ra-darwin-arm64',
|
|
23
|
+
'linux-x64': 'ra-linux-x64',
|
|
24
|
+
'win32-x64': 'ra-win32-x64.exe',
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
function getPlatformKey() {
|
|
28
|
+
const platform = os.platform();
|
|
29
|
+
const arch = os.arch();
|
|
30
|
+
return `${platform}-${arch}`;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function getBinaryName() {
|
|
34
|
+
const key = getPlatformKey();
|
|
35
|
+
const binary = BINARY_MAP[key];
|
|
36
|
+
|
|
37
|
+
if (!binary) {
|
|
38
|
+
console.error(`Unsupported platform: ${key}`);
|
|
39
|
+
console.error(`Supported platforms: ${Object.keys(BINARY_MAP).join(', ')}`);
|
|
40
|
+
console.error('');
|
|
41
|
+
console.error('For linux-arm64, please build from source:');
|
|
42
|
+
console.error(' git clone https://github.com/Ra-Pay-AI/rapay');
|
|
43
|
+
console.error(' cd rapay/cli && cargo build --release');
|
|
44
|
+
process.exit(1);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return binary;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function getDownloadUrl(filename) {
|
|
51
|
+
return `${CDN_BASE}/v${VERSION}/${filename}`;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function download(url) {
|
|
55
|
+
return new Promise((resolve, reject) => {
|
|
56
|
+
const chunks = [];
|
|
57
|
+
|
|
58
|
+
const request = (url) => {
|
|
59
|
+
const urlObj = new URL(url);
|
|
60
|
+
const options = {
|
|
61
|
+
hostname: urlObj.hostname,
|
|
62
|
+
path: urlObj.pathname,
|
|
63
|
+
headers: {
|
|
64
|
+
'User-Agent': 'rapay-installer/1.0',
|
|
65
|
+
'Accept': '*/*'
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
https.get(options, (response) => {
|
|
70
|
+
// Handle redirects
|
|
71
|
+
if (response.statusCode === 301 || response.statusCode === 302) {
|
|
72
|
+
request(response.headers.location);
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (response.statusCode !== 200) {
|
|
77
|
+
reject(new Error(`Failed to download: HTTP ${response.statusCode}`));
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
response.on('data', (chunk) => chunks.push(chunk));
|
|
82
|
+
response.on('end', () => resolve(Buffer.concat(chunks)));
|
|
83
|
+
response.on('error', reject);
|
|
84
|
+
}).on('error', reject);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
request(url);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function calculateSha256(buffer) {
|
|
92
|
+
return createHash('sha256').update(buffer).digest('hex');
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function parseChecksums(content) {
|
|
96
|
+
const checksums = {};
|
|
97
|
+
const lines = content.toString().split('\n');
|
|
98
|
+
|
|
99
|
+
for (const line of lines) {
|
|
100
|
+
// Skip comments and empty lines
|
|
101
|
+
if (line.startsWith('#') || !line.trim()) continue;
|
|
102
|
+
|
|
103
|
+
// Format: "hash filename" or "hash filename"
|
|
104
|
+
const match = line.match(/^([a-f0-9]{64})\s+(.+)$/i);
|
|
105
|
+
if (match) {
|
|
106
|
+
const [, hash, filename] = match;
|
|
107
|
+
checksums[filename.trim()] = hash.toLowerCase();
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return checksums;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
async function install() {
|
|
115
|
+
const binDir = path.join(__dirname, 'bin');
|
|
116
|
+
const platform = os.platform();
|
|
117
|
+
const binaryName = getBinaryName();
|
|
118
|
+
// Windows: ra.exe, Unix: ra-binary (launcher script handles dispatch)
|
|
119
|
+
const destName = platform === 'win32' ? 'ra.exe' : 'ra-binary';
|
|
120
|
+
const destPath = path.join(binDir, destName);
|
|
121
|
+
const binaryUrl = getDownloadUrl(binaryName);
|
|
122
|
+
const checksumsUrl = getDownloadUrl('checksums.txt');
|
|
123
|
+
|
|
124
|
+
console.log(`Installing Ra Pay CLI v${VERSION} for ${getPlatformKey()}...`);
|
|
125
|
+
|
|
126
|
+
// Create bin directory
|
|
127
|
+
if (!fs.existsSync(binDir)) {
|
|
128
|
+
fs.mkdirSync(binDir, { recursive: true });
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
try {
|
|
132
|
+
// Step 1: Download checksums.txt
|
|
133
|
+
console.log('Downloading checksums...');
|
|
134
|
+
let checksums = {};
|
|
135
|
+
try {
|
|
136
|
+
const checksumsContent = await download(checksumsUrl);
|
|
137
|
+
checksums = parseChecksums(checksumsContent);
|
|
138
|
+
console.log(` Found ${Object.keys(checksums).length} checksums`);
|
|
139
|
+
} catch (error) {
|
|
140
|
+
console.error('');
|
|
141
|
+
console.error('SECURITY ERROR: Could not download checksums.txt');
|
|
142
|
+
console.error('Cannot verify binary integrity. Installation aborted.');
|
|
143
|
+
console.error('');
|
|
144
|
+
console.error('If this is a new release, checksums may not be published yet.');
|
|
145
|
+
console.error('Try again in a few minutes or contact support@rapay.ai');
|
|
146
|
+
process.exit(1);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// Step 2: Download binary
|
|
150
|
+
console.log(`Downloading ${binaryName}...`);
|
|
151
|
+
const binaryBuffer = await download(binaryUrl);
|
|
152
|
+
console.log(` Downloaded ${(binaryBuffer.length / 1024 / 1024).toFixed(2)} MB`);
|
|
153
|
+
|
|
154
|
+
// Step 3: Verify checksum (if available)
|
|
155
|
+
const expectedHash = checksums[binaryName];
|
|
156
|
+
if (expectedHash) {
|
|
157
|
+
console.log('Verifying checksum...');
|
|
158
|
+
const actualHash = calculateSha256(binaryBuffer);
|
|
159
|
+
|
|
160
|
+
if (actualHash !== expectedHash) {
|
|
161
|
+
console.error('');
|
|
162
|
+
console.error('SECURITY ERROR: Checksum verification failed!');
|
|
163
|
+
console.error(` Expected: ${expectedHash}`);
|
|
164
|
+
console.error(` Got: ${actualHash}`);
|
|
165
|
+
console.error('');
|
|
166
|
+
console.error('The downloaded binary may have been tampered with.');
|
|
167
|
+
console.error('Please report this issue at: https://github.com/Ra-Pay-AI/rapay/issues');
|
|
168
|
+
process.exit(1);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
console.log(' Checksum verified OK');
|
|
172
|
+
} else if (Object.keys(checksums).length > 0) {
|
|
173
|
+
// We have checksums but not for this binary - suspicious
|
|
174
|
+
console.error('');
|
|
175
|
+
console.error(`SECURITY ERROR: No checksum found for ${binaryName}`);
|
|
176
|
+
console.error('Cannot verify binary integrity. Installation aborted.');
|
|
177
|
+
console.error('');
|
|
178
|
+
console.error('This may indicate a supply chain attack or misconfigured release.');
|
|
179
|
+
console.error('Please report this at: https://github.com/Ra-Pay-AI/rapay/issues');
|
|
180
|
+
process.exit(1);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// Step 4: Write binary to disk
|
|
184
|
+
fs.writeFileSync(destPath, binaryBuffer);
|
|
185
|
+
|
|
186
|
+
// Step 5: Make executable on Unix
|
|
187
|
+
if (platform !== 'win32') {
|
|
188
|
+
fs.chmodSync(destPath, 0o755);
|
|
189
|
+
// Also ensure launcher script is executable
|
|
190
|
+
const launcherPath = path.join(binDir, 'ra');
|
|
191
|
+
if (fs.existsSync(launcherPath)) {
|
|
192
|
+
fs.chmodSync(launcherPath, 0o755);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
console.log('');
|
|
197
|
+
console.log('Ra Pay CLI installed successfully!');
|
|
198
|
+
console.log('Run "ra --help" to get started.');
|
|
199
|
+
console.log('');
|
|
200
|
+
console.log('Quick start:');
|
|
201
|
+
console.log(' ra link-bank Connect your Stripe account');
|
|
202
|
+
console.log(' ra balance Check your balance');
|
|
203
|
+
console.log(' ra send Send payments');
|
|
204
|
+
} catch (error) {
|
|
205
|
+
console.error('');
|
|
206
|
+
console.error('Failed to install Ra Pay CLI:', error.message);
|
|
207
|
+
console.error('');
|
|
208
|
+
console.error('You can manually download the binary from:');
|
|
209
|
+
console.error(`${CDN_BASE}/v${VERSION}/`);
|
|
210
|
+
process.exit(1);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
install();
|
package/package.json
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "rapay",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "CLI-native payment infrastructure for AI agents. Send fiat USD payments via Stripe without browser automation.",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"cli",
|
|
7
|
-
"payments",
|
|
8
|
-
"ai-agents",
|
|
9
|
-
"stripe",
|
|
10
|
-
"fiat",
|
|
11
|
-
"terminal",
|
|
12
|
-
"automation",
|
|
13
|
-
"mcp",
|
|
14
|
-
"claude",
|
|
15
|
-
"chatgpt"
|
|
16
|
-
],
|
|
17
|
-
"author": "Ra Pay AI, LLC <e@rapay.ai>",
|
|
18
|
-
"license": "UNLICENSED",
|
|
19
|
-
"homepage": "https://rapay.ai",
|
|
20
|
-
"repository": {
|
|
21
|
-
"type": "git",
|
|
22
|
-
"url": "https://github.com/Ra-Pay-AI/rapay"
|
|
23
|
-
},
|
|
24
|
-
"bugs": {
|
|
25
|
-
"url": "https://github.com/Ra-Pay-AI/rapay/issues"
|
|
26
|
-
},
|
|
27
|
-
"bin": {
|
|
28
|
-
"ra": "bin/ra"
|
|
29
|
-
},
|
|
30
|
-
"scripts": {
|
|
31
|
-
"postinstall": "node install.js"
|
|
32
|
-
},
|
|
33
|
-
"engines": {
|
|
34
|
-
"node": ">=14.0.0"
|
|
35
|
-
},
|
|
36
|
-
"os": [
|
|
37
|
-
"darwin",
|
|
38
|
-
"linux",
|
|
39
|
-
"win32"
|
|
40
|
-
],
|
|
41
|
-
"cpu": [
|
|
42
|
-
"x64",
|
|
43
|
-
"arm64"
|
|
44
|
-
],
|
|
45
|
-
"files": [
|
|
46
|
-
"bin",
|
|
47
|
-
"install.js",
|
|
48
|
-
"README.md",
|
|
49
|
-
"LICENSE"
|
|
50
|
-
]
|
|
51
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "rapay",
|
|
3
|
+
"version": "1.0.6",
|
|
4
|
+
"description": "CLI-native payment infrastructure for AI agents. Send fiat USD payments via Stripe without browser automation.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"cli",
|
|
7
|
+
"payments",
|
|
8
|
+
"ai-agents",
|
|
9
|
+
"stripe",
|
|
10
|
+
"fiat",
|
|
11
|
+
"terminal",
|
|
12
|
+
"automation",
|
|
13
|
+
"mcp",
|
|
14
|
+
"claude",
|
|
15
|
+
"chatgpt"
|
|
16
|
+
],
|
|
17
|
+
"author": "Ra Pay AI, LLC <e@rapay.ai>",
|
|
18
|
+
"license": "UNLICENSED",
|
|
19
|
+
"homepage": "https://rapay.ai",
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "https://github.com/Ra-Pay-AI/rapay"
|
|
23
|
+
},
|
|
24
|
+
"bugs": {
|
|
25
|
+
"url": "https://github.com/Ra-Pay-AI/rapay/issues"
|
|
26
|
+
},
|
|
27
|
+
"bin": {
|
|
28
|
+
"ra": "bin/ra"
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"postinstall": "node install.js"
|
|
32
|
+
},
|
|
33
|
+
"engines": {
|
|
34
|
+
"node": ">=14.0.0"
|
|
35
|
+
},
|
|
36
|
+
"os": [
|
|
37
|
+
"darwin",
|
|
38
|
+
"linux",
|
|
39
|
+
"win32"
|
|
40
|
+
],
|
|
41
|
+
"cpu": [
|
|
42
|
+
"x64",
|
|
43
|
+
"arm64"
|
|
44
|
+
],
|
|
45
|
+
"files": [
|
|
46
|
+
"bin",
|
|
47
|
+
"install.js",
|
|
48
|
+
"README.md",
|
|
49
|
+
"LICENSE"
|
|
50
|
+
]
|
|
51
|
+
}
|