#[cfg(target_arch = "wasm32")]
pub mod tokio {
pub use tokio_with_wasm::alias::*;
}
pub mod ephemeral;
pub(crate) mod generated;
pub mod staged_registry;
pub(crate) mod turn_admission;
#[cfg(feature = "session-compaction")]
pub mod compactor;
#[cfg(all(feature = "session-store", not(target_arch = "wasm32")))]
pub mod event_store;
#[cfg(all(feature = "session-store", not(target_arch = "wasm32")))]
pub mod persistent;
#[cfg(all(feature = "session-store", not(target_arch = "wasm32")))]
pub mod projector;
pub use ephemeral::{
EphemeralSessionService, RuntimeContextAdmissionGuard, SessionAgent, SessionAgentBuilder,
SessionSnapshot,
};
pub use staged_registry::{AdmissionOutcome, MaterializationStatus, StagedSessionRegistry};
pub const SESSION_LABELS_KEY: &str = "session_labels";
pub type BroadcastEventReceiver =
tokio::sync::broadcast::Receiver<meerkat_core::EventEnvelope<meerkat_core::AgentEvent>>;
#[cfg(feature = "session-compaction")]
pub use compactor::DefaultCompactor;
#[cfg(all(feature = "session-store", not(target_arch = "wasm32")))]
pub use persistent::{
MachineServiceTurnCommitProtocol, MachineSessionArchiveProtocol, PersistentSessionService,
};
#[cfg(all(feature = "session-store", not(target_arch = "wasm32")))]
inventory::submit! {
meerkat_skills::SkillRegistration {
id: "session-management",
name: "Session Management",
description: "Session persistence, resume patterns, event store replay, compaction tuning",
scope: meerkat_core::skills::SkillScope::Builtin,
requires_capabilities: &["session_store"],
body: include_str!("../skills/session-management/SKILL.md"),
extensions: &[],
}
}
#[cfg(all(feature = "session-store", not(target_arch = "wasm32")))]
inventory::submit! {
meerkat_capabilities::CapabilityRegistration {
id: meerkat_capabilities::CapabilityId::SessionStore,
description: "PersistentSessionService, SessionProjector",
scope: meerkat_capabilities::CapabilityScope::Universal,
requires_feature: Some("session-store"),
prerequisites: &[],
status_resolver: None,
}
}
#[cfg(all(feature = "session-compaction", not(target_arch = "wasm32")))]
inventory::submit! {
meerkat_capabilities::CapabilityRegistration {
id: meerkat_capabilities::CapabilityId::SessionCompaction,
description: "DefaultCompactor: auto-compact at token threshold, LLM summary, history rebuild",
scope: meerkat_capabilities::CapabilityScope::Universal,
requires_feature: Some("session-compaction"),
prerequisites: &[],
status_resolver: None,
}
}
pub(crate) fn control_error_into_session_error(
err: meerkat_core::service::SessionControlError,
) -> meerkat_core::service::SessionError {
match err {
meerkat_core::service::SessionControlError::Session(session_err) => session_err,
other => meerkat_core::service::SessionError::Unsupported(other.to_string()),
}
}