terminal-smart-cli 0.89.0 → 0.90.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/bin/ts.js +9 -2
- package/package.json +1 -1
package/bin/ts.js
CHANGED
|
@@ -836,6 +836,13 @@ async function agentCmd(words, { askFn, cwd: cwdIn = null, onCwd = null } = {})
|
|
|
836
836
|
if (_v) { const j = words.indexOf(_v); if (j >= 0) words = words.slice(0, j).concat(words.slice(j + 1)); }
|
|
837
837
|
}
|
|
838
838
|
let task = words.join(' ').trim();
|
|
839
|
+
// Flags INLINE no texto (pro REPL, onde não há argv): --passos N / --steps N / --yolo.
|
|
840
|
+
// Assim "faça tudo ... --passos 60 --yolo" digitado no chat vale igual à linha de comando.
|
|
841
|
+
let _inlinePassos, _inlineYolo = false;
|
|
842
|
+
task = task
|
|
843
|
+
.replace(/(?:^|\s)--(?:passos|steps|max-passos)[\s=]+(\d{1,3})\b/gi, (_m, n) => { _inlinePassos = Number(n); return ' '; })
|
|
844
|
+
.replace(/(?:^|\s)--(?:yolo|full-auto|auto-tudo)\b/gi, () => { _inlineYolo = true; return ' '; })
|
|
845
|
+
.replace(/\s{2,}/g, ' ').trim();
|
|
839
846
|
const piped = await readStdin();
|
|
840
847
|
if (piped) task = (task || (cfg.lang === 'en' ? 'Analyze the input below and act on it.' : 'Analise a entrada abaixo e aja sobre ela.'))
|
|
841
848
|
+ `\n\n${T.pipe_ctx}:\n\`\`\`\n${piped.slice(0, 30000)}\n\`\`\``;
|
|
@@ -905,9 +912,9 @@ async function agentCmd(words, { askFn, cwd: cwdIn = null, onCwd = null } = {})
|
|
|
905
912
|
// --passos N (ou --steps): quantas iterações o agente pode fazer numa run (default 15, teto 120).
|
|
906
913
|
// Pra missões grandes ("faça tudo de uma vez") sem o pára-e-continua.
|
|
907
914
|
const _pi = process.argv.findIndex(a => a === '--passos' || a === '--steps' || a === '--max-passos');
|
|
908
|
-
const _maxPassos = _pi >= 0 ? Number(process.argv[_pi + 1]) :
|
|
915
|
+
const _maxPassos = _pi >= 0 ? Number(process.argv[_pi + 1]) : _inlinePassos;
|
|
909
916
|
out = await agent.run(task, {
|
|
910
|
-
token, lang: cfg.lang || 'pt', yes: YES, autoAll: YOLO, model, priorMessages, cwd: startCwd, readOnly, plan, browser: useBrowser, maxIter: _maxPassos,
|
|
917
|
+
token, lang: cfg.lang || 'pt', yes: YES, autoAll: (YOLO || _inlineYolo), model, priorMessages, cwd: startCwd, readOnly, plan, browser: useBrowser, maxIter: _maxPassos,
|
|
911
918
|
onThinking: (p) => {
|
|
912
919
|
if (p && typeof p === 'object') {
|
|
913
920
|
_live.steps = p.steps ?? _live.steps; _live.inTok = p.inTok ?? _live.inTok; _live.outTok = p.outTok ?? _live.outTok;
|