claudish 7.66.0 → 7.66.1

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 +84 -40
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -731,7 +731,7 @@ var init_onepassword_config = __esm(() => {
731
731
  });
732
732
 
733
733
  // src/version.ts
734
- var VERSION = "7.66.0";
734
+ var VERSION = "7.66.1";
735
735
 
736
736
  // src/logger.ts
737
737
  var exports_logger = {};
@@ -35182,26 +35182,35 @@ function hasQuotaExhaustionWording(errorBody) {
35182
35182
  const lower = (errorBody || "").toLowerCase();
35183
35183
  return EXHAUSTION_PHRASES.some((phrase) => lower.includes(phrase));
35184
35184
  }
35185
+ function hasPlanLimitWording(errorBody) {
35186
+ const lower = (errorBody || "").toLowerCase();
35187
+ if (BALANCE_PHRASES.some((phrase) => lower.includes(phrase)))
35188
+ return false;
35189
+ return PLAN_LIMIT_PHRASES.some((phrase) => lower.includes(phrase));
35190
+ }
35185
35191
  function isQuotaExhaustionError(status, errorBody) {
35186
35192
  if (status !== 401 && status !== 403 && status !== 429)
35187
35193
  return false;
35188
35194
  return hasQuotaExhaustionWording(errorBody);
35189
35195
  }
35190
- var EXHAUSTION_PHRASES;
35196
+ var BALANCE_PHRASES, PLAN_LIMIT_PHRASES, EXHAUSTION_PHRASES;
35191
35197
  var init_quota_exhaustion = __esm(() => {
35192
- EXHAUSTION_PHRASES = [
35198
+ BALANCE_PHRASES = [
35199
+ "insufficient balance",
35200
+ "insufficient_quota",
35201
+ "out of credits",
35202
+ "credit balance"
35203
+ ];
35204
+ PLAN_LIMIT_PHRASES = [
35193
35205
  "usage limit",
35194
35206
  "billing cycle",
35195
35207
  "quota",
35196
- "insufficient balance",
35197
- "insufficient_quota",
35198
35208
  "upgrade your plan",
35199
35209
  "exceeded your current",
35200
- "out of credits",
35201
- "credit balance",
35202
35210
  "daily limit",
35203
35211
  "plan limit"
35204
35212
  ];
35213
+ EXHAUSTION_PHRASES = [...BALANCE_PHRASES, ...PLAN_LIMIT_PHRASES];
35205
35214
  });
35206
35215
 
35207
35216
  // src/handlers/shared/gemini-queue.ts
@@ -43650,6 +43659,9 @@ function getRecoveryHint(status, errorText, providerName, transportTerminal429)
43650
43659
  return "Provider overloaded. Retry or use a different model.";
43651
43660
  }
43652
43661
  if (status === 429 && (transportTerminal429 ?? isTerminal429(errorText))) {
43662
+ if (hasPlanLimitWording(errorText)) {
43663
+ return "Plan limit reached \u2014 your allowance is spent for this cycle and refills on the provider's own schedule (see the message below). Wait, upgrade the plan, or switch provider.";
43664
+ }
43653
43665
  return "Out of quota \u2014 check your plan & billing details. This won't recover on retry.";
43654
43666
  }
43655
43667
  if (status === 429 && transportTerminal429 === false) {
@@ -43666,6 +43678,9 @@ function getRecoveryHint(status, errorText, providerName, transportTerminal429)
43666
43678
  return "Model not supported by this provider. Verify model name.";
43667
43679
  }
43668
43680
  if (isQuotaExhaustionError(status, errorText)) {
43681
+ if (hasPlanLimitWording(errorText)) {
43682
+ return "Plan limit reached \u2014 your allowance is spent for this cycle and refills on the provider's own schedule (see the message below). Wait, upgrade the plan, or switch provider.";
43683
+ }
43669
43684
  return "Out of quota \u2014 check your plan & billing details. This won't recover on retry.";
43670
43685
  }
43671
43686
  if (hasActionableLink(errorText)) {
@@ -51223,6 +51238,14 @@ function classifyHttpError(status, body, latencyMs) {
51223
51238
  };
51224
51239
  }
