@phystack/device-phyos 4.5.57-dev → 4.5.58-dev

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/README.md CHANGED
@@ -4,60 +4,47 @@ PhyStack device agent for PhyOS.
4
4
 
5
5
  ## Installation
6
6
 
7
- Download the pre-built binary for your platform. No runtime dependencies required.
8
-
9
- ### Linux (x86_64)
7
+ ### Via npm (recommended)
10
8
 
11
9
  ```bash
12
- curl -fsSL https://os.phygrid.com/phystack-npm/releases/latest/phydevice-linux-x64.tar.gz | tar xz
13
- sudo mv phydevice /usr/local/bin/
14
- hash -r
15
- phydevice --version
10
+ npm install -g @phystack/device-phyos
16
11
  ```
17
12
 
18
- ### Linux (ARM64)
13
+ npm automatically downloads the correct binary for your platform.
14
+
15
+ ### Direct binary download (no npm required)
19
16
 
20
17
  ```bash
21
- curl -fsSL https://os.phygrid.com/phystack-npm/releases/latest/phydevice-linux-arm64.tar.gz | tar xz
18
+ # Linux ARM64
19
+ curl -sL "https://registry.npmjs.org/@phystack/phydevice-linux-arm64/-/phydevice-linux-arm64-VERSION.tgz" | tar xz --strip-components=2 package/bin/phydevice
22
20
  sudo mv phydevice /usr/local/bin/
23
21
  hash -r
24
- phydevice --version
25
- ```
26
-
27
- ### macOS (Apple Silicon)
28
22
 
29
- ```bash
30
- curl -fsSL https://os.phygrid.com/phystack-npm/releases/latest/phydevice-darwin-arm64.tar.gz | tar xz
23
+ # Linux x86_64
24
+ curl -sL "https://registry.npmjs.org/@phystack/phydevice-linux-x64/-/phydevice-linux-x64-VERSION.tgz" | tar xz --strip-components=2 package/bin/phydevice
31
25
  sudo mv phydevice /usr/local/bin/
32
- phydevice --version
33
- ```
34
26
 
35
- ### macOS (Intel)
27
+ # macOS Apple Silicon
28
+ curl -sL "https://registry.npmjs.org/@phystack/phydevice-darwin-arm64/-/phydevice-darwin-arm64-VERSION.tgz" | tar xz --strip-components=2 package/bin/phydevice
29
+ sudo mv phydevice /usr/local/bin/
36
30
 
37
- ```bash
38
- curl -fsSL https://os.phygrid.com/phystack-npm/releases/latest/phydevice-darwin-x64.tar.gz | tar xz
31
+ # macOS Intel
32
+ curl -sL "https://registry.npmjs.org/@phystack/phydevice-darwin-x64/-/phydevice-darwin-x64-VERSION.tgz" | tar xz --strip-components=2 package/bin/phydevice
39
33
  sudo mv phydevice /usr/local/bin/
40
- phydevice --version
41
34
  ```
42
35
 
43
- ### Install a specific version
44
-
45
- Replace `latest` with the version number:
46
-
47
- ```bash
48
- curl -fsSL https://os.phygrid.com/phystack-npm/releases/4.5.54-dev/phydevice-linux-x64.tar.gz | tar xz
49
- ```
36
+ Replace `VERSION` with the desired version (e.g., `4.4.69`).
50
37
 
51
- > **Note:** If you previously had phydevice installed via npm, remove it first or run `hash -r` after installing the binary to clear the shell's path cache.
38
+ > **Note:** Run `hash -r` after installing to clear the shell's path cache.
52
39
 
53
40
  ## Supported platforms
54
41
 
