@postman-cse/cse-toold 1.9.0 → 1.13.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.
Files changed (2) hide show
  1. package/package.json +5 -5
  2. package/src/index.js +18 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@postman-cse/cse-toold",
3
- "version": "1.9.0",
3
+ "version": "1.13.0",
4
4
  "description": "CSE tools daemon: signed Rust binary that mediates auth + MCP traffic for Claude/Codex/Droid",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -22,9 +22,9 @@
22
22
  "bin/"
23
23
  ],
24
24
  "optionalDependencies": {
25
- "@postman-cse/cse-toold-darwin-arm64": "1.9.0",
26
- "@postman-cse/cse-toold-linux-arm64": "1.9.0",
27
- "@postman-cse/cse-toold-linux-x64": "1.9.0",
28
- "@postman-cse/cse-toold-win32-arm64": "1.9.0"
25
+ "@postman-cse/cse-toold-darwin-arm64": "1.13.0",
26
+ "@postman-cse/cse-toold-linux-arm64": "1.13.0",
27
+ "@postman-cse/cse-toold-linux-x64": "1.13.0",
28
+ "@postman-cse/cse-toold-win32-arm64": "1.13.0"
29
29
  }
30
30
  }
package/src/index.js CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  const path = require('path');
4
4
  const fs = require('fs');
5
+ const os = require('os');
5
6
  const child_process = require('child_process');
6
7
 
7
8
  function platformPackageName() {
@@ -12,6 +13,21 @@ function nativeBinaryName(platform) {
12
13
  return platform === 'win32' ? 'cse-toold.exe' : 'cse-toold';
13
14
  }
14
15
 
16
+ function stableBinaryPath() {
17
+ if (process.platform !== 'darwin') return undefined;
18
+ return path.join(os.homedir(), 'Library', 'Application Support', 'cse-tools', 'bin', 'cse-toold');
19
+ }
20
+
21
+ function executableCandidate(candidate) {
22
+ if (!candidate || !fs.existsSync(candidate)) return undefined;
23
+ try {
24
+ fs.accessSync(candidate, fs.constants.X_OK);
25
+ return candidate;
26
+ } catch (_) {
27
+ throw new Error('native runtime is not executable');
28
+ }
29
+ }
30
+
15
31
  function resolveCoreBinary() {
16
32
  const platformKey = `${process.platform}-${process.arch}`;
17
33
  const supportedPlatforms = new Set([
@@ -21,6 +37,8 @@ function resolveCoreBinary() {
21
37
  'win32-arm64',
22
38
  ]);
23
39
  const binaryName = nativeBinaryName(process.platform);
40
+ const stable = executableCandidate(stableBinaryPath());
41
+ if (stable) return stable;
24
42
 
25
43
  if (supportedPlatforms.has(platformKey)) {
26
44
  try {