nexrall-code 0.5.43 → 0.5.45

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 +51 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -53371,6 +53371,45 @@ 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
+ if (filler <= 0)
53389
+ return;
53390
+ console.log("\n".repeat(filler - 1));
53391
+ }
53392
+ var rowCounter = null;
53393
+ function startRowCount() {
53394
+ if (rowCounter)
53395
+ return;
53396
+ const columns = process.stdout.columns || 80;
53397
+ const original = console.log;
53398
+ const state = { rows: 0, original };
53399
+ rowCounter = state;
53400
+ console.log = (...args) => {
53401
+ state.rows += args.length === 0 ? 1 : rowsOccupied(args.map(String).join(" "), columns);
53402
+ original(...args);
53403
+ };
53404
+ }
53405
+ function stopRowCount() {
53406
+ if (!rowCounter)
53407
+ return 0;
53408
+ const { rows, original } = rowCounter;
53409
+ console.log = original;
53410
+ rowCounter = null;
53411
+ return rows;
53412
+ }
53374
53413
  var NEX_LOGO = [
53375
53414
  "\u2588\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2557 \u2588\u2588\u2557",
53376
53415
  "\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 +53454,7 @@ function renderBanner(info) {
53415
53454
  const CHROME = 3 + 4 * PAD;
53416
53455
  const LOGO_W = Math.max(...NEX_LOGO.map(visibleLen));
53417
53456
  const termW = process.stdout.columns || 100;
53418
- const totalW = Math.max(LOGO_W + CHROME + 24, termW);
53457
+ const totalW = Math.max(LOGO_W + CHROME + 24, termW - 1);
53419
53458
  const headerText = `Nexrall Code v${info.version}`;
53420
53459
  const LEFT_W = Math.max(LOGO_W, visibleLen(headerText));
53421
53460
  const RIGHT_W = totalW - CHROME - LEFT_W;
@@ -62406,7 +62445,7 @@ var App2 = ({ onReady }) => {
62406
62445
  import_react35.default.useEffect(() => {
62407
62446
  onReady({ print, setFooter, setLive, askLine, onLine, setInputEnabled, close: () => exit() });
62408
62447
  }, []);
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)));
62448
+ 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
62449
  };
62411
62450
  function startInkTerminal() {
62412
62451
  if (handle)
@@ -62431,6 +62470,9 @@ function stopInkTerminal() {
62431
62470
  inkInstance = null;
62432
62471
  handle = null;
62433
62472
  }
62473
+ async function flushInkFrame() {
62474
+ await inkInstance?.waitUntilRenderFlush();
62475
+ }
62434
62476
  function getInkTerminal() {
62435
62477
  return handle;
62436
62478
  }
@@ -62476,7 +62518,7 @@ var InkReadlineAdapter = class extends EventEmitter3 {
62476
62518
  };
62477
62519
 
62478
62520
  // src/commands/chat.ts
62479
- var CLI_VERSION = "0.5.43";
62521
+ var CLI_VERSION = "0.5.45";
62480
62522
  var MODEL_LABELS = {
62481
62523
  turbo: "Nexrall Turbo",
62482
62524
  pro: "Nexrall Pro",
@@ -62961,6 +63003,7 @@ Set ${TRUST_ENV_VAR}=1 to confirm non-interactively, or run \`nex\` interactivel
62961
63003
  stopInkTerminal();
62962
63004
  });
62963
63005
  await startInkTerminal();
63006
+ startRowCount();
62964
63007
  }
62965
63008
  if (options.showBanner !== false && !headless) {
62966
63009
  const branch = tryExec("git branch --show-current", workDir);
@@ -63119,6 +63162,10 @@ ${text}` : "");
63119
63162
  }
63120
63163
  console.log(source_default.dim(" Type a message, /help for commands, or Ctrl+C to exit."));
63121
63164
  console.log();
63165
+ if (interactive) {
63166
+ await flushInkFrame();
63167
+ padToBottom(stopRowCount());
63168
+ }
63122
63169
  let agentRunning = false;
63123
63170
  const abortSignal = { aborted: false };
63124
63171
  process.on("SIGINT", () => {
@@ -63923,7 +63970,7 @@ function pluginListCommand() {
63923
63970
 
63924
63971
  // src/index.ts
63925
63972
  var program2 = new Command();
63926
- program2.name("nex").description("Nexrall Code \u2014 AI coding assistant (powered by Nexrall)").version("0.5.43");
63973
+ program2.name("nex").description("Nexrall Code \u2014 AI coding assistant (powered by Nexrall)").version("0.5.45");
63927
63974
  program2.command("auth").description("Login to your Nexrall account").action(authCommand);
63928
63975
  program2.command("logout").description("Log out of your Nexrall account").action(logoutCommand);
63929
63976
  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.43",
3
+ "version": "0.5.45",
4
4
  "description": "Nexrall Code — AI coding assistant for your terminal (headless agent for scripts, CI and automation)",
5
5
  "keywords": [
6
6
  "ai",