@blockrun/clawrouter 0.12.125 → 0.12.127
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/index.js +73 -70
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/scripts/reinstall.sh +4 -4
- package/scripts/update.sh +5 -5
package/dist/index.js
CHANGED
|
@@ -80993,7 +80993,7 @@ function restartProxyForChainSwitch(api) {
|
|
|
80993
80993
|
}
|
|
80994
80994
|
function createWalletCommand(api) {
|
|
80995
80995
|
return {
|
|
80996
|
-
name: "
|
|
80996
|
+
name: "wallet",
|
|
80997
80997
|
description: "Show BlockRun wallet info, balance, chain, or export key",
|
|
80998
80998
|
acceptsArgs: true,
|
|
80999
80999
|
requireAuth: true,
|
|
@@ -81208,12 +81208,12 @@ Run \`openclaw plugins install @blockrun/clawrouter\` to generate a wallet.`,
|
|
|
81208
81208
|
`**Key File:** \`${WALLET_FILE}\``,
|
|
81209
81209
|
"",
|
|
81210
81210
|
"**Commands:**",
|
|
81211
|
-
"\u2022 `/
|
|
81212
|
-
"\u2022 `/
|
|
81211
|
+
"\u2022 `/wallet` - Show this status",
|
|
81212
|
+
"\u2022 `/wallet export` - Export private key for backup",
|
|
81213
81213
|
"\u2022 `/stats` - Detailed usage breakdown",
|
|
81214
|
-
!solanaSection ? "\u2022 `/
|
|
81215
|
-
solanaSection ? "\u2022 `/
|
|
81216
|
-
solanaSection ? "\u2022 `/
|
|
81214
|
+
!solanaSection ? "\u2022 `/wallet solana` - Enable Solana payments" : "",
|
|
81215
|
+
solanaSection ? "\u2022 `/wallet base` - Switch to Base (EVM)" : "",
|
|
81216
|
+
solanaSection ? "\u2022 `/wallet solana` - Switch to Solana" : ""
|
|
81217
81217
|
].filter(Boolean).join("\n")
|
|
81218
81218
|
};
|
|
81219
81219
|
}
|
|
@@ -81236,79 +81236,82 @@ var plugin = {
|
|
|
81236
81236
|
return;
|
|
81237
81237
|
}
|
|
81238
81238
|
const proc = process;
|
|
81239
|
-
|
|
81239
|
+
const alreadyRegistered = !!proc.__clawrouterRegistered;
|
|
81240
81240
|
proc.__clawrouterRegistered = true;
|
|
81241
|
-
|
|
81242
|
-
|
|
81243
|
-
|
|
81244
|
-
|
|
81245
|
-
|
|
81246
|
-
|
|
81247
|
-
|
|
81248
|
-
api.config.models
|
|
81249
|
-
|
|
81250
|
-
|
|
81251
|
-
api.config.models.providers
|
|
81252
|
-
|
|
81253
|
-
|
|
81254
|
-
|
|
81255
|
-
|
|
81256
|
-
|
|
81257
|
-
|
|
81258
|
-
|
|
81259
|
-
|
|
81260
|
-
|
|
81261
|
-
|
|
81262
|
-
|
|
81263
|
-
|
|
81264
|
-
|
|
81265
|
-
|
|
81266
|
-
|
|
81267
|
-
|
|
81268
|
-
|
|
81269
|
-
|
|
81241
|
+
if (!alreadyRegistered) {
|
|
81242
|
+
api.registerProvider(blockrunProvider);
|
|
81243
|
+
api.registerImageGenerationProvider(buildImageGenerationProvider());
|
|
81244
|
+
api.registerMusicGenerationProvider(buildMusicGenerationProvider());
|
|
81245
|
+
injectModelsConfig(api.logger);
|
|
81246
|
+
injectAuthProfile(api.logger);
|
|
81247
|
+
const runtimePort = getProxyPort();
|
|
81248
|
+
if (!api.config.models) {
|
|
81249
|
+
api.config.models = { providers: {} };
|
|
81250
|
+
}
|
|
81251
|
+
if (!api.config.models.providers) {
|
|
81252
|
+
api.config.models.providers = {};
|
|
81253
|
+
}
|
|
81254
|
+
api.config.models.providers.blockrun = {
|
|
81255
|
+
baseUrl: `http://127.0.0.1:${runtimePort}/v1`,
|
|
81256
|
+
api: "openai-completions",
|
|
81257
|
+
// apiKey is required by pi-coding-agent's ModelRegistry for providers with models.
|
|
81258
|
+
apiKey: "x402-proxy-handles-auth",
|
|
81259
|
+
models: OPENCLAW_MODELS
|
|
81260
|
+
};
|
|
81261
|
+
api.logger.info("BlockRun provider registered (55+ models via x402)");
|
|
81262
|
+
try {
|
|
81263
|
+
const proxyBaseUrl = `http://127.0.0.1:${runtimePort}`;
|
|
81264
|
+
const partnerTools = buildPartnerTools(proxyBaseUrl);
|
|
81265
|
+
for (const tool of partnerTools) {
|
|
81266
|
+
api.registerTool(tool);
|
|
81267
|
+
}
|
|
81268
|
+
if (partnerTools.length > 0) {
|
|
81269
|
+
api.logger.info(
|
|
81270
|
+
`Registered ${partnerTools.length} partner tool(s): ${partnerTools.map((t) => t.name).join(", ")}`
|
|
81271
|
+
);
|
|
81272
|
+
}
|
|
81273
|
+
} catch (err) {
|
|
81274
|
+
api.logger.warn(
|
|
81275
|
+
`Failed to register partner tools: ${err instanceof Error ? err.message : String(err)}`
|
|
81270
81276
|
);
|
|
81271
81277
|
}
|
|
81272
|
-
api.registerCommand({
|
|
81273
|
-
name: "partners",
|
|
81274
|
-
description: "List available partner APIs and pricing",
|
|
81275
|
-
acceptsArgs: false,
|
|
81276
|
-
requireAuth: false,
|
|
81277
|
-
handler: async () => {
|
|
81278
|
-
if (PARTNER_SERVICES.length === 0) {
|
|
81279
|
-
return { text: "No partner APIs available." };
|
|
81280
|
-
}
|
|
81281
|
-
const lines = ["**Partner APIs** (paid via your ClawRouter wallet)", ""];
|
|
81282
|
-
for (const svc of PARTNER_SERVICES) {
|
|
81283
|
-
lines.push(`**${svc.name}** (${svc.partner})`);
|
|
81284
|
-
lines.push(` ${svc.description}`);
|
|
81285
|
-
lines.push(` Tool: \`${`blockrun_${svc.id}`}\``);
|
|
81286
|
-
lines.push(
|
|
81287
|
-
` Pricing: ${svc.pricing.perUnit} per ${svc.pricing.unit} (min ${svc.pricing.minimum}, max ${svc.pricing.maximum})`
|
|
81288
|
-
);
|
|
81289
|
-
lines.push(
|
|
81290
|
-
` **How to use:** Ask "Look up Twitter user @elonmusk" or "Get info on these X accounts: @naval, @balajis"`
|
|
81291
|
-
);
|
|
81292
|
-
lines.push("");
|
|
81293
|
-
}
|
|
81294
|
-
return { text: lines.join("\n") };
|
|
81295
|
-
}
|
|
81296
|
-
});
|
|
81297
|
-
} catch (err) {
|
|
81298
|
-
api.logger.warn(
|
|
81299
|
-
`Failed to register partner tools: ${err instanceof Error ? err.message : String(err)}`
|
|
81300
|
-
);
|
|
81301
81278
|
}
|
|
81279
|
+
api.registerCommand({
|
|
81280
|
+
name: "partners",
|
|
81281
|
+
description: "List available partner APIs and pricing",
|
|
81282
|
+
acceptsArgs: false,
|
|
81283
|
+
requireAuth: false,
|
|
81284
|
+
handler: async () => {
|
|
81285
|
+
if (PARTNER_SERVICES.length === 0) {
|
|
81286
|
+
return { text: "No partner APIs available." };
|
|
81287
|
+
}
|
|
81288
|
+
const lines = ["**Partner APIs** (paid via your ClawRouter wallet)", ""];
|
|
81289
|
+
for (const svc of PARTNER_SERVICES) {
|
|
81290
|
+
lines.push(`**${svc.name}** (${svc.partner})`);
|
|
81291
|
+
lines.push(` ${svc.description}`);
|
|
81292
|
+
lines.push(` Tool: \`${`blockrun_${svc.id}`}\``);
|
|
81293
|
+
lines.push(
|
|
81294
|
+
` Pricing: ${svc.pricing.perUnit} per ${svc.pricing.unit} (min ${svc.pricing.minimum}, max ${svc.pricing.maximum})`
|
|
81295
|
+
);
|
|
81296
|
+
lines.push(
|
|
81297
|
+
` **How to use:** Ask "Look up Twitter user @elonmusk" or "Get info on these X accounts: @naval, @balajis"`
|
|
81298
|
+
);
|
|
81299
|
+
lines.push("");
|
|
81300
|
+
}
|
|
81301
|
+
return { text: lines.join("\n") };
|
|
81302
|
+
}
|
|
81303
|
+
});
|
|
81302
81304
|
api.registerCommand(createWalletCommand(api));
|
|
81303
81305
|
try {
|
|
81304
|
-
const
|
|
81305
|
-
|
|
81306
|
-
api.registerCommand(
|
|
81306
|
+
const blockrunAlias = createWalletCommand(api);
|
|
81307
|
+
blockrunAlias.name = "blockrun";
|
|
81308
|
+
api.registerCommand(blockrunAlias);
|
|
81307
81309
|
} catch {
|
|
81308
81310
|
}
|
|
81309
81311
|
api.registerCommand(createStatsCommand());
|
|
81310
81312
|
api.registerCommand(createExcludeCommand());
|
|
81311
|
-
api.logger.info("Commands registered: /
|
|
81313
|
+
api.logger.info("Commands registered: /wallet, /blockrun, /stats, /exclude");
|
|
81314
|
+
if (alreadyRegistered) return;
|
|
81312
81315
|
api.registerService({
|
|
81313
81316
|
id: "clawrouter-proxy",
|
|
81314
81317
|
start: () => {
|
|
@@ -81353,7 +81356,7 @@ var plugin = {
|
|
|
81353
81356
|
}
|
|
81354
81357
|
startProxyInBackground(api).then(async () => {
|
|
81355
81358
|
const port = getProxyPort();
|
|
81356
|
-
const healthy = await waitForProxyHealth(port,
|
|
81359
|
+
const healthy = await waitForProxyHealth(port, 15e3);
|
|
81357
81360
|
if (!healthy) {
|
|
81358
81361
|
api.logger.warn(`Proxy health check timed out, commands may not work immediately`);
|
|
81359
81362
|
}
|