hedgequantx 1.8.16 → 1.8.18

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": "1.8.16",
3
+ "version": "1.8.18",
4
4
  "description": "Prop Futures Algo Trading CLI - Connect to Topstep, Alpha Futures, and other prop firms",
5
5
  "main": "src/app.js",
6
6
  "bin": {
@@ -1,9 +1,10 @@
1
1
  /**
2
2
  * Centralized prompts utility
3
- * Uses inquirer for reliable stdin handling
3
+ * Uses native readline for reliable stdin handling
4
4
  */
5
5
 
6
6
  const inquirer = require('inquirer');
7
+ const readline = require('readline');
7
8
 
8
9
  /**
9
10
  * Ensure stdin is ready
@@ -11,31 +12,42 @@ const inquirer = require('inquirer');
11
12
  const prepareStdin = () => {
12
13
  try {
13
14
  if (process.stdin.isPaused()) process.stdin.resume();
14
- if (process.stdin.isTTY && process.stdin.isRaw) process.stdin.setRawMode(false);
15
+ if (process.stdin.isTTY && process.stdin.setRawMode) {
16
+ process.stdin.setRawMode(false);
17
+ }
15
18
  } catch (e) {}
16
19
  };
17
20
 
21
+ /**
22
+ * Native readline prompt - more reliable than inquirer for simple input
23
+ */
24
+ const nativePrompt = (message) => {
25
+ return new Promise((resolve) => {
26
+ const rl = readline.createInterface({
27
+ input: process.stdin,
28
+ output: process.stdout
29
+ });
30
+
31
+ rl.question(message + ' ', (answer) => {
32
+ rl.close();
33
+ resolve(answer || '');
34
+ });
35
+ });
36
+ };
37
+
18
38
  /**
19
39
  * Wait for Enter
20
40
  */
21
41
  const waitForEnter = async (message = 'Press Enter to continue...') => {
22
- prepareStdin();
23
- await inquirer.prompt([{ type: 'input', name: '_', message, prefix: '' }]);
42
+ await nativePrompt(message);
24
43
  };
25
44
 
26
45
  /**
27
46
  * Text input
28
47
  */
29
48
  const textInput = async (message, defaultVal = '') => {
30
- prepareStdin();
31
- const { value } = await inquirer.prompt([{
32
- type: 'input',
33
- name: 'value',
34
- message,
35
- default: defaultVal,
36
- prefix: ''
37
- }]);
38
- return value;
49
+ const value = await nativePrompt(message);
50
+ return value || defaultVal;
39
51
  };
40
52
 
41
53
  /**