rskim 0.6.0 → 0.7.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.
Binary file
Binary file
Binary file
Binary file
package/bin/skim.js CHANGED
@@ -7,27 +7,82 @@ function getBinaryPath() {
7
7
  const platform = process.platform;
8
8
  const arch = process.arch;
9
9
 
10
- let binaryName = 'skim';
11
- if (platform === 'win32') {
12
- binaryName = 'skim.exe';
10
+ // Define supported platforms and their binary paths
11
+ const supportedPlatforms = {
12
+ 'linux-x64': 'bin/linux/x64/skim',
13
+ 'linux-arm64': 'bin/linux/arm64/skim',
14
+ 'darwin-x64': 'bin/darwin/x64/skim',
15
+ 'darwin-arm64': 'bin/darwin/arm64/skim',
16
+ 'win32-x64': 'bin/win32/x64/skim.exe',
17
+ };
18
+
19
+ const platformKey = `${platform}-${arch}`;
20
+ const binaryRelativePath = supportedPlatforms[platformKey];
21
+
22
+ // Check if platform is supported
23
+ if (!binaryRelativePath) {
24
+ console.error(`ERROR: Platform ${platform}-${arch} is not supported by the npm package.`);
25
+ console.error('');
26
+ console.error('Supported platforms:');
27
+ Object.keys(supportedPlatforms).forEach(p => {
28
+ console.error(` - ${p}`);
29
+ });
30
+ console.error('');
31
+ console.error('Workaround: Install via Cargo instead:');
32
+ console.error(' cargo install rskim');
33
+ console.error('');
34
+ console.error('If you believe this platform should be supported, please report:');
35
+ console.error(' https://github.com/dean0x/skim/issues');
36
+ process.exit(1);
13
37
  }
14
38
 
15
- // Try to find the binary in the package
16
- const possiblePaths = [
17
- path.join(__dirname, '..', 'bin', platform, arch, binaryName),
18
- path.join(__dirname, '..', 'bin', binaryName),
19
- ];
39
+ // Check if binary exists in package
40
+ const binaryPath = path.join(__dirname, '..', binaryRelativePath);
41
+ if (!fs.existsSync(binaryPath)) {
42
+ console.error('ERROR: Binary missing from npm package');
43
+ console.error(`Expected location: ${binaryPath}`);
44
+ console.error(`Platform: ${platformKey}`);
45
+ console.error('');
46
+ console.error('This is a packaging bug. Please report:');
47
+ console.error(' https://github.com/dean0x/skim/issues');
48
+ console.error('');
49
+ console.error('Workaround: Install via Cargo instead:');
50
+ console.error(' cargo install rskim');
51
+ process.exit(1);
52
+ }
53
+
54
+ // Quick check if binary is executable (catches glibc/musl issues)
55
+ try {
56
+ const testResult = spawnSync(binaryPath, ['--version'], {
57
+ timeout: 5000,
58
+ stdio: 'pipe'
59
+ });
60
+
61
+ if (testResult.error) {
62
+ console.error('ERROR: Binary exists but cannot be executed');
63
+ console.error(`Reason: ${testResult.error.message}`);
64
+ console.error('');
20
65
 
21
- for (const p of possiblePaths) {
22
- if (fs.existsSync(p)) {
23
- return p;
66
+ if (testResult.error.code === 'ENOENT' || testResult.error.message.includes('libc')) {
67
+ console.error('This may be a C library incompatibility issue.');
68
+ console.error('Common cause: Alpine Linux (musl) vs glibc binary mismatch');
69
+ console.error('');
70
+ console.error('If you are using Alpine Linux, install via Cargo instead:');
71
+ console.error(' apk add cargo');
72
+ console.error(' cargo install rskim');
73
+ } else {
74
+ console.error('Workaround: Install via Cargo instead:');
75
+ console.error(' cargo install rskim');
76
+ }
77
+ console.error('');
78
+ console.error('For more help, see: https://github.com/dean0x/skim/issues');
79
+ process.exit(1);
24
80
  }
81
+ } catch (e) {
82
+ // Non-fatal, just proceed
25
83
  }
26
84
 
27
- console.error('ERROR: skim binary not found for your platform');
28
- console.error(`Platform: ${platform}, Architecture: ${arch}`);
29
- console.error('Please report this issue at: https://github.com/dean0x/skim/issues');
30
- process.exit(1);
85
+ return binaryPath;
31
86
  }
32
87
 
33
88
  const binary = getBinaryPath();
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rskim",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "Smart code reader - streaming code transformation for AI agents",
5
5
  "bin": {
6
6
  "skim": "./bin/skim.js"