@sylphx/cli 0.20.0 → 0.21.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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 0.20.1
2
+
3
+ - Vendor native `sylphx` binary inside `@sylphx/cli` under `binaries/<os>-<arch>/` so `npm install -g @sylphx/cli` works without depending on separate platform package registry propagation.
4
+ - Platform optional packages remain secondary install path when available.
5
+
1
6
  # Changelog
2
7
 
3
8
  ## 0.20.0
package/README.md CHANGED
@@ -19,7 +19,7 @@ npm install -g @sylphx/cli
19
19
  cargo install sylphx-cli
20
20
  ```
21
21
 
22
- Requires a matching platform optional package (`@sylphx/cli-linux-x64`,
22
+ Ships a vendored native binary under `binaries/<os>-<arch>/` for supported hosts (linux-x64 first). Optional platform packages (`@sylphx/cli-linux-x64`,
23
23
  `@sylphx/cli-darwin-arm64`, …). If the optional native package is missing for
24
24
  your OS/arch, install falls back messaging to `cargo install sylphx-cli`.
25
25
 
@@ -29,20 +29,13 @@ Override path (advanced):
29
29
  export SYLPHX_CLI_BINARY=/path/to/sylphx
30
30
  ```
31
31
 
32
- ## Day-1 shipped commands
33
-
34
- | Command | Notes |
35
- | --- | --- |
36
- | `sylphx health` | Control-plane health |
37
- | `sylphx whoami` | Current principal |
38
- | `sylphx orgs list` | Organizations |
39
- | `sylphx projects list` | Projects |
40
- | `sylphx projects get <id>` | Project detail |
41
- | `sylphx environments list <project_id>` | Environments |
42
- | `sylphx environments get <project_id> <env_id>` | Environment detail |
43
- | `sylphx deployments list <project_id>` | Deployments |
44
- | `sylphx api <METHOD> <path>` | Escape hatch |
45
- | `sylphx version-info` | Contract identity |
32
+ ## Agent operator commands (Rust binary)
33
+
34
+ Full agent-operable surface (no Console). See `sylphx version-info --json`
35
+ for the authoritative `shippedCommands` list including:
36
+
37
+ deploy, rollback, status, env list|set|rm, logs, resources, db, storage,
38
+ tasks, backup, flags, previews cost, projects create, plus day-1 health/whoami/…
46
39
 
