@danhachuel/thunderbolt 0.4.91 → 0.4.92

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/app/main.py CHANGED
@@ -4,12 +4,14 @@ import io
4
4
 
5
5
  os.environ["PYTHONIOENCODING"] = "utf-8"
6
6
  os.environ["PYTHONUTF8"] = "1"
7
+ os.environ["CLICK_NO_WIN_CONSOLE"] = "1"
7
8
 
8
9
  def _force_utf8_stream(stream: object) -> object:
9
10
  buffer = getattr(stream, "buffer", None)
10
- encoding = str(getattr(stream, "encoding", "") or "").lower().replace("-", "_")
11
- if buffer is not None and encoding != "utf_8":
12
- return io.TextIOWrapper(buffer, encoding="utf-8", errors="replace", line_buffering=True)
11
+ if buffer is not None and not getattr(stream, "_thunderbolt_utf8", False):
12
+ wrapped = io.TextIOWrapper(buffer, encoding="utf-8", errors="replace", line_buffering=True)
13
+ setattr(wrapped, "_thunderbolt_utf8", True)
14
+ return wrapped
13
15
  return stream
14
16
 
15
17
  _original_stdout, _original_stderr = sys.stdout, sys.stderr
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danhachuel/thunderbolt",
3
- "version": "0.4.91",
3
+ "version": "0.4.92",
4
4
  "description": "Thunderbolt — interface local para operação de canais faceless e motor MoneyPrinterTurbo",
5
5
  "license": "MIT",
6
6
  "main": "scripts/cli.mjs",
package/scripts/cli.mjs CHANGED
@@ -26,7 +26,7 @@ const venvPython = platform() === "win32" ? join(venvDir, "Scripts", "python.exe
26
26
  const python = process.env.THUNDERBOLT_PYTHON || process.env.HERMES_PYTHON || (existsSync(venvPython) ? venvPython : (platform() === "win32" ? "python" : "python3"));
27
27
  const main = resolve(root, "app", "main.py");
28
28
  const settingsPath = join(thunderboltHome, "storage", "state", "settings.json");
29
- const pythonEnvironment = { ...process.env, PYTHONIOENCODING: "utf-8", PYTHONUTF8: "1" };
29
+ const pythonEnvironment = { ...process.env, PYTHONIOENCODING: "utf-8", PYTHONUTF8: "1", CLICK_NO_WIN_CONSOLE: "1" };
30
30
 
31
31
  function run(command, commandArgs, label = "comando", environment = process.env) {
32
32
  console.log(`Thunderbolt: a iniciar ${label}...`);
@@ -155,6 +155,7 @@ const runtimeEnv = {
155
155
  ...process.env,
156
156
  PYTHONIOENCODING: "utf-8",
157
157
  PYTHONUTF8: "1",
158
+ CLICK_NO_WIN_CONSOLE: "1",
158
159
  THUNDERBOLT_STORAGE_DIR: storageDir,
159
160
  STREAMLIT_BROWSER_GATHER_USAGE_STATS: "false",
160
161
  STREAMLIT_SERVER_HEADLESS: "true",
@@ -257,7 +258,7 @@ function startStreamlit() {
257
258
  child = spawn(python, ["-m", "streamlit", "run", main, "--server.port", String(backendPort), "--server.address", "127.0.0.1"], {
258
259
  cwd: root,
259
260
  stdio: "inherit",
260
- env: { ...runtimeEnv, PYTHONIOENCODING: "utf-8", PYTHONUTF8: "1", THUNDERBOLT_LAUNCHER_RESTART: "1" },
261
+ env: { ...runtimeEnv, PYTHONIOENCODING: "utf-8", PYTHONUTF8: "1", CLICK_NO_WIN_CONSOLE: "1", THUNDERBOLT_LAUNCHER_RESTART: "1" },
261
262
  windowsHide: false,
262
263
  });
263
264
  child.on("error", (error) => {
@@ -42,7 +42,7 @@ const defaultMpt = process.env.MONEYPRINTER_PATH || join(thunderboltHome, "Money
42
42
  const dependencyStatePath = join(thunderboltHome, "storage", "state", "install-state.json");
43
43
  const forceDeps = args.includes("--force-deps");
44
44
  const refreshMoneyPrinter = args.includes("--refresh-moneyprinter");
45
- const pythonEnvironment = { ...process.env, PYTHONIOENCODING: "utf-8", PYTHONUTF8: "1" };
45
+ const pythonEnvironment = { ...process.env, PYTHONIOENCODING: "utf-8", PYTHONUTF8: "1", CLICK_NO_WIN_CONSOLE: "1" };
46
46
 
47
47
  function legacyRoots() {
48
48
  const userProfile = process.env.USERPROFILE || home;