rapay 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/bin/ra +32 -4
  2. package/install.js +5 -4
  3. package/package.json +1 -1
package/bin/ra CHANGED
@@ -1,4 +1,32 @@
1
- #!/bin/sh
2
- # Placeholder - this file will be replaced by install.js with the actual binary
3
- echo "Ra Pay CLI not installed properly. Please reinstall with: npm install -g rapay"
4
- exit 1
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
@@ -12,8 +12,8 @@ const path = require('path');
12
12
  const https = require('https');
13
13
  const os = require('os');
14
14
 
15
- const VERSION = '1.0.0';
16
- const REPO = 'Ra-Pay-AI/rapay';
15
+ const VERSION = '1.0.1'; // CDN binary version (npm package version may differ)
16
+ const CDN_BASE = 'https://cdn.rapay.ai';
17
17
 
18
18
  // Platform/arch to binary name mapping
19
19
  // NOTE: linux-arm64 not supported yet (keyring native libs don't cross-compile)
@@ -48,7 +48,7 @@ function getBinaryName() {
48
48
  }
49
49
 
50
50
  function getDownloadUrl(filename) {
51
- return `https://github.com/${REPO}/releases/download/v${VERSION}/${filename}`;
51
+ return `${CDN_BASE}/v${VERSION}/${filename}`;
52
52
  }
53
53
 
54
54
  function download(url) {
@@ -105,7 +105,8 @@ async function install() {
105
105
  const binDir = path.join(__dirname, 'bin');
106
106
  const platform = os.platform();
107
107
  const binaryName = getBinaryName();
108
- const destName = platform === 'win32' ? 'ra.exe' : 'ra';
108
+ // Windows: ra.exe, Unix: ra-binary (launcher script handles dispatch)
109
+ const destName = platform === 'win32' ? 'ra.exe' : 'ra-binary';
109
110
  const destPath = path.join(binDir, destName);
110
111
  const binaryUrl = getDownloadUrl(binaryName);
111
112
  const checksumsUrl = getDownloadUrl('checksums.txt');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rapay",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "CLI-native payment infrastructure for AI agents. Send fiat USD payments via Stripe without browser automation.",
5
5
  "keywords": [
6
6
  "cli",