47
40
  ```bash
48
41
  export SYLPHX_TOKEN=svc_...
Binary file
package/lib/get-binary.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  const fs = require('node:fs')
4
4
  const path = require('node:path')
5
- const { platformPackageName, knownPlatforms, platformKey } = require('./platform')
5
+ const { platformPackageName, knownPlatforms, platformKey, normalizeArch } = require('./platform')
6
6
 
7
7
  /**
8
8
  * Resolve the absolute path to the native `sylphx` binary.
@@ -10,17 +10,21 @@ const { platformPackageName, knownPlatforms, platformKey } = require('./platform
10
10
  *
11
11
  * Resolution order:
12
12
  * 1. SYLPHX_CLI_BINARY env override (absolute path)
13
- * 2. optionalDependency platform package bin/sylphx(.exe)
14
- * 3. sibling packages/cli-<platform>/bin (workspace / local pack layout)
13
+ * 2. Vendored binaries shipped inside this package (binaries/<os>-<arch>/sylphx)
14
+ * 3. optionalDependency platform package bin/sylphx(.exe)
15
+ * 4. sibling packages/cli-<platform>/bin (workspace / local pack layout)
15
16
  */
16
17
 
17
18
  function binaryFileName() {
18
19
  return process.platform === 'win32' ? 'sylphx.exe' : 'sylphx'
19
20
  }
20
21
 
22
+ function vendorDirName(platform = process.platform, arch = process.arch) {
23
+ return `${platform}-${normalizeArch(arch)}`
24
+ }
25
+
21
26
  function tryRequireResolve(pkgName) {
22
27
  try {
23
- // package.json is always resolvable even if exports hide other files
24
28
  return require.resolve(`${pkgName}/package.json`)
25
29
  } catch {
26
30
  return null
@@ -33,6 +37,12 @@ function pathFromPackageRoot(pkgRoot) {
33
37
  return null
34
38
  }
35
39
 
40
+ function pathFromVendor() {
41
+ const vendor = path.join(__dirname, '..', 'binaries', vendorDirName(), binaryFileName())
42
+ if (fs.existsSync(vendor)) return vendor
43
+ return null
44
+ }
45
+
36
46
  function getBinaryPath() {
37
47
  if (process.env.SYLPHX_CLI_BINARY) {
38
48
  const override = path.resolve(process.env.SYLPHX_CLI_BINARY)
@@ -44,6 +54,9 @@ function getBinaryPath() {
44
54
  return override
45
55
  }
46
56
 
57
+ const vendored = pathFromVendor()
58
+ if (vendored) return vendored
59
+
47
60
  const pkgName = platformPackageName()
48
61
  if (!pkgName) {
49
62
  throw missingBinaryError(
@@ -57,20 +70,18 @@ function getBinaryPath() {
57
70
  if (fromOptional) return fromOptional
58
71
  }
59
72
 
60
- // Workspace / monorepo layout: packages/cli-linux-x64 next to packages/cli
61
73
  const localSibling = pathFromPackageRoot(
62
74
  path.resolve(__dirname, '..', '..', pkgName.replace('@sylphx/', '')),
63
75
  )
64
76
  if (localSibling) return localSibling
65
77
 
66
- // Nested node_modules of this package (some installers place optionals here)
67
78
  const nested = pathFromPackageRoot(
68
79
  path.resolve(__dirname, '..', 'node_modules', ...pkgName.split('/')),
69
80
  )
70
81
  if (nested) return nested
71
82
 
72
83
  throw missingBinaryError(
73
- `Native binary package ${pkgName} is not installed or does not contain bin/${binaryFileName()}.`,
84
+ `No vendored binary for ${platformKey()} and optional package ${pkgName} is missing.`,
74
85
  )
75
86
  }
76
87
 
@@ -80,7 +91,7 @@ function missingBinaryError(detail) {
80
91
  detail,
81
92
  '',
82
93
  'Fix options:',
83
- ' 1) npm install -g @sylphx/cli@0.20.0 # reinstall (pulls platform optionalDependency)',
94
+ ' 1) npm install -g @sylphx/cli@latest # reinstall npm channel',
84
95
  ' 2) cargo install sylphx-cli # crates.io SSOT (same binary product)',
85
96
  ' 3) export SYLPHX_CLI_BINARY=/path/to/sylphx',
86
97
  '',
@@ -94,5 +105,6 @@ function missingBinaryError(detail) {
94
105
  module.exports = {
95
106
  getBinaryPath,
96
107
  binaryFileName,
108
+ vendorDirName,
97
109
  missingBinaryError,
98
110
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sylphx/cli",
3
- "version": "0.20.0",
4
- "description": "Sylphx Platform CLI — npm install channel for the Rust `sylphx` binary (same SSOT as crates.io sylphx-cli).",
3
+ "version": "0.21.0",
4
+ "description": "Sylphx Platform CLI \u2014 npm install channel for the Rust `sylphx` binary (same SSOT as crates.io sylphx-cli).",
5
5
  "type": "commonjs",
6
6
  "homepage": "https://sylphx.com",
7
7
  "repository": {
@@ -20,6 +20,7 @@
20
20
  "main": "lib/index.js",
21
21
  "files": [
22
22
  "bin",
23
+ "binaries",
23
24
  "lib",
24
25
  "install.js",
25
26
  "README.md",
@@ -34,11 +35,11 @@
34
35
  "postinstall": "node ./install.js"
35
36
  },
36
37
  "optionalDependencies": {
37
- "@sylphx/cli-linux-x64": "0.20.0",
38
- "@sylphx/cli-linux-arm64": "0.20.0",
39
- "@sylphx/cli-darwin-x64": "0.20.0",
40
- "@sylphx/cli-darwin-arm64": "0.20.0",
41
- "@sylphx/cli-win32-x64": "0.20.0"
38
+ "@sylphx/cli-linux-x64": "0.21.0",
39
+ "@sylphx/cli-linux-arm64": "0.21.0",
40
+ "@sylphx/cli-darwin-x64": "0.21.0",
41
+ "@sylphx/cli-darwin-arm64": "0.21.0",
42
+ "@sylphx/cli-win32-x64": "0.21.0"
42
43
  },
43
44
  "engines": {
44
45
  "node": ">=18"
@@ -58,7 +59,7 @@
58
59
  "sylphx": {
59
60
  "channel": "rust-native",
60
61
  "crate": "sylphx-cli",
61
- "crateVersion": "0.1.1",
62
+ "crateVersion": "0.1.2",
62
63
  "binaryName": "sylphx"
63
64
  }
64
65
  }