claudish 6.5.1 → 6.5.2

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.
Files changed (2) hide show
  1. package/dist/index.js +31 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -34296,7 +34296,7 @@ async function fetchGLMCodingModels() {
34296
34296
  return [];
34297
34297
  }
34298
34298
  }
34299
- var __filename4, __dirname4, VERSION = "6.5.1", CACHE_MAX_AGE_DAYS2 = 2, CLAUDISH_CACHE_DIR2, BUNDLED_MODELS_PATH, CACHED_MODELS_PATH, ALL_MODELS_JSON_PATH;
34299
+ var __filename4, __dirname4, VERSION = "6.5.2", CACHE_MAX_AGE_DAYS2 = 2, CLAUDISH_CACHE_DIR2, BUNDLED_MODELS_PATH, CACHED_MODELS_PATH, ALL_MODELS_JSON_PATH;
34300
34300
  var init_cli = __esm(() => {
34301
34301
  init_config();
34302
34302
  init_model_loader();
@@ -96521,6 +96521,8 @@ class MtmDiagRunner {
96521
96521
  modelName = "";
96522
96522
  provider = "";
96523
96523
  port = "";
96524
+ quotaRemaining;
96525
+ tokenPollTimer = null;
96524
96526
  lastError = "";
96525
96527
  errorCount = 0;
96526
96528
  requestCount = 0;
@@ -96530,6 +96532,11 @@ class MtmDiagRunner {
96530
96532
  adapters = "";
96531
96533
  setPort(port) {
96532
96534
  this.port = String(port);
96535
+ this.tokenPollTimer = setInterval(() => {
96536
+ const changed = this.readTokenFile();
96537
+ if (changed)
96538
+ this.refreshStatusBar();
96539
+ }, 3000);
96533
96540
  }
96534
96541
  setModel(name) {
96535
96542
  this.modelName = name.includes("/") ? name.split("/").pop() : name;
@@ -96539,16 +96546,28 @@ class MtmDiagRunner {
96539
96546
  this.provider = name.split("/")[0];
96540
96547
  }
96541
96548
  }
96542
- refreshStatusBar() {
96543
- let quotaRemaining;
96549
+ readTokenFile() {
96550
+ if (!this.port)
96551
+ return false;
96544
96552
  try {
96545
96553
  const tokPath = join31(homedir27(), ".claudish", `tokens-${this.port}.json`);
96546
96554
  const tok = JSON.parse(readFileSync24(tokPath, "utf-8"));
96547
- if (typeof tok.quota_remaining === "number")
96548
- quotaRemaining = tok.quota_remaining;
96549
- if (!this.provider && tok.provider_name)
96555
+ let changed = false;
96556
+ if (typeof tok.quota_remaining === "number" && tok.quota_remaining !== this.quotaRemaining) {
96557
+ this.quotaRemaining = tok.quota_remaining;
96558
+ changed = true;
96559
+ }
96560
+ if (tok.provider_name && tok.provider_name !== this.provider) {
96550
96561
  this.provider = tok.provider_name;
96551
- } catch {}
96562
+ changed = true;
96563
+ }
96564
+ return changed;
96565
+ } catch {
96566
+ return false;
96567
+ }
96568
+ }
96569
+ refreshStatusBar() {
96570
+ this.readTokenFile();
96552
96571
  const bar = renderStatusBar({
96553
96572
  model: this.modelName,
96554
96573
  provider: this.provider,
@@ -96556,7 +96575,7 @@ class MtmDiagRunner {
96556
96575
  lastError: this.lastError,
96557
96576
  requestCount: this.requestCount,
96558
96577
  avgRoundtripMs: this.avgRoundtripMs,
96559
- quotaRemaining
96578
+ quotaRemaining: this.quotaRemaining
96560
96579
  });
96561
96580
  try {
96562
96581
  appendFileSync2(this.statusPath, bar + `
@@ -96567,6 +96586,10 @@ class MtmDiagRunner {
96567
96586
  return this.logPath;
96568
96587
  }
96569
96588
  cleanup() {
96589
+ if (this.tokenPollTimer) {
96590
+ clearInterval(this.tokenPollTimer);
96591
+ this.tokenPollTimer = null;
96592
+ }
96570
96593
  if (this.logStream) {
96571
96594
  try {
96572
96595
  this.logStream.end();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claudish",
3
- "version": "6.5.1",
3
+ "version": "6.5.2",
4
4
  "description": "Run Claude Code with any model - OpenRouter, Ollama, LM Studio & local models",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",