@blockrun/clawrouter 0.6.6 → 0.6.8

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.6.6",
3
+ "version": "0.6.8",
4
4
  "description": "Smart LLM router — save 78% on inference costs. 30+ models, one wallet, x402 micropayments.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -33,7 +33,8 @@
33
33
  "test:resilience:stability:full": "DURATION_MINUTES=240 npx tsx test/resilience-stability.ts",
34
34
  "test:resilience:lifecycle": "npx tsx test/resilience-lifecycle.ts",
35
35
  "test:resilience:quick": "npm run test:resilience:errors && npm run test:resilience:lifecycle",
36
- "test:resilience:full": "npm run test:resilience:errors && npm run test:resilience:lifecycle && npm run test:resilience:stability:full"
36
+ "test:resilience:full": "npm run test:resilience:errors && npm run test:resilience:lifecycle && npm run test:resilience:stability:full",
37
+ "test:e2e:tool-ids": "npx tsx test/e2e-tool-id-sanitization.ts"
37
38
  },
38
39
  "keywords": [
39
40
  "llm",
@@ -96,8 +96,8 @@ if (!store.profiles[profileKey]) {
96
96
  }
97
97
  "
98
98
 
99
- # 5. Add plugin to allow list (required for OpenClaw to load it)
100
- echo "→ Adding to plugins allow list..."
99
+ # 5. Ensure apiKey is present for /model picker (but DON'T override default model)
100
+ echo "→ Finalizing setup..."
101
101
  node -e "
102
102
  const os = require('os');
103
103
  const fs = require('fs');
@@ -107,20 +107,18 @@ const configPath = path.join(os.homedir(), '.openclaw', 'openclaw.json');
107
107
  if (fs.existsSync(configPath)) {
108
108
  try {
109
109
  const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
110
+ let changed = false;
110
111
 
111
- // Ensure plugins.allow exists and includes clawrouter
112
- if (!config.plugins) config.plugins = {};
113
- if (!Array.isArray(config.plugins.allow)) {
114
- config.plugins.allow = [];
115
- }
116
- if (!config.plugins.allow.includes('clawrouter') && !config.plugins.allow.includes('@blockrun/clawrouter')) {
117
- config.plugins.allow.push('clawrouter');
118
- console.log(' Added clawrouter to plugins.allow');
119
- } else {
120
- console.log(' Plugin already in allow list');
112
+ // Ensure blockrun provider has apiKey (required by ModelRegistry for /model picker)
113
+ if (config.models?.providers?.blockrun && !config.models.providers.blockrun.apiKey) {
114
+ config.models.providers.blockrun.apiKey = 'x402-proxy-handles-auth';
115
+ console.log(' Added apiKey to blockrun provider config');
116
+ changed = true;
121
117
  }
122
118
 
123
- fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
119
+ if (changed) {
120
+ fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
121
+ }
124
122
  } catch (e) {
125
123
  console.log(' Could not update config:', e.message);
126
124
  }
@@ -129,8 +127,12 @@ if (fs.existsSync(configPath)) {
129
127
  }
130
128
  "
131
129
 
132
- # 6. Ensure apiKey is present for /model picker (but DON'T override default model)
133
- echo "→ Finalizing setup..."
130
+ # 6. Install plugin (config is ready, but no allow list yet to avoid validation error)
131
+ echo "→ Installing ClawRouter..."
132
+ openclaw plugins install @blockrun/clawrouter
133
+
134
+ # 7. Add plugin to allow list (done AFTER install so plugin files exist for validation)
135
+ echo "→ Adding to plugins allow list..."
134
136
  node -e "
135
137
  const os = require('os');
136
138
  const fs = require('fs');
@@ -140,18 +142,20 @@ const configPath = path.join(os.homedir(), '.openclaw', 'openclaw.json');
140
142
  if (fs.existsSync(configPath)) {
141
143
  try {
142
144
  const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
143
- let changed = false;
144
145
 
145
- // Ensure blockrun provider has apiKey (required by ModelRegistry for /model picker)
146
- if (config.models?.providers?.blockrun && !config.models.providers.blockrun.apiKey) {
147
- config.models.providers.blockrun.apiKey = 'x402-proxy-handles-auth';
148
- console.log(' Added apiKey to blockrun provider config');
149
- changed = true;
146
+ // Ensure plugins.allow exists and includes clawrouter
147
+ if (!config.plugins) config.plugins = {};
148
+ if (!Array.isArray(config.plugins.allow)) {
149
+ config.plugins.allow = [];
150
150
  }
151
-
152
- if (changed) {
153
- fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
151
+ if (!config.plugins.allow.includes('clawrouter') && !config.plugins.allow.includes('@blockrun/clawrouter')) {
152
+ config.plugins.allow.push('clawrouter');
153
+ console.log(' Added clawrouter to plugins.allow');
154
+ } else {
155
+ console.log(' Plugin already in allow list');
154
156
  }
157
+
158
+ fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
155
159
  } catch (e) {
156
160
  console.log(' Could not update config:', e.message);
157
161
  }
@@ -160,10 +164,6 @@ if (fs.existsSync(configPath)) {
160
164
  }
161
165
  "
162
166
 
163
- # 7. Install plugin (done last so it starts with correct config)
164
- echo "→ Installing ClawRouter..."
165
- openclaw plugins install @blockrun/clawrouter
166
-
167
167
  echo ""
168
168
  echo "✓ Done! Smart routing enabled by default."
169
169
  echo ""