@phystack/device-phyos 4.4.71 → 4.4.73

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 (65) hide show
  1. package/README.md +68 -3
  2. package/bin/index.js +22 -1
  3. package/package.json +9 -41
  4. package/dist/edge-hub.js +0 -1125
  5. package/dist/edge-hub.js.map +0 -1
  6. package/dist/http-proxy.js +0 -54
  7. package/dist/http-proxy.js.map +0 -1
  8. package/dist/index.js +0 -491
  9. package/dist/index.js.map +0 -1
  10. package/dist/methods/devdevice.js +0 -123
  11. package/dist/methods/devdevice.js.map +0 -1
  12. package/dist/methods/environment.js +0 -356
  13. package/dist/methods/environment.js.map +0 -1
  14. package/dist/methods/index.js +0 -24
  15. package/dist/methods/index.js.map +0 -1
  16. package/dist/methods/network/ca.js +0 -48
  17. package/dist/methods/network/ca.js.map +0 -1
  18. package/dist/methods/network/hostname.js +0 -56
  19. package/dist/methods/network/hostname.js.map +0 -1
  20. package/dist/methods/network/lan.js +0 -193
  21. package/dist/methods/network/lan.js.map +0 -1
  22. package/dist/methods/network/wifi.js +0 -299
  23. package/dist/methods/network/wifi.js.map +0 -1
  24. package/dist/methods/password.js +0 -87
  25. package/dist/methods/password.js.map +0 -1
  26. package/dist/methods/reboot.js +0 -22
  27. package/dist/methods/reboot.js.map +0 -1
  28. package/dist/methods/ssh.js +0 -148
  29. package/dist/methods/ssh.js.map +0 -1
  30. package/dist/services/scheduler.service.js +0 -335
  31. package/dist/services/scheduler.service.js.map +0 -1
  32. package/dist/store/types/network-interface.type.js +0 -3
  33. package/dist/store/types/network-interface.type.js.map +0 -1
  34. package/dist/time-sync.js +0 -119
  35. package/dist/time-sync.js.map +0 -1
  36. package/dist/types/command.types.js +0 -8
  37. package/dist/types/command.types.js.map +0 -1
  38. package/dist/types/container.types.js +0 -3
  39. package/dist/types/container.types.js.map +0 -1
  40. package/dist/types/event.types.js +0 -9
  41. package/dist/types/event.types.js.map +0 -1
  42. package/dist/types/job.types.js +0 -15
  43. package/dist/types/job.types.js.map +0 -1
  44. package/dist/types/twin.types.js +0 -34
  45. package/dist/types/twin.types.js.map +0 -1
  46. package/dist/utilities/audio-control.js +0 -919
  47. package/dist/utilities/audio-control.js.map +0 -1
  48. package/dist/utilities/docker-progress-tracker.js +0 -33
  49. package/dist/utilities/docker-progress-tracker.js.map +0 -1
  50. package/dist/utilities/docker.js +0 -1090
  51. package/dist/utilities/docker.js.map +0 -1
  52. package/dist/utilities/instances.js +0 -236
  53. package/dist/utilities/instances.js.map +0 -1
  54. package/dist/utilities/jobs.js +0 -103
  55. package/dist/utilities/jobs.js.map +0 -1
  56. package/dist/utilities/local-twins.js +0 -204
  57. package/dist/utilities/local-twins.js.map +0 -1
  58. package/dist/utilities/network-settings.js +0 -147
  59. package/dist/utilities/network-settings.js.map +0 -1
  60. package/dist/utilities/symlink.js +0 -47
  61. package/dist/utilities/symlink.js.map +0 -1
  62. package/dist/utilities/sysinfo.js +0 -128
  63. package/dist/utilities/sysinfo.js.map +0 -1
  64. package/dist/utilities/twin-manager.js +0 -108
  65. package/dist/utilities/twin-manager.js.map +0 -1
package/README.md CHANGED
@@ -1,6 +1,71 @@
1
- For local development, ensure the process can write to /etc/phyos.env
2
- if on a mac
1
+ # phydevice
2
+
3
+ PhyStack device agent for PhyOS. Compiled as a standalone Bun binary.
4
+
5
+ ## Installation
6
+
7
+ ### Via npm (recommended)
8
+
9
+ ```bash
10
+ npm install -g @phystack/device-phyos
3
11
  ```