51225
51240
  if (status === 429) {
51241
+ if (hasPlanLimitWording(body)) {
51242
+ return {
51243
+ state: "plan-limit",
51244
+ latencyMs,
51245
+ httpStatus: status,
51246
+ errorMessage: extractErrorMessage(body) || "Plan allowance spent for this cycle"
51247
+ };
51248
+ }
51226
51249
  return {
51227
51250
  state: "rate-limited",
51228
51251
  latencyMs,
@@ -51231,6 +51254,14 @@ function classifyHttpError(status, body, latencyMs) {
51231
51254
  };
51232
51255
  }
51233
51256
  if (upstream === 429 || status === 402) {
51257
+ if (status !== 402 && hasPlanLimitWording(body)) {
51258
+ return {
51259
+ state: "plan-limit",
51260
+ latencyMs,
51261
+ httpStatus: upstream ?? status,
51262
+ errorMessage: extractErrorMessage(body) || "Plan allowance spent for this cycle"
51263
+ };
51264
+ }
51234
51265
  return {
51235
51266
  state: "out-of-credit",
51236
51267
  latencyMs,
@@ -51253,7 +51284,7 @@ function classifyHttpError(status, body, latencyMs) {
51253
51284
  errorMessage: extractErrorMessage(body) || `HTTP ${status}`
51254
51285
  };
51255
51286
  }
51256
- function truncateKeepingLink(text, max = 160) {
51287
+ function truncateKeepingLink(text, max = 400) {
51257
51288
  if (text.length <= max)
51258
51289
  return text;
51259
51290
  const url2 = text.match(/https?:\/\/\S+/i)?.[0];
@@ -51470,6 +51501,8 @@ function describeProbeState(result) {
51470
51501
  return withDetail(`rate limited \xB7 ${result.latencyMs}ms`, result.errorMessage);
51471
51502
  case "out-of-credit":
51472
51503
  return withDetail(`out of credit \xB7 ${status}${latency}`.trim(), result.errorMessage);
51504
+ case "plan-limit":
51505
+ return withDetail(`plan limit reached \xB7 ${status}${latency}`.trim(), result.errorMessage);
51473
51506
  case "server-error":
51474
51507
  return withDetail(`server error \xB7 ${status} \xB7 ${result.latencyMs}ms`, result.errorMessage);
51475
51508
  case "timeout":
@@ -51486,12 +51519,13 @@ function isReadyState(state) {
51486
51519
  return state === "live";
51487
51520
  }
51488
51521
  function isFailureState(state) {
51489
- return state === "auth-failed" || state === "model-not-found" || state === "rate-limited" || state === "out-of-credit" || state === "server-error" || state === "timeout" || state === "network-error" || state === "error";
51522
+ return state === "auth-failed" || state === "model-not-found" || state === "rate-limited" || state === "out-of-credit" || state === "plan-limit" || state === "server-error" || state === "timeout" || state === "network-error" || state === "error";
51490
51523
  }
51491
51524
  var STREAM_MS_FLOOR = 50, OAUTH_PROVIDERS2, PROBE_PROMPT = "Count from one to twenty in words, one per line.", PROBE_MAX_TOKENS = 512, MINIMAL_EFFORT_UNSUPPORTED;
51492
51525
  var init_probe_live = __esm(() => {
51493
51526
  init_anthropic_error();
51494
51527
  init_model_unsupported();
51528
+ init_quota_exhaustion();
51495
51529
  OAUTH_PROVIDERS2 = new Set(["vertex", "antigravity", "devin"]);
51496
51530
  MINIMAL_EFFORT_UNSUPPORTED = new Set(["native-anthropic", "anthropic"]);
51497
51531
  });
@@ -72716,6 +72750,8 @@ function shortStatusLabel(probe2, hasCreds, _hint) {
72716
72750
  return `${pc.red}\u2297 rate-limited${pc.reset}`;
72717
72751
  case "out-of-credit":
72718
72752
  return `${pc.red}\u2297 no credit${pc.reset}`;
72753
+ case "plan-limit":
72754
+ return `${pc.red}\u2297 plan limit${pc.reset}`;
72719
72755
  case "server-error":
72720
72756
  return `${pc.red}\u2297 server ${probe2.httpStatus ?? ""}${pc.reset}`;
72721
72757
  case "timeout":
@@ -79796,12 +79832,29 @@ var init_ProfilesContent = __esm(() => {
79796
79832
 
79797
79833
  // src/tui/components/ProviderDetail.tsx
79798
79834
  import { jsx as jsx11, jsxs as jsxs10, Fragment as Fragment7 } from "@opentui/react/jsx-runtime";
79799
- function truncateOneLine(text, maxWidth) {
79835
+ function wrapToLines(text, maxWidth, maxLines) {
79800
79836
  const collapsed = text.replace(/\s+/g, " ").trim();
79801
79837
  const limit = Math.max(20, maxWidth);
79802
79838
  if (collapsed.length <= limit)
79803
- return collapsed;
79804
- return `${collapsed.slice(0, limit - 1)}\u2026`;
79839
+ return [collapsed];
79840
+ const lines = [];
79841
+ let rest = collapsed;
79842
+ while (rest.length > 0 && lines.length < maxLines) {
79843
+ if (rest.length <= limit) {
79844
+ lines.push(rest);
79845
+ break;
79846
+ }
79847
+ const slice = rest.slice(0, limit);
79848
+ const cut = slice.lastIndexOf(" ");
79849
+ const at = cut > limit * 0.5 ? cut : limit;
79850
+ lines.push(rest.slice(0, at));
79851
+ rest = rest.slice(at).trimStart();
79852
+ }
79853
+ if (rest.length > 0 && lines.length === maxLines) {
79854
+ const last = lines[maxLines - 1] ?? "";
79855
+ lines[maxLines - 1] = `${last.slice(0, Math.max(1, limit - 1))}\u2026`;
79856
+ }
79857
+ return lines;
79805
79858
  }
79806
79859
  function resolveProviderDetailKeyDisplay(input) {
79807
79860
  if (input.isLocal)
@@ -79911,6 +79964,7 @@ function ProviderDetail({
79911
79964
  });
79912
79965
  }
79913
79966
  const tr = testResults[selectedProvider.name];
79967
+ const failureText = tr && (tr.status === "failed" || tr.status === "unavailable") ? tr.providerMessage ?? tr.error : undefined;
79914
79968
  return /* @__PURE__ */ jsxs10("box", {
79915
79969
  height: DETAIL_H,
79916
79970
  border: true,
@@ -80089,7 +80143,7 @@ function ProviderDetail({
80089
80143
  })
80090
80144
  ]
80091
80145
  }),
80092
- /* @__PURE__ */ jsxs10("text", {
80146
+ !failureText && /* @__PURE__ */ jsxs10("text", {
80093
80147
  children: [
80094
80148
  /* @__PURE__ */ jsxs10("span", {
80095
80149
  fg: C.blue,
@@ -80105,7 +80159,7 @@ function ProviderDetail({
80105
80159
  })
80106
80160
  ]
80107
80161
  }),
80108
- selectedProvider.keyUrl && /* @__PURE__ */ jsxs10("text", {
80162
+ selectedProvider.keyUrl && !failureText && /* @__PURE__ */ jsxs10("text", {
80109
80163
  children: [
80110
80164
  /* @__PURE__ */ jsxs10("span", {
80111
80165
  fg: C.blue,
@@ -80150,34 +80204,24 @@ function ProviderDetail({
80150
80204
  })
80151
80205
  ]
80152
80206
  }),
80153
- tr.status === "failed" && /* @__PURE__ */ jsxs10(Fragment7, {
80154
- children: [
80155
- /* @__PURE__ */ jsx11("span", {
80156
- fg: C.red,
80157
- attributes: A.bold,
80158
- children: "\u2717 failed"
80159
- }),
80160
- tr.error && /* @__PURE__ */ jsx11("span", {
80161
- fg: C.red,
80162
- children: ` ${truncateOneLine(tr.error, width - 16)}`
80163
- })
80164
- ]
80207
+ tr.status === "failed" && /* @__PURE__ */ jsx11("span", {
80208
+ fg: C.red,
80209
+ attributes: A.bold,
80210
+ children: "\u2717 failed"
80165
80211
  }),
80166
- tr.status === "unavailable" && /* @__PURE__ */ jsxs10(Fragment7, {
80167
- children: [
80168
- /* @__PURE__ */ jsx11("span", {
80169
- fg: C.yellow,
80170
- attributes: A.bold,
80171
- children: "\u25CB unavailable"
80172
- }),
80173
- tr.error && /* @__PURE__ */ jsx11("span", {
80174
- fg: C.yellow,
80175
- children: ` ${truncateOneLine(tr.error, width - 16)}`
80176
- })
80177
- ]
80212
+ tr.status === "unavailable" && /* @__PURE__ */ jsx11("span", {
80213
+ fg: C.yellow,
80214
+ attributes: A.bold,
80215
+ children: "\u25CB unavailable"
80178
80216
  })
80179
80217
  ]
80180
- })
80218
+ }),
80219
+ failureText && wrapToLines(failureText, width - 4, 2).map((line, i) => /* @__PURE__ */ jsx11("text", {
80220
+ children: /* @__PURE__ */ jsx11("span", {
80221
+ fg: tr?.status === "unavailable" ? C.yellow : C.red,
80222
+ children: line
80223
+ })
80224
+ }, i))
80181
80225
  ]
80182
80226
  });
80183
80227
  }
@@ -82763,7 +82807,7 @@ function App({ requestLogin } = {}) {
82763
82807
  const error46 = tried.size > 1 ? `${baseError} (tried ${tried.size} models)` : baseError;
82764
82808
  setTestResults((prev) => ({
82765
82809
  ...prev,
82766
- [provName]: { status: "failed", error: error46, ms }
82810
+ [provName]: { status: "failed", error: error46, providerMessage: result.errorMessage, ms }
82767
82811
  }));
82768
82812
  }
82769
82813
  } catch (err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claudish",
3
- "version": "7.66.0",
3
+ "version": "7.66.1",
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",
@@ -60,10 +60,10 @@
60
60
  "ai"
61
61
  ],
62
62
  "optionalDependencies": {
63
- "@claudish/magmux-darwin-arm64": "7.66.0",
64
- "@claudish/magmux-darwin-x64": "7.66.0",
65
- "@claudish/magmux-linux-arm64": "7.66.0",
66
- "@claudish/magmux-linux-x64": "7.66.0"
63
+ "@claudish/magmux-darwin-arm64": "7.66.1",
64
+ "@claudish/magmux-darwin-x64": "7.66.1",
65
+ "@claudish/magmux-linux-arm64": "7.66.1",
66
+ "@claudish/magmux-linux-x64": "7.66.1"
67
67
  },
68
68
  "author": "Jack Rudenko <i@madappgang.com>",
69
69
  "license": "MIT",