orchestrai 0.1.5 → 0.1.6

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 (2) hide show
  1. package/bin/orchestrai.js +24 -6
  2. package/package.json +4 -4
package/bin/orchestrai.js CHANGED
@@ -24,7 +24,7 @@
24
24
 
25
25
  const path = require("path")
26
26
  const { spawnSync } = require("child_process")
27
- const { chmodSync } = require("fs")
27
+ const { chmodSync, existsSync } = require("fs")
28
28
 
29
29
  // One fixed platform package per supported platform+arch — mirrors
30
30
  // npm-package/*/package.json's own "os"/"cpu" restrictions exactly.
@@ -47,12 +47,19 @@ function resolveBinaryPath() {
47
47
  `See https://github.com/Muhamad-Yussuf/devops-mcp-server#readme for building from source instead.`,
48
48
  )
49
49
  }
50
+ // Resolve the platform package's own package.json first, then join the
51
+ // known relative bin path onto its directory — rather than
52
+ // require.resolve()-ing the binary's deep sub-path directly. Found live
53
+ // (a real WSL/global-install report, binary confirmed present on disk
54
+ // in exactly the expected location, yet the deep-path resolve() still
55
+ // failed) that the direct approach is fragile in at least one real
56
+ // global-install layout, for a reason not fully pinned down. Resolving
57
+ // package.json is the same pattern esbuild's own installer uses for
58
+ // this exact reason — it only depends on Node finding the package
59
+ // directory at all, not on any deep multi-segment specifier resolution.
60
+ let pkgDir
50
61
  try {
51
- // require.resolve() walks node_modules exactly the way `require()`
52
- // would — correct whether this dispatcher is itself inside
53
- // node_modules/orchestrai/bin/ (the real installed case) or run
54
- // directly from a workspace/monorepo layout during local testing.
55
- return require.resolve(path.join(entry.pkg, "bin", entry.bin))
62
+ pkgDir = path.dirname(require.resolve(path.join(entry.pkg, "package.json")))
56
63
  } catch {
57
64
  throw new Error(
58
65
  `The "${entry.pkg}" optional dependency isn't installed. ` +
@@ -61,6 +68,17 @@ function resolveBinaryPath() {
61
68
  `Try reinstalling without those flags.`,
62
69
  )
63
70
  }
71
+
72
+ const binPath = path.join(pkgDir, "bin", entry.bin)
73
+ if (!existsSync(binPath)) {
74
+ throw new Error(
75
+ `The "${entry.pkg}" optional dependency is installed at ${pkgDir}, ` +
76
+ `but its expected binary is missing at ${binPath}. The install may ` +
77
+ `be corrupted — try "npm uninstall -g orchestrai && npm cache clean ` +
78
+ `--force && npm i -g orchestrai" to reinstall cleanly.`,
79
+ )
80
+ }
81
+ return binPath
64
82
  }
65
83
 
66
84
  function main() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orchestrai",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "OrchestrAI — run the standalone orchestrai binary via bunx/npx with nothing pre-installed. The right platform binary is installed automatically as an optional dependency; no network download at runtime.",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -11,9 +11,9 @@
11
11
  "README.md"
12
12
  ],
13
13
  "optionalDependencies": {
14
- "orchestrai-windows-x64": "0.1.4",
15
- "orchestrai-linux-x64": "0.1.4",
16
- "orchestrai-darwin-arm64": "0.1.4"
14
+ "orchestrai-windows-x64": "0.1.6",
15
+ "orchestrai-linux-x64": "0.1.6",
16
+ "orchestrai-darwin-arm64": "0.1.6"
17
17
  },
18
18
  "engines": {
19
19
  "node": ">=18"