@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 +1 -1
- package/scripts/reinstall.sh +5 -3
- package/scripts/update.sh +39 -5
package/package.json
CHANGED
package/scripts/reinstall.sh
CHANGED
|
@@ -204,9 +204,11 @@ try {
|
|
|
204
204
|
process.exit(0);
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
-
// Clean plugin entries
|
|
208
|
-
|
|
209
|
-
if (c.plugins?.
|
|
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
|
|
216
|
+
// Remove stale plugin entries (check all case variants)
|
|
217
217
|
const entries = config?.plugins?.entries;
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
changed = true;
|
|
221
|
-
console.log(' Removed
|
|
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
|
|