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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hedgequantx",
3
- "version": "2.7.30",
3
+ "version": "2.7.31",
4
4
  "description": "HedgeQuantX - Prop Futures Trading CLI",
5
5
  "main": "src/app.js",
6
6
  "bin": {
@@ -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 display)
31
+ * Detect if running in headless/VPS environment (no browser access)
32
32
  * @returns {boolean}
33
33
  */
34
34
  const isHeadless = () => {
35
- // Check for common display environment variables
36
- if (process.env.DISPLAY) return false;
37
- if (process.env.WAYLAND_DISPLAY) return false;
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
- // Check if running via SSH
40
- if (process.env.SSH_CLIENT || process.env.SSH_TTY || process.env.SSH_CONNECTION) return true;
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 platform-specific indicators
50
+ // 4. Check for display on Linux
43
51
  if (process.platform === 'linux') {
44
- // No DISPLAY usually means headless on Linux
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/Windows usually have a display
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