@blockrun/clawrouter 0.8.28 → 0.8.29
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/dist/cli.js +8 -11
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.js +8 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -478,8 +478,7 @@ declare function getSessionId(headers: Record<string, string | string[] | undefi
|
|
|
478
478
|
*/
|
|
479
479
|
|
|
480
480
|
/**
|
|
481
|
-
* Get the proxy port from
|
|
482
|
-
* Port is validated at module load time, this just returns the cached value.
|
|
481
|
+
* Get the proxy port from environment variable or default.
|
|
483
482
|
*/
|
|
484
483
|
declare function getProxyPort(): number;
|
|
485
484
|
/** Callback info for low balance warning */
|
package/dist/index.js
CHANGED
|
@@ -2494,16 +2494,6 @@ var FREE_MODEL = "nvidia/gpt-oss-120b";
|
|
|
2494
2494
|
var HEARTBEAT_INTERVAL_MS = 2e3;
|
|
2495
2495
|
var DEFAULT_REQUEST_TIMEOUT_MS = 18e4;
|
|
2496
2496
|
var DEFAULT_PORT = 8402;
|
|
2497
|
-
var PROXY_PORT = (() => {
|
|
2498
|
-
const envPort = process.env.BLOCKRUN_PROXY_PORT;
|
|
2499
|
-
if (envPort) {
|
|
2500
|
-
const parsed = parseInt(envPort, 10);
|
|
2501
|
-
if (!isNaN(parsed) && parsed > 0 && parsed < 65536) {
|
|
2502
|
-
return parsed;
|
|
2503
|
-
}
|
|
2504
|
-
}
|
|
2505
|
-
return DEFAULT_PORT;
|
|
2506
|
-
})();
|
|
2507
2497
|
var MAX_FALLBACK_ATTEMPTS = 3;
|
|
2508
2498
|
var HEALTH_CHECK_TIMEOUT_MS = 2e3;
|
|
2509
2499
|
var RATE_LIMIT_COOLDOWN_MS = 6e4;
|
|
@@ -2603,7 +2593,14 @@ function safeWrite(res, data) {
|
|
|
2603
2593
|
}
|
|
2604
2594
|
var BALANCE_CHECK_BUFFER = 1.5;
|
|
2605
2595
|
function getProxyPort() {
|
|
2606
|
-
|
|
2596
|
+
const envPort = process.env.BLOCKRUN_PROXY_PORT;
|
|
2597
|
+
if (envPort) {
|
|
2598
|
+
const parsed = parseInt(envPort, 10);
|
|
2599
|
+
if (!isNaN(parsed) && parsed > 0 && parsed < 65536) {
|
|
2600
|
+
return parsed;
|
|
2601
|
+
}
|
|
2602
|
+
}
|
|
2603
|
+
return DEFAULT_PORT;
|
|
2607
2604
|
}
|
|
2608
2605
|
async function checkExistingProxy(port) {
|
|
2609
2606
|
const controller = new AbortController();
|