@iola_adm/iola-cli 0.1.70 → 0.1.71

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/package.json +1 -1
  2. package/src/cli.js +8 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iola_adm/iola-cli",
3
- "version": "0.1.70",
3
+ "version": "0.1.71",
4
4
  "description": "CLI и AI-агент городского округа Йошкар-Ола.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/adm-iola/iola-cli#readme",
package/src/cli.js CHANGED
@@ -766,7 +766,7 @@ async function startAgentReadline() {
766
766
  }
767
767
 
768
768
  async function startAgentRawInput() {
769
- const state = { history: [], buffer: "", selected: 0, slashOffset: 0, slashOpen: false, running: false, renderedInputLines: 0, rawMode: true, pendingOutput: "", aiStatus: null };
769
+ const state = { history: [], buffer: "", selected: 0, slashOffset: 0, slashOpen: false, running: false, renderedInputLines: 0, renderedLines: 0, rawMode: true, pendingOutput: "", aiStatus: null };
770
770
  const wasRaw = input.isRaw;
771
771
  activateRawInput(input);
772
772
 
@@ -1330,14 +1330,18 @@ function renderAgentInput(state) {
1330
1330
  output.write(`\x1b[${cursorColumn + 1}G`);
1331
1331
  }
1332
1332
  state.renderedInputLines = inputLines.length;
1333
+ state.renderedLines = renderedLines.length;
1333
1334
  }
1334
1335
 
1335
1336
  function clearAgentInputArea(state = null) {
1336
1337
  if (!output.isTTY) return;
1337
- const inputLines = Math.max(1, Number(state?.renderedInputLines || 1));
1338
- if (inputLines > 1) output.write(`\x1b[${inputLines - 1}A`);
1338
+ const renderedLines = Math.max(1, Number(state?.renderedLines || state?.renderedInputLines || 1));
1339
+ if (renderedLines > 1) output.write(`\x1b[${renderedLines - 1}A`);
1339
1340
  output.write("\r\x1b[0J");
1340
- if (state) state.renderedInputLines = 0;
1341
+ if (state) {
1342
+ state.renderedInputLines = 0;
1343
+ state.renderedLines = 0;
1344
+ }
1341
1345
  }
1342
1346
 
1343
1347
  function startActivityIndicator(label = "работаю") {