@blockrun/clawrouter 0.12.99 → 0.12.100
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 +46 -45
- package/scripts/update.sh +21 -45
package/package.json
CHANGED
package/scripts/reinstall.sh
CHANGED
|
@@ -256,6 +256,52 @@ if (fs.existsSync(configPath)) {
|
|
|
256
256
|
}
|
|
257
257
|
"
|
|
258
258
|
|
|
259
|
+
# 5b. Ensure provider baseUrl is set (must happen BEFORE openclaw plugins install,
|
|
260
|
+
# which validates the config and fails if baseUrl is missing)
|
|
261
|
+
echo "→ Verifying provider config..."
|
|
262
|
+
node -e "
|
|
263
|
+
const os = require('os');
|
|
264
|
+
const fs = require('fs');
|
|
265
|
+
const path = require('path');
|
|
266
|
+
const configPath = path.join(os.homedir(), '.openclaw', 'openclaw.json');
|
|
267
|
+
|
|
268
|
+
if (!fs.existsSync(configPath)) {
|
|
269
|
+
console.log(' No config file found, skipping');
|
|
270
|
+
process.exit(0);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
try {
|
|
274
|
+
const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
|
|
275
|
+
const provider = config?.models?.providers?.blockrun;
|
|
276
|
+
if (!provider) {
|
|
277
|
+
console.log(' No blockrun provider found, skipping');
|
|
278
|
+
process.exit(0);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
let changed = false;
|
|
282
|
+
if (!provider.baseUrl) {
|
|
283
|
+
provider.baseUrl = 'http://127.0.0.1:8402/v1';
|
|
284
|
+
changed = true;
|
|
285
|
+
console.log(' Fixed missing baseUrl');
|
|
286
|
+
}
|
|
287
|
+
if (!provider.apiKey) {
|
|
288
|
+
provider.apiKey = 'x402-proxy-handles-auth';
|
|
289
|
+
changed = true;
|
|
290
|
+
console.log(' Fixed missing apiKey');
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
if (changed) {
|
|
294
|
+
const tmpPath = configPath + '.tmp.' + process.pid;
|
|
295
|
+
fs.writeFileSync(tmpPath, JSON.stringify(config, null, 2));
|
|
296
|
+
fs.renameSync(tmpPath, configPath);
|
|
297
|
+
} else {
|
|
298
|
+
console.log(' Provider config OK');
|
|
299
|
+
}
|
|
300
|
+
} catch (err) {
|
|
301
|
+
console.log(' Skipped: ' + err.message);
|
|
302
|
+
}
|
|
303
|
+
"
|
|
304
|
+
|
|
259
305
|
# 6. Install plugin (config is ready, but no allow list yet to avoid validation error)
|
|
260
306
|
# Back up OpenClaw credentials (channels, WhatsApp/Telegram state) before plugin install
|
|
261
307
|
CREDS_DIR="$HOME/.openclaw/credentials"
|
|
@@ -437,51 +483,6 @@ if (fs.existsSync(configPath)) {
|
|
|
437
483
|
}
|
|
438
484
|
"
|
|
439
485
|
|
|
440
|
-
# 8. Ensure provider baseUrl is set (prevents "baseUrl: undefined" on gateway restart)
|
|
441
|
-
echo "→ Verifying provider config..."
|
|
442
|
-
node -e "
|
|
443
|
-
const os = require('os');
|
|
444
|
-
const fs = require('fs');
|
|
445
|
-
const path = require('path');
|
|
446
|
-
const configPath = path.join(os.homedir(), '.openclaw', 'openclaw.json');
|
|
447
|
-
|
|
448
|
-
if (!fs.existsSync(configPath)) {
|
|
449
|
-
console.log(' No config file found, skipping');
|
|
450
|
-
process.exit(0);
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
try {
|
|
454
|
-
const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
|
|
455
|
-
const provider = config?.models?.providers?.blockrun;
|
|
456
|
-
if (!provider) {
|
|
457
|
-
console.log(' No blockrun provider found, skipping');
|
|
458
|
-
process.exit(0);
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
let changed = false;
|
|
462
|
-
if (!provider.baseUrl) {
|
|
463
|
-
provider.baseUrl = 'http://127.0.0.1:8402/v1';
|
|
464
|
-
changed = true;
|
|
465
|
-
console.log(' Fixed missing baseUrl');
|
|
466
|
-
}
|
|
467
|
-
if (!provider.apiKey) {
|
|
468
|
-
provider.apiKey = 'x402-proxy-handles-auth';
|
|
469
|
-
changed = true;
|
|
470
|
-
console.log(' Fixed missing apiKey');
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
if (changed) {
|
|
474
|
-
const tmpPath = configPath + '.tmp.' + process.pid;
|
|
475
|
-
fs.writeFileSync(tmpPath, JSON.stringify(config, null, 2));
|
|
476
|
-
fs.renameSync(tmpPath, configPath);
|
|
477
|
-
} else {
|
|
478
|
-
console.log(' Provider config OK');
|
|
479
|
-
}
|
|
480
|
-
} catch (err) {
|
|
481
|
-
console.log(' Skipped: ' + err.message);
|
|
482
|
-
}
|
|
483
|
-
"
|
|
484
|
-
|
|
485
486
|
# Final: verify wallet survived reinstall
|
|
486
487
|
echo "→ Verifying wallet integrity..."
|
|
487
488
|
if [ -f "$WALLET_FILE" ]; then
|
package/scripts/update.sh
CHANGED
|
@@ -169,6 +169,27 @@ try {
|
|
|
169
169
|
}
|
|
170
170
|
"
|
|
171
171
|
|
|
172
|
+
# ── Step 3b: Ensure baseUrl is set (must happen BEFORE install, which validates config) ──
|
|
173
|
+
echo "→ Verifying provider config..."
|
|
174
|
+
node -e "
|
|
175
|
+
const fs = require('fs');
|
|
176
|
+
const configPath = '$CONFIG_PATH';
|
|
177
|
+
if (!fs.existsSync(configPath)) { console.log(' No config, skipping'); process.exit(0); }
|
|
178
|
+
try {
|
|
179
|
+
const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
|
|
180
|
+
const provider = config?.models?.providers?.blockrun;
|
|
181
|
+
if (!provider) { console.log(' No blockrun provider, skipping'); process.exit(0); }
|
|
182
|
+
let changed = false;
|
|
183
|
+
if (!provider.baseUrl) { provider.baseUrl = 'http://127.0.0.1:8402/v1'; changed = true; console.log(' Fixed missing baseUrl'); }
|
|
184
|
+
if (!provider.apiKey) { provider.apiKey = 'x402-proxy-handles-auth'; changed = true; console.log(' Fixed missing apiKey'); }
|
|
185
|
+
if (changed) {
|
|
186
|
+
const tmp = configPath + '.tmp.' + process.pid;
|
|
187
|
+
fs.writeFileSync(tmp, JSON.stringify(config, null, 2));
|
|
188
|
+
fs.renameSync(tmp, configPath);
|
|
189
|
+
} else { console.log(' Provider config OK'); }
|
|
190
|
+
} catch (err) { console.log(' Skipped: ' + err.message); }
|
|
191
|
+
"
|
|
192
|
+
|
|
172
193
|
# ── Step 4: Install latest version ─────────────────────────────
|
|
173
194
|
# Back up OpenClaw credentials (channels, WhatsApp/Telegram state) before plugin install
|
|
174
195
|
CREDS_DIR="$HOME/.openclaw/credentials"
|
|
@@ -350,51 +371,6 @@ try {
|
|
|
350
371
|
}
|
|
351
372
|
"
|
|
352
373
|
|
|
353
|
-
# ── Step 9: Ensure baseUrl is set ─────────────────────────────
|
|
354
|
-
echo "→ Verifying provider config..."
|
|
355
|
-
node -e "
|
|
356
|
-
const os = require('os');
|
|
357
|
-
const fs = require('fs');
|
|
358
|
-
const path = require('path');
|
|
359
|
-
const configPath = path.join(os.homedir(), '.openclaw', 'openclaw.json');
|
|
360
|
-
|
|
361
|
-
if (!fs.existsSync(configPath)) {
|
|
362
|
-
console.log(' No config file found, skipping');
|
|
363
|
-
process.exit(0);
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
try {
|
|
367
|
-
const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
|
|
368
|
-
const provider = config?.models?.providers?.blockrun;
|
|
369
|
-
if (!provider) {
|
|
370
|
-
console.log(' No blockrun provider found, skipping');
|
|
371
|
-
process.exit(0);
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
let changed = false;
|
|
375
|
-
if (!provider.baseUrl) {
|
|
376
|
-
provider.baseUrl = 'http://127.0.0.1:8402/v1';
|
|
377
|
-
changed = true;
|
|
378
|
-
console.log(' Fixed missing baseUrl');
|
|
379
|
-
}
|
|
380
|
-
if (!provider.apiKey) {
|
|
381
|
-
provider.apiKey = 'x402-proxy-handles-auth';
|
|
382
|
-
changed = true;
|
|
383
|
-
console.log(' Fixed missing apiKey');
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
if (changed) {
|
|
387
|
-
const tmpPath = configPath + '.tmp.' + process.pid;
|
|
388
|
-
fs.writeFileSync(tmpPath, JSON.stringify(config, null, 2));
|
|
389
|
-
fs.renameSync(tmpPath, configPath);
|
|
390
|
-
} else {
|
|
391
|
-
console.log(' Provider config OK');
|
|
392
|
-
}
|
|
393
|
-
} catch (err) {
|
|
394
|
-
console.log(' Skipped: ' + err.message);
|
|
395
|
-
}
|
|
396
|
-
"
|
|
397
|
-
|
|
398
374
|
# ── Summary ─────────────────────────────────────────────────────
|
|
399
375
|
echo ""
|
|
400
376
|
echo "✓ ClawRouter updated successfully!"
|