port habitica integration from JS to Rust

The old JS ppc repo had a working habitica integration. This ports all
that functionality into the new Rust-based marts package so it can run
natively without the Deno/JS runtime dependency.

Changes:
- habitica.rs: make api_request public, add get_tasks() and delete_task()
  convenience methods, register config opts
- c2vi/mod.rs: full rewrite implementing all 9 CLI commands (bed,
  clearTodos, listTodos, buyHealthPotion, addActionItems, skip, dumpLog,
  listDailies, printTask) with SQLite persistence via rusqlite
- lib.rs: wire c2vi module into marts exports
- ppc main.rs: register c2vi part at startup
- Cargo.toml: add rusqlite dependency with bundled feature

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Raphael 'kena' Poss
2026-03-09 14:22:08 +01:00
parent 0dc09e7618
commit d7a0780095
6 changed files with 610 additions and 168 deletions

View File

@@ -17,10 +17,11 @@ chrono = "0.4.44"
reqwest = { version = "0.13.2", features = ["blocking", "json"] }
serde = "1.0.228"
serde_json = "1.0.149"
rusqlite = { version = "0.31", features = ["bundled"], optional = true }
[features]
default = ["target-os"]
target-os = [ "clap", "mize/target-os", "deno_core", "rustyscript" ]
target-os = [ "clap", "mize/target-os", "deno_core", "rustyscript", "rusqlite" ]
target-wasm = [ "mize/target-wasm" ]
clap = ["dep:clap"]