hedgequantx 2.7.78 → 2.7.80
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
|
@@ -140,10 +140,11 @@ const fetchProviderModels = async (providerId) => {
|
|
|
140
140
|
m.id.toLowerCase().includes(prefix)
|
|
141
141
|
);
|
|
142
142
|
|
|
143
|
+
// Return only filtered models for this provider (empty if none found)
|
|
143
144
|
return {
|
|
144
|
-
success:
|
|
145
|
-
models: filtered
|
|
146
|
-
error: null
|
|
145
|
+
success: filtered.length > 0,
|
|
146
|
+
models: filtered,
|
|
147
|
+
error: filtered.length === 0 ? `No ${providerId} models available` : null
|
|
147
148
|
};
|
|
148
149
|
};
|
|
149
150
|
|
|
@@ -297,21 +297,30 @@ const stop = async () => {
|
|
|
297
297
|
if (status.pid) {
|
|
298
298
|
process.kill(status.pid, 'SIGTERM');
|
|
299
299
|
} else {
|
|
300
|
-
// No PID - try to find and kill by port
|
|
300
|
+
// No PID - try to find and kill by port (only cli-proxy-api process)
|
|
301
301
|
const { execSync } = require('child_process');
|
|
302
302
|
try {
|
|
303
303
|
if (process.platform === 'win32') {
|
|
304
304
|
// Windows: find PID by port and kill
|
|
305
|
-
const result = execSync(`netstat -ano | findstr :${DEFAULT_PORT}`, { encoding: 'utf8' });
|
|
305
|
+
const result = execSync(`netstat -ano | findstr :${DEFAULT_PORT} | findstr LISTENING`, { encoding: 'utf8' });
|
|
306
306
|
const match = result.match(/LISTENING\s+(\d+)/);
|
|
307
|
-
if (match)
|
|
307
|
+
if (match) {
|
|
308
|
+
const pid = parseInt(match[1]);
|
|
309
|
+
if (pid !== process.pid) process.kill(pid, 'SIGTERM');
|
|
310
|
+
}
|
|
308
311
|
} else {
|
|
309
|
-
// Unix:
|
|
312
|
+
// Unix: find PID listening on port, filter to only cli-proxy-api
|
|
310
313
|
try {
|
|
311
|
-
execSync(`lsof -ti:${DEFAULT_PORT}
|
|
314
|
+
const result = execSync(`lsof -ti:${DEFAULT_PORT} -sTCP:LISTEN 2>/dev/null || true`, { encoding: 'utf8' });
|
|
315
|
+
const pids = result.trim().split('\n').filter(p => p && parseInt(p) !== process.pid);
|
|
316
|
+
for (const pidStr of pids) {
|
|
317
|
+
const pid = parseInt(pidStr);
|
|
318
|
+
if (pid && pid !== process.pid) {
|
|
319
|
+
try { process.kill(pid, 'SIGTERM'); } catch (e) { /* ignore */ }
|
|
320
|
+
}
|
|
321
|
+
}
|
|
312
322
|
} catch (e) {
|
|
313
|
-
//
|
|
314
|
-
execSync(`fuser -k ${DEFAULT_PORT}/tcp 2>/dev/null || true`, { encoding: 'utf8' });
|
|
323
|
+
// Ignore errors
|
|
315
324
|
}
|
|
316
325
|
}
|
|
317
326
|
} catch (e) {
|