@blockrun/clawrouter 0.12.98 → 0.12.99

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blockrun/clawrouter",
3
- "version": "0.12.98",
3
+ "version": "0.12.99",
4
4
  "description": "Smart LLM router — save 85% on inference costs. 55+ models (11 free), one wallet, x402 micropayments.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -437,6 +437,51 @@ if (fs.existsSync(configPath)) {
437
437
  }
438
438
  "
439
439
 
440
+ # 8. Ensure provider baseUrl is set (prevents "baseUrl: undefined" on gateway restart)
441
+ echo "→ Verifying provider config..."
442
+ node -e "
443
+ const os = require('os');
444
+ const fs = require('fs');
445
+ const path = require('path');
446
+ const configPath = path.join(os.homedir(), '.openclaw', 'openclaw.json');
447
+
448
+ if (!fs.existsSync(configPath)) {
449
+ console.log(' No config file found, skipping');
450
+ process.exit(0);
451
+ }
452
+
453
+ try {
454
+ const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
455
+ const provider = config?.models?.providers?.blockrun;
456
+ if (!provider) {
457
+ console.log(' No blockrun provider found, skipping');
458
+ process.exit(0);
459
+ }
460
+
461
+ let changed = false;
462
+ if (!provider.baseUrl) {
463
+ provider.baseUrl = 'http://127.0.0.1:8402/v1';
464
+ changed = true;
465
+ console.log(' Fixed missing baseUrl');
466
+ }
467
+ if (!provider.apiKey) {
468
+ provider.apiKey = 'x402-proxy-handles-auth';
469
+ changed = true;
470
+ console.log(' Fixed missing apiKey');
471
+ }
472
+
473
+ if (changed) {
474
+ const tmpPath = configPath + '.tmp.' + process.pid;
475
+ fs.writeFileSync(tmpPath, JSON.stringify(config, null, 2));
476
+ fs.renameSync(tmpPath, configPath);
477
+ } else {
478
+ console.log(' Provider config OK');
479
+ }
480
+ } catch (err) {
481
+ console.log(' Skipped: ' + err.message);
482
+ }
483
+ "
484
+
440
485
  # Final: verify wallet survived reinstall
441
486
  echo "→ Verifying wallet integrity..."
442
487
  if [ -f "$WALLET_FILE" ]; then
package/scripts/update.sh CHANGED
@@ -350,6 +350,51 @@ try {
350
350
  }
351
351
  "
352
352
 
353
+ # ── Step 9: Ensure baseUrl is set ─────────────────────────────
354
+ echo "→ Verifying provider config..."
355
+ node -e "
356
+ const os = require('os');
357
+ const fs = require('fs');
358
+ const path = require('path');
359
+ const configPath = path.join(os.homedir(), '.openclaw', 'openclaw.json');
360
+
361
+ if (!fs.existsSync(configPath)) {
362
+ console.log(' No config file found, skipping');
363
+ process.exit(0);
364
+ }
365
+
366
+ try {
367
+ const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
368
+ const provider = config?.models?.providers?.blockrun;
369
+ if (!provider) {
370
+ console.log(' No blockrun provider found, skipping');
371
+ process.exit(0);
372
+ }
373
+
374
+ let changed = false;
375
+ if (!provider.baseUrl) {
376
+ provider.baseUrl = 'http://127.0.0.1:8402/v1';
377
+ changed = true;
378
+ console.log(' Fixed missing baseUrl');
379
+ }
380
+ if (!provider.apiKey) {
381
+ provider.apiKey = 'x402-proxy-handles-auth';
382
+ changed = true;
383
+ console.log(' Fixed missing apiKey');
384
+ }
385
+
386
+ if (changed) {
387
+ const tmpPath = configPath + '.tmp.' + process.pid;
388
+ fs.writeFileSync(tmpPath, JSON.stringify(config, null, 2));
389
+ fs.renameSync(tmpPath, configPath);
390
+ } else {
391
+ console.log(' Provider config OK');
392
+ }
393
+ } catch (err) {
394
+ console.log(' Skipped: ' + err.message);
395
+ }
396
+ "
397
+
353
398
  # ── Summary ─────────────────────────────────────────────────────
354
399
  echo ""
355
400
  echo "✓ ClawRouter updated successfully!"