diff --git a/Cargo.lock b/Cargo.lock index 9f1ff5f8..d2301709 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3466,6 +3466,22 @@ dependencies = [ "windows 0.62.2", ] +[[package]] +name = "komorebi-protocol" +version = "0.1.42" +dependencies = [ + "clap", + "color-eyre", + "dirs 6.0.0", + "komorebi-layouts", + "komorebi-themes", + "schemars 1.2.3", + "serde", + "serde_json_lenient", + "serde_with", + "strum", +] + [[package]] name = "komorebi-scrolling" version = "0.1.42" diff --git a/Cargo.toml b/Cargo.toml index 8b68f258..1cd60e8c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,6 +11,7 @@ members = [ "komorebic-no-console", "komorebi-bar", "komorebi-themes", + "crates/komorebi-protocol", "komorebi-shortcuts", "e2e/guest/agent", "e2e/guest/testwin", diff --git a/crates/komorebi-protocol/Cargo.toml b/crates/komorebi-protocol/Cargo.toml new file mode 100644 index 00000000..4e50b722 --- /dev/null +++ b/crates/komorebi-protocol/Cargo.toml @@ -0,0 +1,27 @@ +[package] +name = "komorebi-protocol" +version = "0.1.42" +edition = "2024" +description = "The wire types shared by every komorebi daemon and client: SocketMessage and its payloads" + +[dependencies] +komorebi-layouts = { path = "../../komorebi-layouts" } +komorebi-themes = { path = "../../komorebi-themes" } + +clap = { workspace = true } +color-eyre = { workspace = true } +dirs = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +serde_with = { version = "3.12", features = ["schemars_1"] } +strum = { workspace = true } + +# Optional dependencies +schemars = { workspace = true, optional = true } + +[dev-dependencies] +schemars = { workspace = true } + +[features] +default = ["schemars"] +schemars = ["dep:schemars", "komorebi-layouts/schemars", "komorebi-themes/schemars"] diff --git a/crates/komorebi-protocol/src/animation.rs b/crates/komorebi-protocol/src/animation.rs new file mode 100644 index 00000000..b548f4f1 --- /dev/null +++ b/crates/komorebi-protocol/src/animation.rs @@ -0,0 +1 @@ +//! Placeholder: filled in by a later step 2 revision. diff --git a/crates/komorebi-protocol/src/lib.rs b/crates/komorebi-protocol/src/lib.rs new file mode 100644 index 00000000..4299c9ad --- /dev/null +++ b/crates/komorebi-protocol/src/lib.rs @@ -0,0 +1,14 @@ +//! The wire types shared by every komorebi daemon and client. +//! +//! The crate holds no platform code: `SocketMessage` and the payload types it carries, +//! the support table that says which platform handles which message, and the small +//! leaf modules (`animation`, `pathext`) those payloads depend on. The socket +//! transport is not part of it. +#![warn(clippy::all)] +#![allow(clippy::missing_errors_doc, clippy::use_self, clippy::doc_markdown)] + +pub mod animation; +pub mod message; +pub mod pathext; +pub mod platforms; +pub mod types; diff --git a/crates/komorebi-protocol/src/message.rs b/crates/komorebi-protocol/src/message.rs new file mode 100644 index 00000000..b548f4f1 --- /dev/null +++ b/crates/komorebi-protocol/src/message.rs @@ -0,0 +1 @@ +//! Placeholder: filled in by a later step 2 revision. diff --git a/crates/komorebi-protocol/src/pathext.rs b/crates/komorebi-protocol/src/pathext.rs new file mode 100644 index 00000000..b548f4f1 --- /dev/null +++ b/crates/komorebi-protocol/src/pathext.rs @@ -0,0 +1 @@ +//! Placeholder: filled in by a later step 2 revision. diff --git a/crates/komorebi-protocol/src/platforms.rs b/crates/komorebi-protocol/src/platforms.rs new file mode 100644 index 00000000..b548f4f1 --- /dev/null +++ b/crates/komorebi-protocol/src/platforms.rs @@ -0,0 +1 @@ +//! Placeholder: filled in by a later step 2 revision. diff --git a/crates/komorebi-protocol/src/types.rs b/crates/komorebi-protocol/src/types.rs new file mode 100644 index 00000000..b548f4f1 --- /dev/null +++ b/crates/komorebi-protocol/src/types.rs @@ -0,0 +1 @@ +//! Placeholder: filled in by a later step 2 revision.