Skip to content

Latest commit

 

History

History
181 lines (168 loc) · 12.1 KB

File metadata and controls

181 lines (168 loc) · 12.1 KB

2026-06-25 21:08 — DarkDM

Summary: ✅ feat-003 COMPLETADO. Implementado DarkDM SDK completo: page analyzer (detecta


2026-06-25 11:42 — DarkDM

Summary: Implementado disk space check + auto-rename. disk_space.rs usa libc::statvfs para verificar espacio disponible antes de descargar (Linux). auto_rename.rs evita sobrescribir archivos existentes (file.mp4 → file (1).mp4, soporta multi-ext .tar.gz). Auto-rename se aplica ANTES del check resumable para cubrir ambos paths (multi-threaded y single-threaded). 22 tests pasando (+3 nuevos). CLI verificado: auto-rename funcional (102400 → 102400 (1) → 102400 (2)). Commit f577229 pushed. Verified: cargo test --lib (22/22 passed), cargo build --release successful, CLI functional test (auto-rename verified with 3 sequential downloads), ./init.sh passes Completed: none


2026-06-25 11:20 — DarkDM

Summary: Implementado multi-threaded download loop. download_loop() polling is_complete() cada 100ms. spawn_worker() crea tasks con tokio::spawn. EngineCallback auto-spawns nuevos workers en on_piece_complete() cuando try_create_piece() retorna nuevo ID. Flow: download() → download_loop() → spawn_worker() → on_piece_complete() → try_create_piece() → spawn_worker() → repeat hasta is_complete(). EngineCallback ahora tiene url + output_path para self-contained spawning. 19 tests pasando. CLI probado: darkdm descargar httpbin.org/bytes/102400 → 100K descargado exitosamente. Verified: cargo test --lib (19/19 passed), darkdm descargar functional, file downloaded /tmp/darkdm-test/102400 (100K), ./init.sh passes, git push successful (2 commits) Completed: none


2026-06-25 11:15 — DarkDM

Summary: Actualizado progress bar a ILoveCandy style (Pac-Man comiendo dots). Pac-Man (ᗧ/ᗣ) con animación de boca abre/cierra, se mueve left/right bouncing en bordes. Dots (·) representan trabajo restante, espacios = comidos. build_pacman_bar() genera barra animada. pacman_pos tracks posición, pacman_direction controla dirección. Formato: filename 45.2 MiB / 100 MiB 1234 KiB/s 00:38 [ ᗧ··········] 45%. 19 tests pasando. Docs actualizadas (CLI.md, README.md, feature_list, progress). Verified: cargo test --lib (19/19 passed), cargo build --release successful, ./init.sh passes, git push successful Completed: none


2026-06-25 11:09 — DarkDM

Summary: Implementado progress bar estilo pacman de Arch Linux. ProgressBar custom (sin indicatif) con formato: filename 45.2 MiB / 100 MiB 1234 KiB/s 00:38 [####] 100%. Updates cada 100ms, format_size/speed/time con KiB/MiB/GiB. Integrado en DownloadEngine via EngineCallback. CLI darkdm descargar muestra progress bar. Probado con httpbin.org/bytes/10240, archivo descargado exitosamente. 19 tests pasando (+3 progress). Docs actualizadas. Verified: cargo test --lib (19/19 passed), darkdm descargar functional, file downloaded to /tmp/darkdm-test/10240, ./init.sh passes, git push successful (2 commits) Completed: none


2026-06-25 10:57 — DarkDM

Summary: Implementados PieceManager (orchestrator con dynamic splitting), DownloadEngine (coordinator con probe + download), y CLI darkdm con clap (descargar, info). PieceManager: try_create_piece() reintenta fallidos → divide la pieza activa más grande. DownloadEngine: probe() → ProbeResult, download() → multi-thread si resumable. CLI: darkdm info funcional, probado con httpbin.org. 16 tests pasando. Dependencies: clap, indicatif. CLI.md creado con docs completas. Verified: cargo test --lib (16/16 passed), cargo build --bin darkdm successful, darkdm info https://httpbin.org/bytes/1024 functional, ./init.sh passes, git push successful (4 commits) Completed: none


2026-06-25 10:42 — DarkDM

Summary: Implementados 4 módulos core del download engine: piece.rs (AtomicU64 + split dinámico), probe.rs (ProbeResult desde headers), transacted_io.rs (crash-safe 3-file rotation), piece_worker.rs (PieceCallback trait + Accept-Encoding identity). 10 tests pasando. Dependencies: reqwest, tokio, async-trait, futures-util. feat-003 marcado in-progress. Verified: cargo test --lib (10/10 passed), ./init.sh build passes, git push successful (2 commits) Completed: none


2026-06-25 — DarkDM Multi-threaded Download Loop

Summary: Implementado download loop multi-threaded:

  • download_loop() espera a que todos los workers terminen (polling is_complete() cada 100ms)
  • spawn_worker() crea tasks individuales con tokio::spawn
  • EngineCallback auto-spawns nuevos workers en on_piece_complete()
  • on_piece_complete() → try_create_piece() → spawn_worker() (dynamic splitting)
  • Loop continúa hasta manager.is_complete()

EngineCallback:

  • Ahora tiene url + output_path fields
  • Puede spawns workers sin referencia a DownloadEngine
  • Self-contained worker spawning

Flow:

  1. download() crea pieza inicial (0..size)
  2. download_loop() spawns primer worker
  3. Worker descarga → on_piece_complete()
  4. on_piece_complete() → try_create_piece() → spawn_worker()
  5. Repeat hasta is_complete()
  6. Loop exits, progress bar finish()

Tests: 19/19 passing CLI probado: darkdm descargar https://httpbin.org/bytes/102400 → /tmp/darkdm-test/102400 (100K) ✓ Verified: cargo test --lib (19 passed), darkdm descargar functional, file downloaded, ./init.sh passes, git push successful Completed: none Next: Test con servidor que soporte Range para ver multi-threading en acción, plugins


2026-06-25 — DarkDM Engine + CLI + ILoveCandy Progress Bar

Summary: Progress bar ILoveCandy (Pac-Man comiendo dots) añadido:

  • progress.rs: ProgressBar custom (sin indicatif)
  • Formato ILoveCandy: filename 45.2 MiB / 100 MiB 1234 KiB/s 00:38 [ ᗧ··········] 45%
  • Pac-Man (ᗧ/ᗣ) comiendo dots (·), boca abre/cierra, se mueve left/right
  • Updates cada 100ms (evita flickering)
  • format_size/speed/time con KiB/MiB/GiB (como pacman)
  • Integrado en DownloadEngine via EngineCallback
  • on_piece_progress() actualiza bar con total_downloaded
  • on_piece_complete() llama finish() cuando todo completo

CLI:

  • darkdm descargar muestra progress bar
  • Probado: httpbin.org/bytes/10240 → /tmp/darkdm-test/10240 ✓

Tests: 19/19 passing (+3 progress tests) Verified: cargo test --lib (19 passed), darkdm descargar functional, archivo descargado, ./init.sh passes, git push successful Completed: none Next: Multi-threaded download loop (actualmente solo 1 worker), resume, retry, plugins


2026-06-25 — DarkDM Engine + CLI Complete

Summary: Engine completo + CLI funcional:

  • piece_manager.rs: PieceManager orchestrator con try_create_piece() (retry failed → split largest)
  • download_engine.rs: DownloadEngine coordinator (probe, download, spawn workers, EngineCallback)
  • bin/darkdm.rs: CLI con clap (descargar, info subcommands)

PieceManager:

  • Dynamic splitting: busca pieza activa más grande con remaining >= 512KB
  • Retry failed pieces primero antes de crear nuevas
  • Max active workers (default 8)
  • Tests: init, split, no_split_too_small, max_active, retry_failed

DownloadEngine:

  • probe() → ProbeResult (filename, size, resumable)
  • download() → multi-thread si resumable, single-thread fallback
  • EngineCallback implements PieceCallback (on_piece_complete → try_create_piece)
  • Tests: probe con httpbin.org

CLI darkdm:

  • darkdm descargar [--output DIR] [--threads N] [--no-resume]
  • darkdm info (probe sin descargar)
  • Emoji output, clap derive
  • Probado: darkdm info https://httpbin.org/bytes/1024

Dependencies: reqwest, tokio, async-trait, futures-util, url, urlencoding, clap 4.5, indicatif 0.17 Tests: 16/16 passing Verified: cargo test --lib (16 passed), cargo build --bin darkdm, darkdm info functional, ./init.sh passes, git push successful Completed: none Next: Wire multi-threaded download loop, progress bars (indicatif), plugins (MediaFire, YouTube)


2026-06-25 — DarkDM Engine Core Primitives

Summary: Implementados los 4 módulos core del download engine en Rust:

  • piece.rs: Piece con AtomicU64 + split() dinámico (min 512KB)
  • probe.rs: ProbeResult desde headers HTTP (size, resumable, filename, Content-Disposition parsing)
  • transacted_io.rs: Crash-safe state con rotación 3-file (state.1 ← state.2 ← tmp) + END marker
  • stages/piece_worker.rs: PieceWorker + PieceCallback trait (IoC) con Accept-Encoding: identity

Dependencies: reqwest 0.12, tokio, async-trait, futures-util, url, urlencoding Tests: 10/10 passing (piece, probe, transacted_io, piece_worker) Verified: cargo test --lib (10 passed), ./init.sh build passes, git push successful Completed: none Next: PieceManager orchestrator, download_engine.rs, CLI binary con clap


2026-06-24 23:04 — DarkDM

Summary: Spec actualizado con 12 algoritmos portados de XDM: dynamic piece-splitting, ContinueAdjacentPiece, TransactedIO, Accept-Encoding identity, ProbeResult, PieceCallback trait, text redirect, session expiry, disk space check, speed limiter, auto-rename, HLS byte-range. Spec ahora tiene 2725 líneas. Pusheado a GitHub. Verified: git push exitoso, wc -l = 2725 Completed: none


2026-06-24 22:57 — DarkDM

Summary: Analizó XDM codebase (860 archivos, 346 C#). Identificó 12 algoritmos portables a Rust: dynamic piece-splitting, ContinueAdjacentPiece, TransactedIO, Accept-Encoding identity, ProbeResult, PieceCallback trait, text redirect, session expiry, disk space check, HLS byte-range, scheduler. El spec actual tiene el segmented downloader estático y debe actualizarse a work-stealing dinámico. Verified: Análisis completo del repo clonado en /tmp/opencode/xdm Completed: none


2026-06-24 19:36 — DarkDM

Summary: Completado spec CLI nativo Rust + docs + push. README actualizado, feature_list.json marcado feat-002 completo, 11 commits pusheados. Proyecto listo para Fase 3 (implementación engine Rust). Verified: init.sh build passes, git status clean, push successful Completed: none


2026-06-24 — DarkDM Spec Completion

Summary: Spec del CLI nativo Rust completado (2000+ líneas, 8 patrones de diseño).

  • Pipeline Pattern (Chain of Responsibility)
  • State Machine (12 estados, transiciones explícitas)
  • Plugin Registry (SiteExtractor trait con prioridad)
  • Event System (broadcast channel → terminal + GUI)
  • Retry with Exponential Backoff (5 intentos, 1s→16s + jitter)
  • Segmented Download (multi-hilo como IDM)
  • Queue Manager (FIFO con límite de concurrentes)
  • File Layout (30+ archivos organizados)

README actualizado reflejando: bash scripts funcionales, spec completado, roadmap futuro.

Verified: init.sh build passes Completed: feat-001 (darkdm-mediafire bash), feat-002 (native-cli spec) Next: feat-003 (Native Rust CLI Implementation)

2026-06-24 18:58 — DarkDM

Summary: Completado spec nativo Rust CLI para DarkDM: design.md, tasks.md, proposal.md en openspec. Engine compartido reqwest+scraper+clap entre CLI y Tauri app. Reemplazará scripts bash actuales. Verified: init.sh build passes, all spec files committed Completed: none

2026-06-23 11:49 — DarkDM

Summary: Fixed darkdm-mediafire script: added --compressed to curl (fixes gzip binary issue), added --get-link flag to extract direct URL without downloading, improved regex patterns for current MediaFire HTML structure Verified: --get-link flag tested successfully against live MediaFire URL, init.sh build passes Completed: none