hedgequantx 2.7.30 → 2.7.31
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/package.json
CHANGED
|
@@ -28,24 +28,47 @@ const DEFAULT_PORT = 8317;
|
|
|
28
28
|
const CALLBACK_PORT = 54545;
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
|
-
* Detect if running in headless/VPS environment (no
|
|
31
|
+
* Detect if running in headless/VPS environment (no browser access)
|
|
32
32
|
* @returns {boolean}
|
|
33
33
|
*/
|
|
34
34
|
const isHeadless = () => {
|
|
35
|
-
//
|
|
36
|
-
if (process.env.
|
|
37
|
-
|
|
35
|
+
// 1. SSH connection = definitely VPS/remote
|
|
36
|
+
if (process.env.SSH_CLIENT || process.env.SSH_TTY || process.env.SSH_CONNECTION) {
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// 2. Docker/container environment
|
|
41
|
+
if (process.env.DOCKER_CONTAINER || process.env.KUBERNETES_SERVICE_HOST) {
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
38
44
|
|
|
39
|
-
//
|
|
40
|
-
if (process.env.
|
|
45
|
+
// 3. Common CI/CD environments
|
|
46
|
+
if (process.env.CI || process.env.GITHUB_ACTIONS || process.env.GITLAB_CI) {
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
41
49
|
|
|
42
|
-
// Check
|
|
50
|
+
// 4. Check for display on Linux
|
|
43
51
|
if (process.platform === 'linux') {
|
|
44
|
-
//
|
|
52
|
+
// Has display = local with GUI
|
|
53
|
+
if (process.env.DISPLAY || process.env.WAYLAND_DISPLAY) {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
// No display on Linux = likely headless/VPS
|
|
45
57
|
return true;
|
|
46
58
|
}
|
|
47
59
|
|
|
48
|
-
// macOS
|
|
60
|
+
// 5. macOS - check if running in terminal with GUI access
|
|
61
|
+
if (process.platform === 'darwin') {
|
|
62
|
+
// macOS always has GUI unless SSH (checked above)
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// 6. Windows - usually has GUI
|
|
67
|
+
if (process.platform === 'win32') {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Default: assume local
|
|
49
72
|
return false;
|
|
50
73
|
};
|
|
51
74
|
|