@blockrun/clawrouter 0.12.272 → 0.12.273
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 +14 -2
- package/dist/index.js +14 -2
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -91138,7 +91138,12 @@ async function checkExistingProxy(port) {
|
|
|
91138
91138
|
const data = await response.json();
|
|
91139
91139
|
const authMode = data.authMode === "api-key" ? "api-key" : "wallet";
|
|
91140
91140
|
if (data.status === "ok" && (data.wallet || authMode === "api-key")) {
|
|
91141
|
-
return {
|
|
91141
|
+
return {
|
|
91142
|
+
wallet: data.wallet ?? "",
|
|
91143
|
+
paymentChain: data.paymentChain,
|
|
91144
|
+
authMode,
|
|
91145
|
+
apiKeyLabel: typeof data.apiKey === "string" ? data.apiKey : void 0
|
|
91146
|
+
};
|
|
91142
91147
|
}
|
|
91143
91148
|
}
|
|
91144
91149
|
return void 0;
|
|
@@ -91821,13 +91826,20 @@ async function startProxy(options) {
|
|
|
91821
91826
|
);
|
|
91822
91827
|
}
|
|
91823
91828
|
if (authMode === "api-key") {
|
|
91829
|
+
const runningLabel = existingProxy.apiKeyLabel;
|
|
91830
|
+
const ourLabel = maskApiKey(apiKey);
|
|
91831
|
+
if (runningLabel !== ourLabel) {
|
|
91832
|
+
throw new Error(
|
|
91833
|
+
`Existing proxy on port ${listenPort} is billing ${runningLabel ?? "an unidentified BlockRun account"}, but this process is configured for ${ourLabel}. Reusing it would charge the other account. Stop that proxy first, or use a different port.`
|
|
91834
|
+
);
|
|
91835
|
+
}
|
|
91824
91836
|
options.onReady?.(listenPort);
|
|
91825
91837
|
return {
|
|
91826
91838
|
port: listenPort,
|
|
91827
91839
|
baseUrl: baseUrl2,
|
|
91828
91840
|
walletAddress: "",
|
|
91829
91841
|
authMode,
|
|
91830
|
-
apiKeyLabel:
|
|
91842
|
+
apiKeyLabel: ourLabel,
|
|
91831
91843
|
balanceMonitor: new ApiKeyBalanceMonitor(),
|
|
91832
91844
|
// No-op: we didn't start this proxy, so we shouldn't close it
|
|
91833
91845
|
close: async () => {
|
package/dist/index.js
CHANGED
|
@@ -90891,7 +90891,12 @@ async function checkExistingProxy(port) {
|
|
|
90891
90891
|
const data = await response.json();
|
|
90892
90892
|
const authMode = data.authMode === "api-key" ? "api-key" : "wallet";
|
|
90893
90893
|
if (data.status === "ok" && (data.wallet || authMode === "api-key")) {
|
|
90894
|
-
return {
|
|
90894
|
+
return {
|
|
90895
|
+
wallet: data.wallet ?? "",
|
|
90896
|
+
paymentChain: data.paymentChain,
|
|
90897
|
+
authMode,
|
|
90898
|
+
apiKeyLabel: typeof data.apiKey === "string" ? data.apiKey : void 0
|
|
90899
|
+
};
|
|
90895
90900
|
}
|
|
90896
90901
|
}
|
|
90897
90902
|
return void 0;
|
|
@@ -91574,13 +91579,20 @@ async function startProxy(options) {
|
|
|
91574
91579
|
);
|
|
91575
91580
|
}
|
|
91576
91581
|
if (authMode === "api-key") {
|
|
91582
|
+
const runningLabel = existingProxy.apiKeyLabel;
|
|
91583
|
+
const ourLabel = maskApiKey(apiKey);
|
|
91584
|
+
if (runningLabel !== ourLabel) {
|
|
91585
|
+
throw new Error(
|
|
91586
|
+
`Existing proxy on port ${listenPort} is billing ${runningLabel ?? "an unidentified BlockRun account"}, but this process is configured for ${ourLabel}. Reusing it would charge the other account. Stop that proxy first, or use a different port.`
|
|
91587
|
+
);
|
|
91588
|
+
}
|
|
91577
91589
|
options.onReady?.(listenPort);
|
|
91578
91590
|
return {
|
|
91579
91591
|
port: listenPort,
|
|
91580
91592
|
baseUrl: baseUrl2,
|
|
91581
91593
|
walletAddress: "",
|
|
91582
91594
|
authMode,
|
|
91583
|
-
apiKeyLabel:
|
|
91595
|
+
apiKeyLabel: ourLabel,
|
|
91584
91596
|
balanceMonitor: new ApiKeyBalanceMonitor(),
|
|
91585
91597
|
// No-op: we didn't start this proxy, so we shouldn't close it
|
|
91586
91598
|
close: async () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blockrun/clawrouter",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.273",
|
|
4
4
|
"description": "Smart LLM router — save 84% on inference costs. 76 models (7 free). Pay by credit card (API key) or USDC (x402 wallet).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|