@blockrun/clawrouter 0.12.134 → 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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blockrun/clawrouter",
3
- "version": "0.12.134",
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",
@@ -204,9 +204,11 @@ try {
204
204
  process.exit(0);
205
205
  }
206
206
 
207
- // Clean plugin entries
208
- if (c.plugins?.entries?.clawrouter) delete c.plugins.entries.clawrouter;
209
- if (c.plugins?.installs?.clawrouter) delete c.plugins.installs.clawrouter;
207
+ // Clean plugin entries (all case variants to prevent duplicate plugin warnings)
208
+ for (const key of ['clawrouter', 'ClawRouter', '@blockrun/clawrouter']) {
209
+ if (c.plugins?.entries?.[key]) delete c.plugins.entries[key];
210
+ if (c.plugins?.installs?.[key]) delete c.plugins.installs[key];
211
+ }
210
212
 
211
213
  // Clean plugins.allow — remove clawrouter (will be re-added after install)
212
214
  // and strip any non-bundled plugin names that don't exist (e.g. "wallet" added
package/scripts/update.sh CHANGED
@@ -213,12 +213,12 @@ try {
213
213
  const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
214
214
  let changed = false;
215
215
 
216
- // Remove stale plugin entry
216
+ // Remove stale plugin entries (check all case variants)
217
217
  const entries = config?.plugins?.entries;
218
- if (entries && entries.clawrouter) {
219
- delete entries.clawrouter;
220
- changed = true;
221
- console.log(' Removed stale plugin entry');
218
+ const installs = config?.plugins?.installs;
219
+ for (const key of ['clawrouter', 'ClawRouter', '@blockrun/clawrouter']) {
220
+ if (entries?.[key]) { delete entries[key]; changed = true; console.log(' Removed plugins.entries.' + key); }
221
+ if (installs?.[key]) { delete installs[key]; changed = true; console.log(' Removed plugins.installs.' + key); }
222
222
  }
223
223
 
224
224
  // Clean plugins.allow — remove clawrouter (re-added later) and any stale bare
@@ -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