@blockrun/clawrouter 0.12.103 → 0.12.105

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/dist/cli.js CHANGED
@@ -79095,6 +79095,18 @@ function red(text) {
79095
79095
  function yellow(text) {
79096
79096
  return `\x1B[33m\u26A0\x1B[0m ${text}`;
79097
79097
  }
79098
+ async function fetchLatestVersion() {
79099
+ try {
79100
+ const res = await fetch("https://registry.npmjs.org/@blockrun/clawrouter/latest", {
79101
+ signal: AbortSignal.timeout(5e3)
79102
+ });
79103
+ if (!res.ok) return null;
79104
+ const data = await res.json();
79105
+ return data.version ?? null;
79106
+ } catch {
79107
+ return null;
79108
+ }
79109
+ }
79098
79110
  function collectSystemInfo() {
79099
79111
  return {
79100
79112
  os: `${platform()} ${arch()}`,
@@ -79241,11 +79253,28 @@ function identifyIssues(result) {
79241
79253
  if (!result.network.localProxy.running) {
79242
79254
  issues.push(`Local proxy not running on port ${result.network.localProxy.port}`);
79243
79255
  }
79256
+ if (result.latestVersion && result.latestVersion !== result.version) {
79257
+ issues.push(
79258
+ `Outdated version: running v${result.version}, latest is v${result.latestVersion}. Run: curl -fsSL https://blockrun.ai/ClawRouter-update | bash`
79259
+ );
79260
+ }
79244
79261
  return issues;
79245
79262
  }
79246
79263
  function printDiagnostics(result) {
79247
79264
  console.log("\n\u{1F50D} Collecting diagnostics...\n");
79248
- console.log("System");
79265
+ console.log("Version");
79266
+ if (result.latestVersion && result.latestVersion !== result.version) {
79267
+ console.log(` ${red(`Installed: v${result.version} (outdated!)`)}`);
79268
+ console.log(` ${yellow(`Latest: v${result.latestVersion}`)}`);
79269
+ console.log(
79270
+ ` ${yellow(`Update: curl -fsSL https://blockrun.ai/ClawRouter-update | bash`)}`
79271
+ );
79272
+ } else if (result.latestVersion) {
79273
+ console.log(` ${green(`v${result.version} (up to date)`)}`);
79274
+ } else {
79275
+ console.log(` ${green(`v${result.version}`)}`);
79276
+ }
79277
+ console.log("\nSystem");
79249
79278
  console.log(` ${green(`OS: ${result.system.os}`)}`);
79250
79279
  console.log(` ${green(`Node: ${result.system.nodeVersion}`)}`);
79251
79280
  console.log(
@@ -79396,14 +79425,16 @@ async function runDoctor(userQuestion, model = "sonnet") {
79396
79425
  console.log(`
79397
79426
  \u{1FA7A} BlockRun Doctor v${VERSION}
79398
79427
  `);
79399
- const [system, wallet, network, logs] = await Promise.all([
79428
+ const [system, wallet, network, logs, latestVersion] = await Promise.all([
79400
79429
  collectSystemInfo(),
79401
79430
  collectWalletInfo(),
79402
79431
  collectNetworkInfo(),
79403
- collectLogInfo()
79432
+ collectLogInfo(),
79433
+ fetchLatestVersion()
79404
79434
  ]);
79405
79435
  const result = {
79406
79436
  version: VERSION,
79437
+ latestVersion,
79407
79438
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
79408
79439
  system,
79409
79440
  wallet,