@danhachuel/thunderbolt 0.5.83 → 0.5.84

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.
@@ -268,6 +268,20 @@ def _update(task_id: str, **updates: Any) -> dict[str, Any]:
268
268
  if str(current.get("state") or "") in {"blocked", "cancelled"}:
269
269
  raise PipelineStopped("A tarefa foi parada pelo utilizador.")
270
270
  updates = dict(updates)
271
+ if "progress" in updates:
272
+ try:
273
+ previous_progress = max(0, min(100, int(current.get("progress") or 0)))
274
+ except (TypeError, ValueError):
275
+ previous_progress = 0
276
+ try:
277
+ requested_progress = max(0, min(100, int(updates.get("progress") or 0)))
278
+ except (TypeError, ValueError):
279
+ requested_progress = previous_progress
280
+ # A geração pode ser retomada a partir de um checkpoint avançado,
281
+ # enquanto o subprocesso expõe uma faixa própria para a etapa actual.
282
+ # Nunca deixar a percentagem persistida recuar evita a oscilação visual
283
+ # e mantém o card fiel ao maior avanço já confirmado.
284
+ updates["progress"] = max(previous_progress, requested_progress)
271
285
  updates["orchestration"] = _cascade_metadata(current, updates)
272
286
  updated = update_task(task_id, updates)
273
287
  if not updated:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danhachuel/thunderbolt",
3
- "version": "0.5.83",
3
+ "version": "0.5.84",
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",