diff --git a/Cargo.lock b/Cargo.lock index 83f349ba..b234052b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -504,6 +504,16 @@ dependencies = [ "uuid", ] +[[package]] +name = "cc-types" +version = "0.1.0" +dependencies = [ + "chrono", + "serde", + "serde_json", + "uuid", +] + [[package]] name = "cfg-if" version = "1.0.4" @@ -584,6 +594,7 @@ dependencies = [ "bytes", "cc-keybindings", "cc-observability", + "cc-types", "chrono", "clap", "crossterm", diff --git a/Cargo.toml b/Cargo.toml index 249545fa..e4dd6866 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -122,6 +122,7 @@ parking_lot = "0.12" # 内部 crates (workspace split) cc-keybindings = { path = "crates/cc-keybindings" } cc-observability = { path = "crates/cc-observability" } +cc-types = { path = "crates/cc-types" } # Daemon HTTP server axum = { version = "0.8", features = ["ws"] } diff --git a/crates/cc-types/Cargo.toml b/crates/cc-types/Cargo.toml new file mode 100644 index 00000000..2d2f54b2 --- /dev/null +++ b/crates/cc-types/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "cc-types" +version = "0.1.0" +edition = "2021" +description = "Pure leaf types for cc-rust: message, state, transitions (no runtime deps on root crate)" + +[dependencies] +serde = { workspace = true } +serde_json = { workspace = true } +uuid = { workspace = true } +chrono = { workspace = true } diff --git a/crates/cc-types/src/lib.rs b/crates/cc-types/src/lib.rs new file mode 100644 index 00000000..37f5acf0 --- /dev/null +++ b/crates/cc-types/src/lib.rs @@ -0,0 +1,12 @@ +//! Pure leaf types extracted from `claude-code-rs::types`. +//! +//! This crate holds the subset of `src/types/` with no cross-module dependencies +//! on the main crate (teams / ui / config / ipc). The three modules below are +//! the truly pure leaves; `app_state`, `tool`, and `config` remain in the root +//! crate because they still reach into the not-yet-extracted subsystems. +//! +//! See issue #70 (`[workspace-split] Phase 1`) for the rationale behind this +//! partial split. +pub mod message; +pub mod state; +pub mod transitions; diff --git a/crates/claude-code-rs/src/types/message.rs b/crates/cc-types/src/message.rs similarity index 100% rename from crates/claude-code-rs/src/types/message.rs rename to crates/cc-types/src/message.rs diff --git a/crates/claude-code-rs/src/types/state.rs b/crates/cc-types/src/state.rs similarity index 100% rename from crates/claude-code-rs/src/types/state.rs rename to crates/cc-types/src/state.rs diff --git a/crates/claude-code-rs/src/types/transitions.rs b/crates/cc-types/src/transitions.rs similarity index 100% rename from crates/claude-code-rs/src/types/transitions.rs rename to crates/cc-types/src/transitions.rs diff --git a/crates/claude-code-rs/Cargo.toml b/crates/claude-code-rs/Cargo.toml index 6e02621d..f022887a 100644 --- a/crates/claude-code-rs/Cargo.toml +++ b/crates/claude-code-rs/Cargo.toml @@ -134,6 +134,7 @@ parking_lot = { workspace = true } # 内部 workspace crates (P1) cc-keybindings = { workspace = true } cc-observability = { workspace = true } +cc-types = { workspace = true } # Daemon axum = { workspace = true } diff --git a/crates/claude-code-rs/src/types/mod.rs b/crates/claude-code-rs/src/types/mod.rs index 147d1755..203cf538 100644 --- a/crates/claude-code-rs/src/types/mod.rs +++ b/crates/claude-code-rs/src/types/mod.rs @@ -1,6 +1,13 @@ +// `message`, `state`, `transitions` now live in the `cc-types` workspace crate +// (issue #70 — Phase 1 leaf extraction). Re-export them here so existing +// `crate::types::message::*` paths keep resolving across the ~100 call sites +// in this crate. +// +// `app_state`, `tool`, and `config` still depend on teams / ui / config / ipc +// and stay local to the root crate until those subsystems move out. Once they +// do, this file can collapse to a single `pub use cc_types::*;`. +pub use cc_types::{message, state, transitions}; + pub mod app_state; pub mod config; -pub mod message; -pub mod state; pub mod tool; -pub mod transitions;