nexrall-code 0.5.195 → 0.5.196

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 +69 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -10124,7 +10124,13 @@ var require_client = __commonJS({
10124
10124
  "resumable",
10125
10125
  "runtime_context",
10126
10126
  "context_warning",
10127
- "tool_progress"
10127
+ "tool_progress",
10128
+ // The first-payment gate's substitution notice (routes/code.js emits it
10129
+ // with the other pre-turn frames, before openStream()): a system message
10130
+ // for the USER, not evidence the model started. Counting it would downgrade
10131
+ // the turn to the 150 s mid-stream limit while the upstream is still doing
10132
+ // prompt processing — the exact spurious-stall class 'resumable' caused.
10133
+ "notice"
10128
10134
  ]);
10129
10135
  var MAX_TOTAL_RETRY_MS = (() => {
10130
10136
  const raw = Number(process.env.NEXRALL_MAX_RETRY_MS);
@@ -10643,6 +10649,12 @@ var require_client = __commonJS({
10643
10649
  case "context_warning": {
10644
10650
  break;
10645
10651
  }
10652
+ case "notice": {
10653
+ const message = typeof evt.message === "string" ? evt.message : "";
10654
+ if (message)
10655
+ onEvent({ type: "notice", message });
10656
+ break;
10657
+ }
10646
10658
  case "thinking": {
10647
10659
  const text = typeof evt.text === "string" ? evt.text : "";
10648
10660
  if (text) {
@@ -10953,7 +10965,13 @@ var require_client = __commonJS({
10953
10965
  const data = await response.json();
10954
10966
  return {
10955
10967
  models: Array.isArray(data.models) ? data.models : [],
10956
- defaultModel: typeof data.defaultModel === "string" ? data.defaultModel : "deepseek-flash"
10968
+ defaultModel: typeof data.defaultModel === "string" ? data.defaultModel : "deepseek-flash",
10969
+ // First-payment model gate (2026-10-05): true = this account's model CHOICE
10970
+ // is locked until its first payment (team members and anyone who has paid
10971
+ // are exempt). Absent on an older backend, which also means unenforced —
10972
+ // so defaulting to false (open picker, pre-gate behaviour) is the only
10973
+ // correct reading: the flag must never lock a picker the server won't.
10974
+ isFreeTier: data.isFreeTier === true
10957
10975
  };
10958
10976
  }
10959
10977
  async function getUsageDaily(days = 30) {
@@ -22811,7 +22829,8 @@ var require_modelCatalogue = __commonJS({
22811
22829
  Object.defineProperty(exports, "__esModule", { value: true });
22812
22830
  exports.CHEAPEST_MODEL_ALIAS = void 0;
22813
22831
  exports.getModelCatalogue = getModelCatalogue2;
22814
- exports.getCachedModelCatalogue = getCachedModelCatalogue;
22832
+ exports.getCachedModelCatalogue = getCachedModelCatalogue2;
22833
+ exports.liveIsFreeTier = liveIsFreeTier2;
22815
22834
  exports.liveContextWindowFor = liveContextWindowFor;
22816
22835
  exports.liveMaxOutputTokensFor = liveMaxOutputTokensFor;
22817
22836
  exports.liveSupportsImageInput = liveSupportsImageInput2;
@@ -22839,10 +22858,10 @@ var require_modelCatalogue = __commonJS({
22839
22858
  return _inFlight;
22840
22859
  _inFlight = (async () => {
22841
22860
  try {
22842
- const { models, defaultModel } = await (0, client_1.getCodeModels)();
22861
+ const { models, defaultModel, isFreeTier } = await (0, client_1.getCodeModels)();
22843
22862
  if (!models.length)
22844
22863
  return _state2;
22845
- const next = { models, defaultModel, fetchedAt: Date.now() };
22864
+ const next = { models, defaultModel, isFreeTier, fetchedAt: Date.now() };
22846
22865
  _state2 = next;
22847
22866
  return next;
22848
22867
  } catch {
@@ -22853,9 +22872,12 @@ var require_modelCatalogue = __commonJS({
22853
22872
  })();
22854
22873
  return _inFlight;
22855
22874
  }
22856
- function getCachedModelCatalogue() {
22875
+ function getCachedModelCatalogue2() {
22857
22876
  return _state2;
22858
22877
  }
22878
+ function liveIsFreeTier2() {
22879
+ return _state2 ? _state2.isFreeTier : null;
22880
+ }
22859
22881
  function findModel(id) {
22860
22882
  if (!id || !_state2)
22861
22883
  return void 0;
@@ -22936,8 +22958,8 @@ var require_modelCatalogue = __commonJS({
22936
22958
  return cheapestSameVendorModel(parentModel);
22937
22959
  return agentModel;
22938
22960
  }
22939
- function _setModelCatalogueForTest(models) {
22940
- _state2 = models ? { models, defaultModel: models[0]?.id ?? "", fetchedAt: Date.now() } : null;
22961
+ function _setModelCatalogueForTest(models, isFreeTier = false) {
22962
+ _state2 = models ? { models, defaultModel: models[0]?.id ?? "", isFreeTier, fetchedAt: Date.now() } : null;
22941
22963
  }
22942
22964
  }
22943
22965
  });
@@ -26907,6 +26929,9 @@ ${extra}` : extra;
26907
26929
  case "runtime_context":
26908
26930
  pendingRuntimeContext = event.text;
26909
26931
  break;
26932
+ case "notice":
26933
+ options.onNotice?.(event.message);
26934
+ break;
26910
26935
  case "tool_use_ready":
26911
26936
  if (prefetchOn && !options.abortSignal?.aborted)
26912
26937
  prefetcher.start(event.id, event.name, event.input);
@@ -102437,6 +102462,19 @@ function printBalanceNotice(balance, zero) {
102437
102462
  console.log(" " + paint.yellow(hyperlink("\u2192 Top up", BILLING_URL)) + paint.dim(` (${BILLING_URL})`));
102438
102463
  console.log();
102439
102464
  }
102465
+ function gateDefaultModelId() {
102466
+ return (0, import_code_core62.getCachedModelCatalogue)()?.defaultModel || "deepseek-flash";
102467
+ }
102468
+ function printModelGateNotice() {
102469
+ const model = resolveModelLabel(gateDefaultModelId());
102470
+ console.log();
102471
+ console.log(
102472
+ paint.badge(" Upgrade ") + " " + paint.dim(`Model choice unlocks after your first payment \u2014 this session runs on ${model}.`)
102473
+ );
102474
+ console.log(" " + paint.dim("Your first payment unlocks every model and the effort control."));
102475
+ console.log(" " + paint.yellow(hyperlink("\u2192 Add funds", BILLING_URL)) + paint.dim(` (${BILLING_URL})`));
102476
+ console.log();
102477
+ }
102440
102478
  function currentUserLabel() {
102441
102479
  try {
102442
102480
  const u = os14.userInfo().username;
@@ -105233,6 +105271,10 @@ ${text}` : "");
105233
105271
  }
105234
105272
  };
105235
105273
  const applyModel = (id) => {
105274
+ if ((0, import_code_core62.liveIsFreeTier)() === true && id !== gateDefaultModelId()) {
105275
+ printModelGateNotice();
105276
+ return;
105277
+ }
105236
105278
  const plan = planModelSwitch(id, effortLevel, clampEffortForModel);
105237
105279
  const prevModel = modelAlias;
105238
105280
  void (0, import_code_core63.fireObserverHook)(workDir, "PreModelSwitch", { from: prevModel, to: plan.model }, plan.model);
@@ -105271,6 +105313,10 @@ ${text}` : "");
105271
105313
  const openModelPicker = async () => {
105272
105314
  if (!(rl instanceof InkReadlineAdapter))
105273
105315
  return;
105316
+ if ((0, import_code_core62.liveIsFreeTier)() === true) {
105317
+ printModelGateNotice();
105318
+ return;
105319
+ }
105274
105320
  const list = buildPickList({
105275
105321
  title: "Switch model",
105276
105322
  detail: "Takes effect on the next turn \u2014 the conversation and your files are untouched",
@@ -105288,6 +105334,21 @@ ${text}` : "");
105288
105334
  return;
105289
105335
  applyModel(out.value);
105290
105336
  };
105337
+ void (0, import_code_core62.getModelCatalogue)().then((cat) => {
105338
+ if (!cat || !cat.isFreeTier || !cat.defaultModel)
105339
+ return;
105340
+ if (modelAlias === cat.defaultModel)
105341
+ return;
105342
+ const prev = resolveModelLabel(modelAlias);
105343
+ modelAlias = cat.defaultModel;
105344
+ updateFooter();
105345
+ console.log(
105346
+ paint.dim(
105347
+ ` Model choice unlocks after your first payment \u2014 switched ${prev} \u2192 ${resolveModelLabel(modelAlias)}. Add funds: ${BILLING_URL}`
105348
+ )
105349
+ );
105350
+ }).catch(() => {
105351
+ });
105291
105352
  const openEffortPicker = async () => {
105292
105353
  if (!(rl instanceof InkReadlineAdapter))
105293
105354
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexrall-code",
3
- "version": "0.5.195",
3
+ "version": "0.5.196",
4
4
  "description": "Nexrall Code — AI coding assistant for your terminal (headless agent for scripts, CI and automation)",
5
5
  "keywords": [
6
6
  "ai",