hyperclaw 5.0.2 → 5.0.3

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/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "hyperclaw",
3
- "version": "5.0.2",
3
+ "version": "5.0.3",
4
4
  "description": "⚡ HyperClaw — AI Gateway Platform. The Lobster Evolution 🦅",
5
5
  "main": "dist/run-main.js",
6
6
  "bin": {
7
- "hyperclaw": "dist/run-main.js"
7
+ "hyperclaw": "bin/hyperclaw.js"
8
8
  },
9
9
  "files": [
10
+ "bin/",
10
11
  "dist/",
11
12
  "scripts/",
12
13
  "README.md",
@@ -37,7 +38,7 @@
37
38
  "core:build": "tsc --noEmit -p packages/core/tsconfig.json",
38
39
  "prepare": "npm run build",
39
40
  "prepublishOnly": "npm run build && npm run sdk:build && npm run core:build",
40
- "postinstall": "node scripts/postinstall.js 2>/dev/null || true",
41
+ "postinstall": "node scripts/postinstall.js",
41
42
  "test": "vitest run",
42
43
  "test:watch": "vitest",
43
44
  "test:coverage": "vitest run --coverage",
@@ -1,42 +1,53 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env node
2
2
  // scripts/postinstall.js
3
3
  // Shown after `npm install -g hyperclaw` — guides user to onboard.
4
4
  // Kept dependency-free (plain Node.js) so it works before npm install completes.
5
+ // Wrapped in try-catch so a failure here never breaks the install.
5
6
 
6
7
  'use strict';
7
8
 
8
- // Skip in CI or when installed as a dependency (not globally)
9
- if (process.env.CI || process.env.npm_config_global !== 'true') {
10
- process.exit(0);
11
- }
9
+ try {
10
+ // Skip in CI or when installed as a dependency (not globally)
11
+ if (process.env.CI || process.env.npm_config_global !== 'true') {
12
+ process.exit(0);
13
+ }
12
14
 
13
- const isWin = process.platform === 'win32';
15
+ const cyan = (s) => `\x1b[36m${s}\x1b[0m`;
16
+ const bold = (s) => `\x1b[1m${s}\x1b[0m`;
17
+ const gray = (s) => `\x1b[90m${s}\x1b[0m`;
18
+ const green = (s) => `\x1b[32m${s}\x1b[0m`;
14
19
 
15
- const cyan = (s) => `\x1b[36m${s}\x1b[0m`;
16
- const bold = (s) => `\x1b[1m${s}\x1b[0m`;
17
- const gray = (s) => `\x1b[90m${s}\x1b[0m`;
18
- const green = (s) => `\x1b[32m${s}\x1b[0m`;
19
- const dim = (s) => `\x1b[2m${s}\x1b[0m`;
20
+ let version = '5.0.3';
21
+ try {
22
+ const path = require('path');
23
+ const fs = require('fs');
24
+ const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, '..', 'package.json'), 'utf8'));
25
+ version = pkg.version || version;
26
+ } catch (_) {}
20
27
 
21
- const line = gray('─'.repeat(56));
28
+ const line = gray('─'.repeat(56));
22
29
 
23
- console.log('');
24
- console.log(line);
25
- console.log('');
26
- console.log(` ${bold(' HyperClaw')} ${cyan('v' + require('../package.json').version)} ${gray('installed successfully')}`);
27
- console.log('');
28
- console.log(` Run the setup wizard to get started:`);
29
- console.log('');
30
- console.log(` ${cyan('hyperclaw onboard')}`);
31
- console.log('');
32
- console.log(` Or start with daemon auto-install:`);
33
- console.log('');
34
- console.log(` ${cyan('hyperclaw onboard --install-daemon')}`);
35
- console.log('');
36
- console.log(line);
37
- console.log('');
38
- console.log(` ${gray('Docs:')} https://hyperclaw.ai/docs`);
39
- console.log(` ${gray('GitHub:')} https://github.com/hyperclaw-ai/hyperclaw`);
40
- console.log('');
41
- console.log(line);
42
- console.log('');
30
+ console.log('');
31
+ console.log(line);
32
+ console.log('');
33
+ console.log(` ${bold('\u26a1 HyperClaw')} ${cyan('v' + version)} ${gray('installed successfully')}`);
34
+ console.log('');
35
+ console.log(` Run the setup wizard to get started:`);
36
+ console.log('');
37
+ console.log(` ${cyan('hyperclaw onboard')}`);
38
+ console.log('');
39
+ console.log(` Or start with daemon auto-install:`);
40
+ console.log('');
41
+ console.log(` ${cyan('hyperclaw onboard --install-daemon')}`);
42
+ console.log('');
43
+ console.log(line);
44
+ console.log('');
45
+ console.log(` ${gray('Docs:')} https://github.com/mylo-2001/hyperclaw#readme`);
46
+ console.log(` ${gray('GitHub:')} https://github.com/mylo-2001/hyperclaw`);
47
+ console.log('');
48
+ console.log(line);
49
+ console.log('');
50
+ } catch (_) {
51
+ // Never fail the install due to postinstall script errors
52
+ process.exit(0);
53
+ }