55
- | Platform | Architecture | Download |
56
- |----------|-------------|----------|
57
- | Linux | x86_64 | [phydevice-linux-x64.tar.gz](https://os.phygrid.com/phystack-npm/releases/latest/phydevice-linux-x64.tar.gz) |
58
- | Linux | ARM64 | [phydevice-linux-arm64.tar.gz](https://os.phygrid.com/phystack-npm/releases/latest/phydevice-linux-arm64.tar.gz) |
59
- | macOS | ARM64 | [phydevice-darwin-arm64.tar.gz](https://os.phygrid.com/phystack-npm/releases/latest/phydevice-darwin-arm64.tar.gz) |
60
- | macOS | x86_64 | [phydevice-darwin-x64.tar.gz](https://os.phygrid.com/phystack-npm/releases/latest/phydevice-darwin-x64.tar.gz) |
42
+ | Platform | Architecture | npm package |
43
+ |----------|-------------|-------------|
44
+ | Linux | ARM64 | `@phystack/phydevice-linux-arm64` |
45
+ | Linux | x86_64 | `@phystack/phydevice-linux-x64` |
46
+ | macOS | ARM64 | `@phystack/phydevice-darwin-arm64` |
47
+ | macOS | x86_64 | `@phystack/phydevice-darwin-x64` |
61
48
 
62
49
  ## Local development
63
50
 
package/bin/index.js ADDED
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env node
2
+ const { spawnSync } = require('child_process');
3
+ const path = require('path');
4
+
5
+ const BINARY = 'phydevice';
6
+ const key = `${process.platform}-${process.arch}`;
7
+ const pkg = `@phystack/${BINARY}-${key}`;
8
+
9
+ let binPath;
10
+ try {
11
+ binPath = path.join(path.dirname(require.resolve(`${pkg}/package.json`)), 'bin', BINARY);
12
+ } catch {
13
+ console.error(
14
+ `Unsupported or missing platform package: ${pkg}\n` +
15
+ `Platform: ${key}\n\n` +
16
+ `Install manually: npm install ${pkg}\n` +
17
+ `Or download: npx ${pkg}`
18
+ );
19
+ process.exit(1);
20
+ }
21
+
22
+ const result = spawnSync(binPath, process.argv.slice(2), { stdio: 'inherit' });
23
+ process.exit(result.status ?? 1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phystack/device-phyos",
3
- "version": "4.5.57-dev",
3
+ "version": "4.5.58-dev",
4
4
  "main": "index.js",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -9,17 +9,16 @@
9
9
  "test": "echo \"Error: no test specified\" && exit 1",
10
10
  "build": "rimraf dist && tsc",
11
11
  "build:binary": "npx bun build --compile --minify ./src/index.ts --outfile phydevice",
12
- "prepublishOnly": "npx bun build --compile --minify ./src/index.ts --outfile bin/phydevice",
13
12
  "start": "yarn build && node --inspect --enable-source-maps dist/index",
14
13
  "dev": "NODE_ENV=development npx nodemon",
15
14
  "format": "prettier --write \"src/**/*.{ts,js,json,md}\"",
16
15
  "format:check": "prettier --check \"src/**/*.{ts,js,json,md}\""
17
16
  },
18
17
  "bin": {
19
- "phydevice": "./bin/phydevice"
18
+ "phydevice": "./bin/index.js"
20
19
  },
21
20
  "files": [
22
- "bin/phydevice"
21
+ "bin/**/*"
23
22
  ],
24
23
  "engines": {
25
24
  "node": ">=20.0.0"
@@ -28,10 +27,10 @@
28
27
  "license": "MIT",
29
28
  "description": "",
30
29
  "dependencies": {
31
- "@phystack/axios-proxy": "4.5.57-dev",
32
- "@phystack/hub-client": "4.5.57-dev",
33
- "@phystack/hub-device": "4.5.57-dev",
34
- "@phystack/phy-logger": "4.5.57-dev",
30
+ "@phystack/axios-proxy": "4.5.58-dev",
31
+ "@phystack/hub-client": "4.5.58-dev",
32
+ "@phystack/hub-device": "4.5.58-dev",
33
+ "@phystack/phy-logger": "4.5.58-dev",
35
34
  "@vercel/ncc": "^0.38.1",
36
35
  "async-mutex": "^0.5.0",
37
36
  "bufferutil": "^4.0.8",
@@ -65,5 +64,11 @@
65
64
  "typescript": "^5.5.2",
66
65
  "typescript-cli": "^0.1.0"
67
66
  },
68
- "gitHead": "d11ba954df0547448f973f74221cd3727b60b9ae"
67
+ "optionalDependencies": {
68
+ "@phystack/phydevice-darwin-arm64": "4.5.58-dev",
69
+ "@phystack/phydevice-darwin-x64": "4.5.58-dev",
70
+ "@phystack/phydevice-linux-arm64": "4.5.58-dev",
71
+ "@phystack/phydevice-linux-x64": "4.5.58-dev"
72
+ },
73
+ "gitHead": "4e51de0c4e43f46904625e89aa3286417cdc7c81"
69
74
  }
package/bin/phydevice DELETED
Binary file