@blockrun/clawrouter 0.8.17 → 0.8.19

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/README.md CHANGED
@@ -9,9 +9,13 @@ One wallet, 30+ models, zero API keys.
9
9
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
10
10
  [![TypeScript](https://img.shields.io/badge/TypeScript-5.7-blue.svg)](https://typescriptlang.org)
11
11
  [![Node](https://img.shields.io/badge/node-%E2%89%A520-brightgreen.svg)](https://nodejs.org)
12
+ [![USDC Hackathon Winner](https://img.shields.io/badge/🏆_USDC_Hackathon-Agentic_Commerce_Winner-gold)](https://x.com/USDC/status/2021625822294216977)
12
13
 
13
14
  [Docs](https://blockrun.ai/docs) · [Models](https://blockrun.ai/models) · [Configuration](docs/configuration.md) · [Features](docs/features.md) · [Windows](docs/windows-installation.md) · [Troubleshooting](docs/troubleshooting.md) · [Telegram](https://t.me/blockrunAI) · [X](https://x.com/BlockRunAI)
14
15
 
16
+ **Winner — Agentic Commerce Track** at the [USDC AI Agent Hackathon](https://x.com/USDC/status/2021625822294216977)<br>
17
+ *The world's first hackathon run entirely by AI agents, powered by USDC*
18
+
15
19
  </div>
16
20
 
17
21
  ---
package/dist/cli.js CHANGED
@@ -2233,6 +2233,42 @@ function getSessionId(headers, headerName = DEFAULT_SESSION_CONFIG.headerName) {
2233
2233
  return void 0;
2234
2234
  }
2235
2235
 
2236
+ // src/updater.ts
2237
+ var NPM_REGISTRY = "https://registry.npmjs.org/@blockrun/clawrouter/latest";
2238
+ var UPDATE_URL = "https://blockrun.ai/ClawRouter-update";
2239
+ var CHECK_TIMEOUT_MS = 5e3;
2240
+ function compareSemver(a, b) {
2241
+ const pa = a.split(".").map(Number);
2242
+ const pb = b.split(".").map(Number);
2243
+ for (let i = 0; i < 3; i++) {
2244
+ if ((pa[i] || 0) > (pb[i] || 0)) return 1;
2245
+ if ((pa[i] || 0) < (pb[i] || 0)) return -1;
2246
+ }
2247
+ return 0;
2248
+ }
2249
+ async function checkForUpdates() {
2250
+ try {
2251
+ const controller = new AbortController();
2252
+ const timeout = setTimeout(() => controller.abort(), CHECK_TIMEOUT_MS);
2253
+ const res = await fetch(NPM_REGISTRY, {
2254
+ signal: controller.signal,
2255
+ headers: { Accept: "application/json" }
2256
+ });
2257
+ clearTimeout(timeout);
2258
+ if (!res.ok) return;
2259
+ const data = await res.json();
2260
+ const latest = data.version;
2261
+ if (!latest) return;
2262
+ if (compareSemver(latest, VERSION) > 0) {
2263
+ console.log("");
2264
+ console.log(`\x1B[33m\u2B06\uFE0F ClawRouter ${latest} available (you have ${VERSION})\x1B[0m`);
2265
+ console.log(` Run: \x1B[36mcurl -fsSL ${UPDATE_URL} | bash\x1B[0m`);
2266
+ console.log("");
2267
+ }
2268
+ } catch {
2269
+ }
2270
+ }
2271
+
2236
2272
  // src/proxy.ts
2237
2273
  var BLOCKRUN_API = "https://blockrun.ai/api";
2238
2274
  var AUTO_MODEL = "blockrun/auto";
@@ -2778,6 +2814,7 @@ async function startProxy(options) {
2778
2814
  const port = addr.port;
2779
2815
  const baseUrl = `http://127.0.0.1:${port}`;
2780
2816
  options.onReady?.(port);
2817
+ checkForUpdates();
2781
2818
  server.on("error", (err) => {
2782
2819
  console.error(`[ClawRouter] Server runtime error: ${err.message}`);
2783
2820
  options.onError?.(err);