diff --git a/crates/desktop/artcraft/src/core/tasks/frontend_subscriber_id.rs b/crates/desktop/artcraft/src/core/tasks/frontend_subscriber_id.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/crates/desktop/artcraft/src/core/tasks/frontend_subscriber_payload.rs b/crates/desktop/artcraft/src/core/tasks/frontend_subscriber_payload.rs deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/crates/desktop/artcraft/src/core/tasks/mod.rs b/crates/desktop/artcraft/src/core/tasks/mod.rs deleted file mode 100644 index 17c97ab531..0000000000 --- a/crates/desktop/artcraft/src/core/tasks/mod.rs +++ /dev/null @@ -1,10 +0,0 @@ -pub mod frontend_subscriber_id; -pub mod frontend_subscriber_payload; -pub mod task_provider; -pub mod task; -pub mod task_id; -pub mod task_pool; -pub mod task_type; -mod task_provider_job_id; -mod task_state; -pub mod task_database; \ No newline at end of file diff --git a/crates/desktop/artcraft/src/core/tasks/task.rs b/crates/desktop/artcraft/src/core/tasks/task.rs deleted file mode 100644 index 98220451ae..0000000000 --- a/crates/desktop/artcraft/src/core/tasks/task.rs +++ /dev/null @@ -1,42 +0,0 @@ -use multi_index_map::MultiIndexMap; -use crate::core::tasks::task_id::TaskId; -use crate::core::tasks::task_provider::TaskProvider; -use crate::core::tasks::task_provider_job_id::TaskProviderJobId; -use crate::core::tasks::task_state::TaskState; -use crate::core::tasks::task_type::TaskType; - -/// The provider's native identifier for the task. -pub type ProviderTaskId = String; - -#[derive(MultiIndexMap, Debug, Clone)] -#[multi_index_derive(Debug)] -#[multi_index_hash(rustc_hash::FxBuildHasher)] -pub struct Task { - #[multi_index(hashed_unique)] - pub id: TaskId, - - #[multi_index(hashed_non_unique)] - pub task_state: TaskState, - - pub task_type: Option, - - #[multi_index(hashed_non_unique)] - pub provider: Option, - - /// Identifier used by the provider to track the job. - #[multi_index(hashed_unique)] - pub provider_job_id: Option, - - /// If the frontend is subscribing, it might have an identifier - pub frontend_subscriber_id: Option, - - /// If the frontend is subscribing, it might have a payload. - /// This is opaque, but could be for instance base64-encoded JSON. - pub frontend_subscriber_payload: Option, - - // TODO: Submitted and completion datetimes - - // TODO: Progress - - // TODO: Completion media file, completion batch token -} diff --git a/crates/desktop/artcraft/src/core/tasks/task_database.rs b/crates/desktop/artcraft/src/core/tasks/task_database.rs deleted file mode 100644 index 09b3fa517e..0000000000 --- a/crates/desktop/artcraft/src/core/tasks/task_database.rs +++ /dev/null @@ -1,21 +0,0 @@ - -pub struct TaskDatabase { - pub pool: Pool, -} - -impl Database { - pub async fn new(app_handle: &AppHandle) -> Result { - let app_dir = app_handle - .path_resolver() - .app_data_dir() - .expect("failed to get app dir"); - - // Ensure the app directory exists - fs::create_dir_all(&app_dir)?; - - let db_path = app_dir.join("grid_search.db"); - - // Set the DATABASE_URL environment variable to point to this SQLite file - env::set_var("DATABASE_URL", format!("sqlite://{}", db_path.display())); - } -} \ No newline at end of file diff --git a/crates/desktop/artcraft/src/core/tasks/task_id.rs b/crates/desktop/artcraft/src/core/tasks/task_id.rs deleted file mode 100644 index 5ff2d3cbb6..0000000000 --- a/crates/desktop/artcraft/src/core/tasks/task_id.rs +++ /dev/null @@ -1,25 +0,0 @@ -use idempotency::uuid::generate_random_uuid; - -/// Our identifier for tasks. -/// These are ephemeral (for now), but may be peristed later on. -#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] -pub struct TaskId(String); - -impl TaskId { - pub fn generate() -> Self { - let task_id = format!("tauri_task_{}", generate_random_uuid()); - Self(task_id) - } - - pub fn from_str(task_id: &str) -> Self { - Self(task_id.to_string()) - } - - pub fn to_string(&self) -> String { - self.0.clone() - } - - pub fn as_str(&self) -> &str { - self.0.as_str() - } -} diff --git a/crates/desktop/artcraft/src/core/tasks/task_pool.rs b/crates/desktop/artcraft/src/core/tasks/task_pool.rs deleted file mode 100644 index d2890a5c77..0000000000 --- a/crates/desktop/artcraft/src/core/tasks/task_pool.rs +++ /dev/null @@ -1,7 +0,0 @@ - -/// Hand-rolling this instead of SQLite for now. -/// Not sure if SQLite will create crazy build issues. -/// Can replace with SQLite later, perhaps. -pub struct TaskPool { - -} \ No newline at end of file diff --git a/crates/desktop/artcraft/src/core/tasks/task_provider.rs b/crates/desktop/artcraft/src/core/tasks/task_provider.rs deleted file mode 100644 index 0636f9ee4c..0000000000 --- a/crates/desktop/artcraft/src/core/tasks/task_provider.rs +++ /dev/null @@ -1,8 +0,0 @@ - - -#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] -pub enum TaskProvider { - Artcraft, - Fal, - Sora, -} \ No newline at end of file diff --git a/crates/desktop/artcraft/src/core/tasks/task_provider_job_id.rs b/crates/desktop/artcraft/src/core/tasks/task_provider_job_id.rs deleted file mode 100644 index c4a1d1b44d..0000000000 --- a/crates/desktop/artcraft/src/core/tasks/task_provider_job_id.rs +++ /dev/null @@ -1,22 +0,0 @@ -use tokens::tokens::generic_inference_jobs::InferenceJobToken; - -#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] -pub struct TaskProviderJobId(String); - -impl TaskProviderJobId { - pub fn from_str(job_id: &str) -> Self { - Self(job_id.to_string()) - } - - pub fn from_artcraft_job_id(job_id: InferenceJobToken) -> Self { - Self(job_id.to_string()) - } - - pub fn to_string(&self) -> String { - self.0.clone() - } - - pub fn as_str(&self) -> &str { - self.0.as_str() - } -} diff --git a/crates/desktop/artcraft/src/core/tasks/task_state.rs b/crates/desktop/artcraft/src/core/tasks/task_state.rs deleted file mode 100644 index 98cfcb6418..0000000000 --- a/crates/desktop/artcraft/src/core/tasks/task_state.rs +++ /dev/null @@ -1,11 +0,0 @@ - -#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] -pub enum TaskState { - Submitted, - InProgress, - - // Terminal states - - Complete, - Failed, -} \ No newline at end of file diff --git a/crates/desktop/artcraft/src/core/tasks/task_type.rs b/crates/desktop/artcraft/src/core/tasks/task_type.rs deleted file mode 100644 index 3a4ef2d449..0000000000 --- a/crates/desktop/artcraft/src/core/tasks/task_type.rs +++ /dev/null @@ -1,7 +0,0 @@ - -#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] -pub enum TaskType { - BackgroundRemoval, - ImageGeneration, - VideoGeneration, -} \ No newline at end of file diff --git a/crates/desktop/artcraft/src/core/utils/best_window_size_heuristic.rs b/crates/desktop/artcraft/src/core/utils/best_window_size_heuristic.rs index 4c69b92a01..0c3b7e2ac9 100644 --- a/crates/desktop/artcraft/src/core/utils/best_window_size_heuristic.rs +++ b/crates/desktop/artcraft/src/core/utils/best_window_size_heuristic.rs @@ -13,7 +13,7 @@ pub fn best_window_size_heuristic(window: &Window) -> AnyhowResult HEIGHT_DIFFERENCE_THRESHOLD { // Dev tools are open, use the outer size