nexrall-code 0.5.60 → 0.5.61

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 +82 -23
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -15005,7 +15005,19 @@ var require_agentTypes = __commonJS({
15005
15005
  "testfilesonly",
15006
15006
  "memory"
15007
15007
  ]);
15008
- var VALID_MODELS = ["turbo", "pro", "ultra"];
15008
+ var VALID_MODELS = [
15009
+ "claude-sonnet-5",
15010
+ "claude-opus-5",
15011
+ "claude-fable-5",
15012
+ "gpt-5.4",
15013
+ "gpt-5.4-mini",
15014
+ "gpt-4.1",
15015
+ // Legacy tier aliases — still accepted, still resolved by the backend.
15016
+ "turbo",
15017
+ "pro",
15018
+ "ultra",
15019
+ "fast"
15020
+ ];
15009
15021
  function parseFrontmatter(raw) {
15010
15022
  const m2 = /^\s*---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/.exec(raw);
15011
15023
  if (!m2)
@@ -15019,8 +15031,13 @@ var require_agentTypes = __commonJS({
15019
15031
  return { meta, body: (m2[2] ?? "").trim(), ok: true };
15020
15032
  }
15021
15033
  function parseModel(v) {
15022
- const s2 = (v ?? "").toLowerCase();
15023
- return s2 === "turbo" || s2 === "pro" || s2 === "ultra" ? s2 : void 0;
15034
+ const raw = (v ?? "").trim();
15035
+ if (!raw)
15036
+ return void 0;
15037
+ const lower2 = raw.toLowerCase();
15038
+ if (lower2 === "turbo" || lower2 === "pro" || lower2 === "ultra" || lower2 === "fast")
15039
+ return lower2;
15040
+ return raw;
15024
15041
  }
15025
15042
  function parseBool(v) {
15026
15043
  return /^(true|yes|1|on)$/i.test((v ?? "").trim());
@@ -15083,11 +15100,12 @@ var require_agentTypes = __commonJS({
15083
15100
  message: `has memory: "${meta.memory}", which is not a valid scope \u2014 use one of ${VALID_MEMORY_SCOPES.join(", ")}, or omit the line to give this agent no persistent notes.`
15084
15101
  });
15085
15102
  }
15086
- if (meta.model !== void 0 && parseModel(meta.model) === void 0) {
15103
+ const declaredModel = meta.model === void 0 ? void 0 : parseModel(meta.model);
15104
+ if (meta.model !== void 0 && (declaredModel === void 0 || !VALID_MODELS.includes(declaredModel))) {
15087
15105
  warnings.push({
15088
15106
  file: full,
15089
15107
  agent: name,
15090
- message: `has model: "${meta.model}", which is not valid \u2014 use one of ${VALID_MODELS.join(", ")}, or omit the line to inherit the current session's model.`
15108
+ message: `has model: "${meta.model}", which this version does not recognise \u2014 expected one of ${VALID_MODELS.join(", ")}, or omit the line to inherit the current session's model. It will still be sent; the server decides whether it is valid.`
15091
15109
  });
15092
15110
  }
15093
15111
  const unknown = (tools ?? []).filter((t2) => !KNOWN_TOOL_NAMES.has(t2) && !t2.includes("__"));
@@ -16846,12 +16864,25 @@ ${partial}` : "",
16846
16864
  }
16847
16865
  }
16848
16866
  var MODEL_CONTEXT_TOKENS = {
16867
+ // Tier aliases — still sent by older clients, saved settings and sub-agent
16868
+ // frontmatter, so they must keep resolving.
16849
16869
  turbo: 1e6,
16850
16870
  pro: 1e6,
16851
- ultra: 1e6
16871
+ ultra: 1e6,
16872
+ fast: 2e5,
16873
+ // Anthropic, by real model id.
16874
+ "claude-sonnet-5": 1e6,
16875
+ "claude-opus-5": 1e6,
16876
+ "claude-fable-5": 1e6,
16877
+ "claude-haiku-4-5-20251001": 2e5,
16878
+ // OpenAI, by real model id (measured).
16879
+ "gpt-5.4": 922e3,
16880
+ "gpt-5.4-mini": 272e3,
16881
+ "gpt-4.1": 1047576,
16882
+ "gpt-4o-mini": 128e3
16852
16883
  };
16853
16884
  function contextWindowFor2(model) {
16854
- return MODEL_CONTEXT_TOKENS[model ?? "turbo"] ?? 1e6;
16885
+ return MODEL_CONTEXT_TOKENS[model ?? "turbo"] ?? 128e3;
16855
16886
  }
16856
16887
  function envFraction(name, fallback) {
16857
16888
  const v = Number(process.env[name]);
@@ -64720,14 +64751,41 @@ var InkReadlineAdapter = class extends EventEmitter3 {
64720
64751
  };
64721
64752
 
64722
64753
  // src/commands/chat.ts
64723
- var CLI_VERSION = "0.5.60";
64754
+ var CLI_VERSION = "0.5.61";
64724
64755
  var MODEL_LABELS = {
64725
- turbo: "Nexrall Turbo",
64726
- pro: "Nexrall Pro",
64727
- ultra: "Ultra"
64756
+ "claude-sonnet-5": "Claude Sonnet 5",
64757
+ "claude-opus-5": "Claude Opus 5",
64758
+ "claude-fable-5": "Claude Fable 5",
64759
+ "claude-haiku-4-5-20251001": "Claude Haiku 4.5",
64760
+ "gpt-5.4": "GPT-5.4",
64761
+ "gpt-5.4-mini": "GPT-5.4 Mini",
64762
+ "gpt-4.1": "GPT-4.1"
64728
64763
  };
64764
+ var LEGACY_MODEL_ALIASES = {
64765
+ turbo: "claude-sonnet-5",
64766
+ auto: "claude-sonnet-5",
64767
+ pro: "claude-opus-5",
64768
+ power: "claude-opus-5",
64769
+ ultra: "claude-fable-5",
64770
+ fast: "claude-haiku-4-5-20251001"
64771
+ };
64772
+ var SELECTABLE_MODELS = [
64773
+ "claude-sonnet-5",
64774
+ "claude-opus-5",
64775
+ "claude-fable-5",
64776
+ "gpt-5.4",
64777
+ "gpt-5.4-mini",
64778
+ "gpt-4.1"
64779
+ ];
64780
+ function normaliseModelId(model) {
64781
+ const raw = (model ?? "").trim();
64782
+ if (!raw)
64783
+ return "claude-sonnet-5";
64784
+ return LEGACY_MODEL_ALIASES[raw.toLowerCase()] ?? raw;
64785
+ }
64729
64786
  function resolveModelLabel(alias) {
64730
- return MODEL_LABELS[alias] ?? MODEL_LABELS["turbo"];
64787
+ const id = normaliseModelId(alias);
64788
+ return MODEL_LABELS[id] ?? id;
64731
64789
  }
64732
64790
  function tryExec(cmd, cwd2) {
64733
64791
  try {
@@ -65242,7 +65300,7 @@ function printHelp() {
65242
65300
  ["/init", "Generate nexrall.md for this project"],
65243
65301
  ["/memory [global] [clear]", "View persistent memory (project or global); /memory clear to wipe"],
65244
65302
  ["/help", "Show this help"],
65245
- ["/model [turbo|pro|ultra]", "Switch model"],
65303
+ ["/model [name]", "Switch model (e.g. claude-opus-5, gpt-5.4)"],
65246
65304
  ["/mode [ask|edit|plan|auto]", "Set agent mode"],
65247
65305
  ["/effort [low|medium|high|extra]", "Set thinking effort level"],
65248
65306
  ["/yolo", "Auto-approve all permissions"],
@@ -65772,14 +65830,15 @@ ${dirList}`;
65772
65830
  rl.prompt();
65773
65831
  return;
65774
65832
  case "/model": {
65775
- const newAlias = arg.toLowerCase();
65776
- if (!newAlias) {
65777
- console.log(source_default.dim(` Current: ${source_default.cyan(resolveModelLabel(modelAlias))} Options: turbo \xB7 pro \xB7 ultra`));
65778
- } else if (["turbo", "pro", "ultra"].includes(newAlias)) {
65779
- modelAlias = newAlias;
65780
- console.log(source_default.green(` Model \u2192 ${source_default.bold(resolveModelLabel(newAlias))}`));
65833
+ const requested = arg.trim();
65834
+ if (!requested) {
65835
+ console.log(source_default.dim(` Current: ${source_default.cyan(resolveModelLabel(modelAlias))}`));
65836
+ console.log(source_default.dim(` Options: ${SELECTABLE_MODELS.join(" \xB7 ")}`));
65837
+ } else if (SELECTABLE_MODELS.includes(normaliseModelId(requested))) {
65838
+ modelAlias = normaliseModelId(requested);
65839
+ console.log(source_default.green(` Model \u2192 ${source_default.bold(resolveModelLabel(modelAlias))}`));
65781
65840
  } else {
65782
- console.log(source_default.red(` Unknown: ${newAlias}. Options: turbo, pro, ultra`));
65841
+ console.log(source_default.red(` Unknown: ${requested}. Options: ${SELECTABLE_MODELS.join(", ")}`));
65783
65842
  }
65784
65843
  rl.prompt();
65785
65844
  return;
@@ -66395,7 +66454,7 @@ function pluginSourceRemoveCommand(name, opts) {
66395
66454
 
66396
66455
  // src/index.ts
66397
66456
  var program2 = new Command();
66398
- program2.name("nex").description("Nexrall Code \u2014 AI coding assistant (powered by Nexrall)").version("0.5.60").enablePositionalOptions();
66457
+ program2.name("nex").description("Nexrall Code \u2014 AI coding assistant (powered by Nexrall)").version("0.5.61").enablePositionalOptions();
66399
66458
  program2.command("auth").description("Login to your Nexrall account").action(authCommand);
66400
66459
  program2.command("logout").description("Log out of your Nexrall account").action(logoutCommand);
66401
66460
  program2.command("update").description("Update nex to the latest version").option("-c, --check", "Check for updates without installing").option("-y, --yes", "Skip confirmation prompt").action(async (opts) => {
@@ -66466,12 +66525,12 @@ program2.command("sessions").description("List or delete saved chat sessions").o
66466
66525
  console.log(source_default.dim(" nex sessions --delete <id> to remove one"));
66467
66526
  console.log();
66468
66527
  });
66469
- program2.option("-p, --pro", "Use Nexrall Pro (Claude Opus, most capable)").option("-t, --turbo", "Use Nexrall Turbo (Claude Sonnet, fast)").option("-u, --ultra", "Use Ultra (Claude Fable 5, most powerful)").option("-y, --yolo", "Auto-approve all tool calls (no permission prompts)").option("-d, --dir <path>", "Set working directory (default: current directory)").option("-m, --model <name>", "Explicit model: turbo | pro | ultra").option("-r, --resume [id]", "Resume last session, or a specific session id").option("--no-banner", "Skip the ASCII banner (useful in scripts/pipes)").option("--output-format <fmt>", "One-shot output format: text | json | stream-json (implies auto-approve)").argument("[prompt...]", "One-shot prompt \u2014 if omitted, starts interactive mode").action(async (promptParts, options) => {
66528
+ program2.option("-p, --pro", "Use Claude Opus 5 (most capable)").option("-t, --turbo", "Use Claude Sonnet 5 (fast, default)").option("-u, --ultra", "Use Claude Fable 5 (most powerful)").option("-y, --yolo", "Auto-approve all tool calls (no permission prompts)").option("-d, --dir <path>", "Set working directory (default: current directory)").option("-m, --model <name>", "Explicit model, e.g. claude-opus-5 | gpt-5.4 | gpt-4.1").option("-r, --resume [id]", "Resume last session, or a specific session id").option("--no-banner", "Skip the ASCII banner (useful in scripts/pipes)").option("--output-format <fmt>", "One-shot output format: text | json | stream-json (implies auto-approve)").argument("[prompt...]", "One-shot prompt \u2014 if omitted, starts interactive mode").action(async (promptParts, options) => {
66470
66529
  if (!(0, import_code_core6.isAuthenticated)()) {
66471
66530
  console.error("Not logged in. Run: nex auth");
66472
66531
  process.exit(1);
66473
66532
  }
66474
- const model = options.model ? options.model : options.ultra ? "ultra" : options.pro ? "pro" : options.turbo ? "turbo" : "turbo";
66533
+ const model = options.model ? options.model : options.ultra ? "claude-fable-5" : options.pro ? "claude-opus-5" : options.turbo ? "claude-sonnet-5" : "claude-sonnet-5";
66475
66534
  const workDir = options.dir ? path5.resolve(options.dir) : process.cwd();
66476
66535
  if (options.yolo)
66477
66536
  setAutoApprove("all");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexrall-code",
3
- "version": "0.5.60",
3
+ "version": "0.5.61",
4
4
  "description": "Nexrall Code — AI coding assistant for your terminal (headless agent for scripts, CI and automation)",
5
5
  "keywords": [
6
6
  "ai",
@@ -39,7 +39,7 @@
39
39
  "release": "node build.js && node scripts/upload-release.cjs"
40
40
  },
41
41
  "dependencies": {
42
- "@nexrall/code-core": "workspace:*",
42
+ "@nexrall/code-core": "^1.4.35",
43
43
  "chalk": "^5.3.0",
44
44
  "commander": "^12.0.0",
45
45
  "diff": "^5.2.0",