algocline_core/execution/mod.rs
1//! Pure execution service layer for `algocline-core`.
2//!
3//! This module provides the [`ExecutionService`] trait and all associated value types
4//! for the new service layer design. It coexists with the legacy types in
5//! `crate::state` and `crate::engine_api` without modifying them (parallel evolution).
6//!
7//! ## Module structure
8//!
9//! | Module | Key types |
10//! |--------|-----------|
11//! | [`session_id`] | [`SessionId`] |
12//! | [`spec`] | [`SessionSpec`], [`SpecKind`], [`ScenarioRef`] |
13//! | [`state`] | [`ExecutionState`] (v2), [`ExecutionStateTag`], [`ExecutionResult`] |
14//! | [`pause`] | [`PauseInfo`], [`PauseKind`], [`PausePrompt`] |
15//! | [`resume`] | [`ResumePayload`], [`QueryResponse`], [`ResumeOutcome`], [`TerminalOutcome`] |
16//! | [`cancel`] | [`CancelReason`], [`CancelCode`], [`CancelInfo`], [`FailureInfo`], [`FailureKind`] |
17//! | [`progress`] | [`ProgressEvent`], [`ObserverHandle`] |
18//! | [`error`] | [`SpawnError`], [`StateError`], [`ResumeError`], [`CancelError`], [`ObserveError`], [`AwaitError`], [`ObserverRecvError`] |
19//! | [`service`] | [`ExecutionService`] |
20//!
21//! ## Access path
22//!
23//! Types in this module are accessed as `algocline_core::execution::Foo`.
24//! They are **not** re-exported at the top level of `algocline_core` to avoid
25//! naming conflicts with legacy top-level types (e.g., `QueryResponse`).
26
27pub mod cancel;
28pub mod error;
29pub mod pause;
30pub mod progress;
31pub mod resume;
32pub mod service;
33pub mod session_id;
34pub mod spec;
35pub mod state;
36
37// Re-export all public items for convenient access via `algocline_core::execution::*`.
38pub use cancel::{CancelCode, CancelInfo, CancelReason, FailureInfo, FailureKind};
39pub use error::{
40 AwaitError, CancelError, ObserveError, ObserverRecvError, ResumeError, SpawnError, StateError,
41};
42pub use pause::{PauseInfo, PauseKind, PausePrompt};
43pub use progress::{ObserverHandle, ProgressEvent};
44pub use resume::{QueryResponse, ResumeOutcome, ResumePayload, TerminalOutcome};
45pub use service::ExecutionService;
46pub use session_id::SessionId;
47pub use spec::{ScenarioRef, SessionSpec, SpecKind};
48pub use state::{ExecutionResult, ExecutionState, ExecutionStateTag};
49
50// Re-export TokenUsage into this namespace so engine-layer code can use
51// `algocline_core::execution::TokenUsage` without a separate import.
52pub use crate::TokenUsage;