@blockrun/clawrouter 0.9.33 → 0.9.35
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/README.md +150 -360
- package/dist/cli.js +2 -2
- package/dist/cli.js.map +1 -1
- package/dist/index.js +16 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3568,7 +3568,7 @@ async function checkForUpdates() {
|
|
|
3568
3568
|
// src/config.ts
|
|
3569
3569
|
var DEFAULT_PORT = 8402;
|
|
3570
3570
|
var PROXY_PORT = (() => {
|
|
3571
|
-
const envPort = process
|
|
3571
|
+
const envPort = process["env"].BLOCKRUN_PROXY_PORT;
|
|
3572
3572
|
if (envPort) {
|
|
3573
3573
|
const parsed = parseInt(envPort, 10);
|
|
3574
3574
|
if (!isNaN(parsed) && parsed > 0 && parsed < 65536) {
|
|
@@ -5244,7 +5244,7 @@ async function resolveOrGenerateWalletKey() {
|
|
|
5244
5244
|
const account = privateKeyToAccount3(saved);
|
|
5245
5245
|
return { key: saved, address: account.address, source: "saved" };
|
|
5246
5246
|
}
|
|
5247
|
-
const envKey = process
|
|
5247
|
+
const envKey = process["env"].BLOCKRUN_WALLET_KEY;
|
|
5248
5248
|
if (typeof envKey === "string" && envKey.startsWith("0x") && envKey.length === 66) {
|
|
5249
5249
|
const account = privateKeyToAccount3(envKey);
|
|
5250
5250
|
return { key: envKey, address: account.address, source: "env" };
|
|
@@ -5742,7 +5742,7 @@ var plugin = {
|
|
|
5742
5742
|
description: "Smart LLM router \u2014 30+ models, x402 micropayments, 78% cost savings",
|
|
5743
5743
|
version: VERSION,
|
|
5744
5744
|
async register(api) {
|
|
5745
|
-
const isDisabled = process
|
|
5745
|
+
const isDisabled = process["env"].CLAWROUTER_DISABLED === "true" || process["env"].CLAWROUTER_DISABLED === "1";
|
|
5746
5746
|
if (isDisabled) {
|
|
5747
5747
|
api.logger.info("ClawRouter disabled (CLAWROUTER_DISABLED=true). Using default routing.");
|
|
5748
5748
|
return;
|
|
@@ -5810,6 +5810,19 @@ var plugin = {
|
|
|
5810
5810
|
}
|
|
5811
5811
|
}
|
|
5812
5812
|
});
|
|
5813
|
+
resolveOrGenerateWalletKey().then(({ address, source }) => {
|
|
5814
|
+
if (source === "generated") {
|
|
5815
|
+
api.logger.info(`Generated new wallet: ${address}`);
|
|
5816
|
+
} else if (source === "saved") {
|
|
5817
|
+
api.logger.info(`Using saved wallet: ${address}`);
|
|
5818
|
+
} else {
|
|
5819
|
+
api.logger.info(`Using wallet from BLOCKRUN_WALLET_KEY: ${address}`);
|
|
5820
|
+
}
|
|
5821
|
+
}).catch((err) => {
|
|
5822
|
+
api.logger.warn(
|
|
5823
|
+
`Failed to initialize wallet: ${err instanceof Error ? err.message : String(err)}`
|
|
5824
|
+
);
|
|
5825
|
+
});
|
|
5813
5826
|
if (!isGatewayMode()) {
|
|
5814
5827
|
api.logger.info("Not in gateway mode \u2014 proxy will start when gateway runs");
|
|
5815
5828
|
return;
|