@iola_adm/iola-cli 0.1.51 → 0.1.52
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 +24 -0
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -847,10 +847,13 @@ async function startAgentRawInput() {
|
|
|
847
847
|
continue;
|
|
848
848
|
}
|
|
849
849
|
output.write(`> ${line}\n`);
|
|
850
|
+
const stopActivity = startActivityIndicator("работаю");
|
|
850
851
|
try {
|
|
851
852
|
const shouldExit = await handleAgentLine(line, state);
|
|
853
|
+
stopActivity();
|
|
852
854
|
if (shouldExit) break;
|
|
853
855
|
} catch (error) {
|
|
856
|
+
stopActivity();
|
|
854
857
|
console.error(error instanceof Error ? error.message : String(error));
|
|
855
858
|
}
|
|
856
859
|
render();
|
|
@@ -1336,6 +1339,27 @@ function clearAgentInputArea(state = null) {
|
|
|
1336
1339
|
if (state) state.renderedInputLines = 0;
|
|
1337
1340
|
}
|
|
1338
1341
|
|
|
1342
|
+
function startActivityIndicator(label = "работаю") {
|
|
1343
|
+
if (!output.isTTY || process.env.NO_COLOR === "1") {
|
|
1344
|
+
output.write(`${label}...\n`);
|
|
1345
|
+
return () => {};
|
|
1346
|
+
}
|
|
1347
|
+
const frames = ["|", "/", "-", "\\"];
|
|
1348
|
+
const started = Date.now();
|
|
1349
|
+
let index = 0;
|
|
1350
|
+
const render = () => {
|
|
1351
|
+
const seconds = ((Date.now() - started) / 1000).toFixed(1);
|
|
1352
|
+
output.write(`\r\x1b[2K${colorMuted(`${frames[index % frames.length]} ${label} ${seconds}s`)}`);
|
|
1353
|
+
index += 1;
|
|
1354
|
+
};
|
|
1355
|
+
render();
|
|
1356
|
+
const timer = setInterval(render, 120);
|
|
1357
|
+
return () => {
|
|
1358
|
+
clearInterval(timer);
|
|
1359
|
+
output.write("\r\x1b[2K");
|
|
1360
|
+
};
|
|
1361
|
+
}
|
|
1362
|
+
|
|
1339
1363
|
function colorSlashSelection(row) {
|
|
1340
1364
|
if (!output.isTTY || process.env.NO_COLOR === "1") return row;
|
|
1341
1365
|
return `\x1b[38;5;213m${row}\x1b[0m`;
|