4
- sudo echo 'LOCAL' > /etc/phyos.env
12
+
13
+ npm automatically downloads the correct binary for your platform.
14
+
15
+ ### Direct binary download (no npm required)
16
+
17
+ ```bash
18
+ VERSION=4.5.62-dev # replace with desired version
19
+
20
+ # Linux ARM64
21
+ sudo curl -sL "https://registry.npmjs.org/@phystack/phydevice-linux-arm64/-/phydevice-linux-arm64-${VERSION}.tgz" | sudo tar xz --strip-components=2 -C /usr/bin package/bin/phydevice
22
+
23
+ # Linux x86_64
24
+ sudo curl -sL "https://registry.npmjs.org/@phystack/phydevice-linux-x64/-/phydevice-linux-x64-${VERSION}.tgz" | sudo tar xz --strip-components=2 -C /usr/bin package/bin/phydevice
25
+
26
+ # macOS Apple Silicon
27
+ curl -sL "https://registry.npmjs.org/@phystack/phydevice-darwin-arm64/-/phydevice-darwin-arm64-${VERSION}.tgz" | tar xz --strip-components=2 -C /usr/local/bin package/bin/phydevice
28
+
29
+ # macOS Intel
30
+ curl -sL "https://registry.npmjs.org/@phystack/phydevice-darwin-x64/-/phydevice-darwin-x64-${VERSION}.tgz" | tar xz --strip-components=2 -C /usr/local/bin package/bin/phydevice
31
+ ```
32
+
33
+ To check available versions:
34
+
35
+ ```bash
36
+ npm view @phystack/phydevice-linux-arm64 versions --json
37
+ ```
38
+
39
+ ## Supported platforms
40
+
41
+ | Platform | Architecture | npm package |
42
+ |----------|-------------|-------------|
43
+ | Linux | ARM64 | `@phystack/phydevice-linux-arm64` |
44
+ | Linux | x86_64 | `@phystack/phydevice-linux-x64` |
45
+ | macOS | ARM64 | `@phystack/phydevice-darwin-arm64` |
46
+ | macOS | x86_64 | `@phystack/phydevice-darwin-x64` |
47
+
48
+ ## Building from source
49
+
50
+ ```bash
51
+ yarn build:binary # compile for current platform
52
+ ```
53
+
54
+ Or use the central build script for cross-compilation:
55
+
56
+ ```bash
57
+ # from repo root
58
+ yarn build:binaries # current platform
59
+ yarn build:binaries:cross # all platforms
60
+ ```
61
+
62
+ Output: `dist-binaries/<platform>/phydevice`
63
+
64
+ ## Local development
65
+
66
+ Ensure the process can write to `/etc/phyos.env`. On macOS:
67
+
68
+ ```bash
69
+ sudo sh -c 'echo LOCAL > /etc/phyos.env'
5
70
  sudo chmod 666 /etc/phyos.env
6
71
  ```
package/bin/index.js CHANGED
@@ -1,2 +1,23 @@
1
1
  #!/usr/bin/env node
2
- require('../dist/index.js');
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.4.71",
3
+ "version": "4.4.73",
4
4
  "main": "index.js",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -8,6 +8,7 @@
8
8
  "scripts": {
9
9
  "test": "echo \"Error: no test specified\" && exit 1",
10
10
  "build": "rimraf dist && tsc",
11
+ "build:binary": "VERSION=$(node -p \"require('./package.json').version\") && npx bun build --compile --minify --define \"__PKG_VERSION__=\\\"$VERSION\\\"\" ./src/index.ts --outfile phydevice",
11
12
  "start": "yarn build && node --inspect --enable-source-maps dist/index",
12
13
  "dev": "NODE_ENV=development npx nodemon",
13
14
  "format": "prettier --write \"src/**/*.{ts,js,json,md}\"",
@@ -17,8 +18,7 @@
17
18
  "phydevice": "./bin/index.js"
18
19
  },
19
20
  "files": [
20
- "bin/**/*",
21
- "dist/**/*"
21
+ "bin/**/*"
22
22
  ],
23
23
  "engines": {
24
24
  "node": ">=20.0.0"
@@ -26,43 +26,11 @@
26
26
  "author": "PhyStack.com",
27
27
  "license": "MIT",
28
28
  "description": "",
29
- "dependencies": {
30
- "@phystack/axios-proxy": "4.4.71",
31
- "@phystack/hub-client": "4.4.71",
32
- "@phystack/hub-device": "4.4.71",
33
- "@phystack/phy-logger": "4.4.71",
34
- "@vercel/ncc": "^0.38.1",
35
- "async-mutex": "^0.5.0",
36
- "bufferutil": "^4.0.8",
37
- "dockerode": "^4.0.2",
38
- "express": "^4.21.2",
39
- "fs-extra": "^11.3.0",
40
- "http-proxy-middleware": "^3.0.0",
41
- "js-yaml": "^4.1.0",
42
- "lodash": "^4.17.21",
43
- "moment-timezone": "^0.5.47",
44
- "node-schedule": "^2.1.1",
45
- "socket.io": "^4.7.5",
46
- "systeminformation": "^5.22.11",
47
- "utf-8-validate": "^6.0.4",
48
- "websocket-stream": "^5.5.2",
49
- "ws": "^8.17.1"
29
+ "optionalDependencies": {
30
+ "@phystack/phydevice-darwin-arm64": "4.4.73",
31
+ "@phystack/phydevice-darwin-x64": "4.4.73",
32
+ "@phystack/phydevice-linux-arm64": "4.4.73",
33
+ "@phystack/phydevice-linux-x64": "4.4.73"
50
34
  },
51
- "devDependencies": {
52
- "@types/dockerode": "^3.3.29",
53
- "@types/express": "^5.0.0",
54
- "@types/fs-extra": "^11.0.4",
55
- "@types/js-yaml": "^4.0.9",
56
- "@types/lodash": "^4.17.6",
57
- "@types/node": "^20.14.9",
58
- "@types/node-schedule": "^2.1.7",
59
- "@types/ws": "^8.5.10",
60
- "ncc": "^0.3.6",
61
- "pkg": "^5.8.1",
62
- "prettier": "^3.4.2",
63
- "rimraf": "^5.0.7",
64
- "typescript": "^5.5.2",
65
- "typescript-cli": "^0.1.0"
66
- },
67
- "gitHead": "38e0aec90c22df7820bcdef5886240cd9a214a32"
35
+ "gitHead": "d7fad2099db20ca9eb05c5fa1289ec822148bc98"
68
36
  }