nexrall-code 0.5.80 → 0.5.82

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 +67 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -54619,6 +54619,12 @@ function padVis(s2, n) {
54619
54619
  const pad = n - visibleLen(s2);
54620
54620
  return pad > 0 ? s2 + " ".repeat(pad) : s2;
54621
54621
  }
54622
+ function ruleWidth(max = 50, columns = process.stdout.columns || 80) {
54623
+ const MIN = 20;
54624
+ const indent = 2;
54625
+ const available = columns - indent;
54626
+ return Math.max(MIN, Math.min(max, available));
54627
+ }
54622
54628
  var MarkdownStreamRenderer = class {
54623
54629
  _buf = "";
54624
54630
  // incomplete trailing chunk
@@ -54660,7 +54666,7 @@ var MarkdownStreamRenderer = class {
54660
54666
  this._buf = "";
54661
54667
  }
54662
54668
  if (this._inCode) {
54663
- console.log(source_default.dim(" \u2514" + "\u2500".repeat(48)));
54669
+ console.log(source_default.dim(" \u2514" + "\u2500".repeat(ruleWidth(48))));
54664
54670
  this._inCode = false;
54665
54671
  }
54666
54672
  this._flushTable();
@@ -54713,10 +54719,10 @@ var MarkdownStreamRenderer = class {
54713
54719
  this._inCode = true;
54714
54720
  this._codeLang = raw.slice(3).trim();
54715
54721
  const label = this._codeLang ? source_default.dim(` ${this._codeLang}`) : "";
54716
- console.log("\n" + source_default.dim(" \u250C" + "\u2500".repeat(48)) + label);
54722
+ console.log("\n" + source_default.dim(" \u250C" + "\u2500".repeat(ruleWidth(48))) + label);
54717
54723
  } else {
54718
54724
  this._inCode = false;
54719
- console.log(source_default.dim(" \u2514" + "\u2500".repeat(48)) + "\n");
54725
+ console.log(source_default.dim(" \u2514" + "\u2500".repeat(ruleWidth(48))) + "\n");
54720
54726
  }
54721
54727
  return;
54722
54728
  }
@@ -54735,7 +54741,7 @@ var MarkdownStreamRenderer = class {
54735
54741
  }
54736
54742
  this._flushTable();
54737
54743
  if (/^[-*_]{3,}\s*$/.test(raw)) {
54738
- console.log("\n" + source_default.dim(" " + "\u2500".repeat(50)) + "\n");
54744
+ console.log("\n" + source_default.dim(" " + "\u2500".repeat(ruleWidth(50))) + "\n");
54739
54745
  return;
54740
54746
  }
54741
54747
  if (raw.startsWith("#### ")) {
@@ -64824,6 +64830,36 @@ function askForTrust(workDir, signals) {
64824
64830
 
64825
64831
  // src/ui/inkTerminal.tsx
64826
64832
  var import_react35 = __toESM(require_react(), 1);
64833
+
64834
+ // src/ui/resizeRepaint.ts
64835
+ var defaultDeps = {
64836
+ setTimeout: (fn, ms) => setTimeout(fn, ms),
64837
+ clearTimeout: (handle2) => clearTimeout(handle2)
64838
+ };
64839
+ function createResizeDebouncer(settleMs, onSettle, deps = defaultDeps) {
64840
+ let timer = null;
64841
+ let disposed = false;
64842
+ const notify = () => {
64843
+ if (disposed)
64844
+ return;
64845
+ if (timer !== null)
64846
+ deps.clearTimeout(timer);
64847
+ timer = deps.setTimeout(() => {
64848
+ timer = null;
64849
+ onSettle();
64850
+ }, settleMs);
64851
+ };
64852
+ const dispose = () => {
64853
+ disposed = true;
64854
+ if (timer !== null) {
64855
+ deps.clearTimeout(timer);
64856
+ timer = null;
64857
+ }
64858
+ };
64859
+ return { notify, dispose };
64860
+ }
64861
+
64862
+ // src/ui/inkTerminal.tsx
64827
64863
  function footerText(info) {
64828
64864
  const modeLabel = info.autoApprove ? "yolo mode on" : info.mode === "plan" ? "plan mode on" : info.mode === "edit" ? "edit mode on" : info.mode === "ask" ? "ask mode on" : "auto mode on";
64829
64865
  return `${modeLabel} \xB7 /help for shortcuts \xB7 /agents for agents`;
@@ -64898,6 +64934,19 @@ function decideCtrlC(state) {
64898
64934
  var handle = null;
64899
64935
  var inkInstance = null;
64900
64936
  var idCounter = 0;
64937
+ var resizeDebouncer = null;
64938
+ var resizeListenerAttached = false;
64939
+ var RESIZE_SETTLE_MS = 120;
64940
+ function repaintAfterResizeSettle() {
64941
+ const instance = inkInstance;
64942
+ if (!instance || !process.stdout.isTTY)
64943
+ return;
64944
+ void instance.waitUntilRenderFlush().then(() => {
64945
+ if (inkInstance !== instance)
64946
+ return;
64947
+ process.stdout.write("\x1B[0J");
64948
+ });
64949
+ }
64901
64950
  var DEFAULT_PROMPT = colors.primary.bold("> ");
64902
64951
  var App2 = ({ onReady }) => {
64903
64952
  const [items, setItems] = (0, import_react35.useState)([]);
@@ -65113,6 +65162,7 @@ function startInkTerminal() {
65113
65162
  {
65114
65163
  onReady: (h2) => {
65115
65164
  handle = h2;
65165
+ attachResizeCleanup();
65116
65166
  resolve3(h2);
65117
65167
  }
65118
65168
  }
@@ -65150,7 +65200,20 @@ function startInkTerminal() {
65150
65200
  );
65151
65201
  });
65152
65202
  }
65203
+ function attachResizeCleanup() {
65204
+ if (resizeListenerAttached || !process.stdout.isTTY)
65205
+ return;
65206
+ resizeListenerAttached = true;
65207
+ resizeDebouncer = createResizeDebouncer(RESIZE_SETTLE_MS, repaintAfterResizeSettle);
65208
+ process.stdout.on("resize", resizeDebouncer.notify);
65209
+ }
65153
65210
  function stopInkTerminal() {
65211
+ if (resizeDebouncer) {
65212
+ process.stdout.off("resize", resizeDebouncer.notify);
65213
+ resizeDebouncer.dispose();
65214
+ resizeDebouncer = null;
65215
+ }
65216
+ resizeListenerAttached = false;
65154
65217
  inkInstance?.unmount();
65155
65218
  inkInstance = null;
65156
65219
  handle = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexrall-code",
3
- "version": "0.5.80",
3
+ "version": "0.5.82",
4
4
  "description": "Nexrall Code — AI coding assistant for your terminal (headless agent for scripts, CI and automation)",
5
5
  "keywords": [
6
6
  "ai",