nexrall-code 0.5.195 → 0.5.197
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/index.js +67 -8
- 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 =
|
|
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
|
|
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);
|
|
@@ -77697,6 +77722,7 @@ function buildPainters(name, custom) {
|
|
|
77697
77722
|
};
|
|
77698
77723
|
out.boldBrand = (s2) => withLevel(() => source_default.bold(out.brand(s2)));
|
|
77699
77724
|
out.badge = level === 0 ? (s2) => s2 : (s2) => withLevel(() => source_default.bgYellow.black(s2));
|
|
77725
|
+
out.badgeBlue = level === 0 ? (s2) => s2 : (s2) => withLevel(() => source_default.bgBlue.white(s2));
|
|
77700
77726
|
out.codeSpan = level === 0 ? (s2) => s2 : (s2) => withLevel(() => source_default.bgBlack.whiteBright(s2));
|
|
77701
77727
|
const table = out;
|
|
77702
77728
|
table.colored = (level ?? source_default.level) !== 0;
|
|
@@ -102437,6 +102463,16 @@ function printBalanceNotice(balance, zero) {
|
|
|
102437
102463
|
console.log(" " + paint.yellow(hyperlink("\u2192 Top up", BILLING_URL)) + paint.dim(` (${BILLING_URL})`));
|
|
102438
102464
|
console.log();
|
|
102439
102465
|
}
|
|
102466
|
+
function gateDefaultModelId() {
|
|
102467
|
+
return (0, import_code_core62.getCachedModelCatalogue)()?.defaultModel || "deepseek-flash";
|
|
102468
|
+
}
|
|
102469
|
+
function printModelGateNotice() {
|
|
102470
|
+
console.log();
|
|
102471
|
+
console.log(paint.badgeBlue(" Upgrade ") + " " + paint.dim("Unlock more models"));
|
|
102472
|
+
console.log(" " + paint.dim("Add funds once to unlock every model and the effort control."));
|
|
102473
|
+
console.log(" " + paint.yellow(hyperlink("\u2192 Add funds", BILLING_URL)) + paint.dim(` (${BILLING_URL})`));
|
|
102474
|
+
console.log();
|
|
102475
|
+
}
|
|
102440
102476
|
function currentUserLabel() {
|
|
102441
102477
|
try {
|
|
102442
102478
|
const u = os14.userInfo().username;
|
|
@@ -105233,6 +105269,10 @@ ${text}` : "");
|
|
|
105233
105269
|
}
|
|
105234
105270
|
};
|
|
105235
105271
|
const applyModel = (id) => {
|
|
105272
|
+
if ((0, import_code_core62.liveIsFreeTier)() === true && id !== gateDefaultModelId()) {
|
|
105273
|
+
printModelGateNotice();
|
|
105274
|
+
return;
|
|
105275
|
+
}
|
|
105236
105276
|
const plan = planModelSwitch(id, effortLevel, clampEffortForModel);
|
|
105237
105277
|
const prevModel = modelAlias;
|
|
105238
105278
|
void (0, import_code_core63.fireObserverHook)(workDir, "PreModelSwitch", { from: prevModel, to: plan.model }, plan.model);
|
|
@@ -105271,6 +105311,10 @@ ${text}` : "");
|
|
|
105271
105311
|
const openModelPicker = async () => {
|
|
105272
105312
|
if (!(rl instanceof InkReadlineAdapter))
|
|
105273
105313
|
return;
|
|
105314
|
+
if ((0, import_code_core62.liveIsFreeTier)() === true) {
|
|
105315
|
+
printModelGateNotice();
|
|
105316
|
+
return;
|
|
105317
|
+
}
|
|
105274
105318
|
const list = buildPickList({
|
|
105275
105319
|
title: "Switch model",
|
|
105276
105320
|
detail: "Takes effect on the next turn \u2014 the conversation and your files are untouched",
|
|
@@ -105288,6 +105332,21 @@ ${text}` : "");
|
|
|
105288
105332
|
return;
|
|
105289
105333
|
applyModel(out.value);
|
|
105290
105334
|
};
|
|
105335
|
+
void (0, import_code_core62.getModelCatalogue)().then((cat) => {
|
|
105336
|
+
if (!cat || !cat.isFreeTier || !cat.defaultModel)
|
|
105337
|
+
return;
|
|
105338
|
+
if (modelAlias === cat.defaultModel)
|
|
105339
|
+
return;
|
|
105340
|
+
const prev = resolveModelLabel(modelAlias);
|
|
105341
|
+
modelAlias = cat.defaultModel;
|
|
105342
|
+
updateFooter();
|
|
105343
|
+
console.log(
|
|
105344
|
+
paint.dim(
|
|
105345
|
+
` Model choice unlocks after your first payment \u2014 switched ${prev} \u2192 ${resolveModelLabel(modelAlias)}. Add funds: ${BILLING_URL}`
|
|
105346
|
+
)
|
|
105347
|
+
);
|
|
105348
|
+
}).catch(() => {
|
|
105349
|
+
});
|
|
105291
105350
|
const openEffortPicker = async () => {
|
|
105292
105351
|
if (!(rl instanceof InkReadlineAdapter))
|
|
105293
105352
|
return;
|