@blockrun/clawrouter 0.12.135 → 0.12.136

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/scripts/update.sh +34 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blockrun/clawrouter",
3
- "version": "0.12.135",
3
+ "version": "0.12.136",
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",
package/scripts/update.sh CHANGED
@@ -417,6 +417,40 @@ if [ -d "$PLUGIN_DIR" ] && [ -f "$PLUGIN_DIR/package.json" ]; then
417
417
  fi
418
418
 
419
419
  # ── Step 5: Verify wallet survived ─────────────────────────────
420
+ # ── Step 4d: Post-install duplicate cleanup ──────────────────────
421
+ # openclaw plugins install writes plugins.entries.ClawRouter (PascalCase, from
422
+ # plugin name) AND plugins.installs.clawrouter (lowercase, from plugin id).
423
+ # The extensions/ directory scan also discovers the plugin by id.
424
+ # Having both entries + directory causes "duplicate plugin" warnings.
425
+ # Fix: keep only the installs record (used by OpenClaw's matchInstalledPlugin),
426
+ # remove the entries record that duplicates it.
427
+ echo "→ Cleaning duplicate plugin entries..."
428
+ node -e "
429
+ const fs = require('fs');
430
+ const configPath = '$CONFIG_PATH';
431
+ if (!fs.existsSync(configPath)) process.exit(0);
432
+ try {
433
+ const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
434
+ let changed = false;
435
+ // Remove entries that duplicate the installs record
436
+ for (const key of ['clawrouter', 'ClawRouter', '@blockrun/clawrouter']) {
437
+ if (config?.plugins?.entries?.[key]) {
438
+ delete config.plugins.entries[key];
439
+ changed = true;
440
+ console.log(' Removed duplicate plugins.entries.' + key);
441
+ }
442
+ }
443
+ if (changed) {
444
+ const tmp = configPath + '.tmp.' + process.pid;
445
+ fs.writeFileSync(tmp, JSON.stringify(config, null, 2));
446
+ fs.renameSync(tmp, configPath);
447
+ console.log(' ✓ Duplicate entries cleaned');
448
+ } else {
449
+ console.log(' ✓ No duplicates found');
450
+ }
451
+ } catch (e) { console.log(' Skipped: ' + e.message); }
452
+ "
453
+
420
454
  echo ""
421
455
  echo "→ Verifying wallet integrity..."
422
456