nexrall-code 0.5.98 → 0.5.100

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 +44 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -9875,6 +9875,7 @@ var require_client = __commonJS({
9875
9875
  exports2.revokeRefreshToken = revokeRefreshToken2;
9876
9876
  exports2.describeAttachment = describeAttachment2;
9877
9877
  exports2.getBalance = getBalance3;
9878
+ exports2.getCodeModels = getCodeModels;
9878
9879
  exports2.getUsageDaily = getUsageDaily;
9879
9880
  exports2.exchangeVscodeCode = exchangeVscodeCode;
9880
9881
  exports2.login = login2;
@@ -10648,6 +10649,27 @@ var require_client = __commonJS({
10648
10649
  const data = await response.json();
10649
10650
  return typeof data.balance === "number" ? data.balance : 0;
10650
10651
  }
10652
+ async function getCodeModels() {
10653
+ const fetchOnce = () => (0, node_fetch_1.default)(`${exports2.API_BASE}/api/code/models`, { method: "GET", headers: authHeaders() });
10654
+ let response = await fetchOnce();
10655
+ if (response.status === 401 || response.status === 403) {
10656
+ const body = await response.text().catch(() => "");
10657
+ if (isExpiredTokenResponse(response.status, body) && await refreshAccessToken()) {
10658
+ response = await fetchOnce();
10659
+ } else {
10660
+ throw new Error(`API error ${response.status}: ${body}`);
10661
+ }
10662
+ }
10663
+ if (!response.ok) {
10664
+ const errText = await response.text();
10665
+ throw new Error(`API error ${response.status}: ${errText}`);
10666
+ }
10667
+ const data = await response.json();
10668
+ return {
10669
+ models: Array.isArray(data.models) ? data.models : [],
10670
+ defaultModel: typeof data.defaultModel === "string" ? data.defaultModel : "claude-sonnet-5"
10671
+ };
10672
+ }
10651
10673
  async function getUsageDaily(days = 30) {
10652
10674
  const fetchOnce = () => (0, node_fetch_1.default)(`${exports2.API_BASE}/api/user/usage-daily?days=${days}`, { method: "GET", headers: authHeaders() });
10653
10675
  let response = await fetchOnce();
@@ -103755,6 +103777,8 @@ ${ctx.repeatError}
103755
103777
  return `Browser: type "${String(input.text ?? "").slice(0, 40)}"`;
103756
103778
  if (action === "snapshot")
103757
103779
  return "Browser: read page";
103780
+ if (action === "read_text")
103781
+ return "Browser: read page text";
103758
103782
  return `Browser: ${action || "(unknown action)"}`;
103759
103783
  }
103760
103784
  default:
@@ -104167,7 +104191,15 @@ ${partial}` : "",
104167
104191
  "deepseek-v4-pro": 1048576,
104168
104192
  "deepseek-v4-flash": 1048576,
104169
104193
  // Qwen (DashScope), by real model id (documented max input, same caveat).
104170
- "qwen3.7-max": 991800
104194
+ "qwen3.7-max": 991800,
104195
+ // Z.ai (GLM), by real model id. contextWindow is documented (Z.ai/
104196
+ // Cloudflare Workers AI model cards, both list 1,048,576) rather than
104197
+ // measured — a ~400K-token request was ACCEPTED (200), not rejected, so
104198
+ // there was no 400 to read a real ceiling out of. maxOutputTokens IS
104199
+ // measured: `max_tokens: 999999` was rejected with the ceiling in the
104200
+ // error body (backend services/providers/modelRegistry.js's glm-5.3 row
104201
+ // has the full verification notes).
104202
+ "glm-5.3": 1048576
104171
104203
  };
104172
104204
  function contextWindowFor2(model) {
104173
104205
  return MODEL_CONTEXT_TOKENS[model ?? "turbo"] ?? 128e3;
@@ -153125,7 +153157,8 @@ var MODEL_LABELS = {
153125
153157
  "gpt-4.1": "GPT-4.1",
153126
153158
  "deepseek-v4-pro": "DeepSeek V4 Pro",
153127
153159
  "deepseek-v4-flash": "DeepSeek V4 Flash",
153128
- "qwen3.7-max": "Qwen3.7 Max"
153160
+ "qwen3.7-max": "Qwen3.7 Max",
153161
+ "glm-5.3": "GLM 5.3"
153129
153162
  };
153130
153163
  var LEGACY_MODEL_ALIASES = {
153131
153164
  turbo: "claude-sonnet-5",
@@ -153144,7 +153177,8 @@ var SELECTABLE_MODELS = [
153144
153177
  "gpt-4.1",
153145
153178
  "deepseek-v4-pro",
153146
153179
  "deepseek-v4-flash",
153147
- "qwen3.7-max"
153180
+ "qwen3.7-max",
153181
+ "glm-5.3"
153148
153182
  ];
153149
153183
  var MODEL_COST_MULTIPLIER = {
153150
153184
  "claude-sonnet-5": 1.5,
@@ -153155,13 +153189,18 @@ var MODEL_COST_MULTIPLIER = {
153155
153189
  "gpt-4.1": 1,
153156
153190
  "deepseek-v4-pro": 0.1,
153157
153191
  "deepseek-v4-flash": 0.05,
153158
- "qwen3.7-max": 1
153192
+ "qwen3.7-max": 1,
153193
+ // $1.40/$4.40 per 1M in/out (docs.z.ai, 2026-08-30) vs gpt-4.1's $2.00/$8.00
153194
+ // (migration 113) — roughly 0.6x on a blended 75/25 in/out turn. Rounded to
153195
+ // a friendly number like every other row; re-check backend/migrations/
153196
+ // 130_glm_5_3_pricing.sql's own caveat if Z.ai ships a GLM-5.3-specific rate.
153197
+ "glm-5.3": 0.6
153159
153198
  };
153160
153199
  function modelWithCostHint(id) {
153161
153200
  const mult = MODEL_COST_MULTIPLIER[id];
153162
153201
  return mult === void 0 ? id : `${id} (${mult}x)`;
153163
153202
  }
153164
- var NO_VISION_MODELS = /* @__PURE__ */ new Set(["deepseek-v4-pro", "deepseek-v4-flash", "qwen3.7-max"]);
153203
+ var NO_VISION_MODELS = /* @__PURE__ */ new Set(["deepseek-v4-pro", "deepseek-v4-flash", "qwen3.7-max", "glm-5.3"]);
153165
153204
  var NO_PDF_MODELS = /* @__PURE__ */ new Set([
153166
153205
  "gpt-5.4",
153167
153206
  "gpt-5.4-mini",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexrall-code",
3
- "version": "0.5.98",
3
+ "version": "0.5.100",
4
4
  "description": "Nexrall Code — AI coding assistant for your terminal (headless agent for scripts, CI and automation)",
5
5
  "keywords": [
6
6
  "ai",