| 1 | //! Core engine module for `DeepSeek` CLI. |
| 2 | //! |
| 3 | //! This module provides the event-driven architecture that separates |
| 4 | //! the UI from the AI interaction logic: |
| 5 | //! |
| 6 | //! - `engine`: The main engine that processes operations |
| 7 | //! - `events`: Events emitted by the engine to the UI |
| 8 | //! - `ops`: Operations submitted by the UI to the engine |
| 9 | //! - `session`: Session state management |
| 10 | //! - `turn`: Turn context and tracking |
| 11 | |
| 12 | // Engine code runs inside the TUI alt-screen — see `runtime_log` for why |
| 13 | // raw stdio prints must not appear here. Use `tracing::*` instead. |
| 14 | #![deny(clippy::print_stdout)] |
| 15 | #![deny(clippy::print_stderr)] |
| 16 | |
| 17 | pub mod authority; |
| 18 | // `crates/core` now owns the engine (issue #5261). The TUI's `engine` |
| 19 | // consumes the core boundary directly so headless and TUI share one |
| 20 | // `Op`-in / `EventMsg`-out API, one `ThreadId`/`SessionId` type, and one |
| 21 | // `Journal` shape. New code should import from `codewhale_core`. |
| 22 | pub mod engine; |
| 23 | pub(crate) use engine::tool_catalog::allowlist_is_native_file_and_shell_only; |
| 24 | pub mod events; |
| 25 | // The first production consumer of the staged runtime contract is the |
| 26 | // provider-neutral model boundary. Keep the remaining contract files staged |
| 27 | // until their own consumers land instead of compiling dead scaffolding. |
| 28 | #[path = "runtime_contract/model.rs"] |
| 29 | pub mod model_client; |
| 30 | pub mod ops; |
| 31 | // Phase A1 of the core/protocol extraction: exhaustive projections of the |
| 32 | // engine's `Op` / `Event` onto `codewhale_protocol::{op::Op, EventMsg}`. |
| 33 | // A new engine variant without a protocol twin fails to compile there. |
| 34 | pub mod protocol_parity; |
| 35 | pub mod session; |
| 36 | #[path = "runtime_contract/termination.rs"] |
| 37 | pub mod termination; |
| 38 | // Moved to `codewhale_core::tool_parser` (zero crate-internal dependencies); |
| 39 | // re-exported so `crate::core::tool_parser` keeps working. |
| 40 | pub use codewhale_core::tool_parser; |
| 41 | pub mod turn; |
| 42 | |
| 43 | // Re-exports |
| 44 |