@iola_adm/iola-cli 0.1.68 → 0.1.69
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.
- package/package.json +1 -1
- package/src/cli.js +12 -4
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -1296,8 +1296,9 @@ function renderAgentInput(state) {
|
|
|
1296
1296
|
clearAgentInputArea(state);
|
|
1297
1297
|
const prompt = "> ";
|
|
1298
1298
|
const lines = state.buffer.split("\n");
|
|
1299
|
-
const inputLines = [`${prompt}${lines[0] || ""}`, ...lines.slice(1)
|
|
1300
|
-
const
|
|
1299
|
+
const inputLines = [`${prompt}${lines[0] || ""}`, ...lines.slice(1)];
|
|
1300
|
+
const statusLine = truncateTerminalLine(` ${buildAgentStatusLine(state)}`);
|
|
1301
|
+
const cwdLine = colorMuted(statusLine);
|
|
1301
1302
|
const menuLines = [];
|
|
1302
1303
|
if (state.slashOpen) {
|
|
1303
1304
|
const matches = currentSlashMatches(state);
|
|
@@ -1311,11 +1312,11 @@ function renderAgentInput(state) {
|
|
|
1311
1312
|
const absoluteIndex = offset + index;
|
|
1312
1313
|
const selected = absoluteIndex === state.selected;
|
|
1313
1314
|
const marker = selected ? ">" : " ";
|
|
1314
|
-
const row = `${marker} ${visibleMatches[index].command.padEnd(24)} ${visibleMatches[index].description}
|
|
1315
|
+
const row = truncateTerminalLine(`${marker} ${visibleMatches[index].command.padEnd(24)} ${visibleMatches[index].description}`);
|
|
1315
1316
|
menuLines.push(selected ? colorSlashSelection(row) : ` ${row.slice(2)}`);
|
|
1316
1317
|
}
|
|
1317
1318
|
const shownTo = Math.min(offset + visibleLimit, matches.length);
|
|
1318
|
-
menuLines.push(` ↑/↓ выбрать • Enter выполнить • Esc закрыть • ${offset + 1}-${shownTo} из ${matches.length}`);
|
|
1319
|
+
menuLines.push(truncateTerminalLine(` ↑/↓ выбрать • Enter выполнить • Esc закрыть • ${offset + 1}-${shownTo} из ${matches.length}`));
|
|
1319
1320
|
}
|
|
1320
1321
|
}
|
|
1321
1322
|
|
|
@@ -1458,6 +1459,13 @@ function buildAgentStatusLine(state) {
|
|
|
1458
1459
|
return `${cwd} | AI: ${kind}${model} (${ai.name})`;
|
|
1459
1460
|
}
|
|
1460
1461
|
|
|
1462
|
+
function truncateTerminalLine(value) {
|
|
1463
|
+
const columns = Math.max(20, Number(output.columns || 100));
|
|
1464
|
+
const text = String(value).replace(/\r?\n/g, " ");
|
|
1465
|
+
if (visibleLength(text) <= columns) return text;
|
|
1466
|
+
return `${text.slice(0, Math.max(0, columns - 1))}…`;
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1461
1469
|
function compactAgentHistory(history) {
|
|
1462
1470
|
if (history.length <= 8) return history;
|
|
1463
1471
|
const summary = history.slice(0, -6)
|