hedgequantx 2.7.30 → 2.7.32

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.32",
4
4
  "description": "HedgeQuantX - Prop Futures Trading CLI",
5
5
  "main": "src/app.js",
6
6
  "bin": {
package/src/app.js CHANGED
@@ -175,11 +175,12 @@ const run = async () => {
175
175
  const boxWidth = getLogoWidth();
176
176
  const innerWidth = boxWidth - 2;
177
177
 
178
- // Show loading inside the box
179
- console.log(chalk.cyan('╠' + '═'.repeat(innerWidth) + '╣'));
178
+ // Show loading inside the box (no extra borders)
180
179
  const loadingText = ' LOADING DASHBOARD...';
181
180
  const loadingPad = innerWidth - loadingText.length;
182
- process.stdout.write(chalk.cyan('') + chalk.yellow(loadingText) + ' '.repeat(loadingPad) + chalk.cyan(''));
181
+ console.log(chalk.cyan('' + ''.repeat(innerWidth) + ''));
182
+ console.log(chalk.cyan('║') + chalk.yellow(loadingText) + ' '.repeat(loadingPad) + chalk.cyan('║'));
183
+ console.log(chalk.cyan('╚' + '═'.repeat(innerWidth) + '╝'));
183
184
 
184
185
  const restored = await connections.restoreFromStorage();
185
186
 
@@ -187,9 +188,6 @@ const run = async () => {
187
188
  currentService = connections.getAll()[0].service;
188
189
  await refreshStats();
189
190
  }
190
-
191
- // Clear loading line
192
- process.stdout.write('\r' + ' '.repeat(boxWidth + 2) + '\r');
193
191
 
194
192
  // Main loop
195
193
  while (true) {
@@ -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