zames_pro 2.22.0 → 2.24.0
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/dist/agent-loop.js +9 -0
- package/dist/i18n.js +4 -0
- package/dist/index.js +8 -0
- package/dist/input.js +6 -0
- package/dist/spinner.js +5 -0
- package/package.json +1 -1
package/dist/agent-loop.js
CHANGED
|
@@ -561,6 +561,15 @@ export async function runAgentLoop({ browser, tools, task, workdir, maxIteration
|
|
|
561
561
|
result: String(result),
|
|
562
562
|
});
|
|
563
563
|
results.push({ tool: call.tool, result });
|
|
564
|
+
// The operator pressed Esc/Ctrl+C while the tool was running. The tool
|
|
565
|
+
// itself has finished (we cannot kill an arbitrary child process from
|
|
566
|
+
// here), but we must NOT feed its result back to the model and must NOT
|
|
567
|
+
// run the remaining calls in this batch — that would keep the agent
|
|
568
|
+
// going after an explicit stop.
|
|
569
|
+
if (browser._abort || browser._stopped) {
|
|
570
|
+
transcript?.log('user_aborted');
|
|
571
|
+
return '(прервано пользователем)';
|
|
572
|
+
}
|
|
564
573
|
}
|
|
565
574
|
// A tool just ran — the next answer is expected to be a fresh tool call.
|
|
566
575
|
// Reset the watchdog so the next empty/repeated answer is nudged.
|
package/dist/i18n.js
CHANGED
|
@@ -354,6 +354,10 @@ const CATALOG = {
|
|
|
354
354
|
ru: '⏳ пауза {n}с перед отправкой',
|
|
355
355
|
en: '⏳ pause {n}s before send',
|
|
356
356
|
},
|
|
357
|
+
'spinner.running_tool': {
|
|
358
|
+
ru: '⚙ выполняю {name}',
|
|
359
|
+
en: '⚙ running {name}',
|
|
360
|
+
},
|
|
357
361
|
'editor.more': { ru: '…ещё {n}', en: '…{n} more' },
|
|
358
362
|
'editor.answer': { ru: '● Ответ', en: '● Answer' },
|
|
359
363
|
// ---------- status ----------
|
package/dist/index.js
CHANGED
|
@@ -871,6 +871,12 @@ async function runTask(browser, tools, taskText, workdir, opts, attachments = []
|
|
|
871
871
|
browser._stopped = false;
|
|
872
872
|
browser._abort = false;
|
|
873
873
|
const ui = editor || mod.createSpinner(currentLocale);
|
|
874
|
+
// Mark the editor busy for the WHOLE task, not only for /init and /self-fix.
|
|
875
|
+
// Esc / Ctrl+C abort the current generation only while busy; without this a
|
|
876
|
+
// long-running tool (Bash, npm, MCP) could not be interrupted — Esc did
|
|
877
|
+
// nothing. Cleared in the finally below.
|
|
878
|
+
if (editor)
|
|
879
|
+
editor.busy = true;
|
|
874
880
|
const stopWatching = editor
|
|
875
881
|
? () => { }
|
|
876
882
|
: watchInput({
|
|
@@ -971,6 +977,8 @@ async function runTask(browser, tools, taskText, workdir, opts, attachments = []
|
|
|
971
977
|
finally {
|
|
972
978
|
stopWatching();
|
|
973
979
|
ui.stop();
|
|
980
|
+
if (editor)
|
|
981
|
+
editor.busy = false;
|
|
974
982
|
// Detach the send hooks so a later browser.ask() outside this task cannot
|
|
975
983
|
// start a stale spinner.
|
|
976
984
|
browser.onSendStart = null;
|
package/dist/input.js
CHANGED
|
@@ -761,8 +761,14 @@ export class LineEditor {
|
|
|
761
761
|
toolCall(name, args) {
|
|
762
762
|
const preview = safeJson(args).slice(0, 120);
|
|
763
763
|
this.printAbove(theme.tool('🔧 ' + name) + ' ' + theme.dim(preview));
|
|
764
|
+
// A tool may run for a long time (Bash, npm test, MCP). Without an active
|
|
765
|
+
// animation the operator sees a frozen screen and cannot tell work is in
|
|
766
|
+
// progress. Start the animated status AFTER printAbove (which stops the
|
|
767
|
+
// dots) and keep it running until toolResult()/assistant()/stop().
|
|
768
|
+
this._startAnimated(translate(this.locale)('spinner.running_tool', { name }));
|
|
764
769
|
}
|
|
765
770
|
toolResult(result) {
|
|
771
|
+
this.stop();
|
|
766
772
|
const text = typeof result === 'string' ? result : safeJson(result);
|
|
767
773
|
const preview = text.slice(0, 200).split(NL).join(' ↵ ');
|
|
768
774
|
this.printAbove(theme.toolResult(' → ' + preview));
|
package/dist/spinner.js
CHANGED
|
@@ -129,6 +129,11 @@ export function createSpinner(locale = 'ru') {
|
|
|
129
129
|
stop();
|
|
130
130
|
const preview = JSON.stringify(args).slice(0, 120);
|
|
131
131
|
console.log(theme.tool('🔧 ' + name), theme.dim(preview));
|
|
132
|
+
// Keep an animated status while the tool runs (Bash/npm/MCP can take a
|
|
133
|
+
// long time): the operator must see that work is in progress.
|
|
134
|
+
if (pending)
|
|
135
|
+
return;
|
|
136
|
+
startAnimated(translate(locale)('spinner.running_tool', { name }));
|
|
132
137
|
},
|
|
133
138
|
toolResult: (result) => {
|
|
134
139
|
stop();
|