@blockrun/clawrouter 0.11.11 → 0.11.13

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.11.11",
3
+ "version": "0.11.13",
4
4
  "description": "Smart LLM router — save 92% on inference costs. 41+ models, one wallet, x402 micropayments.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -39,7 +39,7 @@
39
39
  "test:resilience:lifecycle": "tsx test/resilience-lifecycle.ts",
40
40
  "test:resilience:quick": "npm run test:resilience:errors && npm run test:resilience:lifecycle",
41
41
  "test:resilience:full": "npm run test:resilience:errors && npm run test:resilience:lifecycle && npm run test:resilience:stability:full",
42
- "test:e2e:tool-ids": "tsx test/e2e-tool-id-sanitization.ts",
42
+ "test:e2e:tool-ids": "npm run build && tsx test/e2e-tool-id-sanitization.ts",
43
43
  "test:docker:install": "bash test/run-docker-test.sh",
44
44
  "test:docker:edge-cases": "bash test/docker/run-edge-cases.sh",
45
45
  "test:docker:integration": "docker compose -f test/integration/docker-compose.yml up --build --abort-on-container-exit --exit-code-from integration"
@@ -68,6 +68,13 @@
68
68
  "url": "git+https://github.com/BlockRunAI/ClawRouter.git"
69
69
  },
70
70
  "dependencies": {
71
+ "@scure/bip32": "^1.6.0",
72
+ "@scure/bip39": "^1.5.0",
73
+ "@solana/kit": "^6.0.0",
74
+ "@x402/evm": "^2.4.0",
75
+ "@x402/fetch": "^2.4.0",
76
+ "@x402/svm": "^2.4.0",
77
+ "ethers": "^6.16.0",
71
78
  "viem": "^2.39.3"
72
79
  },
73
80
  "peerDependencies": {
@@ -79,8 +86,8 @@
79
86
  }
80
87
  },
81
88
  "devDependencies": {
82
- "@eslint/js": "^9.39.2",
83
- "eslint": "^9.39.2",
89
+ "@eslint/js": "^10.0.1",
90
+ "eslint": "^10.0.2",
84
91
  "openclaw": "latest",
85
92
  "prettier": "^3.8.1",
86
93
  "tsup": "^8.0.0",
package/scripts/update.sh CHANGED
@@ -166,8 +166,8 @@ if (!store.profiles[profileKey]) {
166
166
  echo "→ Cleaning models cache..."
167
167
  rm -f ~/.openclaw/agents/*/agent/models.json 2>/dev/null || true
168
168
 
169
- # ── Step 8: Migrate allowlist (remove blockrun-only filter) ────
170
- echo "→ Migrating model allowlist..."
169
+ # ── Step 8: Populate model allowlist with top 16 models ────────
170
+ echo "→ Populating model allowlist..."
171
171
  node -e "
172
172
  const os = require('os');
173
173
  const fs = require('fs');
@@ -181,27 +181,38 @@ if (!fs.existsSync(configPath)) {
181
181
 
182
182
  try {
183
183
  const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
184
- const allowlist = config?.agents?.defaults?.models;
185
- if (!allowlist || typeof allowlist !== 'object') {
186
- console.log(' No allowlist found, skipping');
187
- process.exit(0);
188
- }
189
184
 
190
- const keys = Object.keys(allowlist);
191
- if (keys.length === 0) {
192
- console.log(' Allowlist already empty (allow all)');
193
- process.exit(0);
185
+ // Top 16 models for the /model picker
186
+ const TOP_MODELS = [
187
+ 'auto', 'free', 'eco', 'premium',
188
+ 'anthropic/claude-sonnet-4.6', 'anthropic/claude-opus-4.6', 'anthropic/claude-haiku-4.5',
189
+ 'openai/gpt-5.2', 'openai/gpt-4o', 'openai/o3',
190
+ 'google/gemini-3.1-pro', 'google/gemini-3-flash-preview',
191
+ 'deepseek/deepseek-chat', 'moonshot/kimi-k2.5',
192
+ 'xai/grok-3', 'minimax/minimax-m2.5'
193
+ ];
194
+
195
+ if (!config.agents) config.agents = {};
196
+ if (!config.agents.defaults) config.agents.defaults = {};
197
+ if (!config.agents.defaults.models || typeof config.agents.defaults.models !== 'object') {
198
+ config.agents.defaults.models = {};
194
199
  }
195
200
 
196
- const blockrunKeys = keys.filter(k => k.startsWith('blockrun/'));
197
- if (blockrunKeys.length === 0) {
198
- console.log(' No blockrun entries in allowlist, skipping');
199
- process.exit(0);
201
+ const allowlist = config.agents.defaults.models;
202
+ // Clean out old blockrun entries not in TOP_MODELS
203
+ const topSet = new Set(TOP_MODELS.map(id => 'blockrun/' + id));
204
+ for (const key of Object.keys(allowlist)) {
205
+ if (key.startsWith('blockrun/') && !topSet.has(key)) {
206
+ delete allowlist[key];
207
+ }
200
208
  }
201
-
202
- // Remove blockrun entries
203
- for (const k of blockrunKeys) {
204
- delete allowlist[k];
209
+ let added = 0;
210
+ for (const id of TOP_MODELS) {
211
+ const key = 'blockrun/' + id;
212
+ if (!allowlist[key]) {
213
+ allowlist[key] = {};
214
+ added++;
215
+ }
205
216
  }
206
217
 
207
218
  // Atomic write
@@ -209,11 +220,10 @@ try {
209
220
  fs.writeFileSync(tmpPath, JSON.stringify(config, null, 2));
210
221
  fs.renameSync(tmpPath, configPath);
211
222
 
212
- const remaining = Object.keys(allowlist).length;
213
- if (remaining === 0) {
214
- console.log(' Cleared blockrun-only allowlist (all providers now visible)');
223
+ if (added > 0) {
224
+ console.log(' Added ' + added + ' models to allowlist (' + TOP_MODELS.length + ' total)');
215
225
  } else {
216
- console.log(' Removed ' + blockrunKeys.length + ' blockrun entries (' + remaining + ' user entries kept)');
226
+ console.log(' Allowlist already up to date');
217
227
  }
218
228
  } catch (err) {
219
229
  console.log(' Migration skipped: ' + err.message);