nexrall-code 0.5.44 → 0.5.46

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 +52 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -53371,6 +53371,46 @@ function prepareSessionScreen() {
53371
53371
  return;
53372
53372
  process.stdout.write("\x1B[2J\x1B[3J\x1B[H");
53373
53373
  }
53374
+ var BOTTOM_CHROME_ROWS = 3;
53375
+ function rowsOccupied(text, columns = process.stdout.columns || 80) {
53376
+ let rows = 0;
53377
+ for (const line of text.split("\n")) {
53378
+ const width = visibleLen(line);
53379
+ rows += width === 0 ? 1 : Math.ceil(width / columns);
53380
+ }
53381
+ return rows;
53382
+ }
53383
+ function padToBottom(rowsAlreadyPrinted) {
53384
+ const rows = process.stdout.rows;
53385
+ if (!process.stdout.isTTY || !rows)
53386
+ return;
53387
+ const filler = rows - rowsAlreadyPrinted - BOTTOM_CHROME_ROWS - 2;
53388
+ const MIN_WORTHWHILE_FILLER = 3;
53389
+ if (filler < MIN_WORTHWHILE_FILLER)
53390
+ return;
53391
+ console.log("\n".repeat(filler - 1));
53392
+ }
53393
+ var rowCounter = null;
53394
+ function startRowCount() {
53395
+ if (rowCounter)
53396
+ return;
53397
+ const columns = process.stdout.columns || 80;
53398
+ const original = console.log;
53399
+ const state = { rows: 0, original };
53400
+ rowCounter = state;
53401
+ console.log = (...args) => {
53402
+ state.rows += args.length === 0 ? 1 : rowsOccupied(args.map(String).join(" "), columns);
53403
+ original(...args);
53404
+ };
53405
+ }
53406
+ function stopRowCount() {
53407
+ if (!rowCounter)
53408
+ return 0;
53409
+ const { rows, original } = rowCounter;
53410
+ console.log = original;
53411
+ rowCounter = null;
53412
+ return rows;
53413
+ }
53374
53414
  var NEX_LOGO = [
53375
53415
  "\u2588\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2557 \u2588\u2588\u2557",
53376
53416
  "\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u255A\u2588\u2588\u2557\u2588\u2588\u2554\u255D",
@@ -53415,7 +53455,7 @@ function renderBanner(info) {
53415
53455
  const CHROME = 3 + 4 * PAD;
53416
53456
  const LOGO_W = Math.max(...NEX_LOGO.map(visibleLen));
53417
53457
  const termW = process.stdout.columns || 100;
53418
- const totalW = Math.max(LOGO_W + CHROME + 24, termW);
53458
+ const totalW = Math.max(LOGO_W + CHROME + 24, termW - 1);
53419
53459
  const headerText = `Nexrall Code v${info.version}`;
53420
53460
  const LEFT_W = Math.max(LOGO_W, visibleLen(headerText));
53421
53461
  const RIGHT_W = totalW - CHROME - LEFT_W;
@@ -62406,7 +62446,7 @@ var App2 = ({ onReady }) => {
62406
62446
  import_react35.default.useEffect(() => {
62407
62447
  onReady({ print, setFooter, setLive, askLine, onLine, setInputEnabled, close: () => exit() });
62408
62448
  }, []);
62409
- return /* @__PURE__ */ import_react35.default.createElement(Box_default, { flexDirection: "column" }, /* @__PURE__ */ import_react35.default.createElement(Static, { items }, (item) => /* @__PURE__ */ import_react35.default.createElement(Text, { key: item.id }, item.content)), live ? /* @__PURE__ */ import_react35.default.createElement(Text, null, live) : null, /* @__PURE__ */ import_react35.default.createElement(Text, { dimColor: true }, "\u2500".repeat(process.stdout.columns || 80)), inputEnabled ? /* @__PURE__ */ import_react35.default.createElement(Box_default, null, /* @__PURE__ */ import_react35.default.createElement(Text, null, prompt2), /* @__PURE__ */ import_react35.default.createElement(Text, null, line), /* @__PURE__ */ import_react35.default.createElement(Text, { inverse: true }, " ")) : /* @__PURE__ */ import_react35.default.createElement(Text, { dimColor: true }, " (working\u2026)"), /* @__PURE__ */ import_react35.default.createElement(Text, { dimColor: true }, footerText(footer)));
62449
+ return /* @__PURE__ */ import_react35.default.createElement(Box_default, { flexDirection: "column" }, /* @__PURE__ */ import_react35.default.createElement(Static, { items }, (item) => /* @__PURE__ */ import_react35.default.createElement(Text, { key: item.id }, item.content)), live ? /* @__PURE__ */ import_react35.default.createElement(Text, null, live) : null, /* @__PURE__ */ import_react35.default.createElement(Text, { dimColor: true }, "\u2500".repeat(Math.max(1, (process.stdout.columns || 80) - 1))), inputEnabled ? /* @__PURE__ */ import_react35.default.createElement(Box_default, null, /* @__PURE__ */ import_react35.default.createElement(Text, null, prompt2), /* @__PURE__ */ import_react35.default.createElement(Text, null, line), /* @__PURE__ */ import_react35.default.createElement(Text, { inverse: true }, " ")) : /* @__PURE__ */ import_react35.default.createElement(Text, { dimColor: true }, " (working\u2026)"), /* @__PURE__ */ import_react35.default.createElement(Text, { dimColor: true }, footerText(footer)));
62410
62450
  };
62411
62451
  function startInkTerminal() {
62412
62452
  if (handle)
@@ -62431,6 +62471,9 @@ function stopInkTerminal() {
62431
62471
  inkInstance = null;
62432
62472
  handle = null;
62433
62473
  }
62474
+ async function flushInkFrame() {
62475
+ await inkInstance?.waitUntilRenderFlush();
62476
+ }
62434
62477
  function getInkTerminal() {
62435
62478
  return handle;
62436
62479
  }
@@ -62476,7 +62519,7 @@ var InkReadlineAdapter = class extends EventEmitter3 {
62476
62519
  };
62477
62520
 
62478
62521
  // src/commands/chat.ts
62479
- var CLI_VERSION = "0.5.44";
62522
+ var CLI_VERSION = "0.5.46";
62480
62523
  var MODEL_LABELS = {
62481
62524
  turbo: "Nexrall Turbo",
62482
62525
  pro: "Nexrall Pro",
@@ -62961,6 +63004,7 @@ Set ${TRUST_ENV_VAR}=1 to confirm non-interactively, or run \`nex\` interactivel
62961
63004
  stopInkTerminal();
62962
63005
  });
62963
63006
  await startInkTerminal();
63007
+ startRowCount();
62964
63008
  }
62965
63009
  if (options.showBanner !== false && !headless) {
62966
63010
  const branch = tryExec("git branch --show-current", workDir);
@@ -63119,6 +63163,10 @@ ${text}` : "");
63119
63163
  }
63120
63164
  console.log(source_default.dim(" Type a message, /help for commands, or Ctrl+C to exit."));
63121
63165
  console.log();
63166
+ if (interactive) {
63167
+ await flushInkFrame();
63168
+ padToBottom(stopRowCount());
63169
+ }
63122
63170
  let agentRunning = false;
63123
63171
  const abortSignal = { aborted: false };
63124
63172
  process.on("SIGINT", () => {
@@ -63923,7 +63971,7 @@ function pluginListCommand() {
63923
63971
 
63924
63972
  // src/index.ts
63925
63973
  var program2 = new Command();
63926
- program2.name("nex").description("Nexrall Code \u2014 AI coding assistant (powered by Nexrall)").version("0.5.44");
63974
+ program2.name("nex").description("Nexrall Code \u2014 AI coding assistant (powered by Nexrall)").version("0.5.46");
63927
63975
  program2.command("auth").description("Login to your Nexrall account").action(authCommand);
63928
63976
  program2.command("logout").description("Log out of your Nexrall account").action(logoutCommand);
63929
63977
  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) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexrall-code",
3
- "version": "0.5.44",
3
+ "version": "0.5.46",
4
4
  "description": "Nexrall Code — AI coding assistant for your terminal (headless agent for scripts, CI and automation)",
5
5
  "keywords": [
6
6
  "ai",