@danhachuel/thunderbolt 0.5.44 → 0.5.45

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danhachuel/thunderbolt",
3
- "version": "0.5.44",
3
+ "version": "0.5.45",
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",
@@ -433,13 +433,17 @@ function installRequirementIfNeeded(requirementsPath, stateKey, modules, label)
433
433
  const state = readDependencyState();
434
434
  const importsOk = importsAvailable(modules);
435
435
  const hashMatches = state[stateKey] === currentHash;
436
- if (!forceDeps && importsOk && (hashMatches || !state[stateKey])) {
436
+ const markerPath = join(venvPath, `.${stateKey}.sha256`);
437
+ const markerHash = existsSync(markerPath) ? readFileSync(markerPath, "utf8").trim() : "";
438
+ const persistedHashMatches = hashMatches || markerHash === currentHash;
439
+ if (!forceDeps && importsOk && persistedHashMatches) {
437
440
  console.log(`${label}: dependências detectadas e reutilizadas; nenhuma reinstalação necessária.`);
438
441
  writeDependencyState({ [stateKey]: currentHash });
439
442
  return;
440
443
  }
441
444
  console.log(`${label}: dependências ausentes, incompletas ou alteradas; a instalar agora.`);
442
445
  run(pythonBin, ["-m", "pip", "install", "-r", requirementsPath]);
446
+ writeFileSync(markerPath, `${currentHash}\n`, "utf8");
443
447
  writeDependencyState({ [stateKey]: currentHash });
444
448
  }
445
449
 
@@ -461,7 +465,7 @@ function writeSettings(moneyprinterPath) {
461
465
 
462
466
  function installThunderboltDependencies(python) {
463
467
  if (!existsSync(pythonBin)) run(python.command, [...python.args, "-m", "venv", venvPath]);
464
- installRequirementIfNeeded(join(root, "requirements.txt"), "thunderbolt_requirements_sha256", ["streamlit", "requests", "pandas", "toml", "imageio_ffmpeg", "edge_tts", "google.auth", "google_auth_oauthlib", "googleapiclient"], "Thunderbolt");
468
+ installRequirementIfNeeded(join(root, "requirements.txt"), "thunderbolt_requirements_sha256", ["streamlit", "requests", "pandas", "toml", "imageio_ffmpeg", "edge_tts", "google.auth", "google_auth_oauthlib", "googleapiclient", "yt_dlp", "youtube_transcript_api"], "Thunderbolt");
465
469
  }
466
470
 
467
471
  function installMoneyPrinterDependencies(moneyprinterPath) {