terminal-smart-cli 0.97.57 → 0.97.58
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/lib/agent.js +5 -1
- package/lib/tools.js +3 -1
- package/package.json +1 -1
package/lib/agent.js
CHANGED
|
@@ -581,7 +581,11 @@ RULES:
|
|
|
581
581
|
- RESPONSE STYLE (important): write in NATURAL, plain language, like explaining to a person — avoid jargon and internal technical detail that doesn't matter to someone who just wants the result. NO decorative emojis (no 🎮📡🔬✅❌ etc.); to mark pass/fail use ONLY the symbols ✓ (worked) or ✗ (failed). Short sentences; commands/code/paths always in a code block. Don't repeat what already showed up in the steps above.
|
|
582
582
|
- ALWAYS end with a short summary: what was done, the result, and paths of created/changed files.
|
|
583
583
|
- Answer in the user's language.`);
|
|
584
|
-
|
|
584
|
+
// os.userInfo pode falhar em hosts sob pressão de memória. O contexto da
|
|
585
|
+
// máquina é auxiliar; nunca deve impedir uma missão de continuar.
|
|
586
|
+
let userName = process.env.USERNAME || process.env.USER || 'desconhecido';
|
|
587
|
+
try { userName = os.userInfo().username || userName; } catch (_) {}
|
|
588
|
+
const volatile = `\n\nMáquina: ${process.platform} ${os.release()} · host ${os.hostname()} · user ${userName}`
|
|
585
589
|
+ `\nDIRETÓRIO DE TRABALHO (obrigatório): ${wd}`;
|
|
586
590
|
return stable + volatile;
|
|
587
591
|
}
|
package/lib/tools.js
CHANGED
|
@@ -972,8 +972,10 @@ async function execute(name, input, opts = {}) {
|
|
|
972
972
|
} catch (e) { return { erro: 'busca falhou: ' + String((e && e.message) || e).slice(0, 200) }; }
|
|
973
973
|
}
|
|
974
974
|
case 'info_sistema': {
|
|
975
|
+
let usuario = process.env.USERNAME || process.env.USER || 'desconhecido';
|
|
976
|
+
try { usuario = os.userInfo().username || usuario; } catch (_) {}
|
|
975
977
|
return {
|
|
976
|
-
so: `${process.platform} ${os.release()}`, host: os.hostname(), usuario
|
|
978
|
+
so: `${process.platform} ${os.release()}`, host: os.hostname(), usuario,
|
|
977
979
|
diretorio_atual: baseDir, home: os.homedir(),
|
|
978
980
|
cpus: os.cpus().length, mem_total_gb: +(os.totalmem() / 1e9).toFixed(1), mem_livre_gb: +(os.freemem() / 1e9).toFixed(1),
|
|
979
981
|
uptime_h: +(os.uptime() / 3600).toFixed(1), node: process.version,
|