hedgequantx 2.5.11 → 2.5.12

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.5.11",
3
+ "version": "2.5.12",
4
4
  "description": "HedgeQuantX - Prop Futures Trading CLI",
5
5
  "main": "src/app.js",
6
6
  "bin": {
@@ -89,6 +89,11 @@ const aiAgentMenu = async () => {
89
89
  }
90
90
  };
91
91
 
92
+ // Cache for scanned tokens (avoid multiple Keychain prompts)
93
+ let cachedTokens = null;
94
+ let cacheTimestamp = 0;
95
+ const CACHE_TTL = 60000; // 1 minute cache
96
+
92
97
  /**
93
98
  * Show existing tokens found on the system
94
99
  */
@@ -102,16 +107,26 @@ const showExistingTokens = async () => {
102
107
  return chalk.cyan('║') + ' ' + content + ' '.repeat(Math.max(0, padding - 1)) + chalk.cyan('║');
103
108
  };
104
109
 
105
- console.clear();
106
- displayBanner();
107
- drawBoxHeaderContinue('SCANNING FOR EXISTING SESSIONS...', boxWidth);
108
- console.log(makeLine(''));
109
- console.log(makeLine(chalk.gray('CHECKING VS CODE, CURSOR, CLAUDE CLI, OPENCODE...')));
110
- console.log(makeLine(''));
111
- drawBoxFooter(boxWidth);
110
+ // Check cache first
111
+ const now = Date.now();
112
+ let tokens;
112
113
 
113
- // Scan for tokens
114
- const tokens = tokenScanner.scanAllSources();
114
+ if (cachedTokens && (now - cacheTimestamp) < CACHE_TTL) {
115
+ tokens = cachedTokens;
116
+ } else {
117
+ console.clear();
118
+ displayBanner();
119
+ drawBoxHeaderContinue('SCANNING FOR EXISTING SESSIONS...', boxWidth);
120
+ console.log(makeLine(''));
121
+ console.log(makeLine(chalk.gray('CHECKING VS CODE, CURSOR, CLAUDE CLI, OPENCODE...')));
122
+ console.log(makeLine(''));
123
+ drawBoxFooter(boxWidth);
124
+
125
+ // Scan for tokens and cache
126
+ tokens = tokenScanner.scanAllSources();
127
+ cachedTokens = tokens;
128
+ cacheTimestamp = now;
129
+ }
115
130
 
116
131
  if (tokens.length === 0) {
117
132
  // No tokens found, go directly to category selection