@blockrun/clawrouter 0.8.26 → 0.8.28

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
@@ -1772,8 +1772,13 @@ async function logUsage(entry) {
1772
1772
 
1773
1773
  // src/stats.ts
1774
1774
  import { readFile, readdir } from "fs/promises";
1775
- import { join as join2 } from "path";
1775
+ import { join as join2, dirname } from "path";
1776
1776
  import { homedir as homedir2 } from "os";
1777
+ import { fileURLToPath } from "url";
1778
+ var __dirname = dirname(fileURLToPath(import.meta.url));
1779
+ var pkgPath = join2(__dirname, "..", "package.json");
1780
+ var pkg = JSON.parse(await readFile(pkgPath, "utf-8").catch(() => '{"version":"unknown"}'));
1781
+ var VERSION = pkg.version;
1777
1782
  var LOG_DIR2 = join2(homedir2(), ".openclaw", "blockrun", "logs");
1778
1783
  async function parseLogFile(filePath) {
1779
1784
  try {
@@ -2157,14 +2162,14 @@ var BalanceMonitor = class {
2157
2162
 
2158
2163
  // src/version.ts
2159
2164
  import { createRequire } from "module";
2160
- import { fileURLToPath } from "url";
2161
- import { dirname, join as join3 } from "path";
2162
- var __filename = fileURLToPath(import.meta.url);
2163
- var __dirname = dirname(__filename);
2165
+ import { fileURLToPath as fileURLToPath2 } from "url";
2166
+ import { dirname as dirname2, join as join3 } from "path";
2167
+ var __filename = fileURLToPath2(import.meta.url);
2168
+ var __dirname2 = dirname2(__filename);
2164
2169
  var require2 = createRequire(import.meta.url);
2165
- var pkg = require2(join3(__dirname, "..", "package.json"));
2166
- var VERSION = pkg.version;
2167
- var USER_AGENT = `clawrouter/${VERSION}`;
2170
+ var pkg2 = require2(join3(__dirname2, "..", "package.json"));
2171
+ var VERSION2 = pkg2.version;
2172
+ var USER_AGENT = `clawrouter/${VERSION2}`;
2168
2173
 
2169
2174
  // src/session.ts
2170
2175
  var DEFAULT_SESSION_CONFIG = {
@@ -2322,9 +2327,9 @@ async function checkForUpdates() {
2322
2327
  const data = await res.json();
2323
2328
  const latest = data.version;
2324
2329
  if (!latest) return;
2325
- if (compareSemver(latest, VERSION) > 0) {
2330
+ if (compareSemver(latest, VERSION2) > 0) {
2326
2331
  console.log("");
2327
- console.log(`\x1B[33m\u2B06\uFE0F ClawRouter ${latest} available (you have ${VERSION})\x1B[0m`);
2332
+ console.log(`\x1B[33m\u2B06\uFE0F ClawRouter ${latest} available (you have ${VERSION2})\x1B[0m`);
2328
2333
  console.log(` Run: \x1B[36mcurl -fsSL ${UPDATE_URL} | bash\x1B[0m`);
2329
2334
  console.log("");
2330
2335
  }
@@ -3574,7 +3579,7 @@ async function resolveOrGenerateWalletKey() {
3574
3579
  // src/cli.ts
3575
3580
  function printHelp() {
3576
3581
  console.log(`
3577
- ClawRouter v${VERSION} - Smart LLM Router
3582
+ ClawRouter v${VERSION2} - Smart LLM Router
3578
3583
 
3579
3584
  Usage:
3580
3585
  clawrouter [options]
@@ -3619,7 +3624,7 @@ function parseArgs(args) {
3619
3624
  async function main() {
3620
3625
  const args = parseArgs(process.argv.slice(2));
3621
3626
  if (args.version) {
3622
- console.log(VERSION);
3627
+ console.log(VERSION2);
3623
3628
  process.exit(0);
3624
3629
  }
3625
3630
  if (args.help) {