@diggerhq/catty 0.5.7 → 0.5.8

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/bin/catty ADDED
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { execFileSync } = require('child_process');
4
+ const path = require('path');
5
+ const os = require('os');
6
+
7
+ const platform = os.platform();
8
+ const arch = os.arch();
9
+
10
+ const platformMap = { darwin: 'darwin', linux: 'linux' };
11
+ const archMap = { x64: 'amd64', arm64: 'arm64' };
12
+
13
+ const goPlatform = platformMap[platform];
14
+ const goArch = archMap[arch];
15
+
16
+ if (!goPlatform || !goArch) {
17
+ console.error(`Unsupported platform: ${platform}/${arch}`);
18
+ process.exit(1);
19
+ }
20
+
21
+ const binary = path.join(__dirname, `catty-${goPlatform}-${goArch}`);
22
+
23
+ try {
24
+ execFileSync(binary, process.argv.slice(2), { stdio: 'inherit' });
25
+ } catch (err) {
26
+ if (err.status !== undefined) process.exit(err.status);
27
+ console.error(`Failed to run catty: ${err.message}`);
28
+ process.exit(1);
29
+ }
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,12 +1,11 @@
1
1
  {
2
2
  "name": "@diggerhq/catty",
3
- "version": "0.5.7",
3
+ "version": "0.5.8",
4
4
  "description": "A Claude Code wrapper with centralized streaming for cross-device access",
5
5
  "bin": {
6
6
  "catty": "./bin/catty"
7
7
  },
8
8
  "scripts": {
9
- "postinstall": "node scripts/install.js",
10
9
  "build": "bash scripts/build.sh"
11
10
  },
12
11
  "keywords": [
@@ -31,8 +30,6 @@
31
30
  "arm64"
32
31
  ],
33
32
  "files": [
34
- "bin/catty",
35
- "scripts/install.js",
36
- "README.md"
33
+ "bin/"
37
34
  ]
38
35
  }
@@ -1,85 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const https = require('https');
4
- const fs = require('fs');
5
- const path = require('path');
6
- const os = require('os');
7
- const { execSync } = require('child_process');
8
-
9
- const REPO = 'diggerhq/catty-releases';
10
- const packageJson = require('../package.json');
11
- const VERSION = packageJson.version;
12
-
13
- const platformMap = { darwin: 'darwin', linux: 'linux' };
14
- const archMap = { x64: 'amd64', arm64: 'arm64' };
15
-
16
- const platform = platformMap[os.platform()];
17
- const arch = archMap[os.arch()];
18
-
19
- if (!platform || !arch) {
20
- console.error(`Unsupported platform: ${os.platform()}/${os.arch()}`);
21
- process.exit(1);
22
- }
23
-
24
- const binaryName = `catty-${platform}-${arch}`;
25
- const binDir = path.join(__dirname, '..', 'bin');
26
- const targetPath = path.join(binDir, 'catty-binary');
27
-
28
- // Ensure bin directory exists
29
- if (!fs.existsSync(binDir)) {
30
- fs.mkdirSync(binDir, { recursive: true });
31
- }
32
-
33
- // Download URL
34
- const downloadUrl = `https://github.com/${REPO}/releases/download/v${VERSION}/${binaryName}`;
35
-
36
- console.log(`Downloading catty v${VERSION} for ${platform}/${arch}...`);
37
-
38
- function download(url, dest) {
39
- return new Promise((resolve, reject) => {
40
- const file = fs.createWriteStream(dest);
41
-
42
- https.get(url, (response) => {
43
- // Handle redirects (GitHub releases use redirects)
44
- if (response.statusCode === 302 || response.statusCode === 301) {
45
- file.close();
46
- fs.unlinkSync(dest);
47
- return download(response.headers.location, dest).then(resolve).catch(reject);
48
- }
49
-
50
- if (response.statusCode !== 200) {
51
- file.close();
52
- fs.unlinkSync(dest);
53
- reject(new Error(`Failed to download: ${response.statusCode} ${response.statusMessage}`));
54
- return;
55
- }
56
-
57
- response.pipe(file);
58
- file.on('finish', () => {
59
- file.close();
60
- resolve();
61
- });
62
- }).on('error', (err) => {
63
- file.close();
64
- fs.unlinkSync(dest);
65
- reject(err);
66
- });
67
- });
68
- }
69
-
70
- async function main() {
71
- try {
72
- await download(downloadUrl, targetPath);
73
-
74
- // Make executable
75
- fs.chmodSync(targetPath, 0o755);
76
-
77
- console.log(`✓ Installed catty v${VERSION} for ${platform}/${arch}`);
78
- } catch (err) {
79
- console.error(`Failed to install catty: ${err.message}`);
80
- console.error(`URL: ${downloadUrl}`);
81
- process.exit(1);
82
- }
83
- }
84
-
85
- main();