feat: corrigido encoding UTF-8 nos spawns de Python do painel CEP

- corrigido encoding UTF-8 nos spawns de Python do painel CEP para exibir caracteres acentuados corretamente
- corrigido copiar erro técnico: forçado pbcopy com encoding utf-8 em vez de navigator.clipboard que corrompia caracteres

Resumo:
- 2 arquivos alterados
- 0 novos
- 2 modificados
- 0 removidos

 2 files changed, 8 insertions(+), 12 deletions(-)

Arquivos:
  - code/cep-plugin/main.js
  - code/engine/integracoes/premiere/cliente_mcp.py
This commit is contained in:
João Henrique
2026-09-10 17:51:10 -04:00
parent 0260254e45
commit 4170b32340
2 changed files with 8 additions and 12 deletions
+6 -11
View File
@@ -170,21 +170,16 @@ function taskCopyError() {
var texto = taskState.errorText; var texto = taskState.errorText;
if (!texto) return; if (!texto) return;
try { try {
if (navigator.clipboard && navigator.clipboard.writeText) { var copia = childProcess.spawn("pbcopy");
navigator.clipboard.writeText(texto).then(function () { showToast("ok", "Erro técnico copiado."); }).catch(function () { taskCopyErrorFallback(texto); }); copia.stdin.write(texto, "utf-8");
return; copia.stdin.end();
} showToast("ok", "Erro técnico copiado.");
} catch (_) {} } catch (_) {
taskCopyErrorFallback(texto); taskCopyErrorFallback(texto);
} }
}
function taskCopyErrorFallback(texto) { function taskCopyErrorFallback(texto) {
try {
var copia = childProcess.spawn("pbcopy");
copia.stdin.end(texto);
showToast("ok", "Erro técnico copiado.");
return;
} catch (_) {}
var area = document.createElement("textarea"); var area = document.createElement("textarea");
area.value = texto; area.value = texto;
area.style.position = "fixed"; area.style.position = "fixed";
@@ -63,6 +63,7 @@ class ClienteMCPPorStdio(ClienteMCP):
stdout=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, stderr=subprocess.PIPE,
text=True, text=True,
encoding="utf-8",
bufsize=1, bufsize=1,
) )
self._enviar("initialize", {"protocolVersion": "2025-06-18", "capabilities": {}, "clientInfo": {"name": "engine", "version": "0.1.0"}}) self._enviar("initialize", {"protocolVersion": "2025-06-18", "capabilities": {}, "clientInfo": {"name": "engine", "version": "0.1.0"}})