terminal-smart-cli 0.82.0 → 0.83.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.
Files changed (2) hide show
  1. package/lib/ui.js +12 -3
  2. package/package.json +1 -1
package/lib/ui.js CHANGED
@@ -79,15 +79,24 @@ function _wrapLine(line, w) {
79
79
  return rows;
80
80
  }
81
81
 
82
+ // Emoji/símbolo colado no texto ("✅Sim" → "✅ Sim"): o modelo às vezes esquece o espaço.
83
+ // Insere UM espaço entre um emoji/checkmark e a letra/número que vem grudado. Determinístico.
84
+ function _spaceAfterEmoji(s) {
85
+ return String(s).replace(
86
+ /([✅❌✔✖✓✗☑☒⚠❗❓✨⭐\u{1F000}-\u{1FAFF}\u{2600}-\u{26FF}])(?=[\p{L}\p{N}])/gu,
87
+ '$1 ');
88
+ }
89
+
82
90
  // Markdown-lite: negrito, código inline, blocos de código com borda, títulos, listas.
83
91
  // wrapW = largura pra word-wrap do texto (não quebra dentro de bloco de código).
84
92
  function md(text, wrapW) {
85
- if (!TTY) return String(text);
93
+ const src = _spaceAfterEmoji(String(text)); // espaço emoji↔texto SEMPRE (é conteúdo, não cor)
94
+ if (!TTY) return src;
86
95
  const w = Math.max(24, (wrapW || _width()) - 2);
87
96
  const out = [];
88
- const lines = String(text).split('\n');
97
+ const lines = src.split('\n');
89
98
  let inCode = false;
90
- for (const line of lines) {
99
+ for (let line of lines) {
91
100
  if (/^\s*```/.test(line)) { inCode = !inCode; out.push(C.dim(' ' + (inCode ? '╭──' : '╰──'))); continue; }
92
101
  if (inCode) { out.push(C.dim(' │ ') + C.cyan(line)); continue; }
93
102
  // word-wrap ANTES de colorir (o ANSI de negrito/código não muda a largura visível)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "terminal-smart-cli",
3
- "version": "0.82.0",
3
+ "version": "0.83.0",
4
4
  "description": "Terminal Smart no seu terminal — pergunte, analise logs por pipe e orquestre agentes de IA. Comando: ts",
5
5
  "bin": {
6
6
  "ts": "bin/ts.js"