@blockrun/clawrouter 0.12.117 → 0.12.118

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.117",
3
+ "version": "0.12.118",
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",
@@ -172,10 +172,31 @@ try {
172
172
  // Clean plugin entries
173
173
  if (c.plugins?.entries?.clawrouter) delete c.plugins.entries.clawrouter;
174
174
  if (c.plugins?.installs?.clawrouter) delete c.plugins.installs.clawrouter;
175
- // Clean plugins.allow (removes stale clawrouter reference)
175
+
176
+ // Clean plugins.allow — remove clawrouter (will be re-added after install)
177
+ // and strip any non-bundled plugin names that don't exist (e.g. "wallet" added
178
+ // by an AI agent trying to fix a different problem — causes a warning on every start).
176
179
  if (Array.isArray(c.plugins?.allow)) {
177
- c.plugins.allow = c.plugins.allow.filter(p => p !== 'clawrouter' && p !== '@blockrun/clawrouter');
180
+ const BUNDLED_OPENCLAW_PLUGINS = [
181
+ // OpenClaw v2026.x bundled plugin IDs (safe to keep in allow list)
182
+ 'http', 'mcp', 'computer-use', 'browser', 'code', 'image', 'voice',
183
+ 'search', 'memory', 'calendar', 'email', 'slack', 'discord', 'telegram',
184
+ 'whatsapp', 'matrix', 'teams', 'notion', 'github', 'jira', 'linear',
185
+ 'comfyui', 'crossmint',
186
+ ];
187
+ const before = c.plugins.allow.length;
188
+ c.plugins.allow = c.plugins.allow.filter(p => {
189
+ if (p === 'clawrouter' || p === '@blockrun/clawrouter') return false; // re-added later
190
+ if (BUNDLED_OPENCLAW_PLUGINS.includes(p)) return true; // known-good bundled plugins
191
+ // Keep entries that look like npm package names (scoped or plain)
192
+ if (p.startsWith('@') || p.includes('/')) return true;
193
+ // Drop bare single-word entries that aren't bundled (e.g. "wallet" added by mistake)
194
+ return false;
195
+ });
196
+ const removed = before - c.plugins.allow.length;
197
+ if (removed > 0) console.log(' Removed ' + removed + ' stale plugins.allow entry(ies)');
178
198
  }
199
+
179
200
  atomicWrite(f, JSON.stringify(c, null, 2));
180
201
  console.log(' Config cleaned');
181
202
  "
package/scripts/update.sh CHANGED
@@ -172,13 +172,41 @@ const configPath = '$CONFIG_PATH';
172
172
  if (!fs.existsSync(configPath)) process.exit(0);
173
173
  try {
174
174
  const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
175
+ let changed = false;
176
+
177
+ // Remove stale plugin entry
175
178
  const entries = config?.plugins?.entries;
176
179
  if (entries && entries.clawrouter) {
177
180
  delete entries.clawrouter;
181
+ changed = true;
182
+ console.log(' Removed stale plugin entry');
183
+ }
184
+
185
+ // Clean plugins.allow — remove clawrouter (re-added later) and any stale bare
186
+ // single-word entries that aren't bundled OpenClaw plugins (e.g. "wallet" added
187
+ // by an AI agent — shows a warning on every gateway start).
188
+ if (Array.isArray(config?.plugins?.allow)) {
189
+ const BUNDLED = [
190
+ 'http','mcp','computer-use','browser','code','image','voice',
191
+ 'search','memory','calendar','email','slack','discord','telegram',
192
+ 'whatsapp','matrix','teams','notion','github','jira','linear',
193
+ 'comfyui','crossmint',
194
+ ];
195
+ const before = config.plugins.allow.length;
196
+ config.plugins.allow = config.plugins.allow.filter(p => {
197
+ if (p === 'clawrouter' || p === '@blockrun/clawrouter') return false;
198
+ if (BUNDLED.includes(p)) return true;
199
+ if (p.startsWith('@') || p.includes('/')) return true;
200
+ return false;
201
+ });
202
+ const removed = before - config.plugins.allow.length;
203
+ if (removed > 0) { changed = true; console.log(' Removed ' + removed + ' stale plugins.allow entry(ies)'); }
204
+ }
205
+
206
+ if (changed) {
178
207
  const tmp = configPath + '.tmp.' + process.pid;
179
208
  fs.writeFileSync(tmp, JSON.stringify(config, null, 2));
180
209
  fs.renameSync(tmp, configPath);
181
- console.log(' Removed stale plugin entry');
182
210
  } else {
183
211
  console.log(' Config clean');
184
212
  }