Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 70 additions & 2 deletions src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ tauri-plugin-opener = "2"
tauri-plugin-log = { version = "2", features = ["colored"] }
tauri-plugin-updater = "2"
tauri-plugin-process = "2"
# Desktop notifications fired by the background scheduler (PR F2) when an
# auto-publish exhausts its retry budget. Already a transitive dep via
# the Tauri plugin tree, declared explicitly so the scheduler module can
# import `NotificationExt` directly.
tauri-plugin-notification = "2"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
dirs = "5"
Expand Down Expand Up @@ -50,6 +55,11 @@ regex = "1"
# macOS Keychain, Linux Secret Service (gnome-keyring / KWallet).
# Replaces the previous plain-text api_keys.json. ADR-009 documents the choice.
keyring = { version = "3", features = ["apple-native", "windows-native", "sync-secret-service"] }
# Async trait dispatch for the scheduler's PublishDispatcher seam — lets
# tick() be tested with a mock without standing up a real AppHandle.
# Already a transitive dep via sqlx; declared explicitly to make the
# scheduler's intent visible.
async-trait = "0.1"

[dev-dependencies]
# HTTP mock server for testing publish_post / publish_linkedin_post without
Expand Down
3 changes: 2 additions & 1 deletion src-tauri/capabilities/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"opener:allow-reveal-item-in-dir",
"log:default",
"updater:default",
"process:allow-restart"
"process:allow-restart",
"notification:default"
]
}
10 changes: 10 additions & 0 deletions src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ mod db;
mod log_redact;
mod network_rules;
mod openrouter_pricing;
mod scheduler;
mod sidecar;
mod state;
mod token_store;
Expand Down Expand Up @@ -167,6 +168,14 @@ pub fn run() {
}
});

// Scheduler background task (v0.4.0 PR F2). Polls SQLite every
// 60s for due drafts and dispatches them through the existing
// publish commands with the retry/backoff policy enforced by
// `db::scheduler`. Detached — nothing waits on it, failures
// are logged and never propagated to the user-visible setup
// path (a scheduler crash must not block app startup).
scheduler::spawn(app.handle().clone());

// Fire-and-forget OpenRouter pricing refresh on startup. Falls
// back silently to the static `pricing_map` if the user is
// offline; subsequent app opens will pick up live rates the
Expand All @@ -190,6 +199,7 @@ pub fn run() {
.plugin(tauri_plugin_opener::init())
.plugin(tauri_plugin_updater::Builder::new().build())
.plugin(tauri_plugin_process::init())
.plugin(tauri_plugin_notification::init())
.invoke_handler(tauri::generate_handler![
// AI
commands::ai::generate_content,
Expand Down
Loading
Loading