@danhachuel/thunderbolt 0.5.75 → 0.5.77

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
@@ -4798,6 +4798,14 @@ def _render_video_task_state(task: dict[str, Any]) -> None:
4798
4798
  st.caption(f"Manifesto: {task.get('video_result')}")
4799
4799
 
4800
4800
 
4801
+ def _start_pipeline_task(task_id: str, state: str) -> None:
4802
+ """Start or retry a video task from any platform automation card."""
4803
+ if state in {"blocked", "failed"}:
4804
+ retry_task_with_current_settings(task_id)
4805
+ else:
4806
+ transition_task(task_id, "doing")
4807
+
4808
+
4801
4809
  def render_videos():
4802
4810
  st.subheader("Backlog Videos")
4803
4811
  st.caption("Acompanhamento dos vídeos criados, estados da pipeline e controlos de execução.")
@@ -4854,7 +4862,7 @@ def render_videos():
4854
4862
  start_col, stop_col = st.columns(2)
4855
4863
  with start_col:
4856
4864
  if st.button("Start", key=f"automation_start_{task['id']}", use_container_width=True, disabled=state not in {"to_do", "blocked", "failed"}):
4857
- transition_task(task["id"], "doing")
4865
+ _start_pipeline_task(str(task["id"]), state)
4858
4866
  st.rerun()
4859
4867
  with stop_col:
4860
4868
  if st.button("Stop", key=f"automation_stop_{task['id']}", use_container_width=True, disabled=state != "doing"):
@@ -5236,7 +5244,7 @@ def render_tiktok_automation():
5236
5244
  with cols[3]:
5237
5245
  state = str(task.get("state") or "")
5238
5246
  if st.button("Start", key=f"tiktok_automation_start_{task_id}", disabled=state not in {"to_do", "blocked", "failed"}, use_container_width=True):
5239
- retry_task_with_current_settings(task_id) if state in {"blocked", "failed"} else transition_task(task_id, "doing")
5247
+ _start_pipeline_task(task_id, state)
5240
5248
  st.rerun()
5241
5249
  if st.button("Stop", key=f"tiktok_automation_stop_{task_id}", disabled=state != "doing", use_container_width=True):
5242
5250
  stop_task_by_user(task_id)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danhachuel/thunderbolt",
3
- "version": "0.5.75",
3
+ "version": "0.5.77",
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
@@ -79,7 +79,9 @@ function hasScheduledAutomation() {
79
79
 
80
80
  function hasPendingPipelineWork() {
81
81
  const tasks = readStateJson("tasks.json", []);
82
- return Array.isArray(tasks) && tasks.some((task) => ["queued", "pending", "processing", "running", "in_progress"].includes(String(task?.state || task?.status || "").toLowerCase()));
82
+ // A UI Start coloca a tarefa em `doing`; `to_do` também é consumido pelo
83
+ // pipeline worker. Estes estados não dependem de automação de canal activa.
84
+ return Array.isArray(tasks) && tasks.some((task) => ["to_do", "doing"].includes(String(task?.state || task?.status || "").toLowerCase()));
83
85
  }
84
86
 
85
87
  function ensureRuntimeStorage() {